code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
#!/usr/bin/python
# (c) 2016, NetApp, Inc
# 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': ['preview'],
... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import tempfile
from ansible.module_utils import basic
from units.compat import unittest
from ansible.module_utils._text import to_bytes
from ansible.module_utils.basic import AnsibleModule
from ansible.modules.known_ho... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that the implicit rpath is added only when needed.
"""
import TestGyp
import re
import subprocess
import sys
if sys.platform... | unknown | codeparrot/codeparrot-clean | ||
# ext/hybrid.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
"""Define attributes on ORM-mapped classes that have "hybrid" behavior.
"hybrid" means ... | unknown | codeparrot/codeparrot-clean | ||
from django import forms
from basicviz.models import Experiment, BVFeatureSet
from decomposition.models import MotifSet
from motifdb.models import MDBMotifSet
from basicviz.constants import EXPERIMENT_DECOMPOSITION_SOURCE
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_... | unknown | codeparrot/codeparrot-clean | ||
package kotlinx.coroutines.rx3
import io.reactivex.rxjava3.core.*
import kotlinx.coroutines.flow.*
import org.junit.*
import org.reactivestreams.*
import org.reactivestreams.tck.*
class IterableFlowAsFlowableTckTest : PublisherVerification<Long>(TestEnvironment()) {
private fun generate(num: Long): Array<Long> {... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | reactive/kotlinx-coroutines-rx3/test/IterableFlowAsFlowableTckTest.kt |
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the "Elastic License
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, ... | java | github | https://github.com/elastic/elasticsearch | build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/ErrorReportingTestListener.java |
from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from django.views import generic
from oscar.core.application import Application
from oscar.core.loading import get_class
class CustomerApplication(Application):
name = 'customer'
summary_view = get_class('customer.views... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2014, Blue Box Group, Inc.
# Copyright 2014, Craig Tracey <craigtracey@gmail.com>
#
# 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 | ||
# postgresql/pypostgresql.py
# Copyright (C) 2005-2012 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
"""Support for the PostgreSQL database via py-postgresql.
Connecting
-----... | unknown | codeparrot/codeparrot-clean | ||
---
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
Long: ssl-allow-beast
Help: Allow security flaw to improve interop
Protocols: TLS
Added: 7.25.0
Category: tls
Multi: boolean
See-also:
- proxy-ssl-allow-beast
- insecure
Example:
- --ssl-allow-beast $URL
---
# `--ssl-all... | unknown | github | https://github.com/curl/curl | docs/cmdline-opts/ssl-allow-beast.md |
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the "Elastic License
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, ... | java | github | https://github.com/elastic/elasticsearch | build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/transform/RestTestTransformGlobalSetup.java |
#!/usr/bin/env python
import os
from icalendar import Calendar
def get_ics(filename):
return filename.endswith('ics')
def check_if_correct_parse(ics_file):
fh = open(ics_file, 'rb')
try:
# some calendars, such as Austrian ones have multiple
# vCalendar entries - we probably don't want the... | unknown | codeparrot/codeparrot-clean | ||
import queue
from random import choice
from typing import Dict, List
import random
import json
from bptc.data.event import Event, Parents
from bptc.data.hashgraph import Hashgraph
from bptc.data.transaction import MoneyTransaction, PublishNameTransaction
from bptc.data.db import DB
from bptc.protocols.push_protocol imp... | unknown | codeparrot/codeparrot-clean | ||
"""
Helper functions for mapping model fields to a dictionary of default
keyword arguments that should be used for their equivelent serializer fields.
"""
import inspect
from django.core import validators
from django.db import models
from django.utils.text import capfirst
from rest_framework.compat import clean_manyt... | unknown | codeparrot/codeparrot-clean | ||
# encoding: utf-8
"""
server.py
Created by Thomas Mangin on 2011-11-30.
Copyright (c) 2011-2013 Exa Networks. All rights reserved.
"""
# http://code.google.com/speed/articles/web-metrics.html
# http://itamarst.org/writings/pycon05/fast.html
from .functions import listen
from .functions import listen_intercept
impor... | 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.
*/
import {Result} from '../Utils/Result';
import {CompilerDiagnostic, CompilerError, Effect} from '..';
import {ErrorCategory} fro... | typescript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/Validation/ValidateNoDerivedComputationsInEffects_exp.ts |
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# Copyright 2019-2020 ARM Limited or its affiliates
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the... | unknown | codeparrot/codeparrot-clean | ||
# (c) 2013, Jan-Piet Mens <jpmens(at)gmail.com>
# (c) 2017 Ansible Project
# 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
DOCUMENTATION = """
lookup: csvfile
author: Jan-Piet Me... | unknown | codeparrot/codeparrot-clean | ||
"""
Created on Mar 15, 2014
@author: tjoneslo
"""
from .pdfcolor import PDFColor
class PDFDraw(object):
"""
Base class for the drawing classes: PDFLine, PDFRectangle, PDFEllipse
"""
def __init__(self, session, page, color=None, style=None, stroke=None, size=1):
# S is plain, B is filled with b... | unknown | codeparrot/codeparrot-clean | ||
import { InstantSample, Metric } from "../api/responseTypes/query";
import {
formatPrometheusFloat,
parsePrometheusFloat,
} from "../lib/formatFloatValue";
import {
binaryOperatorType,
vectorMatchCardinality,
VectorMatching,
} from "./ast";
import { isComparisonOperator, isSetOperator } from "./utils";
// We... | typescript | github | https://github.com/prometheus/prometheus | web/ui/mantine-ui/src/promql/binOp.ts |
import uuid
from django.utils import lru_cache
class IntConverter:
regex = '[0-9]+'
def to_python(self, value):
return int(value)
def to_url(self, value):
return str(value)
class StringConverter:
regex = '[^/]+'
def to_python(self, value):
return value
def to_url(s... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
try:
# For Python 3.0 and later
from urllib.error import URLError
from urllib.parse import urlencode
except ImportError:
# Fall back to Python 2's urllib2
from urllib2 import URLError
from urllib import urlencode
from django.http import HttpResponseRedirec... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/local/bin/python
"""
This script converts a subset of SVG into an HTML imagemap
Note *subset*. It only handles <path> elements, for which it only pays
attention to the M and L commands. Futher, it only notices the "translate"
transform.
It was written to generate the examples in the documentation for maphil... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
import os
import re
import time
from collections import namedtuple
from os import listdir
from threading import Thread, Lock
from odoo import http
import odoo.addons.hw_proxy.controllers.main as hw_prox... | unknown | codeparrot/codeparrot-clean | ||
# Load the AlchemyAPI module code.
import AlchemyAPI
# Create an AlchemyAPI object.
alchemyObj = AlchemyAPI.AlchemyAPI()
# Load the API key from disk.
alchemyObj.loadAPIKey("api_key.txt");
'''
# Extract a title from a web URL.
result = alchemyObj.URLGetTitle("http://www.techcrunch.com/");
print result
'''
# Extract... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (C) 2012 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/BenchmarkHelpers.java |
- Feature Name: Workload Level Index Recommendation
- Status: draft
- Start Date: 2023-06-05
- Authors: Aiden He
- RFC PR: (PR # after acceptance of initial draft)
- Cockroach Issue:
# Summary
This document is about the “workload level index recommendation”. As introduced in
[Index Recommendation Engine](https://gith... | unknown | github | https://github.com/cockroachdb/cockroach | docs/RFCS/20230605_workload_level_index_recommendation.md |
# -*- coding: utf-8 -*-
""" *==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, 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... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
from metaworld.policies.action import Action
from metaworld.policies.policy import Policy, assert_fully_parsed, move
class SawyerDrawerOpenV1Policy(Policy):
@staticmethod
@assert_fully_parsed
def _parse_obs(obs):
return {
'hand_pos': obs[:3],
'drwr_pos':... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/compiler/augmentExportEquals3_1.ts] ////
//// [file1.d.ts]
declare module "file1" {
function foo(): void;
namespace foo {
export var v: number;
}
export = foo;
}
//// [file2.ts]
/// <reference path="file1.d.ts"/>
import x = require("file1");
x.b = 1;
// OK - './file1' is a n... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/augmentExportEquals3_1.js |
@file:Suppress("PackageDirectoryMismatch")
package definitely.not.kotlinx.coroutines
import kotlinx.coroutines.testing.*
import kotlinx.coroutines.*
import kotlinx.coroutines.debug.*
import kotlinx.coroutines.selects.*
import org.junit.*
import org.junit.Test
import java.util.concurrent.*
import kotlin.test.*
class S... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | kotlinx-coroutines-debug/test/SanitizedProbesTest.kt |
/*
Copyright 2014 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/gendocs/gen_kubectl_docs.go |
#!/usr/bin/env python
############################################################################
#
# Copyright 2016 Samsung Electronics 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... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env bash
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: BUSL-1.1
set -euo pipefail
# Check goimports
echo "==> Checking the code complies with goimports requirements..."
# We only require goimports to have been run on files that were changed
# relative to the main branch, so that we can gradua... | unknown | github | https://github.com/hashicorp/terraform | scripts/goimportscheck.sh |
# -*- coding: utf-8 -*-
"""
Tests for Shibboleth Authentication
@jbau
"""
import unittest
from mock import patch
from ddt import ddt, data
from django.conf import settings
from django.http import HttpResponseRedirect
from django.test import TestCase
from django.test.client import RequestFactory, Client as DjangoTestCl... | unknown | codeparrot/codeparrot-clean | ||
from collections import OrderedDict
from typing import Any, Dict
from ..wrappers.time_distributed_with_mask import TimeDistributedWithMask
from .threshold_tuple_matcher import ThresholdTupleMatcher
from ...common.params import get_choice_with_default
class EmbeddedTupleMatcher:
"""
``EmbeddedTupleMatchers`` o... | unknown | codeparrot/codeparrot-clean | ||
from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS as TCP
from librehatti.config import _SENDER_EMAIL
from librehatti.config import _PASSWORD
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAM... | unknown | codeparrot/codeparrot-clean | ||
"""
Code to do with the grid engine master process, i.e. submitting slave jobs and waiting for them to report back
"""
import plugins, os, sys, socket, signal, logging, time
from utils import *
from Queue import Queue
from SocketServer import ThreadingTCPServer, StreamRequestHandler
from threading import RLock, Lock
f... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright 2011-2013 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT lice... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: iso-8859-1 -*-
"""
MoinMoin - page contents writer
@copyright: 2007 MoinMoin:JohannesBerg
@license: GNU GPL, see COPYING for details.
"""
import xmlrpclib
import sys
from MoinMoin.script import MoinScript
class PluginScript(MoinScript):
"""\
Purpose:
========
This tool allows you to ed... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | unknown | codeparrot/codeparrot-clean | ||
it("should allow to access utils in loader", () => {
expect(require("./loader!" + __filename)).toEqual({
request1: "./index.js",
request2: "./index.js"
});
}); | javascript | github | https://github.com/webpack/webpack | test/cases/loaders/utils/index.js |
from abc import abstractmethod, ABCMeta
import collections
class Primitive(metaclass=ABCMeta):
"""
Base class for callable Lisp-like objects to be defined inside config
"""
@abstractmethod
def __call__(self): pass
class Constant(Primitive):
def __init__(self, value):
assert not isinsta... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from erpnext.stock.doctype.bin.bin import update_item_projected_qty
def execute():
repost_bin_qty()
repost_item_projected_qty()
def... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# This Python script generates AWS CloudFormation templates to start a VoltDB
# cluster. Run the program without any arguments to see usage.
#
# For details on the CloudFormation template, you can check out the doc page at
# http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.ht... | 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 us... | unknown | codeparrot/codeparrot-clean | ||
import { type Author } from "./author";
export type Post = {
slug: string;
title: string;
date: string;
coverImage: string;
author: Author;
excerpt: string;
ogImage: {
url: string;
};
content: string;
preview?: boolean;
}; | typescript | github | https://github.com/vercel/next.js | examples/blog-starter/src/interfaces/post.ts |
# -*- coding: utf-8 -*-
#
# 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
#... | unknown | codeparrot/codeparrot-clean | ||
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | unknown | codeparrot/codeparrot-clean | ||
import unittest
from django.core.management.color import no_style
from django.db import connection
from django.test import SimpleTestCase
from ..models import Person, Tag
@unittest.skipUnless(connection.vendor == "mysql", "MySQL tests.")
class MySQLOperationsTests(SimpleTestCase):
def test_sql_flush(self):
... | python | github | https://github.com/django/django | tests/backends/mysql/test_operations.py |
from django.conf import settings
from django.contrib.staticfiles.handlers import StaticFilesHandler
from django.core.management.commands.runserver import \
Command as RunserverCommand
class Command(RunserverCommand):
help = "Starts a lightweight Web server for development and also serves static files."
de... | 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/modernize/UnaryStaticAssertCheck.h |
<?php
namespace Illuminate\Tests\Queue;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Support\Facades\Queue;
use Orchestra\Testbench\TestCase;
class QueueSizeTest extends TestCase
{
public function test_queue_size()
{
Queue::fake();
$this->assertEqu... | php | github | https://github.com/laravel/framework | tests/Queue/QueueSizeTest.php |
import pytest
from scrapy import Request, Spider
from scrapy.http import FormRequest, JsonRequest
from scrapy.utils.request import request_from_dict
class CustomRequest(Request):
pass
class TestRequestSerialization:
def setup_method(self):
self.spider = MethodsSpider()
def test_basic(self):
... | python | github | https://github.com/scrapy/scrapy | tests/test_request_dict.py |
import Container from "./container";
import { EXAMPLE_PATH } from "../lib/constants";
export default function Footer() {
return (
<footer className="bg-accent-1 border-t border-accent-2">
<Container>
<div className="py-28 flex flex-col lg:flex-row items-center">
<h3 className="text-4xl lg... | typescript | github | https://github.com/vercel/next.js | examples/cms-agilitycms/components/footer.tsx |
/*
* 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.types
import org.jetbrains.kotlin.analysis.api.KaExperimentalAp... | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/types/KaFirFunctionType.kt |
# -*- coding: utf-8 -*-
#
# jams documentation build configuration file, created by
# sphinx-quickstart on Mon Dec 8 10:34:40 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All ... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2019 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | java | github | https://github.com/tensorflow/tensorflow | tensorflow/java/src/main/java/org/tensorflow/AbstractOperation.java |
# -*- coding: utf-8 -*-
"""
***************************************************************************
SetVectorStyle.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
************************... | 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/main/java/org/apache/hadoop/security/alias/LocalKeyStoreProvider.java |
// Copyright 2015 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
package gossip
import (
"testing"
"github.com/cockroachdb/cockroach/pkg/roachpb"
"github.com/cockroachdb/cockroach/pkg/util/leaktest"
"github.com/cockroachdb/cockr... | go | github | https://github.com/cockroachdb/cockroach | pkg/gossip/node_set_test.go |
// Copyright 2025 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.
//go:build unix
package bufio_test
import (
"bufio"
"io"
"net"
"path/filepath"
"strings"
"sync"
"testing"
)
// TestCopyUnixpacket tests that we can us... | go | github | https://github.com/golang/go | src/bufio/net_test.go |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Red Hat | Ansible
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This is a windows documentation stub. Actual code lives in the .ps1
# file of the same name
ANSIBLE_METADATA = {'metadata_version': '1.1',... | unknown | codeparrot/codeparrot-clean | ||
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*
Copyright 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... | go | github | https://github.com/kubernetes/kubernetes | pkg/controller/certificates/signer/config/zz_generated.deepcopy.go |
"""Stuff to parse WAVE files.
Usage.
Reading WAVE files:
f = wave.open(file, 'r')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods read(), seek(), and close().
When the setpos() and rewind() methods are not used, the seek()
method is not necessary.
This ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <headingcell level=1>
# Goals
# <markdowncell>
# Some goals for this exercise:
#
# * to reacquaint ourselves with Python
# * to start learning how to use a particular IPython notebook environment, one which is easy to jump right into, namely [Wakari](https://www.... | 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... | unknown | codeparrot/codeparrot-clean | ||
#
# iw_gui.py: install window base class
#
# Copyright (C) 2000, 2001, 2002 Red Hat, Inc. All rights reserved.
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
@file:Suppress("DEPRECATION")
package org.springframework.docs.web.webmvc.mvcconfig.mvcconfigmessageconverters
import org.springframework.context.annotation.Configuration
import org.springframework.http.converter.HttpMessageConverters
import org.springframework.http.converter.json.JacksonJsonHttpMessageConverter
impo... | kotlin | github | https://github.com/spring-projects/spring-framework | framework-docs/src/main/kotlin/org/springframework/docs/web/webmvc/mvcconfig/mvcconfigmessageconverters/WebConfiguration.kt |
from __future__ import absolute_import, division, unicode_literals
# pylint:disable=protected-access
from pip._vendor.six import text_type
import re
from . import base
from .. import _ihatexml
from .. import constants
from ..constants import namespaces
from .._utils import moduleFactoryFactory
tag_regexp = re.compi... | unknown | codeparrot/codeparrot-clean | ||
import validators
import unittest
import yaml
import sys
import os
# MAKING SURE THAT SETTINGS.YAML IS GOING TO BE FOUND!
TEEKA_SETTINGS = os.getenv('TEEKA_SETTINGS', "../settings.yaml")
# ADDING PARENT AND CURRENT DIRECTORIES INTO SYSTEM PATH
CURREN_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os... | 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 | buildSrc/src/main/java/org/springframework/boot/build/springframework/CheckFactoriesFile.java |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of FLOSS Talks.
#
# FLOSS Talks is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (a... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2010 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.
package mime
import (
"internal/asan"
"slices"
"strings"
"sync"
"testing"
)
func setMimeInit(fn func()) (cleanup func()) {
once = sync.Once{}
testInitM... | go | github | https://github.com/golang/go | src/mime/type_test.go |
// RUN: clang-include-cleaner --print=changes %s -- -I %S/Inputs | FileCheck --allow-empty %s
#include "foo.h"
#include "foo2.h"
int n = foo();
// Make sure both providers are preserved.
// CHECK-NOT: - "foo.h"
// CHECK-NOT: - "foo2.h" | cpp | github | https://github.com/llvm/llvm-project | clang-tools-extra/include-cleaner/test/multiple-providers.cpp |
import unittest
from django.utils.termcolors import (
DARK_PALETTE,
DEFAULT_PALETTE,
LIGHT_PALETTE,
NOCOLOR_PALETTE,
PALETTES,
colorize,
parse_color_setting,
)
class TermColorTests(unittest.TestCase):
def test_empty_string(self):
self.assertEqual(parse_color_setting(""), PALETT... | python | github | https://github.com/django/django | tests/utils_tests/test_termcolors.py |
"""
Tests of errors that are common across a wide group of pywbemcli groups and
commands.
This includes:
1. Tests of connection timeout on bad server with all commands. Note that the
command options in these tests are just sufficient to pass command parsing
since all tests should fail with connection error.
2. Test ... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from .scale import scale
from copy import deepcopy
import matplotlib.pyplot as plt
from matplotlib.colors import LinearSegmentedColormap, rgb2hex, ColorConverter
def colors_at_breaks(cmap, breaks=[0, 0.25, 0.5,... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# Copyright (c) 2009 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.
"""Compiler version checking tool for gcc
Print gcc version as XY if you are running gcc X.Y.*.
This is used to tweak build flags for... | unknown | codeparrot/codeparrot-clean | ||
---
layout: step
title: Setup
menu_name: Step by Step Tutorial
position: 1
redirect_from:
- /docs/step-by-step/
---
Welcome to Jekyll's step-by-step tutorial. This tutorial takes
you from having some front-end web development experience to building your
first Jekyll site from scratch without relying on the default gem-... | unknown | github | https://github.com/jekyll/jekyll | docs/_docs/step-by-step/01-setup.md |
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-boot | configuration-metadata/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/generic/UpperBoundGenericPojo.java |
#!/usr/bin/env python
#
# 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
# "L... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Database\Schema;
use Illuminate\Support\Stringable;
class ForeignIdColumnDefinition extends ColumnDefinition
{
/**
* The schema builder blueprint instance.
*
* @var \Illuminate\Database\Schema\Blueprint
*/
protected $blueprint;
/**
* Create a new forei... | php | github | https://github.com/laravel/framework | src/Illuminate/Database/Schema/ForeignIdColumnDefinition.php |
"""
Goal: Store the rules by which we pick the elements of patient data before
computing the hashed string.
Authors:
Andrei Sura <sura.andrei@gmail.com>
"""
# TODO: research the claim from
# L. Sweeney. k-anonymity: a model for protecting privacy.
# International Journal on Uncertainty, Fuzziness and Knowled... | unknown | codeparrot/codeparrot-clean | ||
<?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\Bundle\FrameworkBundle\Controller;
use Psr\Container\ContainerI... | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Controller/ControllerHelper.php |
import itertools, warnings
import cPickle
from hashlib import sha1
import numpy as np
import helpers
class DataSet:
"""
A data set consists of samples with features and labels, and some additional descriptors.
xs* Samples with features. Features can be multi-dimensional. For example, in the case
of EEG,... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('account', '0030_auto_20151203_1116'),
]
operations = [
migrations.AlterField(
model_name='userprofile',
... | unknown | codeparrot/codeparrot-clean | ||
import warnings
from .base import Renderer
from ..exporter import Exporter
class VincentRenderer(Renderer):
def open_figure(self, fig, props):
self.chart = None
self.figwidth = int(props['figwidth'] * props['dpi'])
self.figheight = int(props['figheight'] * props['dpi'])
def draw_line(s... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# king_phisher/client/dialogs/__init__.py
#
# 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
# ... | unknown | codeparrot/codeparrot-clean | ||
package daemon
import (
"testing"
containertypes "github.com/moby/moby/api/types/container"
)
func TestMergeAndVerifyLogConfigNilConfig(t *testing.T) {
d := &Daemon{defaultLogConfig: containertypes.LogConfig{Type: "json-file", Config: map[string]string{"max-file": "1"}}}
cfg := containertypes.LogConfig{Type: d.d... | go | github | https://github.com/moby/moby | daemon/logs_test.go |
# Parsec Cloud (https://parsec.cloud) Copyright (c) AGPLv3 2016-2021 Scille SAS
import pytest
import trio
from uuid import uuid4
from parsec.api.protocol import INVITED_CMDS, InvitationType
from parsec.core.types import BackendInvitationAddr
from parsec.core.backend_connection import (
BackendNotAvailable,
Ba... | unknown | codeparrot/codeparrot-clean | ||
from test.support import verbose, TestFailed
import sys
import test.support as support
import unittest
maxsize = support.MAX_Py_ssize_t
# test string formatting operator (I am not sure if this is being tested
# elsewhere but, surely, some of the given cases are *not* tested because
# they crash python)
# test on unic... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | python | github | https://github.com/tensorflow/tensorflow | tensorflow/compiler/tests/svd_op_test.py |
// clinic/vectorcall.c.h uses internal pycore_modsupport.h API
#define PYTESTCAPI_NEED_INTERNAL_API
#include "parts.h"
#include "clinic/vectorcall.c.h"
#include <stddef.h> // offsetof
/*[clinic input]
module _testcapi
[clinic start generated code]*/
/*[clinic end generated code: output=da39a3ee5e6b4b... | c | github | https://github.com/python/cpython | Modules/_testcapi/vectorcall.c |
import yaml
import pytest
import os
from os import path
import subprocess
import tempfile
import shutil
import re
import conda_skeletor
from conda_skeletor import git
def test_meta_generation():
data_path = path.join(path.dirname(__file__), 'data')
projects_to_test = [path.join(data_path, folder)
... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/conformance/async/es2017/awaitCallExpression/awaitCallExpression3_es2017.ts] ////
//// [awaitCallExpression3_es2017.ts]
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, ar... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/awaitCallExpression3_es2017.js |
# coding=utf-8
# Copyright 2021 The Google Research 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 applicab... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/conformance/async/es6/asyncSetter_es6.ts] ////
//// [asyncSetter_es6.ts]
class C {
async set foo(value) {
}
}
//// [asyncSetter_es6.js]
"use strict";
class C {
set foo(value) {
}
} | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/asyncSetter_es6.js |
import datetime
from collections import defaultdict
from django.contrib.auth.models import User
from django.shortcuts import render
from django.utils import timezone
from django.db.models import Sum
from django.template.defaultfilters import filesizeformat
from jsonview.decorators import json_view
from airmozilla.ma... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.