code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
from django.conf.urls import url from django.contrib import admin from django.contrib.auth import views from django.contrib.auth.decorators import login_required from django.contrib.auth.forms import AuthenticationForm from django.contrib.auth.urls import urlpatterns as auth_urlpatterns from django.contrib.messages.api...
unknown
codeparrot/codeparrot-clean
// mksysnum_openbsd.pl // Code generated by the command above; DO NOT EDIT. package syscall const ( SYS_EXIT = 1 // { void sys_exit(int rval); } SYS_FORK = 2 // { int sys_fork(void); } SYS_READ = 3 // { ssize_t sys_read(int fd, void *buf, size_t nbyte); } SYS_WRITE = 4...
go
github
https://github.com/golang/go
src/syscall/zsysnum_openbsd_mips64.go
from StringIO import StringIO import pickle import sys import platform import gc import copy from os import path from numpy.testing import * from numpy.testing.utils import _assert_valid_refcount, WarningManager from numpy.compat import asbytes, asunicode, asbytes_nested import warnings import tempfile import numpy as ...
unknown
codeparrot/codeparrot-clean
--- - hosts: localhost connection: local gather_facts: no tasks: - add_host: name: host1 ansible_connection: local ansible_host: 127.0.0.1 - hosts: all gather_facts: no tasks: - debug: msg: "{{ hostvars['host1']['x'] }}" register: x_1 - debug: msg: "{{ hostva...
unknown
github
https://github.com/ansible/ansible
test/integration/targets/var_templating/task_vars_templating.yml
from __future__ import unicode_literals import re from django.core.exceptions import FieldDoesNotExist from django.db.models.constants import LOOKUP_SEP from django.db.models.expressions import Col, Expression from django.db.models.lookups import Lookup from django.utils import six gis_lookups = {} class GISLookup(...
unknown
codeparrot/codeparrot-clean
/* * 'OpenSSL for Ruby' project * Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz> * All rights reserved. */ /* * This program is licensed under the same licence as Ruby. * (See the file 'COPYING'.) */ #include "ossl.h" #define NewSPKI(klass) \ TypedData_Wrap_Struct((klass), &ossl_netscape_spki_ty...
c
github
https://github.com/ruby/ruby
ext/openssl/ossl_ns_spki.c
<?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/GitDownloaderTest.php
#!/usr/bin/python # # Copyright (c) 2019 Zim Kalinowski, (@zikalino) # # 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', '...
unknown
codeparrot/codeparrot-clean
from __future__ import unicode_literals from django.core import serializers from django.db import connection from django.test import TestCase from .models import FKDataNaturalKey, NaturalKeyAnchor from .tests import register_tests class NaturalKeySerializerTests(TestCase): pass def natural_key_serializer_test(f...
unknown
codeparrot/codeparrot-clean
import cp from "node:child_process"; import type { Page, Response, Request } from "@playwright/test"; import { test } from "@playwright/test"; import { load } from "cheerio"; import prettier from "prettier"; let cheerio = load(""); import type { AppFixture } from "./create-fixture.js"; export class PlaywrightFixture...
typescript
github
https://github.com/remix-run/react-router
integration/helpers/playwright-fixture.ts
#! /usr/bin/env python2.5 # -*- coding: latin-1 -*- import axiom_rules import fact_groups import instantiate import pddl import sas_tasks import simplify # TODO: The translator may generate trivial derived variables which are always true, # for example if there ia a derived predicate in the input that only depends on...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2012 LE GOFF Vincent # 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 th...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # Copyright: (c) 2019, Guillaume Martinez (lunik@tiwabbit.fr) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import import pytest from ansible.modules.source_control.gitlab.gitlab_hook import GitLabHook def _dummy(...
unknown
codeparrot/codeparrot-clean
from django.db.utils import DatabaseError from django.db.backends.sqlite3.schema import DatabaseSchemaEditor class SpatialiteSchemaEditor(DatabaseSchemaEditor): sql_add_geometry_column = ( "SELECT AddGeometryColumn(%(table)s, %(column)s, %(srid)s, " "%(geom_type)s, %(dim)s, %(null)s)" ) sql...
unknown
codeparrot/codeparrot-clean
# (c) 2014, Brian Coca, Josh Drake, et al # (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' cache: jsonfi...
unknown
codeparrot/codeparrot-clean
{ "css": null, "js": [], "start": 0, "end": 324, "type": "Root", "fragment": { "type": "Fragment", "nodes": [ { "type": "RegularElement", "start": 0, "end": 14, "name": "div", "name_loc": { "start": { "line": 1, "column": 1, "character": 1 }, "end": { ...
json
github
https://github.com/sveltejs/svelte
packages/svelte/tests/parser-modern/samples/loose-invalid-expression/output.json
# -*- coding: utf-8 -*- import gettext as gettext_module import os import shutil import stat import unittest from django.core.management import ( CommandError, call_command, execute_from_command_line, ) from django.core.management.utils import find_command from django.test import SimpleTestCase, override_settings...
unknown
codeparrot/codeparrot-clean
from datetime import datetime from sqlalchemy.orm import relationship, backref from sqlalchemy.schema import Column, ForeignKey from sqlalchemy.types import Integer, Unicode, DateTime from spendb.core import db, url_for from spendb.model.dataset import Dataset class Run(db.Model): """ A run is a generic grouping...
unknown
codeparrot/codeparrot-clean
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = "j. F Y" TIME_FORMAT = "H:i" DATETIME_FORMAT = "j. F Y H:i" YEAR_MONTH_FORMAT = "F Y" MONTH_DAY_FORM...
python
github
https://github.com/django/django
django/conf/locale/de_CH/formats.py
/* * 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.components.expressionTypeProvider; i...
java
github
https://github.com/JetBrains/kotlin
analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/expressionTypeProvider/FirIdeNormalAnalysisSourceModuleExpectedExpressionTypeTestGenerated.java
try: from scipy import special available_cpu = True except ImportError as e: available_cpu = False _import_error = e import math import chainer from chainer.backends import cuda from chainer import function_node from chainer import utils from chainer.utils import type_check class Ndtri(function_node.F...
unknown
codeparrot/codeparrot-clean
# Copyright 2015 The Switch Authors. All rights reserved. # Licensed under the Apache License, Version 2, which is in the LICENSE file. """ This modules writes out output tables with certain processing. This tables are mostly useful for quick iterations when testing code. """ import os, time, sys from pyomo.environ ...
unknown
codeparrot/codeparrot-clean
import numpy as np from collections import deque from PIL import Image import gym from gym import spaces class NoopResetEnv(gym.Wrapper): def __init__(self, env, noop_max=30): """Sample initial states by taking random number of no-ops on reset. No-op is assumed to be action 0. """ g...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from Define import Global from Define import IMocca from Define import Utility # from qqbot import qqbotsched def onQQMessage(bot, contact, member, content): """ QQBot 全局调用入口 """ # print(bot) # print(contact) # print(member) # print(content) #...
unknown
codeparrot/codeparrot-clean
//! This defines the syntax of MIR, i.e., the set of available MIR operations, and other definitions //! closely related to MIR semantics. //! This is in a dedicated file so that changes to this file can be reviewed more carefully. //! The intention is that this file only contains datatype declarations, no code. use r...
rust
github
https://github.com/rust-lang/rust
compiler/rustc_middle/src/mir/syntax.rs
#### Note: this error code is no longer emitted by the compiler. A trait object has some specific lifetime `'1`, but it was used in a way that requires it to have a `'static` lifetime. Example of erroneous code: ```compile_fail trait BooleanLike {} trait Person {} impl BooleanLike for bool {} impl dyn Person { ...
unknown
github
https://github.com/rust-lang/rust
compiler/rustc_error_codes/src/error_codes/E0772.md
#!/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
# constantPropagation ## File `src/Optimization/ConstantPropagation.ts` ## Purpose Applies Sparse Conditional Constant Propagation (SCCP) to fold compile-time evaluable expressions to constant values, propagate those constants through the program, and eliminate unreachable branches when conditionals have known consta...
unknown
github
https://github.com/facebook/react
compiler/packages/babel-plugin-react-compiler/docs/passes/04-constantPropagation.md
from datetime import datetime, timedelta import os import jwt import json import requests from functools import wraps from urlparse import parse_qs, parse_qsl from urllib import urlencode from flask import Flask, g, send_file, request, redirect, url_for, jsonify from flask.ext.sqlalchemy import SQLAlchemy from werkzeug...
unknown
codeparrot/codeparrot-clean
""" A refactored implementation of Boids from a deliberately bad implementation of [Boids](http://dl.acm.org/citation.cfm?doid=37401.37406): an exercise for class. """ from matplotlib import pyplot as plt from matplotlib import animation import numpy as np class Boids(object): def __init__(self, ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python3 # Copyright (C) 2012-2015 ASTRON (Netherlands Institute for Radio Astronomy) # P.O. Box 2, 7990 AA Dwingeloo, The Netherlands # # This file is part of the LOFAR software suite. # The LOFAR software suite is free software: you can redistribute it and/or # modify it under the terms of the GNU G...
unknown
codeparrot/codeparrot-clean
/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ export {inferTypes} from './InferTypes';
typescript
github
https://github.com/facebook/react
compiler/packages/babel-plugin-react-compiler/src/TypeInference/index.ts
<?php namespace Illuminate\Database\Eloquent; use RuntimeException; class RelationNotFoundException extends RuntimeException { /** * The name of the affected Eloquent model. * * @var string */ public $model; /** * The name of the relation. * * @var string */ p...
php
github
https://github.com/laravel/framework
src/Illuminate/Database/Eloquent/RelationNotFoundException.php
# -*- coding: utf-8 -*- # # Copyright (C) 2008-2011 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://babel.edgewall.org/wiki/License. # # This software consists...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
unknown
codeparrot/codeparrot-clean
from __future__ import absolute_import, print_function, division from getpass import getuser import pytest sa = pytest.importorskip('sqlalchemy') pytest.importorskip('pymysql') from odo import odo, drop, discover import pandas as pd from blaze import symbol, compute from blaze.utils import example, normalize @py...
unknown
codeparrot/codeparrot-clean
import os import subprocess import sys from GpdbBuildBase import GpdbBuildBase class GporcacodegenBuild(GpdbBuildBase): def __init__(self): pass def configure(self): return subprocess.call(' '.join(["./configure", "--enable-orca", ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # based on the 'calculator' demo in the Thrift source import sys, os.path sys.path.insert(0, os.path.join(os.path.abspath(os.path.split(sys.argv[0])[0]), 'gen-py')) import tutorial.Calculator from tutorial.ttypes import * from thrift.transport import TTwisted, TTransport from thrift.protocol imp...
unknown
codeparrot/codeparrot-clean
% This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it. **Description** Converts a multi-valued input of numbers, or a hexadecimal string, to a dense_vector.
unknown
github
https://github.com/elastic/elasticsearch
docs/reference/query-languages/esql/_snippets/functions/description/to_dense_vector.md
#!/usr/bin/env python # # Copyright (c) 2018, The OpenThread Authors. # 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 code must retain the above copyright # ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python import re import os class PgCatalogHeader(object): """This class is a base class for catalog header parser class, and provides basic methods to parse header files by regular expressions. The result will be in self.tuplist. To extend this class, set these three class values. ...
unknown
codeparrot/codeparrot-clean
import unittest from . import load_tests if __name__ == "__main__": unittest.main()
python
github
https://github.com/python/cpython
Lib/test/test_zipfile/__main__.py
/** * Integration with the JSR-354 <code>javax.money</code> package. */ @NullMarked package org.springframework.format.number.money; import org.jspecify.annotations.NullMarked;
java
github
https://github.com/spring-projects/spring-framework
spring-context/src/main/java/org/springframework/format/number/money/package-info.java
from test import TestCase, fill_redis_with_vectors, generate_random_vector import random class LargeScale(TestCase): def getname(self): return "Large Scale Comparison" def estimated_runtime(self): return 10 def test(self): dim = 300 count = 20000 k = 50 # ...
python
github
https://github.com/redis/redis
modules/vector-sets/tests/large_scale.py
#!/usr/bin/python3 # Copyright (c) 2015 Yannick Lamarre # 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 c...
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-tests/test/com/google/common/collect/PeekingIteratorTest.java
#!/usr/bin/env python import os import errno import sys import random import logging import pprint import argparse import datetime import time #from __future__ import print_function import imp try: imp.find_module('libcloud') except ImportError: sys.stderr.write("Python: Apache libcloud module not available,...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2006-2008 Mitch Garnaat http://garnaat.org/ # # 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, modi...
unknown
codeparrot/codeparrot-clean
<!--Copyright 2026 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 applicable law or agreed...
unknown
github
https://github.com/huggingface/transformers
docs/source/en/model_doc/lw_detr.md
# -*- encoding: utf-8 -*- from __future__ import absolute_import, unicode_literals from datetime import datetime from django.contrib.gis.geos import HAS_GEOS from django.contrib.gis.tests.utils import no_mysql, no_spatialite from django.contrib.gis.shortcuts import render_to_kmz from django.contrib.gis.tests.utils im...
unknown
codeparrot/codeparrot-clean
--- layout: step title: Layouts position: 4 --- Jekyll supports [Markdown](https://daringfireball.net/projects/markdown/syntax) in addition to HTML when building pages. Markdown is a great choice for pages with a simple content structure (just paragraphs, headings and images), as it's less verbose than raw HTML. Creat...
unknown
github
https://github.com/jekyll/jekyll
docs/_docs/step-by-step/04-layouts.md
<!--Copyright 2020 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 applicable law or agreed...
unknown
github
https://github.com/huggingface/transformers
docs/source/en/model_doc/mobilebert.md
/* * Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ package io.ktor.client.webrtc import WebRTC.RTCConfiguration import WebRTC.RTCIceServer import WebRTC.RTCMediaConstraints import WebRTC.RTCPeerConnectionFactory import WebRTC.RTCSdpSemantics ...
kotlin
github
https://github.com/ktorio/ktor
ktor-client/ktor-client-webrtc/ios/src/io/ktor/client/webrtc/Engine.kt
import sys from ctypes.util import find_library from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db.backends.sqlite3.base import (Database, DatabaseWrapper as SQLiteDatabaseWrapper, SQLiteCursorWrapper) from django.contrib.gis.db.backends.spatialite.client import...
unknown
codeparrot/codeparrot-clean
# # Copyright 2014 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 by applicable law ...
unknown
codeparrot/codeparrot-clean
package daemon import ( "context" "fmt" "os" "runtime" "strconv" "strings" "time" "github.com/containerd/containerd/v2/pkg/tracing" "github.com/containerd/log" "github.com/moby/moby/api/types/system" "github.com/moby/moby/v2/daemon/command/debug" "github.com/moby/moby/v2/daemon/config" "github.com/moby/m...
go
github
https://github.com/moby/moby
daemon/info.go
#!/bin/sh test_description='test <branch>@{upstream} syntax' GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh test_expect_success 'setup' ' test_commit 1 && git checkout -b side && test_commit 2 && git checkout main && git clone . clone && test_commit 3 &&...
unknown
github
https://github.com/git/git
t/t1507-rev-parse-upstream.sh
# -*- coding: utf-8 -*- """ Management commands for third_party_auth """ from django.core.management.base import BaseCommand, CommandError import logging from third_party_auth.models import SAMLConfiguration from third_party_auth.tasks import fetch_saml_metadata class Command(BaseCommand): """ manage.py commands t...
unknown
codeparrot/codeparrot-clean
def sort_sublists(list1): list1.sort() list1.sort(key=len) return list1
unknown
mbpp
import asyncio import os import signal import threading import traceback import sys PYMPLER_ENABLED = False if PYMPLER_ENABLED: try: import pympler import pympler.muppy import pympler.summary import pympler.tracker except ImportError: pympler = None else: pympler = ...
unknown
codeparrot/codeparrot-clean
{ "name": "ssr", "private": true, "scripts": { "dev": "cross-env NODE_ENV=development node server.js", "build": "npm run build:client && npm run build:server", "build:client": "vite build --outDir dist/client --ssrManifest", "build:server": "vite build --ssr src/entry.server.tsx --outDir dist/serv...
json
github
https://github.com/remix-run/react-router
examples/ssr/package.json
// Copyright 2016-2019 Cargo-Bundle developers <https://github.com/burtonageo/cargo-bundle> // Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT use crate::{ bundle::{ settings::{Arch, Settings}, windows::{ sign::{s...
rust
github
https://github.com/tauri-apps/tauri
crates/tauri-bundler/src/bundle/windows/msi/mod.rs
from bge import logic, events from mathutils import Matrix from math import floor from random import random from particle import Particle import acidbase mouse = logic.mouse keyboard = logic.keyboard gdict = logic.globalDict ACTIVE = logic.KX_INPUT_JUST_ACTIVATED def saveObject(newobject,free=True): if free: ...
unknown
codeparrot/codeparrot-clean
"""Extension to the unittest package to support different loggers and parallel test execution.""" from buildscripts.resmokelib.testing import executor, suite __all__ = ["executor", "suite"]
python
github
https://github.com/mongodb/mongo
buildscripts/resmokelib/testing/__init__.py
## @package layer_model_instantiator # Module caffe2.python.layer_model_instantiator from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from caffe2.python import core, schema from caffe2.python.layers.layers import Instan...
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
import json from urllib.parse import urlencode from xml.dom.minidom import parseString from django.contrib.auth.decorators import login_required, permission_required from django.core import mail from django.core.exceptions import ValidationError from django.forms import fields from django.forms.forms import Form from ...
python
github
https://github.com/django/django
tests/test_client/views.py
import { flushSync } from 'svelte'; import { test } from '../../test'; export default test({ html: ` <button>1</button> <button>2</button> <button>3</button> <p>1, 2, 3</p> `, test({ assert, target }) { let buttons = target.querySelectorAll('button'); flushSync(() => buttons[2].click()); assert.htm...
javascript
github
https://github.com/sveltejs/svelte
packages/svelte/tests/runtime-legacy/samples/each-blocks-update/_config.js
# 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 License, or # (at your option) any later version. # # This program is distributed in the...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- # # resolve.py - Resolves hostname and GeoIP data for each reachable node. # # Copyright (c) 2014 Addy Yeow Chin Heng <ayeowch@gmail.com> # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (...
unknown
codeparrot/codeparrot-clean
/* * Copyright 2002-present the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required b...
java
github
https://github.com/spring-projects/spring-framework
spring-beans/src/testFixtures/java/org/springframework/beans/testfixture/beans/CountingTestBean.java
""" This file demonstrates writing tests using the unittest module. These will pass when you run "manage.py test". Replace this with more appropriate tests for your application. """ try: from urllib.parse import urlencode except ImportError: # Python 2 from urllib import urlencode from django.test import Te...
unknown
codeparrot/codeparrot-clean
import numpy as np from pandas import DataFrame from pandas.tests.copy_view.util import get_array def test_get_array_numpy(): df = DataFrame({"a": [1, 2, 3]}) assert np.shares_memory(get_array(df, "a"), get_array(df, "a")) def test_get_array_masked(): df = DataFrame({"a": [1, 2, 3]}, dtype="Int64") a...
python
github
https://github.com/pandas-dev/pandas
pandas/tests/copy_view/test_util.py
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Feed.has_page' db.add_column('feeds', 'has_page', self.gf('django.db.models.fields.BooleanField')(...
unknown
codeparrot/codeparrot-clean
/* Copyright 2024 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
cmd/prune-junit-xml/logparse/logparse.go
#------------------------------------------------------------------------------ # Copyright 2013 Esri # 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/LICENS...
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/common/security/auth/Login.java
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) Pootle contributors. # # This file is a part of the Pootle project. It is distributed under the GPL3 # or later license. See the LICENSE file for a copy of the license and the # AUTHORS file for copyright and authorship information. from django.shortcuts ...
unknown
codeparrot/codeparrot-clean
""" Django settings for trialproj project. Generated by 'django-admin startproject' using Django 1.8.9. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build pa...
unknown
codeparrot/codeparrot-clean
// Copyright IBM Corp. 2016, 2025 // SPDX-License-Identifier: BUSL-1.1 package command import ( "context" "encoding/json" "errors" "fmt" "io" "os" "strings" "sync" "time" "github.com/hashicorp/cli" "github.com/hashicorp/consul/api" log "github.com/hashicorp/go-hclog" "github.com/hashicorp/go-kms-wrappin...
go
github
https://github.com/hashicorp/vault
command/operator_diagnose.go
#!/usr/bin/env python # pylint: disable=missing-docstring # flake8: noqa: T001 # ___ ___ _ _ ___ ___ _ _____ ___ ___ # / __| __| \| | __| _ \ /_\_ _| __| \ # | (_ | _|| .` | _|| / / _ \| | | _|| |) | # \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____ # | \ / _ \ | \| |/ _ \_ _| | __| \_ ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python """ This module tries to retrieve as much platform-identifying data as possible. It makes this information available via function APIs. If called from the command line, it prints the platform information concatenated as single string to stdout. The output format is useable as par...
unknown
codeparrot/codeparrot-clean
from .channels import Channels from .roles import Roles from .users import Users from twilio.rest.resources import NextGenInstanceResource, NextGenListResource class Service(NextGenInstanceResource): subresources = [ Channels, Roles, Users ] def update(self, **kwargs): """...
unknown
codeparrot/codeparrot-clean
# engine/reflection.py # Copyright (C) 2005-2014 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 """Provides an abstraction for obtaining database schema information. Usage Note...
unknown
codeparrot/codeparrot-clean
__source__ = 'https://leetcode.com/problems/path-sum-ii/' # https://github.com/kamyu104/LeetCode/blob/master/Python/path-sum-ii.py # Time: O(n) # Space: O(h), h is height of binary tree # DFS # # Description: Leetcode # 113. Path Sum II # # Given a binary tree and a sum, find all root-to-leaf paths where each path's s...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python3 # # hyperv_wmi_generator.py: generates most of the WMI type mapping code # # Copyright (C) 2011 Matthias Bolte <matthias.bolte@googlemail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by ...
unknown
codeparrot/codeparrot-clean
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributi...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ requests.utils ~~~~~~~~~~~~~~ This module provides utility functions that are used within Requests that are also useful for external consumption. """ import cgi import codecs import os import platform import re import sys import zlib from netrc import netrc, NetrcParseError from . impor...
unknown
codeparrot/codeparrot-clean
# This file is part of SickRage. # # URL: https://www.sickrage.tv # Git: https://github.com/SiCKRAGETV/SickRage.git # # SickRage is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License,...
unknown
codeparrot/codeparrot-clean
{ "kind": "Dashboard", "apiVersion": "dashboard.grafana.app/v2beta1", "metadata": { "name": "v0alpha1.graph_y_axis.v42" }, "spec": { "annotations": [ { "kind": "AnnotationQuery", "spec": { "query": { "kind": "DataQuery", "group": "", ...
json
github
https://github.com/grafana/grafana
apps/dashboard/pkg/migration/conversion/testdata/output/migrated_dev_dashboards/panel-graph/v0alpha1.graph_y_axis.v42.v2beta1.json
def __boot(): import sys import os PYTHONPATH = os.environ.get('PYTHONPATH') if PYTHONPATH is None or (sys.platform == 'win32' and not PYTHONPATH): PYTHONPATH = [] else: PYTHONPATH = PYTHONPATH.split(os.pathsep) pic = getattr(sys, 'path_importer_cache', {}) stdpath = sys.pat...
unknown
codeparrot/codeparrot-clean
""" Extended math utilities. """ # Authors: Gael Varoquaux # Alexandre Gramfort # Alexandre T. Passos # Olivier Grisel # Lars Buitinck # Stefan van der Walt # Kyle Kastner # Giorgio Patrini # License: BSD 3 clause from __future__ import division from funct...
unknown
codeparrot/codeparrot-clean
from django.db import models from django.test import TestCase class AbsoluteUrlOverrideTests(TestCase): def test_get_absolute_url(self): """ get_absolute_url() functions as a normal method. """ get_absolute_url = lambda o: '/test-a/%s/' % o.pk TestA = self._create_model_cla...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python import unittest import os import sys # simple magic for using scripts within a source tree basedir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) if os.path.isdir(os.path.join(basedir, 'virttest')): sys.path.append(basedir) from virttest import remote from virttest import data_di...
unknown
codeparrot/codeparrot-clean
// Copyright 2020 The Cockroach Authors. // // Use of this software is governed by the CockroachDB Software License // included in the /LICENSE file. package geo import ( "bytes" "encoding/binary" "fmt" "strings" "github.com/cockroachdb/cockroach/pkg/geo/geopb" "github.com/cockroachdb/cockroach/pkg/geo/geoproj...
go
github
https://github.com/cockroachdb/cockroach
pkg/geo/encode.go
#!/usr/bin/env python ''' EC2 external inventory script ================================= Generates inventory that Ansible can understand by making API request to AWS EC2 using the Boto library. NOTE: This script assumes Ansible is being executed where the environment variables needed for Boto have already been set:...
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/MemberDescriptionTest.java
{ "kind": "Dashboard", "apiVersion": "dashboard.grafana.app/v0alpha1", "metadata": { "name": "v40.refresh_not_set.v42" }, "spec": { "annotations": { "list": [ { "builtIn": 1, "datasource": { "type": "grafana", "uid": "-- Grafana --" }...
json
github
https://github.com/grafana/grafana
apps/dashboard/pkg/migration/conversion/testdata/output/migrated_dashboards_from_v0_to_v2/v2beta1.v40.refresh_not_set.v0alpha1.json
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import (absolute_import, division, print_function, unicode_literals) from ..extern import six from ..extern.six.moves import zip, range from .index import TableIndices, TableLoc, TableILoc import re import sys from ...
unknown
codeparrot/codeparrot-clean
import os from django.db import models class Person(models.Model): name = models.CharField(max_length=100) class Triple(models.Model): left = models.IntegerField() middle = models.IntegerField() right = models.IntegerField() class Meta: unique_together = (('left', 'middle'), (u'middle', u...
unknown
codeparrot/codeparrot-clean