code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
"""
Global Django exception classes.
"""
import operator
from django.utils.hashable import make_hashable
class FieldDoesNotExist(Exception):
"""The requested model field does not exist"""
pass
class AppRegistryNotReady(Exception):
"""The django.apps registry is not populated yet"""
pass
class Obj... | python | github | https://github.com/django/django | django/core/exceptions.py |
# This code is licensed under the New BSD License
# 2009, Alexander Artemenko <svetlyak.40wt@gmail.com>
# For other contacts, visit http://aartemenko.com
import unittest
from mongobongo.attributed import AttributedDict, \
AttributedList
class AttrDictTests(unittest.TestCase):
def... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
ActiveJob::Base.queue_adapter = :async
ActiveJob::Base.queue_adapter.immediate = true | ruby | github | https://github.com/rails/rails | activejob/test/adapters/async.rb |
"""
Contains things to detect changes - either using options passed in on the
commandline, or by using autodetection, etc.
"""
from __future__ import print_function
from django.db import models
from django.contrib.contenttypes.generic import GenericRelation
from django.utils.datastructures import SortedDict
from sou... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from frappe.utils import today, add_days
from erpnext.payroll.doctype.salary_structure.test_salary_structure import make_employee
class T... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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... | unknown | codeparrot/codeparrot-clean | ||
# A statically generated blog example using Next.js and Builder.io
This example showcases Next.js's [Static Generation](https://nextjs.org/docs/basic-features/pages) feature using [Builder.io](https://builder.io/) as the data source.
## Demo
[https://cms-builder-io.vercel.app/](https://cms-builder-io.vercel.app/)
#... | unknown | github | https://github.com/vercel/next.js | examples/cms-builder-io/README.md |
//===-- IndexHelpers.h ------------------------------------------*- C++ -*-===//
//
// 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/clangd/unittests/TestIndex.h |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
##########################################################
# THIS IS A GENERATED FILE -- DO NOT MODIFY.
# IF YOU WISH TO MODIFY THIS SUITE, MODIFY THE CORRESPONDING MATRIX SUITE MAPPING FILE
# AND REGENERATE THE MATRIX SUITES.
#
# matrix suite mapping file: buildscripts/resmokeconfig/matrix_suites/mappings/no_causal_co... | unknown | github | https://github.com/mongodb/mongo | buildscripts/resmokeconfig/matrix_suites/generated_suites/no_causal_consistency_replica_sets_kill_stepdown_terminate_jscore_passthrough.yml |
"""
Runs through a reST file looking for old-style literals, and helps replace them
with new-style references.
"""
import re
import sys
import shelve
refre = re.compile(r'``([^`\s]+?)``')
ROLES = (
'attr',
'class',
"djadmin",
'data',
'exc',
'file',
'func',
'lookup',
'meth',
'm... | 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.
*/
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Bundle\SecurityBun... | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/MissingUserProvider/bundles.php |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import matplotlib as mpl
import six
from nose.tools import assert_true
from ggplot.tests import image_comparison, cleanup
from ggplot import *
def _diff(a, b):
ret = {}
for key, val in a.items():
... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
from metaworld.policies.action import Action
from metaworld.policies.policy import Policy, assert_fully_parsed, move
class SawyerPickOutOfHoleV1Policy(Policy):
@staticmethod
@assert_fully_parsed
def _parse_obs(obs):
return {
'hand_pos': obs[:3],
'puck_po... | unknown | codeparrot/codeparrot-clean | ||
"""
Spotify Tag
---------
This implements a Liquid-style spotify tag for Pelican,
based on the jekyll / octopress youtube tag [1]_
Syntax
------
{% spotify id %}
Example
-------
{% spotify 1HNZcRFlIKwHAJD3LxvX4d %}
Output
------
<iframe
src='https://embed.spotify.com/?uri=spotify:track:1HNZcRFlIKwHAJD3LxvX4d'
... | 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 may ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import functools
import openerp
from openerp.http import Controller, route, request, Response
def webservice(f):
@functools.wraps(f)
def wrap(*args, **kw):
try:
return f(*args, **kw)
except Exception, e:
return Response(response=str(e), status=500... | unknown | codeparrot/codeparrot-clean | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from .items import (
Items,
AsyncItems,
ItemsWithRawResponse,
AsyncItemsWithRawResponse,
ItemsWithStreamingResponse,
AsyncItemsWithStreamingResponse,
)
from .conversations import (
Conversations,
Async... | python | github | https://github.com/openai/openai-python | src/openai/resources/conversations/__init__.py |
# -*- coding: utf-8 -*-
#
# SelfTest/Random/Fortuna/__init__.py: Self-test for Fortuna modules
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that de... | unknown | codeparrot/codeparrot-clean | ||
from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
# metadata info about the module, not modified during runtime
self.info = {
# name for the module that will appear in module menus
'Name': 'Dylib Hijack Vulnerability Scanner',
... | 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 | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package main
import (
"testing"
)
func Test_apply_no_input_flag(t *testing.T) {
t.Parallel()
skipIfMissingEnvVar(t)
cases := testCases{
"terraform apply with -input=false": {
operations: []operationSets{
{
prep: func(t *testing.... | go | github | https://github.com/hashicorp/terraform | internal/cloud/e2e/apply_no_input_flag_test.go |
"Translation helper functions"
import locale
import os
import re
import sys
import gettext as gettext_module
from cStringIO import StringIO
from django.utils.functional import lazy
try:
import threading
hasThreads = True
except ImportError:
hasThreads = False
if hasThreads:
currentThread = threading.... | unknown | codeparrot/codeparrot-clean | ||
# Metadata proxy
==============
This metadata proxy returns a 403 for kubelet's kube-env data, but otherwise allows
pods access to the metadata server. | unknown | github | https://github.com/kubernetes/kubernetes | cluster/addons/metadata-proxy/README.md |
"""
This module converts code written for Numeric to run with numpy
Makes the following changes:
* Changes import statements (warns of use of from Numeric import *)
* Changes import statements (using numerix) ...
* Makes search and replace changes to:
- .typecode()
- .iscontiguous()
- .byteswapped()
- .... | 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 may ... | unknown | codeparrot/codeparrot-clean | ||
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect 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 Licen... | unknown | codeparrot/codeparrot-clean | ||
"""
model_b.py
by Ted Morin
contains a function to predict 10-year Coronary Heart Disease risks using model from
10.1161/CIRCULATIONAHA.107.699579
General Cardiovascular Risk Profile for Use in Primary Care
Framingham Heart Study
function expects parameters of
"ismale" "antihypertensive medication use" "age" "total c... | 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... | python | github | https://github.com/apache/airflow | airflow-core/src/airflow/api_fastapi/execution_api/datamodels/xcom.py |
# Copyright (C) 2009 One Laptop Per Child
# Licensed under the terms of the GNU GPL v2 or later; see COPYING for details.
from __future__ import with_statement
from __future__ import division
import sys
import os.path
import urllib
import urllib2
import urlparse
import time
import pickle
from bitfrost.update import ... | unknown | codeparrot/codeparrot-clean | ||
# Custom build pipeline
When building an Angular app we strongly recommend you to use the Angular CLI to leverage its structure-dependent update functionality and build system abstraction. This way your projects benefit from the latest security, performance, and API improvements and transparent build improvements.
Th... | unknown | github | https://github.com/angular/angular | adev/src/content/ecosystem/custom-build-pipeline.md |
#!/usr/bin/env python
#
# Copyright 2008,2010,2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from gnuradio import gr, gr_unittest, digital, blocks
from gnuradio.digital.utils import lfsr_args
import numpy as np
import pmt
# See gr-digital/... | 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 applicable law or agree... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/core/util/tensor_bundle/byte_swap_array.h |
# Copyright 2014 The LibYuv Project Authors. All rights reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors... | unknown | codeparrot/codeparrot-clean | ||
class Point():
def __init__(self, y_pos=0, x_pos=0, y_velo=0, x_velo=0):
self.x_pos = x_pos
self.y_pos = y_pos
self.x_velo = x_velo
self.y_velo = y_velo
def move(self):
self.x_pos += self.x_velo
self.y_pos += self.y_velo
def bounce(self, grid_size):
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#歧視無邊,回頭是岸。鍵起鍵落,情真情幻。
# Correction: 0->ASEAN, 49-> GB, 52 ->KR
import os.path, glob
import requests
from lxml.html import fromstring, tostring, parse
from io import StringIO, BytesIO
import codecs
import pandas as pd
import json
XML_encoding="utf-8"
# Data source
URL_ = "http://www.aseminfoboa... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-14 15:50
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pagos', '0002_auto_20161014_1514'),
]
operations = [
migrations.RemoveField(... | unknown | codeparrot/codeparrot-clean | ||
"""engine.SCons.Tool.cvf
Tool-specific initialization for the Compaq Visual Fortran compiler.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated docume... | unknown | codeparrot/codeparrot-clean | ||
pub mod varint; | rust | github | https://github.com/git/git | src/lib.rs |
######################################################################
##
## Copyright (C) 2007, Blekinge Institute of Technology
##
## Filename: parse.py
## Author: Simon Kagstrom <ska@bth.se>
## Description: Parsing-related stuff for the peephole optimizer
##
## $Id: parse.py 14173 2007-03-11 14:52:39Z... | unknown | codeparrot/codeparrot-clean | ||
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | unknown | codeparrot/codeparrot-clean | ||
##########################################################################
#
# Copyright (c) 2008-2011, Image Engine Design 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:
#
# * Redis... | 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 | configuration-metadata/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/source/LombokSource.java |
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
// Copyright (C) 2016, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective own... | unknown | github | https://github.com/opencv/opencv | hal/openvx/include/ivx_lib_debug.hpp |
"""
Unittests for populate_created_on_site_user_attribute management command.
"""
import ddt
import mock
from django.test import TestCase
from django.contrib.auth.models import User
from django.core.management import call_command, CommandError
from student.models import Registration, UserAttribute
from student.tests.f... | 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/server/telemetry/ClientTelemetryExporterProvider.java |
{
"name": "@vue/runtime-core",
"version": "3.5.28",
"description": "@vue/runtime-core",
"main": "index.js",
"module": "dist/runtime-core.esm-bundler.js",
"types": "dist/runtime-core.d.ts",
"files": [
"index.js",
"dist"
],
"exports": {
".": {
"types": "./dist/runtime-core.d.ts",
... | json | github | https://github.com/vuejs/core | packages/runtime-core/package.json |
# coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2016 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
#... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright 2001-2002 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright n... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from profile_creators import extensions_profile_creator
class ManyExtensionsProfileCreator(
extensions_profile_creator.ExtensionsProfileCreator):
"""I... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
# Copyright (c) 2009 The Hewlett-Packard Development Company
# 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 co... | unknown | codeparrot/codeparrot-clean | ||
from django.test import TestCase
class PublicTest(TestCase):
def test_index(self):
response = self.client.get('/')
self.assertEqual(response.status_code, 200)
def test_about(self):
response = self.client.get('/about/')
self.assertEqual(response.status_code, 200)
def test_... | unknown | codeparrot/codeparrot-clean | ||
import sys, json, os
from solver.conf import Conf
from solver.difficultyDisplayer import DifficultyDisplayer
from utils.utils import fixEnergy
class Out(object):
@staticmethod
def factory(output, solver):
if output == 'web':
return OutWeb(solver)
elif output == 'console':
... | 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... | python | github | https://github.com/apache/airflow | airflow-core/src/airflow/models/dag_version.py |
# Edit this file to override the default graphite settings, do not edit settings.py
# Turn on debugging and restart apache if you ever see an "Internal Server Error" page
#DEBUG = True
# Set your local timezone (django will try to figure this out automatically)
TIME_ZONE = 'Europe/Zurich'
# Secret key for django
SEC... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/env python
# Released to the public domain, by Tim Peters, 28 February 2000.
"""checkappend.py -- search for multi-argument .append() calls.
Usage: specify one or more file or directory paths:
checkappend [-v] file_or_dir [file_or_dir] ...
Each file_or_dir is checked for multi-argument .append() ca... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
description = """
Update the JRE tarballs to be bundled with the SCIFIOImageIO plugin.
The OpenJDK JRE (but no the JDK) can be redistributed. It is downloaded at
build time from Midas and shipped with the SCIFIOImageIO plugin so that the
plugin "just works".
The Fiji fellows maintain Git repos... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
class SuccessAdapter < ActionCable::SubscriptionAdapter::Base
attr_accessor :unsubscribe_latency
def initialize(...)
super
@unsubscribe_latency = nil
end
def broadcast(channel, payload)
end
def subscribe(channel, callback, success_callback = nil)
subscriber_map[... | ruby | github | https://github.com/rails/rails | actioncable/test/stubs/test_adapter.rb |
/*
* csum-file.c
*
* Copyright (C) 2005 Linus Torvalds
*
* Simple file write infrastructure for writing SHA1-summed
* files. Useful when you write a file that you want to be
* able to verify hasn't been messed with afterwards.
*/
#include "git-compat-util.h"
#include "csum-file.h"
#include "git-zlib.h"
#includ... | c | github | https://github.com/git/git | csum-file.c |
/*
* 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 | build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/PomCondition.java |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | unknown | codeparrot/codeparrot-clean | ||
# -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutNewStyleClasses(Koan):
class OldStyleClass:
"An old style class"
# Original class style have been phased out in Python 3.
class NewStyleClass(object):
"A new style class"
# Introduced in Python ... | unknown | codeparrot/codeparrot-clean | ||
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import {
BlockId,
Environment,
getHookKind,
HIRFunction,
Identifier,
IdentifierId,
Instruction,
InstructionKind,... | typescript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/Optimization/DeadCodeElimination.ts |
import datetime
from django.core.urlresolvers import reverse
from tastypie import authorization
from tastypie.authentication import MultiAuthentication
from crits.indicators.indicator import Indicator
from crits.indicators.handlers import handle_indicator_ind, activity_add
from crits.core.api import CRITsApiKeyAuthen... | unknown | codeparrot/codeparrot-clean | ||
name: Build PR Documentation
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
uses: huggingface/doc-builder/.github/workflows/build_pr_documentation.yml@main
with:
commit_sha: ${{ github.event.pull_request... | unknown | github | https://github.com/huggingface/transformers | .github/workflows/build_pr_documentation.yml |
import numpy as np
with open('data/src/sample_nan.csv') as f:
print(f.read())
# 11,12,,14
# 21,,,24
# 31,32,33,34
# a = np.loadtxt('data/src/sample_nan.csv', delimiter=',')
# ValueError: could not convert string to float:
a = np.genfromtxt('data/src/sample_nan.csv', delimiter=',')
print(a)
# [[11. 12. nan 14.]
... | unknown | codeparrot/codeparrot-clean | ||
import { describe, expect, it } from "vitest";
import {
BinOpResult,
MatchErrorType,
computeVectorVectorBinOp,
filteredSampleValue,
fnv1a,
resultMetric,
} from "./binOp";
import {
VectorMatching,
binaryOperatorType,
vectorMatchCardinality,
} from "./ast";
import { InstantSample, Metric } from "../api/... | typescript | github | https://github.com/prometheus/prometheus | web/ui/mantine-ui/src/promql/binOp.test.ts |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# ---------------------------------------------------------------------------
# ___ __ __ __ ___
# / | \ | \ | \ / Automatic
# \__ |__/ |__/ |___| \__ Annotation
# \ | | | | \ ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2012 OpenStack Foundation
# 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 requ... | unknown | codeparrot/codeparrot-clean | ||
from django import test
from django.db.models.fields import related, CharField, Field, FieldDoesNotExist
from django.contrib.contenttypes.fields import GenericRelation
from .models import (
AbstractPerson, BasePerson, Person, Relating, Relation
)
TEST_RESULTS = {
'fields': {
Person: [
'id... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""QGIS Unit tests for the memory layer provider.
.. note:: 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 later vers... | unknown | codeparrot/codeparrot-clean | ||
import type { DirectiveTransform } from '../transform'
import {
ConstantTypes,
ElementTypes,
type ExpressionNode,
NodeTypes,
type Property,
createCompoundExpression,
createObjectProperty,
createSimpleExpression,
} from '../ast'
import { ErrorCodes, createCompilerError } from '../errors'
import {
hasSc... | typescript | github | https://github.com/vuejs/core | packages/compiler-core/src/transforms/vModel.ts |
values1:
as: 1
group_id: 2
values2:
as: 2
group_id: 1 | unknown | github | https://github.com/rails/rails | activerecord/test/fixtures/reserved_words/values.yml |
import OpenPNM
import scipy as sp
class GenericNetworkTest:
def setup_class(self):
self.net = OpenPNM.Network.Cubic(shape=[10, 10, 10])
def teardown_class(self):
mgr = OpenPNM.Base.Workspace()
mgr.clear()
def test_find_connected_pores_numeric_not_flattend(self):
a = self.n... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""Build a test comparison dataset from an existing VCF file.
Produces a slightly modified comparison set to use for testing comparison
software.
Usage:
build_compare_vcf.py <in_vcf_file>
"""
import os
import sys
import random
import vcf
def main(in_file):
out_file = apply("{0}-cmp{1}".f... | unknown | codeparrot/codeparrot-clean | ||
from trac.db import Table, Column, Index, DatabaseManager
def do_upgrade(env, ver, cursor):
cursor.execute("CREATE TEMPORARY TABLE session_old AS SELECT * FROM session")
cursor.execute("DROP TABLE session")
cursor.execute("CREATE TEMPORARY TABLE ticket_change_old AS SELECT * FROM ticket_change")
cursor... | unknown | codeparrot/codeparrot-clean | ||
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th></th>
<th>0</th>
<th>1</th>
</tr>
<tr>
<th>foo</th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<th rowspan="2" valign="top">0</th>
... | html | github | https://github.com/pandas-dev/pandas | pandas/tests/io/formats/data/html/multiindex_sparsify_1.html |
"""Utilities for working with ID tokens."""
import datetime
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
import jwt
from provider.oauth2.models import Client
from student.models import UserProfile
def get_id_token(user, client_name):
"""Construct a JWT for use with the... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
tests.signals
~~~~~~~~~~~~~~~~~~~~~~~
Signalling.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import pytest
try:
import blinker
except ImportError:
blinker = None
import flask
pytestmark = pytest.mark.skipif(
... | unknown | codeparrot/codeparrot-clean | ||
import re
import requests
import lxml.html.soupparser as htmltree
from emuser.educations.helpers import datetime_from_friendly_text
class CodecademyClient(object):
BEFORE_LOGIN_TOKEN_URL = "http://www.codecademy.com/zh/sign_in"
BEFORE_LOGIN_TOKEN_XPATH = ("//*[@id='new-session']/div[1]"
... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
# In[ ]:
import socket
import sys
import numpy as np
import matplotlib.pyplot as plt
import caffe
import cv2
import detectobjects as det
import createdb as cdb
from convnet import ConvNetClassifier
opts = {'img_dir': '/some/where/images',
'model_dir': '/some/where/models/models/',
'an... | unknown | codeparrot/codeparrot-clean | ||
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once
#ifndef SPDLOG_HEADER_ONLY
#include <spdlog/sinks/stdout_color_sinks.h>
#endif
#include <spdlog/common.h>
#include <spdlog/logger.h>
namespace spdlog {
templat... | c | github | https://github.com/nodejs/node | deps/LIEF/third-party/spdlog/include/spdlog/sinks/stdout_color_sinks-inl.h |
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
package v0alpha1
// +k8s:openapi-gen=true
type GetSearchTeamsTeamHit struct {
Name string `json:"name"`
Title string `json:"title"`
Email string `json:"email"`
Provisioned bool `json:"provisioned"`
ExternalUID string `json:"externalUID"`
}
... | go | github | https://github.com/grafana/grafana | apps/iam/pkg/apis/iam/v0alpha1/getsearchteams_response_body_types_gen.go |
""" Python Character Mapping Codec mac_iceland generated from 'MAPPINGS/VENDORS/APPLE/ICELAND.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input... | unknown | codeparrot/codeparrot-clean | ||
import json
import copy
import tempfile
from tests.unit import AWSMockServiceTestCase
from boto.glacier.layer1 import Layer1
class GlacierLayer1ConnectionBase(AWSMockServiceTestCase):
connection_class = Layer1
def setUp(self):
super(GlacierLayer1ConnectionBase, self).setUp()
self.json_header ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Cumulus Networks <ce-ceng@cumulusnetworks.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... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@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__ = t... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Simple script to filter lines of the input for meeting a numeric
# threshold on one, or one of multiple (comma-separated) column numbers.
# If threshold is required on each column, you can chain multiple
# scorethresh.py calls with pipes.
# by default, the column value has to be larger or equal ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# ===========================================================================
# iDevice «Citas para pensar» creado para la FPD por José Ramón Jiménez Reyes
# FPD - Quotation
# ===========================================================================
"""
FPD - Quotation
Citas ... | unknown | codeparrot/codeparrot-clean | ||
from openid.association import Association
from openid.cryptutil import randomString
from openid.store.nonce import mkNonce, split
import unittest
import string
import time
import socket
import random
import os
db_host = 'dbtest'
allowed_handle = []
for c in string.printable:
if c not in string.whitespace:
... | unknown | codeparrot/codeparrot-clean | ||
use crate::io::AsyncWrite;
use bytes::BufMut;
use pin_project_lite::pin_project;
use std::future::Future;
use std::io;
use std::marker::PhantomPinned;
use std::pin::Pin;
use std::task::{Context, Poll};
macro_rules! writer {
($name:ident, $ty:ty, $writer:ident) => {
writer!($name, $ty, $writer, std::mem::s... | rust | github | https://github.com/tokio-rs/tokio | tokio/src/io/util/write_int.rs |
""" Build swig and f2py sources.
"""
from __future__ import division, absolute_import, print_function
import os
import re
import sys
import shlex
import copy
from distutils.command import build_ext
from distutils.dep_util import newer_group, newer
from distutils.util import get_platform
from distutils.errors import D... | unknown | codeparrot/codeparrot-clean | ||
"""
kombu.transport.zmq
===================
ZeroMQ transport.
"""
from __future__ import absolute_import
import errno
import os
import socket
try:
import zmq
from zmq import ZMQError
except ImportError:
zmq = ZMQError = None # noqa
from kombu.five import Empty
from kombu.log import get_logger
from kom... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Routing;
use Illuminate\Contracts\Routing\ResponseFactory;
class ViewController extends Controller
{
/**
* The response factory implementation.
*
* @var \Illuminate\Contracts\Routing\ResponseFactory
*/
protected $response;
/**
* Create a new controller... | php | github | https://github.com/laravel/framework | src/Illuminate/Routing/ViewController.php |
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import {Debouncer} from './debouncer';
/** Runs the provided callback with an `ng` string argument. */
function run... | typescript | github | https://github.com/angular/angular | devtools/projects/ng-devtools/src/lib/shared/utils/debouncer.spec.ts |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
#
"""Module to parse ANSI escape sequences
Maintainer: Jean-Paul Calderone
"""
import string
# Twisted imports
from twisted.python import log
class ColorText:
"""
Represents an element of text along with the texts colors and
additi... | unknown | codeparrot/codeparrot-clean | ||
function Component(props) {
const x = [];
x.push(props.value);
const {length: y} = x;
foo(y);
return [x, y];
} | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructuring-property-inference.js |
const myName: string = "Junya";
const age: number = 22;
function getArray<T>(...args: T[]): T[] {
return [...args];
}
console.log(getArray("foo", "bar"));
console.log(getArray(1, 2, 3)); | typescript | github | https://github.com/webpack/webpack | examples/typescript/index.ts |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2012, 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 opt... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.