code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn scalbnf16(x: f16, n: i32) -> f16 {
super::generic::scalbn(x, n)
} | rust | github | https://github.com/nodejs/node | deps/crates/vendor/libm/src/math/scalbnf16.rs |
"""Functions that listen for event signals and queue up emails.
All triggered emails live here.
"""
from datetime import datetime
from modularodm import Q
from website import mails, settings
from framework.auth import signals as auth_signals
from website.project import signals as project_signals
from website.conferen... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Tests\Database;
use Illuminate\Database\Connection;
use Illuminate\Database\Query\Expression;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Schema\ForeignIdColumnDefinition;
use Illuminate\Database\Schema\Grammars\MariaDbGrammar;
use Illuminate\Database\Schema\MariaDbBui... | php | github | https://github.com/laravel/framework | tests/Database/DatabaseMariaDbSchemaGrammarTest.php |
import AsyncHTTPClient
extension Application.Clients.Provider {
public static var http: Self {
.init {
$0.clients.use {
$0.http.client.shared.delegating(to: $0.eventLoopGroup.next(), logger: $0.logger, byteBufferAllocator: $0.core.storage.allocator)
}
}
}... | swift | github | https://github.com/vapor/vapor | Sources/Vapor/HTTP/Client/Application+HTTP+Client.swift |
<?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\Component\DependencyInjection\Loader\Configurator;
use Symfony\... | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Resources/config/form_csrf.php |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bridge\Twig\Tests\Extension;
use PHPUnit\Framework\Attributes\D... | php | github | https://github.com/symfony/symfony | src/Symfony/Bridge/Twig/Tests/Extension/DumpExtensionTest.php |
from __future__ import annotations
import importlib
import sys
from typing import (
TYPE_CHECKING,
Literal,
overload,
)
import warnings
from pandas.util._exceptions import find_stack_level
from pandas.util.version import Version
if TYPE_CHECKING:
import types
# Update install.rst, actions-311-minim... | python | github | https://github.com/pandas-dev/pandas | pandas/compat/_optional.py |
"""SCons.Defaults
Builders and other things for the local site. Here's where we'll
duplicate the functionality of autoconf until we move it into the
installation procedure or use something like qmconf.
The code that reads the registry to find MSVC components was borrowed
from distutils.msvccompiler.
"""
#
# Copyri... | unknown | codeparrot/codeparrot-clean | ||
import datetime
import sys
from types import MethodType
from datashape import dshape
import pandas as pd
import pandas.util.testing as tm
import pytest
import numpy as np
from odo import into, append
from odo.backends.csv import CSV
from blaze import discover, transform
from blaze.compatibility import pickle
from bla... | unknown | codeparrot/codeparrot-clean | ||
// Copyright The Prometheus 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 w... | go | github | https://github.com/prometheus/prometheus | discovery/vultr/metrics.go |
#! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,re,traceback,sys
try:
import threading
except ImportError:
pass
else:
wlock=threading.Lock()
class sync_stream(object):
def __init__(self,stream):
self.stre... | unknown | codeparrot/codeparrot-clean | ||
from tkinter import *
from idlelib import macosxSupport
class ScrolledList:
default = "(None)"
def __init__(self, master, **options):
# Create top frame, with scrollbar and listbox
self.master = master
self.frame = frame = Frame(master)
self.frame.pack(fill="both", expand=1)
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
pygments.lexers.configs
~~~~~~~~~~~~~~~~~~~~~~~
Lexers for configuration file formats.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, default, words, bygro... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
from twisted.internet import reactor
from twisted.web import http
from twisted.web.proxy import Proxy, ProxyRequest, ProxyClientFactory, ProxyClient
from ImageFile import Parser
from StringIO import StringIO
class InterceptingProxyClient(ProxyClient):
def __init__(self, *args, **kwargs):
... | unknown | codeparrot/codeparrot-clean | ||
"""
Creates permissions for all installed apps that need permissions.
"""
from django.contrib.auth import models as auth_app
from django.db.models import get_models, signals
def _get_permission_codename(action, opts):
return u'%s_%s' % (action, opts.object_name.lower())
def _get_all_permissions(opts):
"Retur... | unknown | codeparrot/codeparrot-clean | ||
""" Views for a student's profile information. """
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django_countries import countries
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import login_required
from django.http import Http404
from d... | unknown | codeparrot/codeparrot-clean | ||
"""
Copyright 2009 55 Minutes (http://www.55minutes.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
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed t... | unknown | codeparrot/codeparrot-clean | ||
"""Unit testing for a CLI utility to initialize the local development database.
Unit testing for the command line based utility to initialize a local
development database. Requires pymox to run.
@author: A. Samuel Pottinger (samnsparky - Gleap LLC, 2013)
@author: Joanne Cheng (joannecheng - Colorado Code for Communit... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import print_function
import copy
import shutil
from datetime import timedelta
from functools import wraps
from json import loads
from textwrap import dedent
from unittest import SkipTest
from uuid import uuid4
import ddt
import django
import lxml.html
import mock
from django.... | unknown | codeparrot/codeparrot-clean | ||
'''
Context
=======
.. versionadded:: 1.8.0
.. warning::
This is experimental and subject to change as long as this warning notice
is present.
Kivy has a few "global" instances that are used directly by many pieces of the
framework: `Cache`, `Builder`, `Clock`.
TODO: document this module.
'''
__all__ = (... | unknown | codeparrot/codeparrot-clean | ||
import pytest
import search_journalctl
def canned_search_journalctl(get_log_output=None):
"""Create a search_journalctl object with canned get_log_output method"""
module = search_journalctl
if get_log_output:
module.get_log_output = get_log_output
return module
DEFAULT_TIMESTAMP = 1496341364
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# (c) 2013, Jesse Keating <jesse.keating@rackspace.com,
# Paul Durivage <paul.durivage@rackspace.com>,
# Matt Martz <matt@sivel.net>
#
# 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 Pu... | unknown | codeparrot/codeparrot-clean | ||
#
# Lines of Descendency Report - a plugin for Gramps, the GTK+/GNOME based
# genealogy program.
#
# This program is released under the MIT License.
# Cf. http://www.opensource.org/licenses/mit-license.php.
#
# Copyright (c) 2010, 2012 lcc <lcc.mailaddress@gmail.com>
#
# Permission is here... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2008 Princeton University
# Copyright (c) 2009 Advanced Micro Devices, 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 c... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Database\Eloquent;
class SoftDeletingScope implements Scope
{
/**
* All of the extensions to be added to the builder.
*
* @var string[]
*/
protected $extensions = ['Restore', 'RestoreOrCreate', 'CreateOrRestore', 'WithTrashed', 'WithoutTrashed', 'OnlyTrashed'];
... | php | github | https://github.com/laravel/framework | src/Illuminate/Database/Eloquent/SoftDeletingScope.php |
#
# The Python Imaging Library.
# $Id$
#
# EXIF tags
#
# Copyright (c) 2003 by Secret Labs AB
#
# See the README file for information on usage and redistribution.
#
##
# This module provides constants and clear-text names for various
# well-known EXIF tags.
##
##
# Maps EXIF tags to tag names.
TAGS = {
# possib... | unknown | codeparrot/codeparrot-clean | ||
'''
Created on Jan 18, 2013
@author: brian
'''
import openid
from openid.fetchers import HTTPFetcher, HTTPResponse
from urlparse import parse_qs
from django.conf import settings
from django.test import TestCase, LiveServerTestCase
from django.test.utils import override_settings
# from django.contrib.auth.models impor... | unknown | codeparrot/codeparrot-clean | ||
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/spec",
"types": [
"jasmine",
"node"
]
},
"files": [
"src/test.ts"
],
"include": [
"**/*.spec.ts",
"**/*.d.ts"
]
} | json | github | https://github.com/angular/angular | adev/src/content/examples/schematics-for-libraries/projects/my-lib/tsconfig.spec.json |
# frozen_string_literal: true
# :markup: markdown
module ActionDispatch
module Routing
# # Action Dispatch Routing PolymorphicRoutes
#
# Polymorphic URL helpers are methods for smart resolution to a named route call
# when given an Active Record model instance. They are to be used in combination
... | ruby | github | https://github.com/rails/rails | actionpack/lib/action_dispatch/routing/polymorphic_routes.rb |
# -*- coding: utf-8 -*-
"""
CSS plugins
"""
from hyde.plugin import CLTransformer, Plugin
from hyde.exceptions import HydeException
import os
import re
import subprocess
import sys
from fswrap import File
#
# Less CSS
#
class LessCSSPlugin(CLTransformer):
"""
The plugin class for less css
"""
def... | unknown | codeparrot/codeparrot-clean | ||
from langchain_classic.schema.runnable.retry import __all__
EXPECTED_ALL = ["RunnableRetry", "U"]
def test_all_imports() -> None:
assert set(__all__) == set(EXPECTED_ALL) | python | github | https://github.com/langchain-ai/langchain | libs/langchain/tests/unit_tests/schema/runnable/test_retry.py |
prelude: |
def bp_yield
yield
end
def bp_pass &b
bp_yield &b
end
benchmark:
vm_blockparam_pass: |
bp_pass{}
loop_count: 30000000 | unknown | github | https://github.com/ruby/ruby | benchmark/vm_blockparam_pass.yml |
# frozen_string_literal: true
require_relative "worker"
require_relative "installer/parallel_installer"
require_relative "installer/standalone"
require_relative "installer/gem_installer"
module Bundler
class Installer
attr_reader :post_install_messages, :definition
# Begins the installation process for Bun... | ruby | github | https://github.com/ruby/ruby | lib/bundler/installer.rb |
#[cfg_attr(target_os = "emscripten", ignore = "disabled on Emscripten")]
#[rustversion::attr(not(nightly), ignore = "requires nightly")]
#[cfg_attr(miri, ignore = "incompatible with miri")]
#[allow(unused_attributes)]
#[test]
fn ui() {
let t = trybuild::TestCases::new();
t.compile_fail("tests/ui/**/*.rs");
} | rust | github | https://github.com/serde-rs/serde | test_suite/tests/compiletest.rs |
#!/usr/bin/env python
import json
import struct
import sys
import zlib
try:
xrange # Python 2
PY2 = True
except NameError:
PY2 = False
xrange = range # Python 3
if __name__ == '__main__':
with open(sys.argv[1]) as fp:
obj = json.load(fp)
text = json.dumps(obj, separators=(',', ':'))... | python | github | https://github.com/nodejs/node | tools/compress_json.py |
"""
This module contains tests for the pulp_node.resources module.
"""
import unittest
from pulp.common import config
import mock
from pulp_node import resources
class TestParentBindings(unittest.TestCase):
"""
This class contains tests for the parent_bindings() function.
"""
@mock.patch('pulp_node.r... | unknown | codeparrot/codeparrot-clean | ||
"""engine.SCons.Variables.ListVariable
This file defines the option type for SCons implementing 'lists'.
A 'list' option may either be 'all', 'none' or a list of names
separated by comma. After the option has been processed, the option
value holds either the named list elements, all list elemens or no
list elements a... | unknown | codeparrot/codeparrot-clean | ||
"""Pure-Python AES implementation."""
from cryptomath import *
from AES import *
from rijndael import rijndael
def new(key, mode, IV):
return Python_AES(key, mode, IV)
class Python_AES(AES):
def __init__(self, key, mode, IV):
AES.__init__(self, key, mode, IV, "python")
self.rijndael = rijnda... | unknown | codeparrot/codeparrot-clean | ||
use super::prelude::*;
pub(crate) struct PathParser;
impl<S: Stage> SingleAttributeParser<S> for PathParser {
const PATH: &[Symbol] = &[sym::path];
const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepOutermost;
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::WarnButFutureError;
const ALLOWED... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_attr_parsing/src/attributes/path.rs |
# Copyright 2009-2010 Gregory P. Ward
# Copyright 2009-2010 Intelerad Medical Systems Incorporated
# Copyright 2010-2011 Fog Creek Software
# Copyright 2010-2011 Unity Technologies
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
'... | unknown | codeparrot/codeparrot-clean | ||
#### Note: this error code is no longer emitted by the compiler.
`async` non-`move` closures with parameters are currently not supported.
Erroneous code example:
```edition2018
fn main() {
let add_one = async |num: u8| {
num + 1
};
}
```
`async` with non-move is currently not supported with the curr... | unknown | github | https://github.com/rust-lang/rust | compiler/rustc_error_codes/src/error_codes/E0708.md |
from setuptools import setup, find_packages
setup(name='restosaur',
version='0.6.8',
description='Damn simple RESTful library',
classifiers=[
"Development Status :: 3 - Alpha",
"Environment :: Web Environment",
"Framework :: Django",
"Framework :: Django :: 1.6",
... | unknown | codeparrot/codeparrot-clean | ||
/*-------------------------------------------------------------------------
*
* hba.c
* Routines to handle host based authentication (that's the scheme
* wherein you authenticate a user by seeing what IP address the system
* says he comes from and choosing authentication method based on it).
*
* Portions C... | c | github | https://github.com/postgres/postgres | src/backend/libpq/hba.c |
#!/usr/bin/env python3
"""Convert a DECam crosstalk text table into LSST CrosstalkCalibs.
"""
import argparse
import numpy as np
import os.path
import sys
import lsst.ip.isr as ipIsr
from lsst.daf.base import PropertyList
from lsst.obs.decam import DecamMapper
def makeDetectorCrosstalk(dataDict, force=False):
"""... | unknown | codeparrot/codeparrot-clean | ||
# A parallelized "find(1)" using the thread module.
# This demonstrates the use of a work queue and worker threads.
# It really does do more stats/sec when using multiple threads,
# although the improvement is only about 20-30 percent.
# (That was 8 years ago. In 2002, on Linux, I can't measure
# a speedup. :-( )
# ... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
class Possession < ActiveRecord::Base
self.table_name = "having"
end | ruby | github | https://github.com/rails/rails | activerecord/test/models/possession.rb |
#!/usr/bin/python
# Copyright: 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | unknown | codeparrot/codeparrot-clean | ||
package distribution
import (
"context"
"errors"
"strings"
"syscall"
"testing"
"github.com/docker/distribution/registry/api/errcode"
"github.com/docker/distribution/registry/client"
)
var errUnexpected = errors.New("some totally unexpected error")
var alwaysContinue = []error{
&client.UnexpectedHTTPResponse... | go | github | https://github.com/moby/moby | daemon/internal/distribution/errors_test.go |
// Copyright The Prometheus 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 w... | go | github | https://github.com/prometheus/prometheus | tsdb/agent/db.go |
//// [tests/cases/compiler/ambientExternalModuleWithoutInternalImportDeclaration.ts] ////
//// [ambientExternalModuleWithoutInternalImportDeclaration_0.ts]
declare module 'M' {
namespace C {
export var f: number;
}
class C {
foo(): void;
}
export = C;
}
//// [ambientExternalModule... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/ambientExternalModuleWithoutInternalImportDeclaration.js |
# -*- coding: utf-8 -*-
# Copyright (c) 2019 Ansible Project
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import re
from ansible.module_utils.six import iteritems
SIZE_... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-framework | spring-beans/src/main/java/org/springframework/beans/factory/BeanIsNotAFactoryException.java |
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: MPL-2.0
package keysutil
import (
"context"
"encoding/base64"
"errors"
"math/big"
paths "path"
"sort"
"strings"
lru "github.com/hashicorp/golang-lru"
"github.com/hashicorp/vault/sdk/logical"
)
const (
// DefaultCacheSize is used if no cache siz... | go | github | https://github.com/hashicorp/vault | sdk/helper/keysutil/encrypted_key_storage.go |
# -*- coding: utf-8 -*-
from distutils.version import LooseVersion
import json
import django
from django.contrib.sites.models import Site
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template.context import RequestContext
from django.utils.encoding import smart_str
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2008 Resolver Systems Ltd
#
# 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, publi... | unknown | codeparrot/codeparrot-clean | ||
from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import setup
class WidthRatioTagTests(SimpleTestCase):
libraries = {"custom": "template_tests.templatetags.custom"}
@setup({"widthratio01": "{% widthratio a b 0 %}"})
def test_widthratio01(self):
o... | python | github | https://github.com/django/django | tests/template_tests/syntax_tests/test_width_ratio.py |
#!/usr/bin/env python
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright 2017-present Iain Cambridge.
#
# Licensed under the MIT License(the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# https://opensource.org/licenses/MIT
#
# Unless required by applicable law or agreed to in... | unknown | codeparrot/codeparrot-clean | ||
import {
AccessorDeclaration,
canHaveDecorators,
cast,
ClassLikeDeclaration,
concatenate,
ConstructorDeclaration,
DeclarationName,
Diagnostics,
factory,
FileTextChanges,
findAncestor,
getDecorators,
getEffectiveModifierFlags,
getFirstConstructorWithBody,
getLo... | typescript | github | https://github.com/microsoft/TypeScript | src/services/codefixes/generateAccessors.ts |
use crate::spec::{Arch, StackProbeType, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::teeos::opts();
base.features = "+strict-align,+neon".into();
base.max_atomic_width = Some(128);
base.stack_probes = StackProbeType::Inline;
Target {
llvm_target: "... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_target/src/spec/targets/aarch64_unknown_teeos.rs |
//===--- OperatorNameLookup.cpp - Operator and Precedence Lookup *- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2020 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.... | cpp | github | https://github.com/apple/swift | lib/AST/OperatorNameLookup.cpp |
from tornado import gen
from . import spotifyMix as spot
from lib.database.auth import save_token
from lib.basehandler import OAuthRequestHandler
class SpotifyAuth(OAuthRequestHandler, spot.SpotifyOAuth2Mixin):
scope = [
'playlist-read-private',
'playlist-read-collaborative',
'user-follow-... | unknown | codeparrot/codeparrot-clean | ||
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\... | c | github | https://github.com/curl/curl | docs/examples/ftpuploadfrommem.c |
"""
routines for computing rates from one subset of a graph to another
"""
import itertools
from collections import defaultdict
import networkx as nx
import numpy as np
def kmcgraph_from_rates(rates):
"""create a graph for input to GraphReduction from a dictionary of rates
Parameters
----------
rates... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/env python3
"""
The Python Debugger Pdb
=======================
To use the debugger in its simplest form:
>>> import pdb
>>> pdb.run('<a statement>')
The debugger's prompt is '(Pdb) '. This will stop in the first
function call in <a statement>.
Alternatively, if a statement terminated ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
"""
Michael DeHaan <mdehaan@fedoraproject.org>, 2008
This software may be freely redistributed under the terms of the GNU
general public license.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-11-29 04:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tournament', '0112_auto_20161127_1814'),
]
operations = [
migrations.AddField(
model_name='alternate',
... | unknown | codeparrot/codeparrot-clean | ||
from django.shortcuts import render
from django import forms
import models
from bigtree import BigTree
from db_cbs_kv import CBS
from operator import itemgetter
import operator
class FormBuildsSelector(forms.Form):
def __init__(self, *args, **kwargs):
builds_choices = self.get_build_choices()
basel... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | unknown | codeparrot/codeparrot-clean | ||
import traceback
from couchpotato.core.helpers.encoding import toUnicode, tryUrlencode
from couchpotato.core.logger import CPLog
from couchpotato.core.notifications.base import Notification
log = CPLog(__name__)
autoload = 'Toasty'
class Toasty(Notification):
urls = {
'api': 'http://api.supertoasty.com... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
require "cases/helper"
require "models/topic"
require "models/person"
class InclusionValidationTest < ActiveModel::TestCase
def teardown
Topic.clear_validators!
end
def test_validates_inclusion_of_range
Topic.validates_inclusion_of(:title, in: "aaa".."bbb")
assert_pre... | ruby | github | https://github.com/rails/rails | activemodel/test/cases/validations/inclusion_validation_test.rb |
/*
Copyright 2017 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/cm/internal_container_lifecycle.go |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2018, 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",
"st... | unknown | codeparrot/codeparrot-clean | ||
"""Configuration classes."""
from __future__ import absolute_import, print_function
import os
import sys
from lib.util import (
CommonConfig,
is_shippable,
docker_qualify_image,
)
from lib.metadata import (
Metadata,
)
class EnvironmentConfig(CommonConfig):
"""Configuration common to all comman... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (C) 2011 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 | android/guava/src/com/google/common/util/concurrent/AsyncFunction.java |
## Input
```javascript
import {useNoAlias} from 'shared-runtime';
function useFoo(props: {value: {x: string; y: string} | null}) {
const value = props.value;
return useNoAlias(value?.x, value?.y) ?? {};
}
export const FIXTURE_ENTRYPONT = {
fn: useFoo,
props: [{value: null}],
};
```
## Code
```javascript
i... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/optional-call-chain-in-logical-expr.expect.md |
"""
The potential fields of a triaxial ellipsoid.
"""
from __future__ import division
import numpy as np
from scipy import linalg
from ..constants import SI2MGAL, G, CM, T2NT, SI2EOTVOS, PERM_FREE_SPACE
from .. import utils
import scipy.special
def bx_c(xp,yp,zp,inten,inc,dec,ellipsoids):
'''
Calculates the... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
import functools
import inspect
import re
from httpretty import HTTPretty
from .responses import metadata_response
from .utils import convert_regex_to_flask_path
class MockAWS(object):
nested_count = 0
def __init__(self, backends):
self.backends = backends
... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package terraform
import (
"fmt"
"log"
"time"
"github.com/hashicorp/hcl/v2"
"github.com/zclconf/go-cty/cty"
"github.com/hashicorp/terraform/internal/addrs"
"github.com/hashicorp/terraform/internal/configs"
"github.com/hashicorp/terraform/... | go | github | https://github.com/hashicorp/terraform | internal/terraform/evaluate.go |
/*-------------------------------------------------------------------------
*
* execExpr.c
* Expression evaluation infrastructure.
*
* During executor startup, we compile each expression tree (which has
* previously been processed by the parser and planner) into an ExprState,
* using ExecInitExpr() et al. Thi... | c | github | https://github.com/postgres/postgres | src/backend/executor/execExpr.c |
#!/usr/bin/env python
# Copyright (c) 2014 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.
"""Tests for analyzer
"""
import TestGyp
found = 'Found dependency\n'
not_found = 'No dependencies\n'
def __CreateTestFile(files):
f = o... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | unknown | codeparrot/codeparrot-clean | ||
version: 2.0.0
filters:
- "*":
approvers:
- 10gen/devprod-correctness
- "/bazel*":
approvers:
- 10gen/devprod-build
- "/compile*":
approvers:
- 10gen/devprod-build
- "/failed_unittests_gather.sh":
approvers:
- 10gen/devprod-build
- "/generate_clang_tidy_report.py":
... | unknown | github | https://github.com/mongodb/mongo | evergreen/OWNERS.yml |
#include "test/jemalloc_test.h"
#include "jemalloc/internal/ticker.h"
TEST_BEGIN(test_ticker_tick) {
#define NREPS 2
#define NTICKS 3
ticker_t ticker;
int32_t i, j;
ticker_init(&ticker, NTICKS);
for (i = 0; i < NREPS; i++) {
for (j = 0; j < NTICKS; j++) {
expect_u_eq(ticker_read(&ticker), NTICKS - j,
... | c | github | https://github.com/redis/redis | deps/jemalloc/test/unit/ticker.c |
'''
Created on Dec 1, 2011
@author: t4aalton
'''
from socialDevices.device import precondition, body, deviceInterface
import time
from socialDevices.misc import TriggeringEvent
class CalendarEvent:
def __init__(self, eid, subject, location, time):
self.eid = eid
self.subject = subject
self... | unknown | codeparrot/codeparrot-clean | ||
#include "ruby.h"
#define init(n) {void Init_##n(VALUE klass); Init_##n(klass);}
static VALUE
sym_find(VALUE dummy, VALUE sym)
{
return rb_check_symbol(&sym);
}
static VALUE
sym_pinneddown_p(VALUE dummy, VALUE sym)
{
ID id = rb_check_id(&sym);
if (!id) return Qnil;
#ifdef ULL2NUM
return ULL2NUM(id);
... | c | github | https://github.com/ruby/ruby | ext/-test-/symbol/init.c |
from cvxopt import matrix, spmatrix
from chompack.misc import symmetrize
from itertools import chain
def maxchord(A, ve = None):
"""
Maximal chordal subgraph of sparsity graph.
Returns a lower triangular sparse matrix which is the projection
of :math:`A` on a maximal chordal subgraph and a perfect
... | unknown | codeparrot/codeparrot-clean | ||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
from twitter import json, TwitterError # TwitterError not used
class UserStatus(object):
"""A class representing the UserStatus structure used by the twitter API.
The UserStatus structure exposes the following properties:
userstatus.name
userstatus.id_str
userstatus.... | unknown | codeparrot/codeparrot-clean | ||
{
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v2beta1",
"metadata": {
"name": "v0alpha1.mysql_unittest.v42"
},
"spec": {
"annotations": [
{
"kind": "AnnotationQuery",
"spec": {
"query": {
"kind": "DataQuery",
"group": "",
... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/conversion/testdata/output/migrated_dev_dashboards/datasource-mysql/v0alpha1.mysql_unittest.v42.v2beta1.json |
"""Unit tests for host collections.
:Requirement: Hostcollection
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: HostCollections
:Assignee: swadeley
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from random import choice
from random import randint
import pytest
from broker imp... | unknown | codeparrot/codeparrot-clean | ||
from optparse import make_option
from django.core.management import BaseCommand
from corehq.apps.change_feed.consumer.feed import KafkaChangeFeed
from corehq.apps.change_feed.exceptions import UnavailableKafkaOffset
from corehq.apps.change_feed.topics import validate_offsets
from pillowtop import get_all_pillow_instanc... | unknown | codeparrot/codeparrot-clean | ||
import os
ROBOT_LISTENER_API_VERSION = '2'
OUTFILE = open(os.path.join(os.getenv('TEMPDIR'), 'listener_attrs.txt'), 'w')
START_ATTRS = 'doc starttime '
END_ATTRS = START_ATTRS + 'endtime elapsedtime status '
KW_ATTRS = 'args assign kwname libname type'
EXPECTED_TYPES = {'elapsedtime': (int, long), 'tags': list, 'args... | unknown | codeparrot/codeparrot-clean | ||
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def DVSFeatureCapability(vim, *args, **kwargs):
'''Dataobject representing the feature cap... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_http.h>
typedef struct {
ngx_uint_t hash_max_size;
ngx_uint_t hash_bucket_size;
} ngx_http_map_conf_t;
typedef struct {
ngx_hash_keys_arrays_t ... | c | github | https://github.com/nginx/nginx | src/http/modules/ngx_http_map_module.c |
//===------- DifferentiationMangler.h --------- differentiation -*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... | c | github | https://github.com/apple/swift | include/swift/SILOptimizer/Utils/DifferentiationMangler.h |
#!/usr/bin/env python
# coding:utf-8
# manning 2015-1-27
import lxml.html
import urlparse
import time
import sys
sys.path.append("..")
from fetch import fetcher
from config.config import *
from node import UrlNode,HtmlNode
def timestamp():
return str(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
def cra... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright 2021 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... | go | github | https://github.com/kubernetes/kubernetes | cmd/kubeadm/app/phases/controlplane/main_test.go |
# -*- coding: utf-8 -*-
"""
This is the common settings file, intended to set sane defaults. If you have a
piece of configuration that's dependent on a set of feature flags being set,
then create a function that returns the calculated value based on the value of
FEATURES[...]. Modules that extend this one can change th... | unknown | codeparrot/codeparrot-clean | ||
"""
Classes to support "biological sequence" files.
:Author: Bob Harris (rsharris@bx.psu.edu)
"""
# DNA reverse complement table
DNA_COMP = " - " \
" TVGH CD M KN YSA BWXR tvgh cd m kn ysa bwxr " \
" ... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.