code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
import unittest from test import test_support import UserDict, random, string import gc, weakref class DictTest(unittest.TestCase): def test_constructor(self): # calling built-in types without argument must return empty self.assertEqual(dict(), {}) self.assert_(dict() is not {}) def t...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This file is part of MSM. MSM 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/python2 # -*- coding: utf-8 -*- # # Copyright 2011 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 requir...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2018-2019, NVIDIA CORPORATION. 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 a...
unknown
codeparrot/codeparrot-clean
# This is equivalent to the aggregation suite, but runs with CBR with sampling CE enabled. test_kind: js_test selector: roots: - jstests/aggregation/**/*.js exclude_files: - jstests/aggregation/extras/*.js - jstests/aggregation/data/*.js # TODO SERVER-92589: Fails in all feature flags variant bec...
unknown
github
https://github.com/mongodb/mongo
buildscripts/resmokeconfig/suites/query_cbr_sampling_aggregation_passthrough.yml
twig: cache: true auto_reload: false
unknown
github
https://github.com/symfony/symfony
src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/yml/prod-cache.yml
A return statement was found outside of a function body. Erroneous code example: ```compile_fail,E0572 const FOO: u32 = return 0; // error: return statement outside of function body fn main() {} ``` To fix this issue, just remove the return keyword or move the expression into a function. Example: ``` const FOO: u3...
unknown
github
https://github.com/rust-lang/rust
compiler/rustc_error_codes/src/error_codes/E0572.md
#!/usr/bin/env python # Copyright (c) 2014-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same director...
unknown
codeparrot/codeparrot-clean
//// [tests/cases/conformance/statements/for-ofStatements/ES5For-of21.ts] //// //// [ES5For-of21.ts] for (let v of []) { for (let _i of []) { } } //// [ES5For-of21.js] "use strict"; for (var _a = 0, _b = []; _a < _b.length; _a++) { var v = _b[_a]; for (var _c = 0, _d = []; _c < _d.length; _c++) { ...
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/ES5For-of21(target=es5).js
/* Copyright 2015 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/core/common_runtime/copy_tensor.h
# (c) 2005 Clark C. Evans # This module is part of the Python Paste Project and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from paste.auth.digest import * from paste.wsgilib import raw_interactive from paste.response import header_value from paste.httpexceptions import * fr...
unknown
codeparrot/codeparrot-clean
"""Compatibility wrapper for cProfile module. This module maintains backward compatibility by importing from the new profiling.tracing module. """ from profiling.tracing import run, runctx, Profile __all__ = ["run", "runctx", "Profile"] if __name__ == "__main__": from profiling.tracing.__main__ import main ...
python
github
https://github.com/python/cpython
Lib/cProfile.py
import { test } from '../../test'; export default test({ html: '', async test({ assert, component, target }) { component.visible = true; assert.htmlEqual( target.innerHTML, ` <div>a</div> ` ); assert.equal(component.items[0].ref, target.querySelector('div')); } });
javascript
github
https://github.com/sveltejs/svelte
packages/svelte/tests/runtime-legacy/samples/binding-this-each-block-property/_config.js
const SIZE: usize = 32; #[repr(C)] #[derive(Debug, Default)] pub struct BracketStack { /// Bracket stack to ensure properly balanced brackets. bracket_stack: [u8; SIZE], bracket_stack_len: usize, } impl BracketStack { #[inline(always)] pub fn is_empty(&self) -> bool { self.bracket_stack_le...
rust
github
https://github.com/tailwindlabs/tailwindcss
crates/oxide/src/extractor/bracket_stack.rs
/* * 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/HeartbeatResponse.java
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2016 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the h...
unknown
codeparrot/codeparrot-clean
''' Module defining setter methods for the UrbanScape class ''' import numpy as np #========================= # | # Distribution Setters | # | #========================= def random_distribution(UrbanScape): u = UrbanScape u.rent = np.random.randint(u.rent_floor, u.rent_ceiling,(u.size,u.size)...
unknown
codeparrot/codeparrot-clean
# Cross-compiling Swift for Windows with `clang` This document describes how to cross compile Swift for Windows on a non-Windows host. For more context on the status of Swift on Windows in general, see [Getting Started with Swift on Windows](./Windows.md) ## 1. Set up Visual Studio environment variables Building for ...
unknown
github
https://github.com/apple/swift
docs/WindowsCrossCompile.md
from doajtest.helpers import DoajTestCase from portality import models import uuid, time from random import randint from portality.bll.doaj import DOAJ from portality.bll.exceptions import ArticleMergeConflict from datetime import datetime class TestArticleMatch(DoajTestCase): def setUp(self): super(TestA...
unknown
codeparrot/codeparrot-clean
from typing import TYPE_CHECKING, Any from langchain_classic._api import create_importer if TYPE_CHECKING: from langchain_community.vectorstores.nucliadb import NucliaDB # Create a way to dynamically look up deprecated imports. # Used to consolidate logic for raising deprecation warnings and # handling optional ...
python
github
https://github.com/langchain-ai/langchain
libs/langchain/langchain_classic/vectorstores/nucliadb.py
"""Support for Genius Hub switch/outlet devices.""" from homeassistant.components.switch import SwitchDevice, DEVICE_CLASS_OUTLET from homeassistant.helpers.typing import ConfigType, HomeAssistantType from . import DOMAIN, GeniusZone ATTR_DURATION = "duration" GH_ON_OFF_ZONE = "on / off" async def async_setup_platf...
unknown
codeparrot/codeparrot-clean
test_kind: parallel_fsm_workload_test selector: roots: - jstests/concurrency/fsm_workloads/**/*.js exclude_files: # SERVER-30644 These tests create/drop/modify views which can deadlock on the ViewCatalog mutex if # there's a concurrent operation which acquires a MODE_X lock. - jstests/concurrency/f...
unknown
github
https://github.com/mongodb/mongo
buildscripts/resmokeconfig/suites/concurrency_simultaneous.yml
{ "DOCS": { "summary": "Returns documentary information about one, multiple or all commands.", "complexity": "O(N) where N is the number of commands to look up", "group": "server", "since": "7.0.0", "arity": -2, "container": "COMMAND", "function": "commandDocs...
json
github
https://github.com/redis/redis
src/commands/command-docs.json
#!/usr/bin/env python # # Copyright (C) 2015 YouCompleteMe contributors # # This file is part of YouCompleteMe. # # YouCompleteMe 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...
unknown
codeparrot/codeparrot-clean
# Copyright 2014 Diamond Light Source Ltd. # # 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 t...
unknown
codeparrot/codeparrot-clean
import collections import mock import os import sys from ansible.compat.tests import unittest try: from ansible.modules.core.packaging.os.apt import ( expand_pkgspec_from_fnmatches, ) except: # Need some more module_utils work (porting urls.py) before we can test # modules. So don't error out ...
unknown
codeparrot/codeparrot-clean
"""TestSuite""" import sys from . import case from . import util __unittest = True def _call_if_exists(parent, attr): func = getattr(parent, attr, lambda: None) func() class BaseTestSuite(object): """A simple test suite that doesn't provide class or module shared fixtures. """ _cleanup = True ...
unknown
codeparrot/codeparrot-clean
package cleanups import ( "context" "errors" "fmt" "testing" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) func TestCall(t *testing.T) { c := Composite{} err1 := errors.New("error1") err2 := errors.New("error2") errX := errors.New("errorX") errY := errors.New("errorY") errZ := errors.New("er...
go
github
https://github.com/moby/moby
daemon/internal/cleanups/composite_test.go
from typing import TYPE_CHECKING, Any from langchain_classic._api import create_importer if TYPE_CHECKING: from langchain_community.retrievers import KayAiRetriever # Create a way to dynamically look up deprecated imports. # Used to consolidate logic for raising deprecation warnings and # handling optional impor...
python
github
https://github.com/langchain-ai/langchain
libs/langchain/langchain_classic/retrievers/kay.py
from __future__ import print_function, absolute_import import numpy as np from numba import cuda, int32, float32 from numba.cuda.testing import unittest, SerialMixin from numba.config import ENABLE_CUDASIM def useless_sync(ary): i = cuda.grid(1) cuda.syncthreads() ary[i] = i def simple_smem(ary): N = ...
unknown
codeparrot/codeparrot-clean
def add_papyrus_handler(self, route_name_prefix, base_url, handler): """ Add a Papyrus handler, i.e. a handler defining the MapFish HTTP interface. Example:: import papyrus config.include(papyrus) config.add_papyrus_handler( 'spots', '/spots', 'mypackage.handlers.SpotHa...
unknown
codeparrot/codeparrot-clean
#ifndef JSON_DOM_INCLUDED #define JSON_DOM_INCLUDED /* Copyright (c) 2015, 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...
c
github
https://github.com/mysql/mysql-server
sql-common/json_dom.h
#!/usr/bin/env python3 import os import tarfile from urllib.request import urlopen from urllib.error import URLError from kiwixbuild.versions import base_deps_meta_version from common import ( print_message, run_kiwix_build, upload, make_deps_archive, HOME, PLATFORM_TARGET, OS_NAME, ) de...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2018 PaddlePaddle 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 app...
unknown
codeparrot/codeparrot-clean
// RUN: %check_clang_tidy %s google-explicit-constructor %t -- --header-filter=.* -system-headers -- -isystem %S/Inputs/nolintbeginend #include "error_in_include.inc" // CHECK-MESSAGES: error_in_include.inc:1:11: warning: single-argument constructors must be marked explicit #include "nolint_in_include.inc" // CHECK-...
cpp
github
https://github.com/llvm/llvm-project
clang-tools-extra/test/clang-tidy/infrastructure/nolintbeginend-error-within-include.cpp
# Copyright 2017 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
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you ca...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * class AboutStrings(Koan): def test_double_quoted_strings_are_strings(self): string = "Hello, world." self.assertEqual(True, isinstance(string, basestring)) def test_single_quoted_strings_are_also_strings(self): s...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- ############################################################################### # # CalculateTariffInputMetaData # Retrieve inputs required to run a calculation for the specified tariff, within a specified period of time. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Lic...
unknown
codeparrot/codeparrot-clean
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2 --- $id: http://devicetree.org/schemas/gpio/st,nomadik-gpio.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# title: Nomadik GPIO controller description: The Nomadik GPIO driver handles Nomadik SoC GPIO blocks. This block has also been...
unknown
github
https://github.com/torvalds/linux
Documentation/devicetree/bindings/gpio/st,nomadik-gpio.yaml
## Input ```javascript // @enableAssumeHooksFollowRulesOfReact true function Component(props) { const x = {}; // In enableAssumeHooksFollowRulesOfReact mode hooks freeze their inputs and return frozen values const y = useFoo(x); // Thus both x and y are frozen here, and x can be independently memoized bar(x,...
unknown
github
https://github.com/facebook/react
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/immutable-hooks.expect.md
''' Created on 2013 mai 24 @author: peio ''' import subprocess import os from tempfile import NamedTemporaryFile from Bio import SeqIO from Bio.Seq import Seq class IsIndelError(Exception): pass class OutsideAlignment(Exception): pass class BetweenSegments(Exception): pass class SeqCoords(object): ...
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/test/java/org/springframework/boot/configurationsample/endpoint/SimpleEndpoint3.java
//// [tests/cases/conformance/statements/VariableStatements/usingDeclarations/awaitUsingDeclarations.13.ts] //// //// [awaitUsingDeclarations.13.ts] await using x = null; function f() { await using x = null; } //// [awaitUsingDeclarations.13.js] "use strict"; await using x = null; function f() { await using ...
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/awaitUsingDeclarations.13.js
import sys import spotipy ''' shows the albums and tracks for a given artist. ''' def get_artist(name): results = sp.search(q='artist:' + name, type='artist') items = results['artists']['items'] if len(items) > 0: return items[0] else: return None def show_artist_albums(artist): a...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python """ Install script for beancount. """ __author__ = "Martin Blais <blais@furius.ca>" import os from os.path import join, isfile from setuptools import setup # Install all scripts under bin. scripts = [join('bin', x) for x in ('bean-web', 'bean-trial', ...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # Copyright: (c) 2016, Red Hat, Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) class ModuleDocFragment(object): # facts standard oVirt documentation fragment DOCUMENTATION = r''' options: fetch_nested: description: ...
unknown
codeparrot/codeparrot-clean
from typing import TYPE_CHECKING, Any from langchain_classic._api import create_importer if TYPE_CHECKING: from langchain_community.chat_models.human import HumanInputChatModel # Create a way to dynamically look up deprecated imports. # Used to consolidate logic for raising deprecation warnings and # handling op...
python
github
https://github.com/langchain-ai/langchain
libs/langchain/langchain_classic/chat_models/human.py
'use strict'; self.console || (self.console = { 'log': function() {} }); addEventListener('message', function(e) { if (e.data) { try { importScripts('../' + e.data); } catch (e) { var lineNumber = e.lineNumber, message = (lineNumber == null ? '' : (lineNumber + ': ')) + e.message; ...
javascript
github
https://github.com/lodash/lodash
test/asset/worker.js
/* 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 applicable law or a...
c
github
https://github.com/tensorflow/tensorflow
tensorflow/core/distributed_runtime/eager/remote_tensor_handle.h
--- - hosts: all gather_facts: no tasks: - name: test magic vars for hosts without any failed/unreachable (no serial) assert: that: - ansible_play_batch | length == 3 - ansible_play_hosts | length == 3 - ansible_play_hosts_all | length == 3 run_once: True -...
unknown
github
https://github.com/ansible/ansible
test/integration/targets/special_vars_hosts/playbook.yml
#! /usr/bin/env python # -*- mode: python; indent-tabs-mode: nil; -*- # vim:expandtab:shiftwidth=2:tabstop=2:smarttab: # # Copyright (C) 2010 Patrick Crews # # # 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 Softwar...
unknown
codeparrot/codeparrot-clean
"""Nearly exact trust-region optimization subproblem.""" from __future__ import division, print_function, absolute_import import numpy as np from scipy.linalg import (norm, get_lapack_funcs, solve_triangular, cho_solve) from ._trustregion import (_minimize_trust_region, BaseQuadraticSubproble...
unknown
codeparrot/codeparrot-clean
name: Integration Tests Reusable on: workflow_call: inputs: name: description: A unique identifer used for uploaded assets type: string test_type: description: '"development" or "production"' required: true type: string run_before_test: descriptio...
unknown
github
https://github.com/vercel/next.js
.github/workflows/integration_tests_reusable.yml
''' Unit tests for oc clusterrole ''' import copy import os import sys import unittest import mock # Removing invalid variable names for tests so that I can # keep them brief # pylint: disable=invalid-name,no-name-in-module # Disable import-error b/c our libraries aren't loaded in jenkins # pylint: disable=import-er...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. import errno import os import sys try: import ctypes import ctypes.util except MemoryError: # selinux execmem denial # https://bugzilla.redhat.com/show_bug.cgi?id=488396 r...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python import argparse import cPickle as pkl import gzip import sys import tables import numpy parser = argparse.ArgumentParser() parser.add_argument("input", type=argparse.FileType('rb'), help="Pickle file") parser.add_argument("output", typ...
unknown
codeparrot/codeparrot-clean
use serde_derive::Serialize; mod remote { pub struct S { a: u8, } impl S { pub fn get(&self) -> u16 { self.a as u16 } } } #[derive(Serialize)] #[serde(remote = "remote::S")] struct S { #[serde(getter = "remote::S::get")] a: u8, } fn main() {}
rust
github
https://github.com/serde-rs/serde
test_suite/tests/ui/remote/wrong_getter.rs
// Copyright 2022 The Cockroach Authors. // // Use of this software is governed by the CockroachDB Software License // included in the /LICENSE file. package cli import ( "fmt" "strings" "testing" "github.com/cockroachdb/cockroach/pkg/clusterversion" "github.com/cockroachdb/cockroach/pkg/testutils/datapathutils...
go
github
https://github.com/cockroachdb/cockroach
pkg/cli/declarative_print_rules_test.go
# التدريب باستخدام نص برمجى بالإضافة إلى دفاتر الملاحظات [notebooks](./notebooks) الخاصة بـ 🤗 Transformers، هناك أيضًا نصوص برمجية توضيحية تُظهر كيفية تدريب نموذج لمهمة باستخدام [PyTorch](https://github.com/huggingface/transformers/tree/main/examples/pytorch) أو [TensorFlow](https://github.com/huggingface/transformer...
unknown
github
https://github.com/huggingface/transformers
docs/source/ar/run_scripts.md
# # 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 us...
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. */ namespace Symfony\Bridge\Doctrine\Tests\IdGenerator; use Doctrine\ORM\EntityManag...
php
github
https://github.com/symfony/symfony
src/Symfony/Bridge/Doctrine/Tests/IdGenerator/UlidGeneratorTest.php
import datetime from itertools import groupby import warnings from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from django.db import connections from django.db.models import Max from django.http import Http404 from django.utils.timezone import make_aware, utc from rest_framework i...
unknown
codeparrot/codeparrot-clean
import { context, getOctokit } from '@actions/github' import { info, getInput } from '@actions/core' const { default: stripAnsi } = require('strip-ansi') const fs = require('fs') /// <reference path="./manifest" /> type Octokit = ReturnType<typeof getOctokit> type Job = Awaited< ReturnType<Octokit['rest']['actions...
typescript
github
https://github.com/vercel/next.js
.github/actions/next-integration-stat/src/index.ts
# 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 use ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # MySQL querying and updates for a recipe site # By Jesse Hunt import argparse import sys import MySQLdb import yaml def get_database_variable(yaml_file, global_variable): """ gets global variable given string variable name""" with open(yaml_file, 'r') as f: doc = yaml.load(f) txt...
unknown
codeparrot/codeparrot-clean
# Example adapted from VisPy, which is released under the BSD license # This script enables multiple isosurfaces based on the variable 'level' defined in glsl code. # The color and transparency is cauculated according to 'level' and 'threshold'. # TODO: improve colormap, current one is kind of random. # TODO: make var...
unknown
codeparrot/codeparrot-clean
// Copyright 2015 The etcd 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 t...
go
github
https://github.com/etcd-io/etcd
server/etcdserver/api/rafthttp/msgappv2_codec_test.go
from cache_toolbox.core import get_cached_content, set_cached_content, del_cached_content from opaque_keys.edx.locations import Location from django.test import TestCase class Content: def __init__(self, location, content): self.location = location self.content = content def get_id(self): ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python import xml.sax from tests.unit import unittest import boto.resultset from boto.ec2.elb.loadbalancer import LoadBalancer LISTENERS_RESPONSE = r"""<?xml version="1.0" encoding="UTF-8"?> <DescribeLoadBalancersResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2012-06-01/"> <DescribeLoa...
unknown
codeparrot/codeparrot-clean
import index from 'tailwindcss/index.css' import preflight from 'tailwindcss/preflight.css' import theme from 'tailwindcss/theme.css' import utilities from 'tailwindcss/utilities.css' export const css = { index, preflight, theme, utilities, }
typescript
github
https://github.com/tailwindlabs/tailwindcss
packages/@tailwindcss-browser/src/assets.ts
''' common XBMC Module Copyright (C) 2011 t0mm0 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 version. Th...
unknown
codeparrot/codeparrot-clean
-- -- Test cube datatype -- CREATE EXTENSION cube; -- Check whether any of our opclasses fail amvalidate SELECT amname, opcname FROM pg_opclass opc LEFT JOIN pg_am am ON am.oid = opcmethod WHERE opc.oid >= 16384 AND NOT amvalidate(opc.oid); -- -- testing the input and output functions -- -- Any number (a one-dimen...
sql
github
https://github.com/postgres/postgres
contrib/cube/sql/cube.sql
//===----------------------------------------------------------------------===// // // 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/clang-tidy/objc/AssertEqualsCheck.cpp
""" Peripheral On Demand global define """ import periphondemand #global POD_CONFIG="~/.podrc" POD_PATH = periphondemand.__path__[0] PLATFORMPATH = "/platforms" BUSPATH = "/busses/" TEMPLATESPATH = "/templates" TOOLCHAINPATH = "/toolchains" SIMULATIONPATH = "/simulation" SYNTHESISPATH = "/synthesis" DRIVERSPATH = "/...
unknown
codeparrot/codeparrot-clean
import numpy as np import pylab as p def mvr(assembly): machs = [] tube_r = [] capsule_r = [] for m in np.arange(.781,.95, .01): hl.Mach_pod_max = m hl.run() machs.append(m) tube_r.append(hl.pod.radius_inlet_back_outer) capsule_r.append(hl.flow_limit.radius_tube...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ @author: Fabio Erculiani <lxnay@sabayon.org> @contact: lxnay@sabayon.org @copyright: Fabio Erculiani @license: GPL-2 B{Entropy Infrastructure Toolkit}. """ import sys import argparse from entropy.i18n import _ from _entropy.eit.commands.descriptor import EitCommandDe...
unknown
codeparrot/codeparrot-clean
from distutils.core import setup, Extension import os, sys XEN_ROOT = "../.." extra_compile_args = [ "-fno-strict-aliasing", "-Werror" ] PATH_XEN = XEN_ROOT + "/tools/include" PATH_LIBXC = XEN_ROOT + "/tools/libxc" PATH_LIBXL = XEN_ROOT + "/tools/libxl" PATH_XENSTORE = XEN_ROOT + "/tools/xenstore" xc = ...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ 图的抽象数据类型 ADT Graph: Graph(self) # 构造一个新图 is_empty(self) # 是否为空图 vertex_num(self) # 顶点数 edge_num(self) # 边数 vertices(self) # 所有顶点的集合 edges(self) # 所有边的集合 add_vertex(self, vertex) # 添加一个顶点 add_edge(self, v1, v2) # 添加一条边 get_edge(self, v1, v2) # 获得v...
unknown
codeparrot/codeparrot-clean
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from __future__ import annotations import os from typing import Any, cast import pytest from openai import OpenAI, AsyncOpenAI from tests.utils import assert_matches_type from openai.types import ( ContainerListResponse, C...
python
github
https://github.com/openai/openai-python
tests/api_resources/test_containers.py
"""Support for the Drizzle database via the mysql-python adapter. MySQL-Python is available at: http://sourceforge.net/projects/mysql-python Connecting ----------- Connect string format:: drizzle+mysqldb://<user>:<password>@<host>[:<port>]/<dbname> """ from sqlalchemy.dialects.drizzle.base import ( D...
unknown
codeparrot/codeparrot-clean
# Copyright 2013 OpenStack Foundation # # 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...
unknown
codeparrot/codeparrot-clean
import pickle from django.core.files.uploadedfile import SimpleUploadedFile from django.forms import FileField, ValidationError from django.test import SimpleTestCase class FileFieldTest(SimpleTestCase): def test_filefield_1(self): f = FileField() with self.assertRaisesMessage(ValidationError, "'...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- # $Id$ """ Test Manager Self Test - Dummy Test Driver. """ __copyright__ = \ """ Copyright (C) 2012-2014 Oracle Corporation This file is part of VirtualBox Open Source Edition (OSE), as available from http://www.virtualbox.org. This file is free software; you can redistr...
unknown
codeparrot/codeparrot-clean
""" Regression test for <https://bugs.freedesktop.org/show_bug.cgi?id=32952>, wherein chat states in MUCs were misparsed, and MUC chat states in general. """ from servicetest import assertEquals, assertLength, EventPattern from gabbletest import exec_test, elem, make_muc_presence, sync_stream from mucutil import join_...
unknown
codeparrot/codeparrot-clean
# Copyright 2019 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, ...
unknown
codeparrot/codeparrot-clean
// Copyright 2015 The etcd 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 t...
go
github
https://github.com/etcd-io/etcd
server/etcdserver/api/rafthttp/stream.go
from nose import SkipTest from nose.tools import assert_raises, assert_true, assert_equal, raises import networkx as nx from networkx.generators.classic import barbell_graph,cycle_graph,path_graph class TestConvertNumpy(object): @classmethod def setupClass(cls): global np, sp, sparse, np_assert_equal ...
unknown
codeparrot/codeparrot-clean
# Unix SMB/CIFS implementation. # Copyright (C) Andrew Bartlett <abartlet@samba.org> 2017 # # 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)...
unknown
codeparrot/codeparrot-clean
# # Test suite for Optik. Supplied by Johannes Gijsbers # (taradino@softhome.net) -- translated from the original Optik # test suite to this PyUnit-based version. # # $Id$ # import sys import os import re import copy import unittest from io import StringIO from test import support from optparse import make_option, ...
unknown
codeparrot/codeparrot-clean
/* * 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 ...
kotlin
github
https://github.com/spring-projects/spring-framework
framework-docs/src/main/kotlin/org/springframework/docs/web/webmvcfnrunning/WebConfiguration.kt
# Copyright (c) 2009 Aldo Cortesi # Copyright (c) 2011 Florian Mounier # Copyright (c) 2011 Anshuman Bhaduri # Copyright (c) 2012 Tycho Andersen # # 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 Softw...
unknown
codeparrot/codeparrot-clean
from genetica.common import Environment, Individual from genetica.single import Population class SingleEnvironment(Environment.CommonEnvironment): def __init__(self, name=None, objectives=None, var_ranges=None, settings=None, fitness=None): Individ = Individual.RealCoded Pop = Population.SinglePop...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- import datetime import mock from nose.tools import eq_ import mkt from mkt.developers.cron import (_flag_rereview_adult, exclude_new_region, process_iarc_changes, send_new_region_emails) from mkt.developers.models import ActivityLog from mkt.site.tests import T...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/thumbor/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com thumbor@googlegroups.com import re import collections STRIP_QUOTE = re.compile(r"^'(.+)'$") ...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # # BOLT documentation build configuration file. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented...
python
github
https://github.com/llvm/llvm-project
bolt/docs/conf.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/src/airflow/api_fastapi/auth/managers/models/resource_details.py
/*------------------------------------------------------------------------- * * compress_io.h * Interface to compress_io.c routines * * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION * src/bin/p...
c
github
https://github.com/postgres/postgres
src/bin/pg_dump/compress_io.h
/* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the "Elastic License * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side * Public License v 1"; you may not use this file except in compliance with, ...
java
github
https://github.com/elastic/elasticsearch
build-tools/src/testFixtures/java/org/elasticsearch/plugin/scanner/test_classes/ExtensibleInterface.java
#!/usr/bin/env python """ Add views for new dominate command. @contact: Debian FTP Master <ftpmaster@debian.org> @copyright: 2009 Torsten Werner <twerner@debian.org> @license: GNU General Public License version 2 or later """ # This program is free software; you can redistribute it and/or modify # it under the term...
unknown
codeparrot/codeparrot-clean