code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
from __future__ import unicode_literals
from copy import deepcopy
from django.db import models
from django.core.exceptions import FieldError
from django.db.models.query_utils import DeferredAttribute
class FieldInstanceTracker(object):
def __init__(self, instance, fields, field_map):
self.instance = inst... | unknown | codeparrot/codeparrot-clean | ||
#-------------------------------------------------------------------------------
# Name: vertex
# Purpose: class for 3D vertices
#
# Author: bencesomogyi
#
# Created: 19.10.2013
# Copyright: (c) bencesomogyi 2013
# Licence: <your licence>
#------------------------------------------------------... | unknown | codeparrot/codeparrot-clean | ||
from django.apps import apps
from django.test import SimpleTestCase
class NoModelTests(SimpleTestCase):
def test_no_models(self):
"""It's possible to load an app with no models.py file."""
app_config = apps.get_app_config("no_models")
self.assertIsNone(app_config.models_module) | python | github | https://github.com/django/django | tests/no_models/tests.py |
#!/usr/bin/env python3
import argparse
import os
import genapi
import numpy_api
from genapi import BoolValuesApi, FunctionApi, GlobalVarApi, TypeApi
# use annotated api when running under cpychecker
h_template = r"""
#if defined(_MULTIARRAYMODULE) || defined(WITH_CPYCHECKER_STEALS_REFERENCE_TO_ARG_ATTRIBUTE)
typedef... | python | github | https://github.com/numpy/numpy | numpy/_core/code_generators/generate_numpy_api.py |
import collections
import copy
import heapq
import traceback
import warnings
import weakref
import numpy
import six
import chainer
from chainer import cuda
from chainer import initializers
from chainer.initializers import constant
from chainer import utils
from chainer.utils import argument
def _check_grad_type(func... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2012 the V8 project authors. 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 conditi... | unknown | codeparrot/codeparrot-clean | ||
export type Writable<T> = T extends Readonly<infer U> ? U : T | typescript | github | https://github.com/tailwindlabs/tailwindcss | packages/tailwindcss/src/types.ts |
# @(#) $Id: String.py,v 1.1.1.1 2012/03/07 17:40:45 acaproni Exp $
#
# Copyright (C) 2001
# Associated Universities, Inc. Washington DC, USA.
#
# Produced for the ALMA project
#
# This library is free software; you can redistribute it and/or modify it under
# the terms of the GNU Library General Public License as publi... | unknown | codeparrot/codeparrot-clean | ||
"""
Test computation of chi2 - fitting of 6 RVs on three spectra.
This also shows that simplex wont get out of the local minimum easily,
so more powerful fitting environments are needed if we want
to get over big obstacles.
"""
import pyterpol
rl = pyterpol.RegionList()
rl.add_region(wmin=6325, wmax=6375)
rl.add_regio... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import StringIO
from xml.dom.minidom import Document
import thedata
def main():
with open("static/xml/clusters.xml", 'w') as opf:
doc = Document()
write_clusters(doc, opf)
with open("static/xml/users.xml", 'w') as opf:
doc = Document()
write_users(doc, opf)
opf.close
def write... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Generates the syscall.h header by scanning for all system calls
# defined in the syscalls.master file.
MASTER_FILE='kernel/syscall/syscalls.master'
OUTPUT_SRC='kernel/syscall/syscall_table.c'
OUTPUT_HDR='include/sys/syscalls.h'
def parse_master_file(fn):
syscalls=dict()
with op... | 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
# distributed under ... | unknown | codeparrot/codeparrot-clean | ||
name: Labeling new issues
on:
issues:
types: ['opened']
permissions:
contents: read
jobs:
automate-issues-labels:
permissions:
issues: write
runs-on: ubuntu-24.04
if: github.repository == 'llvm/llvm-project'
steps:
- uses: llvm/actions/issue-labeler@89a8cf80982d830faab019237860b3... | unknown | github | https://github.com/llvm/llvm-project | .github/workflows/new-issues.yml |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | unknown | codeparrot/codeparrot-clean | ||
# (C) 2012-2013, 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 | ||
# 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 | ||
#!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | unknown | codeparrot/codeparrot-clean | ||
// Need InlineOnly for efficient bytecode on Android
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER", "NOTHING_TO_INLINE")
package kotlinx.coroutines
import java.util.concurrent.locks.*
import kotlin.internal.InlineOnly
internal abstract class AbstractTimeSource {
abstract fun currentTimeMillis(): Long
... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | kotlinx-coroutines-core/jvm/src/AbstractTimeSource.kt |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Peter Mounce <public@neverrunwithscissors.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# this is a windows documentation stub. actual code lives in the .ps1
# file of the same name
ANSIBLE_METADATA ... | unknown | codeparrot/codeparrot-clean | ||
//===--- DebugTypeInfo.h - Type Info for Debugging --------------*- 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 | lib/IRGen/DebugTypeInfo.h |
use anyhow::Result;
use async_trait::async_trait;
use next_custom_transforms::transforms::react_server_components::*;
use swc_core::{
common::FileName,
ecma::{ast::Program, visit::VisitWith},
};
use turbo_tasks::Vc;
use turbo_tasks_fs::FileSystemPath;
use turbopack::module_options::ModuleRule;
use turbopack_ecm... | rust | github | https://github.com/vercel/next.js | crates/next-core/src/next_shared/transforms/next_react_server_components.rs |
'use action';
export async function foo() {} | javascript | github | https://github.com/vercel/next.js | crates/next-custom-transforms/tests/errors/server-actions/server-graph/27/output.js |
package network
import (
"encoding"
"fmt"
"net"
)
// A HardwareAddr represents a physical hardware address.
// It implements [encoding.TextMarshaler] and [encoding.TextUnmarshaler]
// in the absence of go.dev/issue/29678.
type HardwareAddr net.HardwareAddr
var (
_ encoding.TextMarshaler = (HardwareAddr)(nil)
... | go | github | https://github.com/moby/moby | api/types/network/hwaddr.go |
#!/usr/bin/python
######################################
# Originally written by Ryan Hoffmann from Wolynes group,
# Modified by Weihua Zheng 06/01/2011
# For oligomers, make sure the fasta file has all the chains.
######################################################
# The code has three main parts, BLAST fragment se... | unknown | codeparrot/codeparrot-clean | ||
# ERPNext: Copyright 2013 Web Notes Technologies Pvt Ltd
# GNU General Public License. See "license.txt"
from __future__ import unicode_literals
import webnotes
import home
def boot_session(bootinfo):
"""boot session - send website info if guest"""
import webnotes
import webnotes.model.doc
bootinfo['custom_css']... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import fauxfactory
import pytest
from cfme.automate.explorer import Domain, Namespace, Class, Instance, Method
from cfme.automate.simulation import simulate
from cfme.common.vm import VM
from cfme.fixtures import pytest_selenium as sel
from cfme.infrastructure.virtual_machines import Vm # For V... | unknown | codeparrot/codeparrot-clean | ||
---
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/reference/current/rest-api-compatibility.html
applies_to:
stack: all
navigation_title: Compatibility
---
# Elasticsearch API compatibility [rest-api-compatibility]
To help REST clients mitigate the impact of non-compatible (breaking) API changes, {... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/elasticsearch/rest-apis/compatibility.md |
import json
import logging
from airflow.exceptions import AirflowException
from airflow.models import BaseOperator
from airflow.utils.decorators import apply_defaults
from airflow.utils.file import TemporaryDirectory
from docker import Client, tls
import ast
class DockerOperator(BaseOperator):
"""
Execute a co... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
"""
MailMojo API
v1 of the MailMojo API # noqa: E501
OpenAPI spec version: 1.1.0
Contact: hjelp@mailmojo.no
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import io
import json
import logging
import re
import ssl
imp... | unknown | codeparrot/codeparrot-clean | ||
/**
* Copyright 2013, GitHub, Inc
* Copyright 2009-2013, Daniel Lemire, Cliff Moon,
* David McIntosh, Robert Becho, Google Inc. and Veronika Zenz
*
* 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 Fou... | c | github | https://github.com/git/git | ewah/ewok.h |
import {RenderPropAsChild, StaticText1, StaticText2} from 'shared-runtime';
function Component(props: {showText1: boolean}) {
const Foo = props.showText1 ? StaticText1 : StaticText2;
return <RenderPropAsChild items={[() => <Foo key="0" />]} />;
}
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{s... | typescript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-ternary-local-variable.tsx |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Virt management features
Copyright 2007, 2012 Red Hat, Inc
Michael DeHaan <michael.dehaan@gmail.com>
Seth Vidal <skvidal@fedoraproject.org>
This software may be freely redistributed under the terms of the GNU
general public license.
You should have received a copy of th... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2016 Rackspace Inc.
#
# Author: Tim Simmons <tim.simmons@rackspace.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | unknown | codeparrot/codeparrot-clean | ||
#ifndef Py_BLTINMODULE_H
#define Py_BLTINMODULE_H
#ifdef __cplusplus
extern "C" {
#endif
PyAPI_DATA(PyTypeObject) PyFilter_Type;
PyAPI_DATA(PyTypeObject) PyMap_Type;
PyAPI_DATA(PyTypeObject) PyZip_Type;
#ifdef __cplusplus
}
#endif
#endif /* !Py_BLTINMODULE_H */ | c | github | https://github.com/python/cpython | Include/bltinmodule.h |
from __future__ import print_function, division
from sympy import zeros, Matrix, diff, solve_linear_system_LU, eye
from sympy.core.compatibility import range
from sympy.utilities import default_sort_key
from sympy.physics.vector import (ReferenceFrame, dynamicsymbols,
partial_velocity... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp import _, api, models
class Issue(models.Model):
_name = "project.issue"
_inherit = ['project.issue']
@api.multi
def get_access_action(self):
""" Override method that generated the ... | unknown | codeparrot/codeparrot-clean | ||
import { test } from '../../test';
export default test({
html: `
Default
<p>B slot</p>
`
}); | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/tests/runtime-legacy/samples/component-svelte-fragment-nested/_config.js |
#!/usr/bin/env python
# encoding: utf-8
# pylint: disable=W0110, W0614, W0141, C0103
import sys
import re
import textwrap
from fn import F
from lib.parse_args import add_common_arguments
from lib.d3_fn import cross_flist
from lib.d3_io import load_datasets, save_datasets
from lib.d3_utils import pct_change
from math... | unknown | codeparrot/codeparrot-clean | ||
"""
This module houses the GEOS ctypes prototype functions for the
topological operations on geometries.
"""
__all__ = ['geos_boundary', 'geos_buffer', 'geos_centroid', 'geos_convexhull',
'geos_difference', 'geos_envelope', 'geos_intersection',
'geos_linemerge', 'geos_pointonsurface', 'geos_pres... | unknown | codeparrot/codeparrot-clean | ||
package kotlinx.coroutines.flow
import kotlinx.coroutines.testing.*
import kotlinx.coroutines.*
import kotlinx.coroutines.channels.*
import kotlin.math.*
import kotlin.test.*
/**
* A _behavioral_ test for buffering that is introduced by the [buffer] operator to test that it is
* implemented properly and that adjace... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | kotlinx-coroutines-core/common/test/flow/operators/BufferTest.kt |
#!/usr/bin/env python3
# Copyright (c) 2014-2020 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 the RBF code."""
from decimal import Decimal
from test_framework.blocktools import COINBASE_MATU... | unknown | codeparrot/codeparrot-clean | ||
// MODULE: dependency
// MODULE_KIND: Source
// FILE: dependency.kt
fun f<caret>oo() { }
// MODULE: app(dependency)
// MODULE_KIND: Source
// USE_SITE_MODULE
// FILE: app.kt
fun bar() { } | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api/testData/components/analysisScopeProvider/canBeAnalysed/dependencySourceElement_appSourceModule.kt |
//// [tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts] ////
//// [additionOperatorWithUndefinedValueAndInvalidOperands.ts]
// If one operand is the null or undefined value, it is treated as having the type of the other operand.
function foo(... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.js |
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/cpufreq/mediatek,mt8196-cpufreq-hw.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: MediaTek Hybrid CPUFreq for MT8196/MT6991 series SoCs
maintainers:
- Nicolas Frattaroli <nicolas.frattarol... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/cpufreq/mediatek,mt8196-cpufreq-hw.yaml |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Last Change: Tue Jul 17 05:00 PM 2007 J
# The code and descriptive text is copyrighted and offered under the terms of
# the BSD License from the authors; see below. However, the actual dataset may
# have a different origin and intellectual property status. See the SOURC... | unknown | codeparrot/codeparrot-clean | ||
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Project.repo_type'
db.add_column('projects_project', 'repo_type', self.gf('django.db.models.fields... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/compiler/ParameterList6.ts] ////
//// [ParameterList6.ts]
class C {
constructor(C: (public A) => any) {
}
}
//// [ParameterList6.js]
"use strict";
class C {
constructor(C) {
}
} | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/ParameterList6.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.impl.base.symbols.pointers
import org.jetbrains.kotlin.analysis.api... | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-impl-base/src/org/jetbrains/kotlin/analysis/api/impl/base/symbols/pointers/exceptions.kt |
'use strict';
const { join } = require('node:path');
const common = require('../common.js');
const tmpdir = require('../../test/common/tmpdir');
let cnt = 0;
tmpdir.refresh();
function nextLocalStorage() {
return join(tmpdir.path, `${++cnt}.localstorage`);
}
const options = {
flags: [`--localstorage-file=${next... | javascript | github | https://github.com/nodejs/node | benchmark/webstorage/setItem.js |
#!/usr/bin/env python
#
# Use the raw transactions API to spend bitcoins received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a bitcoind or Bit... | unknown | codeparrot/codeparrot-clean | ||
import logging
from flask import jsonify, url_for
from betterapis.app import api, db
from betterapis.models import Talk
def get(talk_id):
# find the talk by id or return a 404
talk = Talk.query.get_or_404(talk_id)
return talk.dump()
def post(talk):
# create a new talk from the post data
new_talk =... | 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/replica/ReplicaView.java |
<?php
namespace Illuminate\Testing\Constraints;
use Illuminate\Database\Connection;
use PHPUnit\Framework\Constraint\Constraint;
class NotSoftDeletedInDatabase extends Constraint
{
/**
* Number of records that will be shown in the console in case of failure.
*
* @var int
*/
protected $sho... | php | github | https://github.com/laravel/framework | src/Illuminate/Testing/Constraints/NotSoftDeletedInDatabase.php |
#! /usr/bin/env python3
"""Freeze a Python script into a binary.
usage: freeze [options...] script [module]...
Options:
-p prefix: This is the prefix used when you ran ``make install''
in the Python build directory.
(If you never ran this, freeze won't work.)
The default ... | 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.
from pylib.base import environment
from pylib.device import adb_wrapper
from pylib.device import device_errors
from pylib.device import device_utils
from pyl... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2012 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual 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 L... | unknown | codeparrot/codeparrot-clean | ||
package runtime
import "github.com/moby/moby/api/types/swarm"
func privilegesFromAPI(privs []*swarm.RuntimePrivilege) []*PluginPrivilege {
var out []*PluginPrivilege
for _, p := range privs {
out = append(out, &PluginPrivilege{
Name: p.Name,
Description: p.Description,
Value: p.Value,
})
... | go | github | https://github.com/moby/moby | daemon/cluster/internal/runtime/convert.go |
# This file is part of Indico.
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | unknown | codeparrot/codeparrot-clean | ||
import pickle
import cv2
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
# Read in the saved camera matrix and distortion coefficients
# These are the arrays you calculated using cv2.calibrateCamera()
dist_pickle = pickle.load(open("wide_dist_pickle.p", "rb"))
mtx = dist_pickle["mtx... | unknown | codeparrot/codeparrot-clean | ||
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const ModuleDependency = require("./ModuleDependency");
/** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */
/** @typedef {import("../Dependency")} Dependency */
/** @typedef {import("... | javascript | github | https://github.com/webpack/webpack | lib/dependencies/ModuleDependencyTemplateAsRequireId.js |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Response.answer_number'
db.add_column(u'survey_response', 'answer_number',
... | unknown | codeparrot/codeparrot-clean | ||
{
"description": "tests handling of multiline strings when updating",
"include_files": [],
"ignore_fields": {}
} | json | github | https://github.com/hashicorp/terraform | testing/equivalence-tests/tests/basic_multiline_string_update/spec.json |
#!/usr/bin/python
# Copyright 2015 Google Inc. All Rights Reserved.
#
# 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 o... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import time
import datetime
try:
import matplotlib.pyplot as plt
except ImportError:
plt = None
def perf_client_attrs():
prepare_data = '''sh: ssh $usr@$ip "${client_env_vars} client_idx=$idx $dir/$client/stress.sh prepare ${type} ${client_start_args}"'''
return locals()
def perf_... | unknown | codeparrot/codeparrot-clean | ||
from sqlagg import CountUniqueColumn, AliasColumn
from sqlagg.columns import SimpleColumn, SumColumn
from sqlagg.filters import LTE, AND, GTE, GT, EQ, NOTEQ, OR, IN
from corehq.apps.reports.datatables import DataTablesHeader, DataTablesColumn
from corehq.apps.reports.sqlreport import DatabaseColumn, AggregateColumn
fro... | unknown | codeparrot/codeparrot-clean | ||
# 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 time
from metrics import smoothness
from telemetry.page import page_measurement
class StatsCollector(object):
def __init__(self, timeline):
... | unknown | codeparrot/codeparrot-clean | ||
"""distutils.ccompiler
Contains CCompiler, an abstract base class that defines the interface
for the Distutils compiler abstraction model."""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id: ccompiler.py 46331 2006-05-26 14:07:23Z bob.ippolito $"
import sys, os, re
from types import *
f... | unknown | codeparrot/codeparrot-clean | ||
package reference
type notFoundError string
func (e notFoundError) Error() string {
return string(e)
}
func (notFoundError) NotFound() {}
type invalidTagError string
func (e invalidTagError) Error() string {
return string(e)
}
func (invalidTagError) InvalidParameter() {}
type conflictingTagError string
func (... | go | github | https://github.com/moby/moby | daemon/internal/refstore/errors.go |
#!/usr/bin/env python
# -*- coding: utf-8; py-indent-offset:4 -*-
###############################################################################
#
# Copyright (C) 2015-2020 Daniel Rodriguez
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License a... | unknown | codeparrot/codeparrot-clean | ||
"""
GraphViz Tag
---------
This implements a Liquid-style graphviz tag for Pelican. You can use different
Graphviz programs like dot, neato, twopi etc. [1]
[1] http://www.graphviz.org/
Syntax
------
{% graphviz
<program> {
<DOT code>
}
%}
Examples
--------
{% graphviz
dot {
digraph graphn... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
from django import forms
from django.forms.formsets import BaseFormSet, DELETION_FIELD_NAME
from django.forms.utils import ErrorDict, ErrorList
from django.forms.models import modelform_factory, inlineformset_factory, modelformset_factory, BaseModelFormSet
from django.test impor... | unknown | codeparrot/codeparrot-clean | ||
import io
import numpy as np
import pytest
from pandas._config import using_string_dtype
from pandas.compat import HAS_PYARROW
from pandas.compat.pyarrow import pa_version_under14p0
from pandas import (
DataFrame,
date_range,
read_csv,
read_excel,
read_feather,
read_json,
read_parquet,
... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/io/test_fsspec.py |
from ethereum.tools import tester
from ethereum import opcodes
from ethereum.utils import int_to_big_endian, encode_int32, big_endian_to_int
from ethereum.tools import new_statetest_utils
import json
import py_pairing
from ethereum.opcodes import GPAIRINGBASE as GPB
from ethereum.opcodes import GPAIRINGPERPOINT as GPP
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
'''
Module for sending messages to Slack
.. versionadded:: 2015.5.0
:configuration: This module can be used by either passing an api key and version
directly or by specifying both in a configuration profile in the salt
master/minion config.
For example:
.. code-block:: yaml
... | 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/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | unknown | codeparrot/codeparrot-clean | ||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from ..modeldb import CommonService_pb2 as modeldb_dot_CommonService__pb2
from ..modeldb import ExperimentService_pb2 as modeldb_dot_ExperimentService__pb2
class ExperimentServiceStub(object):
# missing associated documentation commen... | unknown | codeparrot/codeparrot-clean | ||
import DefaultTheme from "vitepress/theme-without-fonts";
import * as d3 from "d3";
import {useData} from "vitepress";
import CustomLayout from "./CustomLayout.vue";
import "./custom.css";
export default {
extends: DefaultTheme,
Layout: CustomLayout,
enhanceApp({app, router}) {
globalThis.d3 = d3; // for con... | typescript | github | https://github.com/d3/d3 | docs/.vitepress/theme/index.ts |
""" Classes for interpolating values.
"""
from __future__ import division, print_function, absolute_import
__all__ = ['interp1d', 'interp2d', 'spline', 'spleval', 'splmake', 'spltopp',
'ppform', 'lagrange', 'PPoly', 'BPoly', 'NdPPoly',
'RegularGridInterpolator', 'interpn']
import itertools
impor... | unknown | codeparrot/codeparrot-clean | ||
# torch.onnx
## Overview
[Open Neural Network eXchange (ONNX)](https://onnx.ai/) is an open standard
format for representing machine learning models. The `torch.onnx` module captures the computation graph from a
native PyTorch {class}`torch.nn.Module` model and converts it into an
[ONNX graph](https://github.com/onnx... | unknown | github | https://github.com/pytorch/pytorch | docs/source/onnx.md |
# Benchmark System
**VM HOST:** Travis
**Machine:** Ubuntu 16.04.6 LTS x64
**Date:** May 04th, 2020
**Version:** Gin v1.6.3
**Go Version:** 1.14.2 linux/amd64
**Source:** [Go HTTP Router Benchmark](https://github.com/gin-gonic/go-http-routing-benchmark)
**Result:** [See the gist](https://gist.github.com/appleboy/b5f2e... | unknown | github | https://github.com/gin-gonic/gin | BENCHMARKS.md |
# 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 | ||
#include "macro_helper_test.h"
#define DEFINE(name) \
namespace ns { \
static const bool t1 = false; \
bool t2_##name = t1; \
bool t3_##name = t1; \
} \
using ns::t2_##name;
DEFINE(test)
void f1() {} | cpp | github | https://github.com/llvm/llvm-project | clang-tools-extra/test/clang-move/Inputs/macro_helper_test.cpp |
// RUN: %check_clang_tidy -std=c++14 %s bugprone-unhandled-exception-at-new %t -- -- -fexceptions
// FIXME: Fix the checker to work in C++17 or later mode.
namespace std {
typedef __typeof__(sizeof(0)) size_t;
enum class align_val_t : std::size_t {};
class exception {};
class bad_alloc : public exception {};
class bad_... | cpp | github | https://github.com/llvm/llvm-project | clang-tools-extra/test/clang-tidy/checkers/bugprone/unhandled-exception-at-new.cpp |
# Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | unknown | codeparrot/codeparrot-clean | ||
/*
* 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/clients/admin/DeleteAclsOptions.java |
package containerd
import (
"context"
"fmt"
"regexp"
"strconv"
"strings"
c8dimages "github.com/containerd/containerd/v2/core/images"
cerrdefs "github.com/containerd/errdefs"
"github.com/containerd/log"
"github.com/containerd/platforms"
"github.com/distribution/reference"
dockerspec "github.com/moby/docker-... | go | github | https://github.com/moby/moby | daemon/containerd/image.go |
#ifndef Py_INTERNAL_PYMEM_H
#define Py_INTERNAL_PYMEM_H
#include "pycore_llist.h" // struct llist_node
#ifdef __cplusplus
extern "C" {
#endif
#ifndef Py_BUILD_CORE
# error "this header requires Py_BUILD_CORE define"
#endif
// Try to get the allocators name set by _PyMem_SetupAllocators().
// Return NULL ... | c | github | https://github.com/python/cpython | Include/internal/pycore_pymem.h |
#!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from cStringIO import StringIO
from zipfile import ZipFile
from compiled_file_system import CompiledFileSystem
from di... | unknown | codeparrot/codeparrot-clean | ||
// runoutput ./rotate.go
// Copyright 2013 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.
// Generate test of bit rotations.
// The output is compiled and run.
package main
const mode = 1 | go | github | https://github.com/golang/go | test/rotate1.go |
from django.contrib.admin import (
HORIZONTAL,
VERTICAL,
AdminSite,
ModelAdmin,
StackedInline,
TabularInline,
action,
autodiscover,
display,
register,
site,
)
from django.contrib.gis.admin.options import GISModelAdmin
__all__ = [
"HORIZONTAL",
"VERTICAL",
"AdminS... | python | github | https://github.com/django/django | django/contrib/gis/admin/__init__.py |
# 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
# distributed under t... | unknown | codeparrot/codeparrot-clean | ||
#### Update roles for users in CSV
#### Example:
#### updateUserRoles.py -u myuser -p mypassword -portal https://esri.maps.arcgis.com -file c:\temp\agolinput.csv
import csv
import argparse
import sys
from agoTools.admin import Admin
from agoTools.admin import UsersAttributes
from agoTools.admin import UserAttributes
... | unknown | codeparrot/codeparrot-clean | ||
# As usual, a bit of setup
import time, os, json
import numpy as np
from scipy.misc import imread, imresize
import matplotlib.pyplot as plt
from cs231n.classifiers.pretrained_cnn import PretrainedCNN
from cs231n.data_utils import load_tiny_imagenet
from cs231n.image_utils import blur_image, deprocess_image, preproces... | unknown | codeparrot/codeparrot-clean | ||
//===-- FunctionTests.cpp -------------------------------------------------===//
//
// 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/clangd/unittests/support/FunctionTests.cpp |
from sympy import Symbol, exp, log
from sympy.calculus.singularities import (singularities, is_increasing,
is_strictly_increasing, is_decreasing,
is_strictly_decreasing, is_monotonic)
from sympy.sets import Interval, FiniteSet, EmptySet... | unknown | codeparrot/codeparrot-clean | ||
"""
Module for formatting output data into CSV files.
"""
from __future__ import annotations
from collections.abc import (
Hashable,
Iterable,
Iterator,
Sequence,
)
import csv as csvlib
import os
from typing import (
TYPE_CHECKING,
Any,
cast,
)
import numpy as np
from pandas._libs import... | python | github | https://github.com/pandas-dev/pandas | pandas/io/formats/csvs.py |
# Configuring the builder.
## Install prerequisites.
```
$ sudo dnf install podman podman-docker jq
```
## Add services.
```
$ sudo cp self-hosted-builder/*.service /etc/systemd/system/
$ sudo systemctl daemon-reload
```
## Download qemu-user-static image
```
# sudo docker pull docker.io/iiilinuxibmcom/qemu-user-... | unknown | github | https://github.com/pytorch/pytorch | .github/scripts/s390x-ci/README.md |
# -*- coding: utf-8 -*-
# This file is part of the pymfony package.
#
# (c) Alexandre Quercia <alquerci@email.com>
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
from __future__ import absolute_import;
from pymfony.component.system import ... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.