code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
from django.test import TestCase
from django.db.backends import BaseDatabaseWrapper
class DummyDatabaseWrapper(BaseDatabaseWrapper):
pass
class DummyObject(object):
alias = None
class DbBackendTests(TestCase):
def test_compare_db_wrapper_with_another_object(self):
wrapper = BaseDatabaseWrapper({}... | 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/podautoscaler/config/v1alpha1/conversion.go |
---
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-rest.html
applies_to:
stack: ga
serverless: ga
products:
- id: elasticsearch
---
# SQL REST API [sql-rest]
* [Overview](sql-rest-overview.md)
* [Response Data Formats](sql-rest-format.md)
* [Paginating through a large resp... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/query-languages/sql/sql-rest.md |
# Copyright 2015 IBM Corp.
#
# 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 | ||
// Copyright 2016 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 | etcdctl/ctlv3/command/make_mirror_command.go |
from __future__ import absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement
from django import forms
from django.conf.urls import url as urls_url
from django.contrib import admin
from django.contrib.admin import helpers
from django.contrib.admin.templatetags.admin_list... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2009 Søren Roug, European Environment Agency
#
# This is free software. You may redistribute it under the terms
# of the Apache license and the GNU General Public License Version
# 2 or at your option any later version.
#
# This program is distributed in t... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/conformance/classes/propertyMemberDeclarations/autoAccessor5.ts] ////
//// [autoAccessor5.ts]
class C1 {
accessor ["w"]: any;
accessor ["x"] = 1;
static accessor ["y"]: any;
static accessor ["z"] = 2;
}
declare var f: any;
class C2 {
accessor [f()] = 1;
}
//// [autoAccessor5.js]... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/autoAccessor5(target=esnext).js |
from datetime import datetime
from flask import redirect
from flask_security import Security, SQLAlchemyUserDatastore, \
UserMixin, RoleMixin, login_required
from app import inventory_labels, db, admin
roles_users = db.Table('roles_users',
db.Column('user_id', db.Integer, db.ForeignKey('User.id')),
... | unknown | codeparrot/codeparrot-clean | ||
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2010 Nick Hall
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any... | unknown | codeparrot/codeparrot-clean | ||
name: Bug Report
description: Report a bug
labels: [T-Bug]
body:
- type: markdown
attributes:
value: |
Please provide as much detail as you can so we have a better chance of fixing the bug quickly.
Thanks for your contribution to improve this project!
- type: dropdown
id: frequency
... | unknown | github | https://github.com/realm/realm-swift | .github/ISSUE_TEMPLATE/bug.yml |
def mul_even_odd(list1):
first_even = next((el for el in list1 if el%2==0),-1)
first_odd = next((el for el in list1 if el%2!=0),-1)
return (first_even*first_odd) | unknown | mbpp | ||
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
from math import sqrt, pi, cos, sin, acos, asin, fabs
import time
import espressopp
import logging
from mpi4py import MPI
# set parameters for simulations
seed = 654321 # seed for random
L = 50.6 # the length of simulation box
num_cha... | unknown | codeparrot/codeparrot-clean | ||
function Component(
x,
y = () => {
return x;
}
) {
return y();
}
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [],
}; | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.default-param-accesses-local.js |
#!/bin/python
#
# <<1>>:<<Dive into Python>>
#
# Here intruduce python built in data types.
# Notice, python only have directory, list, map as container. list could be
# use as vector, stack, heap and so on.
# number(int/float/double...), bool, string is basic data type.
# for number, only notice upcasting is OK.
# s... | unknown | codeparrot/codeparrot-clean | ||
import agents as ag
def HW2Agent() -> object:
x = 0
def program(percept):
bump, status = percept
lastAction = program.oldActions[-1]
prevAction = program.oldActions[-2]
# if lastAction == 'Suck':
# lastAction = prevAction
if status == 'Dirty':
action ... | unknown | codeparrot/codeparrot-clean | ||
import rest_framework.views
import rest_framework.response
from .models import get_product_details_history
from fjord.base.utils import smart_str
class EventAPI(rest_framework.views.APIView):
def get(self, request):
events = get_product_details_history()
products = smart_str(request.GET.get('prod... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/python
import os
import sys
import glob
import optparse
import tempfile
import logging
import shutil
import ConfigParser
class Fail(Exception):
def __init__(self, test, msg):
self.msg = msg
self.test = test
def getMsg(self):
return '\'%s\' - %s' % (self.test.path, self.msg)... | unknown | codeparrot/codeparrot-clean | ||
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: https://opensource.org/licenses/mit-license.php
# Also licenced under the Apache License, 2.0: https://opensource.org/licenses/apache2.0.php
# Licensed to PSF under a Contributor Agreement
"""
Middlewar... | python | github | https://github.com/python/cpython | Lib/wsgiref/validate.py |
# Check every path through every method of UserDict
from test import test_support, mapping_tests
import UserDict
d0 = {}
d1 = {"one": 1}
d2 = {"one": 1, "two": 2}
d3 = {"one": 1, "two": 3, "three": 5}
d4 = {"one": None, "two": None}
d5 = {"one": 1, "two": 1}
class UserDictTest(mapping_tests.TestHashMappingProtocol):... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2009 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 flag_test
import (
"bytes"
. "flag"
"fmt"
"internal/testenv"
"io"
"os"
"os/exec"
"regexp"
"runtime"
"slices"
"strconv"
"strings"
"testing"... | go | github | https://github.com/golang/go | src/flag/flag_test.go |
import unittest
from ctypes import *
import _ctypes_test
dll = CDLL(_ctypes_test.__file__)
try:
CALLBACK_FUNCTYPE = WINFUNCTYPE
except NameError:
# fake to enable this test on Linux
CALLBACK_FUNCTYPE = CFUNCTYPE
class POINT(Structure):
_fields_ = [("x", c_int), ("y", c_int)]
class BasicWrapTestCase(... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2012 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 | ||
<?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\NodeVisitor;
use PHPUnit\Framework\TestCase;
... | php | github | https://github.com/symfony/symfony | src/Symfony/Bridge/Twig/Tests/NodeVisitor/ScopeTest.php |
"""
Plot the scaling of the nearest neighbors algorithms with k, D, and N
"""
from time import time
import numpy as np
import pylab as pl
from matplotlib import ticker
from sklearn import neighbors, datasets
def get_data(N, D, dataset='dense'):
if dataset == 'dense':
np.random.seed(0)
return np.r... | unknown | codeparrot/codeparrot-clean | ||
<table border="1" class="dataframe">
<thead>
<tr>
<th>foo</th>
<th colspan="2" halign="left">a</th>
<th>...</th>
<th colspan="2" halign="left">b</th>
</tr>
<tr>
<th></th>
<th colspan="2" halign="left">c</th>
<th>...</th>
<th colspan="2" halign="left">d</th>
... | html | github | https://github.com/pandas-dev/pandas | pandas/tests/io/formats/data/html/trunc_df_index_none_columns_named_multi.html |
# 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 json
import os
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
from telemetry import story
__location__ =... | 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 | ||
from __future__ import unicode_literals
from django.conf import settings
from django.db.backends import BaseDatabaseOperations
class DatabaseOperations(BaseDatabaseOperations):
def __init__(self, connection):
super(DatabaseOperations, self).__init__(connection)
def date_extract_sql(self, lookup_type,... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Bitbang'd SPI interface with an MCP3008 ADC device
# MCP3008 is 8-channel 10-bit analog to digital converter
# Connections are:
# CLK => SCLK
# DOUT => MISO
# DIN => MOSI
# CS => CE0
import time
import sys
import spidev
spi = spidev.SpiDev()
spi.open(0,0)
spi.max_speed_hz =... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# Copyright (C) 2010-2014 GRNET S.A.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This progr... | 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/test/java/org/apache/hadoop/service/ServiceAssert.java |
<?php
namespace Illuminate\Support\Facades;
use Illuminate\Filesystem\Filesystem;
use function Illuminate\Support\enum_value;
/**
* @method static \Illuminate\Contracts\Filesystem\Filesystem drive(string|null $name = null)
* @method static \Illuminate\Contracts\Filesystem\Filesystem disk(\UnitEnum|string|null $na... | php | github | https://github.com/laravel/framework | src/Illuminate/Support/Facades/Storage.php |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Thierry Sallé (@seuf)
# 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
ANSIBLE_METADATA = {
'status': ['preview'],
'supported_by': 'com... | unknown | codeparrot/codeparrot-clean | ||
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
/** @typedef {import("./config/defaults").WebpackOptionsNormalizedWithDefaults} WebpackOptions */
/** @typedef {import("./config/normalization").WebpackOptionsInterception} WebpackOptionsInterception */
/... | javascript | github | https://github.com/webpack/webpack | lib/OptionsApply.js |
# -*- coding: utf-8 -*-
import datetime
import logging
import os
import socket
from urlparse import urlparse
from django.utils.functional import lazy
import dj_database_url
import djcelery
from heka.config import client_from_dict_config
from mpconstants import mozilla_languages
from mkt import asset_bundles
#######... | unknown | codeparrot/codeparrot-clean | ||
{
"apiVersion": "v1",
"groupVersion": "apps/v1",
"kind": "APIResourceList",
"resources": [
{
"kind": "ControllerRevision",
"name": "controllerrevisions",
"namespaced": true,
"singularName": "controllerrevision",
"storageVersionHash": "85nkx63pcBU=",
"verbs": [
"cr... | json | github | https://github.com/kubernetes/kubernetes | api/discovery/apis__apps__v1.json |
import unittest
import pysal
from pysal.core.IOHandlers.gwt import GwtIO
import tempfile
import os
import warnings
class test_GwtIO(unittest.TestCase):
def setUp(self):
self.test_file = test_file = pysal.examples.get_path('juvenile.gwt')
self.obj = GwtIO(test_file, 'r')
def test_close(self):
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2012 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.
"""Runs spaceport.io's PerfMarks benchmark."""
import logging
import os
from core import perf_benchmark
from telemetry import benchmark
from telemetry.cor... | unknown | codeparrot/codeparrot-clean | ||
import sys
from django.conf import settings
from django.core.management.base import BaseCommand
from django.core.management.utils import get_command_line_option
from django.test.utils import get_runner
class Command(BaseCommand):
help = 'Discover and run tests in the specified modules or the current directory.'
... | unknown | codeparrot/codeparrot-clean | ||
"""Suite Standard Suite: Common terms that most applications should support
Level 1, version 1
Generated from /System/Library/CoreServices/Finder.app
AETE/AEUT resource version 0/144, language 0, script 0
"""
import aetools
import MacOS
_code = 'CoRe'
from StdSuites.Standard_Suite import *
class Standard_Suite_Even... | unknown | codeparrot/codeparrot-clean | ||
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | c | github | https://github.com/llvm/llvm-project | clang-tools-extra/clang-tidy/google/AvoidUnderscoreInGoogletestNameCheck.h |
# -*- coding: utf-8 -*-
"""
Created on Fri May 27 14:55:33 2016
@author: sheldon
"""
from pydub import AudioSegment
import glob
from math import ceil
import os
import json
import csv
import sys
import speech_recognition as sr
r = sr.Recognizer()
directory = sys.argv[1]
os.chdir(directory)
def transcribe_mp3(AUDIO_... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import, division, unicode_literals
import six
from mock import Mock
from . import support
def _createReprMock(r):
"""Creates a mock with a __repr__ returning r
Also provides __str__ mock with default mock behaviour"""
mock = Mock()
mock.__repr__ = Mock()
mock.__re... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2014 Nippon Telegraph and Telephone Corporation.
#
# 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 appli... | 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/serialization/IntegerSerializer.java |
# Copyright (c) 2007-2008 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware imp... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 ... | unknown | codeparrot/codeparrot-clean | ||
import struct
import array
class proto_env:
id = 0
name = "env"
size = 4
bytesize = 33
hash = "a7c9bdbae9b7c692af5d65a935fa8c78"
meta = (("time",1,"double"),("camera",3,"double"),)
def __init__(self):
self.time = 0.0;
self.camera = array.array('d',[0 for i in range(0,3)]);
def decode(self,data):
if len(da... | 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... | kotlin | github | https://github.com/spring-projects/spring-framework | framework-docs/src/main/kotlin/org/springframework/docs/dataaccess/jdbc/jdbccomplextypes/TestItem.kt |
import unittest
try:
import Queue
except:
import queue as Queue #@UnresolvedImport
from pydevd_constants import * #@UnusedWildImport
import pydev_runfiles_xml_rpc
import time
import os
#=======================================================================================================================
# Fla... | unknown | codeparrot/codeparrot-clean | ||
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | unknown | codeparrot/codeparrot-clean | ||
import { makeExecutableSchema } from "@graphql-tools/schema";
import { typeDefs } from "./type-defs";
import { resolvers } from "./resolvers";
export const schema = makeExecutableSchema({
typeDefs,
resolvers,
}); | typescript | github | https://github.com/vercel/next.js | examples/api-routes-apollo-server-and-client-auth/apollo/schema.ts |
/*
* Copyright (c) Facebook, Inc. and its affiliates.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <arm_neon.h>
#include <qnnpack/q8dwconv.h>
void pytorch_q8dwconv_ukernel_mp8x25_per_channe... | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/quantized/cpu/qnnpack/src/q8dwconv/mp8x25-neon-per-channel.c |
/*!
* 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... | typescript | github | https://github.com/apache/airflow | airflow-core/src/airflow/ui/src/components/SearchDags/SearchDagsDropdownIndicator.tsx |
# -*- coding: utf-8 -*-
from email.header import decode_header
from email.utils import formataddr
import logging
from openerp import _, api, fields, models, SUPERUSER_ID
from openerp import tools
from openerp.exceptions import UserError, AccessError
_logger = logging.getLogger(__name__)
def decode(text):
"""Ret... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Simple translation model and language model data structures
import sys
from collections import namedtuple
# A translation model is a dictionary where keys are tuples of French words
# and values are lists of (english, logprob) named tuples. For instance,
# the French phrase "que se est" has two... | unknown | codeparrot/codeparrot-clean | ||
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts] ////
//// [classExtendsEveryObjectType.ts]
interface I {
foo: string;
}
class C extends I { } // error
class C2 extends { foo: string; } { } // error
declare var x: { foo: string; }
class C3 extends ... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/classExtendsEveryObjectType.js |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# 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) an... | unknown | codeparrot/codeparrot-clean | ||
import type { ParserOptions } from '../src/options'
import { ErrorCodes } from '../src/errors'
import {
type CommentNode,
ConstantTypes,
type DirectiveNode,
type ElementNode,
ElementTypes,
type InterpolationNode,
Namespaces,
NodeTypes,
type Position,
type TextNode,
} from '../src/ast'
import { base... | typescript | github | https://github.com/vuejs/core | packages/compiler-core/__tests__/parse.spec.ts |
"""
Settings and configuration for Django.
Values will be read from the module specified by the DJANGO_SETTINGS_MODULE environment
variable, and then from django.conf.global_settings; see the global settings file for
a list of all possible variables.
"""
import importlib
import os
import time
from django.conf import... | unknown | codeparrot/codeparrot-clean | ||
#include <ATen/native/quantized/AffineQuantizer.h>
namespace at::native {
DEFINE_DISPATCH(quantize_tensor_per_tensor_affine_stub);
DEFINE_DISPATCH(quantize_tensor_per_channel_affine_stub);
DEFINE_DISPATCH(quantize_tensor_per_channel_float_qparams_stub);
DEFINE_DISPATCH(dequantize_tensor_per_tensor_affine_stub);
DEFIN... | cpp | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/quantized/AffineQuantizer.cpp |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2016-09-03 10:43
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
import wagtail.wagtailcore.fields
class Migration(migrations.Migration):
dependencies = [
('... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2010 OpenStack Foundation
# Copyright 2013 NTT corp.
# 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/LIC... | unknown | codeparrot/codeparrot-clean | ||
# (c) 2017, Juan Manuel Parrilla <jparrill@redhat.com>
# (c) 2012-17 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
author:
- Juan Manuel P... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
fix_xml_ampersands,
parse_duration,
qualities,
strip_jsonp,
unified_strdate,
url_basename,
)
class NPOBaseIE(InfoExtractor):
def _get_token(self, video_id):
token_page = self._download_w... | unknown | codeparrot/codeparrot-clean | ||
/*
* 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.server.routing
import io.ktor.server.application.*
/**
* Represents a single entry in the [RoutingResolveTrace].
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.k... | kotlin | github | https://github.com/ktorio/ktor | ktor-server/ktor-server-core/common/src/io/ktor/server/routing/RoutingResolveTrace.kt |
'''
Some simple tests to check that the framework is properly wrapped.
'''
import objc
import unittest
import QuickLookUI
class TestQuickLookUI (unittest.TestCase):
def testClasses(self):
pass
# self.assert_( hasattr(QuickLookUI, 'CLASSNAME') )
# self.assert_( isinstance(QuickLookUI.CLASSNA... | unknown | codeparrot/codeparrot-clean | ||
import json
from social.exceptions import AuthAlreadyAssociated
from social.tests.models import User
from social.tests.actions.actions import BaseActionTest
class AssociateActionTest(BaseActionTest):
expected_username = 'foobar'
def setUp(self):
super(AssociateActionTest, self).setUp()
self.... | unknown | codeparrot/codeparrot-clean | ||
# -*- test-case-name: twisted.python.test.test_shellcomp -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
No public APIs are provided by this module. Internal use only.
This module implements dynamic tab-completion for any command that uses
twisted.python.usage. Currently, only zsh is s... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Management script."""
import os
from glob import glob
from subprocess import call
from flask_migrate import Migrate, MigrateCommand
from flask_script import Command, Manager, Option, Server, Shell
from flask_script.commands import Clean, ShowUrls
from DVProcessing.app ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# 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.
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
//---------------------------------------------------------------------------//
// Copyright (c) 2013 Kyle Lutz <kyle.r.lutz@gmail.com>
//
// Distributed under the Boost Software License, Version 1.0
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//
// See http://boostorg.gi... | unknown | github | https://github.com/mysql/mysql-server | extra/boost/boost_1_87_0/boost/compute/program.hpp |
use rustc_hir as hir;
use rustc_macros::{LintDiagnostic, Subdiagnostic};
use rustc_session::{declare_lint, declare_lint_pass};
use rustc_span::Span;
use crate::{LateContext, LateLintPass};
declare_lint! {
/// The `closure_returning_async_block` lint detects cases where users
/// write a closure that returns a... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_lint/src/async_closures.rs |
# Copyright (c) 2013 Mirantis 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 law or agreed to in writi... | 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/AbstractListeningExecutorService.java |
#
# Copyright 2015 BMC Software, 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 law or agreed to in ... | unknown | codeparrot/codeparrot-clean | ||
"""Tests for the largest-series-product exercise
Implementation note:
In case of invalid inputs to the 'slices' or 'largest_product' functions
your program should raise a ValueError with a meaningful error message.
Feel free to reuse your code for the series exercise!
"""
import unittest
from series import largest_p... | unknown | codeparrot/codeparrot-clean | ||
#
# (c) 2016 Red Hat Inc.
#
# 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 d... | unknown | codeparrot/codeparrot-clean | ||
use anyhow::{Context, Result};
use bincode::{Decode, Encode};
use once_cell::sync::Lazy;
use regex::Regex;
use serde::Deserialize;
use turbo_rcstr::{RcStr, rcstr};
use turbo_tasks::{FxIndexMap, NonLocalValue, Vc, trace::TraceRawVcs};
use turbo_tasks_fs::FileSystemPath;
use turbopack_core::issue::{IssueExt, IssueSeverit... | rust | github | https://github.com/vercel/next.js | crates/next-core/src/next_font/google/font_fallback.rs |
* {
box-sizing: border-box;
padding: 0;
margin: 0;
}
html,
body {
max-width: 100vw;
overflow-x: hidden;
}
body {
color: #fff;
background: #000;
}
a {
color: #fff;
text-decoration: underline;
} | css | github | https://github.com/vercel/next.js | examples/cms-wordpress/src/app/globals.css |
# -*- coding: utf-8 -*-
import logging
if __name__ == '__main__':
logging.basicConfig()
_log = logging.getLogger(__name__)
import types
import datetime
import pyxb.binding.generate
import pyxb.binding.datatypes as xs
import os.path
xsd='''<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element n... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2001,2002 Python Software Foundation
# Author: barry@zope.com (Barry Warsaw)
"""Miscellaneous utilities.
"""
import time
import socket
import re
import random
import os
import warnings
from cStringIO import StringIO
from types import ListType
from email._parseaddr import quote
from email._parseaddr i... | unknown | codeparrot/codeparrot-clean | ||
#ifndef GC_GC_IMPL_H
#define GC_GC_IMPL_H
/**
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the condi... | c | github | https://github.com/ruby/ruby | gc/gc_impl.h |
from sympy import symbols
from sympy.physics.mechanics import dynamicsymbols
from sympy.physics.mechanics import ReferenceFrame, Point, Particle
from sympy.physics.mechanics import LagrangesMethod, Lagrangian
### This test asserts that a system with more than one external forces
### is acurately formed with Lagrange m... | unknown | codeparrot/codeparrot-clean | ||
import argparse
import datetime
from distutils.core import Command
from distutils.errors import DistutilsOptionError
class BuildManPage(Command):
"""
Add a ``build_manpage`` command to your setup.py.
To use this Command class add a command to call this class::
# For setuptools
setup(
... | unknown | codeparrot/codeparrot-clean | ||
# -*- encoding: utf-8 -*-
#################################################################################
# #
# Copyright (C) 2009 Renato Lima - Akretion #
# ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Sun OS Solaris platform implementation."""
import errno
import os
import socket
import subprocess
import sys
from collections im... | unknown | codeparrot/codeparrot-clean | ||
---
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
Long: create-dirs
Help: Create necessary local directory hierarchy
Category: output
Added: 7.10.3
Multi: boolean
See-also:
- ftp-create-dirs
- output-dir
Example:
- --create-dirs --output local/dir/file $URL
---
# `--cre... | unknown | github | https://github.com/curl/curl | docs/cmdline-opts/create-dirs.md |
// Copyright 2022 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
import (
"os"
"sync/atomic"
"time"
_ "unsafe"
)
// defaultNS is the default name servers to use in the absence of DNS configuration.
//
// def... | go | github | https://github.com/golang/go | src/net/dnsconfig.go |
{
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
},
"dependencies": {
"@makeswift/runtime": "0.10.13",
"next": "latest",
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"@types/node": "17.0.41",
"@types/react... | json | github | https://github.com/vercel/next.js | examples/cms-makeswift/package.json |
import pytest
from tests.support.asserts import assert_error, assert_files_uploaded, assert_success
from tests.support.inline import inline
from . import map_files_to_multiline_text
def element_send_keys(session, element, text):
return session.transport.send(
"POST", "/session/{session_id}/element/{eleme... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2015, Cisco Systems.
#
# 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 wri... | unknown | codeparrot/codeparrot-clean | ||
from scipy.interpolate import InterpolatedUnivariateSpline as interp
import os
import sys
import numpy as np
import DataStructures
import matplotlib.pyplot as plt
import Correlate
import FitsUtils
import FindContinuum
# import Units
from astropy import units, constants
import FittingUtilities
homedir = os.environ["... | 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 | ||
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 Lice... | unknown | codeparrot/codeparrot-clean | ||
import os
from captcha.fields import CaptchaField
from django import forms
from django.contrib.auth import get_user_model
from django.forms.forms import pretty_name
from django.forms.widgets import CheckboxFieldRenderer, RadioFieldRenderer
from django.utils.translation import ugettext_lazy as _
from django.utils.safest... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.