--- annotations_creators: - found language_creators: - found language: - code license: - c-uda multilinguality: - monolingual size_categories: - 10K", "package", "org", ".", "vaadin", ".", "teemu", ".", "clara", ".", "demo", ";", "import", "java", ".", "io", ".", "BufferedReader", ";", "import", "java", ".", "io", ".", "ByteArrayInputStream", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "io", ".", "InputStreamReader", ";", "import", "org", ".", "vaadin", ".", "teemu", ".", "clara", ".", "Clara", ";", "import", "org", ".", "vaadin", ".", "teemu", ".", "clara", ".", "inflater", ".", "LayoutInflaterException", ";", "import", "com", ".", "vaadin", ".", "Application", ";", "import", "com", ".", "vaadin", ".", "terminal", ".", "ThemeResource", ";", "import", "com", ".", "vaadin", ".", "ui", ".", "Button", ";", "import", "com", ".", "vaadin", ".", "ui", ".", "Button", ".", "ClickEvent", ";", "import", "com", ".", "vaadin", ".", "ui", ".", "Component", ";", "import", "com", ".", "vaadin", ".", "ui", ".", "Embedded", ";", "import", "com", ".", "vaadin", ".", "ui", ".", "HorizontalLayout", ";", "import", "com", ".", "vaadin", ".", "ui", ".", "HorizontalSplitPanel", ";", "import", "com", ".", "vaadin", ".", "ui", ".", "TextArea", ";", "import", "com", ".", "vaadin", ".", "ui", ".", "VerticalLayout", ";", "import", "com", ".", "vaadin", ".", "ui", ".", "Window", ";", "import", "com", ".", "vaadin", ".", "ui", ".", "Window", ".", "Notification", ";", "@", "SuppressWarnings", "(", "\"serial\"", ")", "public", "class", "DemoApplication", "extends", "Application", "{", "private", "DemoController", "controller", ";", "private", "TextArea", "xmlArea", ";", "private", "HorizontalSplitPanel", "split", "=", "new", "HorizontalSplitPanel", "(", ")", ";", "private", "Window", "mainWindow", ";", "@", "Override", "public", "void", "init", "(", ")", "{", "setTheme", "(", "\"clara\"", ")", ";", "setMainWindow", "(", "mainWindow", "=", "new", "Window", "(", ")", ")", ";", "controller", "=", "new", "DemoController", "(", "mainWindow", ")", ";", "mainWindow", ".", "setContent", "(", "split", ")", ";", "VerticalLayout", "editor", "=", "new", "VerticalLayout", "(", ")", ";", "editor", ".", "setSpacing", "(", "true", ")", ";", "editor", ".", "setMargin", "(", "false", ",", "false", ",", "false", ",", "true", ")", ";", "editor", ".", "setHeight", "(", "\"100%\"", ")", ";", "editor", ".", "addComponent", "(", "xmlArea", "=", "createXmlArea", "(", ")", ")", ";", "editor", ".", "setExpandRatio", "(", "xmlArea", ",", "1.0f", ")", ";", "editor", ".", "addComponent", "(", "createUpdateButton", "(", ")", ")", ";", "HorizontalLayout", "wrapper", "=", "new", "HorizontalLayout", "(", ")", ";", "wrapper", ".", "setMargin", "(", "true", ")", ";", "wrapper", ".", "setSizeFull", "(", ")", ";", "wrapper", ".", "addComponent", "(", "createLogo", "(", ")", ")", ";", "wrapper", ".", "addComponent", "(", "editor", ")", ";", "wrapper", ".", "setExpandRatio", "(", "editor", ",", "1.0f", ")", ";", "split", ".", "setFirstComponent", "(", "wrapper", ")", ";", "updateLayout", "(", ")", ";", "}", "private", "Component", "createLogo", "(", ")", "{", "Embedded", "logo", "=", "new", "Embedded", "(", "null", ",", "new", "ThemeResource", "(", "\"\"", ")", ")", ";", "logo", ".", "setHeight", "(", "\"90px\"", ")", ";", "logo", ".", "setWidth", "(", "\"90px\"", ")", ";", "return", "logo", ";", "}", "private", "TextArea", "createXmlArea", "(", ")", "{", "TextArea", "area", "=", "new", "TextArea", "(", ")", ";", "area", ".", "setStyleName", "(", "\"xml-area\"", ")", ";", "area", ".", "setSizeFull", "(", ")", ";", "area", ".", "setValue", "(", "readStartingPoint", "(", ")", ")", ";", "return", "area", ";", "}", "private", "Button", "createUpdateButton", "(", ")", "{", "return", "new", "Button", "(", "\"Update\"", ",", "new", "Button", ".", "ClickListener", "(", ")", "{", "public", "void", "buttonClick", "(", "ClickEvent", "event", ")", "{", "updateLayout", "(", ")", ";", "}", "}", ")", ";", "}", "private", "String", "readStartingPoint", "(", ")", "{", "BufferedReader", "reader", "=", "null", ";", "try", "{", "reader", "=", "new", "BufferedReader", "(", "new", "InputStreamReader", "(", "getClass", "(", ")", ".", "getClassLoader", "(", ")", ".", "getResourceAsStream", "(", "\"\"", ")", ")", ")", ";", "StringBuilder", "xml", "=", "new", "StringBuilder", "(", ")", ";", "String", "line", ";", "while", "(", "(", "line", "=", "reader", ".", "readLine", "(", ")", ")", "!=", "null", ")", "{", "xml", ".", "append", "(", "line", ")", ";", "xml", ".", "append", "(", "\"n\"", ")", ";", "}", "return", "xml", ".", "toString", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "finally", "{", "if", "(", "reader", "!=", "null", ")", "{", "try", "{", "reader", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "}", "}", "return", "null", ";", "}", "private", "void", "updateLayout", "(", ")", "{", "try", "{", "Component", "c", "=", "Clara", ".", "create", "(", "new", "ByteArrayInputStream", "(", "xmlArea", ".", "getValue", "(", ")", ".", "toString", "(", ")", ".", "getBytes", "(", ")", ")", ",", "controller", ")", ";", "split", ".", "replaceComponent", "(", "split", ".", "getSecondComponent", "(", ")", ",", "c", ")", ";", "}", "catch", "(", "LayoutInflaterException", "e", ")", "{", "mainWindow", ".", "showNotification", "(", "e", ".", "getMessage", "(", ")", ",", "Notification", ".", "TYPE_ERROR_MESSAGE", ")", ";", "}", "}", "}", ""], "id": 0 } ``` #### python An example of 'train' looks as follows. ``` { "code": ["", "from", "bootstrap", "import", "Bootstrap", "", "from", "fund", "import", "InstantPaymentNotificationHandler", "", "from", "fund", "import", "ThankYouHandler", "", "from", "view", "import", "*", "", "mapping", "=", "[", "(", "", "r'/'", ",", "", "Index", "", ")", ",", "(", "", "r'/ipn'", ",", "", "InstantPaymentNotificationHandler", "", ")", ",", "(", "", "r'/thank-you'", ",", "", "ThankYouHandler", "", ")", ",", "(", "", "r'/about\\/?'", ",", "", "About", "", ")", ",", "(", "", "r'/guide\\/?'", ",", "", "Guide", "", ")", ",", "(", "", "r''", ",", "", "Download", "", ")", ",", "(", "", "r''", ",", "", "Standards", "", ")", ",", "(", "", "r'/community\\/?'", ",", "", "Community", "", ")", ",", "(", "", "r'/news\\/?'", ",", "", "News", "", ")", ",", "(", "", "r'/support\\/?'", ",", "", "Support", "", ")", ",", "(", "", "r'/contact\\/?'", ",", "", "Contact", "", ")", ",", "(", "", "r'/press\\/?'", ",", "", "Press", "", ")", ",", "(", "", "r'/legal/terms'", ",", "", "Terms", "", ")", ",", "(", "", "r'/library\\/?'", ",", "", "Library", "", ")", ",", "(", "", "r''", ",", "", "Library", "", ")", ",", "(", "", "r''", ",", "", "Library", "", ")", ",", "(", "", "r''", ",", "", "Users", "", ")", ",", "(", "", "r''", ",", "", "User", "", ")", ",", "(", "", "r''", ",", "", "Design", "", ")", ",", "(", "", "r''", ",", "", "Design", "", ")", ",", "(", "", "r''", ",", "", "Design", "", ")", ",", "(", "", "r''", ",", "", "Design", "", ")", ",", "(", "", "r''", ",", "", "Design", "", ")", ",", "(", "", "r''", ",", "", "RedirectSuccess", "", ")", ",", "(", "", "r''", ",", "", "RedirectError", "", ")", ",", "(", "", "r''", ",", "", "RedirectAfterDelete", "", ")", ",", "(", "", "r''", ",", "", "Moderate", "", ")", ",", "(", "", "r''", ",", "", "Bootstrap", "", ")", ",", "(", "", "r'/activity'", ",", "", "ActivityScreen", "", ")", ",", "(", "", "r'/txns'", ",", "", "TxnList", "", ")", ",", "(", "", "r''", ",", "", "Base64Blob", "", ")", ",", "(", "", "r''", ",", "", "Base64Blob", "", ")", ",", "(", "", "r''", ",", "", "MessageStrings", "", ")", ",", "(", "", "r'/.*'", ",", "", "NotFound", "", ")", "", "]", ""], "id": 0, "path": "00/wikihouse/urls.py\n" } ``` ### Data Fields In the following each data field in go is explained for each config. The data fields are the same among all splits. #### java |field name| type | description | |----------|----------------|--------------------| |id |int32 | Index of the sample| |code |Sequence[string]| Code Tokens | #### python |field name| type | description | |----------|----------------|-----------------------------| |id |int32 | Index of the sample | |path |string | Original path in the dataset| |code |Sequence[string]| Code Tokens | ### Data Splits #### java | |train|validation|test| |----|----:|---------:|---:| |java|12934| 7189|8268| #### python | |train |test | |------|-----:|----:| |python|100000|50000| ## Dataset Creation ### Curation Rationale [More Information Needed] ### Source Data #### Initial Data Collection and Normalization [More Information Needed] #### Who are the source language producers? [More Information Needed] ### Annotations #### Annotation process [More Information Needed] #### Who are the annotators? [More Information Needed] ### Personal and Sensitive Information [More Information Needed] ## Considerations for Using the Data ### Social Impact of Dataset [More Information Needed] ### Discussion of Biases [More Information Needed] ### Other Known Limitations [More Information Needed] ## Additional Information ### Dataset Curators https://github.com/microsoft, https://github.com/madlag ### Licensing Information Computational Use of Data Agreement (C-UDA) License. ### Citation Information ``` @article{raychev2016probabilistic, title={Probabilistic Model for Code with Decision Trees}, author={Raychev, Veselin and Bielik, Pavol and Vechev, Martin}, journal={ACM SIGPLAN Notices}, pages={731--747}, year={2016}, publisher={ACM New York, NY, USA} } @inproceedings{allamanis2013mining, title={Mining Source Code Repositories at Massive Scale using Language Modeling}, author={Allamanis, Miltiadis and Sutton, Charles}, booktitle={2013 10th Working Conference on Mining Software Repositories (MSR)}, pages={207--216}, year={2013}, organization={IEEE} } ``` The data for "java" configuration comes from: ``` @dataset{rafael_michael_karampatsis_2020_3628665, author = {Rafael - Michael Karampatsis and Hlib Babii and Romain Robbes and Charles Sutton and Andrea Janes}, title = {Preprocessed Java Code Corpus}, month = jan, year = 2020, publisher = {Zenodo}, version = {1.0}, doi = {10.5281/zenodo.3628665}, url = {https://doi.org/10.5281/zenodo.3628665} } ``` ### Contributions Thanks to @madlag (and partly also @ncoop57) for adding this dataset.