code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import pytest import re from ansible import context from ansible.cli.adhoc...
unknown
codeparrot/codeparrot-clean
import json from django import template from django.template.defaultfilters import stringfilter from django.utils.safestring import mark_safe from django.utils.text import normalize_newlines from ..models import LogRecord from ..settings import EXTRA_DATA_INDENT, PAGINATOR_RANGE register = template.Library() @regis...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- from openerp.tests import common KARMA = { 'ask': 5, 'ans': 10, 'com_own': 5, 'com_all': 10, 'com_conv_all': 50, 'upv': 5, 'dwv': 10, 'edit_own': 10, 'edit_all': 20, 'close_own': 10, 'close_all': 20, 'unlink_own': 10, 'unlink_all': 20, 'gen_que_new': 1, 'gen_que...
unknown
codeparrot/codeparrot-clean
// SPDX-License-Identifier: GPL-2.0 /* * device_cgroup.c - device cgroup subsystem * * Copyright 2007 IBM Corp */ #include <linux/bpf-cgroup.h> #include <linux/device_cgroup.h> #include <linux/cgroup.h> #include <linux/ctype.h> #include <linux/list.h> #include <linux/uaccess.h> #include <linux/seq_file.h> #include...
c
github
https://github.com/torvalds/linux
security/device_cgroup.c
import {getNull} from 'shared-runtime'; function Component(props) { const items = (() => { return getNull() ?? []; })(); items.push(props.a); return items; } export const FIXTURE_ENTRYPOINT = { fn: Component, params: [{a: {}}], };
typescript
github
https://github.com/facebook/react
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/align-scopes-iife-return-modified-later-logical.ts
"""The tests for the Logger component.""" from collections import namedtuple import logging import unittest from homeassistant.setup import setup_component from homeassistant.components import logger from tests.common import get_test_home_assistant RECORD = namedtuple('record', ('name', 'levelno')) NO_LOGS_CONFIG =...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp.osv import osv from openerp.tools.translate import _ from openerp.exceptions import UserError class analytic_plan_create_model(osv.osv_memory): _name = "analytic.plan.create.model" _description = "a...
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
core/spring-boot-test/src/main/java/org/springframework/boot/test/context/filter/annotation/StandardAnnotationCustomizableTypeExcludeFilter.java
# Kubernetes (K8s) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/569/badge)](https://bestpractices.coreinfrastructure.org/projects/569) [![Go Report Card](https://goreportcard.com/badge/github.com/kubernetes/kubernetes)](https://goreportcard.com/report/github.com/kubernetes/kubernetes) !...
unknown
github
https://github.com/kubernetes/kubernetes
README.md
<?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\PhpUnit\Tests\Fixtures; enum ExistingEnumReal { }
php
github
https://github.com/symfony/symfony
src/Symfony/Bridge/PhpUnit/Tests/Fixtures/ExistingEnumReal.php
{ "openFiles": ["src/app/app.ts"], "title": "Control flow in components - @if", "type": "editor" }
json
github
https://github.com/angular/angular
adev/src/content/tutorials/learn-angular/steps/4-control-flow-if/config.json
# frozen_string_literal: true # :markup: markdown require "active_support/core_ext/hash/keys" require "action_dispatch/middleware/session/abstract_store" require "rack/session/cookie" module ActionDispatch module Session # # Action Dispatch Session CookieStore # # This cookie-based session store is the...
ruby
github
https://github.com/rails/rails
actionpack/lib/action_dispatch/middleware/session/cookie_store.rb
/* * Copyright 2002-present the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required b...
java
github
https://github.com/spring-projects/spring-framework
spring-beans/src/test/java/org/springframework/beans/factory/aot/AutowiredMethodArgumentsResolverTests.java
/* * contrib/tablefunc/tablefunc.c * * * tablefunc * * Sample to demonstrate C functions which return setof scalar * and setof composite. * Joe Conway <mail@joeconway.com> * And contributors: * Nabil Sayegh <postgresql@e-trolley.de> * * Copyright (c) 2002-2026, PostgreSQL Global Development Group * * Perm...
c
github
https://github.com/postgres/postgres
contrib/tablefunc/tablefunc.c
#!/usr/bin/env python3 import argparse import json import subprocess import sys def dump_json(obj, out, pretty): if pretty: json.dump(obj, out, indent=2, sort_keys=True) else: json.dump(obj, out, separators=(",", ":"), sort_keys=True) return def main(): parser = argparse.ArgumentParse...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python from string import strip from sys import stdin targets = {} smilies = {'slowdown': '&#9785;' , 'speedup': '&#9786;'} for line in stdin: line = map(strip, filter(None, line.split(' '))) if 9 == len(line): target, name = line[0:2] factor, dir = line[-2:] name = name.split('-') name, size ...
unknown
codeparrot/codeparrot-clean
import doctest import json import logging import os import unittest import sys sys.path.insert(0, "..") import configr class Tests(unittest.TestCase): ''' Test suite. ''' def tests_metadata(_): _.assertTrue(hasattr(configr, "version")) _.assertTrue(hasattr(configr.version, "__version__")) _.assertTru...
unknown
codeparrot/codeparrot-clean
import sys if sys.version_info[0] < 3: from ConfigParser import SafeConfigParser, NoOptionError else: from configparser import SafeConfigParser, NoOptionError import re import os import shlex __all__ = ['FormatError', 'PkgNotFound', 'LibraryInfo', 'VariableSet', 'read_config', 'parse_flags'] _VAR = re...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # Copyright 2023 The HuggingFace Inc. team. 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 # # U...
python
github
https://github.com/huggingface/transformers
examples/pytorch/image-pretraining/run_mim_no_trainer.py
import sys import struct import threading import json import skitai from .. import wsgi_handler from ...backbone.http_response import catch from aquests.athreads import trigger from rs4 import strutil from aquests.protocols.grpc import discover from aquests.protocols.ws import * from aquests.protocols.http import http_...
unknown
codeparrot/codeparrot-clean
from __future__ import unicode_literals import os import re import subprocess import time from .common import FileDownloader from ..compat import compat_str from ..utils import ( check_executable, encodeFilename, encodeArgument, get_exe_version, ) def rtmpdump_version(): return get_exe_version( ...
unknown
codeparrot/codeparrot-clean
""" NodeMeister ENC - methods to aid in collection of resources """ def getExclusions(node): """ Get excluded groups, classes, params for a node :param node: the node to get exclusions for :type node: Node :returns: tuple: (list of excluded group names, list of excluded class names, list of e...
unknown
codeparrot/codeparrot-clean
# encoding: utf-8 """Utilities to enable code objects to be pickled. Any process that import this module will be able to pickle code objects. This includes the func_code attribute of any function. Once unpickled, new functions can be built using new.function(code, globals()). Eventually we need to automate all of ...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
unknown
codeparrot/codeparrot-clean
"""distutils.command.install Implements the Distutils 'install' command.""" from distutils import log # This module should be kept compatible with Python 2.1. __revision__ = "$Id: install.py 62788 2008-05-06 22:41:46Z christian.heimes $" import sys, os, string from types import * from distutils.core import Command...
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
core/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/lifecycle/TestcontainersLifecycleBeanFactoryPostProcessor.java
/* * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ package ktorbuild.internal import org.gradle.accessors.dm.LibrariesForLibs import org.gradle.api.Project import org.gradle.kotlin.dsl.the /** * Accessor to make version catalog available in...
kotlin
github
https://github.com/ktorio/ktor
build-logic/src/main/kotlin/ktorbuild/internal/VersionCatalogs.kt
//// [tests/cases/compiler/collisionArgumentsClassMethod.ts] //// //// [collisionArgumentsClassMethod.ts] class c1 { public foo(i: number, ...arguments) { //arguments is error var arguments: any[]; // no error } public foo1(arguments: number, ...rest) { //arguments is error var arguments = ...
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/collisionArgumentsClassMethod(target=es5).js
# 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...
python
github
https://github.com/tensorflow/tensorflow
tensorflow/compiler/tests/spacetobatch_op_test.py
#!/usr/bin/env python # 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 appli...
unknown
codeparrot/codeparrot-clean
import os import tarfile import zipfile from charmhelpers.core import ( host, hookenv, ) class ArchiveError(Exception): pass def get_archive_handler(archive_name): if os.path.isfile(archive_name): if tarfile.is_tarfile(archive_name): return extract_tarfile elif zipfile.is_z...
unknown
codeparrot/codeparrot-clean
from __future__ import division, absolute_import, print_function import timeit from functools import reduce import numpy as np from numpy import float_ import numpy.core.fromnumeric as fromnumeric from numpy.testing import build_err_msg # Fixme: this does not look right. np.seterr(all='ignore') pi = np.pi class M...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import random import time # Note: pyauto_functional must come before pyauto. import pyauto_functional import pyauto import webrtc_...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- from openerp import tools from openerp.osv import osv, fields class TestMassMailing(osv.TransientModel): _name = 'mail.mass_mailing.test' _description = 'Sample Mail Wizard' _columns = { 'email_to': fields.char('Recipients', required=True, help='Comma-separated...
unknown
codeparrot/codeparrot-clean
# Expired Certificates and Configuration for Testing This has a valid certificate authority in [ca](./ca) and an invalid server certificate in [server](./server). This can all be regenerated with: ``` make clean make all ```
unknown
github
https://github.com/psf/requests
tests/certs/expired/README.md
# (c) 2012, Jeroen Hoekx <jeroen@hoekx.be> # # 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....
unknown
codeparrot/codeparrot-clean
import re from util import hook, http, formatting search_url = "http://search.atomz.com/search/?sp_a=00062d45-sp00000000" @hook.command def snopes(inp): """snopes <topic> -- Searches snopes for an urban legend about <topic>.""" search_page = http.get_html(search_url, sp_q=inp, sp_c="1") result_urls = se...
unknown
codeparrot/codeparrot-clean
""" Devices controlled my the ISY are represented as "nodes" on the ISY device and with Node Objects in the API There are three types of Node Object: * IsyNode - Node Object Represent lights, switches, motion sensors * IsyScene - Scene Object Represents Scenes contains Nodes that comprise a "...
unknown
codeparrot/codeparrot-clean
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you...
java
github
https://github.com/apache/hadoop
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestListFiles.java
# Copyright 2025 The HuggingFace Team. 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 applicabl...
python
github
https://github.com/huggingface/transformers
src/transformers/integrations/mxfp4.py
[ { "year": 1990, "month": 1, "day": 20, "hour": 14, "minute": 12, "second": 1 }, { "year": 1996, "month": 3, "day": 20, "hour": 2, "minute": 55, "second": 12 }, { "year": 2000, "month": 3...
json
github
https://github.com/nodejs/node
deps/crates/vendor/icu_calendar/benches/fixtures/datetimes.json
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) # Copyright 2025 Eddie James %YAML 1.2 --- $id: http://devicetree.org/schemas/interrupt-controller/aspeed,ast2500-scu-ic.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# title: Aspeed AST25XX, AST26XX, AST27XX SCU Interrupt Controller maintainers: ...
unknown
github
https://github.com/torvalds/linux
Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2500-scu-ic.yaml
#!/usr/bin/python # # (c) 2013, Nimbis Services # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['deprecated']...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # # Copyright (C) 2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
unknown
codeparrot/codeparrot-clean
// Copyright 2018 The Cockroach Authors. // // Use of this software is governed by the CockroachDB Software License // included in the /LICENSE file. package sql import ( "context" "github.com/cockroachdb/cockroach/pkg/kv" "github.com/cockroachdb/cockroach/pkg/sql/catalog" "github.com/cockroachdb/cockroach/pkg/s...
go
github
https://github.com/cockroachdb/cockroach
pkg/sql/tablewriter_insert.go
#if defined __AVX512__ || defined __AVX512F__ #include <immintrin.h> void test() { __m512 a, b, c, d, e; __m512i ai, bi, ci, di, ei, fi; __m128 *mem; __m128i *memi; __mmask16 m; a = _mm512_4fnmadd_ps(a, b, c, d, e, mem); ai = _mm512_4dpwssd_epi32(ai, bi, ci, di, ei, memi); ai = _mm512_...
cpp
github
https://github.com/opencv/opencv
cmake/checks/cpu_avx512knm.cpp
# set up logging before importing any other components if __name__ == '__main__': from config import initialize_logging # noqa initialize_logging('jmxfetch') # std import glob import logging import os import signal import sys import time # 3rd party import yaml # datadog from config import ( DEFAULT_CHE...
unknown
codeparrot/codeparrot-clean
import __future__ class Node(object): def __init__(self, data = None, next_node = None, prev_node = None): self.data = data self.next_node = next_node self.prev_node = prev_node def print_node(self): if (self.data): print("self", self.data, ", next:", self.next_nod...
unknown
codeparrot/codeparrot-clean
// LANGUAGE: +ContextParameters // MODULE: context // FILE: contextParameter.kt class Ctx1 { fun foo() = 10 } class Ctx2 { fun boo(x: Int) = 10 + x } context(ctx2: Ctx2) fun bar(x: Int) = ctx2.boo(x) context(ctx1: Ctx1, ctx2: Ctx2) fun check(x: Int) { <caret_context>ctx1.foo() } fun main() { conte...
kotlin
github
https://github.com/JetBrains/kotlin
analysis/analysis-api/testData/components/compilerFacility/compilation/codeFragments/capturing/contextParameter.kt
from django.template.base import TemplateSyntaxError from django.template.loader import get_template from django.test import SimpleTestCase from django.utils import six from .utils import render, setup class WidthRatioTagTests(SimpleTestCase): @setup({'widthratio01': '{% widthratio a b 0 %}'}) def test_width...
unknown
codeparrot/codeparrot-clean
/* contrib/pageinspect/pageinspect--1.2--1.3.sql */ -- complain if script is sourced in psql, rather than via ALTER EXTENSION \echo Use "ALTER EXTENSION pageinspect UPDATE TO '1.3'" to load this file. \quit -- -- brin_page_type() -- CREATE FUNCTION brin_page_type(IN page bytea) RETURNS text AS 'MODULE_PATHNAME', 'bri...
sql
github
https://github.com/postgres/postgres
contrib/pageinspect/pageinspect--1.2--1.3.sql
# sympy/galgebra/vector.py """ vector.py is a helper class for the MV class that defines the basis vectors and metric and calulates derivatives of the basis vectors for the MV class. """ import itertools import copy from sympy import Symbol, S, Matrix, trigsimp, diff, expand from sympy.core.compatibility import rang...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # # script.py # colorific # import sys import optparse from colorific import config from colorific.palette import ( extract_colors, print_colors, save_palette_as_image, color_stream_mt, color_stream_st) class Application(object): def __init__(self): self.parser = self.cr...
unknown
codeparrot/codeparrot-clean
// Copyright 2024 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
client/v3/kubernetes/client.go
/* * Copyright 2002-present the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required b...
java
github
https://github.com/spring-projects/spring-framework
spring-beans/src/testFixtures/java/org/springframework/beans/testfixture/beans/DummyBean.java
# -*- coding: utf-8 -*- from ccxt.bitfinex import bitfinex import hashlib from ccxt.base.errors import ExchangeError from ccxt.base.errors import NotSupported from ccxt.base.errors import InsufficientFunds class bitfinex2 (bitfinex): def describe(self): return self.deep_extend(super(bitfinex2, self).desc...
unknown
codeparrot/codeparrot-clean
/* 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/data/standalone.h
# This file is part of SEALEVEL - a tool to estimates future sea-level rise # constrained by past obervations and long-term sea-level commitment # Copyright (C) 2016 Matthias Mengel working at PIK Potsdam # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Pub...
unknown
codeparrot/codeparrot-clean
import json from django.http import HttpResponse from django.shortcuts import get_object_or_404, render from mobility.decorators import mobile_template from product_details import product_details from kitsune.products.models import Product, Topic from kitsune.sumo.utils import get_browser from kitsune.wiki.decorator...
unknown
codeparrot/codeparrot-clean
############################################################################## # Copyright (c) 2013-2017, 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
## Input ```javascript // @loggerTestOnly @validateNoJSXInTryStatements @outputMode:"lint" import {identity} from 'shared-runtime'; function Component(props) { let el; try { let value; try { value = identity(props.foo); } catch { el = <div value={value} />; } } catch { return nul...
unknown
github
https://github.com/facebook/react
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/invalid-jsx-in-catch-in-outer-try-with-catch.expect.md
# -*- coding: utf-8 -*- # Copyright (C) 2015 enen92 # # 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 option) any later version. # # This program is ...
unknown
codeparrot/codeparrot-clean
import json from django.contrib import messages from django.core.urlresolvers import reverse from django.http import Http404, HttpResponse, HttpResponseRedirect from django.shortcuts import render from django.utils.decorators import method_decorator from django.utils.translation import ugettext_noop, ugettext as _ from...
unknown
codeparrot/codeparrot-clean
import sys, os import contextlib # find_library(name) returns the pathname of a library, or None. if os.name == "nt": def _get_build_version(): """Return the version of MSVC that was used to build Python. For Python 2.3 and up, the version number is included in sys.version. For earlier v...
unknown
codeparrot/codeparrot-clean
""" Caches tiles to Amazon S3. Requires boto (2.0+): http://pypi.python.org/pypi/boto Example configuration: "cache": { "name": "S3", "bucket": "<bucket name>", "access": "<access key>", "secret": "<secret key>" } S3 cache parameters: bucket Required bucket name for S3. If it doesn't ex...
unknown
codeparrot/codeparrot-clean
from sympy.physics.pring import wavefunction, energy from sympy.core.compatibility import range from sympy import pi, integrate, sqrt, exp, simplify, I from sympy.abc import m, x, r from sympy.physics.quantum.constants import hbar def test_wavefunction(): Psi = { 0: (1/sqrt(2 * pi)), 1: (1/sqrt(2 *...
unknown
codeparrot/codeparrot-clean
// generated with @7nohe/openapi-react-query-codegen@2.0.0 import { type Options } from "@hey-api/client-axios"; import { useSuspenseQuery, UseSuspenseQueryOptions } from "@tanstack/react-query"; import { AxiosError } from "axios"; import { createTokenAllAdmins, loginAllAdmins } from "../requests/services.gen"; import...
typescript
github
https://github.com/apache/airflow
airflow-core/src/airflow/api_fastapi/auth/managers/simple/ui/openapi-gen/queries/suspense.ts
from django.forms import CharField, Form, TextInput from django.utils.safestring import mark_safe from .base import WidgetTest class TextInputTest(WidgetTest): widget = TextInput() def test_render(self): self.check_html( self.widget, "email", "", html='<input type="text" name="email">' ...
python
github
https://github.com/django/django
tests/forms_tests/widget_tests/test_textinput.py
# Copyright (c) 2010 Witchspace <witchspace81@gmail.com> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify,...
unknown
codeparrot/codeparrot-clean
from keras.layers import Dense, Dropout, LSTM, Activation from keras.layers import merge, Input, Embedding from keras.models import Model from keras.regularizers import l2 from keras.constraints import maxnorm from keras.utils import plot_model from keras.optimizers import RMSprop, Nadam, Adagrad, Adam, Adamax from ker...
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...
typescript
github
https://github.com/apache/airflow
airflow-core/src/airflow/ui/src/pages/TaskInstances/TaskInstancesFilter.tsx
"""Provides device automations for Alarm control panel.""" from typing import List, Optional import voluptuous as vol from homeassistant.const import ( ATTR_CODE, ATTR_ENTITY_ID, ATTR_SUPPORTED_FEATURES, CONF_CODE, CONF_DEVICE_ID, CONF_DOMAIN, CONF_ENTITY_ID, CONF_TYPE, SERVICE_ALA...
unknown
codeparrot/codeparrot-clean
//===--- EscapeUtils.swift ------------------------------------------------===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
swift
github
https://github.com/apple/swift
SwiftCompilerSources/Sources/Optimizer/Utilities/EscapeUtils.swift
# PAPAS Access Point Administration System # Copyright (c) 2010 Revolution Linux inc. <info@revolutionlinux.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the ...
unknown
codeparrot/codeparrot-clean
/* * Copyright (C) 2008 The Guava Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
java
github
https://github.com/google/guava
android/guava-testlib/src/com/google/common/collect/testing/testers/MapRemoveTester.java
{ "ZREVRANGEBYSCORE": { "summary": "Returns members in a sorted set within a range of scores in reverse order.", "complexity": "O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements being returned. If M is constant (e.g. always asking for the first 10 element...
json
github
https://github.com/redis/redis
src/commands/zrevrangebyscore.json
//===-- ExpandDeducedTypeTests.cpp ------------------------------*- 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 // //===---------------------------...
cpp
github
https://github.com/llvm/llvm-project
clang-tools-extra/clangd/unittests/tweaks/ExpandDeducedTypeTests.cpp
/* * Copyright (c) 2007 Mockito contributors * This program is made available under the terms of the MIT License. */ package org.mockito.internal.verification.api; import java.util.List; import org.mockito.invocation.Invocation; import org.mockito.invocation.MatchableInvocation; /** * Data needed to perform veri...
java
github
https://github.com/mockito/mockito
mockito-core/src/main/java/org/mockito/internal/verification/api/VerificationData.java
/* __next_internal_action_entry_do_not_use__ {"ffab21efdafbe611287bc25c0462b1e0510d13e48b":{"name":"foo"},"ffac840dcaf5e8197cb02b7f3a43c119b7a770b272":{"name":"bar"}} */ import { registerServerReference } from "private-next-rsc-server-reference"; import { cache as $$cache__ } from "private-next-rsc-cache-wrapper"; impo...
typescript
github
https://github.com/vercel/next.js
crates/next-custom-transforms/tests/fixture/server-actions/server-graph/68/output.tsx
"""Interface for a rate limiter and an in-memory rate limiter.""" from __future__ import annotations import abc import asyncio import threading import time class BaseRateLimiter(abc.ABC): """Base class for rate limiters. Usage of the base limiter is through the acquire and aacquire methods depending on ...
python
github
https://github.com/langchain-ai/langchain
libs/core/langchain_core/rate_limiters.py
//! Simple file-locking apis for each OS. //! //! This is not meant to be in the standard library, it does nothing with //! green/native threading. This is just a bare-bones enough solution for //! librustdoc, it is not production quality at all. cfg_select! { target_os = "linux" => { mod linux; us...
rust
github
https://github.com/rust-lang/rust
compiler/rustc_data_structures/src/flock.rs
#include <gmock/gmock.h> #include <gtest/gtest.h> #include <ATen/ATen.h> #include <ATen/core/Vitals.h> #include <c10/util/env.h> #include <c10/util/irange.h> #include <cstdlib> using namespace at::vitals; using ::testing::HasSubstr; TEST(Vitals, Basic) { std::stringstream buffer; std::streambuf* sbuf = std::cou...
cpp
github
https://github.com/pytorch/pytorch
aten/src/ATen/test/vitals.cpp
// Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 package command import ( "fmt" "strings" "github.com/hashicorp/cli" "github.com/hashicorp/terraform/internal/addrs" "github.com/hashicorp/terraform/internal/backend/backendrun" "github.com/hashicorp/terraform/internal/command/arguments" "g...
go
github
https://github.com/hashicorp/terraform
internal/command/state_mv.go
//go:generate go-winres make --arch=386,amd64,arm,arm64 --in=./winresources/winres.json --out=./resource package main import _ "github.com/moby/moby/v2/cmd/dockerd/winresources"
go
github
https://github.com/moby/moby
cmd/dockerd/main_windows.go
# -*- test-case-name: twisted.test.test_woven -*- # # WORK IN PROGRESS: HARD HAT REQUIRED # from __future__ import nested_scopes # Twisted Imports from twisted.python import formmethod, failure from twisted.python.components import registerAdapter, getAdapter from twisted.web import domhelpers, resource, util from t...
unknown
codeparrot/codeparrot-clean
""" ================ Confusion matrix ================ Example of confusion matrix usage to evaluate the quality of the output of a classifier on the iris data set. The diagonal elements represent the number of points for which the predicted label is equal to the true label, while off-diagonal elements are those that ...
unknown
codeparrot/codeparrot-clean
{ "name": "data-router", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "data-router", "dependencies": { "react": "18.2.0", "react-dom": "18.2.0", "react-router-dom": "^6.15.0" }, "devDependencies": { "@rollup/plugin-replace": "5.0...
json
github
https://github.com/remix-run/react-router
examples/data-router/package-lock.json
import urllib2, urllib API_SSL_SERVER="https://api-secure.recaptcha.net" API_SERVER="http://api.recaptcha.net" VERIFY_SERVER="api-verify.recaptcha.net" class RecaptchaResponse(object): def __init__(self, is_valid, error_code=None): self.is_valid = is_valid self.error_code = error_code def display...
unknown
codeparrot/codeparrot-clean
"""Base class for interactive tests spawning a basic window.""" from inspect import cleandoc from pyglet import gl from pyglet.window import Window from tests.base.interactive import InteractiveTestCase class WindowedTestCase(InteractiveTestCase): """ Base class for tests that show a window, render somethin...
unknown
codeparrot/codeparrot-clean
import unittest from faker import Faker from veritranspay.payment_types import CreditCard, Indomaret, VirtualAccountPermata, VirtualAccountBca, \ VirtualAccountBni, VirtualAccountMandiri, BriEpay, MandiriClickpay, CimbClicks, BCAKlikPay, KlikBCA, GoPay fake = Faker() class CreditCardTests(unittest.TestCase): ...
unknown
codeparrot/codeparrot-clean
#include <gtest/gtest.h> #include <cstddef> #include <iterator> #include <unordered_set> #include <c10/core/DispatchKeySet.h> #include <c10/util/irange.h> using namespace c10; // This test exists not to be comprehensive, but to more clearly show // what the semantics of DispatchKeySet are. TEST(DispatchKeySet, Show...
cpp
github
https://github.com/pytorch/pytorch
c10/test/core/DispatchKeySet_test.cpp
/* * Copyright 2002-present the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required b...
kotlin
github
https://github.com/spring-projects/spring-framework
spring-context/src/main/kotlin/org/springframework/context/annotation/AnnotationConfigApplicationContextExtensions.kt
import pytest from api.base.settings.defaults import API_BASE from osf_tests.factories import ( AuthUserFactory, PreprintProviderFactory, ) from osf.utils import permissions @pytest.mark.enable_quickfiles_creation class ProviderModeratorDetailTestClass: @pytest.fixture() def admin(self, provider): ...
unknown
codeparrot/codeparrot-clean
# Copyright 2012,2014 Hewlett-Packard Development Company, L.P. # Copyright (c) 2012 NTT DOCOMO, 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 # # ...
unknown
codeparrot/codeparrot-clean
from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.db import models from django.db.models.deletion import ProtectedError __all__ = ('Link', 'Place', 'Restaurant', 'Person', 'Address', 'CharLink', '...
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
""" Support for GPS tracking MQTT enabled devices. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/device_tracker.mqtt_json/ """ import asyncio import json import logging import voluptuous as vol import homeassistant.components.mqtt as mqtt from homeass...
unknown
codeparrot/codeparrot-clean
{ "compilerOptions": { "target": "es5", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, "strict": false, "forceConsistentCasingInFileNames": true, "noEmit": true, "esModuleInterop": true, "module": "esnext", "moduleResolution": "node", "reso...
json
github
https://github.com/vercel/next.js
examples/with-typescript/tsconfig.json
/* * Copyright 2010-2024 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.fir.test.cases.generated.cases.references; import com.intellij.test...
java
github
https://github.com/JetBrains/kotlin
analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/references/FirIdeNormalAnalysisSourceModuleReferenceImportAliasTestGenerated.java
/* * Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ import io.ktor.client.engine.mock.* import io.ktor.client.plugins.resources.* import io.ktor.client.plugins.resources.Resources import io.ktor.client.request.* import io.ktor.client.statement....
kotlin
github
https://github.com/ktorio/ktor
ktor-client/ktor-client-plugins/ktor-client-resources/common/test/ResourcesTest.kt