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 |
|---|---|---|---|---|---|---|---|
from Products.validation.interfaces import ivalidator
from Products.validation import validation
from Products.validation.validators.RegexValidator import RegexValidator
from Products.plonehrm import PloneHrmMessageFactory as _
from zope.i18n import translate
class MaxDaysPerWeek:
__implements__ = (ivalidator,)
... | ajibawa-2023/Python-Code-Large/train/row_3920 | 18 | 31 | 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_3920:ImportFrom_L1_C0", "label": "from Products.validation.interfaces import ivalidator", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0323, 0.0323, 0, 0.66, 0.0, 842, 0, 1, 0, 0, 842, 0, 0], "semantic": {"name": "Products.validation.i... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3920:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3920:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3920:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3920:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
__author__ = """Jean-Paul Ladage <j.ladage@zestsoftware.nl>"""
__docformat__ = 'plaintext'
PROJECTNAME = "plonehrm.contracts"
product_globals = globals()
| ajibawa-2023/Python-Code-Large/train/row_3921 | 4 | 5 | 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_3921:Assign_L1_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.2, 0.2, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_na... | [] |
import logging
from zope.component import queryMultiAdapter
from Products.CMFCore.utils import getToolByName
logger = logging.getLogger('plonehrm.contracts.events')
def apply_template(object, event, rename=True):
"""After initializing a contract, set text and title based on template.
If rename is True (the... | ajibawa-2023/Python-Code-Large/train/row_3922 | 35 | 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_3922:Import_L1_C0", "label": "logging import logging", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0159, 0.0159, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "logging", "arg_names": [], "import_names": ["logging"], ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3922:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3922:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3922:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3922:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
from zope.interface import Interface
from zope.component import adapts
from zope.formlib.form import FormFields
from zope.interface import implements
from zope.schema import Bool
from zope.schema import Int
from plone.app.controlpanel.form import ControlPanelForm
from Products.CMFCore.utils import getToolByName
from P... | ajibawa-2023/Python-Code-Large/train/row_3924 | 83 | 192 | 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_3924:ImportFrom_L1_C0", "label": "from zope.interface import Interface", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0052, 0.0052, 0, 0.66, 0.0, 443, 0, 1, 0, 0, 443, 0, 0], "semantic": {"name": "zope.interface", "arg_names": [], "imp... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3924:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3924:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3924:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3924:Assign_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
import logging
from zope.component import queryMultiAdapter
from zope.i18n import translate
from Products.CMFCore.utils import getToolByName
from zope.event import notify
from Products.Archetypes.event import ObjectInitializedEvent
from Acquisition import aq_parent
from Products.plonehrm import utils
from Products.pl... | ajibawa-2023/Python-Code-Large/train/row_3925 | 282 | 573 | 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_3925:Import_L1_C0", "label": "logging import logging", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0017, 0.0017, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "logging", "arg_names": [], "import_names": ["logging"], ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3925:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3925:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3925:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3925:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
import cStringIO
from Acquisition import Explicit
from zope.i18n import translate
from zope.interface import implements
from zope.viewlet.interfaces import IViewlet
from Products.Five import BrowserView
from datetime import date
from Acquisition import aq_chain, aq_parent
from Products.CMFCore.utils import getToolByNa... | ajibawa-2023/Python-Code-Large/train/row_3926 | 122 | 222 | 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_3926:Import_L1_C0", "label": "cStringIO import cStringIO", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0045, 0.0045, 0, 0.66, 0.0, 764, 0, 1, 0, 0, 764, 0, 0], "semantic": {"name": "cStringIO", "arg_names": [], "import_names": ["cStri... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3926:Try_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3926:ImportFrom_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3926:Try_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3926:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
from kss.core import kssaction, KSSView
from zope.event import notify
from Products.Archetypes.event import ObjectInitializedEvent
from Products.Archetypes.config import RENAME_AFTER_CREATION_ATTEMPTS
from Products.CMFCore import utils as cmfutils
from Acquisition import aq_inner
from Products.plonehrm import PloneHrm... | ajibawa-2023/Python-Code-Large/train/row_3927 | 70 | 151 | 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_3927:ImportFrom_L1_C0", "label": "from kss.core import kssaction, KSSView", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0066, 0.0066, 0, 0.66, 0.0, 653, 0, 2, 0, 0, 653, 0, 0], "semantic": {"name": "kss.core", "arg_names": [], "import... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3927:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3927:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3927:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3927:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Larg... |
from datetime import date
from datetime import timedelta
from DateTime import DateTime
import logging
from Acquisition import Explicit
from Products.CMFCore.utils import getToolByName
from Products.Five.browser.pagetemplatefile import ZopeTwoPageTemplateFile
from zope.component import getMultiAdapter
from zope.viewlet... | ajibawa-2023/Python-Code-Large/train/row_3928 | 265 | 540 | 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_3928:ImportFrom_L1_C0", "label": "from datetime import date", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0019, 0.0019, 0, 0.66, 0.0, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "datetime", "arg_names": [], "import_names": ["dat... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3928:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3928:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3928:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_3928:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code... |
from zope.interface import implements
from plone.app.contentmenu.menu import WorkflowMenu
from plone.app.contentmenu.interfaces import IWorkflowMenu
class PloneHrmWorkflowMenu(WorkflowMenu):
""" Overrides the Plone default class to display workflow menus in
order to hide them in the absence view.
"""
i... | ajibawa-2023/Python-Code-Large/train/row_3929 | 10 | 15 | 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_3929:ImportFrom_L1_C0", "label": "from zope.interface import implements", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0667, 0.0667, 0, 0.66, 0.0, 443, 0, 1, 0, 0, 443, 0, 0], "semantic": {"name": "zope.interface", "arg_names": [], "im... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3929:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3929:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3929:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3929:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row... |
from zope.interface import implements
from zope.i18n import translate
from zope.formlib import form
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from Acquisition import aq_inner, aq_parent, aq_chain
from DateTime import DateTime
from Products.Five import BrowserView
from Products.CMFPlone.uti... | ajibawa-2023/Python-Code-Large/train/row_3930 | 226 | 432 | 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_3930:ImportFrom_L1_C0", "label": "from zope.interface import implements", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0023, 0.0023, 0, 0.66, 0.0, 443, 0, 1, 0, 0, 443, 0, 0], "semantic": {"name": "zope.interface", "arg_names": [], "im... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3930:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3930:Expr_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3930:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3930:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
import cStringIO
import codecs
import csv
class UnicodeWriter:
"""
A CSV writer which will write rows to CSV file "f",
which is encoded in the given encoding.
MvL modified the original version from the Python documentation
since that version use codecs.getincrementalencoder which is
introduce... | ajibawa-2023/Python-Code-Large/train/row_3931 | 42 | 74 | 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_3931:Import_L1_C0", "label": "cStringIO import cStringIO", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0135, 0.0135, 0, 0.66, 0.0, 764, 0, 1, 0, 0, 764, 0, 0], "semantic": {"name": "cStringIO", "arg_names": [], "import_names": ["cStri... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3931:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3931:Expr_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3931:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3931:FunctionDef_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
from zope.interface import Interface, Attribute
from zope.viewlet.interfaces import IViewletManager
from plone.portlets.interfaces import IPortletDataProvider
class IEmployeeView(Interface):
def extraItems():
""" Return all non hrm specific items
"""
class IWorkLocationView(Interface):
def... | ajibawa-2023/Python-Code-Large/train/row_3932 | 30 | 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_3932:ImportFrom_L1_C0", "label": "from zope.interface import Interface, Attribute", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0161, 0.0161, 0, 0.66, 0.0, 443, 0, 2, 0, 0, 443, 0, 0], "semantic": {"name": "zope.interface", "arg_names... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3932:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3932:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3932:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_3932:Expr_L9_C8"}, {"f": "ajibawa-2023/Python-Code-Large... |
import csv
from Products.Five import BrowserView
from zope.i18n import translate
from zope.event import notify
from Products.Archetypes.event import ObjectInitializedEvent
from Products.CMFPlone.utils import safe_unicode
from Acquisition import aq_inner
from Products.plonehrm.content.employee import Employee, Employe... | ajibawa-2023/Python-Code-Large/train/row_3933 | 76 | 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_3933:Import_L1_C0", "label": "csv import csv", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0074, 0.0074, 0, 0.66, 0.0, 312, 0, 1, 0, 0, 312, 0, 0], "semantic": {"name": "csv", "arg_names": [], "import_names": ["csv"], "rhs_call_name":... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3933:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3933:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3933:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_3933:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-Code... |
from DateTime import DateTime
from Acquisition import aq_inner, aq_parent, aq_chain
from Products.CMFCore.utils import getToolByName
from Products.Five import BrowserView
from zope.i18n import translate
from zope.component import getMultiAdapter
from zope.viewlet.interfaces import IViewletManager
from Products.plonehr... | ajibawa-2023/Python-Code-Large/train/row_3934 | 29 | 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_3934:ImportFrom_L1_C0", "label": "from DateTime import DateTime", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0145, 0.0145, 0, 0.66, 0.0, 556, 0, 1, 0, 0, 556, 0, 0], "semantic": {"name": "DateTime", "arg_names": [], "import_names": [... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3934:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3934:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3934:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3934:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Larg... |
from Acquisition import Explicit
from Products.CMFCore.utils import getToolByName
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from zope.interface import implements
from zope.viewlet.interfaces import IViewlet
class FileViewlet(Explicit):
implements(IViewlet)
render = ViewPageTempla... | ajibawa-2023/Python-Code-Large/train/row_3935 | 30 | 48 | 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_3935:ImportFrom_L1_C0", "label": "from Acquisition import Explicit", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0208, 0.0208, 0, 0.66, 0.0, 62, 0, 1, 0, 0, 62, 0, 0], "semantic": {"name": "Acquisition", "arg_names": [], "import_names... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3935:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3935:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3935:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3935:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/... |
# make me a python package | ajibawa-2023/Python-Code-Large/train/row_3936 | 0 | 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"] | [] | [] |
from DateTime import DateTime
from Acquisition import aq_inner, aq_parent, aq_chain
from Products.CMFCore.utils import getToolByName
from Products.CMFPlone import Batch
from Products.Five import BrowserView
from plone.memoize.view import memoize
from zope.interface import implements
from kss.core import kssaction, KSSV... | ajibawa-2023/Python-Code-Large/train/row_3937 | 170 | 316 | 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_3937:ImportFrom_L1_C0", "label": "from DateTime import DateTime", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0032, 0.0032, 0, 0.66, 0.0, 556, 0, 1, 0, 0, 556, 0, 0], "semantic": {"name": "DateTime", "arg_names": [], "import_names": [... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3937:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3937:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3937:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_3937:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code... |
from Acquisition import Explicit
from Products.CMFCore.utils import getToolByName
from Products.CMFPlone import Batch
from Products.Five import BrowserView
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from zope.i18n import translate
from zope.interface import Interface, implements
from zope.v... | ajibawa-2023/Python-Code-Large/train/row_3938 | 136 | 196 | 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_3938:ImportFrom_L1_C0", "label": "from Acquisition import Explicit", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0051, 0.0051, 0, 0.66, 0.0, 62, 0, 1, 0, 0, 62, 0, 0], "semantic": {"name": "Acquisition", "arg_names": [], "import_names... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3938:Try_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3938:ImportFrom_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3938:Try_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3938:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
from zope.interface import implements
from plone.app.workflow.interfaces import ISharingPageRole
# Please keep this 'PMF' and not '_' as otherwise i18ndude picks it
# up, does not realize it is for the plone domain and puts it in the
# pot/po files of plonehrm. Alternatively: exclude this file in
# rebuild_i18n.sh
fr... | ajibawa-2023/Python-Code-Large/train/row_3939 | 11 | 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_3939:ImportFrom_L1_C0", "label": "from zope.interface import implements", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0385, 0.0385, 0, 0.66, 0.0, 443, 0, 1, 0, 0, 443, 0, 0], "semantic": {"name": "zope.interface", "arg_names": [], "im... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3939:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3939:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3939:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3939:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
from Products.validation.interfaces import ivalidator
from DateTime import DateTime
from zope.i18n import translate
from Products.plonehrm import PloneHrmMessageFactory as _
class DateValidator:
__implements__ = (ivalidator, )
def __init__(self, name):
self.name = name
def __call__(self, value, ... | ajibawa-2023/Python-Code-Large/train/row_3940 | 70 | 210 | 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_3940:ImportFrom_L1_C0", "label": "from Products.validation.interfaces import ivalidator", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0048, 0.0048, 0, 0.66, 0.0, 842, 0, 1, 0, 0, 842, 0, 0], "semantic": {"name": "Products.validation.i... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3940:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3940:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3940:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3940:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
from Products.ATContentTypes.content.document import ATDocument
from Products.ATContentTypes.content.document import ATDocumentSchema
from Products.Archetypes.atapi import StringField
from Products.Archetypes.atapi import SelectionWidget
from Products.Archetypes.atapi import Schema
from Products.Archetypes.atapi import... | ajibawa-2023/Python-Code-Large/train/row_3941 | 17 | 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_3941:ImportFrom_L1_C0", "label": "from Products.ATContentTypes.content.document import ATDocument", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0227, 0.0227, 0, 0.66, 0.0, 880, 0, 1, 0, 0, 880, 0, 0], "semantic": {"name": "Products.AT... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3941:For_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3941:If_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3941:If_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_3941:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3941:C... |
# -*- coding: utf-8 -*-
import worklocation
import employee
import template
| ajibawa-2023/Python-Code-Large/train/row_3942 | 3 | 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_3942:Import_L2_C0", "label": "worklocation import worklocation", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.5, 0.25, 0, 0.66, 0.0, 128, 0, 1, 0, 0, 128, 0, 0], "semantic": {"name": "worklocation", "arg_names": [], "import_names": ["w... | [] |
__author__ = """Reinout van Rees <reinout@zestsoftware.nl>"""
__docformat__ = 'plaintext'
from AccessControl import ClassSecurityInfo
from Products.ATContentTypes.content.folder import ATFolder
from Products.ATContentTypes.content.folder import ATFolderSchema
from Products.Archetypes.public import BaseFolder
from Pr... | ajibawa-2023/Python-Code-Large/train/row_3943 | 31 | 49 | 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_3943:ImportFrom_L1_C0", "label": "from AccessControl import ClassSecurityInfo", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0204, 0.0204, 0, 0.66, 0.0, 227, 0, 1, 0, 0, 227, 0, 0], "semantic": {"name": "AccessControl", "arg_names": []... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3943:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3943:Expr_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3943:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3943:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
__author__ = """Reinout van Rees <reinout@zestsoftware.nl>"""
__docformat__ = 'plaintext'
from datetime import date, timedelta
from AccessControl import ClassSecurityInfo
from Products.Archetypes.atapi import BaseFolder
from Products.Archetypes.atapi import BaseFolderSchema
from Products.Archetypes.atapi import Calen... | ajibawa-2023/Python-Code-Large/train/row_3944 | 203 | 537 | 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_3944:Assign_L1_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0019, 0.0019, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_c... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3944:For_L221_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3944:If_L222_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3944:If_L222_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_3944:Assign_L223_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_39... |
from Products.CMFCore.utils import getToolByName
from Products.CMFQuickInstallerTool.interfaces import INonInstallable
from plone.portlets.interfaces import IPortletAssignmentMapping
from plone.portlets.interfaces import IPortletManager
from zope.app.container.interfaces import INameChooser
from zope.component import g... | ajibawa-2023/Python-Code-Large/train/row_3945 | 83 | 143 | 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_3945:ImportFrom_L1_C0", "label": "from Products.CMFCore.utils import getToolByName", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.007, 0.007, 0, 0.66, 0.0, 287, 0, 1, 0, 0, 287, 0, 0], "semantic": {"name": "Products.CMFCore.utils", "ar... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3945:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3945:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3945:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3945:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Larg... |
__author__ = """Reinout van Rees <reinout@zestsoftware.nl>"""
__docformat__ = 'plaintext'
from zope.component.interfaces import IObjectEvent
from zope.interface import Interface
class IHRMCheckEvent(IObjectEvent):
""" An event that is fired at a regular interval
This can be triggered using a cron job.
""... | ajibawa-2023/Python-Code-Large/train/row_3946 | 14 | 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_3946:Assign_L1_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0385, 0.0385, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_c... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3946:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3946:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3946:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3946:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
from DateTime import DateTime
from Products.Five.browser.pagetemplatefile import ZopeTwoPageTemplateFile
from Products.CMFCore.utils import getToolByName
from zope.event import notify
from zope.interface import implements
import logging
from Products.plonehrm import utils as hrmutils
from Products.plonehrm.controlpane... | ajibawa-2023/Python-Code-Large/train/row_3947 | 50 | 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_3947:ImportFrom_L1_C0", "label": "from DateTime import DateTime", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0132, 0.0132, 0, 0.66, 0.0, 556, 0, 1, 0, 0, 556, 0, 0], "semantic": {"name": "DateTime", "arg_names": [], "import_names": [... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3947:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3947:Expr_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3947:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3947:Expr_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr... |
from plonehrm.notifications.interfaces import IHRMModuleEvent
from plonehrm.notifications.interfaces import IHRMEmailer
class IPersonalDataEvent(IHRMModuleEvent):
pass
class IPersonalDataEmailer(IHRMEmailer):
pass
| ajibawa-2023/Python-Code-Large/train/row_3948 | 4 | 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_3948:ImportFrom_L1_C0", "label": "from plonehrm.notifications.interfaces import IHRMModuleEvent", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1, 0.1, 0, 0.66, 0.0, 835, 0, 1, 0, 0, 835, 0, 0], "semantic": {"name": "plonehrm.notificati... | [] |
# | ajibawa-2023/Python-Code-Large/train/row_3949 | 0 | 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"] | [] | [] |
from zope.i18n import translate
from zope.interface import implements
from zope.component.interfaces import ObjectEvent
from Products.CMFCore.utils import getToolByName
from Products.plonehrm import PloneHrmMessageFactory as _
from Products.plonehrm.notifications.interfaces import IPersonalDataEvent
from Products.plo... | ajibawa-2023/Python-Code-Large/train/row_3950 | 21 | 31 | 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_3950:ImportFrom_L1_C0", "label": "from zope.i18n import translate", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0323, 0.0323, 0, 0.66, 0.0, 500, 0, 1, 0, 0, 500, 0, 0], "semantic": {"name": "zope.i18n", "arg_names": [], "import_names"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3950:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3950:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3950:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3950:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train... |
from Products.plonehrm.tests.base import MainTestCase
def test_suite():
from unittest import TestSuite
from Testing.ZopeTestCase.zopedoctest import ZopeDocFileSuite
s = ZopeDocFileSuite('permissions.txt',
package='Products.plonehrm.doc',
test_class=MainTe... | ajibawa-2023/Python-Code-Large/train/row_3951 | 6 | 11 | 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_3951:ImportFrom_L1_C0", "label": "from Products.plonehrm.tests.base import MainTestCase", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0909, 0.0909, 0, 0.66, 0.0, 313, 0, 1, 0, 0, 313, 0, 0], "semantic": {"name": "Products.plonehrm.tes... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3951:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3951:ImportFrom_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3951:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3951:ImportFrom_L6_C4"}, {"f": "ajibawa-2023/Python-Co... |
import transaction
from AccessControl import SecurityManagement
from Products.Five import fiveconfigure
from Products.Five import zcml
from Products.PloneTestCase import PloneTestCase as ptc
from Products.PloneTestCase import layer
from Testing import ZopeTestCase as ztc
# Ourselves
import Products.plonehrm
# Regular ... | ajibawa-2023/Python-Code-Large/train/row_3952 | 50 | 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_3952:Import_L1_C0", "label": "transaction import transaction", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0132, 0.0132, 0, 0.66, 0.0, 502, 0, 1, 0, 0, 502, 0, 0], "semantic": {"name": "transaction", "arg_names": [], "import_names": [... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3952:Try_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3952:Import_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3952:Try_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3952:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3... |
from Products.plonehrm.tests.base import MainTestCase
import doctest
OPTIONFLAGS = (doctest.ELLIPSIS |
doctest.NORMALIZE_WHITESPACE)
def test_suite():
from unittest import TestSuite
from Testing.ZopeTestCase.zopedoctest import ZopeDocFileSuite
s = ZopeDocFileSuite('worklocation.txt',
... | ajibawa-2023/Python-Code-Large/train/row_3953 | 8 | 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_3953:ImportFrom_L1_C0", "label": "from Products.plonehrm.tests.base import MainTestCase", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0625, 0.0625, 0, 0.66, 0.0, 313, 0, 1, 0, 0, 313, 0, 0], "semantic": {"name": "Products.plonehrm.tes... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3953:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3953:ImportFrom_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3953:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3953:ImportFrom_L10_C4"}, {"f": "ajibawa-2023/Python-C... |
__author__ = """Maurits van Rees <reinout@zestsoftware.nl>"""
__docformat__ = 'plaintext'
from Products.plonehrm.tests.base import MainTestCase
import doctest
OPTIONFLAGS = (doctest.ELLIPSIS |
doctest.NORMALIZE_WHITESPACE)
class testOverview(MainTestCase):
"""Test-cases for class(es) ."""
pas... | ajibawa-2023/Python-Code-Large/train/row_3954 | 12 | 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_3954:Assign_L1_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0417, 0.0417, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_c... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3954:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3954:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3954:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3954:ImportFrom_L17_C4"}, {"f": "ajibawa-2023/Python-Code-La... |
from Products.plonehrm.tests.base import MainTestCase
import doctest
OPTIONFLAGS = (doctest.ELLIPSIS |
doctest.NORMALIZE_WHITESPACE)
def test_suite():
from unittest import TestSuite
from Testing.ZopeTestCase.zopedoctest import ZopeDocFileSuite
s = ZopeDocFileSuite('overview.txt',
... | ajibawa-2023/Python-Code-Large/train/row_3955 | 8 | 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_3955:ImportFrom_L1_C0", "label": "from Products.plonehrm.tests.base import MainTestCase", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0625, 0.0625, 0, 0.66, 0.0, 313, 0, 1, 0, 0, 313, 0, 0], "semantic": {"name": "Products.plonehrm.tes... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3955:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3955:ImportFrom_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3955:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3955:ImportFrom_L10_C4"}, {"f": "ajibawa-2023/Python-C... |
#
| ajibawa-2023/Python-Code-Large/train/row_3956 | 0 | 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"] | [] | [] |
__author__ = """Reinout van Rees <reinout@zestsoftware.nl>"""
__docformat__ = 'plaintext'
import logging
logger = logging.getLogger('plonehrm')
logger.debug('Installing Product')
from zope.i18nmessageid import MessageFactory
PloneHrmMessageFactory = MessageFactory(u'plonehrm')
from Products.Archetypes import listTyp... | ajibawa-2023/Python-Code-Large/train/row_3957 | 26 | 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_3957:Assign_L1_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0222, 0.0222, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_c... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3957:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3957:Import_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3957:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3957:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
# | ajibawa-2023/Python-Code-Large/train/row_3958 | 0 | 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"] | [] | [] |
PROJECTNAME = "plonehrm"
product_globals = globals()
QI_DEPS = (
'CMFPlacefulWorkflow',
'plonehrm.jobperformance',
'plonehrm.checklist',
'plonehrm.contracts',
'plonehrm.notes',
'plonehrm.absence',
)
# Make a dict of dicts to list the properties.
PLONEHRM_PROPERTIES = {}
PLONEHRM_PROPERTIES... | ajibawa-2023/Python-Code-Large/train/row_3959 | 19 | 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_3959:Assign_L1_C0", "label": "PROJECTNAME =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0132, 0.0132, 0, 0.66, 0.0, 239, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "PROJECTNAME", "arg_names": [], "import_names": [], "rhs... | [] |
from Products.plonehrm.utils import set_plonehrm_workflow_policy
def worklocationCreated(object, event):
"""A Worklocation has been created. Give it a placeful workflow."""
set_plonehrm_workflow_policy(object)
| ajibawa-2023/Python-Code-Large/train/row_3960 | 4 | 6 | 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_3960:ImportFrom_L1_C0", "label": "from Products.plonehrm.utils import set_plonehrm_workflow_policy", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.1667, 0, 0.66, 0.0, 75, 0, 1, 0, 0, 75, 0, 0], "semantic": {"name": "Products.plo... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3960:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3960:Expr_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3960:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3960:Expr_L6_C4"}] |
# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError:
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
| ajibawa-2023/Python-Code-Large/train/row_3961 | 4 | 6 | 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_3961:Try_L2_C0", "label": "try", "type": "try", "loc": [2, 6], "level": 0, "parent": null, "vector": [7, 0, 0.6667, 0.8333, 0, 0.66, 0.0, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snip... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3961:Try_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3961:Expr_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3961:Try_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3961:ImportFrom_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_396... |
#
| ajibawa-2023/Python-Code-Large/train/row_3962 | 0 | 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"] | [] | [] |
from zope import schema
from zope.interface import Interface
from Products.plonecrm import plonecrmMessageFactory as _
class Iorganization(Interface):
"""an organization unite"""
# -*- schema definition goes here -*-
newfield = schema.TextLine(
title=_(u"register capital"),
required=Fals... | ajibawa-2023/Python-Code-Large/train/row_3963 | 14 | 64 | 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_3963:ImportFrom_L1_C0", "label": "from zope import schema", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0156, 0.0156, 0, 0.66, 0.0, 603, 0, 1, 0, 0, 603, 0, 0], "semantic": {"name": "zope", "arg_names": [], "import_names": ["schema"],... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3963:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3963:Expr_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3963:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3963:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/... |
# -*- extra stuff goes here -*-
from contact import Icontact
from organization import Iorganization
| ajibawa-2023/Python-Code-Large/train/row_3964 | 2 | 3 | 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_3964:ImportFrom_L2_C0", "label": "from contact import Icontact", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.6667, 0.3333, 0, 0.66, 0.0, 357, 0, 1, 0, 0, 357, 0, 0], "semantic": {"name": "contact", "arg_names": [], "import_names": ["I... | [] |
from zope import schema
from zope.interface import Interface
from Products.plonecrm import plonecrmMessageFactory as _
class Icontact(Interface):
"""contact person"""
# -*- schema definition goes here -*-
portrait = schema.Bytes(
title=_(u"personal photo"),
required=False,
descri... | ajibawa-2023/Python-Code-Large/train/row_3965 | 20 | 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_3965:ImportFrom_L1_C0", "label": "from zope import schema", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.01, 0.01, 0, 0.66, 0.0, 603, 0, 1, 0, 0, 603, 0, 0], "semantic": {"name": "zope", "arg_names": [], "import_names": ["schema"], "rh... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3965:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3965:Expr_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3965:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3965:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/... |
from zope.interface import implements, Interface
from Products.Five import BrowserView
from Products.CMFCore.utils import getToolByName
from Products.plonecrm import plonecrmMessageFactory as _
class IorganizationView(Interface):
"""
organization view interface
"""
def test():
""" test meth... | ajibawa-2023/Python-Code-Large/train/row_3966 | 22 | 42 | 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_3966:ImportFrom_L1_C0", "label": "from zope.interface import implements, Interface", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0238, 0.0238, 0, 0.66, 0.0, 443, 0, 2, 0, 0, 443, 0, 0], "semantic": {"name": "zope.interface", "arg_name... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3966:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3966:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3966:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3966:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/... |
#
| ajibawa-2023/Python-Code-Large/train/row_3967 | 0 | 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"] | [] | [] |
from zope.interface import implements, Interface
from Products.Five import BrowserView
from Products.CMFCore.utils import getToolByName
from Products.plonecrm import plonecrmMessageFactory as _
class IcontactView(Interface):
"""
contact view interface
"""
def test():
""" test method"""
cl... | ajibawa-2023/Python-Code-Large/train/row_3968 | 22 | 42 | 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_3968:ImportFrom_L1_C0", "label": "from zope.interface import implements, Interface", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0238, 0.0238, 0, 0.66, 0.0, 443, 0, 2, 0, 0, 443, 0, 0], "semantic": {"name": "zope.interface", "arg_name... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3968:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3968:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3968:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3968:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/... |
"""Definition of the organization content type
"""
from zope.interface import implements
from Products.Archetypes import atapi
from Products.ATContentTypes.content import folder
from Products.ATContentTypes.content import schemata
from Products.plonecrm import plonecrmMessageFactory as _
from Products.plonecrm.inter... | ajibawa-2023/Python-Code-Large/train/row_3969 | 29 | 154 | 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_3969:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0097, 0.013, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3969:ClassDef_L124_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3969:Expr_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3969:ClassDef_L124_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3969:Expr_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
#
| ajibawa-2023/Python-Code-Large/train/row_3970 | 0 | 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"] | [] | [] |
"""Definition of the contact content type
"""
from zope.interface import implements
from Products.Archetypes import atapi
from Products.ATContentTypes.content import base
from Products.ATContentTypes.content import schemata
from Products.plonecrm import plonecrmMessageFactory as _
from Products.plonecrm.interfaces i... | ajibawa-2023/Python-Code-Large/train/row_3971 | 35 | 223 | 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_3971:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0067, 0.009, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotatio... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3971:ClassDef_L181_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3971:Expr_L182_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3971:ClassDef_L181_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3971:Expr_L183_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
"""Test setup for integration and functional tests.
When we import PloneTestCase and then call setupPloneSite(), all of
Plone's products are loaded, and a Plone site will be created. This
happens at module level, which makes it faster to run each test, but
slows down test runner startup.
"""
from Products.Five import... | ajibawa-2023/Python-Code-Large/train/row_3972 | 22 | 81 | 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_3972:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0494, 0.0864, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3972:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3972:Expr_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3972:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3972:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
#
| ajibawa-2023/Python-Code-Large/train/row_3973 | 0 | 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"] | [] | [] |
"""Main product initializer
"""
from zope.i18nmessageid import MessageFactory
from Products.plonecrm import config
from Products.Archetypes import atapi
from Products.CMFCore import utils
# Define a message factory for when this product is internationalised.
# This will be imported with the special name "_" in most ... | ajibawa-2023/Python-Code-Large/train/row_3974 | 11 | 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_3974:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 2], "level": 0, "parent": null, "vector": [8, 0, 0.03, 0.04, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation":... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3974:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3974:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3974:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3974:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Lar... |
"""Common configuration constants
"""
PROJECTNAME = 'Products.plonecrm'
ADD_PERMISSIONS = {
# -*- extra stuff goes here -*-
'contact': 'Products.plonecrm: Add contact',
'organization': 'Products.plonecrm: Add organization',
}
| ajibawa-2023/Python-Code-Large/train/row_3975 | 3 | 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_3975:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 2], "level": 0, "parent": null, "vector": [8, 0, 0.15, 0.2, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ... | [] |
# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError:
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
| ajibawa-2023/Python-Code-Large/train/row_3976 | 4 | 6 | 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_3976:Try_L2_C0", "label": "try", "type": "try", "loc": [2, 6], "level": 0, "parent": null, "vector": [7, 0, 0.6667, 0.8333, 0, 0.66, 0.0, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snip... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3976:Try_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3976:Expr_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3976:Try_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3976:ImportFrom_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_397... |
# -*- coding: utf-8 -*-
"""
This module contains the tool of Products.plonecrm
"""
import os
from setuptools import setup, find_packages
def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
version = '1.0'
long_description = (
read('README.txt')
+ '\n' +
'Change hi... | ajibawa-2023/Python-Code-Large/train/row_3977 | 9 | 70 | 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_3977:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0429, 0.0429, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3977:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3977:Return_L10_C4"}] |
# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError:
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
| ajibawa-2023/Python-Code-Large/train/row_3978 | 4 | 6 | 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_3978:Try_L2_C0", "label": "try", "type": "try", "loc": [2, 6], "level": 0, "parent": null, "vector": [7, 0, 0.6667, 0.8333, 0, 0.66, 0.0, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snip... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3978:Try_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3978:Expr_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3978:Try_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3978:ImportFrom_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_397... |
from BeautifulSoup import BeautifulSoup
def getPostUrlFromForum(res, position=0):
soup = BeautifulSoup(res.body)
posts = soup.findAll('a', attrs={'class':'state-active'})
return posts[position].attrMap['href']
def getReplyUrlFromConversation(res, position=0):
soup = BeautifulSoup(res.body)
return ... | ajibawa-2023/Python-Code-Large/train/row_3979 | 11 | 14 | 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_3979:ImportFrom_L1_C0", "label": "from BeautifulSoup import BeautifulSoup", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0714, 0.0714, 0, 0.66, 0.0, 878, 0, 1, 0, 0, 878, 0, 0], "semantic": {"name": "BeautifulSoup", "arg_names": [], "i... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3979:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3979:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3979:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3979:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
## Script (Python) "lock_board.py"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=Locks board
##
if context.portal_type != 'Ploneboard': return
for f1 in context.objectValues('PloneboardForum'):
for c1 in f1.objectValue... | ajibawa-2023/Python-Code-Large/train/row_3981 | 11 | 20 | 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_3981:If_L11_C0", "label": "if", "type": "if", "loc": [11, 11], "level": 0, "parent": null, "vector": [4, 0, 0.55, 0.05, 0, 0.66, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3981:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3981:Return_L11_C40"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3981:For_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3981:For_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3981... |
## Script (Python) "list_pending_search.py"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=obj=None
##title=Searches for pending comments in moderated boards
# $Id: moderation_count_search.py 53223 2007-11-06 10:26:29Z glenfant $
if... | ajibawa-2023/Python-Code-Large/train/row_3982 | 14 | 28 | 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_3982:If_L11_C0", "label": "if", "type": "if", "loc": [11, 12], "level": 0, "parent": null, "vector": [4, 0, 0.4107, 0.0714, 0, 0.66, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snip... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3982:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3982:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3982:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3982:If_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/ro... |
## Script (Python) "moderation.py"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=Searches for pending comments in moderated boards
##
# Search the catalog, and depending on where the script is called from, filter
# and mass... | ajibawa-2023/Python-Code-Large/train/row_3983 | 38 | 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_3983:Assign_L21_C0", "label": "query =", "type": "assigned_variable", "loc": [21, 21], "level": 0, "parent": null, "vector": [14, 0, 0.2958, 0.0141, 0, 0.66, 0.0, 546, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "query", "arg_names": [], "import_names": [], "rhs_call_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3983:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3983:If_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3983:If_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_3983:Assign_L30_C23"}, {"f": "ajibawa-2023/Python-Code-Large/train/r... |
## Script (Python) "moderateComment"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=action,cameFrom=None
##title=Moderate the given comment, and return to referer
##
from Products.CMFCore.utils import getToolByName
from Products.CMF... | ajibawa-2023/Python-Code-Large/train/row_3984 | 7 | 19 | 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_3984:ImportFrom_L11_C0", "label": "from Products.CMFCore.utils import getToolByName", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.5789, 0.0526, 0, 0.66, 0.0, 287, 0, 1, 0, 0, 287, 0, 0], "semantic": {"name": "Products.CMFCore.utils"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3984:If_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3984:Assign_L18_C4"}] |
## Script (Python) "comment_redirect_to_conversation"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=Redirect from a comment to it's conversation
##
# XXX if we ever do batching, we need extra logic here.
redirect_target = ... | ajibawa-2023/Python-Code-Large/train/row_3985 | 17 | 33 | 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_3985:Assign_L12_C0", "label": "redirect_target = getConversation()", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.3636, 0.0303, 0, 0.66, 0.0, 252, 3, 0, 0, 0, 774, 10, 1], "semantic": {"name": "redirect_target", "arg_name... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3985:If_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3985:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3985:If_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3985:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_398... |
## Script (Python) "lock_board.py"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=Unlocks board
##
if context.portal_type != 'Ploneboard': return
for f1 in context.objectValues('PloneboardForum'):
for c1 in f1.objectVal... | ajibawa-2023/Python-Code-Large/train/row_3986 | 11 | 20 | 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_3986:If_L11_C0", "label": "if", "type": "if", "loc": [11, 11], "level": 0, "parent": null, "vector": [4, 0, 0.55, 0.05, 0, 0.66, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet"... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3986:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3986:Return_L11_C40"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3986:For_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3986:For_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3986... |
## Script (Python) "getKeyedForums"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=forums=None
##title=Get forums keyed on category
##
if forums is None:
forums = context.getForums()
result = {}
for forum in forums:
if has... | ajibawa-2023/Python-Code-Large/train/row_3987 | 17 | 30 | 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_3987:If_L11_C0", "label": "if", "type": "if", "loc": [11, 12], "level": 0, "parent": null, "vector": [4, 0, 0.3833, 0.0667, 0, 0.66, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snip... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3987:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3987:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3987:For_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3987:If_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3987:I... |
from Products.PortalTransforms.interfaces import itransform
from ZODB.PersistentMapping import PersistentMapping
from Products.CMFCore.utils import getToolByName
from Products.Ploneboard.utils import TransformDataProvider
import re
import copy
class EmoticonDataProvider(TransformDataProvider):
def __init__(self):
... | ajibawa-2023/Python-Code-Large/train/row_3990 | 60 | 112 | 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_3990:ImportFrom_L1_C0", "label": "from Products.PortalTransforms.interfaces import itransform", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0089, 0.0089, 0, 0.66, 0.0, 415, 0, 1, 0, 0, 415, 0, 0], "semantic": {"name": "Products.Portal... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3990:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3990:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3990:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_3990:Expr_L10_C8"}, {"f": "ajibawa-2023/Python-Code-Larg... |
from Products.PortalTransforms.interfaces import itransform
import re
hider = "##HIDE"
schemematcher = re.compile ("(mailto|telnet|gopher|http|https|ftp)", re.I)
hiddenschemematcher = re.compile ("(mailto|telnet|gopher|http|https|ftp)" + hider, re.I)
elementmatcher = re.compile("<[^>]+>")
emailRegexp = re.compile(r'["... | ajibawa-2023/Python-Code-Large/train/row_3991 | 49 | 72 | 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_3991:ImportFrom_L1_C0", "label": "from Products.PortalTransforms.interfaces import itransform", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0139, 0.0139, 0, 0.66, 0.0, 415, 0, 1, 0, 0, 415, 0, 0], "semantic": {"name": "Products.Portal... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3991:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3991:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3991:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3991:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
from Products.CMFCore.utils import getToolByName
from Products.CMFPlone.utils import getFSVersionTuple
def install(self, reinstall=False):
tool=getToolByName(self, "portal_setup")
if getFSVersionTuple()[0]>=3:
tool.runAllImportStepsFromProfile(
"profile-Products.Ploneboard:ploneboard",... | ajibawa-2023/Python-Code-Large/train/row_3992 | 11 | 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_3992:ImportFrom_L1_C0", "label": "from Products.CMFCore.utils import getToolByName", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0625, 0.0625, 0, 0.66, 0.0, 287, 0, 1, 0, 0, 287, 0, 0], "semantic": {"name": "Products.CMFCore.utils", "... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3992:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3992:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3992:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3992:If_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
from Acquisition import aq_inner, aq_parent
from Products.Ploneboard.interfaces import IConversation, IComment
def autopublish_script(self, sci):
"""Publish the conversation along with the comment"""
object = sci.object
wftool = sci.getPortal().portal_workflow
# Try to make sure that conversation an... | ajibawa-2023/Python-Code-Large/train/row_3993 | 39 | 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_3993:ImportFrom_L1_C0", "label": "from Acquisition import aq_inner, aq_parent", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0161, 0.0161, 0, 0.66, 0.0, 62, 0, 2, 0, 0, 62, 0, 0], "semantic": {"name": "Acquisition", "arg_names": [], "i... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3993:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3993:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3993:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3993:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
# this file is here to make Install.py importable.
# we need to make it non-zero size to make winzip cooperate
| ajibawa-2023/Python-Code-Large/train/row_3994 | 0 | 2 | 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"] | [] | [] |
from datetime import datetime
from dateutil.parser import parse as dateparse
from zope.i18n import translate
from DateTime.DateTime import DateTime
from Products.CMFCore.utils import getToolByName
from Products.CMFPlone import PloneMessageFactory as _plone
from Products.CMFPlone import PloneLocalesMessageFactory as _lo... | ajibawa-2023/Python-Code-Large/train/row_3995 | 46 | 86 | 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_3995:ImportFrom_L1_C0", "label": "from datetime import datetime", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0116, 0.0116, 0, 0.66, 0.0, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "datetime", "arg_names": [], "import_names": [... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3995:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3995:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3995:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3995:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Larg... |
from zope.schema import Tuple
from zope.schema import Choice
from zope.interface import implements
from zope.interface import Interface
from zope.formlib.form import FormFields
from zope.component import adapts
from plone.app.controlpanel.form import ControlPanelForm
from plone.app.controlpanel.widgets import MultiChec... | ajibawa-2023/Python-Code-Large/train/row_3996 | 33 | 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_3996:ImportFrom_L1_C0", "label": "from zope.schema import Tuple", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0161, 0.0161, 0, 0.66, 0.0, 30, 0, 1, 0, 0, 30, 0, 0], "semantic": {"name": "zope.schema", "arg_names": [], "import_names": ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3996:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3996:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3996:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3996:Expr_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
from DateTime import DateTime
from Products import Five
from plone.memoize.view import memoize
from Products.CMFCore.utils import getToolByName
from Products.Ploneboard.batch import Batch
from Products.Ploneboard.browser.utils import toPloneboardTime, getNumberOfComments, getNumberOfConversations
from Products.Ploneboa... | ajibawa-2023/Python-Code-Large/train/row_3998 | 41 | 78 | 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_3998:ImportFrom_L1_C0", "label": "from DateTime import DateTime", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0128, 0.0128, 0, 0.66, 0.0, 556, 0, 1, 0, 0, 556, 0, 0], "semantic": {"name": "DateTime", "arg_names": [], "import_names": [... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3998:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3998:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3998:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3998:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/... |
from zope.component import getMultiAdapter
from zope.component import getUtility
from plone.i18n.normalizer.interfaces import IIDNormalizer
from Products.Five import BrowserView
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from Products.CMFCore.utils import getToolByName
class SearchView(Bro... | ajibawa-2023/Python-Code-Large/train/row_3999 | 40 | 72 | 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_3999:ImportFrom_L1_C0", "label": "from zope.component import getMultiAdapter", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0139, 0.0139, 0, 0.66, 0.0, 353, 0, 1, 0, 0, 353, 0, 0], "semantic": {"name": "zope.component", "arg_names": []... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_3999:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3999:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_3999:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_3999:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large... |
from zope.interface import Interface
class IConversationView(Interface):
def comments():
"""Return all comments in the conversation.
"""
def conversation():
"""Return active conversation.
"""
def root_comments():
"""Return all of the root comments for a conversatio... | ajibawa-2023/Python-Code-Large/train/row_4000 | 17 | 35 | 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_4000:ImportFrom_L1_C0", "label": "from zope.interface import Interface", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0286, 0.0286, 0, 0.66, 0.0, 443, 0, 1, 0, 0, 443, 0, 0], "semantic": {"name": "zope.interface", "arg_names": [], "imp... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_4000:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4000:FunctionDef_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4000:FunctionDef_L4_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4000:Expr_L5_C8"}, {"f": "ajibawa-2023/Python-Code-Large... |
from Products import Five
from Products.CMFCore.utils import getToolByName
from Products.Ploneboard.browser.utils import toPloneboardTime, getNumberOfConversations
from Products.Ploneboard.interfaces import IForum, IComment
class BoardView(Five.BrowserView):
"""View methods for board type
"""
def __init__... | ajibawa-2023/Python-Code-Large/train/row_4001 | 40 | 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_4001:ImportFrom_L1_C0", "label": "from Products import Five", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0161, 0.0161, 0, 0.66, 0.0, 803, 0, 1, 0, 0, 803, 0, 0], "semantic": {"name": "Products", "arg_names": [], "import_names": ["Fiv... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_4001:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4001:Expr_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4001:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4001:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
#
| ajibawa-2023/Python-Code-Large/train/row_4002 | 0 | 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: comment.py 99041 2009-10-06 06:38:21Z sureshvv $
"""
from zope import interface
from Acquisition import aq_base
from DateTime.DateTime import DateTime
from Products import Five
from Products.CMFCore import utils as cmf_utils
from Products.CMFCore.utils import getToolByName
from Products.Ploneboard import permi... | ajibawa-2023/Python-Code-Large/train/row_4003 | 157 | 274 | 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_4003:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0073, 0.0109, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_4003:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4003:Expr_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4003:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4003:FunctionDef_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Larg... |
from zope.interface import implements
from zope import schema
from zope.component import getUtility
from zope.component import getMultiAdapter
from zope.formlib.form import Fields
from plone.memoize.view import memoize
from Products.CMFCore.utils import getToolByName
from Products.Five.browser.pagetemplatefile import V... | ajibawa-2023/Python-Code-Large/train/row_4004 | 60 | 120 | 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_4004:ImportFrom_L1_C0", "label": "from zope.interface import implements", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0083, 0.0083, 0, 0.66, 0.0, 443, 0, 1, 0, 0, 443, 0, 0], "semantic": {"name": "zope.interface", "arg_names": [], "im... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_4004:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4004:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4004:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4004:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tra... |
# Poof
| ajibawa-2023/Python-Code-Large/train/row_4005 | 0 | 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"] | [] | [] |
from zope.interface import implements
from AccessControl import ClassSecurityInfo
from Products.CMFCore.utils import getToolByName
from Products.Archetypes.public import BaseBTreeFolderSchema, Schema, TextField, LinesField
from Products.Archetypes.public import BaseBTreeFolder, registerType
from Products.Archetypes.p... | ajibawa-2023/Python-Code-Large/train/row_4008 | 72 | 131 | 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_4008:ImportFrom_L1_C0", "label": "from zope.interface import implements", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0076, 0.0076, 0, 0.66, 0.0, 443, 0, 1, 0, 0, 443, 0, 0], "semantic": {"name": "zope.interface", "arg_names": [], "im... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_4008:ClassDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4008:Expr_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4008:ClassDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4008:Expr_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train... |
from zope.interface import implements
from AccessControl import ClassSecurityInfo
from Acquisition import aq_chain, aq_inner
from OFS.CopySupport import CopyContainer
from OFS.Image import File
from Products.CMFCore.utils import getToolByName
from Products.CMFPlone.utils import _createObjectByType, log_deprecated
fr... | ajibawa-2023/Python-Code-Large/train/row_4009 | 163 | 307 | 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_4009:ImportFrom_L1_C0", "label": "from zope.interface import implements", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0033, 0.0033, 0, 0.66, 0.0, 443, 0, 1, 0, 0, 443, 0, 0], "semantic": {"name": "zope.interface", "arg_names": [], "im... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_4009:If_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4009:Assign_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4009:If_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4009:Assign_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_400... |
import Ploneboard
import PloneboardForum
import PloneboardConversation
import PloneboardComment
| ajibawa-2023/Python-Code-Large/train/row_4010 | 4 | 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_4010:Import_L1_C0", "label": "Ploneboard import Ploneboard", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.25, 0.25, 0, 0.66, 0.0, 534, 0, 1, 0, 0, 534, 0, 0], "semantic": {"name": "Ploneboard", "arg_names": [], "import_names": ["Ploneb... | [] |
try:
from lipsum import markupgenerator
except ImportError:
class markupgenerator(object):
def __init__(self,sample,dictionary):pass
def generate_sentence(self):return 'subject'
def generate_paragraph(self):return 'Please install lorem-ipsum-generator.'
import transaction
from time impo... | ajibawa-2023/Python-Code-Large/train/row_4011 | 77 | 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_4011:Try_L1_C0", "label": "try", "type": "try", "loc": [1, 7], "level": 0, "parent": null, "vector": [7, 0, 0.0408, 0.0714, 0, 0.66, 0.0, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snip... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_4011:Try_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4011:ImportFrom_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4011:Try_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4011:ClassDef_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row... |
"""
$Id: interfaces.py 55766 2007-12-18 11:08:52Z wichert $
"""
# Dependency on Zope 2.8.x (or greater) or Five
from zope.interface import Interface, Attribute
class IPloneboard(Interface):
"""
Ploneboard is the outmost board object, what shows up in your site.
The board contains forums. Board is folderish... | ajibawa-2023/Python-Code-Large/train/row_4012 | 105 | 277 | 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_4012:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0072, 0.0108, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_4012:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4012:Expr_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4012:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4012:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
from Products.Ploneboard.interfaces import IConversation
from plone.indexer.decorator import indexer
@indexer(IConversation)
def num_comments(obj):
return obj.getNumberOfComments()
| ajibawa-2023/Python-Code-Large/train/row_4014 | 4 | 6 | 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_4014:ImportFrom_L1_C0", "label": "from Products.Ploneboard.interfaces import IConversation", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.1667, 0, 0.66, 0.0, 895, 0, 1, 0, 0, 895, 0, 0], "semantic": {"name": "Products.Ploneboar... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_4014:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4014:Return_L6_C4"}] |
from Testing import ZopeTestCase
# Make the boring stuff load quietly
ZopeTestCase.installProduct('SimpleAttachment')
ZopeTestCase.installProduct('CMFPlacefulWorkflow')
ZopeTestCase.installProduct('Ploneboard')
from Products.PloneTestCase import PloneTestCase
PloneTestCase.setupPloneSite(products=('SimpleAttachment'... | ajibawa-2023/Python-Code-Large/train/row_4015 | 20 | 31 | 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_4015:ImportFrom_L1_C0", "label": "from Testing import ZopeTestCase", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0323, 0.0323, 0, 0.66, 0.0, 740, 0, 1, 0, 0, 740, 0, 0], "semantic": {"name": "Testing", "arg_names": [], "import_names":... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_4015:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4015:ClassDef_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4015:ClassDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4015:FunctionDef_L16_C8"}, {"f": "ajibawa-2023/Python-Code-... |
import Products.Five
import Products.ATContentTypes
from Products.CMFPlacefulWorkflow.WorkflowPolicyConfig import manage_addWorkflowPolicyConfig
from DateTime import DateTime
def addMember(self, username, fullname="", email="", roles=('Member',), last_login_time=None):
self.portal.portal_membership.addMember(user... | ajibawa-2023/Python-Code-Large/train/row_4016 | 47 | 59 | 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_4016:Import_L1_C0", "label": "Products.Five import Products.Five", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0169, 0.0169, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "Products.Five", "arg_names": [], "import_nam... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_4016:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4016:Expr_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4016:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4016:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/t... |
#
# Conversation tests
#
import transaction
import unittest
from zope.interface.verify import verifyClass, verifyObject
import PloneboardTestCase
from Products.CMFPlone.utils import _createObjectByType
from Products.Ploneboard.interfaces import IConversation
from Products.Ploneboard.content.PloneboardConversation imp... | ajibawa-2023/Python-Code-Large/train/row_4017 | 156 | 195 | 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_4017:Import_L5_C0", "label": "transaction import transaction", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0256, 0.0051, 0, 0.66, 0.0, 502, 0, 1, 0, 0, 502, 0, 0], "semantic": {"name": "transaction", "arg_names": [], "import_names": [... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_4017:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4017:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4017:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4017:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code... |
#
# Ploneboard tests
#
from Products.Ploneboard.tests import PloneboardTestCase
# Catch errors in Install
from Products.Ploneboard.Extensions import Install
from Products.CMFCore.utils import getToolByName
class TestSetup(PloneboardTestCase.PloneboardTestCase):
def testSkins(self):
portal_skins = self.... | ajibawa-2023/Python-Code-Large/train/row_4018 | 41 | 67 | 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_4018:ImportFrom_L5_C0", "label": "from Products.Ploneboard.tests import PloneboardTestCase", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0746, 0.0149, 0, 0.66, 0.0, 703, 0, 1, 0, 0, 703, 0, 0], "semantic": {"name": "Products.Ploneboar... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_4018:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4018:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4018:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4018:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code... |
"""Ploneboard functional doctests. This module collects all *.txt
files in the tests directory and runs them. (stolen from Plone)
"""
import os, sys
import glob
import doctest
import unittest
from Globals import package_home
from Testing.ZopeTestCase import FunctionalDocFileSuite as Suite
from Products.Ploneboard.c... | ajibawa-2023/Python-Code-Large/train/row_4019 | 23 | 55 | 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_4019:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0364, 0.0545, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotati... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_4019:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4019:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4019:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4019:Return_L28_C4"}, {"f": "ajibawa-2023/Python-Code-L... |
#
# Comment tests
#
import unittest
from zope.interface.verify import verifyClass
import PloneboardTestCase
from Products.Ploneboard.interfaces import IComment
from Products.Ploneboard.content.PloneboardComment import PloneboardComment
from Products.Ploneboard.config import HAS_SIMPLEATTACHMENT
from OFS.Image import... | ajibawa-2023/Python-Code-Large/train/row_4020 | 208 | 312 | 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_4020:Import_L5_C0", "label": "unittest import unittest", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.016, 0.0032, 0, 0.66, 0.0, 88, 0, 1, 0, 0, 88, 0, 0], "semantic": {"name": "unittest", "arg_names": [], "import_names": ["unittest"],... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_4020:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4020:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4020:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4020:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code... |
#
# Comment tests
#
import unittest
from Products.Ploneboard.tests import PloneboardTestCase
from Products.CMFPlone.utils import _createObjectByType
class TestITextContentAdapter(PloneboardTestCase.PloneboardTestCase):
def afterSetUp(self):
from Products.ATContentTypes.interface import ITextContent
... | ajibawa-2023/Python-Code-Large/train/row_4021 | 26 | 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_4021:Import_L5_C0", "label": "unittest import unittest", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.1163, 0.0233, 0, 0.66, 0.0, 88, 0, 1, 0, 0, 88, 0, 0], "semantic": {"name": "unittest", "arg_names": [], "import_names": ["unittest"]... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_4021:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4021:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4021:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4021:ImportFrom_L12_C8"}, {"f": "ajibawa-2023/Python-C... |
#
# Ploneboard tests
#
import unittest
from Products.Ploneboard.tests import PloneboardTestCase
from Products.Ploneboard.batch import Batch
from Products.CMFPlone.utils import _createObjectByType
class TestBatch(PloneboardTestCase.PloneboardTestCase):
def afterSetUp(self):
self.board = _createObjectBy... | ajibawa-2023/Python-Code-Large/train/row_4022 | 77 | 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_4022:Import_L5_C0", "label": "unittest import unittest", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0481, 0.0096, 0, 0.66, 0.0, 88, 0, 1, 0, 0, 88, 0, 0], "semantic": {"name": "unittest", "arg_names": [], "import_names": ["unittest"]... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_4022:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4022:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4022:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4022:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code... |
#
# Tests the default workflow
#
from AccessControl.Permission import Permission
from Products.CMFPlone.tests import PloneTestCase
from Products.CMFCore.utils import _checkPermission as checkPerm
from Products.CMFPlone.utils import _createObjectByType
from Products.Ploneboard.Extensions import WorkflowScripts # Catc... | ajibawa-2023/Python-Code-Large/train/row_4023 | 61 | 117 | 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_4023:ImportFrom_L5_C0", "label": "from AccessControl.Permission import Permission", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0427, 0.0085, 0, 0.66, 0.0, 745, 0, 1, 0, 0, 745, 0, 0], "semantic": {"name": "AccessControl.Permission", ... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_4023:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4023:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4023:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4023:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code... |
#
# Event notification tests
#
import unittest
import zope.component
from Products.Ploneboard.tests import PloneboardTestCase
from Products.Archetypes.event import ObjectInitializedEvent
from Products.CMFPlone.utils import _createObjectByType
notified = []
@zope.component.adapter(ObjectInitializedEvent)
def dummy... | ajibawa-2023/Python-Code-Large/train/row_4024 | 23 | 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_4024:Import_L6_C0", "label": "unittest import unittest", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1579, 0.0263, 0, 0.66, 0.0, 88, 0, 1, 0, 0, 88, 0, 0], "semantic": {"name": "unittest", "arg_names": [], "import_names": ["unittest"]... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_4024:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4024:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4024:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4024:Expr_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/tr... |
#
# Ploneboard transform tests
#
import unittest
from Products.Ploneboard.tests import PloneboardTestCase
from Products.CMFCore.utils import getToolByName
from Products.Ploneboard.config import PLONEBOARD_TOOL
from Products.CMFPlone.utils import _createObjectByType
class TestTransformRegistration(PloneboardTestCase... | ajibawa-2023/Python-Code-Large/train/row_4025 | 39 | 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_4025:Import_L5_C0", "label": "unittest import unittest", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0943, 0.0189, 0, 0.66, 0.0, 88, 0, 1, 0, 0, 88, 0, 0], "semantic": {"name": "unittest", "arg_names": [], "import_names": ["unittest"]... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_4025:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4025:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4025:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4025:FunctionDef_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Larg... |
"""Ploneboard tests package
"""
| ajibawa-2023/Python-Code-Large/train/row_4026 | 1 | 2 | 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_4026:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 2], "level": 0, "parent": null, "vector": [8, 0, 0.75, 1.0, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ... | [] |
#
# Forum tests
#
import unittest
from zExceptions import Unauthorized
from zope.interface.verify import verifyClass, verifyObject
import PloneboardTestCase
from Products.Ploneboard.interfaces import IForum
from Products.Ploneboard.content.PloneboardForum import PloneboardForum
from Products.CMFCore.utils import get... | ajibawa-2023/Python-Code-Large/train/row_4027 | 139 | 192 | 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_4027:Import_L5_C0", "label": "unittest import unittest", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.026, 0.0052, 0, 0.66, 0.0, 88, 0, 1, 0, 0, 88, 0, 0], "semantic": {"name": "unittest", "arg_names": [], "import_names": ["unittest"],... | [{"f": "ajibawa-2023/Python-Code-Large/train/row_4027:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_4027:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_4027:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_4027:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.