code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
from __future__ import unicode_literals import sys import threading import time from unittest import skipIf, skipUnless from django.db import ( DatabaseError, Error, IntegrityError, OperationalError, connection, transaction, ) from django.test import ( TransactionTestCase, skipIfDBFeature, skipUnlessDBFea...
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/main/java/org/apache/kafka/clients/consumer/internals/metrics/RebalanceCallbackMetricsManager.java
# -*- coding: utf-8 -*- import time, sys # a(activity)代表所有活动的开始时间和结束时间 a = [[5,7],[1,4],[3,5],[0,6],[3,9],[5,9],[6,10],[8,11],[8,12],[2,14],[12,16]] # 首先对a 按照活动的结束时间进行单调递增的排序 a = sorted(a, key=lambda e:e[1]) a.insert(0, [-1,0]) def recurisive_activity_selector(s, f, k, n): # n是所有活动的个数,就是a的长度 ...
unknown
codeparrot/codeparrot-clean
import os import model import redis from . import messaging, record, utils class UserCommand(object): def __init__(self, username, message, dest_port, model_output): self.username = username self.message = message self.dest_port = dest_port self.model_output = model_output de...
unknown
codeparrot/codeparrot-clean
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
unknown
codeparrot/codeparrot-clean
# Copyright 2011-2012 OpenStack Foundation # 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...
unknown
codeparrot/codeparrot-clean
// // thread_pool.hpp // ~~~~~~~~~~~~~~~ // // Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #ifndef BOOST_ASIO_THREAD_POOL_HPP #d...
unknown
github
https://github.com/mysql/mysql-server
extra/boost/boost_1_87_0/boost/asio/thread_pool.hpp
"""Example of Converting TextSum model data. Usage: python data_convert_example.py --command binary_to_text --in_file data/data --out_file data/text_data python data_convert_example.py --command text_to_binary --in_file data/text_data --out_file data/binary_data python data_convert_example.py --command binary_to_text -...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # from trac.core import * from trac.db import * from trac.env import IEnvironmentSetupParticipant from trac.db import Table, Column, DatabaseManager from trac.util.text import printout # Database schema variables db_version_key = 'tracbuildbot_version' db_version = 1 table = Table('buildbot_b...
unknown
codeparrot/codeparrot-clean
# Copyright 2012 NEC Corporation # # 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 ag...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # flake8: noqa from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Route.short_name' db.alter_column('route...
unknown
codeparrot/codeparrot-clean
# Copyright 2017 Nokia. # 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 applic...
unknown
codeparrot/codeparrot-clean
{ "tfcoremock_map": { "attributes": { "map": { "type": "map", "optional": true, "map": { "type": "string" } } } } }
json
github
https://github.com/hashicorp/terraform
testing/equivalence-tests/tests/basic_map/dynamic_resources.json
/* * Copyright 2012-present the original author or authors. * * 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required b...
java
github
https://github.com/spring-projects/spring-boot
buildSrc/src/main/java/org/springframework/boot/build/springframework/CheckAotFactories.java
"""Config flow for Ambiclimate.""" import logging import ambiclimate from homeassistant import config_entries from homeassistant.components.http import HomeAssistantView from homeassistant.const import CONF_CLIENT_ID, CONF_CLIENT_SECRET from homeassistant.core import callback from homeassistant.helpers.aiohttp_client...
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...
unknown
codeparrot/codeparrot-clean
// This defines the ia32 target for UEFI systems as described in the UEFI specification. See the // uefi-base module for generic UEFI options. On ia32 systems // UEFI systems always run in protected-mode, have the interrupt-controller pre-configured and // force a single-CPU execution. // The cdecl ABI is used. It diff...
rust
github
https://github.com/rust-lang/rust
compiler/rustc_target/src/spec/targets/i686_unknown_uefi.rs
""" Models for embargoing visits to certain courses by IP address. WE'RE USING MIGRATIONS! If you make changes to this model, be sure to create an appropriate migration file and check it in at the same time as your model changes. To do that, 1. Go to the edx-platform dir 2. ./manage.py lms schemamigration embargo --...
unknown
codeparrot/codeparrot-clean
# This file is part of Invenio. # Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 CERN. # # Invenio 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, o...
unknown
codeparrot/codeparrot-clean
# # Test does not work on some cards. # from __future__ import print_function, absolute_import, division import threading try: from Queue import Queue # Python 2 except: from queue import Queue # Python 3 import numpy as np from numba import cuda from numba.cuda.testing import unittest, CUDATestCase def new...
unknown
codeparrot/codeparrot-clean
<?php $container->loadFromExtension('framework', [ 'enabled_locales' => ['es'], 'translator' => [ 'providers' => [ 'foo_provider' => [ 'locales' => ['en', 'fr'], ], 'bar_provider' => [ 'locales' => ['de', 'pl'], ] ]...
php
github
https://github.com/symfony/symfony
src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/translator_providers.php
import unittest from django.db import connection from django.conf import settings from django.core.management import call_command from django.db.models import loading # Only perform encrypted fields tests if keyczar is present # Resolves http://github.com/django-extensions/django-extensions/issues/#issue/17 try: ...
unknown
codeparrot/codeparrot-clean
from __future__ import absolute_import from django.utils.translation import ugettext as _ from zerver.lib.actions import check_send_message from zerver.lib.response import json_success, json_error from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view from zerver.models import UserProfile ...
unknown
codeparrot/codeparrot-clean
import os import sys import codecs from glob import glob import logging import zipfile from django.template import loader as template_loader from django.template.loader import render_to_string from django.conf import settings from readthedocs.builds import utils as version_utils from readthedocs.builds.constants impo...
unknown
codeparrot/codeparrot-clean
//go:build !linux /* Copyright 2018 The Kubernetes Authors. 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 agr...
go
github
https://github.com/kubernetes/kubernetes
pkg/kubelet/kubelet_network_others.go
// Copyright (c) 2023 Klemens D. Morgenstern // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_COBALT_LEAF_HPP #define BOOST_COBALT_LEAF_HPP #include <boost/cobalt/detail/leaf.hpp> #include <boost/l...
unknown
github
https://github.com/mysql/mysql-server
extra/boost/boost_1_87_0/boost/cobalt/leaf.hpp
/** * Support classes for setting up * <a href="https://freemarker.apache.org/">FreeMarker</a> * within a Spring application context. */ @NullMarked package org.springframework.ui.freemarker; import org.jspecify.annotations.NullMarked;
java
github
https://github.com/spring-projects/spring-framework
spring-context-support/src/main/java/org/springframework/ui/freemarker/package-info.java
--- c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. SPDX-License-Identifier: curl Short: 1 Long: tlsv1 Tags: Versions Protocols: TLS Added: 7.9.2 Mutexed: tlsv1.1 tlsv1.2 tlsv1.3 Requires: TLS Help: TLSv1.0 or greater Category: tls Multi: mutex See-also: - http1.1 - http2 Example: - --tlsv1 $URL --- #...
unknown
github
https://github.com/curl/curl
docs/cmdline-opts/tlsv1.md
/** @type {import('next').NextConfig} */ module.exports = { turbopack: { resolveAlias: { "react-native": "react-native-web", }, resolveExtensions: [ ".web.js", ".web.jsx", ".web.ts", ".web.tsx", ".mdx", ".tsx", ".ts", ".jsx", ".js", ".mjs",...
javascript
github
https://github.com/vercel/next.js
examples/with-react-native-web/next.config.js
import operator import sys from contextlib import contextmanager from decimal import Decimal from fractions import Fraction from operator import eq from operator import ne from typing import Optional import pytest from _pytest.pytester import Pytester from pytest import approx inf, nan = float("inf"), float("nan") @...
unknown
codeparrot/codeparrot-clean
# The Python ISAPI package. # Exceptions thrown by the DLL framework. class ISAPIError(Exception): def __init__(self, errno, strerror = None, funcname = None): # named attributes match IOError etc. self.errno = errno self.strerror = strerror self.funcname = funcname Exceptio...
unknown
codeparrot/codeparrot-clean
/* * Copyright (C) 2012 The Guava Authors * * 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 agre...
java
github
https://github.com/google/guava
android/guava-tests/test/com/google/common/escape/PackageSanityTests.java
#!/usr/bin/env python """Simple parsers for configuration files.""" from grr.lib import parsers from grr.lib.rdfvalues import protodict as rdf_protodict from grr.parsers import config_file class ProcSysParser(parsers.FileParser): """Parser for /proc/sys entries.""" output_types = ["AttributedDict"] supported_a...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<i@binux.me> # http://binux.me # Created on 2014-03-05 00:11:49 import os import six import copy import time import shutil import logging import logging.config import click import pyspider from pysp...
unknown
codeparrot/codeparrot-clean
#ifndef SRC_STRING_DECODER_INL_H_ #define SRC_STRING_DECODER_INL_H_ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #include "string_decoder.h" namespace node { enum encoding StringDecoder::Encoding() const { return static_cast<enum encoding>(state_[kEncodingField]); } unsigned StringDecoder::BufferedByt...
c
github
https://github.com/nodejs/node
src/string_decoder-inl.h
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Based on AboutClassMethods in the Ruby Koans # from runner.koan import * class AboutClassAttributes(Koan): class Dog(object): pass def test_new_style_class_objects_are_objects(self): # Note: Old style class instances are not objects but they ...
unknown
codeparrot/codeparrot-clean
import datetime import os import re import time from pprint import pformat from urllib import urlencode, quote from urlparse import urljoin try: from cStringIO import StringIO except ImportError: from StringIO import StringIO try: # The mod_python version is more efficient, so try importing it first. fr...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
unknown
codeparrot/codeparrot-clean
# -*- coding:utf-8 -*- ############################################################################## # # Copyright (C) 2012 - 2014 Odoo Canada. All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as publish...
unknown
codeparrot/codeparrot-clean
#!/bin/sh test_description='various @{whatever} syntax tests' . ./test-lib.sh test_expect_success 'setup' ' test_commit one && test_commit two ' check_at() { echo "$2" >expect && git log -1 --format=%s "$1" >actual && test_cmp expect actual } test_expect_success '@{0} shows current' ' check_at @{0} two ' te...
unknown
github
https://github.com/git/git
t/t0101-at-syntax.sh
#!/usr/bin/env python # (c) 2013, Michael Scherer <misc@zarb.org> # # 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 o...
unknown
codeparrot/codeparrot-clean
# Copyright 2020 The StackStorm Authors. # Copyright 2019 Extreme Networks, 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 ...
unknown
codeparrot/codeparrot-clean
import datetime import hashlib import logging import os from itertools import islice from smtplib import SMTPServerDisconnected from urllib.parse import parse_qsl, ParseResult, urlparse, urlsplit, urlunsplit import requests from babel import dates, localedata from celery import chain, chord from django.conf import set...
unknown
codeparrot/codeparrot-clean
import json from udj.models import Participant, Player, ActivePlaylistEntry, LibraryEntry, Vote from udj.views.views06.decorators import PlayerExists, PlayerIsActive, AcceptsMethods, UpdatePlayerActivity, HasNZParams from udj.views.views06.authdecorators import NeedsAuth, IsOwnerOrParticipates, IsOwnerOrParticipatingA...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # # Copyright 2017 F5 Networks Inc. # # 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 lat...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2016, F5 Networks Inc. # 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
# # 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/src/airflow/api_fastapi/auth/managers/models/base_user.py
#! /usr/bin/python # Comfychair test cases for Samba string functions. # Copyright (C) 2003 by Martin Pool <mbp@samba.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 2 of...
unknown
codeparrot/codeparrot-clean
<?php namespace Illuminate\Tests\Database; use BadMethodCallException; use Carbon\Carbon; use Closure; use DateTime; use Illuminate\Contracts\Database\Query\ConditionExpression; use Illuminate\Database\Connection; use Illuminate\Database\Eloquent\Builder as EloquentBuilder; use Illuminate\Database\Query\Builder; use ...
php
github
https://github.com/laravel/framework
tests/Database/DatabaseQueryBuilderTest.php
#!/usr/bin/env python """Test to verify action plugins have an associated module to provide documentation.""" import os def main(): """Main entry point.""" skip = set([ '__init__', # action plugin base class, not an actual action plugin 'net_base', # base class for other net_* action plugins...
unknown
codeparrot/codeparrot-clean
# Copyright 2011, 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
# Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unittests for TestRunResults.""" import unittest from pylib.base.base_test_result import BaseTestResult from pylib.base.base_test_result import Test...
unknown
codeparrot/codeparrot-clean
{ "allRuns": "所有执行", "blockingDeps": { "dependency": "依赖 ", "reason": "原因", "title": "依赖阻碍任务调度" }, "calendar": { "daily": "每日", "hourly": "每小时", "legend": { "less": "更少", "more": "更多" }, "navigation": { "nextMonth": "下个月", "nextYear": "下一年", "previou...
json
github
https://github.com/apache/airflow
airflow-core/src/airflow/ui/public/i18n/locales/zh-CN/dag.json
# -*- coding: utf-8 -*- # # Copyright 2002-2009,2011 Zuza Software Foundation # # This file is part of The Translate Toolkit. # # 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 o...
unknown
codeparrot/codeparrot-clean
from UnitTest import UnitTest def aArgs(*args): return args def ftest(a, b): return [a, b] class ArgsTest(UnitTest): def testNaming1(self): values = ftest(1, 2) self.assertEquals(values[0], 1) self.assertEquals(values[1], 2) def testNaming2(self): values = ftest(a=1,...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # pyswip -- Python SWI-Prolog bridge # Copyright (c) 2007-2012 Yüce Tekol # # 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 lim...
unknown
codeparrot/codeparrot-clean
#include "jemalloc/internal/jemalloc_preamble.h" #include "jemalloc/internal/jemalloc_internal_includes.h" #include "jemalloc/internal/assert.h" #include "jemalloc/internal/buf_writer.h" #include "jemalloc/internal/ckh.h" #include "jemalloc/internal/emitter.h" #include "jemalloc/internal/hash.h" #include "jemalloc/int...
c
github
https://github.com/redis/redis
deps/jemalloc/src/prof_log.c
// Copyright 2023 The Cockroach Authors. // // Use of this software is governed by the CockroachDB Software License // included in the /LICENSE file. package sql import ( "context" "github.com/cockroachdb/cockroach/pkg/kv" "github.com/cockroachdb/cockroach/pkg/security/username" "github.com/cockroachdb/cockroach...
go
github
https://github.com/cockroachdb/cockroach
pkg/sql/reference_provider.go
def min_of_two( x, y ): if x < y: return x return y
unknown
mbpp
/* * By downloading, copying, installing or using the software you agree to this license. * If you do not agree to this license, do not download, install, * copy or use the software. * * * License Agreement * For Open Source Computer Vision Library * ...
cpp
github
https://github.com/opencv/opencv
hal/carotene/src/scharr.cpp
#!/usr/bin/env python # -*- coding: utf-8 -*- # # vim-profiler - Utility script to profile (n)vim (e.g. startup) # Copyright © 2015 Benjamin Chrétien # # 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 Founda...
unknown
codeparrot/codeparrot-clean
from langchain_core.example_selectors.length_based import ( LengthBasedExampleSelector, ) __all__ = ["LengthBasedExampleSelector"]
python
github
https://github.com/langchain-ai/langchain
libs/langchain/langchain_classic/prompts/example_selector/length_based.py
import PostType from "../interfaces/post"; export async function executeGraphQLForBlogPosts( query: string, ): Promise<CmsPost[]> { const graphQLEndpoint = `${process.env.SF_API_URL}graphql`; const response = await fetch(graphQLEndpoint, { method: "POST", body: JSON.stringify({ query }), headers: { "...
typescript
github
https://github.com/vercel/next.js
examples/cms-sitefinity/lib/api.ts
class Solution: def markSkippedPeople(self, people: List[List[str]]): skipped=[] for i,p in enumerate(people): if(len(p)==0 or people.index(p)!=i): skipped+=[i] return skipped def smallestSufficientTeam(self, req_skills: List[str], people: List[List[str]]) ->...
unknown
codeparrot/codeparrot-clean
//go:build linux package daemon import ( "fmt" "github.com/containerd/containerd/v2/pkg/apparmor" aaprofile "github.com/moby/profiles/apparmor" ) // Define constants for native driver const ( unconfinedAppArmorProfile = "unconfined" defaultAppArmorProfile = "docker-default" ) // DefaultApparmorProfile retu...
go
github
https://github.com/moby/moby
daemon/apparmor_default.go
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
unknown
codeparrot/codeparrot-clean
# Author: Leonardo Pistone # Copyright 2014 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any la...
unknown
codeparrot/codeparrot-clean
- name: Uninstall Paramiko using yum history undo command: yum history undo last --assumeyes
unknown
github
https://github.com/ansible/ansible
test/integration/targets/setup_paramiko/uninstall-yum.yml
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Unit tests for the ninja.py file. """ import gyp.generator.ninja as ninja import unittest import StringIO import sys import TestCommon ...
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/config/ConfigTransformerTest.java
from urllib.parse import parse_qs from .exposition import _bake_output from .registry import REGISTRY def make_asgi_app(registry=REGISTRY): """Create a ASGI app which serves the metrics from a registry.""" async def prometheus_app(scope, receive, send): assert scope.get("type") == "http" # Pr...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
unknown
codeparrot/codeparrot-clean
import smtplib from email.message import EmailMessage import tweepy import authentication CONSUMER_KEY = authentication.CONSUMER_KEY CONSUMER_SECRET = authentication.CONSUMER_SECRET ACCESS_TOKEN = authentication.ACCESS_KEY ACCESS_TOKEN_SECRET = authentication.ACCESS_SECRET SEND_EMAIL_ADDRESS = authentication.SEND_EMA...
unknown
codeparrot/codeparrot-clean
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ use Symfony\Bundle\FrameworkBundle\FrameworkBundle; use Symfony\Bundle\FrameworkBu...
php
github
https://github.com/symfony/symfony
src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/RoutingConditionService/bundles.php
# Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com # # 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 ...
unknown
codeparrot/codeparrot-clean
# Copyright 2017-2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev> # Copyright 2017-2018 manawi <https://github.com/manawi> # Copyright 2017-2018 Karamov Ilmir <https://it-projects.info/team/ilmir-k> # Copyright 2017-2018 iledarn <https://github.com/iledarn> # Copyright 2017 Nicolas JEUDY <https://github....
unknown
codeparrot/codeparrot-clean
import os import stat import sys from os.path import join, normcase, normpath, abspath, isabs, sep, dirname from django.utils.encoding import force_text from django.utils import six try: WindowsError = WindowsError except NameError: class WindowsError(Exception): pass if not six.PY3: fs_encoding ...
unknown
codeparrot/codeparrot-clean
# encoding: utf-8 """ pmsi_tunnel.py Created by Thomas Morin on 2014-06-10. Copyright (c) 2014-2015 Orange. All rights reserved. Copyright (c) 2014-2015 Exa Networks. All rights reserved. """ from struct import pack from struct import unpack from exabgp.protocol.ip import IPv4 from exabgp.bgp.message.update.attribut...
unknown
codeparrot/codeparrot-clean
from struct import Struct, unpack_from from .. import dataformat from ..util import dbg, zstr from .empiresdat import endianness from . import unit class Civ(dataformat.Exportable): name_struct = "civilisation" name_struct_file = name_struct struct_description = "describes one a civilisation." ...
unknown
codeparrot/codeparrot-clean
# -*- coding:utf-8 -*- # @author xupingmao <578749341@qq.com> # @since 2017/??/?? # @modified 2021/02/27 16:09:15 import os import sys import glob import xutils import xauth import xtemplate import xconfig import xmanager import time from fnmatch import fnmatch from xutils import dbutil dbutil.register_table("fs_index...
unknown
codeparrot/codeparrot-clean
import contextlib import unittest from .exceptions import InvalidHandshake from .handshake import * from .handshake import accept # private API class HandshakeTests(unittest.TestCase): def test_accept(self): # Test vector from RFC 6455 key = "dGhlIHNhbXBsZSBub25jZQ==" acc = "s3pPLMBiTxaQ...
unknown
codeparrot/codeparrot-clean
'use strict'; const common = require('../common.js'); const bench = common.createBenchmark(main, { method: ['normal', 'destructureObject'], n: [1e8], }); function runNormal(n) { const o = { x: 0, y: 1 }; bench.start(); for (let i = 0; i < n; i++) { /* eslint-disable no-unused-vars */ const x = o.x;...
javascript
github
https://github.com/nodejs/node
benchmark/es/destructuring-object-bench.js
""" This module contains generic exceptions used by template backends. Although, due to historical reasons, the Django template language also internally uses these exceptions, other exceptions specific to the DTL should not be added here. """ class TemplateDoesNotExist(Exception): """ The exception used when a...
unknown
codeparrot/codeparrot-clean
'use strict'; import utils from './utils.js'; import bind from './helpers/bind.js'; import Axios from './core/Axios.js'; import mergeConfig from './core/mergeConfig.js'; import defaults from './defaults/index.js'; import formDataToJSON from './helpers/formDataToJSON.js'; import CanceledError from './cancel/CanceledErr...
javascript
github
https://github.com/axios/axios
lib/axios.js
#ifndef RUBY_INTERNAL_ENCODING_PATHNAME_H /*-*-C++-*-vi:se ft=cpp:*/ #define RUBY_INTERNAL_ENCODING_PATHNAME_H /** * @file * @author Ruby developers <ruby-core@ruby-lang.org> * @copyright This file is a part of the programming language Ruby. * Permission is hereby granted, ...
c
github
https://github.com/ruby/ruby
include/ruby/internal/encoding/pathname.h
/* Copyright 2016 The Kubernetes Authors. 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 writing, ...
go
github
https://github.com/kubernetes/kubernetes
pkg/controlplane/import_known_versions_test.go
bugfixes: - local connection - Pass correct type to become plugins when checking password (https://github.com/ansible/ansible/issues/86458)
unknown
github
https://github.com/ansible/ansible
changelogs/fragments/86473_su_become_local.yml
#!/bin/sh test_description='checkout can handle submodules' . ./test-lib.sh . "$TEST_DIRECTORY"/lib-submodule-update.sh test_expect_success 'setup' ' mkdir submodule && (cd submodule && git init && test_commit first) && git add submodule && test_tick && git commit -m superproject && (cd submodule && test...
unknown
github
https://github.com/git/git
t/t2013-checkout-submodule.sh
""" Custom managers for Django models registered with the tagging application. """ from django.contrib.contenttypes.models import ContentType from django.db import models from tagging.models import Tag, TaggedItem class ModelTagManager(models.Manager): """ A manager for retrieving tags for a particular model....
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # # Electrum - Lightweight Bitcoin Client # Copyright (C) 2015 Thomas Voegtlin # # 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 y...
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
# frozen_string_literal: true # :markup: markdown module AbstractController class Error < StandardError # :nodoc: end end
ruby
github
https://github.com/rails/rails
actionpack/lib/abstract_controller/error.rb
from __future__ import unicode_literals import os import time from django.contrib.auth.models import User from django.utils.datetime_safe import datetime from django.core.files.storage import FileSystemStorage from django.db import models def user_project_directory_path(instance): """ File will be uploaded t...
unknown
codeparrot/codeparrot-clean
# frozen_string_literal: true # :markup: markdown module ActionDispatch # # Action Dispatch AssumeSSL # # When proxying through a load balancer that terminates SSL, the forwarded # request will appear as though it's HTTP instead of HTTPS to the application. # This makes redirects and cookie security target ...
ruby
github
https://github.com/rails/rails
actionpack/lib/action_dispatch/middleware/assume_ssl.rb
#!/bin/sh set -e version="$1" repository="$2" outdir="$3" DOWNLOAD_URL="https://download.docker.com/linux/static/stable/$(xx-info march)/docker-${version#v}.tgz" mkdir "$outdir" if curl --head --silent --fail "${DOWNLOAD_URL}" 1> /dev/null 2>&1; then curl -fsSL "${DOWNLOAD_URL}" | tar -xz docker/docker mv docker/d...
unknown
github
https://github.com/moby/moby
hack/dockerfile/cli.sh
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2014 IBM Corporation # Copyright 2015 Lenovo # # 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/LI...
unknown
codeparrot/codeparrot-clean
# Code to extract organization names from the 'waarde' field of Parlement.com position data # @author Frank Takes - takes@uva.nl # @dependencies: Python 2, Pandas # @run code using: python details.csv # after running once iconv -f utf8 -t ascii//TRANSLIT originalfile > details.csv replace all x with umlaut/accent/...
unknown
codeparrot/codeparrot-clean
"""Test the stacking classifier and regressor.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import re from unittest.mock import Mock import numpy as np import pytest from numpy.testing import assert_array_equal from scipy import sparse from sklearn import config_context from skl...
python
github
https://github.com/scikit-learn/scikit-learn
sklearn/ensemble/tests/test_stacking.py
from django.db import connection from django.db.models import CharField from django.db.models.functions import SHA256 from django.test import TestCase from django.test.utils import register_lookup from ..models import Author class SHA256Tests(TestCase): @classmethod def setUpTestData(cls): Author.obje...
unknown
codeparrot/codeparrot-clean
% This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it. **Description** Returns the values that appear in both input fields. Returns `null` if either field is null or if no values match.
unknown
github
https://github.com/elastic/elasticsearch
docs/reference/query-languages/esql/_snippets/functions/description/mv_intersection.md