code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
/*
* Copyright (C) 2007 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | java | github | https://github.com/google/guava | android/guava-testlib/src/com/google/common/collect/testing/google/UnmodifiableCollectionTests.java |
<!--Copyright 2020 The HuggingFace 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 applicable law or agreed... | unknown | github | https://github.com/huggingface/transformers | docs/source/en/model_doc/fsmt.md |
#!/usr/bin/env python
# encoding: utf-8
from setuptools import setup
import pypandoc
setup(
name='srq',
version='0.9.0',
description='Simple Python library for queue processing',
author='Roman Koblov',
author_email='pingu.g@gmail.com',
url='https://github.com/penpen/sq-python',
license='MIT... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
from numpy.testing import assert_array_equal
from nose import with_setup
try:
from nose.tools import assert_is, assert_is_instance
except ImportError:
from landlab.testing.tools import assert_is, assert_is_instance
from nose.tools import (assert_equal, assert_raises)
from landlab.grid import... | unknown | codeparrot/codeparrot-clean | ||
# Pretty-printers for libstdc++.
# Copyright (C) 2008-2015 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option)... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright (c) 2000, 2025, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
This program is designed to work with certain software (including... | c | github | https://github.com/mysql/mysql-server | include/my_dir.h |
"""Support for Tahoma switches."""
import logging
from homeassistant.components.switch import SwitchDevice
from homeassistant.const import STATE_OFF, STATE_ON
from . import DOMAIN as TAHOMA_DOMAIN, TahomaDevice
_LOGGER = logging.getLogger(__name__)
ATTR_RSSI_LEVEL = 'rssi_level'
def setup_platform(hass, config, ad... | unknown | codeparrot/codeparrot-clean | ||
import { EditingRenderMiddleware } from "@sitecore-jss/sitecore-jss-nextjs/editing";
/**
* This Next.js API route is used to handle POST requests from Sitecore editors.
* This route should match the `serverSideRenderingEngineEndpointUrl` in your Sitecore configuration,
* which is set to "http://localhost:3000/api/e... | typescript | github | https://github.com/vercel/next.js | examples/cms-sitecore-xmcloud/src/pages/api/editing/render.ts |
/* Copyright 2021 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/experimental/ops/gen/cpp/renderers/guard_renderer.h |
import logging
from celery import shared_task
from django.conf import settings
from django.utils import timezone
from waldur_core.logging.loggers import alert_logger, event_logger
from waldur_core.logging.models import BaseHook, Alert, AlertThresholdMixin
logger = logging.getLogger(__name__)
@shared_task(name='wald... | unknown | codeparrot/codeparrot-clean | ||
import logging
import requests
import structlog
import parsel
from random import sample
import re
from django.test import Client
from django.test import RequestFactory
from siteapp.urls import urlpatterns
from django.urls.exceptions import Resolver404 as Resolver404
from siteapp.models import *
from guidedmodules.m... | unknown | codeparrot/codeparrot-clean | ||
# -*- encoding: utf-8 -*-
##############################################################################
#
# sale_automatic_workflow for OpenERP
# Copyright (C) 2011 Akretion Sébastien BEAU <sebastien.beau@akretion.com>
# Copyright 2013 Camptocamp SA (author: Guewen Baconnier)
#
# This program is free software:... | 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 re
from telemetry.core import util
from telemetry.core import exceptions
from telemetry.page.actions import page_action
def _EscapeSelector(sele... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8; py-indent-offset:4 -*-
###############################################################################
#
# Copyright (C) 2015 Daniel Rodriguez
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pub... | unknown | codeparrot/codeparrot-clean | ||
from django.conf import settings
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.core.cache import cache
from django.conf import settings
RELATIONSHIP_CACHE = getattr(settings, 'RELATIONSHIP_CACHE', 60*60*24*7)
RELATIONSHIP_CACHE_KEYS = {
'FRIENDS': 'friends',
'... | unknown | codeparrot/codeparrot-clean | ||
# This is a collection of "tests" done on the package data. The resut of the
# tests is used to give the package a rating.
#
# Each test has a couple of attributes. Both attributes are checked only after
# the test is performed so the test can choose to set the attributes dependning
# on the severity of the failure.
#
... | 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.
import functools
import logging
import os
import shlex
import sys
def memoize(default=None):
"""This decorator caches the return value of a parameterless ... | unknown | codeparrot/codeparrot-clean | ||
test_kind: multi_stmt_txn_passthrough
selector:
roots:
- jstests/core/**/*.js
exclude_files:
# These tests already run with transactions.
- jstests/core/txns/**/*.js
##
## Limitations with the way the runner file injects transactions.
##
# These tests expects some statements to error,... | unknown | github | https://github.com/mongodb/mongo | buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_stepdown_jscore_passthrough.yml |
""" This script tries to generate docs and call tests for randomkit.* """
import scipy
import re
docFile = "doc/randomkit.html"
testFile = "tests/testCalls.lua"
exclude = ['ffi', '_check1DParams']
randomkitFuncsPath = '/Users/daniel.horgan/randomkit_funcs'
def funcTest(name, sig, doc):
match = re.match(r"(.*)\((... | unknown | codeparrot/codeparrot-clean | ||
import ctypes
import numpy as np
from PyQt4.QtCore import QRectF
from pyqtgraph.graphicsItems.ImageItem import ImageItem
# load the C++ library; The _grid_density is build and distributed as a
# python extension but does not export any python objects (apart from PyInit),
from . import _grid_density
lib = ctypes.pydll... | unknown | codeparrot/codeparrot-clean | ||
"""Kernel Principal Components Analysis."""
# Authors: The scikit-learn developers
# SPDX-License-Identifier: BSD-3-Clause
from numbers import Integral, Real
import numpy as np
from scipy import linalg
from scipy.linalg import eigh
from scipy.sparse.linalg import eigsh
from sklearn.base import (
BaseEstimator,
... | python | github | https://github.com/scikit-learn/scikit-learn | sklearn/decomposition/_kernel_pca.py |
//// [tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck12.ts] ////
//// [ES5For-ofTypeCheck12.ts]
for (const v of 0) { }
//// [ES5For-ofTypeCheck12.js]
"use strict";
for (var _i = 0, _a = 0; _i < _a.length; _i++) {
var v = _a[_i];
} | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/ES5For-ofTypeCheck12(target=es5).js |
from __future__ import absolute_import
import atexit
import logging
import numbers
from threading import Lock
import kafka.common
from kafka.common import (
OffsetRequest, OffsetCommitRequest, OffsetFetchRequest,
UnknownTopicOrPartitionError, check_error, KafkaError
)
from kafka.util import kafka_bytestring,... | 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.
"""Layout tests module that is necessary for the layout analyzer.
Layout tests are stored in an SVN repository and LayoutTestCaseManager collects
these ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import sys
from nose.plugins.skip import SkipTest
i... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
import sys
if sys.version_info < (2... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright (C) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this lis... | unknown | codeparrot/codeparrot-clean | ||
import os.path
def normpath(filename):
"""
Return a normalized, absolute filename.
On case-insensitive systems, this also converts the
filename to lowercase.
"""
return os.path.normcase(os.path.abspath(filename))
class Cabinet(object):
"""
Just a helper class taking ca... | unknown | codeparrot/codeparrot-clean | ||
import sys
import win32api
import win32net
import win32netcon
import win32security
import getopt
import traceback
verbose_level = 0
server = None # Run on local machine.
def verbose(msg):
if verbose_level:
print msg
def CreateUser():
"Creates a new test user, then deletes the user"
testName = "P... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016 CERN.
#
# Invenio is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# coding=utf-8
###############################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
from diamond.collector import Collector
from aurora import A... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
# Copyright 2016 by Raytheon BBN Technologies Corp. All Rights Reserved.
import ast
from ast import NodeVisitor
from copy import deepcopy
# For testing only
if __name__ == '__main__':
import os
import sys
# Find the directory that this executable lives in;
# munge the path t... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
module ActiveJob
# Provides behavior for enqueuing jobs.
# Can be raised by adapters if they wish to communicate to the caller a reason
# why the adapter was unexpectedly unable to enqueue a job.
class EnqueueError < StandardError; end
class << self
# Push many jobs onto t... | ruby | github | https://github.com/rails/rails | activejob/lib/active_job/enqueuing.rb |
#!/usr/bin/env python
"""\
Launch script for GSMTerm
@author: Francois Aucamp <francois.aucamp@gmail.com>
"""
from __future__ import print_function
import sys
from gsmtermlib.terminal import GsmTerm, RawTerm
def parseArgs():
""" Argument parser for Python 2.7 and above """
from argparse import ArgumentPars... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
import pytest
from pandas.compat import is_platform_arm
from pandas import (
DataFrame,
Series,
)
import pandas._testing as tm
from pandas.util.version import Version
pytestmark = [pytest.mark.single_cpu]
numba = pytest.importorskip("numba")
pytestmark.append(
pytest.mark.skipif(
... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/window/test_online.py |
'use strict';
import url from 'url';
export default url.URLSearchParams; | javascript | github | https://github.com/axios/axios | lib/platform/node/classes/URLSearchParams.js |
---
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
Title: CURLOPT_DNS_SERVERS
Section: 3
Source: libcurl
See-also:
- CURLOPT_DNS_CACHE_TIMEOUT (3)
- CURLOPT_DNS_LOCAL_IP4 (3)
- CURLOPT_DNS_LOCAL_IP6 (3)
Protocol:
- All
Added-in: 7.24.0
---
# NAME
CURLOPT_DNS_SERVERS -... | unknown | github | https://github.com/curl/curl | docs/libcurl/opts/CURLOPT_DNS_SERVERS.md |
{
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v0alpha1",
"metadata": {
"name": "v24.table-angular.v42"
},
"spec": {
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/conversion/testdata/migrated_dashboards_output/v1beta1-mig-v24.table-angular.v42.v0alpha1.json |
---
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
Long: remote-header-name
Short: J
Protocols: HTTP
Help: Use the header-provided filename
Category: output
Added: 7.20.0
Multi: boolean
See-also:
- remote-name
Example:
- -OJ https://example.com/file
---
# `--remote-header-... | unknown | github | https://github.com/curl/curl | docs/cmdline-opts/remote-header-name.md |
#![feature(
no_core,
lang_items,
never_type,
linkage,
extern_types,
thread_local,
repr_simd,
rustc_private
)]
#![no_core]
#![allow(dead_code, non_camel_case_types, internal_features)]
extern crate mini_core;
use mini_core::libc::*;
use mini_core::*;
macro_rules! assert {
($e:expr)... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs |
from django.test import TestCase
from wagtail.wagtailcore.models import Page, PageViewRestriction
class TestPagePrivacy(TestCase):
fixtures = ['test.json']
def setUp(self):
self.secret_plans_page = Page.objects.get(url_path='/home/secret-plans/')
self.view_restriction = PageViewRestriction.obj... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2023 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/dtensor/cc/dtensor_operation.h |
# Copyright 2014 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 requi... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (C) 2007 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... | java | github | https://github.com/google/guava | android/guava/src/com/google/common/base/AbstractIterator.java |
from django.contrib.sites.shortcuts import get_current_site
from django.contrib.syndication.views import Feed
from django.utils.translation import ugettext as _
import django_comments
class LatestCommentFeed(Feed):
"""Feed of latest comments on the current site."""
def __call__(self, request, *args, **kwargs... | unknown | codeparrot/codeparrot-clean | ||
{
"NUMSUB": {
"summary": "Returns a count of subscribers to channels.",
"complexity": "O(N) for the NUMSUB subcommand, where N is the number of requested channels",
"group": "pubsub",
"since": "2.8.0",
"arity": -2,
"container": "PUBSUB",
"function": "pubsubCom... | json | github | https://github.com/redis/redis | src/commands/pubsub-numsub.json |
#!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import re, codecs, os
from collections import namedtuple
from calibre.customize import CatalogPlugin
from calibre.library.c... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Presidentielcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import PresidentielcoinTestFramework
from test_framework.util... | unknown | codeparrot/codeparrot-clean | ||
import geopandas as gpd
import matplotlib.pyplot as plt
import pandas as pd
from shapely.geometry import Point
from geopandas import GeoDataFrame
def read_em():
city = gpd.read_file('./stadi/kaupunginosat.dxf')
moottori = gpd.read_file('./stadi/klinj_moottorivayla.dxf')
alu_kok =... | unknown | codeparrot/codeparrot-clean | ||
import { AtRule, type ChildNode, type Plugin, type Root } from 'postcss'
const DEFAULT_LAYER_ORDER = ['theme', 'base', 'components', 'utilities']
export function migrateTailwindDirectives(options: { newPrefix: string | null }): Plugin {
let prefixParams = options.newPrefix ? ` prefix(${options.newPrefix})` : ''
... | typescript | github | https://github.com/tailwindlabs/tailwindcss | packages/@tailwindcss-upgrade/src/codemods/css/migrate-tailwind-directives.ts |
from booking.utils.database import get_db
from ..UserSource import UserSource
from ..User import User
from .DatabaseUser import DatabaseUser
from typing import List
class DatabaseUserSource(UserSource):
def __init__(self):
db = get_db()
db.create_table(DatabaseUser, safe=True)
self._db = d... | unknown | codeparrot/codeparrot-clean | ||
# Import a library of functions called 'pygame'
import pygame
from math import pi
# Initialize the game engine
pygame.init()
# Define the colors we will use in RGB format
BLACK = ( 0, 0, 0)
WHITE = (255, 255, 255)
BLUE = ( 0, 0, 255)
GREEN = ( 0, 255, 0)
RED = (255, 0, 0)
# Set the height and width... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# Copyright (c) 2014 Wladmir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the directory that... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2001-2006 Twisted Matrix Laboratories.
# See LICENSE for details.
import sys
from twisted.internet import reactor
from twisted.names.srvconnect import SRVConnector
from twisted.words.xish import domish
from twisted.words.protocols.jabber import xmlstream, client, jid
class XMPPClientConnector(SRVConne... | unknown | codeparrot/codeparrot-clean | ||
from utils_tsp import create_tsp_map, generate_population_tsp, estimate_population_tsp, select_population, estimate_solution_tsp
from utils_tsp import generate_subglobal_solution_tsp
from tsp_local_search import tsp_local_search
import random
def tsp_ga(number_of_cities=20, number_of_iterations=50, population_size = 1... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
#
# Copyright 2008-2010 WebDriver committers
# Copyright 2008-2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# _*_ coding: utf-8 _*_
import os
import sys
import shutil
from setuptools import setup, find_packages
banner = """
██████╗ ███████╗██╗ ██╗██████╗ ███████╗██████╗ ███╗ ██╗███████╗████████╗██╗ ██████╗███████╗
██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔════╝██╔══██╗████╗ ██║██╔════╝╚══██╔══╝██║██╔═══... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'embeddeddialog.ui'
#
# Created: Wed May 28 15:07:08 2008
# by: PyQt4 UI code generator 4.4.3-snapshot-20080526
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_embeddedDialog(object):
... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/core/graph/graph_node_util.h |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional;
use Symfony\Bundle\Fra... | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SerializerTest.php |
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS
#include <ATen/core/Tensor.h>
#include <ATen/Config.h>
#ifndef AT_PER_OPERATOR_HEADERS
#include <ATen/NativeFunctions.h>
#else
#include <ATen/ops/relu_native.h> // for mkldnn_relu, mkldnn_...
#include <ATen/ops/threshold_backward_native.h> // for mkldnn_relu_b... | cpp | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/mkldnn/Relu.cpp |
from django.contrib.auth import models as auth
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
# No related name is needed here, since symmetrical relations are not
# explicitly reversible.
@python_2_unicode_compatible
class SelfRefer(models.Model):
name = models.CharFiel... | unknown | codeparrot/codeparrot-clean | ||
import wx
import infernal_wireless_gui_project
import os
class Example(wx.Frame):
def __init__(self, parent, title):
super(Example, self).__init__(parent, title=title,
size=(600, 400))
self.InitUI()
self.Centre()
self.Show()
global MultiLine
isProject = False
... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (C) 2011 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | java | github | https://github.com/google/guava | android/guava-tests/benchmark/com/google/common/primitives/UnsignedLongsBenchmark.java |
import contextvars
from inspect import markcoroutinefunction
from unittest import mock
from django import dispatch
from django.apps.registry import Apps
from django.db import models
from django.db.models import signals
from django.dispatch import receiver
from django.test import SimpleTestCase, TestCase
from django.te... | python | github | https://github.com/django/django | tests/signals/tests.py |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | unknown | github | https://github.com/apache/airflow | .github/workflows/generate-constraints.yml |
#!/usr/local/bin/python3
__author__ = 'apaeffgen'
# -*- coding: utf-8 -*-
# This file is part of Panconvert.
#
# Panconvert 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 | ||
from django.conf.urls import patterns, include, url
from django.conf import settings
'''
Module that keeps url redirection settings.
@package logviewer.urls
@authors Deniz Eren
@authors Ibrahim Ercan
@authors Ersan Vural Zorlu
@authors Nijad Ahmadli
@copyright This project is released under BSD l... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import bisect
class OrderedDict(object):
def __init__(self, dictionary=None):
self.__keys = []
self.__dict = {}
if dictionary is not None:
if isinstance(dictionary, OrderedDict):
self.__dict = dictionary.__dict.copy()
self._... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2012 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/backward_references_enc.h |
# 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 | ||
# -*- coding: utf-8 -*-
from django.forms import Form, CharField, IntegerField, ValidationError, DateField
from django.forms.formsets import formset_factory, BaseFormSet
from django.test import TestCase
class Choice(Form):
choice = CharField()
votes = IntegerField()
# FormSet allows us to use multiple instanc... | unknown | codeparrot/codeparrot-clean | ||
//go:build !windows
package main
import (
"bufio"
"fmt"
"io"
"os/exec"
"strings"
"testing"
"time"
"github.com/moby/moby/v2/integration-cli/checker"
"github.com/moby/moby/v2/integration-cli/daemon"
"github.com/moby/moby/v2/internal/testutil"
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
"gotes... | go | github | https://github.com/moby/moby | integration-cli/docker_cli_service_logs_test.go |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import itertools
import os
from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.uix.widget import Widget
from kivy.uix.boxlayout import BoxLayout
from kivy.properties import NumericProperty, ObjectProperty
from kivy.clock import Clock
from kivy.gr... | 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.
"""Runs findbugs, and returns an error code if there are new warnings.
This runs findbugs with an additional flag to exclude know... | unknown | codeparrot/codeparrot-clean | ||
import sys
import pickle
import os
import getopt
from time import ctime
import numpy as np
usage = '''
USAGE: python xlsearch_train.py -l [path to xlsearch library]
-p [parameter file]
-o [output file]'''
(pairs, args) = getopt.getopt(sys.argv[1:], 'l:p:... | unknown | codeparrot/codeparrot-clean | ||
'use strict';
const common = require('../common.js');
const assert = require('assert');
const bench = common.createBenchmark(main, {
len: [64 * 1024 * 1024],
n: [32],
}, {
test: { len: 256 },
});
function main({ n, len }) {
const b = Buffer.allocUnsafe(len);
let s = '';
let i;
for (i = 0; i < 256; ++i) ... | javascript | github | https://github.com/nodejs/node | benchmark/buffers/buffer-base64url-encode.js |
import re
from django import template
from account.models import other_service
register = template.Library()
class OtherServiceNode(template.Node):
def __init__(self, user, key, asvar):
self.user = user
self.key = key
self.asvar = asvar
def render(self, context):
user = self.... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#----------------------------------------------------------------------------
# Name: Joystick.py
# Purpose: Demonstrate use of wx.Joystick
#
# Author: Jeff Grimmett (grimmtoo@softhome.net), adapted from original
# .wdr-derived demo
#
# Created: 02-Jan-2004
# Copy... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
"""Tests of run_santi_pipeline.py script."""
import os
import shutil
from argparse import Namespace
from nose.tools import nottest, assert_equal, with_setup
from pycits.scripts import santi_pipeline
NAMESPACE = Namespace(blastclust='blastclust',
convert_format='convert_... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
#
# Create Webfaction website using Ansible and the Webfaction API
#
# ------------------------------------------
#
# (c) Quentin Stafford-Fraser 2015
#
# 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 Lic... | unknown | codeparrot/codeparrot-clean | ||
#!/bin/sh
test_description='test protocol v2 server commands'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
test_expect_success 'setup to generate files with expected content' '
printf "agent=git/%s" "$(git version | cut -d" " -f3)" >agent_capability &&
tes... | unknown | github | https://github.com/git/git | t/t5701-git-serve.sh |
""" Test tmpdirs module """
from __future__ import division, print_function, absolute_import
from os import getcwd
from os.path import realpath, abspath, dirname, isfile, join as pjoin, exists
from scipy._lib._tmpdirs import tempdir, in_tempdir, in_dir
from numpy.testing import run_module_suite, assert_, assert_equa... | unknown | codeparrot/codeparrot-clean | ||
import gettext
import os
import shutil
import tempfile
from importlib import import_module
from unittest import mock
import _thread
from django import conf
from django.contrib import admin
from django.test import SimpleTestCase, override_settings
from django.test.utils import extend_sys_path
from django.utils import ... | unknown | codeparrot/codeparrot-clean | ||
use rand::{Rng, RngCore, SeedableRng};
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;
use tokio::sync::{broadcast, Notify};
use criterion::measurement::WallTime;
use criterion::{black_box, criterion_group, criterion_main, BenchmarkGroup, Criterion};
fn rt() -> tokio::runtime::Runtime {
tokio:... | rust | github | https://github.com/tokio-rs/tokio | benches/sync_broadcast.rs |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp import SUPERUSER_ID
from openerp.osv import fields, osv
class crm_configuration(osv.TransientModel):
_name = 'sale.config.settings'
_inherit = ['sale.config.settings', 'fetchmail.config.settings']
... | unknown | codeparrot/codeparrot-clean | ||
import argparse
import subprocess
def main(config_dir, config_name, args):
subprocess.run(
["optimum-benchmark", "--config-dir", f"{config_dir}", "--config-name", f"{config_name}"]
+ ["hydra/job_logging=disabled", "hydra/hydra_logging=disabled"]
+ args
)
if __name__ == "__main__":
... | python | github | https://github.com/huggingface/transformers | benchmark/optimum_benchmark_wrapper.py |
# 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 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.
"""Thread and ThreadGroup that reraise exceptions on the main thread."""
# pylint: disable=W0212
import logging
import sys
import threading
import time
impo... | unknown | codeparrot/codeparrot-clean | ||
<!-- BEGIN MUNGE: GENERATED_TOC -->
- [v1.10.13](#v11013)
- [Downloads for v1.10.13](#downloads-for-v11013)
- [Client Binaries](#client-binaries)
- [Server Binaries](#server-binaries)
- [Node Binaries](#node-binaries)
- [Changelog since v1.10.12](#changelog-since-v11012)
- [Other notable changes](#o... | unknown | github | https://github.com/kubernetes/kubernetes | CHANGELOG/CHANGELOG-1.10.md |
from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Spawn',
'Author': ['@harmj0y'],
'Description': ('Spawns a new agent in a new powershell.exe process.'),
'Background' : False,
'Outpu... | unknown | codeparrot/codeparrot-clean | ||
# This file is part of Indico.
# Copyright (C) 2002 - 2019 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
import mimetypes
from collections import OrderedDict
from datetim... | 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 | ||
---
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
Title: CURLOPT_COOKIEJAR
Section: 3
Source: libcurl
See-also:
- CURLOPT_COOKIE (3)
- CURLOPT_COOKIEFILE (3)
- CURLOPT_COOKIELIST (3)
Protocol:
- HTTP
Added-in: 7.9
---
# NAME
CURLOPT_COOKIEJAR - filename to store cook... | unknown | github | https://github.com/curl/curl | docs/libcurl/opts/CURLOPT_COOKIEJAR.md |
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
from typing_extensions import Literal, TypedDict
__all__ = ["MessageListParams"]
class MessageListParams(TypedDict, total=False):
after: str
"""Identifier for the last message from the pr... | python | github | https://github.com/openai/openai-python | src/openai/types/chat/completions/message_list_params.py |
import unittest
import numpy as np
import pandas as pd
import scipy.sparse
import smurff
import itertools
import collections
verbose = 0
class TestSmurff(unittest.TestCase):
# Python 2.7 @unittest.skip fix
__name__ = "TestSmurff"
def test_bpmf(self):
Y = scipy.sparse.rand(10, 20, 0.2)
Y,... | unknown | codeparrot/codeparrot-clean | ||
import { baseCompile } from '../../src'
describe('compiler: v-memo transform', () => {
function compile(content: string) {
return baseCompile(`<div>${content}</div>`, {
mode: 'module',
prefixIdentifiers: true,
}).code
}
test('on root element', () => {
expect(
baseCompile(`<div v-me... | typescript | github | https://github.com/vuejs/core | packages/compiler-core/__tests__/transforms/vMemo.spec.ts |
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
import os
from typing import Any, cast
import httpx
import pytest
from respx import MockRouter
import openai._legacy_response as _legacy_response
from openai import OpenAI, AsyncOpenAI
from tests... | python | github | https://github.com/openai/openai-python | tests/api_resources/test_files.py |
# Test case for the select.devpoll() function
# Initial tests are copied as is from "test_poll.py"
import os, select, random, unittest, sys
from test.support import TESTFN, run_unittest, cpython_only
try:
select.devpoll
except AttributeError:
raise unittest.SkipTest("select.devpoll not defined -- skipping te... | unknown | codeparrot/codeparrot-clean | ||
import unittest
from totalopenstation.formats import Feature, LineString, Point
from totalopenstation.output.tops_dxf import OutputFormat
class TestCSVOutput(unittest.TestCase):
def setUp(self):
self.data = [
Feature(Point(12.8, 76.3, 56.2),
desc='TESTPOINT',
... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.