CoolFace
Datasetpublic

23ws-LLMcoder/LLMcoder-GitHub-Python-Mix-Direct

Dataset Card for LLMcoder-GitHub-Python-Mix-Direct Python target autocomplete suggestions in the format of conversations for OpenAI's fine-tuning. Dataset Details Dataset Description Curated by: [More Information Needed] Funded by [optional]: [More Information Needed] Shared by [optional]: [More Information Needed] Language(s) (NLP): [More Information Needed] License: [More Information Needed] Dataset Sources [optional] The data… See the full description on the dataset page: https://huggingface.co/datasets/23ws-LLMcoder/LLMcoder-GitHub-Python-Mix-Direct.

sourceHugging Faceupdated 3y agoView on Hugging Face
0likes216downloads
input.txt63 linesDownload Raw Back to pair_99
1"""2Helper functions for creating user-friendly representations3of serializer classes and serializer fields.4"""5import re6 7from django.db import models8from django.utils.encoding import force_str9from django.utils.functional import Promise10 11 12def manager_repr(value):13    model = value.model14    opts = model._meta15    names_and_managers = [16        (manager.name, manager)17        for manager18        in opts.managers19    ]20    for manager_name, manager_instance in names_and_managers:21        if manager_instance == value:22            return '%s.%s.all()' % (model._meta.object_name, manager_name)23    return repr(value)24 25 26def smart_repr(value):27    if isinstance(value, models.Manager):28        return manager_repr(value)29 30    if isinstance(value, Promise) and value._delegate_text:31        value = force_str(value)32 33    value = repr(value)34 35    # Representations like u'help text'36    # should simply be presented as 'help text'37    if value.startswith("u'") and value.endswith("'"):38        return value[1:]39 40    # Representations like41    # <django.core.validators.RegexValidator object at 0x1047af050>42    # Should be presented as43    # <django.core.validators.RegexValidator object>44    return re.sub(' at 0x[0-9A-Fa-f]{4,32}>', '>', value)45 46 47def field_repr(field, force_many=False):48    kwargs = field._kwargs49    if force_many:50        kwargs = kwargs.copy()51        kwargs['many'] = True52        kwargs.pop('child', None)53 54    arg_string = ', '.join([smart_repr(val) for val in field._args])55    kwarg_string = ', '.join([56        '%s=%s' % (key, smart_repr(val))57        for key, val in sorted(kwargs.items())58    ])59    if arg_string and kwarg_string:60        arg_string += ', '61 62    if force_many:63        class_name = f