code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
# -*- coding: utf-8 -*-
"""
werkzeug.testsuite.formparser
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests the form parsing facilities.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement
import unittest
from StringIO import StringIO
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# vispy: testskip
# -----------------------------------------------------------------------------
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -------------------------------------------------------------... | unknown | codeparrot/codeparrot-clean | ||
from django.conf.urls import include, patterns, url
from django.contrib import admin
from django.core.exceptions import PermissionDenied
from django.core.urlresolvers import reverse
from django.shortcuts import redirect
from . import views
# Hijack the admin's login to use our pages.
def login(request):
# If some... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2011-2012 OpenStack Foundation
# 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
#
# Un... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2013-2020 Free Software Foundation, Inc.
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved. This file is offered as-is,
# without any warranty.
import sys
import re
import ... | unknown | codeparrot/codeparrot-clean | ||
security:
providers:
default:
memory:
users: { foo: { password: foo, roles: ROLE_USER } }
firewalls:
main:
form_login:
provider: default | unknown | github | https://github.com/symfony/symfony | src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/listener_provider.yml |
// Copyright 2016 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
package sql
import (
"context"
"github.com/cockroachdb/cockroach/pkg/jobs/jobsauth"
"github.com/cockroachdb/cockroach/pkg/keyvisualizer"
"github.com/cockroachdb/co... | go | github | https://github.com/cockroachdb/cockroach | pkg/sql/planhook.go |
/*
Copyright 2016 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 | pkg/kubelet/kubelet_resources_test.go |
# http://hbase.apache.org/book.html#_rest
import requests
import base64
import base64
from xml.etree.ElementTree import Element, SubElement, tostring, fromstring
headers = {'Accept': 'text/xml'}
# Method for encoding ints with base64 encoding
def encode(n):
data = struct.pack("i", n)
s = base64.b64encode(dat... | unknown | codeparrot/codeparrot-clean | ||
# iSCSI initiator related facts collection for Ansible.
#
# 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 l... | unknown | codeparrot/codeparrot-clean | ||
# 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/.
import os
from contextlib import contextmanager
from socorro.lib.util import FakeLogger
#-----------------------------... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-framework | spring-context/src/main/java/org/springframework/instrument/classloading/SimpleThrowawayClassLoader.java |
/*
Copyright 2016 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 | pkg/kubelet/kubelet_resources.go |
'use strict';
const common = require('../common.js');
const _checkInvalidHeaderChar = require('_http_common')._checkInvalidHeaderChar;
const groupedInputs = {
// Representative set of inputs from an AcmeAir benchmark run:
// all valid strings, average length 14.4, stdev 13.0
group_acmeair: [
'W/"2-d4cbb29"'... | javascript | github | https://github.com/nodejs/node | benchmark/http/check_invalid_header_char.js |
# Copyright (c) 2020 PaddlePaddle 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 app... | unknown | codeparrot/codeparrot-clean | ||
// RUN: clang-tidy %s -checks='-*,llvm-namespace-comment' -- | FileCheck %s
namespace i {
}
// CHECK: warning: namespace 'i' not terminated with a closing comment [llvm-namespace-comment] | cpp | github | https://github.com/llvm/llvm-project | clang-tools-extra/test/clang-tidy/infrastructure/basic.cpp |
#!/usr/bin/python
#
# Copyright (C) 2010-2011 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | unknown | codeparrot/codeparrot-clean | ||
#!/bin/sh
#
# Copyright (c) 2008 Ping Yin
#
test_description='Summary support for submodules
This test script tries to verify the sanity of summary subcommand of git submodule.
'
# NOTE: This test script uses 'git add' instead of 'git submodule add' to add
# submodules to the superproject. Some submodule subcommands... | unknown | github | https://github.com/git/git | t/t7401-submodule-summary.sh |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Change directory to provide relative paths for doctests
>>> import os
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
>>> datadir = os.path.realpath(os.path.join(filepath,... | 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 annotations
DOCUMENTATION = r"""
name: csvfile
author: Jan-Piet Mens (@jpmens) <jpmens(at)gmail.com>
version_added: ... | python | github | https://github.com/ansible/ansible | lib/ansible/plugins/lookup/csvfile.py |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | unknown | codeparrot/codeparrot-clean | ||
from ika.service import Command, Permission
from ika.models import Account, Channel, Flag
from ika.enums import Flags
class TransferChannel(Command):
name = '채널소유권이전'
aliases = (
'TRANSFERCHANNEL',
)
syntax = '<#채널명> <계정명> <YES>'
regex = r'(?P<cname>#\S+) (?P<target>\S+) (?P<confirmed>YES)'... | unknown | codeparrot/codeparrot-clean | ||
import femagtools
import femagtools.plot
import femagtools.machine
import logging
import matplotlib.pyplot as plt
import os
logging.basicConfig(level=logging.INFO,
format='%(asctime)s %(message)s')
machine = dict(
name="PM 270 L8",
lfe=0.08356,
poles=8,
outer_diam=0.26924,
bore... | unknown | codeparrot/codeparrot-clean | ||
import os
import sys
import shutil
from distutils.core import Extension
from distutils.command.build_ext import build_ext
from distutils.dist import Distribution
from distutils import log
from distutils.msvccompiler import MSVCCompiler
from distutils.sysconfig import get_config_vars
from Cython.Build import cythonize
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014 CodUP (<http://codup.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affer... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
import sys
import xml.dom.minidom
from string import ascii_letters, digits
from libglibcodegen import signal_to_marshal_name
NS_TP = "http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"
class Generator(object):
def __init__(self, dom, prefix):
self.dom = dom
self.mar... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np, tensorflow as tf
from termcolor import colored as c, cprint
outputs = [
[0, 1, 0, 0, 0, 0, 0, 0, 0, 0], # correct
[0, 0, 0, 0, 1, 0, 0, 0, 0, 0], # wrong
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], # null
[-268252.5625, 48779.19921875, 80110.6796875, 354422.34375,
158246.78125, 192678.7... | unknown | codeparrot/codeparrot-clean | ||
// 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.
package net
func supportsUnixSocket() bool {
return false
} | go | github | https://github.com/golang/go | src/net/platform_plan9_test.go |
'''
Created on May 19, 2010
Has a class that is useful for sending commands to remote ssh servers and
interacting with them easily.
@author: jnaous
'''
import paramiko, logging
plogger = paramiko.util.get_logger("paramiko.transport")
plogger.setLevel(logging.WARNING)
logger = logging.getLogger("SSHClientPlus")
cla... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright (C) 2010 Google 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2015 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 __future__ import absolute_import
from __future__ import unicode_literals
import jinja2
from whichcraft import which
from behave import given
from command_steps import step_i_successfully_run_command
import table_utils
GPGKEY_CONF_TMPL = """
%no-protection
%transient-key
Key-Type: {{ key_type|default("RSA") }}... | unknown | codeparrot/codeparrot-clean | ||
from django.conf.urls import patterns, include, url
from django.views.generic import TemplateView
import settings.base
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', 'profiles.views.index', name='index'),
url(r'^accou... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
from PyQt4.QtCore import *
from PyQt4.QtSql import *
from blur.Stone import *
from blur.Classes import *
import blur.email, blur.jabber
import sys, time, re
from math import ceil
try:
import popen2
except: pass
if sys.argv.count('-daemonize'):
from blur.daemonize import createDaemon
createDaemon(... | unknown | codeparrot/codeparrot-clean | ||
"""Base classes that are extended by low level AMQP frames and higher level
AMQP classes and methods.
"""
class AMQPObject(object):
"""Base object that is extended by AMQP low level frames and AMQP classes
and methods.
"""
NAME = 'AMQPObject'
INDEX = None
def __repr__(self):
items = ... | unknown | codeparrot/codeparrot-clean | ||
"""
Exceptions
"""
# Author: Gael Varoquaux < gael dot varoquaux at normalesup dot org >
# Copyright: 2010, Gael Varoquaux
# License: BSD 3 clause
import sys
from ._compat import PY3_OR_LATER
class JoblibException(Exception):
"""A simple exception with an error message that you can get to."""
def __init__(se... | unknown | codeparrot/codeparrot-clean | ||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/dma/apm,xgene-storm-dma.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: APM X-Gene Storm SoC DMA
maintainers:
- Khuong Dinh <khuong@os.amperecomputing.com>
properties:
compatible:
co... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/dma/apm,xgene-storm-dma.yaml |
<!-- BEGIN MUNGE: GENERATED_TOC -->
- [v1.34.4](#v1344)
- [Downloads for v1.34.4](#downloads-for-v1344)
- [Source Code](#source-code)
- [Client Binaries](#client-binaries)
- [Server Binaries](#server-binaries)
- [Node Binaries](#node-binaries)
- [Container Images](#container-images)
- [Changelo... | unknown | github | https://github.com/kubernetes/kubernetes | CHANGELOG/CHANGELOG-1.34.md |
import argparse
import os
import sys
import textwrap
sys.path.insert(0, os.path.dirname(__file__))
import ufunc_docstrings as docstrings
sys.path.pop(0)
def normalize_doc(docstring):
docstring = textwrap.dedent(docstring).strip()
docstring = docstring.encode('unicode-escape').decode('ascii')
docstring = ... | python | github | https://github.com/numpy/numpy | numpy/_core/code_generators/generate_umath_doc.py |
# Copyright (c) 2010 Google 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | unknown | codeparrot/codeparrot-clean | ||
{"arr":
{"type":"array","value":
[
{"subtab":
{"val": {"type":"integer","value":"1"}
}
},
{"subtab": {"val": {"type":"integer","value":"2"}}}
]
}
} | json | github | https://github.com/python/cpython | Lib/test/test_tomllib/data/valid/array/array-subtables.json |
## Input
```javascript
// @flow
export hook useItemLanguage(items) {
return useMemo(() => {
let language: ?string = null;
items.forEach(item => {
if (item.language != null) {
language = item.language;
}
});
return language;
}, [items]);
}
```
## Code
```javascript
import { c ... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reassign-variable-in-usememo.expect.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 | core/spring-boot/src/test/java/org/springframework/boot/SpringApplicationAotProcessorTests.java |
#!/usr/bin/env python
import os
import optparse
import sys
import re
from pip.exceptions import InstallationError, CommandError, PipError
from pip.log import logger
from pip.util import get_installed_distributions, get_prog
from pip.vcs import git, mercurial, subversion, bazaar # noqa
from pip.baseparser import crea... | unknown | codeparrot/codeparrot-clean | ||
from django.contrib.postgres.signals import (
get_citext_oids,
get_hstore_oids,
register_type_handlers,
)
from django.db import NotSupportedError, router
from django.db.migrations import AddConstraint, AddIndex, RemoveIndex
from django.db.migrations.operations.base import Operation, OperationCategory
from d... | python | github | https://github.com/django/django | django/contrib/postgres/operations.py |
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
class PostGISSchemaEditor(DatabaseSchemaEditor):
geom_index_type = 'GIST'
geom_index_ops_nd = 'GIST_GEOMETRY_OPS_ND'
rast_index_wrapper = 'ST_ConvexHull(%s)'
sql_add_spatial_index = "CREATE INDEX %(index)s ON %(table)s USIN... | unknown | codeparrot/codeparrot-clean | ||
import sys
import os
from os.path import abspath, dirname
import re
import json
import logging
import time
import socket
import settings
# from messagetools.mock.mock_http import MockHTTP
logger = logging.getLogger(__name__)
"""
A centralized the mock data access
"""
fs_encoding = sys.getfilesystemencoding() or sys.g... | unknown | codeparrot/codeparrot-clean | ||
#
# Kivy - Crossplatform NUI toolkit
# http://kivy.org/
#
import sys
from copy import deepcopy
import os
from os.path import join, dirname, sep, exists, basename
from os import walk, environ
from distutils.core import setup
from distutils.extension import Extension
from collections import OrderedDict
if sys.version ... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import annotations
import pandas._testing as tm
from pandas.api import types
from pandas.tests.api.test_api import Base
class TestTypes(Base):
allowed = [
"is_any_real_numeric_dtype",
"is_bool",
"is_bool_dtype",
"is_categorical_dtype",
"is_complex",
... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/api/test_types.py |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd F Y' # 25 Ottobre 2006
TIME_FO... | unknown | codeparrot/codeparrot-clean | ||
# (C) British Crown Copyright 2013 - 2015, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | 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 applica... | unknown | codeparrot/codeparrot-clean | ||
//===--- OutputFileMap.cpp - Map of inputs to multiple outputs ------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... | cpp | github | https://github.com/apple/swift | lib/Basic/OutputFileMap.cpp |
type CartesianInput = readonly unknown[][]
type CartesianResult<T extends CartesianInput> = T extends [
infer Head extends unknown[],
...infer Tail extends CartesianInput,
]
? [Head[number], ...CartesianResult<Tail>]
: []
export function* cartesian<T extends CartesianInput>(...sets: T): Generator<CartesianRes... | typescript | github | https://github.com/tailwindlabs/tailwindcss | packages/tailwindcss/src/cartesian.ts |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 ~ 2012 Deepin, Inc.
# 2011 ~ 2012 Hou Shaohui
#
# Author: Hou Shaohui <houshao55@gmail.com>
# Maintainer: Hou Shaohui <houshao55@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | unknown | codeparrot/codeparrot-clean | ||
"""
Django admin dashboard configuration.
"""
from config_models.admin import ConfigurationModelAdmin, KeyedConfigurationModelAdmin
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from xblock_django.models import XBlockConfiguration, XBlockStudioConfiguration, XBlockStudioConf... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright 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.
"""Creates a grd file for packaging the trace-viewer files.
This file is modified from the devtools generate_devtools_grd.py file.
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2007 Google Inc.
# Licensed to PSF under a Contributor Agreement.
"""Unittest for ipaddress module."""
import unittest
import re
import contextlib
import operator
import ipaddress
class BaseTestCase(unittest.TestCase):
# One big change in ipaddress over the original ipaddr module is
# error repo... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
from django.db import models, migrations, connection
from django.conf import settings
# Translate the UserProfile fields back ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: UTF-8 -*-
try:
import unittest2 as unittest
except ImportError:
import unittest
import keypress_mock as kp
from colorama import Fore, Style
from term2048.board import Board
from term2048.game import Game
import sys
import os
from tempfile import NamedTemporaryFile
from os import remove
from help... | unknown | codeparrot/codeparrot-clean | ||
import os, enum
class MouseMoveReporting(enum.Enum):
NONE = 0
LEFT_CLICKED = 1
RIGHT_CLICKED = 2
LEFT_OR_RIGHT_CLICKED = 3
ALWAYS = 4
if os.environ.get('SAKURA_ENV', 'undef') == 'daemon':
SAKURA_DISPLAY_STREAMING = True
else:
SAKUR... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
'''
Ansible module for zabbix graphprototypes
'''
# vim: expandtab:tabstop=4:shiftwidth=4
#
# Zabbix graphprototypes ansible module
#
#
# Copyright 2015 Red Hat Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with t... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
***************************************************************************
r_blend_rgb.py
--------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
******************************... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright (c) 2011, Willow Garage, 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:
# * Redistributions of source code must retain the above copyright
# not... | unknown | codeparrot/codeparrot-clean | ||
#include "var_test.h"
namespace a{
int kGlobalInt = 1;
const char *const kGlobalStr = "Hello";
} | cpp | github | https://github.com/llvm/llvm-project | clang-tools-extra/test/clang-move/Inputs/var_test.cpp |
#[cfg(test)]
mod scanner {
use pretty_assertions::assert_eq;
use std::path::{Path, PathBuf};
use std::process::Command;
use std::thread::sleep;
use std::time::Duration;
use std::{fs, path};
use tailwindcss_oxide::*;
use tempfile::tempdir;
fn symlink<P: AsRef<Path>, Q: AsRef<Path>>(... | rust | github | https://github.com/tailwindlabs/tailwindcss | crates/oxide/tests/scanner.rs |
"""
This bootstrap module contains code for ensuring that the astropy_helpers
package will be importable by the time the setup.py script runs. It also
includes some workarounds to ensure that a recent-enough version of setuptools
is being used for the installation.
This module should be the first thing imported in th... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
#
# Copyright 2015 The Oppia 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 requi... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
from __future__ import division, absolute_import, print_function
# A simple script to test the installed version of numpy by calling
# 'numpy.test()'. Key features:
# -- convenient command-line syntax
# -- sets exit status appropriately, useful for automated test environments
# It would be b... | 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 | configuration-metadata/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/specific/StaticAccessor.java |
Variadic parameters have been used on a non-C ABI function.
Erroneous code example:
```compile_fail,E0045
extern "Rust" {
fn foo(x: u8, ...); // error!
}
```
Rust only supports variadic parameters for interoperability with C code in its
FFI. As such, variadic parameters can only be used with functions which are
... | unknown | github | https://github.com/rust-lang/rust | compiler/rustc_error_codes/src/error_codes/E0045.md |
#!/usr/bin/env python
# Copyright (c) 2009, Christian Kreutzer
# 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,
# ... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-framework | spring-context/src/main/java/org/springframework/scripting/bsh/BshScriptUtils.java |
from muntjac.api import VerticalLayout, Panel, Label, Button
from muntjac.ui.button import IClickListener
from muntjac.ui.themes import Reindeer
class PanelLightExample(VerticalLayout, IClickListener):
def __init__(self):
super(PanelLightExample, self).__init__()
self.setSpacing(True)
se... | unknown | codeparrot/codeparrot-clean | ||
test_kind: js_test
selector:
roots:
- buildscripts/tests/resmoke_end2end/failtestfiles/*.js
executor:
fixture:
class: MongoDFixture
mongod_options:
set_parameters:
enableTestCommands: 1 | unknown | github | https://github.com/mongodb/mongo | buildscripts/tests/resmoke_end2end/suites/resmoke_failing_javascript.yml |
<?php
namespace Illuminate\Support\Facades;
/**
* @method static \Illuminate\Http\Request capture()
* @method static \Illuminate\Http\Request instance()
* @method static string method()
* @method static \Illuminate\Support\Uri uri()
* @method static string root()
* @method static string url()
* @method static ... | php | github | https://github.com/laravel/framework | src/Illuminate/Support/Facades/Request.php |
#########################################################################################
# Condor.py
# 10.11.2014
# Author: A.T.
#########################################################################################
""" Condor.py is a DIRAC independent class representing Condor batch system.
Condor objects are... | unknown | codeparrot/codeparrot-clean | ||
import json
import xml.etree.ElementTree
from django.http import Http404
from django.http import HttpResponse
from edxmako.shortcuts import render_to_response
from .models import ServerCircuit
def circuit_line(circuit):
''' Returns string for an appropriate input element for a circuit.
TODO: Rename. '''... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/compiler/checkJsdocTypeTagOnExportAssignment4.ts] ////
//// [checkJsdocTypeTagOnExportAssignment4.js]
//// [a.js]
/**
* @typedef {number} Foo
*/
/** @type {Foo} */
export default "";
//// [checkJsdocTypeTagOnExportAssignment4.js]
"use strict";
//// [a.js]
"use strict";
/**
* @typedef {number} F... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/checkJsdocTypeTagOnExportAssignment4.js |
'''
This module is just for testing concepts. It should be erased later on.
Experiments:
// gdb -p 4957
// call dlopen("/home/fabioz/Desktop/dev/PyDev.Debugger/pydevd_attach_to_process/linux/attach_linux.so", 2)
// call dlsym($1, "hello")
// call hello()
// call open("/home/fabioz/Desktop/dev/PyDev.Debugger/pydevd_a... | unknown | codeparrot/codeparrot-clean | ||
import collections
import errno
import re
from hashlib import md5, sha1
import base64
from base64 import b64encode, b64decode
import socket
import struct
import logging
from socket import error as SocketError
import gevent
from gunicorn.workers.async import ALREADY_HANDLED
logger = logging.getLogger(__name__)
WS_KEY... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import os
import tempfile
import uuid
from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from d... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright (c) 2011 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.
"""Creates a zip archive with policy template files. The list of input files is
extracted from a grd file with grit. This is to kee... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
# Name: demos/monteverdi.py
# Purpose: Bellairs Workshop on Monteverdi Madrigals, Barbados, Feb 2011
#
# Authors: Michael Scott Cuthbert
#
# Copyright: Copyright © 2011 Michael Scott Cuthbert an... | 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/fs/LocalFileSystem.java |
import re
m = re.search('world', 'hello world')
assert m is not None
assert m.string == 'hello world'
assert m.groups() == ()
m = re.match('world', 'hello world')
assert m is None
m = re.match('hello', 'hello world')
assert m is not None
assert m.string == 'hello world'
assert m.groups() == ()
# Samples code in Pyt... | unknown | codeparrot/codeparrot-clean | ||
"""A service to proxy requests to resmoke."""
from typing import Any, Dict, List
import inject
import buildscripts.resmokelib.parser as _parser
import buildscripts.resmokelib.suitesconfig as _suiteconfig
class ResmokeProxyService:
"""A service to proxy requests to resmoke."""
@inject.autoparams()
def _... | python | github | https://github.com/mongodb/mongo | buildscripts/resmoke_proxy/resmoke_proxy.py |
/*
* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.client.engine.curl
import io.ktor.client.engine.*
import io.ktor.utils.io.*
import kotlinx.cinterop.*
import libcurl.*
// This function is thread unsafe!
// The man page asks t... | kotlin | github | https://github.com/ktorio/ktor | ktor-client/ktor-client-curl/desktop/src/io/ktor/client/engine/curl/Curl.kt |
#!/usr/bin/env python
__author__ = "Justin Kuczynski"
__copyright__ = "Copyright 2011, The QIIME Project"
__credits__ = ["Rob Knight", "Justin Kuczynski"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "justin kuczynski"
__email__ = "justinak@gmail.com"
"""Contains tests for beta_metrics functions.""... | unknown | codeparrot/codeparrot-clean | ||
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const WebpackError = require("../WebpackError");
/** @typedef {import("../Module")} Module */
class BuildCycleError extends WebpackError {
/**
* Creates an instance of BuildCycleError.
* @param {Mo... | javascript | github | https://github.com/webpack/webpack | lib/errors/BuildCycleError.js |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import frappe, os
import unittest, email
test_records = frappe.get_test_records('Email Account')
from frappe.core.doctype.communication.communication import make
from frappe.desk.form.load import get_attachments
from frappe.utils.... | unknown | codeparrot/codeparrot-clean | ||
"""
This page is in the table of contents.
The gts.py script is an import translator plugin to get a carving from an gts file.
An import plugin is a script in the interpret_plugins folder which has the function getCarving. It is meant to be run from the interpret tool. To ensure that the plugin works on platforms wh... | 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 applica... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import unittest
import exiftool
import warnings
import os
class TestExifTool(unittest.TestCase):
def setUp(self):
self.et = exiftool.ExifTool()
def tearDown(self):
if hasattr(self, "et"):
self.et.terminate()
i... | unknown | codeparrot/codeparrot-clean | ||
"""i18n and l10n support for git-cola"""
from __future__ import division, absolute_import, unicode_literals
import gettext as _gettext
import os
import sys
from cola import compat
from cola import core
from cola import resources
_null_translation = _gettext.NullTranslations()
# Python 3 compat
if not hasattr(_null_t... | unknown | codeparrot/codeparrot-clean | ||
""" This file shows 2 ways to fill union of triangulated surfaces:
You can either use union of 2 inGtsSurface predicates or
create union of surfaces using GTS calls first and use a single
isGtsSurface as predicate with the united surface.
The disadvantage of the predicate union | is that each sphere must fit whole in ... | unknown | codeparrot/codeparrot-clean | ||
#
# Secret Labs' Regular Expression Engine
#
# convert template to internal format
#
# Copyright (c) 1997-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support module for sre"""
import sys
import _sre
import sre_parse
from sre_constant... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright 2014 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.
"""Automated tests for many websites"""
import argparse
from environment import Environment
from websitetest import WebsiteTest
TE... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2015 The etcd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed t... | go | github | https://github.com/etcd-io/etcd | server/etcdserver/api/rafthttp/snapshot_sender.go |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.