code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
# encoding: utf-8
# Copyright 2008-2011 California Institute of Technology. ALL RIGHTS
# RESERVED. U.S. Government Sponsorship acknowledged.
from setuptools import setup, find_packages
import os.path
# Package data
# ------------
_name = 'edrn.rdf'
_version = '1.3.8'
_description = 'EDRN RDF S... | unknown | codeparrot/codeparrot-clean | ||
import unittest
from test.test_string._support import TStringBaseCase, fstring
class TestTString(unittest.TestCase, TStringBaseCase):
def test_string_representation(self):
# Test __repr__
t = t"Hello"
self.assertEqual(repr(t), "Template(strings=('Hello',), interpolations=())")
nam... | python | github | https://github.com/python/cpython | Lib/test/test_tstring.py |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import apps
from django.db import models
from django.db.models import Prefetch
class CommentPollQuerySet(models.QuerySet):
def unremoved(self):
return self.filter(is_removed=False)
def for_comment(self, comment):
... | unknown | codeparrot/codeparrot-clean | ||
__author__ = 'Simons'
from main import*
from nltk.corpus import stopwords
from collections import Counter
from nltk import*
import types
import tfidf
def preProcessReviews(list):
porter = nltk.PorterStemmer()
stop = stopwords.words("english")
temp = []
i = 0;
G = []
for row in list:
tok... | unknown | codeparrot/codeparrot-clean | ||
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | unknown | codeparrot/codeparrot-clean | ||
import os
# Plivo Auth ID and Auth Token
PLIVO_AUTH_ID = os.environ.get('PLIVO_AUTH_ID')
PLIVO_AUTH_TOKEN = os.environ.get('PLIVO_AUTH_TOKEN')
# Plivo Caller ID
PLIVO_CALLER_ID = os.environ.get('PLIVO_CALLER_ID', '')
# Wait announcement music when there is only 1 participant in the conference
HOLD_MUSIC = 'https://s... | 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/test/java/org/apache/kafka/common/network/NetworkTestUtils.java |
import operator
from django.db import DataError, InterfaceError
from django.db.backends.base.features import BaseDatabaseFeatures
from django.db.backends.postgresql.psycopg_any import is_psycopg3
from django.utils.functional import cached_property
class DatabaseFeatures(BaseDatabaseFeatures):
minimum_database_ver... | python | github | https://github.com/django/django | django/db/backends/postgresql/features.py |
import unittest
import numpy as np
import nipy.neurospin.group.displacement_field as df
def make_data(n=10, dim=20, r=5, mdim=15, maskdim=20, amplitude=10, noise=1, jitter=None, activation=False):
XYZvol = np.zeros((dim,dim,dim),int)
XYZ = np.array(np.where(XYZvol==0))
p = XYZ.shape[1]
#mask = np.ara... | 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 pytest
import sys
from nose.plugins.skip i... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_age_limit,
parse_iso8601,
)
class IndavideoEmbedIE(InfoExtractor):
_VALID_URL = r'https?://(?:(?:embed\.)?indavideo\.hu/player/video/|assets\.indavideo\.hu/swf/player\.swf... | unknown | codeparrot/codeparrot-clean | ||
import re
from django.db.backends import BaseDatabaseOperations
server_version_re = re.compile(r'PostgreSQL (\d{1,2})\.(\d{1,2})\.?(\d{1,2})?')
# This DatabaseOperations class lives in here instead of base.py because it's
# used by both the 'postgresql' and 'postgresql_psycopg2' backends.
class DatabaseOperations(B... | unknown | codeparrot/codeparrot-clean | ||
# (c) 2016 Red Hat Inc.
#
# (c) 2017 Dell EMC.
#
# 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 vers... | unknown | codeparrot/codeparrot-clean | ||
# Authors: Manoj Kumar <manojkumarsivaraj334@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Joel Nothman <joel.nothman@gmail.com>
# License: BSD 3 clause
from __future__ import division
import warnings
from math import sqrt
import numpy as np
from scipy import sparse
fro... | unknown | codeparrot/codeparrot-clean | ||
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2022 Meta Platforms authors and The HuggingFace Team. 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
#
# U... | python | github | https://github.com/huggingface/transformers | src/transformers/models/flava/processing_flava.py |
"""
Copyright 2008, 2009 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion 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 (at your option) any ... | unknown | codeparrot/codeparrot-clean | ||
"""Default tags used by the template system, available to all templates."""
import re
import sys
import warnings
from collections import namedtuple
from collections.abc import Iterable, Mapping
from datetime import datetime
from itertools import cycle as itertools_cycle
from itertools import groupby
from django.conf ... | python | github | https://github.com/django/django | django/template/defaulttags.py |
from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.query_constructors.tencentvectordb import (
TencentVectorDBTranslator,
)
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raisin... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/retrievers/self_query/tencentvectordb.py |
# frozen_string_literal: true
# :markup: markdown
require "action_dispatch/http/mime_type"
module AbstractController
module Collector
def self.generate_method_for_mime(mime)
sym = mime.is_a?(Symbol) ? mime : mime.to_sym
class_eval <<-RUBY, __FILE__, __LINE__ + 1
def #{sym}(...)
cu... | ruby | github | https://github.com/rails/rails | actionpack/lib/abstract_controller/collector.rb |
#!/usr/bin/env python3
# Copyright (c) 2017-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test getblockstats rpc call
#
from test_framework.test_framework import BitcoinTestFramework
from tes... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
werkzeug.formparser
~~~~~~~~~~~~~~~~~~~
This module implements the form parsing. It supports url-encoded forms
as well as non-nested multipart uploads.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more deta... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2014-2019 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.client.engine.jetty
import io.ktor.client.engine.*
import org.eclipse.jetty.http2.client.*
import org.eclipse.jetty.util.ssl.*
/**
* A configuration for the [Jetty] client e... | kotlin | github | https://github.com/ktorio/ktor | ktor-client/ktor-client-jetty/jvm/src/io/ktor/client/engine/jetty/JettyEngineConfig.kt |
#![allow(non_snake_case)]
use std::ffi::{CStr, CString};
use std::num::NonZero;
use std::ptr;
use std::string::FromUtf8Error;
use libc::c_uint;
use rustc_abi::{AddressSpace, Align, Size, WrappingRange};
use rustc_llvm::RustString;
pub(crate) use self::CallConv::*;
pub(crate) use self::CodeGenOptSize::*;
pub(crate) u... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_codegen_llvm/src/llvm/mod.rs |
# Copyright (c) 2005-2010 Resolver Systems Ltd, PythonAnywhere LLP
# See LICENSE.md
#
try:
import unittest2 as unittest
except ImportError:
import unittest
from sheet.parser.parse_node import ParseNode
from sheet.parser.fl_cell_reference_parse_node import FLCellReferenceParseNode
from sheet.parser.fl_referenc... | unknown | codeparrot/codeparrot-clean | ||
use crate::spec::{
Arch, Cc, CodeModel, LinkerFlavor, Lld, Os, PanicStrategy, RelocModel, SanitizerSet, Target,
TargetMetadata, TargetOptions, cvs,
};
pub(crate) fn target() -> Target {
Target {
data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
metadata: TargetMetadata {
... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_target/src/spec/targets/riscv64imac_unknown_nuttx_elf.rs |
#![feature(core_intrinsics, alloc_error_handler, lang_items)]
#![no_std]
#![no_main]
#![allow(internal_features)]
extern crate alloc;
extern crate alloc_system;
use alloc::boxed::Box;
use alloc_system::System;
#[global_allocator]
static ALLOC: System = System;
#[link(name = "c")]
extern "C" {
fn puts(s: *const... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_codegen_gcc/example/alloc_example.rs |
{
"HELP": {
"summary": "Returns helpful text about the different subcommands.",
"complexity": "O(1)",
"group": "pubsub",
"since": "6.2.0",
"arity": 2,
"container": "PUBSUB",
"function": "pubsubCommand",
"command_flags": [
"LOADING",
... | json | github | https://github.com/redis/redis | src/commands/pubsub-help.json |
####################################################################################################
#
# PyDvi - A Python Library to Process DVI Stream.
# Copyright (C) 2011 Salvaire Fabrice
#
####################################################################################################
#########################... | unknown | codeparrot/codeparrot-clean | ||
"""
A number of functions that enhance IDLE on macOS.
"""
from os.path import expanduser
import plistlib
from sys import platform # Used in _init_tk_type, changed by test.
import tkinter
## Define functions that query the Mac graphics type.
## _tk_type and its initializer are private to this section.
_tk_type = Non... | python | github | https://github.com/python/cpython | Lib/idlelib/macosx.py |
from UnitTest import UnitTest
import random
from math import log, exp, sqrt, pi
try:
from math import fsum as msum
except:
# fsum is new in 2.6
from math import fabs
def msum(x):
xx = [(fabs(v), i) for i, v in enumerate(x)]
xx.sort()
sum = 0
for i in xx:
sum ... | unknown | codeparrot/codeparrot-clean | ||
import React, { ElementType, Fragment, Ref } from "react";
import { Video } from "./Video";
import { Image } from "./Image";
import { StaticImageData } from "next/image";
import { Media as MediaType } from "../../payload-types";
export type Props = {
src?: StaticImageData; // for static media
alt?: string;
resou... | typescript | github | https://github.com/vercel/next.js | examples/cms-payload/components/Media/index.tsx |
import sys
import re
import functools
import distutils.core
import distutils.errors
import distutils.extension
from .dist import _get_unpatched
from . import msvc9_support
_Extension = _get_unpatched(distutils.core.Extension)
msvc9_support.patch_for_specialized_compiler()
def have_pyrex():
"""
Return True i... | unknown | codeparrot/codeparrot-clean | ||
/*
* regfree - free an RE
*
* Copyright (c) 1998, 1999 Henry Spencer. All rights reserved.
*
* Development of this software was funded, in part, by Cray Research Inc.,
* UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics
* Corporation, none of whom are responsible for the results. The aut... | c | github | https://github.com/postgres/postgres | src/backend/regex/regfree.c |
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package statekeys
import (
"strings"
)
// rawKeyBuilder is a helper for building multi-field keys in the format
// that's expected by [cutKeyField].
//
// The zero value of rawKeyBuilder is ready to use.
type rawKeyBuilder struct {
b strings.Bui... | go | github | https://github.com/hashicorp/terraform | internal/stacks/stackstate/statekeys/key_build.go |
// Adapted from https://github.com/withastro/cli-kit
// MIT License Copyright (c) 2022 Nate Moore
import process from "node:process";
import readline from "node:readline";
import { erase, cursor } from "sisteransi";
import { reverse, sleep, color } from "./utils";
const GRADIENT_COLORS: Array<`#${string}`> = [
"#ff... | typescript | github | https://github.com/remix-run/react-router | packages/create-react-router/loading-indicator.ts |
from requests.adapters import HTTPAdapter
from .controller import CacheController
from .cache import DictCache
class CacheControlAdapter(HTTPAdapter):
invalidating_methods = set(['PUT', 'DELETE'])
def __init__(self, cache=None, cache_etags=True, controller_class=None,
serializer=None, *args,... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2021 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/compiler/mlir/lite/experimental/tac/common/cost.h |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains th... | unknown | codeparrot/codeparrot-clean | ||
"use strict";
/** @type {import("webpack").Configuration} */
const config = {
optimization: {
chunkIds: "deterministic" // To keep filename consistent between different modes (for example building only)
}
};
module.exports = config; | javascript | github | https://github.com/webpack/webpack | examples/code-splitting-harmony/webpack.config.js |
"use strict";
const { describeCases } = require("./TestCases.template");
describe("TestCases", () => {
describeCases({
name: "normal"
});
}); | javascript | github | https://github.com/webpack/webpack | test/TestCasesNormal.basictest.js |
/*
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.analysis.api.standalone.fir.test.cases.generated.cases.components.expressionInfoP... | java | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-standalone/tests-gen/org/jetbrains/kotlin/analysis/api/standalone/fir/test/cases/generated/cases/components/expressionInfoProvider/FirStandaloneNormalAnalysisSourceModuleWhenMissingCasesTestGenerated.java |
"""Utility functions for killing the wrapper softly.
Copyright (C) 2013, Joshua More and Michele Ceriotti
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... | unknown | codeparrot/codeparrot-clean | ||
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | cpp | github | https://github.com/llvm/llvm-project | clang-tools-extra/clang-tidy/cppcoreguidelines/SpecialMemberFunctionsCheck.cpp |
# -*- coding: utf-8 -*-
__license__ = 'GPL 3'
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
import os
from calibre.customize.conversion import OutputFormatPlugin, \
OptionRecommendation
class TCROutput(OutputFormatPlugin):
name = 'TCR Output'
author ... | unknown | codeparrot/codeparrot-clean | ||
import logging
from lxml import etree
from pkg_resources import resource_string
from xmodule.x_module import XModule
from xmodule.raw_module import RawDescriptor
from xblock.fields import Scope, String
import textwrap
log = logging.getLogger(__name__)
class AnnotatableFields(object):
data = String(help="XML dat... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
# This file is part of BenchExec, a framework for reliable benchmarking:
# https://github.com/sosy-lab/benchexec
#
# SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org>
#
# SPDX-License-Identifier: Apache-2.0
import collections
import functools
import os
import re
# CONSTANTS
# categorization of ... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright 2019 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/controller/volume/protectionutil/utils.go |
/*
* Copyright 2014-2019 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.server.routing
import io.ktor.http.*
import io.ktor.server.application.*
import io.ktor.server.request.*
import io.ktor.server.response.*
import io.ktor.util.*
import kotlinx.... | kotlin | github | https://github.com/ktorio/ktor | ktor-server/ktor-server-core/common/src/io/ktor/server/routing/RoutingPipelineCall.kt |
# Copyright 2009 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Language pack store."""
__metaclass__ = type
__all__ = [
'LanguagePack',
'LanguagePackSet',
]
from sqlobject import ForeignKey
from zope.interface import implemen... | unknown | codeparrot/codeparrot-clean | ||
"""
34. Generic relations
Generic relations let an object have a foreign key to any object through a
content-type/object-id field. A ``GenericForeignKey`` field can point to any
object, be it animal, vegetable, or mineral.
The canonical example is tags (although this example implementation is *far*
from complete).
""... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""
/**
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you 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:... | unknown | codeparrot/codeparrot-clean | ||
from meowth.core.data_manager import schema
def setup(bot):
lang_table = bot.dbi.table('languages')
lang_table.new_columns = [
schema.IDColumn('language_id', primary_key=True),
schema.StringColumn('iso639', required=True),
schema.StringColumn('iso3166', required=True),
schema.St... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | unknown | codeparrot/codeparrot-clean | ||
# 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.
import logging
from telemetry.core import exceptions
from telemetry.core import util
from telemetry.core import web_contents
class Oobe(web_contents.WebCon... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2012 Google Inc.
#
# 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, dis-
# trib... | unknown | codeparrot/codeparrot-clean | ||
def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
interface _Promise {};
interface A {
legacycaller Promise<any> foo();
};
""")
results = parser.finish()
except:
threw = True
harness.ok(threw,
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | unknown | codeparrot/codeparrot-clean | ||
A link was used without a name parameter.
Erroneous code example:
```compile_fail,E0459
#[link(kind = "dylib")] extern "C" {}
// error: `#[link(...)]` specified without `name = "foo"`
```
Please add the name parameter to allow the rust compiler to find the library
you want. Example:
```no_run
#[link(kind = "dylib",... | unknown | github | https://github.com/rust-lang/rust | compiler/rustc_error_codes/src/error_codes/E0459.md |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>, and others
# 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 errno
import... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import unittest
import tools
class MyPlugin(object):
def __init__(self):
self.app = None
self.add_args = {}
self.add_content = ''
def setup(self, app):
self.app = app
def apply(self, func, config):
def wrapper(*a, **ka):
ka.updat... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright 2014 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... | go | github | https://github.com/kubernetes/kubernetes | pkg/volume/metrics_nil.go |
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package vault
import (
"context"
"errors"
"fmt"
"os"
"strings"
"time"
"github.com/armon/go-metrics"
"github.com/hashicorp/vault/helper/metricsutil"
"github.com/hashicorp/vault/helper/namespace"
"github.com/hashicorp/vault/helper/pluginc... | go | github | https://github.com/hashicorp/vault | vault/core_metrics.go |
'''
Offset test cases
'''
import unittest
import utils
def suite():
suite = unittest.TestSuite()
suite.addTest(Offset1TestCase())
suite.addTest(Offset2TestCase())
suite.addTest(Offset3TestCase())
suite.addTest(Offset4TestCase())
suite.addTest(Offset5TestCase())
suite.addTest(Offset6TestCase())
return suite
c... | unknown | codeparrot/codeparrot-clean | ||
#-*- encoding:utf-8 -*-
from django.db import models
import datetime
from django.utils.text import slugify
class Customer(models.Model):
customer_name = models.CharField(max_length=128,
blank=True, null=True,
verbose_name='Nombre',
help_text='Ingrese el Nombre Completo.')
customer_slug = models.SlugField(max_... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
## Amazon S3 manager
## Author: Michal Ludvig <michal@logix.cz>
## http://www.logix.cz/michal
## License: GPL Version 2
## Copyright: TGRMN Software and contributors
import os
import sys
import time
import re
import string
import random
import errno
from calendar import timegm
from log... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# LexGen.py - implemented 2002 by Neil Hodgson neilh@scintilla.org
# Released to the public domain.
# Regenerate the Scintilla and SciTE source files that list
# all the lexers and all the properties files.
# Should be run whenever a new lexer is added or removed.
# Requires Python 2.4 or later
#... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
import diff
import models
def _MakeSym(section, size, path, name=None, container=None):
if name is None:
# Tra... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from django.http import HttpResponse, HttpResponseRedirect
from django.contrib.auth.decorators import login_required
from django.shortcuts import render_to_response
from datetime import datetime, date, timedelta
from chambres.models import Chambre, Souci, Client, Reservation, Tache, Amour, Cache... | unknown | codeparrot/codeparrot-clean | ||
// SPDX-License-Identifier: GPL-2.0-only
#define pr_fmt(fmt) "%s: " fmt, __func__
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/wait.h>
#include <linux/slab.h>
#include <linux/mm.h>
#include <linux/percpu-refcount.h>
/*
* Initially, a percpu refcount is just a set of percpu counters. Initially, ... | c | github | https://github.com/torvalds/linux | lib/percpu-refcount.c |
# Helper to create files with unique contents
# Create multiple files with unique contents within this test run. Takes the
# number of directories, the number of files in each directory, and the base
# directory.
#
# test_create_unique_files 2 3 my_dir -- Creates 2 directories with 3 files
# each in my_dir, all w... | unknown | github | https://github.com/git/git | t/lib-unique-files.sh |
env:
SMART_RETRIES: "true"
steps:
- group: platform-support-unix
steps:
- label: "{{matrix.image}} / platform-support-unix"
command: .ci/scripts/run-gradle.sh --continue -Dbwc.checkout.align=true functionalTests
timeout_in_minutes: 420
matrix:
setup:
image:
... | unknown | github | https://github.com/elastic/elasticsearch | .buildkite/pipelines/periodic-platform-support.yml |
# Copyright 2012-2013 STACKOPS TECHNOLOGIES S.L.
#
# 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 applic... | unknown | codeparrot/codeparrot-clean | ||
import unittest
from test import support
import collections, random, string
import gc, weakref
class DictTest(unittest.TestCase):
def test_invalid_keyword_arguments(self):
class Custom(dict):
pass
for invalid in {1 : 2}, Custom({1 : 2}):
with self.assertRaises(TypeError):
... | unknown | codeparrot/codeparrot-clean | ||
# 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.
# Based on:
# http://src.chromium.org/viewvc/blink/trunk/Source/build/scripts/template_expander.py
import imp
import inspect
import os.path
import sys
# Di... | unknown | codeparrot/codeparrot-clean | ||
"""About Dialog for IDLE
"""
import os
import sys
import webbrowser
from platform import python_version, architecture
from tkinter import Toplevel, Frame, Label, Button, PhotoImage
from tkinter import SUNKEN, TOP, BOTTOM, LEFT, X, BOTH, W, EW, NSEW, E
from idlelib import textview
pyver = python_version()
if sys.pl... | python | github | https://github.com/python/cpython | Lib/idlelib/help_about.py |
#!/usr/bin/env python
import os
from app import create_app, db
from app.models import (
User,
Role,
Agency,
Permission,
IncidentReport,
EditableHTML
)
from flask.ext.script import Manager, Shell
from flask.ext.migrate import Migrate, MigrateCommand
from flask.ext.rq import get_worker
from app.pa... | 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 | ||
# Copyright 2019 Brian Quinlan
#
# 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 by applicable law or agreed to in writin... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import pytest
from netmiko import ConnectHandler
from DEVICE_CREDS import *
def setup_module(module):
module.EXPECTED_RESPONSES = {
'base_prompt' : 'openstack-rb5',
'config_mode' : '(config)',
}
net_connect = ConnectHandler(**brocade_vdx)
# Enter enable mode... | unknown | codeparrot/codeparrot-clean | ||
"""Test Home Assistant color util methods."""
import pytest
import voluptuous as vol
import homeassistant.util.color as color_util
GAMUT = color_util.GamutType(
color_util.XYPoint(0.704, 0.296),
color_util.XYPoint(0.2151, 0.7106),
color_util.XYPoint(0.138, 0.08),
)
GAMUT_INVALID_1 = color_util.GamutType(
... | unknown | codeparrot/codeparrot-clean | ||
import requests
from roboronya.plugins.plugin import Plugin
from roboronya.config import URBAN_DICT_URL,URBAN_DICT_RANDOM_URL
class Knowledge(Plugin):
description = 'Wanna learn the meaning of something? Ask Roboronya, she knows. For a specific meaning use /whatis <words>, or use /whatis for a random meaning.'
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright 2009, 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 | ||
"""Helper class to quickly write a loop over all standard input files.
Typical use is:
import fileinput
for line in fileinput.input():
process(line)
This iterates over the lines of all files listed in sys.argv[1:],
defaulting to sys.stdin if the list is empty. If a filename is '-' it
is also replace... | unknown | codeparrot/codeparrot-clean | ||
import collections
import itertools
import re
import sys
import warnings
from bs4.dammit import EntitySubstitution
DEFAULT_OUTPUT_ENCODING = "utf-8"
PY3K = (sys.version_info[0] > 2)
whitespace_re = re.compile("\s+")
def _alias(attr):
"""Alias one attribute name to another for backward compatibility"""
@prope... | unknown | codeparrot/codeparrot-clean | ||
---
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
Title: CURLOPT_CONV_TO_NETWORK_FUNCTION
Section: 3
Source: libcurl
See-also:
- CURLOPT_CONV_FROM_NETWORK_FUNCTION (3)
- CURLOPT_CONV_FROM_UTF8_FUNCTION (3)
Protocol:
- All
Added-in: 7.15.4
---
# NAME
CURLOPT_CONV_TO_NET... | unknown | github | https://github.com/curl/curl | docs/libcurl/opts/CURLOPT_CONV_TO_NETWORK_FUNCTION.md |
import datetime
from django.conf import settings
from django.core.cache import cache
from django.db import models
from django.db.models import signals
from django.db.models.query import QuerySet
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from hashlib impo... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
jinja2.loaders
~~~~~~~~~~~~~~
Jinja loader classes.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
import weakref
from types import ModuleType
from os import path
try:
from hashlib import sha1
except Imp... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 | ||
/*
* 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/test/java/org/apache/kafka/common/security/oauthbearer/OAuthBearerSaslClientCallbackHandlerTest.java |
# -*- 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 | ||
#!/usr/bin/env python
import argparse
import csv
import pprint
import editdistance
parser = argparse.ArgumentParser()
parser.add_argument("members", help="members db csv")
parser.add_argument("pos", help="pos tsv")
parser.add_argument("output", help="output csv")
args = parser.parse_args()
pp = pprint.PrettyPrint... | unknown | codeparrot/codeparrot-clean | ||
/*
* pgp-decrypt.c
* OpenPGP decrypt.
*
* Copyright (c) 2005 Marko Kreen
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above cop... | c | github | https://github.com/postgres/postgres | contrib/pgcrypto/pgp-decrypt.c |
from __future__ import unicode_literals
from math import ceil
from django.db import IntegrityError, connection, models
from django.db.models.sql.constants import GET_ITERATOR_CHUNK_SIZE
from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature
from django.utils.six.moves import range
from .models import... | unknown | codeparrot/codeparrot-clean | ||
"""Support to interact with Remember The Milk."""
import json
import logging
import os
from rtmapi import Rtm, RtmRequestFailedException
import voluptuous as vol
from homeassistant.const import CONF_API_KEY, CONF_ID, CONF_NAME, CONF_TOKEN, STATE_OK
import homeassistant.helpers.config_validation as cv
from homeassista... | 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/InvalidTopicException.java |
{
"remainingCount": 5,
"deprecations": [
{
"message": "Some deprecation message.",
"file": "\/path\/to\/some\/file.php",
"line": 39,
"count": 3
},
{
"message": "An other deprecation message.",
"file": "\/path\/to\/an\/other\/file.php",
"line": 25,
"count":... | json | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/deprecations.json |
"""
awslimitchecker/tests/__init__.py
The latest version of this package is available at:
<https://github.com/jantman/awslimitchecker>
##############################################################################
Copyright 2015-2018 Jason Antman <jason@jasonantman.com>
This file is part of awslimitchecker, also... | 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 | promql/functions.go |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.