code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
import time import cgi import oauth2 as oauth from django.test import Client from oauth_provider.tests.auth import BaseOAuthTestCase from oauth_provider.models import Token, Consumer, Scope from oauth_provider.compat import get_user_model User = get_user_model() class ProtocolExample(BaseOAuthTestCase): """Set...
unknown
codeparrot/codeparrot-clean
from clang.cindex import TranslationUnit def check_completion_results(cr, expected): assert cr is not None assert len(cr.diagnostics) == 0 completions = [str(c) for c in cr.results] for c in expected: assert c in completions def test_code_complete(): files = [('fake.c', """ /// Aaa. int ...
unknown
codeparrot/codeparrot-clean
"""View to accept incoming websocket connection.""" import asyncio from contextlib import suppress from functools import partial import json import logging from aiohttp import web, WSMsgType import async_timeout from homeassistant.const import EVENT_HOMEASSISTANT_STOP from homeassistant.core import callback from home...
unknown
codeparrot/codeparrot-clean
//! Performs various peephole optimizations. use rustc_abi::ExternAbi; use rustc_hir::attrs::AttributeKind; use rustc_hir::{LangItem, find_attr}; use rustc_middle::bug; use rustc_middle::mir::visit::MutVisitor; use rustc_middle::mir::*; use rustc_middle::ty::layout::ValidityRequirement; use rustc_middle::ty::{self, Ge...
rust
github
https://github.com/rust-lang/rust
compiler/rustc_mir_transform/src/instsimplify.rs
// SPDX-License-Identifier: GPL-2.0-or-later #include <linux/array_size.h> #include <linux/sort.h> #include <linux/printk.h> #include <linux/memblock.h> #include <linux/numa.h> #include <linux/numa_memblks.h> #include <asm/numa.h> int numa_distance_cnt; static u8 *numa_distance; nodemask_t numa_nodes_parsed __initd...
c
github
https://github.com/torvalds/linux
mm/numa_memblks.c
//! This crate implemens MIR typeck and MIR borrowck. // tidy-alphabetical-start #![allow(internal_features)] #![cfg_attr(bootstrap, feature(assert_matches))] #![feature(box_patterns)] #![feature(default_field_values)] #![feature(file_buffered)] #![feature(if_let_guard)] #![feature(negative_impls)] #![feature(never_ty...
rust
github
https://github.com/rust-lang/rust
compiler/rustc_borrowck/src/lib.rs
/* Copyright 2019 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/lite/kernels/acceleration_test_util_internal.h
## Input ```javascript function Component(props) { let x = []; let y; switch (props.p0) { case true: { x.push(props.p2); x.push(props.p3); y = []; } case false: { y = x; break; } } const child = <Component data={x} />; y.push(props.p4); return <Component data...
unknown
github
https://github.com/facebook/react
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/switch.expect.md
// Copyright 2023 The Cockroach Authors. // // Use of this software is governed by the CockroachDB Software License // included in the /LICENSE file. package jobs import ( "bytes" "context" "math" "time" "github.com/cockroachdb/cockroach/pkg/jobs/jobspb" "github.com/cockroachdb/cockroach/pkg/roachpb" "github....
go
github
https://github.com/cockroachdb/cockroach
pkg/jobs/job_info_storage.go
#!/usr/bin/env python # -*- coding: latin-1 -*- # **************************************************************************** # * Software: FPDF for python * # * Version: 1.7.1 * # * Date: 2010-09-10 ...
unknown
codeparrot/codeparrot-clean
""" Sponge slice. """ from __future__ import absolute_import #Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module. import __init__ from fabmetheus_utilities.geometry.creation import lineation from fabmetheus_utili...
unknown
codeparrot/codeparrot-clean
- name: Install Paramiko for Python 3 on Alpine command: apk add py3-paramiko
unknown
github
https://github.com/ansible/ansible
test/integration/targets/setup_paramiko/install-Alpine-3-python-3.yml
/* Copyright (c) 2016, 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 designed to work with certain software (including but not lim...
c
github
https://github.com/mysql/mysql-server
sql/auto_thd.h
//// [tests/cases/compiler/asyncFunctionContextuallyTypedReturns.ts] //// //// [asyncFunctionContextuallyTypedReturns.ts] declare function f(cb: (v: boolean) => [0] | PromiseLike<[0]>): void; f(v => v ? [0] : Promise.reject()); f(async v => v ? [0] : Promise.reject()); declare function g(cb: (v: boolean) => "contextu...
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/asyncFunctionContextuallyTypedReturns.js
# CUPS Cloudprint - Print via Google Cloud Print # Copyright (C) 2011 Simon Cadman # # 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
""" Test print_monitor_cv.py by training on a short TrainCV YAML file and analyzing the output pickle. """ import os import tempfile from pylearn2.config import yaml_parse from pylearn2.scripts import print_monitor_cv from pylearn2.testing.skip import skip_if_no_sklearn def test_print_monitor_cv(): """Test print_...
unknown
codeparrot/codeparrot-clean
''' Build a tweet sentiment analyzer ''' from collections import OrderedDict import cPickle as pkl import sys import time import numpy import theano from theano import config import theano.tensor as tensor from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams import imdb datasets = {'imdb': (imdb.loa...
unknown
codeparrot/codeparrot-clean
CREATE EXTENSION hstore_plperlu CASCADE; SELECT transforms.udt_schema, transforms.udt_name, routine_schema, routine_name, group_name, transform_type FROM information_schema.transforms JOIN information_schema.routines USING (specific_catalog, specific_schema, specific_name) ORDER BY 1, 2, 5, 6; -- t...
sql
github
https://github.com/postgres/postgres
contrib/hstore_plperl/sql/hstore_plperlu.sql
#!/usr/bin/python #coding: utf-8 -*- # (c) 2013, Benno Joy <benno@ansible.com> # (c) 2013, John Dewey <john@dewey.ws> # # This module 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 Li...
unknown
codeparrot/codeparrot-clean
import { flushSync } from 'svelte'; import { ok, test } from '../../test'; export default test({ html: '<button>???</button>', test({ assert, target, window }) { const event = new window.MouseEvent('click', { clientX: 42, clientY: 42 }); const button = target.querySelector('button'); ok(button); b...
javascript
github
https://github.com/sveltejs/svelte
packages/svelte/tests/runtime-legacy/samples/action-custom-event-handler-with-context/_config.js
//===- bolt/Rewrite/DWARFRewriter.h -----------------------------*- C++ -*-===// // // 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 // //===---------------------------...
c
github
https://github.com/llvm/llvm-project
bolt/include/bolt/Rewrite/DWARFRewriter.h
import os basedir = os.path.abspath(os.path.dirname(__file__)) CSRF_ENABLED = True SECRET_KEY = "\2\1thisismyscretkey\1\2\e\y\y\h" OPENID_PROVIDERS = [ {"name": "Google", "url": "https://www.google.com/accounts/o8/id"}, {"name": "Yahoo", "url": "https://me.yahoo.com"}, {"name": "AOL", "url": "http://open...
unknown
codeparrot/codeparrot-clean
//===----------------------------------------------------------------------===// // // 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/darwin/AvoidSpinlockCheck.cpp
#!/usr/bin/python from pelix.ipopo.decorators import ComponentFactory, Provides, Validate, Invalidate, Property from pelix.ipopo import constants import socket TCP_IP = '127.0.0.1' TCP_PORT = 6571 #BUFFER_SIZE = 1024 @ComponentFactory("led_yun_wrapper_factory") @Property("_name", "led.name", constants.IPOPO_INSTANC...
unknown
codeparrot/codeparrot-clean
""" Objects and functions related to generating CSV reports """ from decimal import Decimal import unicodecsv from django.utils.translation import ugettext as _ from courseware.courses import get_course_by_id from course_modes.models import CourseMode from shoppingcart.models import CertificateItem, OrderItem from s...
unknown
codeparrot/codeparrot-clean
{ "html": { "type": "Fragment", "start": 0, "end": 58, "children": [ { "type": "EachBlock", "start": 0, "end": 58, "children": [ { "type": "Element", "start": 30, "end": 50, "name": "p", "attributes": [], "children": [ { "type": "Mustac...
json
github
https://github.com/sveltejs/svelte
packages/svelte/tests/parser-legacy/samples/each-block-indexed/output.json
# Tweepy # Copyright 2009-2010 Joshua Roesslein # See LICENSE for details. import httplib import urllib import time import re from tweepy.error import TweepError from tweepy.utils import convert_to_utf8_str from tweepy.models import Model re_path_template = re.compile('{\w+}') def bind_api(**config): class API...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals """assign/unassign to ToDo""" import frappe from frappe import _ from frappe.desk.form.load import get_docinfo import frappe.share class DuplicateToDoError(frappe.ValidationErro...
unknown
codeparrot/codeparrot-clean
from flask import url_for from flask.ext.wtf import Form from wtforms import ValidationError from wtforms.fields import (BooleanField, PasswordField, StringField, SubmitField) from wtforms.fields.html5 import EmailField from wtforms.validators import Email, EqualTo, InputRequired, Length fr...
unknown
codeparrot/codeparrot-clean
import logging from rest_framework import decorators, permissions, status from rest_framework.renderers import JSONPRenderer, JSONRenderer, BrowsableAPIRenderer from rest_framework.response import Response import requests from readthedocs.builds.constants import LATEST from readthedocs.builds.models import Version fr...
unknown
codeparrot/codeparrot-clean
# 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, software # distributed under the...
unknown
codeparrot/codeparrot-clean
# $Id$ """Telnet.""" IAC = 255 # interpret as command: DONT = 254 # you are not to use option DO = 253 # please, you use option WONT = 252 # I won't use option WILL = 251 # I will use option SB = 250 # interpret as subnegotiation GA = 249 # you may reverse the line EL = 248 # erase the curren...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- encoding=utf-8 -*- from crawlers.electorates.base_provincePage import * from utils import sanitize def Crawler(nth, election_name, electionType): target = 'assembly' if 1 <= nth <= 17: raise NotImplementedError('Korean National Election Committee does not have any data about electorate...
unknown
codeparrot/codeparrot-clean
""" Tests for the course grading API view """ import json from collections import OrderedDict, namedtuple from datetime import datetime import ddt from django.urls import reverse from freezegun import freeze_time from mock import MagicMock, patch from opaque_keys.edx.locator import BlockUsageLocator from pytz import ...
unknown
codeparrot/codeparrot-clean
package kotlinx.coroutines.debug import kotlinx.coroutines.testing.* import kotlinx.coroutines.* import org.junit.* import kotlin.coroutines.* class ScopedBuildersTest : DebugTestBase() { @Test fun testNestedScopes() = runBlocking { val job = launch { doInScope() } yield() yield() ...
kotlin
github
https://github.com/Kotlin/kotlinx.coroutines
kotlinx-coroutines-debug/test/ScopedBuildersTest.kt
/* * 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/configurationprocessor/JavaBeanPropertyDescriptorTests.java
from __future__ import unicode_literals import json import re from .common import InfoExtractor from ..compat import compat_urllib_parse_unquote class PhotobucketIE(InfoExtractor): _VALID_URL = r'https?://(?:[a-z0-9]+\.)?photobucket\.com/.*(([\?\&]current=)|_)(?P<id>.*)\.(?P<ext>(flv)|(mp4))' _TEST = { ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import annotations DOCUMENTATION = """ module: _module3 short_description: Another test module description: This is a test module that has not been deprecated. author: - Ansible Core Team "...
python
github
https://github.com/ansible/ansible
test/integration/targets/ansible-test-sanity-ansible-doc/ansible_collections/ns/col/plugins/modules/_module3.py
""" Some basic admin tests. Rather than testing the frontend UI -- that's be a job for something like Selenium -- this does a bunch of mocking and just tests the various admin callbacks. """ from __future__ import absolute_import import mock from django.contrib import admin from django.contrib.auth.models import Use...
unknown
codeparrot/codeparrot-clean
# # This file is part of Plinth. # # 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 later version. # # This program is distribute...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # Copyright 2014 by Idiap Research Institute, http://www.idiap.ch # # See the file COPYING for the licence associated with this software. # # Author(s): # Milos Cernak, Oct 2014 # import sys import numpy as np from struct import pack, unpack from os import makedirs from os.path import dirname, e...
unknown
codeparrot/codeparrot-clean
""" Module for processing Sitemaps. Note: The main purpose of this module is to provide support for the SitemapSpider, its API is subject to change without notice. """ from cStringIO import StringIO from xml.etree.cElementTree import ElementTree class Sitemap(object): """Class to parse Sitemap (type=urlset) and ...
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/clients/admin/MockAdminClient.java
from functools import wraps from flask import request from flask import jsonify from slingrpm.utils import iam class NoOpAuth(object): def __init__(self): pass def authenticate(self, wrapped): @wraps(wrapped) def wrapper(*args, **kwargs): return wrapped(*args, **kwargs) ...
unknown
codeparrot/codeparrot-clean
# # namcap rules - emptydir # Copyright (C) 2004-2009 Jason Chu <jason@archlinux.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 the License, or # (at your opt...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ /*************************************************************************** Name : Versioning plugin for DB Manager Description : Set up versioning support for a table Date : Mar 12, 2012 copyright : (C) 2012 by Giuseppe Sucameli email ...
unknown
codeparrot/codeparrot-clean
import base64 import random from ajenti.com import Plugin, implements from ajenti.api import IXSLTFunctionProvider def attr(_, v, d): return d if v == [] or v == ['None'] else v[0] def css(_, v, d): v = d if v == [] or v == ['None'] else v[0] if v == 'auto': return v return v if '%' in v ...
unknown
codeparrot/codeparrot-clean
// Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 package views import ( "strings" "testing" "github.com/google/go-cmp/cmp" "github.com/zclconf/go-cty/cty" "github.com/hashicorp/terraform/internal/addrs" "github.com/hashicorp/terraform/internal/command/arguments" "github.com/hashicorp/ter...
go
github
https://github.com/hashicorp/terraform
internal/command/views/test_test.go
"""JOSE utilities.""" import collections from cryptography.hazmat.primitives.asymmetric import rsa import OpenSSL import six class abstractclassmethod(classmethod): # pylint: disable=invalid-name,too-few-public-methods """Descriptor for an abstract classmethod. It augments the :mod:`abc` framework with a...
unknown
codeparrot/codeparrot-clean
"""Demo platform that offers fake air quality data.""" from homeassistant.components.air_quality import AirQualityEntity async def async_setup_platform(hass, config, async_add_entities, discovery_info=None): """Set up the Air Quality.""" async_add_entities( [DemoAirQuality("Home", 14, 23, 100), DemoAir...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python import threading import dns from dnsdisttests import DNSDistTest class TestAXFR(DNSDistTest): # this test suite uses a different responder port # because, contrary to the other ones, its # TCP responder allows multiple responses and we don't want # to mix things up. _testServ...
unknown
codeparrot/codeparrot-clean
# stdlib from types import ListType import time import unittest # 3p from mock import Mock from nose.plugins.attrib import attr # project from checks import AgentCheck from tests.checks.common import AgentCheckTest, load_check PORT1 = 37017 PORT2 = 37018 MAX_WAIT = 150 GAUGE = AgentCheck.gauge RATE = AgentCheck.rat...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS P...
unknown
codeparrot/codeparrot-clean
import XCTVapor import XCTest import Vapor import NIOCore import NIOFoundationCompat import AsyncHTTPClient import Atomics import NIOConcurrencyHelpers fileprivate extension String { static func randomDigits(length: Int = 999) -> String { var string = "" for _ in 0...999 { string += Str...
swift
github
https://github.com/vapor/vapor
Tests/VaporTests/AsyncRequestTests.swift
use actix_http::{header, uri::Uri, RequestHead, Version}; use super::{Guard, GuardContext}; /// Creates a guard that matches requests targeting a specific host. /// /// # Matching Host /// This guard will: /// - match against the `Host` header, if present; /// - fall-back to matching against the request target's host...
rust
github
https://github.com/actix/actix-web
actix-web/src/guard/host.rs
# 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. # These are fake fetchers that are used for testing and the preview server. # They return canned responses for URLs. appengine_wrappers.py uses the fake ...
unknown
codeparrot/codeparrot-clean
# Copyright 2014 Intel Corporation. # Copyright 2014 Isaku Yamahata <isaku.yamahata at intel com> # <isaku.yamahata at gmail com> # All Rights Reserved. # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the Lic...
unknown
codeparrot/codeparrot-clean
teststring = { 'big5': ( "\xa6\x70\xa6\xf3\xa6\x62\x20\x50\x79\x74\x68\x6f\x6e\x20\xa4\xa4" "\xa8\xcf\xa5\xce\xac\x4a\xa6\xb3\xaa\xba\x20\x43\x20\x6c\x69\x62" "\x72\x61\x72\x79\x3f\x0a\xa1\x40\xa6\x62\xb8\xea\xb0\x54\xac\xec" "\xa7\xde\xa7\xd6\xb3\x74\xb5\x6f\xae\x69\xaa\xba\xa4\xb5\xa4\xd1" "\x2c\x20\xb6\x7d\xb5\x6f\x...
unknown
codeparrot/codeparrot-clean
'use strict'; const util = require('util'); const common = require('../common'); const inputs = { 'string': ['Hello, my name is %s', 'Fred'], 'string-2': ['Hello, %s is my name', 'Fred'], 'number': ['Hi, I was born in %d', 1989], 'replace-object': ['An error occurred %j', { msg: 'This is an error' }], 'unkn...
javascript
github
https://github.com/nodejs/node
benchmark/util/format.js
from __future__ import absolute_import import sys from gi.repository import Gtk from gi.repository import GObject from .__init__ import DockComposite from .__init__ import NORTH, EAST, SOUTH, WEST, CENTER class PyDockComposite (Gtk.Alignment, DockComposite): def __init__ (self, position): GObject.GObject....
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test -reindex and -reindex-chainstate with CheckBlockIndex # from test_framework.test_framework impor...
unknown
codeparrot/codeparrot-clean
from datetime import datetime from django.forms import SplitHiddenDateTimeWidget from django.test import override_settings from django.utils import translation from .base import WidgetTest class SplitHiddenDateTimeWidgetTest(WidgetTest): widget = SplitHiddenDateTimeWidget() def test_render_empty(self): ...
unknown
codeparrot/codeparrot-clean
/* * Copyright (c) 2007 Mockito contributors * This program is made available under the terms of the MIT License. */ package org.mockito.internal.stubbing.defaultanswers; import static org.junit.Assert.*; import static org.junit.Assume.assumeFalse; import static org.mockito.Mockito.when; import org.junit.Test; imp...
java
github
https://github.com/mockito/mockito
mockito-core/src/test/java/org/mockito/internal/stubbing/defaultanswers/ReturnsMocksTest.java
groups: - name: test_1 rules: - record: test_2 expr: vector(2)
unknown
github
https://github.com/prometheus/prometheus
rules/fixtures/rules1.yaml
# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Michael Bayer mike_mp@zzzcomputing.com # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Exceptions used with SQLAlchemy. The base exception class is :class:`.SQLAlchemyError`. Except...
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
buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/socket/FileDescriptorTests.java
// Copyright 2024 The Cockroach Authors. // // Use of this software is governed by the CockroachDB Software License // included in the /LICENSE file. package sql import ( "context" "fmt" "strconv" "strings" "testing" "time" "github.com/cockroachdb/cockroach/pkg/base" "github.com/cockroachdb/cockroach/pkg/set...
go
github
https://github.com/cockroachdb/cockroach
pkg/sql/telemetry_datadriven_test.go
""" """ from setuptools import setup, find_packages setup(name = "Products.Paypal2SalesforceLead", version = "1.5", description = "Paypal provides a service called Instant Payment Notification (IPN) which can notify a URL when a payment is made. Paypal2SalesforceLead is a very simple Product for Plone which...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- ############################################################################### # # GetAllEvents # Retrieve data for all events in a specified calendar. # # Python version 2.6 # ############################################################################### from temboo.core.choreography import...
unknown
codeparrot/codeparrot-clean
{ "annotations": { "list": [ { "builtIn": 1, "datasource": { "type": "grafana", "uid": "-- Grafana --" }, "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations \u0026 Alerts", "type": "dashb...
json
github
https://github.com/grafana/grafana
apps/dashboard/pkg/migration/testdata/output/latest_version/v40.refresh_not_set.v42.json
//// [tests/cases/conformance/classes/propertyMemberDeclarations/autoAccessor1.ts] //// //// [autoAccessor1.ts] class C1 { accessor a: any; accessor b = 1; static accessor c: any; static accessor d = 2; } //// [autoAccessor1.js] "use strict"; class C1 { #a_accessor_storage; get a() { return th...
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/autoAccessor1(target=es2022).js
import fabric.api OPTION_PACKAGE = "OPTION_PACKAGE" OPTION_PYTHON_PACKAGE = "OPTION_PYTHON_PACKAGE" AVAILABLE_OPTIONS = dict( package=["apt", "yum", "zypper"], python_package=["easy_install", "pip"] ) DEFAULT_OPTIONS = dict( package="apt", python_package="pip" ) def select_package(selection=None): ...
unknown
codeparrot/codeparrot-clean
"""Class browser. XXX TO DO: - reparse when source changed (maybe just a button would be OK?) (or recheck on window popup) - add popup menu with more options (e.g. doc strings, base classes, imports) - show function argument list? (have to do pattern matching on source) - should the classes and methods lists also...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # # Copyright 2009 Facebook # # 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
// Copyright IBM Corp. 2016, 2025 // SPDX-License-Identifier: BUSL-1.1 package cassandra import ( "context" "fmt" "net" "os" "path/filepath" "runtime" "strings" "testing" "time" "github.com/gocql/gocql" "github.com/hashicorp/vault/sdk/helper/docker" ) type containerConfig struct { containerName string ...
go
github
https://github.com/hashicorp/vault
helper/testhelpers/cassandra/cassandrahelper.go
<?php declare(strict_types=1); /* * This file is part of Composer. * * (c) Nils Adermann <naderman@naderman.de> * Jordi Boggiano <j.boggiano@seld.be> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Composer\Test; ...
php
github
https://github.com/composer/composer
tests/Composer/Test/DocumentationTest.php
#-*- coding: utf-8 -*- """ Group Configuration Tests. """ import json import mock from django.conf import settings from django.test.utils import override_settings from opaque_keys.edx.keys import AssetKey from opaque_keys.edx.locations import AssetLocation from contentstore.utils import reverse_course_url from cont...
unknown
codeparrot/codeparrot-clean
from wtforms import Form, TextField, TextAreaField, PasswordField, validators class LogInForm(Form): email = TextField('Email',[validators.Required(), validators.Length(min=6,max=50)]) password = PasswordField('Password',[validators.Required()]) class SignUpForm(Form): first_name = TextField('First Name', [validat...
unknown
codeparrot/codeparrot-clean
import numpy as np import matplotlib.pyplot as plt def plot_decision_function(classifier, fea, gnd, title): ''' plot the decision function in 2-d plane classifiers: the svm models fea: array like, shape = (smp_num, fea_num) gnd: array like, shape = (smp_num,) title: title of...
unknown
codeparrot/codeparrot-clean
# encoding: utf-8 """ Translator taking a CXML abstract syntax tree (AST) and producing an object graph rooted in a |RootElement| object. """ from __future__ import ( absolute_import, division, print_function, unicode_literals ) from .model import ( Element, NamespaceDeclaration, RootElement, StringAttribute...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2013 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, or (at your option) any later...
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/configurationprocessor/MetadataGenerationEnvironmentFactory.java
#!/usr/bin/env python # # test_multibytecodec_support.py # Common Unittest Routines for CJK codecs # import codecs import os import re import sys import unittest from httplib import HTTPException from test import test_support from StringIO import StringIO class TestBase: encoding = '' # codec name ...
unknown
codeparrot/codeparrot-clean
import random from util import hook, http def api_get(query, key, is_image=None, num=1): url = ('https://www.googleapis.com/customsearch/v1?cx=007629729846476161907:ud5nlxktgcw' '&fields=items(title,link,snippet)&safe=off' + ('&searchType=image' if is_image else '')) return http.get_json(url, key=k...
unknown
codeparrot/codeparrot-clean
"""Translation utils.""" import argparse import os import pathlib import subprocess from .error import ExitApp def get_base_arg_parser() -> argparse.ArgumentParser: """Get a base argument parser.""" parser = argparse.ArgumentParser(description="Home Assistant Translations") parser.add_argument( "a...
unknown
codeparrot/codeparrot-clean
""" 3D Studio Max file (.3ds) parser. Author: Victor Stinner """ from hachoir_parser import Parser from hachoir_core.field import (StaticFieldSet, FieldSet, UInt16, UInt32, RawBytes, Enum, CString) from hachoir_parser.image.common import RGB from hachoir_core.endian import LITTLE_ENDIAN from hachoir_core.text_hand...
unknown
codeparrot/codeparrot-clean
"""Support for HomeKit Controller humidifier.""" from __future__ import annotations from aiohomekit.model.characteristics import CharacteristicsTypes from aiohomekit.model.services import ServicesTypes from homeassistant.components.humidifier import HumidifierEntity from homeassistant.components.humidifier.const impo...
unknown
codeparrot/codeparrot-clean
"""Integration with Python standard library module urllib2: Request class. Copyright 2004-2006 John J Lee <jjl@pobox.com> This code is free software; you can redistribute it and/or modify it under the terms of the BSD or ZPL 2.1 licenses (see the file COPYING.txt included with the distribution). """ import urllib2,...
unknown
codeparrot/codeparrot-clean
/*------------------------------------------------------------------------- * * pg_subscription.c * replication subscriptions * * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION * src/backend/catal...
c
github
https://github.com/postgres/postgres
src/backend/catalog/pg_subscription.c
# coding=utf-8 from __future__ import absolute_import from flask import make_response __author__ = "Gina Häußge <osd@foosel.net>" __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' __copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 Licens...
unknown
codeparrot/codeparrot-clean
//// [tests/cases/conformance/es6/for-ofStatements/for-of45.ts] //// //// [for-of45.ts] var k: string, v: boolean; var map = new Map([["", true]]); for ([k = "", v = false] of map) { k; v; } //// [for-of45.js] "use strict"; var k, v; var map = new Map([["", true]]); for ([k = "", v = false] of map) { k; ...
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/for-of45.js
// 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...
json
github
https://github.com/apache/kafka
clients/src/test/resources/common/message/SimpleRecordsMessage.json
import re from django.contrib.gis.db.backends.base.models import SpatialRefSysMixin from django.db import connection from django.test import TestCase, skipUnlessDBFeature from django.utils.functional import cached_property test_srs = ( { "srid": 4326, "auth_name": ("EPSG", True), "auth_sri...
python
github
https://github.com/django/django
tests/gis_tests/test_spatialrefsys.py
# 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. """Tests for ChromeDriver. If your test is testing a specific part of the WebDriver API, consider adding it to the appropriate place in the WebDriver tr...
unknown
codeparrot/codeparrot-clean
# 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. """ Error and information logging for IDL """ import sys class IDLLog(object): """Captures and routes logging output. Caputres logging output and/...
unknown
codeparrot/codeparrot-clean
import WebIDL expected = [ ("::TestConsts::zero", "zero", "Byte", 0), ("::TestConsts::b", "b", "Byte", -1), ("::TestConsts::o", "o", "Octet", 2), ("::TestConsts::s", "s", "Short", -3), ("::TestConsts::us", "us", "UnsignedShort", 4), ("::TestConsts::l", "l", "Long", -5), ("::TestConsts::ul",...
unknown
codeparrot/codeparrot-clean
# =========================================================================== # eXe # Copyright 2004-2006, University of Auckland # Copyright 2004-2008 eXe Project, http://eXeLearning.org/ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as ...
unknown
codeparrot/codeparrot-clean
from textwrap import dedent import py, pytest from _pytest.config import PytestPluginManager @pytest.fixture(scope="module", params=["global", "inpackage"]) def basedir(request, tmpdir_factory): from _pytest.tmpdir import tmpdir tmpdir = tmpdir(request, tmpdir_factory) tmpdir.ensure("adir/conftest.py").wri...
unknown
codeparrot/codeparrot-clean
# Used to guarantee to use at least Wx2.8 import wxversion wxversion.ensureMinimal('2.8') import wx import wx.aui import matplotlib as mpl from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as Canvas from matplotlib.backends.backend_wxagg import NavigationToolbar2Wx as Toolbar class Plot(wx.Panel): d...
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/DefaultHostResolver.java