code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
#!/usr/bin/env bash
# Copyright IBM Corp. 2016, 2025
# SPDX-License-Identifier: BUSL-1.1
set -e
binpath=${VAULT_INSTALL_DIR}/vault
fail() {
echo "$1" 2>&1
return 1
}
retry() {
local retries=$1
shift
local count=0
until "$@"; do
exit=$?
wait=$((2 ** count))
count=$((count + 1))
if [ "$co... | unknown | github | https://github.com/hashicorp/vault | enos/modules/vault_verify_raft_auto_join_voter/scripts/verify-raft-auto-join-voter.sh |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'Y. F j.'
TIME_FORMAT = 'G.i.s'
DA... | unknown | codeparrot/codeparrot-clean | ||
# tk common colour chooser dialogue
#
# this module provides an interface to the native color dialogue
# available in Tk 4.2 and newer.
#
# written by Fredrik Lundh, May 1997
#
# fixed initialcolor handling in August 1998
#
#
# options (all have default values):
#
# - initialcolor: colour to mark as selected when dial... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__doc__ = """
if you have a set of SDSS magnitudes at a given redshift, you can get
the stellar mass by doing the following:
from mass_to_light import *
sdss_z09(sdssmags,z=redshift,color = 'r-z')
If you want to change the cosmology usead you should modify the source code... | unknown | codeparrot/codeparrot-clean | ||
from test.vim_test_case import VimTestCase as _VimTest
from test.constant import *
# Tab Completion of Words {{{#
class Completion_SimpleExample_ECR(_VimTest):
snippets = ('test', '$1 ${1:blah}')
keys = 'superkallifragilistik\ntest' + EX + 'sup' + COMPL_KW + \
COMPL_ACCEPT + ' some more'
wanted =... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | unknown | codeparrot/codeparrot-clean | ||
from django.contrib.gis.db import models
from django.db import connection
from django.db.models import Index
from django.test import TransactionTestCase
from django.test.utils import isolate_apps
from .models import City
class SchemaIndexesTests(TransactionTestCase):
available_apps = []
models = [City]
d... | python | github | https://github.com/django/django | tests/gis_tests/geoapp/test_indexes.py |
# This import fixes sys.path issues
from . import parentpath
import os
import sys
import glob
import string
import random
import psutil
import tempfile
from cacheman import cacher
from cacheman.utils import random_name
from cacheman.registers import generate_pickle_path, generate_csv_path
class CacheCommonAsserter(ob... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2015 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 | etcdctl/ctlv3/command/doc.go |
// 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 net
import (
"internal/syscall/unix"
"syscall"
)
// Linux stores the backlog as:
//
// - uint16 in kernel version < 4.1,
// - uint32 in kernel v... | go | github | https://github.com/golang/go | src/net/sock_linux.go |
# 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 applica... | python | github | https://github.com/tensorflow/tensorflow | tensorflow/examples/custom_ops_doc/multiplex_4/multiplex_2_save.py |
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | c | github | https://github.com/llvm/llvm-project | clang-tools-extra/clang-tidy/readability/StaticAccessedThroughInstanceCheck.h |
#!/usr/bin/python
# Compile document to HTML use docutils.
# ========================================
# Pygments syntax highlighting
# ========================================
from pygments.formatters import HtmlFormatter
# Set to True if you want inline CSS styles instead of classes
INLINESTYLES = True
from pygment... | unknown | codeparrot/codeparrot-clean | ||
""" Client commands """
from datetime import datetime
from pprint import pprint
from steward.colors import green, red, yellow, magenta
def _fuzzy_timedelta(td):
""" Format a timedelta into a *loose* 'X time ago' string """
ago_str = lambda x, y: '%d %s%s ago' % (x, y, 's' if x > 1 else '')
if td.days > 0:... | unknown | codeparrot/codeparrot-clean | ||
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2014 OpenERP S.A. (<http://openerp.com).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pu... | unknown | codeparrot/codeparrot-clean | ||
# swift_build_support/workspace.py ------------------------------*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.tx... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
***************************************************************************
menus.py
---------------------
Date : February 2016
Copyright : (C) 2016 by Victor Olaya
Email : volayaf at gmail dot com
*******************************... | 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/test/java/org/springframework/aop/config/AopNamespaceHandlerTests.java |
"""Test seeking on files.
"""
import io
import rarfile
from nose.tools import *
ARC = 'test/files/seektest.rar'
def do_seek(f, pos, lim):
ofs = pos*4
fsize = lim*4
if ofs < 0:
exp = 0
elif ofs > fsize:
exp = fsize
else:
exp = ofs
f.seek(ofs)
got = f.tell()
... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import division, print_function
import os
import genapi
from genapi import \
TypeApi, GlobalVarApi, FunctionApi, BoolValuesApi
import numpy_api
# use annotated api when running under cpychecker
h_template = r"""
#if defined(_MULTIARRAYMODULE) || defined(WITH_CPYCHECKER_STEALS_REFERENCE_TO_AR... | 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 applica... | unknown | github | https://github.com/tensorflow/tensorflow | .github/workflows/osv-scanner-scheduled.yml |
import copy
import datetime
import binascii
from django.utils import six
from django.utils.text import force_text
from django.db.backends.schema import BaseDatabaseSchemaEditor
from django.db.utils import DatabaseError
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
sql_create_column = "ALTER TABLE %(table... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
/**
* 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-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ftp/FtpConfigKeys.java |
# -*- coding: utf-8 -*-
import json
import uuid
from hashlib import md5
from urllib import urlencode
import requests
from website import settings
class PiwikException(Exception):
pass
def _create_user(user):
""" Given an OSF user, creates a Piwik user.
"""
login = 'osf.' + user._id
pw = str(uui... | unknown | codeparrot/codeparrot-clean | ||
# CudaPy module
from ctypes import *
import hashlib, subprocess, tempfile, os.path
from pkg_resources import resource_filename
from cudatypes import *
from template import Template, parseSig
from wrapper import wrapper
# Load the py2cuda library
py2cudaLib = cdll.LoadLibrary(resource_filename(__name__, 'py2cuda.so'))... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2011 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 net
import (
"context"
"errors"
"internal/bytealg"
"internal/strconv"
"internal/stringslite"
"io"
"os"
)
// cgoAvailable set to true to indicat... | go | github | https://github.com/golang/go | src/net/lookup_plan9.go |
# Copyright 2013 - Mirantis, Inc.
# Copyright 2015 - StackStorm, 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-2.0
#
# Unl... | unknown | codeparrot/codeparrot-clean | ||
from pycp2k.inputsection import InputSection
class _each6(InputSection):
def __init__(self):
InputSection.__init__(self)
self.Just_energy = None
self.Powell_opt = None
self.Qs_scf = None
self.Xas_scf = None
self.Md = None
self.Pint = None
self.Metadyn... | unknown | codeparrot/codeparrot-clean | ||
"""
Many-to-many relationships via an intermediary table
For many-to-many relationships that need extra fields on the intermediary
table, use an intermediary model.
In this example, an ``Article`` can have multiple ``Reporter`` objects, and
each ``Article``-``Reporter`` combination (a ``Writer``) has a ``position``
f... | unknown | codeparrot/codeparrot-clean | ||
"""Tests for mobile_app component."""
# pylint: disable=redefined-outer-name,unused-import
import pytest
from homeassistant.components.mobile_app.const import DOMAIN
from homeassistant.setup import async_setup_component
from .const import REGISTER, REGISTER_CLEARTEXT
from tests.common import mock_device_registry
@p... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env/python
#-*- coding:utf-8 -*-
__author__ = 'BlackYe.'
from golismero.api.config import Config
from golismero.api.data.information.html import HTML
from golismero.api.data.information.text import Text
from golismero.api.data.resource.email import Email
from golismero.api.parallel import pmap
from golisme... | unknown | codeparrot/codeparrot-clean | ||
# Module doctest.
# Released to the public domain 16-Jan-2001, by Tim Peters (tim@python.org).
# Major enhancements and refactoring by:
# Jim Fulton
# Edward Loper
# Provided as-is; use at your own risk; no warranty; no promises; enjoy!
try:
basestring
except NameError:
basestring = str,unicode
try:
... | unknown | codeparrot/codeparrot-clean | ||
from django.utils.translation import ugettext as _, ugettext_lazy as _lazy
from django.core import urlresolvers
from django.db import transaction
from gasistafelice.rest.views.blocks.base import BlockSSDataTables, ResourceBlockAction, CREATE_PDF
from gasistafelice.lib.shortcuts import render_to_xml_response, render_t... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# create a rendering window and renderer
ren1 = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren1)
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(r... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding:utf-8 -*-
__author__ = 'l00293089@huawei'
import threading
import os
import json
from heat.openstack.common import log as logging
from conf_util import *
LOG = logging.getLogger(__name__)
subnet_manager_lock = threading.Lock()
SUBNET_ID_MAX = 129
class SubnetManager(object):
def __init__(self):
... | unknown | codeparrot/codeparrot-clean | ||
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2015 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free S... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
jinja2.testsuite.utils
~~~~~~~~~~~~~~~~~~~~~~
Tests utilities jinja uses.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import gc
import unittest
import pickle
from jinja2.testsuite import JinjaTestCase
from jinja2.utils imp... | unknown | codeparrot/codeparrot-clean | ||
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr
from frappe import _
import json
from frappe.model.document import Document
class CustomField(Document):
def autoname(self):
self.s... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.analysis.api.platform.packages
import org.jetbrains.kotlin.analysis.api.KaPlatfo... | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-platform-interface/src/org/jetbrains/kotlin/analysis/api/platform/packages/KotlinEmptyPackageProvider.kt |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | unknown | codeparrot/codeparrot-clean | ||
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* Sync from <https://github.com/reactjs/reactjs.org/blob/main/beta/colors.js>.
*/
module.exports = {
// Text colors
p... | javascript | github | https://github.com/facebook/react | compiler/apps/playground/colors.js |
///////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2004, Industrial Light & Magic, a division of Lucas
// Digital Ltd. LLC
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the fol... | cpp | github | https://github.com/opencv/opencv | 3rdparty/openexr/IlmImf/ImfZip.cpp |
"""Functions for generating stochastic graphs from a given weighted directed
graph.
"""
# Copyright (C) 2010-2013 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
from __future__ import division
import warnin... | unknown | codeparrot/codeparrot-clean | ||
#**************************************************************************
#* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
#* *
#* Author: The ALICE Off-line Project. *
#* Contributors ... | unknown | codeparrot/codeparrot-clean | ||
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"incremental": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolu... | json | github | https://github.com/vercel/next.js | examples/with-xstate/tsconfig.json |
# Copyright Bruno da Silva de Oliveira 2003. Use, modification and
# distribution is subject to the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import unittest
from _header_test import *
class HeaderTest(unittest.TestCase):
def t... | unknown | codeparrot/codeparrot-clean | ||
import logging
import requests
LOGGER = logging.getLogger(__name__)
class GoogleDrive(object):
""" A simple API wrapper for google drive
"""
def __init__(self, token, refresh_token, client_id, client_secret,
refresh_callback=None):
"""
:param token: the granted access ... | unknown | codeparrot/codeparrot-clean | ||
import pandas as pd
import matplotlib.pyplot as plt
from numpy import random
import os
# The inital set of baby names
names = ['Bob','Jessica','Mary','John','Mel']
# This will ensure the random samples below can be reproduced.
# This means the random samples will always be identical.
random.seed(500)
random_names = [... | unknown | codeparrot/codeparrot-clean | ||
"""Get Netscaler details."""
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import formatting
from SoftLayer import utils
@click.command()
@click.argument('identifier')
@environment.pass_env
def cli(env, identifier):
"""Get Netscaler details."""
mgr = SoftLayer.LoadBala... | unknown | codeparrot/codeparrot-clean | ||
package unshare
import (
"fmt"
"os"
"runtime"
"golang.org/x/sys/unix"
)
func init() {
// The startup thread of a process is special in a few different ways.
// Most pertinent to the discussion at hand, any per-thread kernel state
// reflected in the /proc/[pid]/ directory for a process is taken from
// the s... | go | github | https://github.com/moby/moby | daemon/internal/unshare/unshare_linux.go |
# Copyright (C) 2010-2014 CEA/DEN, EDF R&D
#
# This library 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; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# Copyright (c) 2018 Red Hat, 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview... | unknown | codeparrot/codeparrot-clean | ||
//===--- DependencyVerifier.cpp - Dependency Verifier ---------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2020 - 2025 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... | cpp | github | https://github.com/apple/swift | lib/Frontend/DependencyVerifier.cpp |
//
// DispatchQueue+AlamofireTests.swift
//
// Copyright (c) 2025 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without rest... | swift | github | https://github.com/Alamofire/Alamofire | Tests/DispatchQueue+AlamofireTests.swift |
# Created by Tyrell Rutledge - tytek2012@gmail.com & IRC Freenode as TheRinger, Contributions welcome and will be credited.
from influxdb import InfluxDBClient
from influxdb import SeriesHelper
import RPi.GPIO as GPIO
import time
import datetime
import logging
import random
import Adafruit_DHT
import sys
import serial
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies file copies with --generator-output using an explicit build
target of 'all'.
"""
import TestGyp
# Android doesn't support --g... | 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/member_test.go |
define("named1", [], function() {
return "named1";
});
define("named2", [], function() {
return "named2";
});
define("named3", [], function() {
return "named3";
});
define("named4", [], function() {
return "named4";
});
define("named1,named2".split(","), function(named1, named2) {
it("should load the named mod... | javascript | github | https://github.com/webpack/webpack | test/cases/amd/namedModulesConstArrayDep/index.js |
#!/usr/bin/python
# Copyright (c) 2009 The Regents of the University of California. All rights reserved.
#
# Permission is hereby granted, without written agreement and without
# license or royalty fees, to use, copy, modify, and distribute this
# software and its documentation for any purpose, provided that the
# abov... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
from __future__ import absolute_import
import os
from setuptools import find_packages, setup
from scanomatic import get_version
setup(
name="Scan-o-Matic",
version=get_version(),
description="High Throughput Solid Media Image Phenotyping Platform",
long_description="""Scan-o-Ma... | unknown | codeparrot/codeparrot-clean | ||
CREATE EXTENSION jsonb_plperl CASCADE;
CREATE FUNCTION testHVToJsonb() RETURNS jsonb
LANGUAGE plperl
TRANSFORM FOR TYPE jsonb
AS $$
$val = {a => 1, b => 'boo', c => undef};
return $val;
$$;
SELECT testHVToJsonb();
CREATE FUNCTION testAVToJsonb() RETURNS jsonb
LANGUAGE plperl
TRANSFORM FOR TYPE jsonb
AS $$
$val = [{a... | sql | github | https://github.com/postgres/postgres | contrib/jsonb_plperl/sql/jsonb_plperl.sql |
<!--Copyright 2023 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/ja/tasks/document_question_answering.md |
<?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 acme\lib;
class PhpDeprecation implements \Serializable
{
public fu... | php | github | https://github.com/symfony/symfony | src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/fake_vendor/acme/lib/PhpDeprecation.php |
#!/usr/bin/env python3
'''
by Christophe Vandeplas
Takes the MISP categories and types and saves them in the MISP-book, misp-website and PyMISP format.
# TODO - do some more data-validation between the mappings and defaults, and alert if we're missing something
'''
import json
import os
import re
import subprocess
... | unknown | codeparrot/codeparrot-clean | ||
import toppra.solverwrapper.cy_seidel_solverwrapper as seidel
import numpy as np
from numpy import array
import pytest
import cvxpy as cvx
testdata_correct = [
([1, 2, 3.0], None, None, None, [-1, -1], [1, 1], [-1, 1],
1, 6, [1, 1], [-2, -4]),
([-2, 2, 2.0], None, None, None, [-1, -1], [1, 1], [-1, 1],
... | unknown | codeparrot/codeparrot-clean | ||
use anyhow::Result;
use next_core::next_manifests::AssetBinding;
use tracing::Instrument;
use turbo_rcstr::RcStr;
use turbo_tasks::{ResolvedVc, TryFlatJoinIterExt, TryJoinIterExt, Vc};
use turbo_tasks_fs::FileSystemPath;
use turbopack_core::{
asset::Asset,
output::{OutputAsset, OutputAssets},
reference::all... | rust | github | https://github.com/vercel/next.js | crates/next-api/src/paths.rs |
"""Module for constructing RNN Cells."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
from six.moves import xrange # pylint: disable=redefined-builtin
import tensorflow as tf
from tensorflow.models.rnn import linear
class RNNCell(object):
... | unknown | codeparrot/codeparrot-clean | ||
from django.contrib.sites.models import Site
from django.core import mail
import mock
from kitsune.kbforums.tests import KBForumTestCase
from kitsune.sumo.tests import post, attrs_eq, starts_with
from kitsune.users.models import Setting
from kitsune.users.tests import user
PRIVATE_MESSAGE_EMAIL = '{sender} sent you ... | unknown | codeparrot/codeparrot-clean | ||
//===--- TestWorkspace.h - Utility for writing multi-file tests --*- C++-*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | c | github | https://github.com/llvm/llvm-project | clang-tools-extra/clangd/unittests/TestWorkspace.h |
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
use windows::core::{w, HSTRING};
enum Level {
Error,
#[allow(unused)]
Warning,
#[allow(unused)]
Info,
}
pub fn error<S: AsRef<str>>(err: S) {
dialog_inner(err.as_re... | rust | github | https://github.com/tauri-apps/tauri | crates/tauri-runtime-wry/src/dialog/windows.rs |
# Copyright (c) 2014 Alexander Bredo
# 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 list of conditions and t... | unknown | codeparrot/codeparrot-clean | ||
__author__ = 'iankuoli'
"""
This tutorial introduces logistic regression using Theano and stochastic
gradient descent.
Logistic regression is a probabilistic, linear classifier. It is parametrized
by a weight matrix :math:`W` and a bias vector :math:`b`. Classification is
done by projecting data points onto a set of ... | unknown | codeparrot/codeparrot-clean | ||
name: Self-hosted runner (nightly-past-ci-caller)
on:
schedule:
- cron: "17 2,14 * * *"
push:
branches:
- run_past_ci*
jobs:
get_number:
name: Get number
runs-on: ubuntu-22.04
outputs:
run_number: ${{ steps.get_number.outputs.run_number }}
steps:
- name: Get number
... | unknown | github | https://github.com/huggingface/transformers | .github/workflows/self-nightly-past-ci-caller.yml |
<?php
namespace Illuminate\Foundation\Console;
use Illuminate\Console\Command;
use Illuminate\Support\Collection;
use Illuminate\Support\ServiceProvider;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputOption;
#[AsCommand(name: 'optimize:clear')]
class OptimizeClearCommand... | php | github | https://github.com/laravel/framework | src/Illuminate/Foundation/Console/OptimizeClearCommand.php |
/*-------------------------------------------------------------------------
*
* vacuumlazy.c
* Concurrent ("lazy") vacuuming.
*
* Heap relations are vacuumed in three main phases. In phase I, vacuum scans
* relation pages, pruning and freezing tuples and saving dead tuples' TIDs in
* a TID store. If that TID s... | c | github | https://github.com/postgres/postgres | src/backend/access/heap/vacuumlazy.c |
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-boot | core/spring-boot/src/main/java/org/springframework/boot/task/SimpleAsyncTaskExecutorBuilder.java |
#include "rubysocket.h"
#ifdef HAVE_GETIFADDRS
/*
* ifa_flags is usually unsigned int.
* However it is uint64_t on SunOS 5.11 (OpenIndiana).
*/
#ifdef HAVE_LONG_LONG
typedef unsigned LONG_LONG ifa_flags_t;
#define PRIxIFAFLAGS PRI_LL_PREFIX"x"
#define IFAFLAGS2NUM(flags) ULL2NUM(flags)
#else
typedef unsigned int i... | c | github | https://github.com/ruby/ruby | ext/socket/ifaddr.c |
#!/usr/bin/env python
# vim:fileencoding=utf-8
# License: GPLv3 Copyright: 2018, Kovid Goyal <kovid at kovidgoyal.net>
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import sys
import collections
is_py2 = sys.version_info.major < 3
if is_py2:
import ... | unknown | codeparrot/codeparrot-clean | ||
ErrorHandler Component
======================
The ErrorHandler component provides tools to manage errors and ease debugging PHP code.
Getting Started
---------------
```bash
composer require symfony/error-handler
```
```php
use Symfony\Component\ErrorHandler\Debug;
use Symfony\Component\ErrorHandler\ErrorHandler;
u... | unknown | github | https://github.com/symfony/symfony | src/Symfony/Component/ErrorHandler/README.md |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may n... | java | github | https://github.com/apache/kafka | clients/src/main/java/org/apache/kafka/common/memory/package-info.java |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import re
from pymatgen.core.structure import Molecule
from monty.io import zopen
"""
Module implementing an XYZ file object class.
"""
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Mate... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#############################################
# WARNING #
#############################################
#
# This file is au... | unknown | codeparrot/codeparrot-clean | ||
import unittest2 as unittest
import pyodbc
# Sidable logging during unittests
import logging
logging.disable(logging.CRITICAL)
from subprocess import CalledProcessError
from mock import Mock, call, patch
from pyvertica.migrate import VerticaMigrator, VerticaMigratorError
class VerticaMigratorConnection(unittest.Tes... | unknown | codeparrot/codeparrot-clean | ||
# erase_command.py
# Erase CLI command.
#
# Copyright (C) 2012-2014 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This progr... | unknown | codeparrot/codeparrot-clean | ||
import datetime
import numpy as np
import pytest
import pandas as pd
from pandas import DataFrame, Index, MultiIndex, Series
from pandas.core.util.hashing import _hash_scalar, hash_tuple, hash_tuples
from pandas.util import hash_array, hash_pandas_object
import pandas.util.testing as tm
@pytest.fixture(
params=[... | 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-beans/src/test/java/org/springframework/beans/factory/support/ConstructorResolverAotTests.java |
<?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\DebugBundle\DependencyInjection;
use Symfony\Component\C... | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/DebugBundle/DependencyInjection/Configuration.php |
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"iso... | json | github | https://github.com/prometheus/prometheus | web/ui/mantine-ui/tsconfig.json |
#define USE_THE_REPOSITORY_VARIABLE
#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "add-interactive.h"
#include "advice.h"
#include "editor.h"
#include "environment.h"
#include "gettext.h"
#include "object-name.h"
#include "pager.h"
#include "read-cache-ll.h"
#include "repository.h"
#inclu... | c | github | https://github.com/git/git | add-patch.c |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2012 Nick Hall
#
# 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 v... | unknown | codeparrot/codeparrot-clean | ||
import pytest
from addons.osfstorage import settings as osfstorage_settings
from osf.models import BaseFileNode, Folder, File
from osf_tests.factories import (
UserFactory,
ProjectFactory,
)
pytestmark = pytest.mark.django_db
@pytest.fixture()
def user():
return UserFactory()
@pytest.fixture()
def proje... | unknown | codeparrot/codeparrot-clean | ||
"""Extract, format and print information about Python stack traces."""
import linecache
import sys
import types
__all__ = ['extract_stack', 'extract_tb', 'format_exception',
'format_exception_only', 'format_list', 'format_stack',
'format_tb', 'print_exc', 'format_exc', 'print_exception',
... | unknown | codeparrot/codeparrot-clean | ||
// RUN: %check_clang_tidy %s cppcoreguidelines-pro-bounds-constant-array-index %t
typedef __SIZE_TYPE__ size_t;
namespace std {
template<typename T, size_t N>
struct array {
T& operator[](size_t n);
T& at(size_t n);
};
}
namespace gsl {
template<class T, size_t N>
T& at( T(&a)[N], size_t index );
... | cpp | github | https://github.com/llvm/llvm-project | clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/pro-bounds-constant-array-index.cpp |
import os
from jedi._compatibility import unicode
from jedi.parser import Parser, load_grammar
from jedi.evaluate import sys_path, Evaluator
def test_paths_from_assignment():
def paths(src):
grammar = load_grammar()
stmt = Parser(grammar, unicode(src)).module.statements[0]
return list(sys_... | unknown | codeparrot/codeparrot-clean | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import Union
from typing_extensions import Literal, TypeAlias
__all__ = ["VideoModel"]
VideoModel: TypeAlias = Union[
str, Literal["sora-2", "sora-2-pro", "sora-2-2025-10-06", "sora-2-pro-2025-10-06", "sora-2-2025-1... | python | github | https://github.com/openai/openai-python | src/openai/types/video_model.py |
# -*- coding: utf-8 -*-
from __future__ import with_statement
from classytags.arguments import IntegerArgument, Argument, StringArgument
from classytags.core import Options
from classytags.helpers import InclusionTag
from cms.utils.i18n import force_language, get_language_objects
from django import template
from djang... | unknown | codeparrot/codeparrot-clean | ||
from blackjack.cmake.ScriptBase import ScriptBase
from blackjack.cmake.cmdpart.Version import Version
class project(ScriptBase):
"""
CMake Command - Project Defintion
"""
def __init__(self, name: str, version: Version = None, langs: str = None):
super().__init__()
self._Name = None
... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.