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.txt379 linesDownload Raw Back to pair_11
1ue) == 1:2                value = value[0]3            d[key] = value4        response = jsonify(d)5        for key, value in headers.items(multi=True):6            response.headers.add(key, value)7        response_has_changed = response.data != original_data8        if not response_has_changed:9            break10    return response11 12 13@app.route("/cookies")14def view_cookies(hide_env=True):15    """Returns cookie data.16    ---17    tags:18      - Cookies19    produces:20      - application/json21    responses:22      200:23        description: Set cookies.24    """25 26    cookies = dict(request.cookies.items())27 28    if hide_env and ("show_env" not in request.args):29        for key in ENV_COOKIES:30            try:31                del cookies[key]32            except KeyError:33                pass34 35    return jsonify(cookies=cookies)36 37 38@app.route("/forms/post")39def view_forms_post():40    """Simple HTML form."""41 42    return render_template("forms-post.html")43 44 45@app.route("/cookies/set/<name>/<value>")46def set_cookie(name, value):47    """Sets a cookie and redirects to cookie list.48    ---49    tags:50      - Cookies51    parameters:52      - in: path53        name: name54        type: string55      - in: path56        name: value57        type: string58    produces:59      - text/plain60    responses:61      200:62        description: Set cookies and redirects to cookie list.63    """64 65    r = app.make_response(redirect(url_for("view_cookies")))66    r.set_cookie(key=name, value=value, secure=secure_cookie())67 68    return r69 70 71@app.route("/cookies/set")72def set_cookies():73    """Sets cookie(s) as provided by the query string and redirects to cookie list.74    ---75    tags:76      - Cookies77    parameters:78      - in: query79        name: freeform80        explode: true81        allowEmptyValue: true82        schema:83          type: object84          additionalProperties:85            type: string86        style: form87    produces:88      - text/plain89    responses:90      200:91        description: Redirect to cookie list92    """93 94    cookies = dict(request.args.items())95    r = app.make_response(redirect(url_for("view_cookies")))96    for key, value in cookies.items():97        r.set_cookie(key=key, value=value, secure=secure_cookie())98 99    return r100 101 102@app.route("/cookies/delete")103def delete_cookies():104    """Deletes cookie(s) as provided by the query string and redirects to cookie list.105    ---106    tags:107      - Cookies108    parameters:109      - in: query110        name: freeform111        explode: true112        allowEmptyValue: true113        schema:114          type: object115          additionalProperties:116            type: string117        style: form118    produces:119      - text/plain120    responses:121      200:122        description: Redirect to cookie list123    """124 125    cookies = dict(request.args.items())126    r = app.make_response(redirect(url_for("view_cookies")))127    for key, value in cookies.items():128        r.delete_cookie(key=key)129 130    return r131 132 133@app.route("/basic-auth/<user>/<passwd>")134def basic_auth(user="user", passwd="passwd"):135    """Prompts the user for authorization using HTTP Basic Auth.136    ---137    tags:138      - Auth139    parameters:140      - in: path141        name: user142        type: string143      - in: path144        name: passwd145        type: string146    produces:147      - application/json148    responses:149      200:150        description: Sucessful authentication.151      401:152        description: Unsuccessful authentication.153    """154 155    if not check_basic_auth(user, passwd):156        return status_code(401)157 158    return jsonify(authenticated=True, user=user)159 160 161@app.route("/hidden-basic-auth/<user>/<passwd>")162def hidden_basic_auth(user="user", passwd="passwd"):163    """Prompts the user for authorization using HTTP Basic Auth.164    ---165    tags:166      - Auth167    parameters:168      - in: path169        name: user170        type: string171      - in: path172        name: passwd173        type: string174    produces:175      - application/json176    responses:177      200:178        description: Sucessful authentication.179      404:180        description: Unsuccessful authentication.181    """182 183    if not check_basic_auth(user, passwd):184        return status_code(404)185    return jsonify(authenticated=True, user=user)186 187 188@app.route("/bearer")189def bearer_auth():190    """Prompts the user for authorization using bearer authentication.191    ---192    tags:193      - Auth194    parameters:195      - in: header196        name: Authorization197        schema:198          type: string199    produces:200      - application/json201    responses:202      200:203        description: Sucessful authentication.204      401:205        description: Unsuccessful authentication.206    """207    authorization = request.headers.get("Authorization")208    if not (authorization and authorization.startswith("Bearer ")):209        response = app.make_response("")210        response.headers["WWW-Authenticate"] = "Bearer"211        response.status_code = 401212        return response213    slice_start = len("Bearer ")214    token = authorization[slice_start:]215 216    return jsonify(authenticated=True, token=token)217 218 219@app.route("/digest-auth/<qop>/<user>/<passwd>")220def digest_auth_md5(qop=None, user="user", passwd="passwd"):221    """Prompts the user for authorization using Digest Auth.222    ---223    tags:224      - Auth225    parameters:226      - in: path227        name: qop228        type: string229        description: auth or auth-int230      - in: path231        name: user232        type: string233      - in: path234        name: passwd235        type: string236    produces:237      - application/json238    responses:239      200:240        description: Sucessful authentication.241      401:242        description: Unsuccessful authentication.243    """244    return digest_auth(qop, user, passwd, "MD5", "never")245 246 247@app.route("/digest-auth/<qop>/<user>/<passwd>/<algorithm>")248def digest_auth_nostale(qop=None, user="user", passwd="passwd", algorithm="MD5"):249    """Prompts the user for authorization using Digest Auth + Algorithm.250    ---251    tags:252      - Auth253    parameters:254      - in: path255        name: qop256        type: string257        description: auth or auth-int258      - in: path259        name: user260        type: string261      - in: path262        name: passwd263        type: string264      - in: path265        name: algorithm266        type: string267        description: MD5, SHA-256, SHA-512268        default: MD5269    produces:270      - application/json271    responses:272      200:273        description: Sucessful authentication.274      401:275        description: Unsuccessful authentication.276    """277    return digest_auth(qop, user, passwd, algorithm, "never")278 279 280@app.route("/digest-auth/<qop>/<user>/<passwd>/<algorithm>/<stale_after>")281def digest_auth(282    qop=None, user="user", passwd="passwd", algorithm="MD5", stale_after="never"283):284    """Prompts the user for authorization using Digest Auth + Algorithm.285    allow settings the stale_after argument.286    ---287    tags:288      - Auth289    parameters:290      - in: path291        name: qop292        type: string293        description: auth or auth-int294      - in: path295        name: user296        type: string297      - in: path298        name: passwd299        type: string300      - in: path301        name: algorithm302        type: string303        description: MD5, SHA-256, SHA-512304        default: MD5305      - in: path306        name: stale_after307        type: string308        default: never309    produces:310      - application/json311    responses:312      200:313        description: Sucessful authentication.314      401:315        description: Unsuccessful authentication.316    """317    require_cookie_handling = request.args.get("require-cookie", "").lower() in (318        "1",319        "t",320        "true",321    )322    if algorithm not in ("MD5", "SHA-256", "SHA-512"):323        algorithm = "MD5"324 325    if qop not in ("auth", "auth-int"):326        qop = None327 328    authorization = request.headers.get("Authorization")329    credentials = None330    if authorization:331        credentials = parse_authorization_header(authorization)332 333    if (334        not authorization335        or not credentials336        or credentials.type.lower() != "digest"337        or (require_cookie_handling and "Cookie" not in request.headers)338    ):339        response = digest_challenge_response(app, qop, algorithm)340        response.set_cookie("stale_after", value=stale_after)341        response.set_cookie("fake", value="fake_value")342        return response343 344    if require_cookie_handling and request.cookies.get("fake") != "fake_value":345        response = jsonify({"errors": ["missing cookie set on challenge"]})346        response.set_cookie("fake", value="fake_value")347        response.status_code = 403348        return response349 350    current_nonce = credentials.get("nonce")351 352    stale_after_value = None353    if "stale_after" in request.cookies:354        stale_after_value = request.cookies.get("stale_after")355 356    if (357        "last_nonce" in request.cookies358        and current_nonce == request.cookies.get("last_nonce")359        or stale_after_value == "0"360    ):361        response = digest_challenge_response(app, qop, algorithm, True)362        response.set_cookie("stale_after", value=stale_after)363        response.set_cookie("last_nonce", value=current_nonce)364        response.set_cookie("fake", value="fake_value")365        return response366 367    if not check_digest_auth(user, passwd):368        response = digest_challenge_response(app, qop, algorithm, False)369        response.set_cookie("stale_after", value=stale_after)370        response.set_cookie("last_nonce", value=current_nonce)371        response.set_cookie("fake", value="fake_value")372        return response373 374    response = jsonify(authenticated=True, user=user)375    response.set_cookie("fake", value="fake_value")376    if stale_after_value:377        response.set_cookie(378            "stale_after", value=next_stale_after_value(stale_after_value)379