code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
# (c) 2017, Roman Belyakovsky <ihryamzik () gmail.com>
#
# 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 la... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2023 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/tfrt/ifrt/ifrt_executable_registry.h |
"use strict";
const NodeEnvironment =
// For jest@29
require("jest-environment-node").TestEnvironment ||
// For jest@27
require("jest-environment-node");
class CustomEnvironment extends NodeEnvironment {
constructor(config, context) {
// TODO - regression in jest/Node@25.2.0, temporary fix
global.localStorag... | javascript | github | https://github.com/webpack/webpack | test/patch-node-env.js |
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with this
* work for additional information regarding copyright ownership. The ASF
* licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may ... | c | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/main/winutils/main.c |
#!/usr/bin/env python3
import json
import os
import sys
# Get relative imports to work when the package is not installed on the PYTHONPATH.
if __name__ == "__main__" and __package__ is None:
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from buildscripts.ciconfig.evergreen import p... | python | github | https://github.com/mongodb/mongo | buildscripts/validate_task_gen.py |
#!/usr/bin/env bash
# Copyright 2021 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 applica... | unknown | github | https://github.com/kubernetes/kubernetes | hack/verify-generated-stable-metrics.sh |
--
-- Tests with plan cache
--
-- Setup
CREATE OR REPLACE FUNCTION select_one_func(int) RETURNS VOID AS $$
DECLARE
ret INT;
BEGIN
SELECT $1 INTO ret;
END;
$$ LANGUAGE plpgsql;
CREATE OR REPLACE PROCEDURE select_one_proc(int) AS $$
DECLARE
ret INT;
BEGIN
SELECT $1 INTO ret;
END;
$$ LANGUAGE plpgsql;
-- Prepare... | sql | github | https://github.com/postgres/postgres | contrib/pg_stat_statements/sql/plancache.sql |
//// [tests/cases/conformance/ambient/ambientDeclarationsPatterns_tooManyAsterisks.ts] ////
//// [ambientDeclarationsPatterns_tooManyAsterisks.ts]
declare module "too*many*asterisks" { }
//// [ambientDeclarationsPatterns_tooManyAsterisks.js]
"use strict"; | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/ambientDeclarationsPatterns_tooManyAsterisks.js |
def freq0_carrier_calculation(freq_desired, fxosc=26.0, debug=False):
"""
Calculates the FREQ0, FREQ1, and FREQ2 24 bit word for main carrier frequency of the CC430.
:param freq_desired: Frequency in MHz that is desired to tune to (Integer or float)
:param fxosc: CC430 High Frequency crystal frequency ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2012-2013 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will... | unknown | codeparrot/codeparrot-clean | ||
"""distutils.command.clean
Implements the Distutils 'clean' command."""
# contributed by Bastian Kleineidam <calvin@cs.uni-sb.de>, added 2000-03-18
__revision__ = "$Id$"
import os
from distutils.core import Command
from distutils.dir_util import remove_tree
from distutils import log
class clean(Command):
desc... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
# Character ranges of letters
letters = 'a-zA-Z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u0103\u0106\u0107\
\u010c-\u010f\u0112-\u0115\u011a-\u012d\u0131\u0141\u0142\u0147\u0148\
\u0150-\u0153\u0158-\u0161\u0164\u0165\u016e-\u0171\u017d\u01... | unknown | codeparrot/codeparrot-clean | ||
package v1beta1
import (
"fmt"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"github.com/grafana/grafana/pkg/apimachinery/utils"
)
const (
GROUP = APIGroup
VERSION = APIVersion
RESOURCE = "folders"
APIVERSION =... | go | github | https://github.com/grafana/grafana | apps/folder/pkg/apis/folder/v1beta1/register.go |
import nose.tools as nt
import numpy as np
import theano
import theano.tensor as T
import treeano
import treeano.nodes as tn
fX = theano.config.floatX
def test_aggregator_node_serialization():
tn.check_serialization(tn.AggregatorNode("a"))
def test_elementwise_cost_node_serialization():
tn.check_serializati... | unknown | codeparrot/codeparrot-clean | ||
from setuptools import setup, find_packages
from phonenumber_field import __version__
setup(
name="django-phonenumber-field",
version=__version__,
url='http://github.com/stefanfoulis/django-phonenumber-field',
license='BSD',
platforms=['OS Independent'],
description="An international phone numb... | unknown | codeparrot/codeparrot-clean | ||
from django import forms
from django.conf import settings
from django.contrib.flatpages.models import FlatPage
from django.utils.translation import ugettext, ugettext_lazy as _
class FlatpageForm(forms.ModelForm):
url = forms.RegexField(
label=_("URL"),
max_length=100,
regex=r'^[-\w/\.~]+$'... | unknown | codeparrot/codeparrot-clean | ||
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import timeit
import numpy as np # pylint: disable=W0611
# largest image size to use for "linear" and fft convolutions
max_exponents_linear = {1: 15, 2: 7, 3: 5}
max_exponents_fft = {1: 15, 2: 10, 3: 7}
if __name__ == "__main__":
for ndims in [1, ... | 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 or ag... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
from django.test import SimpleTestCase
from django.utils import six, text
from django.utils.encoding import force_text
from django.utils.functional import lazy
from django.utils.translation import override
lazystr = lazy(force_text, six.text... | unknown | codeparrot/codeparrot-clean | ||
'''OpenGL extension EXT.vertex_array
This module customises the behaviour of the
OpenGL.raw.GL.EXT.vertex_array to provide a more
Python-friendly API
Overview (from the spec)
This extension adds the ability to specify multiple geometric primitives
with very few subroutine calls. Instead of calling an OpenGL proce... | unknown | codeparrot/codeparrot-clean | ||
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Software async crypto daemon.
*
* Copyright (c) 2006 Herbert Xu <herbert@gondor.apana.org.au>
*
* Added AEAD support to cryptd.
* Authors: Tadeusz Struk (tadeusz.struk@intel.com)
* Adrian Hoban <adrian.hoban@intel.com>
* Gabriele Paolo... | c | github | https://github.com/torvalds/linux | crypto/cryptd.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/clang-tidy/bugprone/ChainedComparisonCheck.cpp |
#
# Copyright (c) 2019-2020 Google LLC. All Rights Reserved.
# Copyright (c) 2016-2018 Nest Labs 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 | ||
# -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from datetime import datetime
from django.contrib.gis.db.models import Extent
from django.contrib.gis.shortcuts import render_to_kmz
from django.db.models import Count, Min
from django.test import TestCase, skipUnlessDBFeature
from ..utils import no_o... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# coding: utf-8
# Copyright (c) 2016 Alexandre Syenchuk (alexpirine)
from setuptools import setup
if __name__ == '__main__':
setup(
name='Trivial-Sudoku',
version='2.0',
url='https://github.com/alexpirine/python-trivial-sudoku',
license='New BSD License',
... | unknown | codeparrot/codeparrot-clean | ||
# Some code to convert arbitrary curves to high quality cubics.
# Some conventions: points are (x, y) pairs. Cubic Bezier segments are
# lists of four points.
import sys
from math import *
import pcorn
def pt_wsum(points, wts):
x, y = 0, 0
for i in range(len(points)):
x += points[i][0] * wts[i]
... | unknown | codeparrot/codeparrot-clean | ||
#!/bin/bash
OUTPUT_SCRIPT=${OUTPUT_SCRIPT:-/home/circleci/project/ci_test_script.sh}
# only source if file exists
if [[ -f /home/circleci/project/env ]]; then
source /home/circleci/project/env
fi
cat >"${OUTPUT_SCRIPT}" <<EOL
# =================== The following code will be executed inside Docker container ========... | unknown | github | https://github.com/pytorch/pytorch | .circleci/scripts/binary_linux_test.sh |
# This program lets a user control a robot with a joystick and
# test taking pictures and making the robot beep
# This function checks if a point is inside the joystick circle
def checkIfInCircle(x, y):
from math import *
if fabs((x - 250)*(x - 250) + (y - 250)*(y - 250)) <= 245*245:
return True
el... | unknown | codeparrot/codeparrot-clean | ||
# -*- test-case-name: openid.test.test_xrires -*-
"""XRI resolution.
"""
from urllib import urlencode
from openid import fetchers
from openid.yadis import etxrd
from openid.yadis.xri import toURINormal
from openid.yadis.services import iterServices
DEFAULT_PROXY = 'http://proxy.xri.net/'
class ProxyResolver(object):... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
pint.formatter
~~~~~~~~~~~~~~
Format units for pint.
:copyright: 2016 by Pint Authors, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import division, unicode_literals, print_function, absolute_import
import re
from .ba... | unknown | codeparrot/codeparrot-clean | ||
import { test } from '../../assert';
export default test({
props: {
railColor1: 'black',
trackColor1: 'red',
railColor2: 'green',
trackColor2: 'blue',
nestRailColor1: 'white',
nestTrackColor1: 'gray',
nestRailColor2: 'aqua',
nestTrackColor2: 'pink'
},
html: `
<svelte-css-wrapper style="display: co... | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/tests/runtime-browser/samples/svelte-self-css-custom-properties-dynamic/_config.js |
## Input
```javascript
import {Stringify} from 'shared-runtime';
function Component({a, b}) {
let z = {a};
let p = () => <Stringify>{z}</Stringify>;
return p();
}
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{a: 1}],
sequentialRenders: [{a: 1}, {a: 1}, {a: 2}],
};
```
## Code
```javascrip... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-runs-inference.expect.md |
#!/usr/bin/env python
from __future__ import print_function
import os
import gtk
import sys
import argparse
def responseToDialog(entry, dialog, response):
dialog.response(response)
def getText(authHost, authRealm):
dialog = gtk.MessageDialog(
None,
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Tests\Routing;
enum CategoryEnum
{
case People;
case Fruits;
}
enum CategoryBackedEnum: string
{
case People = 'people';
case Fruits = 'fruits';
}
enum RouteNameEnum: string
{
case UserIndex = 'users.index';
}
enum RouteDomainEnum: string
{
case DashboardDomain = ... | php | github | https://github.com/laravel/framework | tests/Routing/Enums.php |
# Copyright (c) 2013 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 os
import unittest
from telemetry.page import page as page_module
from telemetry.page import page_test
from telemetry.page.actions import all_page... | unknown | codeparrot/codeparrot-clean | ||
#!/bin/bash
set -euo pipefail
#!/bin/bash
# Configure a dm-crypt volume backed by a file
set -e
dd if=/dev/zero of=dm-crypt.img bs=1 count=0 seek=80GB
dd if=/dev/urandom of=key.secret bs=2k count=1
LOOP=$(losetup -f)
sudo losetup $LOOP dm-crypt.img
sudo cryptsetup luksFormat -q --key-file key.secret "$LOOP"
sudo cryp... | unknown | github | https://github.com/elastic/elasticsearch | .buildkite/scripts/encryption-at-rest.sh |
import { describe, expect, it } from 'vitest'
import { decodeArbitraryValue } from './decode-arbitrary-value'
describe('decoding arbitrary values', () => {
it('should replace an underscore with a space', () => {
expect(decodeArbitraryValue('foo_bar')).toBe('foo bar')
})
it('should replace multiple underscor... | typescript | github | https://github.com/tailwindlabs/tailwindcss | packages/tailwindcss/src/utils/decode-arbitrary-value.test.ts |
#include "opencv2/core.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/imgcodecs.hpp"
#include "imagestorage.h"
#include <stdio.h>
#include <iostream>
#include <fstream>
using namespace std;
using namespace cv;
bool CvCascadeImageReader::create( const string _posFilename, const string _negFilename, Size _winSi... | cpp | github | https://github.com/opencv/opencv | apps/traincascade/imagestorage.cpp |
# -*- coding: utf-8 -*-
import logging
import os.path
import yaml
logger = logging.getLogger("tailor.config")
pkConfig = dict()
def jpath(*args):
return os.path.normpath(os.path.join(*args))
def reload(path):
app_root_path = os.path.realpath(os.path.join(__file__, "..", ".."))
# TODO: make sense of al... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import print_function
import os
import sys
import argparse
import platform
import... | unknown | codeparrot/codeparrot-clean | ||
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
from askbot import const
class Migration(DataMigration):
def forwards(self, orm):
"""populate email and display filter strategies"""
for user in orm['auth.User'].objects.all():... | 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 applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/core/platform/strong_hash.h |
##########################################################################
#
# Copyright (c) 2018, Image Engine Design 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:
#
# * Redistribu... | unknown | codeparrot/codeparrot-clean | ||
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... | cpp | github | https://github.com/opencv/opencv | modules/core/src/copy.cpp |
# Copyright 2011 Andrew Bogott for the Wikimedia Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | unknown | codeparrot/codeparrot-clean | ||
from . import bagofrequests as bag
from . import handlers
from . import result as res
class PackageManager(object):
def __init__(self, url, **kwargs):
self.url = url
self.kwargs = kwargs
self.handlers = {
401: handlers.auth_fail,
405: handlers.method_not_allowed
... | unknown | codeparrot/codeparrot-clean | ||
#
# Copyright 2015 Reliance Jio Infocomm Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | unknown | codeparrot/codeparrot-clean | ||
import argparse
import math
import re
class Experiment(object):
def __init__(self, commit, params):
self.commit = commit
self.params = dict([
tuple(kv.split('=')) for kv in params.split(',')
])
self.outputs = []
class Results(dict):
def __init__(self, *args, **kwarg... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2006-2007 The Regents of The University of Michigan
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# This work was funded by Roche and generously donated to the free
# and open source cheminformatics community.
## Copyright (c) 2012 Andrew Dalke Scientific AB
## Andrew Dalke <dalke@dalkescientific.com>
##
## All rights reserved.
##
## Redistribution and use in source and binary forms, with or... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
#
# Copyright (c) 2015 CenturyLink
#
# 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 la... | unknown | codeparrot/codeparrot-clean | ||
/* Do not edit this file manually.
This file is autogenerated by windmc. */
//
// The values are 32 bit layed out as follows:
//
// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
// +---+-+-+-----------------------+------------------------------... | c | github | https://github.com/moby/moby | cmd/dockerd/winresources/event_messages.h |
# Copyright 2012 the V8 project 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditi... | unknown | codeparrot/codeparrot-clean | ||
from kfoldcv import *
from collections import defaultdict
class GraphBased(Model):
"""graph based language identification model"""
def __init__(self, **parameters):
# length of the n-grams
self.n = parameters.get('n', 3)
# store all the languages used to train this model
self.languages =... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# 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 me... | 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 applica... | python | github | https://github.com/tensorflow/tensorflow | tensorflow/compiler/tests/matrix_triangular_solve_op_test.py |
<?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\Twig\Tests\Extension;
use Symfony\Bridge\Twig\Extension\... | php | github | https://github.com/symfony/symfony | src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap4HorizontalLayoutTest.php |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
from optparse import make_option
import os
import re
import sys
import socket
from django.core.management.base import BaseCommand, CommandError
from django.core.servers.basehttp import AdminMediaHandler, run, WSGIServerException, get_internal_wsgi_application
from django.utils import autoreload
naiveip_re = re.compil... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Declarations for operating systems implementing time.now
// indirectly, in terms of walltime and nanotime assembly.
//go:build !faketime && !windows && !(li... | go | github | https://github.com/golang/go | src/runtime/timestub.go |
from __future__ import unicode_literals
from moto.core.responses import BaseResponse
from moto.core.utils import camelcase_to_underscores
from moto.ec2.utils import filters_from_querystring, vpc_ids_from_querystring
class VPCs(BaseResponse):
def create_vpc(self):
cidr_block = self.querystring.get('CidrBloc... | unknown | codeparrot/codeparrot-clean | ||
// Generated using cgo, then manually converted into appropriate naming and code
// for the Go runtime.
// go tool cgo -godefs defs_linux.go defs1_linux.go defs2_linux.go
package runtime
import "unsafe"
const (
_EINTR = 0x4
_EAGAIN = 0xb
_ENOMEM = 0xc
_ENOSYS = 0x26
_PROT_NONE = 0x0
_PROT_READ = 0x1
_PROT... | go | github | https://github.com/golang/go | src/runtime/defs_linux_loong64.go |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may n... | java | github | https://github.com/apache/kafka | clients/src/main/java/org/apache/kafka/common/requests/LeaveGroupResponse.java |
import sys
import xmlrpclib
import urllib
from certmaster import SSLCommon
class SSL_Transport(xmlrpclib.Transport):
user_agent = "pyOpenSSL_XMLRPC/%s - %s" % ('0.1', xmlrpclib.Transport.user_agent)
def __init__(self, ssl_context, timeout=None, use_datetime=0):
if sys.version_info[:3] >= (2, 5, 0):
... | unknown | codeparrot/codeparrot-clean | ||
{
"StatusCode": 1
} | json | github | https://github.com/spring-projects/spring-boot | buildpack/spring-boot-buildpack-platform/src/test/resources/org/springframework/boot/buildpack/platform/docker/container-wait-response.json |
"""create and manipulate C data types in Python"""
import os as _os, sys as _sys
__version__ = "1.1.0"
from _ctypes import Union, Structure, Array
from _ctypes import _Pointer
from _ctypes import CFuncPtr as _CFuncPtr
from _ctypes import __version__ as _ctypes_version
from _ctypes import RTLD_LOCAL, RTLD_GLOBAL
from... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
require "cases/helper"
require "support/schema_dumping_helper"
if ActiveRecord::Base.lease_connection.supports_comments?
class CommentTest < ActiveRecord::TestCase
include SchemaDumpingHelper
class Commented < ActiveRecord::Base
self.table_name = "commenteds"
end
... | ruby | github | https://github.com/rails/rails | activerecord/test/cases/comment_test.rb |
# -*- test-case-name: twisted.test.test_ftp -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
An FTP protocol implementation
"""
# System Imports
import os
import time
import re
import stat
import errno
import fnmatch
try:
import pwd, grp
except ImportError:
pwd = grp = None
fr... | unknown | codeparrot/codeparrot-clean | ||
doctests = """
Test simple loop with conditional
>>> sum(i*i for i in range(100) if i&1 == 1)
166650
Test simple nesting
>>> list((i,j) for i in range(3) for j in range(4) )
[(0, 0), (0, 1), (0, 2), (0, 3), (1, 0), (1, 1), (1, 2), (1, 3), (2, 0), (2, 1), (2, 2), (2, 3)]
Test nesting with the inner ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2016 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package terraform
import (
"fmt"
"log"
"github.com/hashicorp/terraform/internal/configs"
"github.com/hashicorp/terraform/internal/dag"
"github.com/hashicorp/terraform/internal/states"
)
// GraphNodeDestroyerCBD must be implemented by nodes t... | go | github | https://github.com/hashicorp/terraform | internal/terraform/transform_destroy_cbd.go |
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS
#include <ATen/core/Tensor.h>
#include <ATen/Context.h>
#include <ATen/NamedTensorUtils.h>
#include <ATen/native/quantized/cpu/init_qnnpack.h>
#include <ATen/native/quantized/cpu/QuantizedOps.h>
#include <ATen/native/quantized/cpu/QnnpackUtils.h>
#include <caffe2/utils/threadp... | cpp | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/quantized/cpu/ReduceOps.cpp |
// Copyright 2024 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
package sql_test
import (
"bufio"
"bytes"
"context"
"fmt"
"math"
"math/rand"
"regexp"
"strconv"
"testing"
"time"
"github.com/cockroachdb/cockroach/pkg/base"... | go | github | https://github.com/cockroachdb/cockroach | pkg/sql/mvcc_statistics_update_job_test.go |
#!/usr/bin/python
from __future__ import print_function, division
import unittest
from os.path import join
from os import remove
import pandas as pd
from datetime import timedelta
from testingtools import data_dir
from nilmtk.datastore import HDFDataStore
from nilmtk import TimeFrame
from nilmtk import DataSet, TimeFra... | unknown | codeparrot/codeparrot-clean | ||
"""
Memcached Backends
------------------
Provides backends for talking to `memcached <http://memcached.org>`_.
"""
import random
import threading
import time
from ..api import CacheBackend
from ..api import NO_VALUE
from ... import util
__all__ = (
"GenericMemcachedBackend",
"MemcachedBackend",
"Pylib... | unknown | codeparrot/codeparrot-clean | ||
<!--#docregion -->
<h3>Bypass Security Component</h3>
<!--#docregion URL -->
<h4>An untrusted URL:</h4>
<p><a class="e2e-dangerous-url" [href]="dangerousUrl">Click me</a></p>
<h4>A trusted URL:</h4>
<p><a class="e2e-trusted-url" [href]="trustedUrl">Click me</a></p>
<!--#enddocregion URL -->
<!--#docregion iframe -->
... | html | github | https://github.com/angular/angular | adev/src/content/examples/security/src/app/bypass-security.component.html |
import unittest
import mock
import blivet
from pyanaconda.storage.osinstall import InstallerStorage
from pyanaconda.core.constants import CLEAR_PARTITIONS_ALL, CLEAR_PARTITIONS_LINUX, CLEAR_PARTITIONS_NONE
from parted import PARTITION_NORMAL
from blivet.flags import flags
DEVICE_CLASSES = [
blivet.devices.DiskDev... | unknown | codeparrot/codeparrot-clean | ||
#
# This source file is part of appleseed.
# Visit https://appleseedhq.net/ for additional information and resources.
#
# This software is released under the MIT license.
#
# Copyright (c) 2016-2019 Esteban Tovagliari, The appleseedhq Organization
#
# Permission is hereby granted, free of charge, to any person obtainin... | unknown | codeparrot/codeparrot-clean | ||
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | c | github | https://github.com/llvm/llvm-project | clang-tools-extra/clang-tidy/tool/ClangTidyMain.h |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2007 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http://www.gn... | unknown | codeparrot/codeparrot-clean | ||
import socket
import warnings
def g_log(*args):
warnings.warn("eventlet.util.g_log is deprecated because "
"we're pretty sure no one uses it. "
"Send mail to eventletdev@lists.secondlife.com "
"if you are actually using it.",
DeprecationWarning, stackl... | 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 | ||
"""
Helpers to manipulate deferred DDL statements that might need to be adjusted or
discarded within when executing a migration.
"""
class Reference:
"""Base class that defines the reference interface."""
def references_table(self, table):
"""
Return whether or not this instance references the... | unknown | codeparrot/codeparrot-clean | ||
# This is a big script to test some SDK items.
from __future__ import print_function
import os
import json
import time
import pytest
from dotenv import load_dotenv, find_dotenv
from glpi import GlpiProfile
from glpi import GlpiTicket, Ticket
from glpi import GlpiKnowBase, KnowBase
from glpi import GLPI
def load_from... | unknown | codeparrot/codeparrot-clean | ||
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3 - clause BSD License)
*
* Redistribution and use ... | cpp | github | https://github.com/opencv/opencv | modules/calib3d/perf/perf_stereosgbm.cpp |
"""
Middleware decorator for removing headers.
"""
from functools import wraps
from openedx.core.djangoapps.header_control import force_header_for_response, remove_headers_from_response
def remove_headers(*headers):
"""
Decorator that removes specific headers from the response.
Usage:
@remove_hea... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
mpl.rcParams['axes.titlesize'] = 20
mpl.rcParams['xtick.labelsize'] = 16
mpl.rcParams['ytick.labelsize'] = 16
mpl.rcParams['axes.labelsize'] = 16
mpl.rcParams['xtick.major.size'] = 0
mpl.rcParams['ytick.major.size'] = 0
# 包含了狗,猫和猎豹的最高奔跑速度,还有对... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import print_function
import os.path
import CoolProp
import subprocess
import sys
web_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
root_dir = os.path.abspath(os.path.join(web_dir, '..'))
fluids_path = os.path.join(web_dir,'fluid_properties','fluids')
plots_path = os.path.join(we... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from cms.management.commands.subcommands.base import SubcommandsCommand
from cms.models import Page
from cms.models.pluginmodel import CMSPlugin
from cms.plugin_pool import plugin_pool
from django.core.management.base import NoArgsCommand
class ListApphooksCommand(NoArgsCommand):
help = 'L... | 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 | ||
# example.js
```javascript
import { increment as inc } from './increment';
var a = 1;
inc(a); // 2
// async loading
import("./async-loaded").then(function(asyncLoaded) {
console.log(asyncLoaded);
});
```
# increment.js
```javascript
import { add } from './math';
export function increment(val) {
return add(val,... | unknown | github | https://github.com/webpack/webpack | examples/custom-javascript-parser/README.md |
# vim: set et nosi ai ts=2 sts=2 sw=2:
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import argparse
import itertools
import textwrap
from schwa.dr import Reader, Writer
DECORATE_METHOD = 'drcli_decorate'
class SubParsed(object):
arg_parsers = ()
CLASSES = None ... | unknown | codeparrot/codeparrot-clean | ||
import {
createCodeFixActionWithoutFixAll,
registerCodeFix,
} from "../_namespaces/ts.codefix.js";
import {
Diagnostics,
factory,
textChanges,
} from "../_namespaces/ts.js";
registerCodeFix({
errorCodes: [
Diagnostics.await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_th... | typescript | github | https://github.com/microsoft/TypeScript | src/services/codefixes/addEmptyExportDeclaration.ts |
"""distutils.command.build_clib
Implements the Distutils 'build_clib' command, to build a C/C++ library
that is included in the module distribution and needed by an extension
module."""
# XXX this module has *lots* of code ripped-off quite transparently from
# build_ext.py -- not surprisingly really, as the work requ... | unknown | codeparrot/codeparrot-clean | ||
import unittest
class VotingSet:
def __init__(self, processes, numVotingSets, numSetsPerProcess):
self.processes = processes
self._split(numVotingSets, numSetsPerProcess)
def getVotingSet(self, process):
return self.procToVoteSets[process]
def getProcessesInSet(self, setNum):
... | unknown | codeparrot/codeparrot-clean | ||
data = (
'', # 0x00
'', # 0x01
'', # 0x02
'', # 0x03
'', # 0x04
'', # 0x05
'', # 0x06
'', # 0x07
'', # 0x08
'', # 0x09
'', # 0x0a
'', # 0x0b
'', # 0x0c
'', # 0x0d
'', # 0x0e
'', # 0x0f
'', # 0x10
'', # 0x11
'', # 0x12
'', # 0x13
'', # 0x14
'', # 0x15
'',... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2014 Google Inc. All Rights Reserved.
"""Command for creating forwarding rules."""
from googlecloudapis.compute.v1 import compute_v1_messages
from googlecloudsdk.calliope import exceptions
from googlecloudsdk.compute.lib import base_classes
from googlecloudsdk.compute.lib import forwarding_rules_utils as u... | unknown | codeparrot/codeparrot-clean | ||
"""Support for remote Python debugging.
Some ASCII art to describe the structure:
IN PYTHON SUBPROCESS # IN IDLE PROCESS
#
# oid='gui_adapter'
+----------+ # +------------+ ... | python | github | https://github.com/python/cpython | Lib/idlelib/debugger_r.py |
# Settings for Zulip Voyager
### MANDATORY SETTINGS
#
# These settings MUST be set in production. In a development environment,
# sensible default values will be used.
# The user-accessible Zulip hostname for this installation, e.g.
# zulip.example.com
EXTERNAL_HOST = 'zulip.example.com'
# The email address for the ... | unknown | codeparrot/codeparrot-clean | ||
"""This module provides the components needed to build your own __import__
function. Undocumented functions are obsolete.
In most cases it is preferred you consider using the importlib module's
functionality over this module.
"""
# (Probably) need to stay in _imp
from _imp import (lock_held, acquire_lock, release_lo... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.