code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
"""Tests for special utilities related to nuclear problems.""" import random import pytest from sympy import Symbol, symbols, KroneckerDelta, sqrt, IndexedBase from drudge import NuclearBogoliubovDrudge, Range, Term from drudge.nuclear import ( JOf, MOf, CG, Wigner6j, Wigner3j, _simpl_pono_term ) from conftest ...
unknown
codeparrot/codeparrot-clean
""" Test Form class. Objective: Test parameters, and behavior. """ import datetime from django.test import TestCase, override_settings from django.core.urlresolvers import reverse from mock import patch from colab.accounts import forms as accounts_forms from colab.accounts.models import User from colab.accounts.forms ...
unknown
codeparrot/codeparrot-clean
// Copyright IBM Corp. 2016, 2025 // SPDX-License-Identifier: BUSL-1.1 package command import ( "strings" "github.com/hashicorp/cli" ) var _ cli.Command = (*PolicyCommand)(nil) // PolicyCommand is a Command that holds the audit commands type PolicyCommand struct { *BaseCommand } func (c *PolicyCommand) Synopsi...
go
github
https://github.com/hashicorp/vault
command/policy.go
# Copyright 2010-2011 OpenStack Foundation # Copyright 2012-2013 IBM Corp. # 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/li...
unknown
codeparrot/codeparrot-clean
from geopy import Point from geopy.util import NULL_HANDLER from geopy.parsers.iso8601 import parse_iso8601 import sys, re, logging from xml.etree import ElementTree log = logging.getLogger(__name__) log.addHandler(NULL_HANDLER) class VersionError(Exception): pass class Waypoint(Point): ''' A `Waypoint`...
unknown
codeparrot/codeparrot-clean
//////////////////////////////////////////////////////////////////////////// // // Copyright 2020 Realm 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/li...
swift
github
https://github.com/realm/realm-swift
RealmSwift/Tests/MutableSetTests.swift
#!/bin/python import os import sys from pymongo import MongoClient from bson.objectid import ObjectId def modifyConfig(expression, value): print('Modifying server.properties '+expression+' with value '+str(value)) os.system("sed -i 's/"+str(expression)+"/"+str(value)+"/' server.properties") def modifyLog(expr...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ Created on Thu Sep 08 15:09:49 2016 #test Github @author: tih """ import numpy as np import os import scipy.interpolate import gdal from openpyxl import load_workbook import osr from datetime import datetime, timedelta import pandas as pd import shutil import glob from netCDF4 import Dataset...
unknown
codeparrot/codeparrot-clean
/* * 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
configuration-metadata/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/ConstructorParameterPropertyDescriptor.java
import unittest from dnd_character import Character, modifier # Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0 class DnDCharacterTest(unittest.TestCase): def test_modifier_for_score_3_is_n4(self): self.assertEqual(modifier(3), -4) def test_modifier_for_score_4_is_n3(self):...
unknown
codeparrot/codeparrot-clean
import doctest from insights.parsers import redhat_release from insights.parsers.redhat_release import RedhatRelease from insights.tests import context_wrap REDHAT_RELEASE1 = """ Red Hat Enterprise Linux Server release 6.7 (Santiago) """.strip() REDHAT_RELEASE2 = """ Red Hat Enterprise Linux Server release 7.2 (Maip...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # this is a windows documentation stub. actual code lives in the .ps1 # file of the same name ANSIBLE_METADATA = {'metadata_version': '1.1', ...
unknown
codeparrot/codeparrot-clean
<?php namespace Illuminate\Tests\Redis; use Illuminate\Contracts\Redis\Connector; use Illuminate\Foundation\Application; use Illuminate\Redis\RedisManager; use Mockery as m; use PHPUnit\Framework\TestCase; class RedisManagerExtensionTest extends TestCase { /** * @var \Illuminate\Redis\RedisManager */ ...
php
github
https://github.com/laravel/framework
tests/Redis/RedisManagerExtensionTest.php
#!/usr/bin/python # -*- coding: ascii -*- ########################################################################### # PBKDF2.py - PKCS#5 v2.0 Password-Based Key Derivation # # Copyright (C) 2007, 2008 Dwayne C. Litzenberger <dlitz@dlitz.net> # All rights reserved. # # Permission to use, copy, modify, and distribute t...
unknown
codeparrot/codeparrot-clean
#ifndef HEADER_CURL_TFTP_H #define HEADER_CURL_TFTP_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| ...
c
github
https://github.com/curl/curl
lib/tftp.h
#!/usr/bin/env python # Copyright 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. """ Replaces gyp files in tree with files from here that make the build use system libraries. """ import optparse import os.path impor...
unknown
codeparrot/codeparrot-clean
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # # Description: generate inputs and targets for the DLRM benchmark # # Utility function(s) to download and pre-process public data sets # - ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python3 # Copyright (c) 2014-present, The osquery authors # # This source code is licensed as defined by the LICENSE file found in the # root directory of this source tree. # # SPDX-License-Identifier: (Apache-2.0 OR GPL-2.0-only) import json import os import sys try: import argparse except Import...
unknown
codeparrot/codeparrot-clean
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( str_to_int, ExtractorError ) class AppleConnectIE(InfoExtractor): _VALID_URL = r'https?://itunes\.apple\.com/\w{0,2}/?post/idsa\.(?P<id>[\w-]+)' _TEST = { 'url': 'https://itunes.appl...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf_8 -*- # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 # Crypto Key Database import os import sqlite3 import shutil import uuid import random import base64 import Crypto.PublicKey.RSA import Crypto.Random.random import Crypto.Cipher.PKCS1_OAEP import Crypto.Hash.SHA256 # increment keydb_vers...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # Copyright (c) 2012 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. '''Handling of the <message> element. ''' import re import types from grit.node import base import grit.format.rc_header import ...
unknown
codeparrot/codeparrot-clean
from django.core.exceptions import ValidationError from .factories import PhotoSizeFactory from .helpers import PhotologueBaseTest class PhotoSizeNameTest(PhotologueBaseTest): def test_valid_name(self): """We are restricted in what names we can enter.""" photosize = PhotoSizeFactory() ph...
unknown
codeparrot/codeparrot-clean
use std::fmt::{Debug, Formatter}; use std::io; use rustc_public_bridge::bridge; use serde::Serialize; use crate::abi::FnAbi; use crate::crate_def::CrateDef; use crate::mir::Body; use crate::ty::{Allocation, ClosureDef, ClosureKind, FnDef, GenericArgs, Ty, index_impl}; use crate::{CrateItem, DefId, Error, ItemKind, Op...
rust
github
https://github.com/rust-lang/rust
compiler/rustc_public/src/mir/mono.rs
import string, random words = open("Alice's Adventures in Wonderland by Lewis Carroll.txt").read().split('\n') xwords = open('words.txt').read().split('\n') emma = open('Emma by Jane Austen.txt').read().split('\n') def break_book_into_words(book): #apostrophes are a problem, don't => dont lower_book = '' no_punct ...
unknown
codeparrot/codeparrot-clean
# 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. import filecmp import gyp.common import gyp.xcodeproj_file import errno import os import sys import posixpath import re import shutil import subprocess import temp...
unknown
codeparrot/codeparrot-clean
# Copyright 2015 HGST # 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 agree...
unknown
codeparrot/codeparrot-clean
# (c) 2016, Ansible by Red Hat <info@ansible.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) any later v...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # coding=utf8 """ Reference archive table from suite and add path to archive root @contact: Debian FTP Master <ftpmaster@debian.org> @copyright: 2012 Ansgar Burchardt <ansgar@debian.org> @license: GNU General Public License version 2 or later """ # This program is free software; you can redistr...
unknown
codeparrot/codeparrot-clean
/* @Copyright Barrett Adair 2015-2017 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_CLBL_TRTS_ADD_MEMBER_CV_HPP #define BOOST_CLBL_TRTS_ADD_MEMBER_CV_HPP #include <boost/callable_traits/detail/core.hpp> nam...
unknown
github
https://github.com/mysql/mysql-server
extra/boost/boost_1_87_0/boost/callable_traits/add_member_cv.hpp
#!/usr/bin/env python """ Example script to control a Scrapy server using its JSON-RPC web service. It only provides a reduced functionality as its main purpose is to illustrate how to write a web service client. Feel free to improve or write you own. Also, keep in mind that the JSON-RPC API is not stable. The recomm...
unknown
codeparrot/codeparrot-clean
from __future__ import with_statement import os def vs9to8(src, dest): for name in os.listdir(src): path, ext = os.path.splitext(name) if ext.lower() not in ('.sln', '.vcproj', '.vsprops'): continue filename = os.path.normpath(os.path.join(src, name)) destname = os.path...
unknown
codeparrot/codeparrot-clean
name: Dairy products: - name: cheese price: 5.5 - name: milk price: 2.75
unknown
github
https://github.com/jekyll/jekyll
test/source/_data/categories.01/dairy.yaml
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ *************************************************************************** parse_dash_results.py --------------------- Date : October 2016 Copyright : (C) 2016 by Nyall Dawson Email : nyall dot dawson at g...
unknown
codeparrot/codeparrot-clean
# pylint: disable=E0601,W0622,W0611 # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of logilab-common. # # logilab-common is free software: you can redistribute it and/or modify it under # the terms of the GNU L...
unknown
codeparrot/codeparrot-clean
/*------------------------------------------------------------------------- * * nodeCtescan.c * routines to handle CteScan nodes. * * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION * src/back...
c
github
https://github.com/postgres/postgres
src/backend/executor/nodeCtescan.c
# # This program creates a Deck of Cards # from collections import namedtuple from random import choice # What is the card composed of? A card is made up of a rank and suit Card = namedtuple('Card', ['rank', 'suit']) suit_values = dict(spades=3, hearts=2, diamonds=1, clubs=0) def spades_high(card): rank_index =...
unknown
codeparrot/codeparrot-clean
# It's most useful to run these tests with ThreadSanitizer enabled. import sys import functools import threading import time import unittest import _testinternalcapi import warnings from test.support import threading_helper class TestBase(unittest.TestCase): pass def do_race(func1, func2): """Run func1() and...
python
github
https://github.com/python/cpython
Lib/test/test_free_threading/test_races.py
import PyQt4.uic import os import PyQt4 from PyQt4.QtGui import (QLabel, QDialog, QFileDialog, QPixmap, QGridLayout, QLayout, QWidget) from PyQt4.QtCore import (QByteArray, QBuffer, QIODevice, QEvent, QObject, pyqtSignal) import logging import images_rc basepath = os.path.dirname(__file__) uipath = o...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 17-7-22 上午12:41 # @Author : tom.lee # @docs : http://old.sebug.net/paper/books/scipydoc/numpy_intro.html # @File : study_numpy.py # @Software: PyCharm """ numpy Numpy是Python的一个科学计算的库,提供了矩阵运算的功能,其一般与Scipy,matplotlib一起使用. NumPy提供了两种基本的对象: ndarray(N-d...
unknown
codeparrot/codeparrot-clean
#ifndef SRC_COMPILE_CACHE_H_ #define SRC_COMPILE_CACHE_H_ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #include <cinttypes> #include <memory> #include <string> #include <string_view> #include <unordered_map> #include "v8.h" namespace node { class Environment; #define CACHED_CODE_TYPES(V) ...
c
github
https://github.com/nodejs/node
src/compile_cache.h
/* Copyright 2025 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/securitycontext/util_linux.go
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2 --- $id: http://devicetree.org/schemas/memory-controllers/ingenic,nemc.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# title: Ingenic SoCs NAND / External Memory Controller (NEMC) maintainers: - Paul Cercueil <paul@crapouillou.net> pr...
unknown
github
https://github.com/torvalds/linux
Documentation/devicetree/bindings/memory-controllers/ingenic,nemc.yaml
import colorsys import datetime class ColourScheme(object): cols_android = { 'light_blue' : '33b5e5', 'blue' : '0099cc', 'light_purple' : 'aa66cc', 'purple' : '9933cc', 'light_green' : '99cc00', 'green' : '669900', 'light_yellow' : 'ff...
unknown
codeparrot/codeparrot-clean
from django.test import TestCase from regressiontests.select_related_regress.models import * class SelectRelatedRegressTests(TestCase): def test_regression_7110(self): """ Regression test for bug #7110. When using select_related(), we must query the Device and Building tables usin...
unknown
codeparrot/codeparrot-clean
# Copyright 2018 Google LLC # # 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, s...
unknown
codeparrot/codeparrot-clean
# django imports from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic from django.db import models from django.utils.translation import ugettext_lazy as _ class CriteriaObjects(models.Model): """Assigns arbitrary criteria to arbitrary content objects. """ ...
unknown
codeparrot/codeparrot-clean
import json import urllib import openerp from openerp import http from openerp.http import request import openerp.addons.web.controllers.main as webmain from openerp.addons.web.http import SessionExpiredException from werkzeug.exceptions import BadRequest import werkzeug.utils class google_auth(http.Controller): ...
unknown
codeparrot/codeparrot-clean
from __future__ import unicode_literals, division, absolute_import import logging from datetime import datetime, timedelta from sqlalchemy import Column, Integer, String, Unicode, DateTime, ForeignKey, and_, Index from sqlalchemy.orm import relation from flexget import db_schema, options, plugin from flexget.event im...
unknown
codeparrot/codeparrot-clean
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2 --- $id: http://devicetree.org/schemas/clock/ti,am62-audio-refclk.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# title: TI Audio Reference Clock maintainers: - Jai Luthra <j-luthra@ti.com> properties: compatible: items: -...
unknown
github
https://github.com/torvalds/linux
Documentation/devicetree/bindings/clock/ti,am62-audio-refclk.yaml
import { flushSync } from 'svelte'; import { test } from '../../test'; export default test({ get props() { return { items: ['one', 'two', 'three'] }; }, html: ` <div> <input><p>one</p> </div> <div> <input><p>two</p> </div> <div> <input><p>three</p> </div> `, ssrHtml: ` <div> <input v...
javascript
github
https://github.com/sveltejs/svelte
packages/svelte/tests/runtime-legacy/samples/binding-input-text-contextual/_config.js
# # Copyright 2005,2006,2012-2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # any lat...
unknown
codeparrot/codeparrot-clean
#ifndef TABLE_INCLUDED #define TABLE_INCLUDED /* Copyright (c) 2000, 2025, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by the Free Software Foundation. This program is de...
c
github
https://github.com/mysql/mysql-server
sql/table.h
#ifdef _MSC_VER # include <nmmintrin.h> # if defined(_M_X64) # define CV_POPCNT_U64 _mm_popcnt_u64 # endif # define CV_POPCNT_U32 _mm_popcnt_u32 #elif defined(__POPCNT__) # include <popcntintrin.h> # if defined(__x86_64__) # define CV_POPCNT_U64 __builtin_popcountll # endif # define CV_POPCNT_U32 __builti...
cpp
github
https://github.com/opencv/opencv
cmake/checks/cpu_popcnt.cpp
/* Copyright 2024 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/transforms/ifrt/ifrt_types.h
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'Template.template' db.delete_column('popcorn_template', 'template') def backwards(self...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # # Created on Aug 25, 2016 # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # # # 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...
unknown
codeparrot/codeparrot-clean
var value = { ho: [ 1, 2 ] }; var tmp = value.ho, hey = tmp === void 0 ? [] : tmp; console.log(hey);
javascript
github
https://github.com/vercel/next.js
crates/next-custom-transforms/tests/loader/issue-30766/output.js
import os from flask import Flask, request, Response from flask import render_template, url_for, redirect, send_from_directory from flask import send_file, make_response, abort from angular_flask import app # routing for API endpoints, generated from the models designated as API_MODELS from angular_flask.core import...
unknown
codeparrot/codeparrot-clean
""" Sync Media to S3 ================ Django command that scans all files in your settings.MEDIA_ROOT and settings.STATIC_ROOT folders and uploads them to S3 with the same directory structure. This command can optionally do the following but it is off by default: * gzip compress any CSS and Javascript files it finds ...
unknown
codeparrot/codeparrot-clean
// Copyright IBM Corp. 2016, 2025 // SPDX-License-Identifier: BUSL-1.1 package command import ( "crypto/rand" "crypto/rsa" "crypto/sha256" "crypto/x509" "encoding/base64" "encoding/pem" "errors" "fmt" "os" "regexp" "strings" "github.com/hashicorp/cli" "github.com/hashicorp/vault/api" "github.com/posene...
go
github
https://github.com/hashicorp/vault
command/transit_import_key.go
/* * Copyright 2002-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-framework
spring-beans/src/test/java/org/springframework/beans/support/ProtectedBaseBean.java
# Generated by h2py from \mssdk\include\shlobj.h and shellapi.h WM_USER = 1024 DROPEFFECT_NONE = 0 DROPEFFECT_COPY = 1 DROPEFFECT_MOVE = 2 DROPEFFECT_LINK = 4 DROPEFFECT_SCROLL = -2147483648 FO_MOVE = 1 FO_COPY = 2 FO_DELETE = 3 FO_RENAME = 4 ## File operation flags used with shell.SHFileOperation FOF_MULTIDESTFILES ...
unknown
codeparrot/codeparrot-clean
""" Mixins to facilitate testing OAuth connections to Django-OAuth-Toolkit or Django-OAuth2-Provider. """ # pylint: disable=protected-access from unittest import skip, expectedFailure from django.test.client import RequestFactory from openedx.core.djangoapps.oauth_dispatch import adapters from openedx.core.djangoapp...
unknown
codeparrot/codeparrot-clean
# This file is part of Headphones. # # Headphones 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. # # Headphones is distributed i...
unknown
codeparrot/codeparrot-clean
import re from django.conf import settings from django.core.exceptions import ImproperlyConfigured, PermissionDenied from django.utils.module_loading import import_by_path from django.middleware.csrf import rotate_token from .signals import user_logged_in, user_logged_out, user_login_failed SESSION_KEY = '_auth_user...
unknown
codeparrot/codeparrot-clean
apiVersion: test.com/v1 kind: Example metadata: name: test spec: test: test
unknown
github
https://github.com/kubernetes/kubernetes
hack/testdata/CRD/example-crd-1-cluster-scoped-resource.yaml
// LANGUAGE: +JvmIndyAllowLambdasWithAnnotations // WITH_FIR_TEST_COMPILER_PLUGIN // DUMP_IR // MODULE: lib // MODULE_KIND: LibraryBinary // FILE: p3/foo.kt package p3 import org.jetbrains.kotlin.plugin.sandbox.MyInlineable @MyInlineable fun Scaffold(x: @MyInlineable () -> (@MyInlineable () -> Unit)) { } // MODULE:...
kotlin
github
https://github.com/JetBrains/kotlin
analysis/analysis-api/testData/components/compilerFacility/firPluginPrototypeMultiModule/functionParamInBinaryModule3.kt
package libnetwork import ( "fmt" "net" "net/netip" "testing" "github.com/Microsoft/hcsshim" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) func TestAddEpToResolver(t *testing.T) { const ( ep1v4 = "192.0.2.11" ep2v4 ...
go
github
https://github.com/moby/moby
daemon/libnetwork/network_windows_test.go
#!/usr/bin/env python3 # This file is part of the Printrun suite. # # Printrun 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. # # Pri...
unknown
codeparrot/codeparrot-clean
#ifndef PATH_H #define PATH_H struct repository; struct strbuf; struct string_list; struct worktree; /* * The result to all functions which return statically allocated memory may be * overwritten by another call to _any_ one of these functions. Consider using * the safer variants which operate on strbufs or return...
c
github
https://github.com/git/git
path.h
"""Tests for distutils.spawn.""" import unittest import sys import os from test.support import run_unittest, unix_shell from distutils.spawn import _nt_quote_args from distutils.spawn import spawn from distutils.errors import DistutilsExecError from distutils.tests import support class SpawnTestCase(support.TempdirMa...
unknown
codeparrot/codeparrot-clean
# coding=utf-8 from __future__ import unicode_literals from .. import Provider as AddressProvider class Provider(AddressProvider): city_suffixes = ( 'do Sul', 'do Norte', 'de Minas', 'do Campo', 'Grande', 'da Serra', 'do Oeste', 'de Goiás', 'Paulista', 'da Mata', 'Alegre', 'da Praia', 'das Flores',...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='OpenIDNonce', fields=[ ('id', models.AutoField(p...
unknown
codeparrot/codeparrot-clean
""" API - Resource Manager """ import json import re import textwrap from collections import OrderedDict, defaultdict from os.path import basename, dirname, join import simple_yaml as yaml from flask import abort as flask_abort from flask import ( Response, current_app, make_response, request, send_from_directory ...
unknown
codeparrot/codeparrot-clean
from sympy import (symbols, Symbol, sqrt, oo, re, nan, im, sign, I, E, log, pi, arg, conjugate, expand, exp, sin, cos, Function, Abs, zoo, atan2, S, DiracDelta, Rational, Heaviside) from sympy.utilities.pytest import XFAIL from sympy.utilities.randtest import comp def N_equals(a, b): """Check wheth...
unknown
codeparrot/codeparrot-clean
"""Base class for all estimators.""" # Author: Gael Varoquaux <gael.varoquaux@normalesup.org> # License: BSD Style import copy import inspect import numpy as np from scipy import sparse from .metrics import r2_score ############################################################################### def clone(estimator, ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # Copyright 2009 Google 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
# # Copyright (C) 2012-2013 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # import codecs from collections import deque import contextlib import csv from glob import iglob as std_iglob import io import json import logging import os import py_compile import re import shutil import socket import...
unknown
codeparrot/codeparrot-clean
{ "DELETE": { "summary": "Deletes a library and its functions.", "complexity": "O(1)", "group": "scripting", "since": "7.0.0", "arity": 3, "container": "FUNCTION", "function": "functionDeleteCommand", "command_flags": [ "NOSCRIPT", ...
json
github
https://github.com/redis/redis
src/commands/function-delete.json
# -*- coding: utf-8 -*- """ *************************************************************************** ZonalStatistics.py --------------------- Date : August 2013 Copyright : (C) 2013 by Alexander Bruy Email : alexander dot bruy at gmail dot com **********...
unknown
codeparrot/codeparrot-clean
//// [tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts] //// //// [assignmentCompatWithStringIndexer.ts] // index signatures must be compatible in assignments interface Base { foo: string; } interface Derived extends Base { bar: string; } interface Derived2 ...
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/assignmentCompatWithStringIndexer.js
# Copyright (C) 2016-2018 ycmd contributors # # This file is part of ycmd. # # ycmd 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. # #...
unknown
codeparrot/codeparrot-clean
# -*- test-case-name: twisted.web.test.test_newclient -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ An U{HTTP 1.1<http://www.w3.org/Protocols/rfc2616/rfc2616.html>} client. The way to use the functionality provided by this module is to: - Connect a L{HTTP11ClientProtocol} to an HT...
unknown
codeparrot/codeparrot-clean
/* * Copyright (c) 2018 Mockito contributors * This program is made available under the terms of the MIT License. */ package org.mockito.internal.session; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.mockito.Mockito.when; import static org.mockito.quali...
java
github
https://github.com/mockito/mockito
mockito-core/src/test/java/org/mockito/internal/session/DefaultMockitoSessionBuilderTest.java
package kotlinx.coroutines.reactive import kotlinx.atomicfu.* import kotlinx.coroutines.* import kotlinx.coroutines.channels.* import kotlinx.coroutines.flow.* import kotlinx.coroutines.flow.internal.* import kotlinx.coroutines.intrinsics.* import org.reactivestreams.* import java.util.* import kotlin.coroutines.* imp...
kotlin
github
https://github.com/Kotlin/kotlinx.coroutines
reactive/kotlinx-coroutines-reactive/src/ReactiveFlow.kt
import functools, logging import bson.json_util as json_util from fbvoting.conf import REDIS_TIMEOUT, ACTIVATE_REDIS from fbvoting.mylogging import report if ACTIVATE_REDIS: from flask_redis import Redis redis_store = Redis() logger = logging.getLogger(__name__) def _serialize(obj): return json_util.dum...
unknown
codeparrot/codeparrot-clean
#! /usr/bin/env python # 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/. """demonstrates using configman to make a Socorro app""" # This app can be invoked like this: # ...
unknown
codeparrot/codeparrot-clean
{ "spring":[ "boot", "framework" ] }
json
github
https://github.com/spring-projects/spring-boot
core/spring-boot-test/src/test/resources/org/springframework/boot/test/json/source.json
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * import glob class Redundans(Package): """Redundans pipeline assists an assembly of heterozygous g...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # Copyright: (c) 2015, Peter Sprygada <psprygada@ansible.com> # Copyright: (c) 2016, Dell Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) class ModuleDocFragment(object): # Standard files documentation fragment DOCUMENTATION = r''' opt...
unknown
codeparrot/codeparrot-clean
import zlib from scrapy.utils.gz import gunzip, is_gzipped from scrapy.http import Response, TextResponse from scrapy.responsetypes import responsetypes from scrapy.exceptions import NotConfigured class HttpCompressionMiddleware(object): """This middleware allows compressed (gzip, deflate) traffic to be sent/...
unknown
codeparrot/codeparrot-clean
framework: php_errors: throw: true
unknown
github
https://github.com/symfony/symfony
src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/php_errors_enabled.yml
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # 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 F...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Created on Sat May 25 00:09:01 2013 @author: Sol """ from __future__ import absolute_import, print_function from builtins import range from builtins import object from textwrap import TextWrapper import io import os from collections import deque from weakref import p...
unknown
codeparrot/codeparrot-clean
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
unknown
codeparrot/codeparrot-clean
//// [tests/cases/conformance/es6/spread/arrayLiteralSpreadES5iterable.ts] //// //// [arrayLiteralSpreadES5iterable.ts] function f0() { var a = [1, 2, 3]; var a1 = [...a]; var a2 = [1, ...a]; var a3 = [1, 2, ...a]; var a4 = [...a, 1]; var a5 = [...a, 1, 2]; var a6 = [1, 2, ...a, 1, 2]; ...
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/arrayLiteralSpreadES5iterable(target=es2015).js
import unittest from testlib import testutil, PygrTestProgram import ConfigParser import os import string import sys from pygr.mapping import Collection import pygr.Data try: import hashlib except ImportError: import md5 as hashlib config = ConfigParser.ConfigParser({'testOutputBaseDir': '.', ...
unknown
codeparrot/codeparrot-clean
"""Glance unit tests.""" # Copyright 2015 Solinea, 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 la...
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/io/compress/zlib/BuiltInZlibInflater.java
//===--- IRGenDebugInfo.cpp - Debug Info Support --------------------------===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
cpp
github
https://github.com/apple/swift
lib/IRGen/IRGenDebugInfo.cpp