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.support import check_syntax_error, run_unittest
class ScopeTests(unittest.TestCase):
def testSimpleNesting(self):
def make_adder(x):
def adder(y):
return x + y
return adder
inc = make_adder(1)
plus10 = make_adder(10)
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# 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 Lic... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/env python
sources = """
QlpoOTFBWSZTWcC/jl0G3b5///////////////////////9AwIAAgAMABABAAmIAgABEYmKFss+w
y2c7JLvjyw85vVtbvvt58za+3r06d93PSrbX177PpH2bK23Zz3d0W+x7fOn3dxoKU7pZ0Ks19777
6qXno+6WDVthUsKeigoEhKoopVQAFU0dOcG0D3w+U97eeMRKSpKdsru4+73hQAfVABr5dKfIvej7
vF7va2Xa+LhLUNsqqW+ruzFaDQrp3Y21CtHQabbqHbKogiIVubq... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
Tests for other lexers
~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import glob
import os
import unittest
from pygments.lexers import guess_lexer
from pygments.lexers.scripting import ... | unknown | codeparrot/codeparrot-clean | ||
# testing/fixtures.py
# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from . import config
from . import assertions, schema
from .util import adict
fr... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# File created on 19 May 2011
from __future__ import division
__author__ = "William Van Treuren"
__copyright__ = "Copyright 2011, The QIIME project"
__credits__ = ["William Van Treuren", "Greg Caporaso", "Jai Ram Rideout"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "William Va... | unknown | codeparrot/codeparrot-clean | ||
import unittest
from wordsalad import WordSaladMatrixBuilder, WordSaladMatrix
from wordsalad.generators import draw_follower, chain, generate_sentences
from itertools import islice
import random
def _get_static_string_mat():
builder = WordSaladMatrixBuilder()
builder.count_follower("cat", "has")
builder.... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInheritance1.ts] ////
//// [classAbstractInheritance1.ts]
abstract class A {}
abstract class B extends A {}
class C extends A {}
abstract class AA {
abstract foo();
}
abstract class BB extends AA {}
class CC extends AA {... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/classAbstractInheritance1.js |
// Copyright 2020 The Abseil 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 by applicable law or agree... | c | github | https://github.com/mysql/mysql-server | extra/abseil/abseil-cpp-20230802.1/absl/strings/internal/cord_rep_ring.h |
import urwid
from . import common
class _OptionWidget(urwid.WidgetWrap):
def __init__(self, option, text, shortcut, active, focus):
self.option = option
textattr = "text"
keyattr = "key"
if focus and active:
textattr = "option_active_selected"
keyattr = "opt... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright 2015 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/api/testing/deep_copy_test.go |
package daemon
import (
"fmt"
"os"
"path/filepath"
"strings"
"testing"
is "gotest.tools/v3/assert/cmp"
"gotest.tools/v3/fs"
containertypes "github.com/moby/moby/api/types/container"
"github.com/moby/moby/v2/daemon/container"
swarmagent "github.com/moby/swarmkit/v2/agent"
swarmapi "github.com/moby/swarmkit... | go | github | https://github.com/moby/moby | daemon/oci_windows_test.go |
"""
Package to test the openlp.core.lib package.
"""
from unittest import TestCase
from mock import MagicMock, Mock, patch
from PyQt4 import QtGui
from openlp.core.lib import Registry, ScreenList, ServiceItem
from openlp.core.ui.mainwindow import MainWindow
class TestServiceManager(TestCase):
def setUp(sel... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | unknown | codeparrot/codeparrot-clean | ||
/*-------------------------------------------------------------------------
* syncutils.c
* PostgreSQL logical replication: common synchronization code
*
* Copyright (c) 2025-2026, PostgreSQL Global Development Group
*
* IDENTIFICATION
* src/backend/replication/logical/syncutils.c
*
* NOTES
* This file ... | c | github | https://github.com/postgres/postgres | src/backend/replication/logical/syncutils.c |
/*
* Copyright 2010-2025 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.analysis.api.contracts.description.booleans
import org.jetbrains.kotlin.analysis... | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api/src/org/jetbrains/kotlin/analysis/api/contracts/description/booleans/KaContractBooleanExpression.kt |
"""
Demonstrates high-resolution tricontouring of a random set of points ;
a matplotlib.tri.TriAnalyzer is used to improve the plot quality.
The initial data points and triangular grid for this demo are:
- a set of random points is instantiated, inside [-1, 1] x [-1, 1] square
- A Delaunay triangulation of the... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2022 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/transforms/legacy_call/pass.h |
"""Generic interface to all dbm clones.
Use
import dbm
d = dbm.open(file, 'w', 0o666)
The returned object is a dbm.gnu, dbm.ndbm or dbm.dumb object, dependent on the
type of database being opened (determined by the whichdb function) in the case
of an existing dbm. If the dbm does not exist and the cr... | unknown | codeparrot/codeparrot-clean | ||
from functools import partial
from django.db.models.utils import make_model_tuple
from django.dispatch import Signal
class_prepared = Signal()
class ModelSignal(Signal):
"""
Signal subclass that allows the sender to be lazily specified as a string
of the `app_label.ModelName` form.
"""
def _lazy... | python | github | https://github.com/django/django | django/db/models/signals.py |
from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.llms import KoboldApiLLM
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPR... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/llms/koboldai.py |
<?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\Do... | php | github | https://github.com/composer/composer | tests/Composer/Test/Downloader/ZipDownloaderTest.php |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
"""
Utilities for view tests.
"""
import json
from contentstore.tests.utils import CourseTestCase
from contentstore.views.helpers import xblock_studio_url
from xmodule.modulestore.tests.factories import ItemFactory
class StudioPageTestCase(CourseTestCase):
"""
Base class for all tests of Studio pages.
""... | unknown | codeparrot/codeparrot-clean | ||
//go:build windows
/*
Copyright 2017 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 ag... | go | github | https://github.com/kubernetes/kubernetes | cmd/kubeadm/app/util/initsystem/initsystem_windows.go |
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
from __future__ import absolute_import, division, print_function
import sys
import _pytest._code
import py
import pytest
from test_excinfo import TWMock
def test_ne():
code1 = _pytest._code.Code(compile('foo = "bar"', '', 'exec'))
assert code1 == code1
code2 = _pytest._code.Code(compile('f... | unknown | codeparrot/codeparrot-clean | ||
{
"values": {
"id": {
"string": "f3c6ddc5-37d5-0170-64ff-518ad421385a"
},
"string": {
"string": "Hello, drift!"
}
}
} | json | github | https://github.com/hashicorp/terraform | testing/equivalence-tests/tests/drift_simple/terraform.resource/f3c6ddc5-37d5-0170-64ff-518ad421385a.json |
use crate::spec::{
Cc, FramePointer, LinkOutputKind, LinkerFlavor, Lld, Os, TargetOptions, crt_objects, cvs,
};
pub(crate) fn opts() -> TargetOptions {
// This mirrors the linker options provided by clang. We presume lld for
// now. When using clang as the linker it will supply these options for us,
//... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_target/src/spec/base/fuchsia.rs |
import unittest
from datetime import datetime
from unittest.mock import Mock, PropertyMock, patch
import zap_common
import zapv2
class TestZapCommon(unittest.TestCase):
def setUp(self):
zap_common.context_id = None
zap_common.context_name = None
zap_common.context_users = None
zap... | unknown | codeparrot/codeparrot-clean | ||
from django.contrib import admin
from django.contrib.contenttypes import generic
from django.db.models import Q
from models import Member, Membership, MemberAltname
from models import CoalitionMembership, Correlation, Party, \
Award, AwardType, Knesset
from links.models import Link
from video.models import Video
f... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
import sys;
import os;
sys.path.append("allinpay projects")
from creditscore.creditscore import CreditScore
import numpy as np
import pandas as pd
import time
from sklearn.model_selection import train_test_split
from sklearn.linear_model i... | unknown | codeparrot/codeparrot-clean | ||
import sys, os
from twisted.trial import unittest
testModule = """
from twisted.trial import unittest
class FooTest(unittest.TestCase):
def testFoo(self):
pass
"""
dosModule = testModule.replace('\n', '\r\n')
testSample = """
'''This module is used by test_loader to test the Trial test loading
functiona... | unknown | codeparrot/codeparrot-clean | ||
import { test } from '../../test';
export default test({
html: `
<div>
<p>foo</p>
</div>
`,
async test({ assert, target, window }) {
const div = target.querySelector('div');
const click = new window.MouseEvent('click', { bubbles: true });
await div?.dispatchEvent(click);
assert.htmlEqual(
targe... | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/tests/runtime-legacy/samples/component-slot-let-e/_config.js |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""
sentry.utils.runner
~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
from logan.runner import run_app, configure_app
import base64
import os
impo... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
import logging
import sys
import types
import warnings
from django import http
from django.conf import settings
from django.core import signals, urlresolvers
from django.core.exceptions import (
MiddlewareNotUsed, PermissionDenied, SuspiciousOperation,
)
from django.db impo... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
"""Tests for laguerre module.
"""
from __future__ import division, absolute_import, print_function
import numpy as np
import numpy.polynomial.laguerre as lag
from numpy.polynomial.polynomial import polyval
from numpy.testing import (
TestCase, assert_almost_equal, assert_raises,
assert_equal, assert_, run_mod... | unknown | codeparrot/codeparrot-clean | ||
from enum import Enum
from flask_admin.model import filters
class BookmarkField(Enum):
ID = 0
URL = 1
TITLE = 2
TAGS = 3
DESCRIPTION = 4
def equal_func(query, value, index):
return filter(lambda x: x[index] == value, query)
def not_equal_func(query, value, index):
return filter(lambda x:... | 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
from datetime import datetime
from functools import partial
import time
_socket = __import__("socket")
# workaround on osx, disable kqueue
if sys.platform =... | unknown | codeparrot/codeparrot-clean | ||
/* __next_internal_action_entry_do_not_use__ {"601c36b06e398c97abe5d5d7ae8c672bfddf4e1b91":{"name":"$$RSC_SERVER_ACTION_2"},"606a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"},"6090b5db271335765a4b0eab01f044b381b5ebd5cd":{"name":"$$RSC_SERVER_ACTION_1"},"7f0090eaf4e1f08a2d94f6be401e54a2ded399b... | javascript | github | https://github.com/vercel/next.js | crates/next-custom-transforms/tests/fixture/server-actions/server-graph/30/output.js |
#![no_main]
use std::str::FromStr;
use globset::Glob;
libfuzzer_sys::fuzz_target!(|glob_str: &str| {
let Ok(glob) = Glob::new(glob_str) else {
return;
};
let Ok(glob2) = Glob::from_str(glob_str) else {
return;
};
// Verify that a `Glob` constructed with `new` is the same as a `G... | rust | github | https://github.com/BurntSushi/ripgrep | fuzz/fuzz_targets/fuzz_glob.rs |
export default function Home() {
return __jsx("h1", null, "Hello World!");
} | javascript | github | https://github.com/vercel/next.js | crates/next-custom-transforms/tests/fixture/ssg/getStaticProps/no-props/output.js |
"""PyPI and direct package downloading"""
import sys
import os
import re
import shutil
import socket
import base64
import hashlib
import itertools
from functools import wraps
try:
from urllib.parse import splituser
except ImportError:
from urllib2 import splituser
import six
from six.moves import urllib, http... | unknown | codeparrot/codeparrot-clean | ||
name: Annocheck
on:
push:
paths-ignore:
- 'doc/**'
- '**/man/*'
- '**.md'
- '**.rdoc'
- '**/.document'
- '.*.yml'
pull_request:
paths-ignore:
- 'doc/**'
- '**/man/*'
- '**.md'
- '**.rdoc'
- '**/.document'
- '.*.yml'
merge_group:
con... | unknown | github | https://github.com/ruby/ruby | .github/workflows/annocheck.yml |
import os
import string
import math
import re
import subprocess
# I didn't implement getProperties, found it somewhere, just reads a java style
# properties file into a dictionary.
#Note: Fixed by Bryan Lunt <blunt@sdsc.edu> on Oct, 28, 2013 to handle properly escaped spaces in properties files.
import re
__property_s... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Michael Eaton <meaton@iforium.com>
# 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... | unknown | codeparrot/codeparrot-clean | ||
import sys
import numpy as np
from pandas import (
DataFrame,
Index,
concat,
date_range,
json_normalize,
read_json,
timedelta_range,
)
from ..pandas_vb_common import BaseIO
class ReadJSON(BaseIO):
fname = "__test__.json"
params = (["split", "index", "records"], ["int", "datetime"... | python | github | https://github.com/pandas-dev/pandas | asv_bench/benchmarks/io/json.py |
import type { NextApiRequest, NextApiResponse } from "next";
import Cors from "cors";
// Initializing the cors middleware
// You can read more about the available options here: https://github.com/expressjs/cors#configuration-options
const cors = Cors({
methods: ["POST", "GET", "HEAD"],
});
// Helper method to wait ... | typescript | github | https://github.com/vercel/next.js | examples/api-routes-cors/pages/api/cors.ts |
from datetime import datetime, timezone
import pytest
from scrapy.exceptions import NotConfigured
from scrapy.extensions.spiderstate import SpiderState
from scrapy.spiders import Spider
from scrapy.utils.test import get_crawler
def test_store_load(tmp_path):
jobdir = str(tmp_path)
spider = Spider(name="defa... | python | github | https://github.com/scrapy/scrapy | tests/test_spiderstate.py |
# Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env bash
set -e
dir="$1"
if [ -z "$dir" ]; then
{
echo 'This script is for destroying old /var/lib/docker directories more safely than'
echo ' "rm -rf", which can cause data loss or other serious issues.'
echo
echo "usage: $0 directory"
echo " ie: $0 /var/lib/docker"
} >&2
exit 1
fi
if [ "... | unknown | github | https://github.com/moby/moby | contrib/nuke-graph-directory.sh |
package libnetwork
import (
"context"
"testing"
"github.com/moby/moby/v2/daemon/libnetwork/config"
)
func testLocalBackend(t *testing.T, path, bucket string) {
cfgOptions := []config.Option{
config.OptionDataDir(path),
func(c *config.Config) { c.DatastoreBucket = bucket },
}
testController, err := New(con... | go | github | https://github.com/moby/moby | daemon/libnetwork/store_test.go |
#!/usr/bin/env python
# Copyright 2011 Google Inc. 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... | unknown | codeparrot/codeparrot-clean | ||
"""
Tests of the LMS XBlock Mixin
"""
import ddt
from xblock.validation import ValidationMessage
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, TEST_DATA_MIXED_TOY_MODULES... | unknown | codeparrot/codeparrot-clean | ||
from django.db import migrations, models
import django_countries.fields
import django.db.models.deletion
from django.conf import settings
from opaque_keys.edx.django.models import CourseKeyField
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODE... | unknown | codeparrot/codeparrot-clean | ||
# This test module covers support in various parts of the standard library
# for working with modules located inside zipfiles
# The tests are centralised in this fashion to make it easy to drop them
# if a platform doesn't support zipimport
import test.support
import os
import os.path
import sys
import textwrap
import ... | 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 | ||
from django.conf.urls import url
from django.contrib.auth import views as auth_views
from django.views.generic import RedirectView
from . import views
from .models import Article, DateArticle
date_based_info_dict = {
'queryset': Article.objects.all(),
'date_field': 'date_created',
'month_format': '%m',
}
... | unknown | codeparrot/codeparrot-clean | ||
# This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | 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.util.reflection;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse... | java | github | https://github.com/mockito/mockito | mockito-core/src/test/java/org/mockito/internal/util/reflection/FieldInitializerTest.java |
"""
========================= IMAGE LINKS =================================
Turns paragraphs like
<~~~~~~~~~~~~~~~~~~~~~~~~
dir/subdir
dir/subdir
dir/subdir
~~~~~~~~~~~~~~
dir/subdir
dir/subdir
dir/subdir
~~~~~~~~~~~~~~~~~~~>
Into mini-photo galleries.
"""
import re, markdown
import url_manager
IMAGE_LINK = """<a... | unknown | codeparrot/codeparrot-clean | ||
// This file can update, because it accept itself.
// A dispose handler removes the old <style> element.
var addStyle = require("./addStyle");
var dispose = addStyle("body { background: green; }");
if(module.hot) {
module.hot.accept();
module.hot.dispose(dispose);
} | javascript | github | https://github.com/webpack/webpack | test/hotPlayground/style.js |
import { test } from '../../assert';
const tick = () => Promise.resolve();
export default test({
warnings: [
{
code: 'attribute_avoid_is',
message:
'The "is" attribute is not supported cross-browser and should be avoided\nhttps://svelte.dev/e/attribute_avoid_is',
start: {
character: 109,
column... | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/tests/runtime-browser/custom-elements-samples/extended-builtin/_config.js |
/*
* 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 | benchmarks/src/main/java/org/elasticsearch/benchmark/swisshash/BytesRefSwissHashBenchmark.java |
import { MakeswiftApiHandler } from "@makeswift/runtime/next";
export default MakeswiftApiHandler(process.env.MAKESWIFT_SITE_API_KEY!); | typescript | github | https://github.com/vercel/next.js | examples/cms-makeswift/pages/api/makeswift/[...makeswift].ts |
#
# PS Move API - An interface for the PS Move Motion Controller
# Copyright (c) 2011 Thomas Perl <m@thp.io>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source cod... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.server.response
/**
* HTTP/2 push is no longer supported by the Chrome web browser.
* Other browsers may discard it at some point.
* With such browsers, HTTP/2 push will be d... | kotlin | github | https://github.com/ktorio/ktor | ktor-server/ktor-server-core/common/src/io/ktor/server/response/UseHttp2Push.kt |
/*!
* 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... | typescript | github | https://github.com/apache/airflow | airflow-core/src/airflow/ui/src/pages/Dashboard/Stats/Stats.tsx |
# 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 | ||
# Copyright 2014 CERN.
#
# 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, softw... | unknown | codeparrot/codeparrot-clean | ||
#ifndef Py_INTERNAL_OBJECT_H
#define Py_INTERNAL_OBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef Py_BUILD_CORE
# error "this header requires Py_BUILD_CORE define"
#endif
#include "pycore_emscripten_trampoline.h" // _PyCFunction_TrampolineCall()
#include "pycore_gc.h" // _PyObject_GC_TRACK()
#inclu... | c | github | https://github.com/python/cpython | Include/internal/pycore_object.h |
"""
Django queryset filters used by the requests view
"""
from datetime import timedelta, datetime
import logging
from django.db.models import Q, Count, Sum
from django.utils import timezone
from silk.profiling.dynamic import _get_module
from silk.templatetags.silk_filters import _silk_date_time
logger = logging.getL... | unknown | codeparrot/codeparrot-clean | ||
/*
* 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/gradle/internal/test/BuildConfigurationAwareGradleRunner.java |
import unittest
class TestAssert(unittest.TestCase):
def test_pass(self):
true = True
self.assertTrue(true) | python | github | https://github.com/mongodb/mongo | buildscripts/tests/resmoke_validation/tests/python_test.py |
from django.test.testcases import LiveServerTestCase
from selenium import webdriver
from about_me.models import Message
from jellyblog.models import Category, Document
from jellyblog.views import init_category
class MessageTest(LiveServerTestCase):
def setUp(self):
# 유저는 메인 화면으로 들어와서
self.browser ... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import
from rest_framework.response import Response
from sentry.api.base import DocSection
from sentry.api.bases.group import GroupEndpoint
from sentry.api.exceptions import ResourceDoesNotExist
from sentry.api.serializers import serialize
from sentry.models import GroupTagValue, TagKe... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
import {useFragment} from 'shared-runtime';
function Component(props) {
const x = makeObject();
const user = useFragment(
graphql`
fragment Component_user on User {
name
}
`,
props.user
);
const posts = user.timeline.posts.edges.nodes.map(node => {
x.y = true;
return <Po... | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/readonly-object-method-calls-mutable-lambda.js |
from django.conf import settings
from django.core.checks import Error, Tags, register
@register(Tags.compatibility)
def check_csrf_trusted_origins(app_configs, **kwargs):
errors = []
for origin in settings.CSRF_TRUSTED_ORIGINS:
if "://" not in origin:
errors.append(
Error(
... | python | github | https://github.com/django/django | django/core/checks/compatibility/django_4_0.py |
import sys
import os
import subprocess
import xml.sax
import tempfile
import shutil
from base64 import encodestring
sys.path.append("/usr/share/rhn/")
from up2date_client import up2dateLog
from up2date_client import rhnserver
from up2date_client import up2dateAuth
from up2date_client import up2dateErrors
__rhnexport__... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
Romanian specific form helpers.
"""
from __future__ import absolute_import
from django.contrib.localflavor.ro.ro_counties import COUNTIES_CHOICES
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError, Field, RegexField, Select
from django.utils.translation... | unknown | codeparrot/codeparrot-clean | ||
import sys
PY2 = sys.version_info[0] == 2
if PY2:
from future_builtins import zip as izip, map as imap
import __builtin__ as builtins
import cPickle as pickle
from cStringIO import StringIO
xrange = xrange
basestring = basestring
unicode = unicode
buffer = buffer
int_types = (int, ... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2023 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
package jobs_test
import (
"context"
"testing"
"github.com/cockroachdb/cockroach/pkg/base"
"github.com/cockroachdb/cockroach/pkg/jobs"
"github.com/cockroachdb/coc... | go | github | https://github.com/cockroachdb/cockroach | pkg/jobs/update_test.go |
from .base import SimIRExpr
from .. import size_bytes
from ... import s_options as o
from ...s_action import SimActionData
from ...s_variable import SimRegisterVariable
class SimIRExpr_GetI(SimIRExpr):
def _execute(self):
self.ix = self._translate_expr(self._expr.ix)
size = size_bytes(self._expr.de... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2017 - 2025 R. Thomas
* Copyright 2017 - 2025 Quarkslab
*
* 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 req... | unknown | github | https://github.com/nodejs/node | deps/LIEF/include/LIEF/PE/ResourceData.hpp |
package kotlinx.coroutines.reactor
import kotlinx.coroutines.*
import kotlinx.coroutines.channels.*
import reactor.core.publisher.*
import kotlin.coroutines.*
/**
* Converts this job to the hot reactive mono that signals
* with [success][MonoSink.success] when the corresponding job completes.
*
* Every subscriber... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | reactive/kotlinx-coroutines-reactor/src/Convert.kt |
#
# 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 | ||
"""Hue binary sensor entities."""
from aiohue.sensors import TYPE_ZLL_PRESENCE
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_MOTION,
BinarySensorDevice,
)
from homeassistant.components.hue.sensor_base import (
GenericZLLSensor,
SensorManager,
async_setup_entry as shared_async_s... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import
from engineauth import models
from engineauth import utils
from engineauth.config import load_config
import re
import traceback
from webob import Response
from webob import Request
class EngineAuthResponse(Response):
def _save_session(self):
session = self.request.se... | unknown | codeparrot/codeparrot-clean | ||
""" Unit tests for pipelines expressed via arlexecute
"""
import logging
import sys
import unittest
import numpy
from astropy import units as u
from astropy.coordinates import SkyCoord
from data_models.memory_data_models import Image, SkyModel
from data_models.memory_data_models import Skycomponent
from data_models.... | unknown | codeparrot/codeparrot-clean | ||
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | unknown | codeparrot/codeparrot-clean | ||
"""Test shopping list component."""
import asyncio
from unittest.mock import patch
import pytest
from homeassistant.bootstrap import async_setup_component
from homeassistant.helpers import intent
from homeassistant.components.websocket_api.const import TYPE_RESULT
@pytest.fixture(autouse=True)
def mock_shopping_list... | unknown | codeparrot/codeparrot-clean | ||
from django.conf.urls import patterns, include, url
urlpatterns = patterns('',
#Main
url(r'^$', 'main.views.index', name='home'),
url(r'^settings/', 'main.views.settings', name='settings'),
url(r'^network/', 'main.views.networkviews', name='network view'),
url(r'^notifications/', 'main.views.notifi... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
pyspecific.py
~~~~~~~~~~~~~
Sphinx extension with Python doc-specific markup.
:copyright: 2008-2014 by Georg Brandl.
:license: Python license.
"""
import re
import io
from os import getenv, path
from docutils import nodes
from docutils.parsers.rst import directives
fr... | python | github | https://github.com/python/cpython | Doc/tools/extensions/pyspecific.py |
use std::collections::BTreeSet;
use anyhow::{Result, bail};
use bincode::{Decode, Encode};
use turbo_rcstr::{RcStr, rcstr};
use turbo_tasks::{ResolvedVc, TaskInput, Vc, trace::TraceRawVcs};
use turbo_tasks_fs::FileSystemPath;
use turbopack::{
module_options::{
CssOptionsContext, EcmascriptOptionsContext, E... | rust | github | https://github.com/vercel/next.js | crates/next-core/src/next_server/context.rs |
@starting-style {
.card.svelte-xyz{
height: 0;
}
}
.card.svelte-xyz {
color: red;
} | css | github | https://github.com/sveltejs/svelte | packages/svelte/tests/css/samples/at-rule-nested-class/expected.css |
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
/*
* FreeBSD does not test /etc/localtime change, however, we can workaround it
* by calling tzset() with TZ and then without TZ to update timezone.
* The trick should work since FreeBSD 2.1.0.
*
* Linu... | c | github | https://github.com/nginx/nginx | src/os/unix/ngx_time.c |
"""
Tests for pika.credentials
"""
try:
import mock
except ImportError:
from unittest import mock
try:
import unittest2 as unittest
except ImportError:
import unittest
from pika import credentials
from pika import spec
class PlainCredentialsTests(unittest.TestCase):
CREDENTIALS = 'guest', 'gues... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.