code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
# -*- coding: UTF-8 -*-
"""
Test libpython.py. This is already partly tested by test_libcython_in_gdb and
Lib/test/test_gdb.py in the Python source. These tests are run in gdb and
called from test_libcython_in_gdb.main()
"""
import os
import sys
import gdb
from Cython.Debugger import libcython
from Cython.Debugger ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env bash
# Copyright 2025 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 a... | unknown | github | https://github.com/etcd-io/etcd | scripts/build-binary.sh |
// Copyright 2018 The Abseil 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 by applicable law or agr... | c | github | https://github.com/mysql/mysql-server | extra/abseil/abseil-cpp-20230802.1/absl/container/internal/common.h |
# coding: utf-8
from __future__ import unicode_literals
import random
import re
from .common import InfoExtractor
from ..compat import compat_urllib_parse_unquote_plus
from ..utils import (
int_or_none,
float_or_none,
timeconvert,
update_url_query,
xpath_text,
)
class KUSIIE(InfoExtractor):
_... | unknown | codeparrot/codeparrot-clean | ||
import unittest
from hearthbreaker.cards import ArgentSquire, DireWolfAlpha, HarvestGolem, BloodfenRaptor, MagmaRager, Wisp, Ysera
from hearthbreaker.cards.spells.neutral import TheCoin
from tests.agents.trade.test_helpers import TestHelpers
from hearthbreaker.agents.trade.possible_play import PossiblePlays
from tests.... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2010-2025 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.renderer.declarations.superTypes
import org.jetbrains.kotlin.analys... | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api/src/org/jetbrains/kotlin/analysis/api/renderer/declarations/superTypes/KaSuperTypeRenderer.kt |
# stackish.py
#
# Stackish is a data representation syntax, similar to JSON or YAML. For more info on
# stackish, see http://www.savingtheinternetwithhate.com/stackish.html
#
# Copyright 2008, Paul McGuire
#
"""
NUMBER A simple integer type that's just any series of digits.
FLOAT A simple floating point type.
STRING ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright 2009,2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your ... | unknown | codeparrot/codeparrot-clean | ||
"""Example Zigbee Devices."""
DEVICES = [
{
"device_no": 0,
"endpoints": {
1: {
"device_type": 2080,
"endpoint_id": 1,
"in_clusters": [0, 3, 4096, 64716],
"out_clusters": [3, 4, 6, 8, 4096, 64716],
"profile_... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2021 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
//
// Code generated by generate-staticcheck; DO NOT EDIT.
//
//go:build bazel
package s1019
import (
util "github.com/cockroachdb/cockroach/pkg/testutils/lint/passes/... | go | github | https://github.com/cockroachdb/cockroach | build/bazelutil/staticcheckanalyzers/s1019/analyzer.go |
#!/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 | ||
import requests
from allauth.account.utils import get_next_redirect_url
from allauth.socialaccount.providers.oauth2.views import (OAuth2LoginView,
OAuth2CallbackView)
from allauth.socialaccount.providers.github.views import GitHubOAuth2Adapter
from kuma.core.u... | unknown | codeparrot/codeparrot-clean | ||
#ifndef HEADER_CURL_DYNHDS_H
#define HEADER_CURL_DYNHDS_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (... | c | github | https://github.com/curl/curl | lib/dynhds.h |
/*-------------------------------------------------------------------------
*
* pg_amcheck.c
* Detects corruption within database relations.
*
* Copyright (c) 2017-2026, PostgreSQL Global Development Group
*
* IDENTIFICATION
* src/bin/pg_amcheck/pg_amcheck.c
*
*---------------------------------------------... | c | github | https://github.com/postgres/postgres | src/bin/pg_amcheck/pg_amcheck.c |
## This file is part of Invenio.
## Copyright (C) 2013 CERN.
##
## Invenio 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 later version.
##
## Inv... | 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... | unknown | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/site/markdown/release/0.20.203.1/CHANGELOG.0.20.203.1.md |
//===-- LayoutConstraint.h - Layout constraints types and APIs --*- 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/AST/LayoutConstraint.h |
from __future__ import unicode_literals
from psycopg2.extras import Inet
from django.conf import settings
from django.db.backends.base.operations import BaseDatabaseOperations
class DatabaseOperations(BaseDatabaseOperations):
def unification_cast_sql(self, output_field):
internal_type = output_field.get_... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
#
# Requirements:
# sudo apt-get install python-argparse
import sys
import numpy
import argparse
import associate
def align_first(model,data):
numpy.set_printoptions(precision=3,suppress=True)
model_zerocentered = model - model.mean(1)
data_zerocentered = data - data.mean(1)
W = num... | unknown | codeparrot/codeparrot-clean | ||
/*
* 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)
*
* Copyright (c) 2020-2021 Andrey Semashev
*/
/*!
* \file atomic/atomic_ref.hpp
*
* This header contains definition of \c atomic_ref template.
*/
#ifn... | unknown | github | https://github.com/mysql/mysql-server | extra/boost/boost_1_87_0/boost/atomic/atomic_ref.hpp |
# -*- coding: utf-8 -*-
"""
***************************************************************************
v_proj.py
---------
Date : November 2017
Copyright : (C) 2017 by Médéric Ribreux
Email : medspx at medspx dot fr
****************************************... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
from ..utils import int_or_none
class PodomaticIE(InfoExtractor):
IE_NAME = 'podomatic'
_VALID_URL = r'^(?P<proto>https?)://(?P<channel>[^.]+)\.podomatic\.com/entry/(?P<id>[^?]+)'
_TESTS = [
{
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf8 -*-
import unittest
from lib.ots2_api_test_base import OTS2APITestBase
from ots2 import *
import lib.restriction as restriction
import copy
from collections import OrderedDict
from ots2.error import *
import math
import time
class RowOpTest(OTS2APITestBase):
"""行读写测试"""
# 行操作API: GetRow, P... | unknown | codeparrot/codeparrot-clean | ||
Previous change logs can be found at [CHANGELOG-3.x](https://github.com/etcd-io/etcd/blob/main/CHANGELOG/CHANGELOG-3.x.md).
---
## v4.0.0 (TBD)
See [code changes](https://github.com/etcd-io/etcd/compare/v3.5.0...v4.0.0) and [v4.0 upgrade guide](https://etcd.io/docs/latest/upgrades/upgrade_4_0/) for any breaking chan... | unknown | github | https://github.com/etcd-io/etcd | CHANGELOG/CHANGELOG-4.0.md |
"Test debugobj, coverage 40%."
from idlelib import debugobj
import unittest
class ObjectTreeItemTest(unittest.TestCase):
def test_init(self):
ti = debugobj.ObjectTreeItem('label', 22)
self.assertEqual(ti.labeltext, 'label')
self.assertEqual(ti.object, 22)
self.assertEqual(ti.setfu... | python | github | https://github.com/python/cpython | Lib/idlelib/idle_test/test_debugobj.py |
# Example app with MDX
This example shows using [MDX](https://github.com/mdx-js/mdx) as top level pages for your next.js app.
## Deploy your own
[](https://vercel.com/new/clone?repository-url=https://github.com/vercel/next.js/tree/canary/examples/mdx&project-name=mdx&r... | unknown | github | https://github.com/vercel/next.js | examples/mdx/README.md |
# SPDX-License-Identifier: GPL-2.0-only
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/qcom,gcc-mdm9607.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Qualcomm Global Clock & Reset Controller
maintainers:
- Stephen Boyd <sboyd@kernel.org>
- Taniya Das <quic_tdas@quicinc.com>
descript... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/clock/qcom,gcc-mdm9607.yaml |
#!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.com>
#
# 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
ANSI... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2025 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
package main
import (
"strings"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestParsePythonDict(t *testing.T) {
t... | go | github | https://github.com/cockroachdb/cockroach | build/tools/gen-cockroachdb-metrics/main_test.go |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Patrik Lundin <patrik@sigterm.se>
#
# 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 Lic... | unknown | codeparrot/codeparrot-clean | ||
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | unknown | codeparrot/codeparrot-clean | ||
/*
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/controller/certificates/certificate_controller_test.go |
---
title: Context
---
Context allows components to access values owned by parent components without passing them down as props (potentially through many layers of intermediate components, known as 'prop-drilling'). The parent component sets context with `setContext(key, value)`...
```svelte
<!--- file: Parent.svelte... | unknown | github | https://github.com/sveltejs/svelte | documentation/docs/06-runtime/02-context.md |
# (c) 2015, Brian Coca <bcoca@ansible.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 annotations
DOCUMENTATION = """
name: url
author: Brian Coca (@bcoca)
version_added: "1.9"
short_description: return contents from... | python | github | https://github.com/ansible/ansible | lib/ansible/plugins/lookup/url.py |
{
"browser": {
"a": "./a.js",
"b": "./b.js",
"c": "./c.js"
}
} | json | github | https://github.com/webpack/webpack | test/cases/loaders/issue-4959/package.json |
import unittest
from triangle import Triangle, TriangleError
class TriangleTests(unittest.TestCase):
def test_equilateral_triangles_have_equal_sides(self):
self.assertEqual("equilateral", Triangle(2, 2, 2).kind())
def test_larger_equilateral_triangles_also_have_equal_sides(self):
self.assertE... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
from __future__ import unicode_literals
import base64
from .common import InfoExtractor
from ..compat import compat_urllib_parse_unquote
from ..utils import (
int_or_none,
)
class MangomoloBaseIE(InfoExtractor):
def _get_real_id(self, page_id):
return page_id
def _real_extract(se... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2011, NEC Europe Ltd, Consorzio Nazionale
# Interuniversitario per le Telecomunicazioni, Institut
# Telecom/Telecom Bretagne, ETH Zuerich, INVEA-TECH a.s. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following... | unknown | codeparrot/codeparrot-clean | ||
"""
Backwards compatibility profile for serialization for persisted ansible-inventory output.
Behavior is equivalent to pre 2.18 `AnsibleJSONEncoder` with vault_to_text=True.
"""
from __future__ import annotations
from ... import _json
from . import _legacy
class _InventoryVariableVisitor(_legacy._LegacyVariableVisi... | python | github | https://github.com/ansible/ansible | lib/ansible/_internal/_json/_profiles/_inventory_legacy.py |
# Copyright 2021 The TensorFlow Probability 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 o... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.contrib.sites.models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Site',
fields=[
... | unknown | codeparrot/codeparrot-clean | ||
#
# ----------------------------------------------------------------------------------------------------
#
# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# u... | unknown | codeparrot/codeparrot-clean | ||
---
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
Long: ftp-port
Arg: <address>
Help: Send PORT instead of PASV
Short: P
Protocols: FTP
Category: ftp
Added: 4.0
Multi: single
See-also:
- ftp-pasv
- disable-eprt
Example:
- -P - ftp:/example.com
- -P eth0 ftp:/example.co... | unknown | github | https://github.com/curl/curl | docs/cmdline-opts/ftp-port.md |
#
# 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 | ||
from __future__ import print_function
import numpy as np
np.random.seed(1337)
from keras.utils.test_utils import get_test_data
from keras.models import Sequential
from keras.layers.core import Dense, Activation, TimeDistributedDense, Flatten
from keras.layers.recurrent import GRU
from keras.layers.convolutional import... | unknown | codeparrot/codeparrot-clean | ||
import argparse
import csv
import os
import json
def arguments():
parser = argparse.ArgumentParser()
parser.add_argument('-j', '--jsons', help = 'Path to JSON directory')
parser.add_argument('-o', '--out', help = 'CSV output file path.')
parser.add_argument('-t', '--test', help = 'Name of the MIST te... | 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 | ||
// Copyright 2025 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 | cache/store_test.go |
"""
DWF Python Example
Author: Digilent, Inc.
Revision: 2018-07-19
Requires:
Python 2.7, 3
"""
import numpy as np
import scipy.io.wavfile
import matplotlib.pyplot as plt
import ctypes
from ctypes import *
import sys
print("Load audio.WAV file")
rate, data = scipy.io.wavfile.read('audio.wav')
pri... | unknown | codeparrot/codeparrot-clean | ||
import time
import random
from multiprocessing import Process, Queue, current_process, freeze_support
#
# Function run by worker processes
#
def worker(input, output):
for func, args in iter(input.get, 'STOP'):
result = calculate(func, args)
output.put(result)
#
# Function used to calculate resu... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (c) 2007 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockito.internal.util.reflection;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.mockitoutil.TestBase;
@Suppres... | java | github | https://github.com/mockito/mockito | mockito-core/src/test/java/org/mockito/internal/util/reflection/FieldReaderTest.java |
#pragma once
#include <ATen/Tensor.h>
#include <utility>
namespace at::functionalization {
// See Note [Functionalization Pass In Core]
enum class InverseReturnMode {
/// Specifies that functional inverses should always return a view.
AlwaysView,
/// Specifies that functional inverses should always return a ... | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/FunctionalStorageImpl.h |
#!/usr/bin/env python
#-*- coding: UTF-8 -*-
#Ticloud web version 2.0
#author:WangRui
from protocol.proto_hardWareRequestServerOfforRebootInfo_pb2 import hardWareRequestServerOfforRebootInfo
from common.requestserver import RequestAgentManager
from common.configmanager import ConfigManager
from systemlog import SystemL... | unknown | codeparrot/codeparrot-clean | ||
## Input
```javascript
function component(a, b) {
let z = {a, b};
let x = function () {
console.log(z);
};
return x;
}
export const FIXTURE_ENTRYPOINT = {
fn: component,
params: ['TodoAdd'],
isComponent: 'TodoAdd',
};
```
## Code
```javascript
import { c as _c } from "react/compiler-runtime";
fun... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/prop-capturing-function-1.expect.md |
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | unknown | codeparrot/codeparrot-clean | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
from typing_extensions import Literal, TypedDict
__all__ = ["FileListParams"]
class FileListParams(TypedDict, total=False):
after: str
"""A cursor for use in pagination.
`after` is a... | python | github | https://github.com/openai/openai-python | src/openai/types/containers/file_list_params.py |
# Copyright (c) 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.
import getopt
import sys
from idl_log import ErrOut, InfoOut, WarnOut
OptionMap = { }
def GetOption(name):
if name not in OptionMap:
raise Runti... | unknown | codeparrot/codeparrot-clean | ||
<?php
// include_paths.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
$baseDir . '/lib',
$baseDir . '/src',
$vendorDir . '/a/a/lib1',
$vendorDir . '/a/a/src1',
$vendorDir . '/b/b/lib2',
$vendorDir . '/c/c/lib3',
); | php | github | https://github.com/composer/composer | tests/Composer/Test/Autoload/Fixtures/include_paths_functions.php |
# Copyright 2013 Yajie Miao Carnegie Mellon University
# 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
#
# THIS CODE IS PROVIDED *AS IS* B... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright 2018 Juca Crispim <juca@poraodojuca.net>
# This file is part of toxicbuild.
# toxicbuild is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Author: Alex Tereschenko <alext.mkrs@gmail.com>
# Copyright (c) 2016 Alex Tereschenko.
#
# 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, includin... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2022 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/core/tpu/kernels/tpu_embedding_load_retrieve_ops.h |
from __future__ import absolute_import, division, unicode_literals
from six import text_type, string_types
import gettext
_ = gettext.gettext
from xml.dom import Node
DOCUMENT = Node.DOCUMENT_NODE
DOCTYPE = Node.DOCUMENT_TYPE_NODE
TEXT = Node.TEXT_NODE
ELEMENT = Node.ELEMENT_NODE
COMMENT = Node.COMMENT_NODE
ENTITY =... | 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 | ||
#!/usr/bin/env python
"""
Your task is to complete the 'porsche_query' function and in particular the query
to find all autos where the manufacturer field matches "Porsche".
Please modify only 'porsche_query' function, as only that will be taken into account.
Your code will be run against a MongoDB instance that we ha... | 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 os
import unittest
from telemetry.core import util
from telemetry.internal.image_processing import frame_generator
from telemetry.internal.util impor... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright 2011, 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 | ||
interface ObjectConstructor {
/**
* Groups members of an iterable according to the return value of the passed callback.
* @param items An iterable.
* @param keySelector A callback which will be invoked for each item in items.
*/
groupBy<K extends PropertyKey, T>(
items: Iterable<T>,
... | typescript | github | https://github.com/microsoft/TypeScript | src/lib/es2024.object.d.ts |
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.core.urlresolvers import reverse
from django.http import Http404
from django.shortcuts import redirect, render
from django.views.generic.edit import CreateView
from django.db.models import Q
from d... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import with_statement
from nose.tools import assert_equal #@UnresolvedImport
from whoosh import analysis, classify, fields, formats
from whoosh.compat import u, text_type
from whoosh.filedb.filestore import RamStorage
domain = [u("A volume that is a signed distance field used for collision calculati... | unknown | codeparrot/codeparrot-clean | ||
'''
Created on May 19, 2011
@author: bungeman
'''
import os
import re
import math
# bench representation algorithm constant names
ALGORITHM_AVERAGE = 'avg'
ALGORITHM_MEDIAN = 'med'
ALGORITHM_MINIMUM = 'min'
ALGORITHM_25TH_PERCENTILE = '25th'
# Regular expressions used throughout.
PER_SETTING_RE = '([^\s=]+)(?:=(\S+... | unknown | codeparrot/codeparrot-clean | ||
"""
==================
Anscombe's Quartet
==================
"""
from __future__ import print_function
"""
Edward Tufte uses this example from Anscombe to show 4 datasets of x
and y that have the same mean, standard deviation, and regression
line, but which are qualitatively different.
matplotlib fun for a rainy day
... | unknown | codeparrot/codeparrot-clean | ||
from django.template.defaultfilters import cut
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class CutTests(SimpleTestCase):
@setup({'cut01': '{% autoescape off %}{{ a|cut:"x" }} {{ b|cut:"x" }}{% endautoescape %}'})
def test_cut01(self):
... | unknown | codeparrot/codeparrot-clean | ||
import argparse
import importlib.util
import sys
def _usage():
print("pytrack_generator_tests.py \
--module_path path/to/pytrack_generator.so \
--data_path path/to/omim/data \
--user_resource_path path/to/omim/data")
def _main():
parser = argparse.ArgumentParser()
parser.add_argument(
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import os
import sys
from redis import __version__
try:
from setuptools import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Simple class defining the windows.
:copyright:
Lion Krischer (krischer@geophysik.uni-muenchen.de), 2014
:license:
GNU General Public License, Version 3
(http://www.gnu.org/copyleft/gpl.html)
"""
from __future__ import (absolute_import, division, print_funct... | unknown | codeparrot/codeparrot-clean | ||
// SPDX-License-Identifier: GPL-2.0-only
#include <linux/blkdev.h>
#include <linux/slab.h>
struct bd_holder_disk {
struct list_head list;
struct kobject *holder_dir;
int refcnt;
};
static DEFINE_MUTEX(blk_holder_mutex);
static struct bd_holder_disk *bd_find_holder_disk(struct block_device *bdev,
struct... | c | github | https://github.com/torvalds/linux | block/holder.c |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from translate.lang import factory
def test_punctranslate():
"""Tests that we can translate punctuation."""
language = factory.getlanguage('fa')
assert language.punctranslate(u"") == u""
assert language.punctranslate(u"abc efg") == u"abc efg"
assert la... | unknown | codeparrot/codeparrot-clean | ||
from decimal import *
from django.db import models
from decimal import Decimal
class Invoice(models.Model):
invoice_number = models.CharField(max_length=32)
invoice_date = models.DateField()
invoice_comment = models.TextField()
def get_net_total(self):
line_items = Line_item.objects.select_related().filter(invo... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#-------------------------------------------------------------------------------
# FILE: mymail.py
# PURPOSE: send mail messages and receive commands via email
#
# AUTHOR: Jason G Yates
# DATE: 18-Nov-2016
#
# MODIFICATIONS:
#-----------------------------------------------------------------... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# coding:utf-8
# vi:tabstop=4:shiftwidth=4:expandtab:sts=4
import sys
sys.setrecursionlimit(50000)
from recurrent import *
import deepstacks
from deepstacks.macros import *
from deepstacks.lasagne import curr_layer,curr_stacks,curr_flags,curr_model
from operator import *
#import crossbatch_mom... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import unittest
from test import test_support
import errno
import socket
import select
import time
import traceback
import Queue
import sys
import os
import array
import contextlib
from weakref import proxy
import signal
import math
def try_address(host, port=0, family=socket.AF_INET):
"""T... | unknown | codeparrot/codeparrot-clean | ||
---
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
Short: A
Long: user-agent
Arg: <name>
Help: Send User-Agent <name> to server
Protocols: HTTP
Category: important http
Added: 4.5.1
Multi: single
See-also:
- header
- proxy-header
Example:
- -A "Agent 007" $URL
---
# `--u... | unknown | github | https://github.com/curl/curl | docs/cmdline-opts/user-agent.md |
# coding: utf-8
"""
=======
Presets
=======
This notebook demonstrates how to use the `presets` package to change the
default parameters for librosa.
"""
# Code source: Brian McFee
# License: ISC
##################################################
# We'll need numpy and matplotlib for this example
from __future__ imp... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Alexander Bulimov <lazywolf0@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 t... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-boot | core/spring-boot/src/main/java/org/springframework/boot/ssl/DefaultSslManagerBundle.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 | ||
from __future__ import absolute_import
import mimetypes
import os.path
import random
import re
import string
from django.conf import settings
from django.core.files.storage import default_storage
from django.template.defaultfilters import slugify
from django.utils.encoding import force_text
# Non-image file icons, m... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2012 NEC 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 applicable law or ag... | unknown | codeparrot/codeparrot-clean | ||
'''tzinfo timezone information for America/Indiana/Marengo.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Marengo(DstTzInfo):
'''America/Indiana/Marengo timezone definition. See datetime.tzinfo for details'''
zone = 'Am... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# ykpersonalize -ofixed=ccccccccccci -afcaa0c5bf2e83ec040e4aeb7f8565293 -ouid=1e7f1da7d6d1
from fedora.client import AccountSystem, AuthError
from getpass import getpass, getuser
import subprocess, sys, gettext
from optparse import OptionParser
t = gettext.translation('fas', '/usr/share/locale', fal... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Tests\Database;
use Illuminate\Database\Capsule\Manager as DB;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model as Eloquent;
use Illuminate\Database\Eloquent\Relations\Relation;
use PHPUnit\Framework\TestCase;
class DatabaseEloquentIntegrationWithTablePre... | php | github | https://github.com/laravel/framework | tests/Database/DatabaseEloquentIntegrationWithTablePrefixTest.php |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2009 Zuza Software Foundation
# Copyright 2014 F Wolff
#
# This file is part of Virtaal.
#
# 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 Foundat... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2021 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
package roachpb
import (
"reflect"
"testing"
"github.com/cockroachdb/cockroach/pkg/util/timeutil"
"github.com/stretchr/testify/require"
)
func TestAddIndexUsageSt... | go | github | https://github.com/cockroachdb/cockroach | pkg/roachpb/index_usage_stats_test.go |
from __future__ import division
from __future__ import print_function
from past.utils import old_div
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
import pandas as pd
import zipfile
import statsmodels.api as sm
from h2o.estimators.glm import H2OGeneralizedLinearEstimator
def link_... | unknown | codeparrot/codeparrot-clean | ||
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const RuntimeGlobals = require("../RuntimeGlobals");
const JavascriptModulesPlugin = require("../javascript/JavascriptModulesPlugin");
/** @typedef {import("webpack-sources").Source} Source */
/** @typed... | javascript | github | https://github.com/webpack/webpack | lib/library/AbstractLibraryPlugin.js |
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-or-later
# Get a list of all the relocations, remove from it the relocations
# that are known to be legitimate and return this list to arch specific
# script that will look for suspicious relocations.
objdump="$1"
nm="$2"
vmlinux="$3"
# Remove from the possible bad reloca... | unknown | github | https://github.com/torvalds/linux | scripts/relocs_check.sh |
"""
Tests for PEP-526 type annotations.
Python 3.6+ only.
"""
import types
import typing
import pytest
import attr
from attr._make import _classvar_prefixes
from attr.exceptions import UnannotatedAttributeError
class TestAnnotations:
"""
Tests for types derived from variable annotations (PEP-526).
"""... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (c) 2017 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockito.internal.util;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import org.assertj.core.api.Assertions;
import org.junit.Test;
import org.mockito.exceptions.misu... | java | github | https://github.com/mockito/mockito | mockito-core/src/test/java/org/mockito/internal/util/TimerTest.java |
# -*- test-case-name: twisted.test.test_task,twisted.test.test_cooperator -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Scheduling utility methods and classes.
"""
from __future__ import division, absolute_import
__metaclass__ = type
import sys
import time
from zope.interface impo... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.