code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
import logging import os import sys import threading from flask import Flask, Response from flask.ext.compress import Compress from history.statebuffer import BufferCollection, BufferUpdater compress = Compress() state_buffer = None log = logging.getLogger(__name__) add_headers_cb = None try: import dcos_auth_p...
unknown
codeparrot/codeparrot-clean
""" SoftLayer.hardware ~~~~~~~~~~~~~~~~~~ Hardware Manager/helpers :license: MIT, see LICENSE for more details. """ import logging import socket import time import SoftLayer from SoftLayer.decoration import retry from SoftLayer.managers import ordering from SoftLayer import utils LOGGER = logging.get...
unknown
codeparrot/codeparrot-clean
//===-- ConfigYAMLTests.cpp -----------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===---------------------------...
cpp
github
https://github.com/llvm/llvm-project
clang-tools-extra/clangd/unittests/ConfigYAMLTests.cpp
import numpy as np import time, os, sys import matplotlib.pyplot as plt sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/transformations/')) import utilFunctions as UF impo...
unknown
codeparrot/codeparrot-clean
/* * Copyright (c) 2007 Mockito contributors * This program is made available under the terms of the MIT License. */ package org.concurrentmockito; import static org.mockito.Mockito.atLeastOnce; import static org.mockito.Mockito.verify; import org.junit.Test; import org.mockito.Mock; import org.mockitousage.IMetho...
java
github
https://github.com/mockito/mockito
mockito-core/src/test/java/org/concurrentmockito/ThreadVerifiesContinuouslyInteractingMockTest.java
#!/usr/bin/env python """ Written by Vadim Aleksandrov Github: https://github.com/verdel Email: valeksandrov@me.com This code has been released under the terms of the Apache-2.0 license http://opensource.org/licenses/Apache-2.0 Example of using Storage Policy Based Management (SPBM) API to get VM Home and Virtual Dis...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # pylint: disable=E1101 # pylint: disable=W0621 import uuid import fauxfactory import pytest from widgetastic.exceptions import MoveTargetOutOfBoundsException from cfme import test_requirements from cfme.base.credential import Credential from cfme.cloud.instance import Instance from cfme.cloud...
unknown
codeparrot/codeparrot-clean
// Copyright © 2022 Apple Inc. #pragma once #include <initializer_list> #define TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/Tensor.h> #include <ATen/TensorIterator.h> #include <ATen/Utils.h> #include <ATen/mps/MPSProfiler.h> #include <ATen/mps/MPSStream.h> #include <ATen/native/mps/MetalShaderLibrary.h> #inclu...
c
github
https://github.com/pytorch/pytorch
aten/src/ATen/native/mps/OperationUtils.h
import flask def test_template_rendered(app, client): @app.route("/") def index(): return flask.render_template("simple_template.html", whiskey=42) recorded = [] def record(sender, template, context): recorded.append((template, context)) flask.template_rendered.connect(record, ap...
python
github
https://github.com/pallets/flask
tests/test_signals.py
# Copyright (c) 2008, Chris Moyer http://coredumped.org # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, ...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011-2012 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
unknown
codeparrot/codeparrot-clean
# coding=utf-8 """ History management classes """ import re from typing import List, Union import attr from . import utils from .parsing import Statement @attr.s(frozen=True) class HistoryItem(): """Class used to represent one command in the history list""" _listformat = ' {:>4} {}' _ex_listformat = '...
unknown
codeparrot/codeparrot-clean
name: Lint code on: [push, pull_request] permissions: contents: read jobs: lint: runs-on: ubuntu-24.04 timeout-minutes: 10 steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Python uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d468...
unknown
github
https://github.com/psf/requests
.github/workflows/lint.yml
from django.core.exceptions import FieldError from django.test import TestCase from .models import Choice, Inner, OuterA, OuterB, Poll class NullQueriesTests(TestCase): def test_none_as_null(self): """ Regression test for the use of None as a query value. None is interpreted as an SQL NU...
unknown
codeparrot/codeparrot-clean
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may n...
java
github
https://github.com/apache/kafka
clients/src/test/java/org/apache/kafka/common/utils/ExitTest.java
from __future__ import absolute_import from __future__ import print_function from typing import Any from argparse import ArgumentParser from optparse import make_option from django.core.management.base import BaseCommand from zerver.models import RealmFilter, all_realm_filters, get_realm_by_string_id from zerver.lib...
unknown
codeparrot/codeparrot-clean
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may n...
java
github
https://github.com/apache/kafka
clients/src/test/java/org/apache/kafka/test/TestUtils.java
# This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it w...
unknown
codeparrot/codeparrot-clean
from __future__ import annotations from datetime import datetime from typing import TYPE_CHECKING from unittest import mock import pytest from scrapy.exceptions import ScrapyDeprecationWarning from scrapy.extensions.corestats import CoreStats from scrapy.spiders import Spider from scrapy.statscollectors import Dummy...
python
github
https://github.com/scrapy/scrapy
tests/test_stats.py
#!/usr/bin/python # # Copyright (c) 2016 Matt Davis, <mdavis@ansible.com> # Chris Houseknecht, <house@redhat.com> # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSI...
unknown
codeparrot/codeparrot-clean
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
unknown
codeparrot/codeparrot-clean
/** * Copyright IBM Corp. 2016, 2025 * SPDX-License-Identifier: BUSL-1.1 */ 'use strict'; module.exports = { extends: ['stylelint-config-standard', 'stylelint-prettier/recommended'], };
javascript
github
https://github.com/hashicorp/vault
ui/.stylelintrc.js
# Copyright 2025 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
python
github
https://github.com/huggingface/transformers
src/transformers/models/efficientloftr/__init__.py
# This suite combines testing for change_streams_mongos_passthrough, change_streams_secondary_reads, # and change_streams_sharded_collections_passthrough, while running change streams in v2 version. # If part of this suite fails, you can comment out individual parts or run the above tests # to dig deeper into what is f...
unknown
github
https://github.com/mongodb/mongo
buildscripts/resmokeconfig/matrix_suites/mappings/change_streams_secondary_reads_sharded_collections_v2.yml
from __future__ import division, print_function, absolute_import import numpy as np from scipy.linalg import block_diag from scipy.sparse import csc_matrix from numpy.testing import (TestCase, assert_array_almost_equal, assert_array_equal, assert_array_less, assert_...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # parse and construct FlightGear NET FDM packets # Andrew Tridgell, November 2011 # released under GNU GPL version 2 or later import struct, math class fgFDMError(Exception): '''fgFDM error class''' def __init__(self, msg): Exception.__init__(self, msg) self.message = 'fg...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
unknown
codeparrot/codeparrot-clean
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
unknown
codeparrot/codeparrot-clean
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ...
java
github
https://github.com/apache/hadoop
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/functional/RunnableRaisingIOE.java
# -*- coding: ascii -*- r""" :Copyright: Copyright 2006 - 2015 Andr\xe9 Malo or his licensors, as applicable :License: Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache....
unknown
codeparrot/codeparrot-clean
# -*- encoding: utf-8 -*- """ Tests for django.core.servers. """ from __future__ import unicode_literals import contextlib import errno import os import socket from django.core.exceptions import ImproperlyConfigured from django.test import LiveServerTestCase, override_settings from django.utils._os import upath from ...
unknown
codeparrot/codeparrot-clean
#include "parts.h" #include "util.h" #include "frameobject.h" // PyFrame_New() static PyObject * frame_getlocals(PyObject *self, PyObject *frame) { if (!PyFrame_Check(frame)) { PyErr_SetString(PyExc_TypeError, "argument must be a frame"); return NULL; } return PyFrame_GetLocals((P...
c
github
https://github.com/python/cpython
Modules/_testcapi/frame.c
#!/usr/bin/env python # Copyright 2021 The Matrix.org Foundation C.I.C. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
unknown
codeparrot/codeparrot-clean
from optparse import OptionParser from uuid import uuid4 import re def main(): parser = OptionParser() #parser.add_option("--skip-rows", type="int", dest="skip_rows", default="0", help="Number of lines/rows to skip when using --lines or --csv. Default: %default") (options, arguments) = parser.parse_args() listing...
unknown
codeparrot/codeparrot-clean
// Copyright 2014 The Cockroach Authors. // // Use of this software is governed by the CockroachDB Software License // included in the /LICENSE file. package server import ( "context" "testing" "github.com/cockroachdb/cockroach/pkg/kv/kvpb" "github.com/cockroachdb/cockroach/pkg/roachpb" "github.com/cockroachdb/...
go
github
https://github.com/cockroachdb/cockroach
pkg/server/bench_test.go
//// [tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction1_es5.ts] //// //// [asyncArrowFunction1_es5.ts] var foo = async (): Promise<void> => { }; //// [asyncArrowFunction1_es5.js] "use strict"; var foo = () => __awaiter(void 0, void 0, void 0, function* () { });
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/asyncArrowFunction1_es5(target=es2015).js
use rustc_abi::{HasDataLayout, Reg, Size, TyAbiInterface}; use super::CastTarget; use crate::callconv::{ArgAbi, FnAbi, Uniform}; fn classify_ret<Ty>(ret: &mut ArgAbi<'_, Ty>) { if ret.layout.is_aggregate() && ret.layout.is_sized() { classify_aggregate(ret) } else if ret.layout.size.bits() < 32 && ret....
rust
github
https://github.com/rust-lang/rust
compiler/rustc_target/src/callconv/nvptx64.rs
from task_app import create_app flask_app = create_app() celery_app = flask_app.extensions["celery"]
python
github
https://github.com/pallets/flask
examples/celery/make_celery.py
""" ============================================= A demo of the Spectral Biclustering algorithm ============================================= This example demonstrates how to generate a checkerboard dataset and bicluster it using the :class:`~sklearn.cluster.SpectralBiclustering` algorithm. The spectral biclustering a...
python
github
https://github.com/scikit-learn/scikit-learn
examples/bicluster/plot_spectral_biclustering.py
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may n...
java
github
https://github.com/apache/kafka
clients/src/main/java/org/apache/kafka/common/requests/BeginQuorumEpochResponse.java
import React from 'react'; import { shallow, mount } from 'enzyme'; import { Badge } from 'reactstrap'; import EndpointLink from './EndpointLink'; describe('EndpointLink', () => { it('renders a simple anchor if the endpoint has no query params', () => { const endpoint = 'http://100.104.208.71:15090/stats/prometh...
typescript
github
https://github.com/prometheus/prometheus
web/ui/react-app/src/pages/targets/EndpointLink.test.tsx
"""Integration providing core pieces of infrastructure.""" import asyncio import itertools as it import logging from typing import Awaitable import voluptuous as vol import homeassistant.core as ha import homeassistant.config as conf_util from homeassistant.exceptions import HomeAssistantError from homeassistant.help...
unknown
codeparrot/codeparrot-clean
// This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html #include "precomp.hpp" #include "opencl_kernels_core.hpp" #include "stat.hpp" #include "norm.simd.hpp" #include "norm.simd_de...
cpp
github
https://github.com/opencv/opencv
modules/core/src/norm.dispatch.cpp
urlpatterns = [] handler400 = "django.views.bad_handler" handler403 = "django.invalid_module.bad_handler" handler404 = "invalid_module.bad_handler" handler500 = "django"
python
github
https://github.com/django/django
tests/check_framework/urls/bad_error_handlers_invalid_path.py
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
python
github
https://github.com/apache/airflow
airflow-core/tests/unit/utils/test_memray_utils.py
''' Gesture Surface =============== .. versionadded:: 1.9.0 .. warning:: This is experimental and subject to change as long as this warning notice is present. See :file:`kivy/examples/demo/multistroke/main.py` for a complete application example. ''' __all__ = ('GestureSurface', 'GestureContainer') from...
unknown
codeparrot/codeparrot-clean
import concurrent.futures from . import Command from itertools import chain import logging from ..utils import blue logger = logging.getLogger("repose.command.install") class Install(Command): command = True def _run(self, repoq, target): repositories = {} for repa in self.repa: t...
unknown
codeparrot/codeparrot-clean
import json import marisa_trie import os import shutil from operator import itemgetter import TileStache from werkzeug.serving import run_simple from werkzeug.wrappers import Request, Response from cartograph import Utils from cartograph import Config """ This is an example from a summer research project that adapte...
unknown
codeparrot/codeparrot-clean
# Copyright (C) 2014, Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
unknown
codeparrot/codeparrot-clean
/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; const { SyncWaterfallHook } = require("tapable"); const Compilation = require("../Compilation"); const { CSS_TYPE } = require("../ModuleSourceTypeConstants"); const RuntimeGlobals = require("../RuntimeGlo...
javascript
github
https://github.com/webpack/webpack
lib/css/CssLoadingRuntimeModule.js
# Owner(s): ["oncall: pt2"] """ Test suite for OpInfo ops with unbacked symints. This test marks tensor dimensions as unbacked and verifies that ops can be compiled with fullgraph=True without data-dependent errors (DDEs). """ import copy import unittest import torch import torch._dynamo from torch.testing._interna...
python
github
https://github.com/pytorch/pytorch
test/test_ops_unbacked.py
#!/usr/bin/python #---------------------------------------------------------------------- # Copyright (c) 2011 Raytheon BBN Technologies # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and/or hardware specification (the "Work") to # deal in the Work without restricti...
unknown
codeparrot/codeparrot-clean
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import math import re import numpy as np import pytest from sklearn.base import clone from sklearn.datasets import load_iris, make_blobs, make_classification from sklearn.linear_model import LogisticRegression, Ridge from sklearn.linear_m...
python
github
https://github.com/scikit-learn/scikit-learn
sklearn/linear_model/tests/test_sag.py
import sys import gzip import numpy as np def getNormalizedRankSingleTF(regionPeakFileName, normalizedRankFileName, gz): # Get the normalized rank for the signal in the regionPeak file # Returns a file in narrowPeak format where the signal column has been replaced by a normalized rank regionPeakFile = None normali...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ (C) 2008-2012 Wolfgang Rohdewald <wolfgang@rohdewald.de> kajongg is free software you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version....
unknown
codeparrot/codeparrot-clean
# # # Copyright 2012-2016 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (...
unknown
codeparrot/codeparrot-clean
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
unknown
codeparrot/codeparrot-clean
<?php namespace Illuminate\Tests\Database; use Illuminate\Database\Capsule\Manager as DB; use Illuminate\Database\Eloquent\Model as Eloquent; use PHPUnit\Framework\TestCase; class DatabaseEloquentBelongsToManyEachByIdTest extends TestCase { protected function setUp(): void { $db = new DB; $d...
php
github
https://github.com/laravel/framework
tests/Database/DatabaseEloquentBelongsToManyEachByIdTest.php
package kotlinx.coroutines.test import kotlinx.coroutines.* import kotlinx.coroutines.internal.* import kotlin.coroutines.* internal class TestCoroutineExceptionHandler : AbstractCoroutineContextElement(CoroutineExceptionHandler), CoroutineExceptionHandler { private val _exceptions = mutableListOf<Throwable>(...
kotlin
github
https://github.com/Kotlin/kotlinx.coroutines
kotlinx-coroutines-test/jvm/src/migration/TestCoroutineExceptionHandler.kt
{ "kind": "Dashboard", "apiVersion": "dashboard.grafana.app/v2beta1", "metadata": { "name": "v0alpha1.mysql_fakedata.v42" }, "spec": { "annotations": [ { "kind": "AnnotationQuery", "spec": { "query": { "kind": "DataQuery", "group": "", ...
json
github
https://github.com/grafana/grafana
apps/dashboard/pkg/migration/conversion/testdata/output/migrated_dev_dashboards/datasource-mysql/v0alpha1.mysql_fakedata.v42.v2beta1.json
use super::RngSeed; use std::collections::hash_map::DefaultHasher; use std::hash::Hasher; impl RngSeed { /// Generates a seed from the provided byte slice. /// /// # Example /// /// ``` /// # use tokio::runtime::RngSeed; /// let seed = RngSeed::from_bytes(b"make me a seed"); /// ``` ...
rust
github
https://github.com/tokio-rs/tokio
tokio/src/util/rand/rt_unstable.rs
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import webnotes from webnotes.utils import flt, getdate from webnotes import msgprint from utilities.transaction_base import delete_events class Do...
unknown
codeparrot/codeparrot-clean
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
unknown
codeparrot/codeparrot-clean
from .util import galloping_search from itertools import islice INF = float('inf') class InvertedIndex(object): def __init__(self, tokens): self.__postings = {} self.__corpus_length = 0 self.__next_cache = {} self.__prev_cache = {} for t in tokens: position = ...
unknown
codeparrot/codeparrot-clean
import re from streamlink.plugin import Plugin from streamlink.plugin.api import StreamMapper from streamlink.plugin.api import validate from streamlink.plugin.api import useragents from streamlink.stream import HDSStream from streamlink.stream import HLSStream from streamlink.stream import HTTPStream from streamlink....
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2014-2015 Cedric Bellegarde <cedric.bellegarde@adishatz.org> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later vers...
unknown
codeparrot/codeparrot-clean
from django.contrib.gis.db.models.functions import ( Area, Distance, Length, Perimeter, Transform, Union, ) from django.contrib.gis.geos import GEOSGeometry, LineString, Point from django.contrib.gis.measure import D # alias for Distance from django.db import NotSupportedError, connection from ...
python
github
https://github.com/django/django
tests/gis_tests/distapp/tests.py
import re import sys from io import StringIO import numpy as np import pytest import scipy.sparse as sp from numpy.testing import assert_allclose from scipy.optimize import check_grad from scipy.spatial.distance import pdist, squareform from sklearn import config_context from sklearn.datasets import make_blobs # myp...
python
github
https://github.com/scikit-learn/scikit-learn
sklearn/manifold/tests/test_t_sne.py
/* Copyright 2021 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
c
github
https://github.com/tensorflow/tensorflow
tensorflow/compiler/mlir/tfrt/ir/tfrt_fallback_common.h
"""Conversions to/from quoted-printable transport encoding as per RFC 1521.""" # (Dec 1991 version). __all__ = ["encode", "decode", "encodestring", "decodestring"] ESCAPE = b'=' MAXLINESIZE = 76 HEX = b'0123456789ABCDEF' EMPTYSTRING = b'' try: from binascii import a2b_qp, b2a_qp except ImportError: a2b_qp =...
python
github
https://github.com/python/cpython
Lib/quopri.py
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from pathlib import Path import textwrap from django.core.management.base import BaseCommand class Command(BaseCommand...
unknown
codeparrot/codeparrot-clean
# Copyright: (c) 2018, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.module_utils._text import to_text from ansible.module_utils.aws.waiters import get_wa...
unknown
codeparrot/codeparrot-clean
<?php namespace Illuminate\Auth\Middleware; use Closure; use Illuminate\Contracts\Routing\ResponseFactory; use Illuminate\Contracts\Routing\UrlGenerator; use Illuminate\Support\Facades\Date; class RequirePassword { /** * The response factory instance. * * @var \Illuminate\Contracts\Routing\Respons...
php
github
https://github.com/laravel/framework
src/Illuminate/Auth/Middleware/RequirePassword.php
from opm._common import eclArrType from opm._common import EclFile from opm._common import ERst from opm._common import ESmry from opm._common import EGrid from opm._common import ERft from opm._common import EclOutput import sys import datetime import numpy as np import datetime # When extracting the strings from CH...
unknown
codeparrot/codeparrot-clean
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
python
github
https://github.com/apache/airflow
airflow-core/src/airflow/example_dags/example_asset_decorator.py
import os from fabric.context_managers import settings from fabric.state import env from .base import BaseProvider from ..project import * from ... import debian from ... import supervisor from ...app import blueprint class SupervisorProvider(BaseProvider): def install(self): """ Install system...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ kombu.async.timer ================= Timer scheduling Python callbacks. """ from __future__ import absolute_import import heapq import sys from collections import namedtuple from datetime import datetime from functools import wraps from time import time from weakref import proxy as weakre...
unknown
codeparrot/codeparrot-clean
# pylint: disable=no-member """ This file exposes a number of password complexity validators which can be optionally added to account creation This file was inspired by the django-passwords project at https://github.com/dstufft/django-passwords authored by dstufft (https://github.com/dstufft) """ from __future__ impor...
unknown
codeparrot/codeparrot-clean
// Generic big-endian AArch64 target for bare-metal code - Floating point disabled // // Can be used in conjunction with the `target-feature` and // `target-cpu` compiler flags to opt-in more hardware-specific // features. // // For example, `-C target-cpu=cortex-a53`. use rustc_abi::Endian; use crate::spec::{ Abi...
rust
github
https://github.com/rust-lang/rust
compiler/rustc_target/src/spec/targets/aarch64_be_unknown_none_softfloat.rs
""" analysis ======== Library code for analysing captures returned by `Scope.capture()`. """ # pylama:ignore=C0103,R1716 import numpy as np from utils import DotDict def interpolate_min_x(f, x): return 0.5 * (f[x-1] - f[x+1]) / (f[x-1] - 2 * f[x] + f[x+1]) + x def rms(f): return np.sqrt((f ** 2).mean()) ...
unknown
codeparrot/codeparrot-clean
package libnetwork import ( "context" "encoding/json" "errors" "fmt" "net" "net/netip" "reflect" "runtime" "testing" "time" "github.com/google/go-cmp/cmp/cmpopts" "github.com/moby/moby/v2/daemon/libnetwork/config" "github.com/moby/moby/v2/daemon/libnetwork/driverapi" "github.com/moby/moby/v2/daemon/libn...
go
github
https://github.com/moby/moby
daemon/libnetwork/libnetwork_internal_test.go
import threading from django.conf import settings from django.test.client import RequestFactory from django.core.urlresolvers import reverse as django_reverse from django.utils.translation.trans_real import parse_accept_lang_header # Thread-local storage for URL prefixes. Access with (get|set)_url_prefix. _locals = t...
unknown
codeparrot/codeparrot-clean
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
unknown
codeparrot/codeparrot-clean
class EventException(Exception): pass class EventAddException(EventException): pass class EventRemoveException(EventException): pass class EventCallException(EventException): pass class ServerException(Exception): pass class PortAlreadyInUse(ServerException): pass class ConnectionException...
unknown
codeparrot/codeparrot-clean
# -*- encoding: utf-8 -*- from __future__ import unicode_literals import re from unittest import skipUnless from django.core.management import call_command from django.db import connection from django.test import TestCase, skipUnlessDBFeature from django.utils.six import PY3, StringIO from .models import ColumnTypes...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # Copyright 2012 by Giorgos Tsiapaliokas <terietor@gmail.com> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option)...
unknown
codeparrot/codeparrot-clean
{ "RESTORE": { "summary": "Restores all libraries from a payload.", "complexity": "O(N) where N is the number of functions on the payload", "group": "scripting", "since": "7.0.0", "arity": -3, "container": "FUNCTION", "function": "functionRestoreCommand", ...
json
github
https://github.com/redis/redis
src/commands/function-restore.json
# -*- coding: utf-8 -*- # # Copyright (C)2006-2009 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.org/wiki/TracLicense. # # This software consis...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2018, Felix Fontein <felix@fontein.de> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
unknown
codeparrot/codeparrot-clean
package opts import ( "fmt" "github.com/docker/go-units" "github.com/moby/moby/api/types/container" ) // UlimitOpt defines a map of Ulimits type UlimitOpt struct { values *map[string]*container.Ulimit } // NewUlimitOpt creates a new UlimitOpt func NewUlimitOpt(ref *map[string]*container.Ulimit) *UlimitOpt { //...
go
github
https://github.com/moby/moby
daemon/pkg/opts/ulimit.go
""" --- Reuben Thorpe (2015) --- The TSP class provides novice solutions to the 'complete and semetric traveling salsmen problem' for advent of code 2015. To be added - [held-karp algorithem, monte-carlo simulation] """ from itertools import permutations from time import process_time import math cla...
unknown
codeparrot/codeparrot-clean
""" mbed SDK Copyright (c) 2011-2013 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wr...
unknown
codeparrot/codeparrot-clean
use crate::spec::{ Arch, Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target, TargetMetadata, TargetOptions, base, }; pub(crate) fn target() -> Target { let mut base = base::netbsd::opts(); base.cpu = "x86-64".into(); base.plt_by_default = false; base.max_atomic_width = Some(64); ba...
rust
github
https://github.com/rust-lang/rust
compiler/rustc_target/src/spec/targets/x86_64_unknown_netbsd.rs
--- c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. SPDX-License-Identifier: curl Title: CURLMOPT_PIPELINING_SITE_BL Section: 3 Source: libcurl See-also: - CURLMOPT_PIPELINING (3) - CURLMOPT_PIPELINING_SERVER_BL (3) Protocol: - HTTP Added-in: 7.30.0 --- # NAME CURLMOPT_PIPELINING_SITE_BL - pipelining...
unknown
github
https://github.com/curl/curl
docs/libcurl/opts/CURLMOPT_PIPELINING_SITE_BL.md
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package time_test import ( "fmt" "runtime" "sync" "testing" . "time" ) func TestTicker(t *testing.T) { t.Parallel() // We want to test that a ticker t...
go
github
https://github.com/golang/go
src/time/tick_test.go
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Optional from typing_extensions import Literal from ...._models import BaseModel __all__ = ["PermissionRetrieveResponse", "Data"] class Data(BaseModel): """ The `checkpoint.permission` object repre...
python
github
https://github.com/openai/openai-python
src/openai/types/fine_tuning/checkpoints/permission_retrieve_response.py
#!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (th...
unknown
codeparrot/codeparrot-clean
# (c) 2014 Deutsche Telekom AG # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
unknown
codeparrot/codeparrot-clean
/* * Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.analysis.api.descriptors import com.intellij.openapi.project.Project import org....
kotlin
github
https://github.com/JetBrains/kotlin
analysis/analysis-api-fe10/src/org/jetbrains/kotlin/analysis/api/descriptors/KaFe10SessionProvider.kt
#!/usr/bin/env python ### BEGIN PLUGIN INFO # [plugin] # plugin_format: 0, 0 # name: Gajim tune # version: 0, 0, 1 # description: Update the MPRIS (in Gajim etc.) tune information. # author: Fomin Denis # author_email: fominde@gmail.com # url: http://sonata.berlios.de # license: GPL v3 or later # [capabilities] # enab...
unknown
codeparrot/codeparrot-clean