code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
# Angular workspace configuration The `angular.json` file at the root level of an Angular workspace provides workspace-wide and project-specific configuration defaults. These are used for build and development tools provided by the Angular CLI. Path values given in the configuration are relative to the root workspace ...
unknown
github
https://github.com/angular/angular
adev/src/content/reference/configs/workspace-config.md
#!/usr/bin/env python # # Copyright 2004,2007,2011,2012 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 ...
unknown
codeparrot/codeparrot-clean
""" API views """ import hashlib import itertools import json import random import urllib from datetime import date, timedelta from django.core.cache import cache from django.http import HttpResponse, HttpResponsePermanentRedirect from django.shortcuts import render from django.template.context import get_standard_pro...
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 json import os import sys import buildbot_common import build_version import getos from buildbot_common import ErrorExit from easy_template impor...
unknown
codeparrot/codeparrot-clean
## flags, enums, guids used with DeviceIoControl from WinIoCtl.h import pywintypes from ntsecuritycon import FILE_READ_DATA,FILE_WRITE_DATA def CTL_CODE(DeviceType, Function, Method, Access): return (DeviceType << 16) | (Access << 14) | (Function << 2) | Method def DEVICE_TYPE_FROM_CTL_CODE(ctrlCode): return ...
unknown
codeparrot/codeparrot-clean
{ "name": "add", "command": "ng add <collection>", "shortDescription": "Adds support for an external library to your project.", "longDescriptionRelativePath": "@angular/cli/src/commands/add/long-description.md", "longDescription": "Adds the npm package for a published library to your workspace, and configures...
json
github
https://github.com/angular/angular
adev/src/content/cli/add.json
from __future__ import print_function from termcolor import colored from time import sleep from .base import BaseOverlay import copy import queue from .rpiopengles import rpiopengles class RpifadeOverlay (BaseOverlay): queue = queue.Queue() nextFader = {'red': 0.0, 'green': 0.0, 'blue': 0.0, 'alpha': 0.0} ...
unknown
codeparrot/codeparrot-clean
# frozen_string_literal: true require "date" require "action_view/helpers/tag_helper" require "active_support/core_ext/array/extract_options" require "active_support/core_ext/date/conversions" require "active_support/core_ext/hash/slice" require "active_support/core_ext/object/acts_like" require "active_support/core_e...
ruby
github
https://github.com/rails/rails
actionview/lib/action_view/helpers/date_helper.rb
# frozen_string_literal: true require "active_model/validations/resolve_value" module ActiveModel module Validations class FormatValidator < EachValidator # :nodoc: include ResolveValue def validate_each(record, attribute, value) if options[:with] regexp = resolve_value(record, op...
ruby
github
https://github.com/rails/rails
activemodel/lib/active_model/validations/format.rb
import os import unittest import tools.lib.template_parser from tools.lib.html_branches import ( build_id_dict, get_tag_info, html_branches, html_tag_tree, split_for_id_and_class, ) ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) TEST_TEMPLATES_DIR = os.pa...
unknown
codeparrot/codeparrot-clean
/*------------------------------------------------------------------------ * * geqo_recombination.c * misc recombination procedures * * src/backend/optimizer/geqo/geqo_recombination.c * *------------------------------------------------------------------------- */ /* contributed by: =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*...
c
github
https://github.com/postgres/postgres
src/backend/optimizer/geqo/geqo_recombination.c
{ "SETNX": { "summary": "Set the string value of a key only when the key doesn't exist.", "complexity": "O(1)", "group": "string", "since": "1.0.0", "arity": 3, "function": "setnxCommand", "deprecated_since": "2.6.12", "replaced_by": "`SET` with the `N...
json
github
https://github.com/redis/redis
src/commands/setnx.json
import escapeStringRegexp from "/-/escape-string-regexp@v5.0.0-SUDdAhYOdAgXIYndxZss/dist=es2020,mode=imports/optimized/escape-string-regexp.js"; var os = {}; const extractPathRegex = /\s+at.*[(\s](.*)\)?/; const pathRegex = /^(?:(?:(?:node|node:[\w/]+|(?:(?:node:)?internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pira...
javascript
github
https://github.com/webpack/webpack
examples/build-http/webpack.lock.data/https_cdn.skypack.dev/clean-stack_v4.1.0-DgWUKXHVzThBBZtsHXhC_dist_es2020_mode_imports_optimized_clean-stack_25e0e8c6773c790b5bc1.js
# 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
from __future__ import unicode_literals import json import re from .common import InfoExtractor from ..compat import ( compat_str, compat_urlparse, ) from ..utils import ( ExtractorError, ) class BandcampIE(InfoExtractor): _VALID_URL = r'https?://.*?\.bandcamp\.com/track/(?P<title>.*)' _TESTS = [...
unknown
codeparrot/codeparrot-clean
import { flushSync } from 'svelte'; import { test } from '../../test'; export default test({ test({ assert, target }) { const button = target.querySelector('button'); assert.htmlEqual(target.innerHTML, `<div></div><button data-foo="true">inc</button> 12 - 12`); flushSync(() => button?.click()); assert.htmlEq...
javascript
github
https://github.com/sveltejs/svelte
packages/svelte/tests/runtime-legacy/samples/block-expression-fn-call/_config.js
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import unittest from pants.util.contextutil import temporary_file_path from pants.util.rwbuf import FileBackedRWBuf, StringWriter class StringWriterTest(unittest.TestCase): def test_...
unknown
codeparrot/codeparrot-clean
/* Sign a module file using the given key. * * Copyright © 2014-2016 Red Hat, Inc. All Rights Reserved. * Copyright © 2015 Intel Corporation. * Copyright © 2016 Hewlett Packard Enterprise Development LP * * Authors: David Howells <dhowells@redhat.com> * David Woodhouse <dwmw2@infradead.org> *...
c
github
https://github.com/torvalds/linux
scripts/sign-file.c
""" Tests for groups """ import httpretty from ddt import ddt, data from django.conf import settings from django.core.urlresolvers import reverse from courseware.tests.factories import UserFactory from ..test_utils import SocialFacebookTestCase @ddt class TestGroups(SocialFacebookTestCase): """ Tests for /api...
unknown
codeparrot/codeparrot-clean
// Copyright 2023 The Cockroach Authors. // // Use of this software is governed by the CockroachDB Software License // included in the /LICENSE file. package rpc import ( "context" "fmt" "net" "time" "github.com/VividCortex/ewma" "github.com/cockroachdb/cockroach/pkg/kv/kvpb" "github.com/cockroachdb/cockroach...
go
github
https://github.com/cockroachdb/cockroach
pkg/rpc/peer.go
#define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #define PY_SSIZE_T_CLEAN #include <Python.h> #include <structmember.h> #include "numpy/arrayobject.h" #include "numpy/arrayscalars.h" #include "npy_config.h" #include "common.h" #include "mapping.h" #include "sequence.h" #include "calculation....
c
github
https://github.com/numpy/numpy
numpy/_core/src/multiarray/sequence.c
// Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. // The ASF licenses this file to You under the Apache License, Version 2.0 // (the "License"); you may not...
json
github
https://github.com/apache/kafka
clients/src/main/resources/common/message/HeartbeatResponse.json
import centinel.primitives.http as http from centinel.experiment import Experiment class MultiInputHTTPRequestExperiment(Experiment): """ This is the multiple-input-file HTTP experiment. You can specify filenames using the list in the class definition to have Centinel load them prior to running the ex...
unknown
codeparrot/codeparrot-clean
""" <This library provides a Python interface for the Telegram Bot API> Copyright (C) <2015> <Jacopo De Luca> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of t...
unknown
codeparrot/codeparrot-clean
// Copyright 2011 Google Inc. All Rights Reserved. // // Use of this source code is governed by a BSD-style license // that can be found in the COPYING 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 may // be...
c
github
https://github.com/opencv/opencv
3rdparty/libwebp/src/enc/iterator_enc.c
/* * Copyright 2002-present the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required b...
java
github
https://github.com/spring-projects/spring-framework
spring-aop/src/test/java/org/springframework/aop/support/RootClassFilterTests.java
# -*- coding: utf-8 -*- ############################################################################## # # Authors: Laurent Mignon # Copyright (c) 2015 Acsone SA/NV (http://www.acsone.eu) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General ...
unknown
codeparrot/codeparrot-clean
# # Author: Pearu Peterson # Created: February 2008 # """ Provides PolynomialRing class. """ __docformat__ = "restructuredtext" __all__ = "PolynomialRing" from ..core import classes, IntegerList, Expr from ..utils import SYMBOL, NUMBER, ADD, MUL, POW, SPARSE_POLY, SUB, DIV from ..basealgebra.algebra import Algebra fr...
unknown
codeparrot/codeparrot-clean
from sympy import ( acos, Add, atan, besselsimp, binomial, collect, collect_const, combsimp, cos, cosh, cot, coth, count_ops, Derivative, diff, Dummy, E, Eq, erf, exp, exp_polar, expand, factor, factorial, FallingFactorial, Float, fraction, Function, gamma, GoldenRatio, hyper, hyper, hypersimp, I, Integ...
unknown
codeparrot/codeparrot-clean
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package math /* Floating-point arctangent. */ // The original C code, the long comment, and the constants below were // from http://netlib.sandia.gov/cephes/...
go
github
https://github.com/golang/go
src/math/atan.go
import matplotlib import numpy as np import scipy as sp import matplotlib.pyplot as plt import scipy.io from sklearn.cross_decomposition import CCA from orthAE import OrthdAE # generate toy data for multi-view learning from paper "Factorized Latent Spaces with Structured Sparsity" t = np.arange(-1, 1, 0.02) x = np.s...
unknown
codeparrot/codeparrot-clean
prelude: | short_lived_ary = [] if RUBY_VERSION >= "2.2.0" GC.start(full_mark: false, immediate_mark: true, immediate_sweep: true) end short_lived = '' benchmark: vm_gc_wb_ary: | short_lived_ary[0] = short_lived # write barrier loop_count: 30000000
unknown
github
https://github.com/ruby/ruby
benchmark/vm_gc_wb_ary.yml
use std::{ cell::Cell, convert::Infallible, task::{Context, Poll}, }; use actix_codec::{AsyncRead, AsyncWrite, Framed}; use actix_http::{ body::{BodySize, BoxBody}, h1, ws::{self, CloseCode, Frame, Item, Message}, Error, HttpService, Request, Response, }; use actix_http_test::test_server; u...
rust
github
https://github.com/actix/actix-web
actix-http/tests/test_ws.rs
# =========================================================================== # eXe # Copyright 2004-2006, University of Auckland # Copyright 2004-2008 eXe Project, http://eXeLearning.org/ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as ...
unknown
codeparrot/codeparrot-clean
# Copyright (C) 2008, OLPC # Copyright (C) 2010-14, Sugar Labs # Copyright (C) 2010-14, Walter Bender # Copyright (C) 2014, Ignacio Rodriguez # # 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; ei...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>) # Copyright (C) 2011 Domsense srl (<http://www.domsense.com>) # # This program is free software: you can redistribute it and/or modi...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ Optimized images (jpg and png) Assumes that jpegtran and optipng are isntalled on path. http://jpegclub.org/jpegtran/ http://optipng.sourceforge.net/ Copyright (c) 2012 Irfan Ahmad (http://i.com.pk) """ import logging import os from subprocess import call from pelican import signals logg...
unknown
codeparrot/codeparrot-clean
""" Helper functions for mapping model fields to a dictionary of default keyword arguments that should be used for their equivalent serializer fields. """ import inspect from django.core import validators from django.db import models from django.utils.text import capfirst from rest_framework.compat import DecimalVali...
unknown
codeparrot/codeparrot-clean
# test-batching.py - tests for transparent command batching # # Copyright 2011 Peter Arrenbrecht <peter@arrenbrecht.ch> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from mercurial.wireproto import localbatch, remotebatch, batch...
unknown
codeparrot/codeparrot-clean
""" mbed SDK Copyright (c) 2011-2013 ARM Limited 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 wr...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env cctools_python # CCTOOLS_PYTHON_VERSION 2.7 2.6 2.5 2.4 import sys import os try: import Chirp except ImportError: print 'Could not find Chirp module. Please set PYTHONPATH accordingly.' sys.exit(1) def write_some_file(filename='bar.txt'): message = ''' One makeflow to rule them a...
unknown
codeparrot/codeparrot-clean
<?php namespace Illuminate\Validation; use Illuminate\Contracts\Support\Arrayable; use Illuminate\Support\Arr; use Illuminate\Support\Traits\Macroable; use Illuminate\Validation\Rules\AnyOf; use Illuminate\Validation\Rules\ArrayRule; use Illuminate\Validation\Rules\Can; use Illuminate\Validation\Rules\Date; use Illum...
php
github
https://github.com/laravel/framework
src/Illuminate/Validation/Rule.php
<?php declare(strict_types=1); /* * This file is part of Composer. * * (c) Nils Adermann <naderman@naderman.de> * Jordi Boggiano <j.boggiano@seld.be> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Composer\Depende...
php
github
https://github.com/composer/composer
src/Composer/DependencyResolver/Operation/UninstallOperation.php
/* * Copyright (c) 2017 Mockito contributors * This program is made available under the terms of the MIT License. */ package org.mockitousage.bugs.creation; import org.junit.Test; import org.mockito.Mockito; import org.mockitousage.bugs.creation.api.PublicClass; // see GH-233 public class PublicMethodInParentWithN...
java
github
https://github.com/mockito/mockito
mockito-core/src/test/java/org/mockitousage/bugs/creation/PublicMethodInParentWithNonPublicTypeInSignatureTest.java
// SPDX-License-Identifier: GPL-2.0-or-later /* * Linux driver model AC97 bus interface * * Author: Nicolas Pitre * Created: Jan 14, 2005 * Copyright: (C) MontaVista Software Inc. */ #include <linux/module.h> #include <linux/init.h> #include <linux/device.h> #include <linux/string.h> #include <sound/ac97_codec.h...
c
github
https://github.com/torvalds/linux
sound/ac97_bus.c
//! This module contains logic for determining whether a type is inhabited or //! uninhabited. The [`InhabitedPredicate`] type captures the minimum //! information needed to determine whether a type is inhabited given a //! `ParamEnv` and module ID. //! //! # Example //! ```rust //! #![feature(never_type)] //! mod a { ...
rust
github
https://github.com/rust-lang/rust
compiler/rustc_middle/src/ty/inhabitedness/mod.rs
# # The Python Imaging Library. # $Id$ # # macOS icns file decoder, based on icns.py by Bob Ippolito. # # history: # 2004-10-09 fl Turned into a PIL plugin; removed 2.3 dependencies. # # Copyright (c) 2004 by Bob Ippolito. # Copyright (c) 2004 by Secret Labs. # Copyright (c) 2004 by Fredrik Lundh. # Copyright (c) 201...
unknown
codeparrot/codeparrot-clean
############################################################################### # This file is part of openWNS (open Wireless Network Simulator) # _____________________________________________________________________________ # # Copyright (C) 2004-2007 # Chair of Communication Networks (ComNets) # Kopernikusstr. 16, D-...
unknown
codeparrot/codeparrot-clean
from __future__ import print_function import enum import re import struct import sys import threading import time import serial from serial.tools.list_ports import comports from common import * def multichr(ords): if sys.version_info[0] >= 3: return bytes(ords) else: return ''.join(map(chr, ...
unknown
codeparrot/codeparrot-clean
# # ElementTree # $Id: ElementTree.py 2326 2005-03-17 07:45:21Z fredrik $ # # light-weight XML support for Python 1.5.2 and later. # # history: # 2001-10-20 fl created (from various sources) # 2001-11-01 fl return root from parse method # 2002-02-16 fl sort attributes in lexical order # 2002-04-06 fl TreeBuilde...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python import sys from setuptools import setup from mpyq import __version__ as version setup(name='mpyq', version=version, author='Aku Kotkavuo', author_email='aku@hibana.net', url='http://github.com/arkx/mpyq/', description='A Python library for extracting MPQ (MoPaQ) fil...
unknown
codeparrot/codeparrot-clean
/* Copyright 2017 - 2025 R. Thomas * Copyright 2017 - 2025 Quarkslab * * 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 req...
unknown
github
https://github.com/nodejs/node
deps/LIEF/include/LIEF/MachO/BindingInfo.hpp
/* * Copyright (c) 2016 Mockito contributors * This program is made available under the terms of the MIT License. */ package org.mockito; import org.mockito.exceptions.misusing.DisabledMockException; import org.mockito.exceptions.misusing.RedundantListenerException; import org.mockito.invocation.Invocation; import ...
java
github
https://github.com/mockito/mockito
mockito-core/src/main/java/org/mockito/MockitoFramework.java
# -*- coding: UTF-8 -*- from odoorpc.tests import LoginTestCase class TestFieldBoolean(LoginTestCase): def test_field_boolean_read(self): self.assertTrue(self.user.active) def test_field_boolean_write(self): # TODO: split in several unit tests partner = self.user.partner_id b...
unknown
codeparrot/codeparrot-clean
#! /usr/bin/env python # encoding: utf-8 import os,sys import Configure,Options,Utils import ccroot,ar from Configure import conftest def find_gcc(conf): cc=conf.find_program(['gcc','cc'],var='CC',mandatory=True) cc=conf.cmd_to_list(cc) ccroot.get_cc_version(conf,cc,gcc=True) conf.env.CC_NAME='gcc' conf.env.CC=cc...
unknown
codeparrot/codeparrot-clean
""" Django REST Framework Serializers """ from django.core.urlresolvers import reverse from rest_framework import serializers from openedx.core.lib.courses import course_image_url class CourseSerializer(serializers.Serializer): """ Serializer for Courses """ id = serializers.CharField() # pylint: disable=in...
unknown
codeparrot/codeparrot-clean
//// [tests/cases/conformance/es6/for-ofStatements/for-of36.ts] //// //// [for-of36.ts] var tuple: [string, boolean] = ["", true]; for (var v of tuple) { v; } //// [for-of36.js] "use strict"; var tuple = ["", true]; for (var v of tuple) { v; }
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/for-of36.js
# encoding: utf-8 # # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http:# mozilla.org/MPL/2.0/. # # Author: Kyle Lahnakoski (kyle@lahnakoski.com) # from __future__ import unicode_literals from __...
unknown
codeparrot/codeparrot-clean
# Author : Martin Luessi mluessi@nmr.mgh.harvard.edu (2012) # License : BSD 3-clause # Parts of this code were copied from NiTime http://nipy.sourceforge.net/nitime from warnings import warn import numpy as np from scipy import fftpack, linalg import warnings from ..parallel import parallel_func from ..utils import ...
unknown
codeparrot/codeparrot-clean
//===--- ArrayOfRef.swift -------------------------------------------------===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
swift
github
https://github.com/apple/swift
benchmark/single-source/ArrayOfRef.swift
import { cleanup, setup } from "./utils/data-router-setup"; import { createFormData } from "./utils/utils"; describe("flushSync", () => { // Detect any failures inside the router navigate code afterEach(() => cleanup()); it("supports GET navigations with flushSync", async () => { let t = setup({ route...
typescript
github
https://github.com/remix-run/react-router
packages/react-router/__tests__/router/flush-sync-test.ts
import models from django.contrib import admin # Customization of Administration. # Display in the list of UserProfile the status in a column. class UserProfileAdmin(admin.ModelAdmin): list_display = ['user', 'status'] # Add right filter list_filter = ('status',) admin.site.register(models.UserProfile, U...
unknown
codeparrot/codeparrot-clean
# Authors: Manoj Kumar <manojkumarsivaraj334@gmail.com> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Joel Nothman <joel.nothman@gmail.com> # License: BSD 3 clause from __future__ import division import warnings import numpy as np from scipy import sparse from math import sqrt fro...
unknown
codeparrot/codeparrot-clean
""" MAIN CLASS FOR TLS LITE (START HERE!). """ from __future__ import generators import socket from utils.compat import formatExceptionTrace from TLSRecordLayer import TLSRecordLayer from Session import Session from constants import * from utils.cryptomath import getRandomBytes from errors import * from messages impor...
unknown
codeparrot/codeparrot-clean
import os, random, struct, time, socket, base64 from disco.compat import BytesIO, file, httplib, basestring, str_to_bytes from disco.error import CommError from disco.settings import DiscoSettings from disco.util import iterify, urlresolve, urlsplit BUFFER_SIZE = int(1024**2) CHUNK_SIZE = int(10 * 1024**2) settings =...
unknown
codeparrot/codeparrot-clean
/*------------------------------------------------------------------------- * * genam.h * POSTGRES generalized index access method definitions. * * * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/ac...
c
github
https://github.com/postgres/postgres
src/include/access/genam.h
"""Tests for square-free decomposition algorithms and related tools. """ from sympy.polys.sqfreetools import ( dup_sqf_p, dmp_sqf_p, dup_sqf_norm, dmp_sqf_norm, dup_sqf_part, dmp_sqf_part, dup_sqf_list, dup_sqf_list_include, dmp_sqf_list, dmp_sqf_list_include, dup_gff_list, dmp_gff_list) from ...
unknown
codeparrot/codeparrot-clean
import copy import collections import yaml __version__ = '0.1' class RdoinfoException(Exception): msg_fmt = "An unknown error occurred" def __init__(self, msg=None, **kwargs): self.kwargs = kwargs if not msg: try: msg = self.msg_fmt % kwargs except Exce...
unknown
codeparrot/codeparrot-clean
''' Documentation Builder Environments ''' import os import re import sys import logging import subprocess import traceback import socket from datetime import datetime from django.utils.text import slugify from django.utils.translation import ugettext_lazy as _ from docker import Client from docker.utils import creat...
unknown
codeparrot/codeparrot-clean
# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of logilab-common. # # logilab-common is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as publ...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ markupsafe._native ~~~~~~~~~~~~~~~~~~ Native Python implementation the C module is not compiled. :copyright: (c) 2010 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from jinja2._markupsafe import Markup def escape(s): """Convert the characters ...
unknown
codeparrot/codeparrot-clean
function component() { function x(a) { a.foo(); } function x() {} return x; } export const FIXTURE_ENTRYPOINT = { fn: component, params: [], isComponent: false, };
javascript
github
https://github.com/facebook/react
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/function-declaration-redeclare.js
# (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import os from datadog_checks.base.utils.common import get_docker_hostname HERE = os.path.dirname(os.path.abspath(__file__)) # Networking HOST = get_docker_hostname() GITLAB_TEST_TOKEN = "ddtesttoken"...
unknown
codeparrot/codeparrot-clean
/* Copyright 2022 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/apis/resource/v1alpha3/register.go
import numpy as np import pytest from numpy.testing import assert_allclose, assert_array_equal from pytest import approx from sklearn.ensemble._hist_gradient_boosting.binning import _BinMapper from sklearn.ensemble._hist_gradient_boosting.common import ( G_H_DTYPE, X_BINNED_DTYPE, X_BITSET_INNER_DTYPE, ...
python
github
https://github.com/scikit-learn/scikit-learn
sklearn/ensemble/_hist_gradient_boosting/tests/test_grower.py
# Copyright 2015 Huawei. # 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 appli...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2017, Ted Trask <ttrask01@yahoo.com> # # This file is part of Ansible # # This module 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 L...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # 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. """Generate and process code coverage. TODO(jrg): rename this from coverage_posix.py to coverage_all.py! Written for and tested o...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # This file is part of Elsim. # # Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr> # All rights reserved. # # Androguard is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, eith...
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.exceptions.util; import java.util.List; import org.mockito.internal.exceptions.VerificationAwareInvocation; public class ScenarioPrinter { public String print(List...
java
github
https://github.com/mockito/mockito
mockito-core/src/main/java/org/mockito/internal/exceptions/util/ScenarioPrinter.java
/* 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 a...
c
github
https://github.com/tensorflow/tensorflow
tensorflow/c/tf_file_statistics.h
""" :copyright: (c) 2011 Local Projects, all rights reserved :license: Affero GNU GPL v3, see LICENSE for more details. """ from sqlalchemy import * from migrate import * # TODO: The alter database statements assume the CBU db is named `changebyus`. This should be # dynamically determined from the sqla engin...
unknown
codeparrot/codeparrot-clean
import sys from ast import literal_eval import os infile = open(os.path.join(os.path.dirname(__file__), 'prime_pairs.txt')) PRIME_PAIRS = literal_eval(infile.read()) for key in PRIME_PAIRS.keys(): PRIME_PAIRS[key] = set(PRIME_PAIRS[key]) # literal_eval doesn't support sets, hence we convert here infile.close() d...
unknown
codeparrot/codeparrot-clean
# coding=utf-8 from BaseHandler import BaseHandler from utils.common import require_logined from utils.image_storage import storage from utils.response_code import RET from config import image_url_prefix import logging class ProfileHandler(BaseHandler): """头像验证""" @require_logined def post(self): user_id = self.s...
unknown
codeparrot/codeparrot-clean
/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; const Factory = require("enhanced-resolve").ResolverFactory; const { HookMap, SyncHook, SyncWaterfallHook } = require("tapable"); const { cachedCleverMerge, removeOperations, resolveByProperty } = requ...
javascript
github
https://github.com/webpack/webpack
lib/ResolverFactory.js
# 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 """ Generate all parsers from PyX12-1.5.0.zip Example Usage: python generate_all_parsers.py ../../Downloads/pyx12-1.5.0.zip """ import argparse import fnmatch import logging import os import sys import zipfile from tigershark.tools import convertPyX12 def convert_from_zip(zip_file_path, dest_pa...
unknown
codeparrot/codeparrot-clean
//===--- ScopedLock.h - ScopedLock ---------------------------- -*- C++ -*-===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2022 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE....
c
github
https://github.com/apple/swift
include/swift/Threading/ScopedLock.h
"""Utilities for enumeration of finite and countably infinite sets. """ ### # Countable iteration # Simplifies some calculations class Aleph0(int): _singleton = None def __new__(type): if type._singleton is None: type._singleton = int.__new__(type) return type._singleton def __r...
unknown
codeparrot/codeparrot-clean
/* * Copyright (c) 2007 Mockito contributors * This program is made available under the terms of the MIT License. */ package org.mockitousage.bugs.varargs; import static org.mockito.ArgumentMatchers.*; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import org.junit.Test; import ...
java
github
https://github.com/mockito/mockito
mockito-core/src/test/java/org/mockitousage/bugs/varargs/VarargsAndAnyPicksUpExtraInvocationsTest.java
import traceback from before import database as before_db, Apples, Tweets from after import database as after_db, TweetsLastsearch, TweetsTweets # 実行前に、新旧のデータベースに対しpwizを実行してmodelを自動生成しておく # (下を一行にて実行する) # python -m pwiz -e postgresql # -u `user name` # -P `password` # -H `host name` # `database name` > `before.py|afte...
unknown
codeparrot/codeparrot-clean
import { join } from 'path' import { ensureDir, outputFile, remove } from 'fs-extra' import recursiveCopyNpm from 'recursive-copy' import { recursiveCopy as recursiveCopyCustom } from 'next/dist/lib/recursive-copy' const fixturesDir = join(__dirname, 'fixtures') const srcDir = join(fixturesDir, 'src') const destDir = ...
javascript
github
https://github.com/vercel/next.js
bench/recursive-copy/run.js
import type { Action, ActionReturn } from 'svelte/action'; // ---------------- Action const href: Action<HTMLAnchorElement> = (node) => { node.href = ''; // @ts-expect-error node.href = 1; }; href; const required: Action<HTMLElement, boolean> = (_node, _param) => {}; required(null as any, true); // @ts-expect-err...
typescript
github
https://github.com/sveltejs/svelte
packages/svelte/tests/types/actions.ts
#!/bin/env python """urllib2-based transport class for xmlrpclib.py (with test code). Written from scratch but inspired by xmlrpc_urllib_transport.py file from http://starship.python.net/crew/jjkunce/ by jjk. A. Ellerton 2006-07-06 Testing with Python 2.4 on Windows and Linux, with/without a corporate proxy in place...
unknown
codeparrot/codeparrot-clean
import os, random, logging, getpass from utils.decrypt_string import decrypt_string # Get application base dir. _basedir = os.path.abspath(os.path.dirname(__file__)) from utils.interactive import check_default, bool_input from utils.log_setup import setup_experiment_logging global_log_file_path = setup_experiment_logg...
unknown
codeparrot/codeparrot-clean
from numbers import Integral from .base import TestBase from ..object import ObjectFile from ..object import Relocation from ..object import Section from ..object import Symbol class TestObjectFile(TestBase): def get_object_file(self): source = self.get_test_binary() return ObjectFile(filename=sou...
unknown
codeparrot/codeparrot-clean
# Copyright 2016 Google Inc. 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...
unknown
codeparrot/codeparrot-clean
"""The tests for the geolocation trigger.""" import pytest from homeassistant.components import automation, zone from homeassistant.const import ATTR_ENTITY_ID, ENTITY_MATCH_ALL, SERVICE_TURN_OFF from homeassistant.core import Context from homeassistant.setup import async_setup_component from tests.common import asyn...
unknown
codeparrot/codeparrot-clean
# Copyright 2022 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
python
github
https://github.com/huggingface/transformers
src/transformers/models/donut/configuration_donut_swin.py
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2005-2006 CamptoCamp # Copyright (c) 2006-2010 OpenERP S.A # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsibility of assessing all po...
unknown
codeparrot/codeparrot-clean