code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This package defines the CGS units. They are also available in the
top-level `astropy.units` namespace.
"""
from fractions import Fraction
from . import si
from .core import UnitBase, def_unit
_ns = globals()
def_unit(['cm... | unknown | codeparrot/codeparrot-clean | ||
import logging
import os
import threading
import time
from fs.osfs import OSFS
from smartfile.errors import RequestError, ResponseError
import common
from definitions import FileDefinition, LocalDefinitionHelper
from errors import FileNotAvailableError, FileDeletedError, MaxTriesError
from errors import UploadError
f... | unknown | codeparrot/codeparrot-clean | ||
/*-------------------------------------------------------------------------
*
* nodeBitmapIndexscan.c
* Routines to support bitmapped index scans of relations
*
* Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
*... | c | github | https://github.com/postgres/postgres | src/backend/executor/nodeBitmapIndexscan.c |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from os import path
from setuptools import setup
from distutils.cmd import Command
NAME = 'redpipe'
ROOTDIR = path.abspath(os.path.dirname(__file__))
with open(os.path.join(ROOTDIR, 'README.rst')) as f:
readme = f.read()
with open(os.path.join(ROOTDIR, 'd... | unknown | codeparrot/codeparrot-clean | ||
from django.shortcuts import render
from django.template.response import TemplateResponse
from models import *
import random
# Create your views here.
def reverse_pitch(request):
# "Static" text here. OPTIONAL
intro = "US Ignite Will Convene Reverse Pitch Events in Nine Communities Throughout the United States... | unknown | codeparrot/codeparrot-clean | ||
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (C) 2015 Robert Jarzmik <robert.jarzmik@free.fr>
*
* Scatterlist splitting helpers.
*/
#include <linux/scatterlist.h>
#include <linux/slab.h>
struct sg_splitter {
struct scatterlist *in_sg0;
int nents;
off_t skip_sg0;
unsigned int length_last_sg;
struc... | c | github | https://github.com/torvalds/linux | lib/sg_split.c |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutExceptions(Koan):
class MySpecialError(RuntimeError):
pass
def test_exceptions_inherit_from_exception(self):
mro = self.MySpecialError.mro()
self.assertEqual(__, mro[1].__name__)
self.assertEqu... | unknown | codeparrot/codeparrot-clean | ||
"""
A Cobbler repesentation of an IP network.
Copyright 2009, Red Hat, Inc
John Eckersberg <jeckersb@redhat.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(... | unknown | codeparrot/codeparrot-clean | ||
"""engine.SCons.Variables.PackageVariable
This file defines the option type for SCons implementing 'package
activation'.
To be used whenever a 'package' may be enabled/disabled and the
package path may be specified.
Usage example:
Examples:
x11=no (disables X11 support)
x11=yes (will search for the... | unknown | codeparrot/codeparrot-clean | ||
it("should allow to use top-level-await", () => {
return import("./reexport").then(({ default: value, other }) => {
expect(value).toBe(42);
expect(other).toBe(42);
});
}); | javascript | github | https://github.com/webpack/webpack | test/cases/async-modules/top-level-await/index.js |
import unittest
from nativedroid_server import *
CHUNK_SIZE = 1024 * 1024 # 1MB
def get_file_chunks(filename):
with open(filename, 'rb') as f:
while True:
piece = f.read(CHUNK_SIZE)
if len(piece) == 0:
return
yield LoadBinaryRequest(buffer=piece)
clas... | unknown | codeparrot/codeparrot-clean | ||
import threading
import subprocess
import logging
import time
import os
import traceback
import errno
from collections import namedtuple, deque
from itertools import chain
import psutil
import conf
import client
import utils
import rpc.ttypes as ttypes
from profile import SystemProfiler as _SystemProfiler
logger =... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2014 NeuroData (http://neurodata.io)
#
# 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 | ||
/*
* 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/errors/DuplicateSequenceException.java |
# Copyright 2017, 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 ... | unknown | codeparrot/codeparrot-clean | ||
package benchmarks.scheduler
import benchmarks.*
import kotlinx.coroutines.*
import kotlinx.coroutines.channels.*
import org.openjdk.jmh.annotations.*
import java.util.concurrent.*
/*
* Benchmark which launches multiple async jobs each with either own private or global shared state,
* each job iterates over its sta... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | benchmarks/src/jmh/kotlin/benchmarks/scheduler/StatefulAwaitsBenchmark.kt |
package client
import (
"net/http"
"testing"
cerrdefs "github.com/containerd/errdefs"
"github.com/moby/moby/api/types/container"
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
)
func TestContainerUpdateError(t *testing.T) {
client, err := New(WithMockClient(errorMock(http.StatusInternalServerError, ... | go | github | https://github.com/moby/moby | client/container_update_test.go |
# Copyright 2012-2015, Damian Johnson and The Tor Project
# See LICENSE for licensing information
import stem.response
import stem.socket
class MapAddressResponse(stem.response.ControlMessage):
"""
Reply for a MAPADDRESS query.
Doesn't raise an exception unless no addresses were mapped successfully.
:var dic... | unknown | codeparrot/codeparrot-clean | ||
import type { DesignSystem } from '../design-system'
import { ThemeOptions } from '../theme'
import type { ResolvedConfig } from './config/types'
function resolveThemeValue(value: unknown, subValue: string | null = null): string | null {
if (
Array.isArray(value) &&
value.length === 2 &&
typeof value[1] ... | typescript | github | https://github.com/tailwindlabs/tailwindcss | packages/tailwindcss/src/compat/apply-config-to-theme.ts |
import logging
import logging.handlers
import os
def convert_log_level(level=26):
"""
Get a numeric log level from a string. The default 26 is for SHORT logs.
:param level
:return level
"""
# annoying but the level can be passed in as None
if not level:
level = 26
levels = {'n... | unknown | codeparrot/codeparrot-clean | ||
# 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 | ||
from datetime import datetime
from src.PTTparser import PTTparser
from src.DBmanage import DBmanage
class PTTcrawler:
def __init__(self):
self.db = DBmanage()
self.pttParser = PTTparser()
def crawlHotBoards(self):
hotBoardList = self.pttParser.parseHotBoard()
for board in hot... | unknown | codeparrot/codeparrot-clean | ||
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | python | github | https://github.com/apache/airflow | airflow-core/tests/unit/utils/test_dag_version_inflation_checker.py |
# Copyright 2012, Nachi Ueno, NTT MCL, 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
#
# Unles... | 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 Symfony\Component\HttpKe... | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Controller/ControllerResolver.php |
package daemon
import (
"context"
"fmt"
"github.com/containerd/log"
"github.com/moby/moby/api/types/events"
"github.com/moby/moby/v2/daemon/container"
"github.com/moby/moby/v2/errdefs"
)
// ContainerPause pauses a container
func (daemon *Daemon) ContainerPause(name string) error {
ctr, err := daemon.GetContai... | go | github | https://github.com/moby/moby | daemon/pause.go |
# pylint: disable=missing-docstring,import-error,unused-import,assignment-from-no-return
# pylint: disable=invalid-name, too-few-public-methods
from __future__ import print_function
from UNINFERABLE import uninferable_func
try:
from functools import singledispatch
except ImportError:
from singledispatch import... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
import theano.tensor as T
from numpy import linalg as la, random as rnd
import pymanopt
from pymanopt.manifolds import Oblique
from pymanopt.solvers import TrustRegions
def rank_k_correlation_matrix_approximation(A, k):
"""
Returns the matrix with unit-norm columns that is closests to A w.r... | unknown | codeparrot/codeparrot-clean | ||
from functools import partial
import sys
from threading import Thread
try:
import cPickle as pickle
except:
import pickle
import uwsgi
if uwsgi.masterpid() == 0:
raise Exception(
"you have to enable the uWSGI master process to use this module")
spooler_functions = {}
mule_functions = {}
postfork... | unknown | codeparrot/codeparrot-clean | ||
# 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 | ||
# frozen_string_literal: true
require "cases/helper"
require "models/post"
require "models/author"
require "models/account"
require "models/categorization"
require "models/comment"
require "models/company"
require "models/tagging"
require "models/topic"
require "models/reply"
require "models/rating"
require "models/en... | ruby | github | https://github.com/rails/rails | activerecord/test/cases/finder_test.rb |
{% for widget in widget.subwidgets -%}{% include widget.template_name %}{%- endfor %} | html | github | https://github.com/django/django | django/forms/jinja2/django/forms/widgets/multiwidget.html |
import random
import spriteobj
# By Willi Kappler <grandor@gmx.de>
# Licensed under GPL
class Firedevil(spriteobj.SpriteObj):
"Class for the fire devil: falls, removes ice-blocks"
def __init__(self, screen, level, gfx, x, y):
spriteobj.SpriteObj.__init__(self, screen, level, gfx, x, y)
self.m... | unknown | codeparrot/codeparrot-clean | ||
"""
Array methods which are called by both the C-code for the method
and the Python code for the NumPy-namespace function
"""
from __future__ import division, absolute_import, print_function
import warnings
from numpy.core import multiarray as mu
from numpy.core import umath as um
from numpy.core.numeric import asan... | unknown | codeparrot/codeparrot-clean | ||
{
"PUNSUBSCRIBE": {
"summary": "Stops listening to messages published to channels that match one or more patterns.",
"complexity": "O(N) where N is the number of patterns to unsubscribe.",
"group": "pubsub",
"since": "2.0.0",
"arity": -1,
"function": "punsubscribeComm... | json | github | https://github.com/redis/redis | src/commands/punsubscribe.json |
import numpy as np
import numpy.random as npr
import kayak
from . import *
def test_elemmult_values_1():
npr.seed(1)
for ii in xrange(NUM_TRIALS):
np_A = npr.randn(5,6)
np_B = npr.randn(5,6)
A = kayak.Parameter(np_A)
B = kayak.Parameter(np_B)
C = kaya... | unknown | codeparrot/codeparrot-clean | ||
"""County level agg."""
from pyiem.util import get_dbconn
from pyiem.plot.geoplot import MapPlot
from geopandas import read_postgis
from pandas.io.sql import read_sql
def main():
"""Go Main Go."""
years = 12.0 # 2008 - 2019
pgconn = get_dbconn("idep")
postgis = get_dbconn("postgis")
# Get the in... | unknown | codeparrot/codeparrot-clean | ||
import itertools
import json
import logging
import math
import os
import string
import time
from datetime import datetime
from mimetypes import types_map
from urllib.parse import urljoin, quote
import bs4
import requests
from django.conf import settings
from django.contrib.gis.gdal.error import GDALException
from djan... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (C) 2007 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/AbstractMapEntryTest.java |
# -*- coding: utf-8 -*-
#
#
# Author: Guewen Baconnier, Yannick Vaucher
# Copyright 2013-2015 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version... | unknown | codeparrot/codeparrot-clean | ||
<!DOCTYPE html>
<html lang="en">
<head>
<title>AuthenticationInterceptor Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset="utf-8">
<script src="../js/jquery.min.js" defer></... | html | github | https://github.com/Alamofire/Alamofire | docs/Classes/AuthenticationInterceptor.html |
#!/usr/bin/env python
import sys
import subprocess
import re
import telnetlib
HOST = "localhost"
def main():
regexIp = "\.1\.3\.6\.1\.4\.1\.8072\.2\.265\.(\d{1,5})\.(\d{1,4})\.(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})"
if len(sys.argv) < 5:
print("error, parameter missing")
else:
if sys.argv[1] == "-s":
regex... | unknown | codeparrot/codeparrot-clean | ||
/**********************************************************************
miniinit.c -
$Author$
created at: Thu Jul 11 22:09:57 JST 2013
Copyright (C) 2013 Yukihiro Matsumoto
**********************************************************************/
#include "ruby/ruby.h"
#include "ruby/encoding.h"
/* loadpath... | c | github | https://github.com/ruby/ruby | miniinit.c |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This file is part of XBMC Mega Pack Addon.
Copyright (C) 2014 Wolverine (xbmcmegapack@gmail.com)
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 Softwar... | unknown | codeparrot/codeparrot-clean | ||
###############################################################################
##
## Copyright (C) 2011-2013 Tavendo GmbH
##
## 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
##
## h... | unknown | codeparrot/codeparrot-clean | ||
import sys
import types
import unittest
class Test_TestLoader(unittest.TestCase):
### Tests for TestLoader.loadTestsFromTestCase
################################################################
# "Return a suite of all tests cases contained in the TestCase-derived
# class testCaseClass"
def test... | unknown | codeparrot/codeparrot-clean | ||
# -----------------------------------------------------------------------------
# yacc_prec1.py
#
# Tests case where precedence specifier doesn't match up to terminals
# -----------------------------------------------------------------------------
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright (c) 2019 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
import pytest
from ansible.module_utils._text import to_native
from ansible.p... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
"""
Onshape REST API
The Onshape REST API consumed by all clients. # noqa: E501
The version of the OpenAPI document: 1.113
Contact: api-support@onshape.zendesk.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
imp... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env bash
#
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
set -e
if [ -z "$IOS_CMAKE_TOOLCHAIN_FILE" ]
then
echo "IOS_CMAKE_TOOLCHAIN_FILE not set... | unknown | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/quantized/cpu/qnnpack/scripts/build-ios-armv7s.sh |
/*
* Copyright (c) 2010-2011 Ævar Arnfjörð Bjarmason
*
* This is a skeleton no-op implementation of gettext for Git.
* You can replace it with something that uses libintl.h and wraps
* gettext() to try out the translations.
*/
#ifndef GETTEXT_H
#define GETTEXT_H
#if defined(_) || defined(Q_)
#error "namespace c... | c | github | https://github.com/git/git | gettext.h |
/* Copyright 2018 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/core/platform/null_file_system.h |
"""
Helper methods related to EdxNotes.
"""
import json
import logging
import requests
from requests.exceptions import RequestException
from uuid import uuid4
from json import JSONEncoder
from datetime import datetime
from courseware.access import has_access
from courseware.views import get_current_child
from django.co... | unknown | codeparrot/codeparrot-clean | ||
use std::borrow::Cow;
use bstr::{ByteSlice, ByteVec};
/// The final component of the path, if it is a normal file.
///
/// If the path terminates in `..`, or consists solely of a root of prefix,
/// file_name will return `None`.
pub(crate) fn file_name<'a>(path: &Cow<'a, [u8]>) -> Option<Cow<'a, [u8]>> {
if path.... | rust | github | https://github.com/BurntSushi/ripgrep | crates/globset/src/pathutil.rs |
{
"BGREWRITEAOF": {
"summary": "Asynchronously rewrites the append-only file to disk.",
"complexity": "O(1)",
"group": "server",
"since": "1.0.0",
"arity": 1,
"function": "bgrewriteaofCommand",
"command_flags": [
"NO_ASYNC_LOADING",
"AD... | json | github | https://github.com/redis/redis | src/commands/bgrewriteaof.json |
A private item was used outside of its scope.
Erroneous code example:
```compile_fail,E0624
mod inner {
pub struct Foo;
impl Foo {
fn method(&self) {}
}
}
let foo = inner::Foo;
foo.method(); // error: method `method` is private
```
Two possibilities are available to solve this issue:
1. Only u... | unknown | github | https://github.com/rust-lang/rust | compiler/rustc_error_codes/src/error_codes/E0624.md |
# Copyright 2015 ARM Limited
#
# 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 writin... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
***************************************************************************
TestData.py
---------------------
Date : March 2013
Copyright : (C) 2013 by Victor Olaya
Email : volayaf at gmail dot com
*******************************... | unknown | codeparrot/codeparrot-clean | ||
/* contrib/pg_freespacemap/pg_freespacemap--1.2--1.3.sql */
-- complain if script is sourced in psql, rather than via ALTER EXTENSION
\echo Use "ALTER EXTENSION pg_freespacemap UPDATE TO '1.3'" to load this file. \quit
CREATE OR REPLACE FUNCTION
pg_freespace(rel regclass, blkno OUT bigint, avail OUT int2)
RETURNS S... | sql | github | https://github.com/postgres/postgres | contrib/pg_freespacemap/pg_freespacemap--1.2--1.3.sql |
use std::io::{self, Write};
use gsgdt::GraphvizSettings;
use rustc_graphviz as dot;
use super::generic_graph::mir_fn_to_generic_graph;
use super::pretty::dump_mir_def_ids;
use crate::mir::*;
/// Write a graphviz DOT graph of a list of MIRs.
pub fn write_mir_graphviz<W>(tcx: TyCtxt<'_>, single: Option<DefId>, w: &mut... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_middle/src/mir/graphviz.rs |
/*
* 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 | integration-tests/src/test/java/org/springframework/cache/annotation/EnableCachingIntegrationTests.java |
# -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright (C) 2009 Renato Lima - Akretion
{
'name': 'Brazilian - Accounting',
'category': 'Localization/Account Charts',
'description': """
Base module for the Brazilian localization
===================... | unknown | codeparrot/codeparrot-clean | ||
<?php
$container->loadFromExtension('security', [
'access_decision_manager' => [
'allow_if_all_abstain' => true,
'allow_if_equal_granted_denied' => false,
],
'providers' => [
'default' => [
'memory' => [
'users' => [
'foo' => ['passwor... | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/access_decision_manager_customized_config.php |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | unknown | codeparrot/codeparrot-clean | ||
import content from "./loader!!";
it("should compile", () => {
expect(typeof content).toBe("string");
expect(content.startsWith("webpack://")).toBe(true);
}); | javascript | github | https://github.com/webpack/webpack | test/cases/loaders/import-module/index.js |
from sympy.matrices.expressions.slice import MatrixSlice
from sympy.matrices.expressions import MatrixSymbol
from sympy.abc import a, b, c, d, k, l, m, n
from sympy.utilities.pytest import raises, XFAIL
from sympy.functions.elementary.integers import floor
from sympy.assumptions import assuming, Q
X = MatrixSymbol('X'... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks 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
import os
import json
import sys
from nose.plugins.skip import SkipTest
i... | unknown | codeparrot/codeparrot-clean | ||
from .. import Provider as PersonProvider
class Provider(PersonProvider):
formats = (
'{{first_name}} {{last_name}}',
'{{first_name}} {{last_name}}',
'{{first_name}} {{last_name}}',
'{{first_name}} {{last_name}}',
'{{first_name}} {{last_name}}',
'{{first_name}} {{las... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2016-2017 Capital One Services, 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 agreed ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#===----------------------------------------------------------------------===##
#
# 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
#
#===------------... | unknown | codeparrot/codeparrot-clean | ||
---
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
Title: CURLINFO_TLS_SSL_PTR
Section: 3
Source: libcurl
See-also:
- CURLINFO_TLS_SESSION (3)
- curl_easy_getinfo (3)
- curl_easy_setopt (3)
Protocol:
- TLS
TLS-backend:
- GnuTLS
- mbedTLS
- OpenSSL
- Schannel
-... | unknown | github | https://github.com/curl/curl | docs/libcurl/opts/CURLINFO_TLS_SSL_PTR.md |
import os
import re
class FormatParser:
def __init__(self, fileName = None):
self.dictFormat = {}
self.pattern = re.compile(r'(field\d{1,2})')
self.__OpenFile(fileName)
def __OpenFile(self, fileName):
if fileName == None or os.access(fileName, os.F_OK) == False:
return
f = open(fileName)
while True:
... | unknown | codeparrot/codeparrot-clean | ||
""" History related magics and functionality """
#-----------------------------------------------------------------------------
# Copyright (C) 2010-2011 The IPython Development Team.
#
# Distributed under the terms of the BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
... | 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 | ||
// This file was automatically generated from flow.md by Knit tool. Do not edit.
package kotlinx.coroutines.guide.exampleFlow23
import kotlinx.coroutines.*
import kotlinx.coroutines.flow.*
fun requestFlow(i: Int): Flow<String> = flow {
emit("$i: First")
delay(500) // wait 500 ms
emit("$i: Second")
}
fun ... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | kotlinx-coroutines-core/jvm/test/guide/example-flow-23.kt |
# -*- 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 | ||
# Copyright 2014 Hewlett-Packard Development Company, L.P.
# 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... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Write a program to solve a Sudoku puzzle by filling the empty cells.
# Empty cells are indicated by the character '.'.
# You may assume that there will be only one unique solution.
# A sudoku puzzle...
# 13974865.
# 7........
# .2.1.9...
# ..7...24.
# .64.1.59.
# .98...3..
# ...8.3.2.
# ....... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, 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',
... | unknown | codeparrot/codeparrot-clean | ||
// RUN: clang-reorder-fields -record-name Foo -fields-order c,e1,e3,e2,a,b %s -- | FileCheck %s
class Foo {
int a; // Trailing comment for a.
int b; // Multiline
// trailing for b.
// Prefix comments for c.
int c;
/*c-like*/ int e1;
int /*c-like*/ e2;
int e3 /*c-like*/;
};
// Note: the positio... | cpp | github | https://github.com/llvm/llvm-project | clang-tools-extra/test/clang-reorder-fields/Comments.cpp |
# 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, software
# distributed under th... | unknown | codeparrot/codeparrot-clean | ||
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Asynchronous Compression operations
*
* Copyright (c) 2016, Intel Corporation
* Authors: Weigang Li <weigang.li@intel.com>
* Giovanni Cabiddu <giovanni.cabiddu@intel.com>
*/
#include <crypto/internal/acompress.h>
#include <crypto/scatterwalk.h>
#include ... | c | github | https://github.com/torvalds/linux | crypto/acompress.c |
# use this to debug issues
#- debug: msg={{ is_private ~ ', ' ~ is_default ~ ', ' ~ privacy|default('nope')}}
- hosts: localhost
name: test global privacy setting
gather_facts: false
roles:
- a
pre_tasks:
- name: 'test roles: privacy'
assert:
that:
- is_private and privacy is u... | unknown | github | https://github.com/ansible/ansible | test/integration/targets/roles/privacy.yml |
# (c) Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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... | unknown | codeparrot/codeparrot-clean | ||
import distutils, os
from setuptools import Command
from distutils.util import convert_path
from distutils import log
from distutils.errors import *
from setuptools.command.setopt import edit_config, option_base, config_file
def shquote(arg):
"""Quote an argument for later parsing by shlex.split()"""
for c in ... | unknown | codeparrot/codeparrot-clean | ||
package middleware
import (
"context"
"net/http"
)
// Middleware is an interface to allow the use of ordinary functions as Docker API filters.
// Any struct that has the appropriate signature can be registered as a middleware.
type Middleware interface {
WrapHandler(func(ctx context.Context, w http.ResponseWriter,... | go | github | https://github.com/moby/moby | daemon/server/middleware/middleware.go |
#!/usr/bin/env python
# Copyright 2015 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.
"""Bootstrap script to clone and forward to the recipe engine tool."""
import ast
import logging
import os
import random
import re
im... | unknown | codeparrot/codeparrot-clean | ||
{
"css": null,
"js": [],
"start": 0,
"end": 204,
"type": "Root",
"fragment": {
"type": "Fragment",
"nodes": [
{
"type": "RegularElement",
"start": 0,
"end": 20,
"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-unclosed-tag/output.json |
"""
Command to manually re-post open ended submissions to the grader.
"""
from django.contrib.auth.models import User
from django.core.management.base import BaseCommand
from optparse import make_option
from xmodule.modulestore.django import modulestore
from opaque_keys.edx.locations import SlashSeparatedCourseKey
fro... | 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\Tests\DependencyInjection\Compiler;
use ... | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/UnusedTagsPassTest.php |
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The exos legacy fact class
It is in this file the configuration is collected from the device
for a given resource, parsed, and the facts tree is populated
based on the con... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (C) 2009 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 agreed ... | java | github | https://github.com/google/guava | guava/src/com/google/common/util/concurrent/AbstractService.java |
from unittest import TestCase
from django.test import tag
@tag('syntax_error')
class SyntaxErrorTestCase(TestCase):
pass
1syntax_error # NOQA | python | github | https://github.com/django/django | tests/test_runner_apps/tagged/tests_syntax_error.py |
#!/usr/bin/env python
import subprocess
import sys
import css_properties
import in_generator
import license
HEADER_TEMPLATE = """
%(license)s
#ifndef %(class_name)s_h
#define %(class_name)s_h
#include "core/css/parser/CSSParserMode.h"
#include "wtf/HashFunctions.h"
#include "wtf/HashTraits.h"
#include <string.h>
... | unknown | codeparrot/codeparrot-clean | ||
"""
This module is pending deprecation as of Django 1.6 and will be removed in
version 1.8.
"""
import json
import re
import unittest as real_unittest
import warnings
from django.db.models import get_app, get_apps
from django.test import _doctest as doctest
from django.test import runner
from django.test.utils import... | unknown | codeparrot/codeparrot-clean | ||
//go:build !exclude_graphdriver_overlay2 && linux
package register
import (
// register the overlay2 graphdriver
_ "github.com/moby/moby/v2/daemon/graphdriver/overlay2"
) | go | github | https://github.com/moby/moby | daemon/graphdriver/register/register_overlay2.go |
/*
* TLS 1.3 key schedule
*
* Copyright The Mbed TLS Contributors
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
*/
#if !defined(MBEDTLS_SSL_TLS1_3_KEYS_H)
#define MBEDTLS_SSL_TLS1_3_KEYS_H
/* This requires MBEDTLS_SSL_TLS1_3_LABEL( idx, name, string ) to be defined at
* the point of use. See e.g. ... | c | github | https://github.com/nodejs/node | deps/LIEF/third-party/mbedtls/library/ssl_tls13_keys.h |
# ----------------------------------------------------------------------------
# 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 | ||
"""Support for ISY994 fans."""
import logging
from typing import Callable
from homeassistant.components.fan import (
DOMAIN,
SPEED_HIGH,
SPEED_LOW,
SPEED_MEDIUM,
SPEED_OFF,
SUPPORT_SET_SPEED,
FanEntity,
)
from homeassistant.helpers.typing import ConfigType
from . import ISY994_NODES, ISY99... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
//go:build !enterprise
package audit
import "fmt"
// validate ensures that this if we're not running Vault Enterprise, we cannot
// supply Enterprise-only audit configuration options.
func (c *BackendConfig) validate() error {
if HasInvalidOpti... | go | github | https://github.com/hashicorp/vault | audit/backend_config_ce.go |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.