--- annotations_creators: - found language_creators: - found language: - code license: - c-uda multilinguality: - monolingual size_categories: - 1K package org . rubypeople . rdt . internal . ui . rubyeditor ; import java . util . Iterator ; import org . eclipse . core . resources . IMarker ; import org . eclipse . ui . texteditor . MarkerAnnotation ; import org . eclipse . ui . texteditor . MarkerUtilities ; import org . rubypeople . rdt . core . IRubyElement ; import org . rubypeople . rdt . core . IRubyModelMarker ; import org . rubypeople . rdt . core . IRubyScript ; import org . rubypeople . rdt . core . RubyCore ; public class RubyMarkerAnnotation extends MarkerAnnotation implements IRubyAnnotation { public static final String RUBY_MARKER_TYPE_PREFIX = \"\" ; public static final String ERROR_ANNOTATION_TYPE = \"\" ; public static final String WARNING_ANNOTATION_TYPE = \"\" ; public static final String INFO_ANNOTATION_TYPE = \"\" ; public static final String TASK_ANNOTATION_TYPE = \"\" ; private IRubyAnnotation fOverlay ; public RubyMarkerAnnotation ( IMarker marker ) { super ( marker ) ; } public String [ ] getArguments ( ) { return null ; } public int getId ( ) { IMarker marker = getMarker ( ) ; if ( marker == null || ! marker . exists ( ) ) return - 1 ; if ( isProblem ( ) ) return marker . getAttribute ( IRubyModelMarker . ID , - 1 ) ; return - 1 ; } public boolean isProblem ( ) { String type = getType ( ) ; return WARNING_ANNOTATION_TYPE . equals ( type ) || ERROR_ANNOTATION_TYPE . equals" } ``` #### python An example of 'train' looks as follows. ``` { "gt": "", "id": 0, "input": " from __future__ import absolute_import import weakref import operator from . compat import threading , itertools_filterfalse from . import py2k import types EMPTY_SET = frozenset ( ) class KeyedTuple ( tuple ) : def __new__ ( cls , vals , labels = None ) : t = tuple . __new__ ( cls , vals ) t . _labels = [ ] if labels : t . __dict__ . update ( zip ( labels , vals ) ) t . _labels = labels return t def keys ( self ) : return [ l for l in self . _labels if l is not None ] @ property def _fields ( self ) : return tuple ( self . keys ( ) ) def _asdict ( self ) : return dict ( ( key , self . __dict__ [ key ] ) for key in self . keys ( ) ) class ImmutableContainer ( object ) : def _immutable ( self , * arg , ** kw ) : raise TypeError ( \"\" % self . __class__ . __name__ ) __delitem__ = __setitem__ = __setattr__ = _immutable class immutabledict ( ImmutableContainer , dict ) : clear = pop = popitem = setdefault = update = ImmutableContainer . _immutable def __new__ ( cls , * args ) : new = dict . __new__ ( cls ) dict . __init__ ( new , * args ) return new def __init__ ( self , * args ) : pass def __reduce__ ( self ) : return immutabledict , ( dict ( self ) , ) def union ( self , d ) : if not self : return immutabledict ( d ) else : d2 = immutabledict ( self ) dict . update ( d2 , d ) return d2 def __repr__ ( self ) : return \"\" % dict . __repr__ ( self ) class Properties ( object ) : def __init__ ( self , data ) : self . __dict__ [ '_data' ] = data def __len__ ( self ) : return len ( self . _data ) def __iter__ ( self ) : return iter ( list ( self . _data . values ( ) ) ) def __add__ ( self , other ) : return list ( self ) + list ( other ) def __setitem__ ( self , key , object ) : self . _data [ key ] = object def __getitem__ ( self , key ) : return self . _data [ key ] def __delitem__ ( self , key ) : del self . _data [ key ] def __setattr__ ( self , key , object ) : self . _data [ key ] = object def __getstate__ ( self ) : return { '_data' : self . __dict__ [ '_data' ] } def __setstate__ ( self , state ) : self . __dict__ [ '_data' ] = state [ '_data' ] def __getattr__ ( self , key ) : try : return self . _data [ key ] except KeyError : raise AttributeError ( key ) def __contains__ ( self , key ) : return key in self . _data def as_immutable ( self ) : return ImmutableProperties ( self . _data ) def update ( self , value ) : self . _data . update ( value ) def get ( self , key , default = None ) : if key in self : return self [ key ] else : return default def keys ( self ) : return list ( self . _data ) def values ( self ) : return list ( self . _data . values ( ) ) def items ( self ) : return list ( self . _data . items ( ) ) def has_key ( self , key ) : return key in self . _data def clear ( self ) : self . _data . clear ( ) class OrderedProperties ( Properties ) : def __init__ ( self ) : Properties . __init__ ( self , OrderedDict ( ) ) class ImmutableProperties ( ImmutableContainer , Properties ) : class OrderedDict ( dict ) : def __init__ ( self , ____sequence = None , ** kwargs ) : self . _list = [ ] if ____sequence is None : if kwargs : self . update ( ** kwargs ) else : self . update ( ____sequence , ** kwargs ) def clear ( self ) : self . _list = [ ] dict . clear ( self ) def copy ( self ) : return self . __copy__ ( ) def __copy__ ( self ) : return OrderedDict ( self ) def sort ( self , * arg , ** kw ) : self . _list . sort ( * arg , ** kw ) def update ( self , ____sequence = None , ** kwargs ) : if ____sequence is not None : if hasattr ( ____sequence , 'keys' ) : for key in ____sequence . keys ( ) : self . __setitem__ ( key , ____sequence [ key ] ) else : for key , value in ____sequence : self [ key ] = value if kwargs : self . update ( kwargs ) def setdefault ( self , key , value ) : if key not in self : self . __setitem__ ( key , value ) return value else : return self . __getitem__ ( key ) def __iter__ ( self ) : return iter ( self . _list ) def keys ( self ) : return list ( self ) def values ( self ) : return [ self [ key ] for key in self . _list ] def items ( self ) : return [ ( key , self [ key ] ) for key in self . _list ] if py2k : def itervalues ( self ) : return iter ( self . values ( ) ) def iterkeys ( self ) : return iter ( self ) def iteritems ( self ) : return iter ( self . items ( ) ) def __setitem__ ( self , key , object ) : if key not in self : try : self . _list . append ( key ) except AttributeError : self . _list = [ key ] dict . __setitem__ ( self , key , object ) def __delitem__ ( self , key ) : dict . __delitem__ ( self , key ) self . _list . remove ( key ) def pop ( self , key , * default ) : present = key in self value = dict . pop ( self , key , * default ) if present : self . _list . remove ( key ) return value def popitem ( self ) : item = dict . popitem ( self ) self . _list . remove ( item [ 0 ] ) return item class OrderedSet ( set ) : def __init__ ( self , d = None ) : set . __init__ ( self ) self . _list = [ ] if d is not None : " } ``` ### 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, python |field name| type | description | |----------|------|----------------------------| |id |int32 | Index of the sample | |input |string| Input code string | |gt |string| Code string to be predicted| ### Data Splits | name |train| |------|----:| |java | 3000| |python|10000| ## 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} } ``` ### Contributions Thanks to @madlag (and partly also @ncoop57) for adding this dataset.