code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
<?php
namespace Illuminate\Console\Concerns;
use Symfony\Component\Console\Completion\CompletionInput;
use Symfony\Component\Console\Completion\CompletionSuggestions;
use Symfony\Component\Console\Completion\Suggestion;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption... | php | github | https://github.com/laravel/framework | src/Illuminate/Console/Concerns/HasParameters.php |
- Feature Name: Adding new SQL features with syntax - recommendations
- Status: active
- Start Date: 2017-08-06
- Authors: knz, Dan Harrison, Andrew Couch
- RFC PR: #17569
- Cockroach Issue: N/A
# Summary
This RFC recommends some general steps for projects that add features
visible through SQL syntax (either by addin... | unknown | github | https://github.com/cockroachdb/cockroach | docs/RFCS/20171011_adding_sql_syntax.md |
from langchain_core.exceptions import TracerException
from langchain_core.tracers.base import BaseTracer
__all__ = ["BaseTracer", "TracerException"] | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/schema/callbacks/tracers/base.py |
#ifndef RUBY_ID_TABLE_H
#define RUBY_ID_TABLE_H 1
#include "ruby/internal/config.h"
#include <stddef.h>
#include "ruby/ruby.h"
struct rb_id_table;
/* compatible with ST_* */
enum rb_id_table_iterator_result {
ID_TABLE_CONTINUE = ST_CONTINUE,
ID_TABLE_STOP = ST_STOP,
ID_TABLE_DELETE = ST_DELETE,
... | c | github | https://github.com/ruby/ruby | id_table.h |
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is based on
# Lib/posixpath.py of cpython
# It is licensed under the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
#
# 1. This LICENSE AGREEMENT is between the Python Software Foundation
# ("PSF")... | unknown | codeparrot/codeparrot-clean | ||
/*-------------------------------------------------------------------------
*
* hashsort.c
* Sort tuples for insertion into a new hash index.
*
* When building a very large hash index, we pre-sort the tuples by bucket
* number to improve locality of access to the index, and thereby avoid
* thrashing. We use tu... | c | github | https://github.com/postgres/postgres | src/backend/access/hash/hashsort.c |
#!/usr/bin/env python
# Copyright (C) 2011 Genome Research Limited -- See full notice at end
# of module.
# Create a plot of ZMW productivity by x/y position on the
# SMRTcell. First parameter is input .bas.h5 file. Output png file is
# optional command line parameter, defaulting to productivity.png.
import sys
impo... | unknown | codeparrot/codeparrot-clean | ||
import pytest
import rpm_version
expected_pkgs = {
"spam": {
"name": "spam",
"version": "3.2.1",
},
"eggs": {
"name": "eggs",
"version": "3.2.1",
},
}
@pytest.mark.parametrize('pkgs, expect_not_found', [
(
{},
["spam", "eggs"], # none found
),
... | unknown | codeparrot/codeparrot-clean | ||
# TODO.TXT-CLI-python test script
# Copyright (C) 2011-2012 Sigmavirus24, Jeff Stein
#
# 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) any... | unknown | codeparrot/codeparrot-clean | ||
"""Fixer for __metaclass__ = X -> (metaclass=X) methods.
The various forms of classef (inherits nothing, inherits once, inherints
many) don't parse the same in the CST so we look at ALL classes for
a __metaclass__ and if we find one normalize the inherits to all be
an arglist.
For one-liner classes ('c... | unknown | codeparrot/codeparrot-clean | ||
__author__ = 'tan'
from juliabox.jbox_tasks import JBPluginTask
from juliabox.interactive import SessContainer
from juliabox.srvr_jboxd import jboxd_method
from user_cluster import UserCluster
class ParallelHousekeep(JBPluginTask):
provides = [JBPluginTask.JBP_CLUSTER]
@staticmethod
def terminate_or_dele... | unknown | codeparrot/codeparrot-clean | ||
prelude: |
def call(*val)
case val
in [String => body]
[200, {}, [body]]
in [Integer => status]
[status, {}, [""]]
in [Integer, String] => response
[response[0], {}, [response[1]]]
in [Integer, Hash, String] => response
[response[0], response[1], [response[2... | unknown | github | https://github.com/ruby/ruby | benchmark/pm_array.yml |
import {ApplicationConfig} from '@angular/core';
import {routes} from './app.routes';
import {provideRouter} from '@angular/router';
import {provideProtractorTestingSupport} from '@angular/platform-browser';
import {provideAnimations} from '@angular/platform-browser/animations';
export const appConfig: ApplicationConf... | typescript | github | https://github.com/angular/angular | adev/src/content/examples/animations/src/app/app.config.ts |
__author__ = 'amelie'
from math import sqrt
from mock import Mock
import unittest2
import numpy
from preimage.inference.bound_calculator import BoundCalculatorMock
from preimage.inference.node import MaxNode
from preimage.inference.node_creator import NodeCreator
class TestNodeCreator(unittest2.TestCase):
def s... | unknown | codeparrot/codeparrot-clean | ||
"""
Creates permissions for all installed apps that need permissions.
"""
from __future__ import unicode_literals
import getpass
import unicodedata
from django.apps import apps
from django.contrib.auth import models as auth_app, get_permission_codename
from django.core import exceptions
from django.core.management.ba... | unknown | codeparrot/codeparrot-clean | ||
from vint.ast.node_type import NodeType
from vint.linting.level import Level
from vint.linting.policy.abstract_policy import AbstractPolicy
from vint.linting.policy_registry import register_policy
from vint.ast.plugin.scope_plugin import ExplicityOfScopeVisibility
@register_policy
class ProhibitImplicitScopeVariable(A... | unknown | codeparrot/codeparrot-clean | ||
from django.test import TestCase
from django.utils.translation import ugettext_lazy as _
from userena import forms
from userena import settings as userena_settings
from userena.utils import get_user_model
class SignupFormTests(TestCase):
""" Test the signup form. """
fixtures = ['users']
def test_signup_... | unknown | codeparrot/codeparrot-clean | ||
imports:
- { resource: ../config/default.yml }
framework:
type_info: ~
json_streamer:
default_options:
include_null_properties: true
custom_key: custom_value
services:
_defaults:
autoconfigure: true
json_streamer.stream_writer.alias:
alias: json_str... | unknown | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/JsonStreamer/config.yml |
# Copyright 2015-2017 Capital One Services, LLC
#
# 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 | codeparrot/codeparrot-clean | ||
from datetime import timedelta
from flask import make_response, request, current_app
from functools import update_wrapper
def crossdomain(origin=None, methods=None, headers=None,
max_age=21600, attach_to_all=True,
automatic_options=True):
if methods is not None:
methods = ',... | unknown | codeparrot/codeparrot-clean | ||
import operator
import sys
import traceback
from pprint import pprint
import random
import collections
def is_iterable(item):
return isinstance(item, collections.Iterable) and not isinstance(item,str)
def is_not_iterable(item):
return not isinstance(item, collections.Iterable)
def flatten(x):
if isinstan... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package arguments
// View represents the global command-line arguments which configure the view.
type View struct {
// NoColor is used to disable the use of terminal color codes in all
// output.
NoColor bool
// CompactWarnings is used to coal... | go | github | https://github.com/hashicorp/terraform | internal/command/arguments/view.go |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | unknown | codeparrot/codeparrot-clean | ||
'''
pathmtu.py
Created on: May 14, 2009
Authors: dh
$LastChangedBy$
$LastChangedDate$
$Revision$
(C) 2008-2009 by Computer Networks and Internet, University of Tuebingen
This file is part of UNISONO Unified Information Service for Overlay
Network Optimization.
UNISONO is free software: you can redistribut... | unknown | codeparrot/codeparrot-clean | ||
#
# Copyright (c) 2012-2016 The ANTLR Project. All rights reserved.
# Use of this file is governed by the BSD 3-clause license that
# can be found in the LICENSE.txt file in the project root.
#/
# Map a predicate to a predicted alternative.#/
from io import StringIO
from antlr4.atn.ATNConfigSet import ATNConfigSet
cl... | unknown | codeparrot/codeparrot-clean | ||
from django.conf import settings
from django.shortcuts import get_object_or_404, redirect
from django.template.response import TemplateResponse
from django.utils.translation import get_language_from_request
from oioioi.base.permissions import enforce_condition, is_superuser
from oioioi.newsfeed.forms import NewsLangua... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2017 Presslabs SRL
#
# 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 writ... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-boot | core/spring-boot/src/main/java/org/springframework/boot/logging/CorrelationIdFormatter.java |
# Copyright (c) 2012 OpenStack Foundation
#
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
from totalimpact.providers import provider
from totalimpact.providers.provider import Provider, ProviderContentMalformedError
import re
import logging
logger = logging.getLogger('ti.providers.figshare')
class Figshare(Provider):
example_id = ("doi", "10.6084/m9.figshare.92393")
url = "http://figshare.com"
... | unknown | codeparrot/codeparrot-clean | ||
import pytest
from pandas._libs.tslibs.dtypes import NpyDatetimeUnit
from pandas.errors import OutOfBoundsTimedelta
from pandas import Timedelta
class TestAsUnit:
def test_as_unit(self):
td = Timedelta(days=1)
assert td.as_unit("us") is td
res = td.as_unit("ns")
assert res._valu... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/scalar/timedelta/methods/test_as_unit.py |
# -*- coding: utf-8 -*-
"""
Deployment publishing operations module
"""
import codecs
import os
import shutil
import hashlib
import datetime
import ZipHelper
import xmlParamsHealper
import JsonParamsHelper
class PublisherHealperConfig:
"""Class for setting up publisher Healper"""
moduleName = "" # name o... | unknown | codeparrot/codeparrot-clean | ||
"""
Watches the key ``paste.httpserver.thread_pool`` to see how many
threads there are and report on any wedged threads.
"""
import sys
import cgi
import time
import traceback
from cStringIO import StringIO
from thread import get_ident
from paste import httpexceptions
from paste.request import construct_url, parse_form... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2014 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.
/*
Pack is a simple version of the traditional Unix ar tool.
It implements only the operations needed by Go.
Usage:
go tool pack op file.a [name...]
Pack ap... | go | github | https://github.com/golang/go | src/cmd/pack/doc.go |
"""ML-Ensemble
:author: Sebastian Flennerhag
:copyright: 2017-2018
:license: MIT
Parallel processing backend classes. Manages memory-mapping of data, estimation
caching and job scheduling.
"""
# pylint: disable=too-few-public-methods
# pylint: disable=too-many-arguments
# pylint: disable=too-many-instance-attributes
... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
import pytest
from pandas._libs.tslibs import IncompatibleFrequency
from pandas import (
DataFrame,
Period,
Series,
Timestamp,
date_range,
period_range,
to_datetime,
)
import pandas._testing as tm
@pytest.fixture
def date_range_frame():
"""
Fixture for DataFrame... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/frame/methods/test_asof.py |
/* NOLINT(build/header_guard) */
/* Copyright 2010 Google Inc. All Rights Reserved.
Distributed under MIT license.
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/
/* template parameters: FN */
/* A (forgetful) hash table to the data seen by the compressor, to
help create backward ... | c | github | https://github.com/nodejs/node | deps/brotli/c/enc/hash_longest_match_simd_inc.h |
from couchpotato.core.event import fireEvent
from couchpotato.core.helpers.encoding import tryUrlencode
from couchpotato.core.helpers.rss import RSS
from couchpotato.core.helpers.variable import cleanHost
from couchpotato.core.logger import CPLog
from couchpotato.core.providers.nzb.base import NZBProvider
from couchpot... | unknown | codeparrot/codeparrot-clean | ||
import logging
from langchain_core.callbacks import (
AsyncCallbackManagerForRetrieverRun,
CallbackManagerForRetrieverRun,
)
from langchain_core.documents import Document
from langchain_core.language_models import BaseLLM
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts imp... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/retrievers/re_phraser.py |
<!--Copyright 2022 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/pt/pipeline_tutorial.md |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | unknown | codeparrot/codeparrot-clean | ||
"""
Django settings for kanban project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
imp... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2023 The etcd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed t... | go | github | https://github.com/etcd-io/etcd | tests/robustness/validate/patch_history_test.go |
# Merge a pull request
When a pull request has been reviewed and approved by at least one person and all checks have passed, then it's time to merge the pull request.
## Who is expected to merge a pull request?
Maintainers are responsible for merging all pull requests. If a maintainer has opened a pull request, then... | unknown | github | https://github.com/grafana/grafana | contribute/merge-pull-request.md |
# -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'French Payroll',
'category': 'Localization/Payroll',
'author': 'Yannick Buron (SYNERPGY)',
'depends': ['hr_payroll', 'l10n_fr'],
'version': '1.0',
'description': """
French Payroll Rul... | unknown | codeparrot/codeparrot-clean | ||
/*
* 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-context/src/main/java/org/springframework/context/annotation/ClassPathBeanDefinitionScanner.java |
# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for has_key().
Calls to .has_key() methods are expressed in terms of the 'in'
operator:
d.has_key(k) -> k in d
CAVEATS:
1) While the primary target of this fixer is dict.has_key(), the
fixer will chan... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2013 OpenStack Foundation
#
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
# Some simple queue module tests, plus some failure conditions
# to ensure the Queue locks remain stable.
import queue
import time
import unittest
from test import support
threading = support.import_module('threading')
QUEUE_SIZE = 5
def qfull(q):
return q.maxsize > 0 and q.qsize() == q.maxsize
# A thread to run... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Wrapper script for launching application within the sel_ldr.
"""
import optparse
import os
import subprocess
import sys
import cre... | unknown | codeparrot/codeparrot-clean | ||
#!python
# uses raw_input in Python 2.X
# add triple quotes around a test you don't wish to run
import sys
if sys.version[0] == '2': input = raw_input # 2.X compatible
print('test1')
while True:
reply = input('Enter text:')
if reply == 'stop': break
print(reply.upper())
print('test2')
while True:
r... | unknown | codeparrot/codeparrot-clean | ||
from django.utils.encoding import python_2_unicode_compatible
from ..models import models
from ..utils import gisfield_may_be_null
@python_2_unicode_compatible
class NamedModel(models.Model):
name = models.CharField(max_length=30)
objects = models.GeoManager()
class Meta:
abstract = True
... | unknown | codeparrot/codeparrot-clean | ||
from datetime import (
time,
timezone,
)
import zoneinfo
import numpy as np
import pytest
from pandas._libs.tslibs import timezones
from pandas.errors import Pandas4Warning
from pandas import (
DataFrame,
date_range,
)
import pandas._testing as tm
class TestAtTime:
@pytest.mark.parametrize("tzst... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/frame/methods/test_at_time.py |
import assert from 'assert';
import axios, {CanceledError, AxiosError, AxiosHeaders} from 'axios';
import settle from 'axios/unsafe/core/settle.js';
assert.strictEqual(typeof axios, 'function');
assert.strictEqual(typeof CanceledError, 'function');
assert.strictEqual(typeof AxiosError, 'function');
assert.strictEqual(... | javascript | github | https://github.com/axios/axios | test/module/esm/index.js |
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package terraform
import (
"strings"
"github.com/hashicorp/hcl/v2"
"github.com/hashicorp/hcl/v2/hclsyntax"
"github.com/zclconf/go-cty/cty"
"github.com/hashicorp/terraform/internal/addrs"
"github.com/hashicorp/terraform/internal/instances"
... | go | github | https://github.com/hashicorp/terraform | internal/terraform/evaluate_triggers.go |
#==========================================================================
#
# Copyright Insight Software Consortium
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2016 The etcd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed t... | go | github | https://github.com/etcd-io/etcd | pkg/contention/contention.go |
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
static ngx_uint_t mday[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
time_t
ngx_parse_http_time(u_char *value, size_t len)
{
u_char *p, *end;
ngx_int_t month;
ngx_uint_t day... | c | github | https://github.com/nginx/nginx | src/core/ngx_parse_time.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 ... | java | github | https://github.com/apache/hadoop | hadoop-cloud-storage-project/hadoop-gcp/src/main/java/org/apache/hadoop/fs/gs/GoogleCloudStorageClientWriteChannel.java |
#!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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 | ||
import os
from qtpy import QtGui, compat
from glue.viewers.common.tool import Tool, CheckableTool
from glue.config import viewer_tool
from vispy import app, io
RECORD_START_ICON = os.path.join(os.path.dirname(__file__), 'glue_record_start.png')
RECORD_STOP_ICON = os.path.join(os.path.dirname(__file__), 'glue_recor... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.client.webrtc
import WebRTC.RTCDataBuffer
import WebRTC.RTCDataChannel
import WebRTC.RTCDataChannelDelegateProtocol
import kotlinx.cinterop.ExperimentalForeignApi
import kotli... | kotlin | github | https://github.com/ktorio/ktor | ktor-client/ktor-client-webrtc/ios/src/io/ktor/client/webrtc/DataChannel.kt |
"""HTML utilities suitable for global use."""
from __future__ import unicode_literals
import re
import string
try:
from urllib.parse import quote, unquote, urlsplit, urlunsplit
except ImportError: # Python 2
from urllib import quote, unquote
from urlparse import urlsplit, urlunsplit
from django.utils... | unknown | codeparrot/codeparrot-clean | ||
"""Getting uniprot txt files for proteins
parsing them
loading parsed data."""
import os, time, sys
import files
from collections import defaultdict
def parseProteinName(protein):
with open(mkTxtFile(protein)) as f:
for line in f:
# DE RecName: Full=Fatty acid synthase;
if l... | unknown | codeparrot/codeparrot-clean | ||
from .base import TestCase
import os
import mock
import shutil
import time
from django.conf import settings
import whisper
import gzip
from graphite.readers import WhisperReader, GzippedWhisperReader
from graphite.wsgi import application # NOQA makes sure we have a working WSGI app
class WhisperReadersTests(TestC... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""
Convert the X11 locale.alias file into a mapping dictionary suitable
for locale.py.
Written by Marc-Andre Lemburg <mal@genix.com>, 2004-12-10.
"""
import locale
# Location of the alias file
LOCALE_ALIAS = '/usr/lib/X11/locale/locale.alias'
def parse(filename):
f = open(fil... | unknown | codeparrot/codeparrot-clean | ||
from test.support import verbose, run_unittest, import_module, reap_children
#Skip these tests if either fcntl or termios is not available
fcntl = import_module('fcntl')
import_module('termios')
import errno
import pty
import os
import sys
import select
import signal
import socket
import unittest
TEST_STRING_1 = b"I... | unknown | codeparrot/codeparrot-clean | ||
"""Test the example module auth module."""
from homeassistant import auth, data_entry_flow
from homeassistant.auth.mfa_modules import auth_mfa_module_from_config
from homeassistant.auth.models import Credentials
from tests.common import MockUser
async def test_validate(hass):
"""Test validating pin."""
auth_mo... | unknown | codeparrot/codeparrot-clean | ||
from collections import defaultdict
from openerp.tools import mute_logger
from openerp.tests import common
UID = common.ADMIN_USER_ID
class TestORM(common.TransactionCase):
""" test special behaviors of ORM CRUD functions
TODO: use real Exceptions types instead of Exception """
def setUp(self):
... | unknown | codeparrot/codeparrot-clean | ||
# NOTE: This is a common file that is overwritten by realm/ci-actions sync service
# and should only be modified in that repository.
# syntax - https://github.com/redhat-plumbers-in-action/advanced-issue-labeler#policy
# Below keys map from the option used in issue form dropdowns to issue labels
# Limitation:
# Curren... | unknown | github | https://github.com/realm/realm-swift | .github/advanced-issue-labeler.yml |
#
# Author:: Matthew Kent (<mkent@magoazul.com>)
# Copyright:: Copyright (c) 2009, 2011 Matthew Kent
# License:: Apache License, Version 2.0
#
# 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
#
... | unknown | codeparrot/codeparrot-clean | ||
def maxmin(a, type):
if operation == 'max':
type = True
else:
type = False
height = len(a)
matrix = [[0] * height for row in xrange(height)]
for nr_signs in range(height):
matrix[nr_signs][nr_signs] = int(a[nr_signs])
for nr_signs in range(1, height): # loop total numbe... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2022 The etcd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed t... | go | github | https://github.com/etcd-io/etcd | tests/common/integration_test.go |
['../evaluation_tmp.py', '10000']
mnist classes = 2
size: 10000
(2609,)
(7391,)
data size: 10000, nu: 0.2, gamma: 1
============ 1. Fold of CV ============
1) Incremental OCSVM
0 data points processed
1000 data points processed
2000 data points processed
3000 data points processed
4000 data points processed
5000 data p... | unknown | codeparrot/codeparrot-clean | ||
"""This test checks for correct wait4() behavior.
"""
import os
import sys
import unittest
from test.fork_wait import ForkWait
from test import support
# If either of these do not exist, skip this test.
if not support.has_fork_support:
raise unittest.SkipTest("requires working os.fork()")
support.get_attribute(o... | python | github | https://github.com/python/cpython | Lib/test/test_wait4.py |
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Tests\Queue;
use Illuminate\Database\Capsule\Manager as DB;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Queue\Failed\DatabaseUuidFailedJobProvider;
use Illuminate\Support\Carbon;
use Illuminate\Support\Str;
use PHPUnit\Framework\TestCase;
use RuntimeException;
class DatabaseUu... | php | github | https://github.com/laravel/framework | tests/Queue/DatabaseUuidFailedJobProviderTest.php |
#!/usr/bin/env python
import os, sys, re, shutil
from optparse import OptionParser, OptionGroup, Values
# Determine the MOOSE Directory
MOOSE_PYTHON_DIR = None
if os.environ.has_key('MOOSE_DIR'):
MOOSE_PYTHON_DIR = os.path.join(os.environ['MOOSE_DIR'], 'python')
else:
MOOSE_PYTHON_DIR = os.path.join(os.path.split(... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
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) any later version.
This prog... | unknown | codeparrot/codeparrot-clean | ||
{
"name": "vault",
"version": "0.0.0",
"description": "The official UI for Vault by HashiCorp",
"repository": "",
"author": "",
"directories": {
"doc": "doc",
"test": "tests"
},
"scripts": {
"postinstall": "pnpm build:jsondiffpatch",
"build": "pnpm build:jsondiffpatch && ember build --en... | json | github | https://github.com/hashicorp/vault | ui/package.json |
package kotlinx.coroutines.internal
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFalse
import kotlin.test.assertTrue
class LinkedListTest {
data class IntNode(val i: Int) : LockFreeLinkedListNode()
@Test
fun testSimpleAddLastRemove() {
val list = LockFreeLinked... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | kotlinx-coroutines-core/jsAndWasmShared/test/internal/LinkedListTest.kt |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | unknown | codeparrot/codeparrot-clean | ||
#pragma once
// ${generated_comment}
#ifdef TORCH_ASSERT_NO_OPERATORS
#error This change adds a dependency on native_functions.yaml, \
meaning the file will need to be re-compiled every time an operator \
is changed or added. Consider if your change would be better placed in \
another file, o... | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/templates/MethodOperators.h |
from django.conf import settings
from django.contrib.flatpages.models import FlatPage
from django.contrib.sites.models import get_current_site
from django.http import Http404, HttpResponse, HttpResponsePermanentRedirect
from django.shortcuts import get_object_or_404
from django.template import loader, RequestContext
fr... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2013 Kitware 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 cop... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright (c) 2014, 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 | sql/malloc_allocator.h |
"""This module contains all the request handlers for the service."""
import httplib
import logging
import tornado.web
import tor_async_util
from . import __api_version__
import async_actions
import jsonschemas
from .. import request_handlers
_logger = logging.getLogger(__name__)
class RequestHandler(request_handle... | unknown | codeparrot/codeparrot-clean | ||
"""
===================================================
Recursive feature elimination with cross-validation
===================================================
A recursive feature elimination example with automatic tuning of the
number of features selected with cross-validation.
"""
print(__doc__)
import matplotlib.p... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from pelican.generators import ArticlesGenerator
from pelican.tests.support import unittest, get_settings
from tempfile import mkdtemp
from shutil import rmtree
import photos
CUR_DIR = os.path.dirname(__file__)
class TestPhotos(unittest.TestCa... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-boot | core/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionalOnMissingFilterBean.java |
#!/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.
import os
import re
import subprocess
import sys
"""Prints the lowest locally available SDK version greater than or equal to a
giv... | unknown | codeparrot/codeparrot-clean | ||
import { expect, it } from 'vitest'
import { toKeyPath } from './to-key-path'
it('can convert key paths to arrays', () => {
expect(toKeyPath('fontSize.xs')).toEqual(['fontSize', 'xs'])
expect(toKeyPath('fontSize.xs[1].lineHeight')).toEqual(['fontSize', 'xs', '1', 'lineHeight'])
expect(toKeyPath('colors.red.500')... | typescript | github | https://github.com/tailwindlabs/tailwindcss | packages/tailwindcss/src/utils/to-key-path.test.ts |
/*
* 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-context/src/main/java/org/springframework/context/support/AbstractRefreshableApplicationContext.java |
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/dma/socionext,uniphier-xdmac.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Socionext UniPhier external DMA controller
description: |
This describes the devicetree bindings for an external... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/dma/socionext,uniphier-xdmac.yaml |
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
#![allow(clippy::result_large_err)]
use serde::de::DeserializeOwned;
use serde_json::Value;
use std::ffi::OsStr;
use std::path::{Path, PathBuf};
use thiserror::Error;
/// All e... | rust | github | https://github.com/tauri-apps/tauri | crates/tauri-utils/src/config_v1/parse.rs |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 NEC Corporation
# 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... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import print_function, division
import matplotlib
import logging
from sys import stdout
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import (Net, RealApplianceSource,
BLSTMLayer, DimshuffleLayer,
Bidirectiona... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
from __future__ import unicode_literals
import time
import math
import os.path
import re
from .common import InfoExtractor
from ..compat import (
compat_html_parser,
compat_urllib_parse,
compat_urllib_request,
compat_urlparse,
)
from ..utils import ExtractorError
class GroovesharkHtml... | unknown | codeparrot/codeparrot-clean | ||
from django.forms.widgets import Widget, HiddenInput, TextInput
from django.utils.safestring import mark_safe
class AutoCompleteWidget(Widget):
"""
Widget that presents an <input> field that can be used to search for
objects instead of a giant <select> field
You will need to include jQuery UI with aut... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.