code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""@package pySEIMS
Python APIs for SEIMS
Preprocess, postprocess, parameters sensitivity, calibration, and scenario_analysis
-------------------
author : Liangjun Zhu, Junzhi Liu
copyright : (C) 2018-... | unknown | codeparrot/codeparrot-clean | ||
"""
naivefit.py
A NaiveFit follows the approach described in Crundall et al. (2019).
NaiveFit begins with an initial guess provided by user of an N component fit.
If no guess is provided, all provided stars are assumed to be members of one
component.
NaiveFit will perform an Expectation Maximisation on this N compon... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
# :markup: markdown
require "action_dispatch/journey/nfa/dot"
module ActionDispatch
module Journey # :nodoc:
module GTG # :nodoc:
class TransitionTable # :nodoc:
include Journey::NFA::Dot
attr_reader :memos
DEFAULT_EXP = /[^.\/?]+/
def init... | ruby | github | https://github.com/rails/rails | actionpack/lib/action_dispatch/journey/gtg/transition_table.rb |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2012 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) a... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
# :markup: markdown
require "uri"
require "active_support/core_ext/hash/indifferent_access"
require "active_support/core_ext/string/access"
require "active_support/core_ext/module/redefine_method"
require "action_controller/metal/exceptions"
module ActionDispatch
module Assertions
... | ruby | github | https://github.com/rails/rails | actionpack/lib/action_dispatch/testing/assertions/routing.rb |
/*
* 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.fe10.test.cases.generated.cases.components.resolver;
import com.int... | java | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-fe10/tests-gen/org/jetbrains/kotlin/analysis/api/fe10/test/cases/generated/cases/components/resolver/Fe10IdeNormalAnalysisSourceModuleResolveReferenceTestGenerated.java |
# initializations
import logging
import numpy
import theano
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
rng = numpy.random.RandomState(1234)
def constant_weight(shape, value=0., name=None):
param = numpy.ones(shape, dtype=theano.config.floatX) * value
return theano.shared(val... | unknown | codeparrot/codeparrot-clean | ||
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
use Symfony\... | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Resources/config/messenger_debug.php |
#!/bin/bash
set -ex
mkdir -p /usr/local/include
cp jni.h /usr/local/include | unknown | github | https://github.com/pytorch/pytorch | .ci/docker/common/install_jni.sh |
from __future__ import absolute_import
from __future__ import unicode_literals
from .. import unittest
from compose.utils import split_buffer
class SplitBufferTest(unittest.TestCase):
def test_single_line_chunks(self):
def reader():
yield b'abc\n'
yield b'def\n'
yield b... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, filter_strip_join
from frappe.website.website_generator import WebsiteGenerator
from erpnext.utilities.a... | unknown | codeparrot/codeparrot-clean | ||
#### Note: this error code is no longer emitted by the compiler.
A `while let` pattern attempts to match the pattern, and enters the body if the
match was successful. If the match is irrefutable (when it cannot fail to
match), use a regular `let`-binding inside a `loop` instead. For instance:
```no_run
struct Irrefut... | unknown | github | https://github.com/rust-lang/rust | compiler/rustc_error_codes/src/error_codes/E0165.md |
from __future__ import unicode_literals
template = {
"Resources": {
"HostedZone": {
"Type": "AWS::Route53::HostedZone",
"Properties": {
"Name": "my_zone"
}
},
"my_health_check": {
"Type": "AWS::Route53::HealthCheck",
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2012 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright (C) 2015 Hewlett-Packard Development Company, L.P.
#
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
#from https://gist.github.com/andersx/6061586
#runas run()
#bench run()
#pythran export run()
# A simple energy minimization program that uses steepest descent
# and a force field to minimize the energy of water in internal coordinates.
# Written by Jan H. Jensen, 2013
def Eandg(rOH,thetaHOH):
""""
Arguments... | 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/context/properties/source/SpringIterableConfigurationPropertySource.java |
# torch.onnx.testing
```{eval-rst}
.. automodule:: torch.onnx.testing
```
```{eval-rst}
.. autofunction:: torch.onnx.testing.assert_onnx_program
``` | unknown | github | https://github.com/pytorch/pytorch | docs/source/onnx_testing.md |
package n1
var X = "n1" | go | github | https://github.com/kubernetes/kubernetes | cmd/import-boss/testdata/inverse/neither/n1/file.go |
__all__ = ["LoggingCallbackHandler"]
import logging
from typing import Any
from uuid import UUID
from langchain_core.exceptions import TracerException
from langchain_core.tracers.stdout import FunctionCallbackHandler
from langchain_core.utils.input import get_bolded_text, get_colored_text
from typing_extensions impor... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/callbacks/tracers/logging.py |
import math
from sverchok.utils.csg_geom import *
class CSG(object):
"""
## License
Copyright (c) 2011 Evan Wallace (http://madebyevan.com/), under the MIT license.
Python port Copyright (c) 2012 Tim Knip (http://www.floorplanner.com), under the MIT license.
"""
def __init__(self):
self... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import struct
import numpy as np
from aston.trace.Trace import AstonFrame
from aston.tracefile.TraceFile import TraceFile
from aston.tracefile.Common import find_offset
class InficonHapsite(TraceFile):
ext = 'HPS'
mgc = '0403'
traces = ['#ms']
def _ions(self, f):
"""
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2009-2010, Michael Gorven
# Released under terms of the MIT/X/Expat Licence. See COPYING for details.
import logging
from twisted.spread import pb
from twisted.application import internet
from twisted.internet import reactor
import ibid
from ibid.source import IbidSourceFactory
from ibid.config impor... | unknown | codeparrot/codeparrot-clean | ||
/*
* NFA utilities.
* This file is #included by regcomp.c.
*
* Copyright (c) 1998, 1999 Henry Spencer. All rights reserved.
*
* Development of this software was funded, in part, by Cray Research Inc.,
* UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics
* Corporation, none of whom are res... | c | github | https://github.com/postgres/postgres | src/backend/regex/regc_nfa.c |
# Copyright (c) 2001-2006 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for epoll wrapper.
"""
import socket, errno, time
from twisted.trial import unittest
from twisted.python.util import untilConcludes
try:
from twisted.python import _epoll
except ImportError:
_epoll = None
class EPol... | unknown | codeparrot/codeparrot-clean | ||
"""
The GeometryColumns and SpatialRefSys models for the SpatiaLite backend.
"""
from django.db import connection, models
from django.contrib.gis.db.backends.base import SpatialRefSysMixin
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class GeometryColumns(models.Model):
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 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 os
import unittest
from telemetry.core import discover
from telemetry.core import util
class DiscoverTest(unittest.TestCase):
def setUp(self):
... | unknown | codeparrot/codeparrot-clean | ||
/*-------------------------------------------------------------------------
*
* md5.c
* Implements the MD5 Message-Digest Algorithm
*
* Fallback implementation of MD5, as specified in RFC 1321. This
* implementation is a simple one, in that it needs every input byte
* to be buffered before doing any calculati... | c | github | https://github.com/postgres/postgres | src/common/md5.c |
# Copyright 2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# G... | unknown | codeparrot/codeparrot-clean | ||
#! /bin/bash
set -xue
CHECKSUM_FILE="Django-${VERSION}.checksum.txt"
MEDIA_URL_PREFIX="https://media.djangoproject.com"
RELEASE_URL_PREFIX="https://www.djangoproject.com/m/releases/"
DOWNLOAD_PREFIX="https://www.djangoproject.com/download"
if [[ ! "${VERSION}" =~ ^[0-9]+\.[0-9]+(\.[0-9]+|a[0-9]+|b[0-9]+|rc[0-9]+)?$ ... | unknown | github | https://github.com/django/django | scripts/confirm_release.sh |
"""Module progress tests"""
import unittest
from mock import Mock
from xblock.field_data import DictFieldData
from xmodule.progress import Progress
from xmodule import x_module
from . import get_test_system
class ProgressTest(unittest.TestCase):
''' Test that basic Progress objects work. A Progress represents... | unknown | codeparrot/codeparrot-clean | ||
An inherent implementation was marked unsafe.
Erroneous code example:
```compile_fail,E0197
struct Foo;
unsafe impl Foo { } // error!
```
Inherent implementations (one that do not implement a trait but provide
methods associated with a type) are always safe because they are not
implementing an unsafe trait. Removin... | unknown | github | https://github.com/rust-lang/rust | compiler/rustc_error_codes/src/error_codes/E0197.md |
#!/usr/bin/env python
"""This modules contains tests for artifact API handler."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import io
import os
from absl import app
from grr_response_core import config
from grr_response_core.lib.rdfvalues import ar... | unknown | codeparrot/codeparrot-clean | ||
use serde_derive::Serialize;
#[derive(Serialize)]
enum Enum {
#[serde(serialize_with = "serialize_some_newtype_variant")]
Newtype(#[serde(skip_serializing)] String),
}
fn main() {} | rust | github | https://github.com/serde-rs/serde | test_suite/tests/ui/with-variant/skip_ser_newtype_field.rs |
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from _emerge.DepPriority import DepPriority
class DepPriorityNormalRange(object):
"""
DepPriority properties Index Category
buildtime HARD
runtime ... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2014-2019 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.client.plugins
import io.ktor.client.*
import io.ktor.client.request.*
import io.ktor.http.*
import io.ktor.http.content.*
internal actual fun platformRequestDefaultTransform... | kotlin | github | https://github.com/ktorio/ktor | ktor-client/ktor-client-core/web/src/io/ktor/client/plugins/DefaultTransform.web.kt |
#!/usr/bin/env python
import sys, os, platform, xml, re, tempfile, glob, datetime, getpass, shutil
from optparse import OptionParser
from subprocess import Popen, PIPE
hostos = os.name # 'nt', 'posix'
hostmachine = platform.machine() # 'x86', 'AMD64', 'x86_64'
errorCode = 0
SIMD_DETECTION_PROGRAM="""
#if __SSE5__
#... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
###############################################################################
# Copyright 2018 The Apollo 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 ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2004-2012 Pexego Sistemas Informáticos All Rights Reserved
# $Marta Vázquez Rodríguez$ <marta@pexego.es>
#
# This program is free software: you can redistribute it and/or modify
# it unde... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
pygments.lexers.algebra
~~~~~~~~~~~~~~~~~~~~~~~
Lexers for computer algebra systems.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, bygroups, words
from py... | unknown | codeparrot/codeparrot-clean | ||
<!--Copyright 2025 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/serve-cli/serving.md |
# This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even... | unknown | codeparrot/codeparrot-clean | ||
from ..base import *
import six
#todo Double check everything is OK
@Js
def Object():
val = arguments.get('0')
if val.is_null() or val.is_undefined():
return PyJsObject(prototype=ObjectPrototype)
return val.to_object()
@Js
def object_constructor():
if len(arguments):
val = arguments.g... | unknown | codeparrot/codeparrot-clean | ||
#if defined(DETECT_FEATURES) && defined(__INTEL_COMPILER)
/*
* Unlike GCC and CLANG, Intel Compiler exposes all supported intrinsics,
* whether or not the build options for those features are specified.
* Therefore, we must test #definitions of CPU features when option native/host
* is enabled v... | c | github | https://github.com/numpy/numpy | numpy/_core/src/_simd/checks/cpu_sse42.c |
function Component(props) {
const data = useFreeze(); // assume this returns {items: Array<{...}>}
// In this call `data` and `data.items` have a read effect *and* the lambda itself
// is readonly (it doesn't capture ony mutable references). Further, we ca
// theoretically determine that the lambda doesn't need... | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/todo.unnecessary-lambda-memoization.js |
//===----------------------------------------------------------------------===//
//
// 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/modernize/RawStringLiteralCheck.h |
### Addon-manager
addon-manager manages two classes of addons with given template files in
`$ADDON_PATH` (default `/etc/kubernetes/addons/`).
- Addons with label `addonmanager.kubernetes.io/mode=Reconcile` will be periodically
reconciled. Direct manipulation to these addons through apiserver is discouraged because
add... | unknown | github | https://github.com/kubernetes/kubernetes | cluster/addons/addon-manager/README.md |
//===--- Sanitizers.h - Helpers related to sanitizers -----------*- C++ -*-===//
//
// 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/L... | c | github | https://github.com/apple/swift | include/swift/Basic/Sanitizers.h |
"use strict";
const path = require("path");
const { describeCases } = require("./TestCases.template");
describe("TestCases", () => {
describeCases({
name: "cache pack",
cache: {
type: "filesystem",
buildDependencies: {
defaultWebpack: []
}
},
snapshot: {
managedPaths: [path.resolve(__dirname,... | javascript | github | https://github.com/webpack/webpack | test/TestCasesCachePack.longtest.js |
# 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 applicab... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# Copyright (c) 2016 PaddlePaddle 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 ... | unknown | codeparrot/codeparrot-clean | ||
This template intentionally left blank | html | github | https://github.com/django/django | tests/templates/views/article_archive_day.html |
#index p.rubric { font-size:150%; font-weight:normal; margin-bottom:.2em; color:#487858; }
#index div.section dt { font-weight: normal; }
#index #s-getting-help { float: right; width: 35em; background: #E1ECE2; padding: 1em; margin: 2em 0 2em 2em; }
#index #s-getting-help h2 { margin: 0; }
#index #s-django-documenta... | css | github | https://github.com/django/django | docs/_theme/djangodocs/static/homepage.css |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, json
from frappe import _, throw, msgprint
from frappe.utils import cstr, nowdate
from frappe.model.document import Document
class SMS... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2012 10gen, 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
#
# Unless required by applicable law or agreed to in writing, softw... | unknown | codeparrot/codeparrot-clean | ||
from random import random, shuffle
from braser import Braser
# noinspection PyUnresolvedReferences
from circus.desafio_a import main as desafio0
DETAIL, DETAILURL = "dungeon_detail", "DungeonWall.jpg"
MONSTER, MONSTERURL = "monster", "monstersheets.png?"
DETILE = "dungeon_detile"
FIRE, FIREURL = "fire", "http://s19.po... | unknown | codeparrot/codeparrot-clean | ||
import os
import sys
from collections import defaultdict
from collections.abc import Callable
from dataclasses import dataclass
from typing import Any, Optional
import matplotlib.pyplot as plt
from scipy.stats import gmean
import torch
from torch._inductor.runtime.benchmarking import benchmarker
def benchmark_kernel... | python | github | https://github.com/pytorch/pytorch | benchmarks/dynamo/genai_layers/utils.py |
# -*- coding: utf-8 -*-
from core import httptools
from core import scrapertools
from platformcode import logger
def test_video_exists(page_url):
logger.info()
global server, vid
server = scrapertools.find_single_match(page_url, 'www.([A-z0-9-]+).com')
vid = scrapertools.find_single_match(page_url, '(?... | unknown | codeparrot/codeparrot-clean | ||
import datetime
from django.test import TestCase, override_settings
from django.utils import timezone
from .models import Article, Category, Comment
class DateTimesTests(TestCase):
def test_related_model_traverse(self):
a1 = Article.objects.create(
title="First one",
pub_date=date... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from openerp import models, fields, api, osv
# We just create a new model
class mother(models.Model):
_name = 'test.inherit.mother'
_columns = {
# check interoperability of field inheritance with old-style fields
'name': osv.fields.char('Name', required=True),
}
... | unknown | codeparrot/codeparrot-clean | ||
# coding=utf-8
"""
Shells out to get the exim queue length
#### Dependencies
* /usr/sbin/exim
"""
import diamond.collector
import subprocess
import os
from diamond.collector import str_to_bool
class EximCollector(diamond.collector.Collector):
def get_default_config_help(self):
config_help = super(Ex... | 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.
"""Shim to run nacl toolchain download script only if there is a nacl dir."""
import os
import shutil
import sys
def Main(args):
... | unknown | codeparrot/codeparrot-clean | ||
/**
* \file cipher_invasive.h
*
* \brief Cipher module: interfaces for invasive testing only.
*
* The interfaces in this file are intended for testing purposes only.
* They SHOULD NOT be made available in library integrations except when
* building the library for testing.
*/
/*
* Copyright The Mbed TLS Contr... | c | github | https://github.com/nodejs/node | deps/LIEF/third-party/mbedtls/library/cipher_invasive.h |
/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
export interface ProfilingPluginOptions {
/**
* Path to the output file e.g. `path.resolve(__dirname, 'profiling/events.json')`. Defaults to `events.json`.
*/
outputPath?: string;
} | typescript | github | https://github.com/webpack/webpack | declarations/plugins/debug/ProfilingPlugin.d.ts |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2014 Romain Dorgueil
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | unknown | codeparrot/codeparrot-clean | ||
/*!
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import {h, JSX} from 'preact';
import {InitializerApiFunctionRenderable} from '../entities/renderables.mjs';
import ... | typescript | github | https://github.com/angular/angular | adev/shared-docs/pipeline/api-gen/rendering/templates/initializer-api-function.tsx |
# encoding: utf-8
"""A fancy version of Python's builtin :func:`dir` function.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, di... | unknown | codeparrot/codeparrot-clean | ||
# ASN.1 named integers
from pyasn1 import error
__all__ = [ 'NamedValues' ]
class NamedValues:
def __init__(self, *namedValues):
self.nameToValIdx = {}; self.valToNameIdx = {}
self.namedValues = ()
automaticVal = 1
for namedValue in namedValues:
if isinstance(namedValue... | unknown | codeparrot/codeparrot-clean | ||
#
# script to read the version information from `../configure`
# relevant lines are starting with:
# `doxygen_version_major`
# `doxygen_version_minor`
# `doxygen_version_revision`
# `doxygen_version_mmn`
# the collected information is written to: `../VERSION` and `../src/version.cpp`
#
import sys
import os
#
#... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __manifest__.py... | unknown | codeparrot/codeparrot-clean | ||
{
"name": "@next/swc-linux-arm64-musl",
"version": "0.0.0",
"repository": {
"type": "git",
"url": "https://github.com/vercel/next.js",
"directory": "crates/next-napi-bindings/npm/linux-arm64-musl"
},
"os": [
"linux"
],
"cpu": [
"arm64"
],
"libc": [
"musl"
],
"main": "next-s... | json | github | https://github.com/vercel/next.js | crates/next-napi-bindings/npm/linux-arm64-musl/package.json |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
========================================================================
Gaussian Processes regression: goodness-of-fit on the 'diabetes' dataset
========================================================================
In this example, we fit a Gaussian Process model onto... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import sys
from argparse import ArgumentParser
try:
import cProfile as profile
except:
import profile
from . import helpers
from . import TEST_DIR
helpers.setup_path()
import pbxproj
def get_argument_parser():
parser = ArgumentParser()
parser.add_argument("file",
... | unknown | codeparrot/codeparrot-clean | ||
use crate::spec::{
Abi, Arch, Cc, FloatAbi, LinkerFlavor, Lld, SanitizerSet, Target, TargetMetadata,
TargetOptions, base,
};
// This target if is for the baseline of the Android v7a ABI
// in thumb mode. It's named armv7-* instead of thumbv7-*
// for historical reasons. See the thumbv7neon variant for
// enabl... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_target/src/spec/targets/armv7_linux_androideabi.rs |
from .stream import Stream
from .wrappers import StreamIOThreadWrapper
from ..compat import str
from ..exceptions import StreamError
from ..packages import pbs as sh
import os
import time
import tempfile
class StreamProcessIO(StreamIOThreadWrapper):
def __init__(self, session, process, **kwargs):
self.pro... | unknown | codeparrot/codeparrot-clean | ||
"""Utility for loading all modules within a package."""
import importlib
import pkgutil
def load_all_modules(name, path):
"""Dynamically load all modules in the 'name' package.
This function is useful in combination with the registry.py module
so that any classes declared within the package are automatic... | python | github | https://github.com/mongodb/mongo | buildscripts/resmokelib/utils/autoloader.py |
import numpy as np
from copy import deepcopy
from sklearn.base import BaseEstimator, TransformerMixin
def epoch_data(data, events, stim_ID, tmin=-.2, tmax=0.399):
"""Epoch data."""
ix_events = np.where(np.diff(np.int32(events > 0)) == 1)[0] + 1
ix_min = int(tmin*1000)
ix_max = int(tmax*1000)
nsamp... | 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... | python | github | https://github.com/apache/airflow | airflow-core/tests/unit/models/test_taskmap.py |
// Copyright 2020 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.
//go:build dragonfly || freebsd || linux || netbsd || openbsd || solaris
package runtime
func Pipe() (r, w int32, errno int32) {
return pipe2(0)
} | go | github | https://github.com/golang/go | src/runtime/export_pipe2_test.go |
"""Some generic utilties."""
import keyring
import getpass
import re
UN = "everpy"
def refresh_token():
"""Set new token."""
print("Set a new a token")
keyring.set_password(UN, UN, getpass.getpass("Password: "))
return keyring.get_password(UN, UN)
def get_token():
"""Get a token."""
dev_token... | unknown | codeparrot/codeparrot-clean | ||
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/display/atmel,lcdc-display.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Microchip's LCDC Display
maintainers:
- Nicolas Ferre <nicolas.ferre@microchip.com>
- Dharma Balasubiramani <dharma.b... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/display/atmel,lcdc-display.yaml |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016 Michael Gruener <michael.gruener@chaosmoon.net>
# 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... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015, 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... | unknown | codeparrot/codeparrot-clean | ||
"""Review Board e-mail module."""
from __future__ import absolute_import, unicode_literals
from django.db.models.signals import post_delete
from djblets.auth.signals import user_registered
from reviewboard.notifications.email.signal_handlers import (
send_reply_published_mail,
send_review_published_mail,
... | unknown | codeparrot/codeparrot-clean | ||
import Avatar from "./avatar";
import Date from "./date";
import CoverImage from "./cover-image";
import Link from "next/link";
export default function HeroPost({
title,
coverImage,
date,
excerpt,
author,
slug,
}) {
return (
<section>
<div className="mb-8 md:mb-16">
<CoverImage
... | javascript | github | https://github.com/vercel/next.js | examples/cms-ghost/components/hero-post.js |
#!/usr/bin/python
#
# Ansible module to manage IPv4 policy objects in fortigate devices
# (c) 2017, Benjamin Jolivot <bjolivot@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... | unknown | codeparrot/codeparrot-clean | ||
#!/bin/python
import os, subprocess
import logging
from autotest.client import test
from autotest.client.shared import error
class perl_XML_RegExp(test.test):
"""
Autotest module for testing basic functionality
of perl_XML_RegExp
@author Ramya BS <ramyabs1@in.ibm.com> ... | unknown | codeparrot/codeparrot-clean | ||
//
// Code generated by grafana-app-sdk. DO NOT EDIT.
//
package v0alpha1
import (
"encoding/json"
"io"
"github.com/grafana/grafana-app-sdk/resource"
)
// ExternalGroupMappingJSONCodec is an implementation of resource.Codec for kubernetes JSON encoding
type ExternalGroupMappingJSONCodec struct{}
// Read reads J... | go | github | https://github.com/grafana/grafana | apps/iam/pkg/apis/iam/v0alpha1/externalgroupmapping_codec_gen.go |
import datetime
import errno
import os
import tempfile
from django.conf import settings
from django.contrib.sessions.backends.base import SessionBase, CreateError, VALID_KEY_CHARS
from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured
from django.utils import timezone
class SessionStore(SessionB... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
## \file updateHistoryMap.py
# \brief Python script for updating the historyMap.py file.
# \author T. Albring
# \version 7.0.0 "Falcon"
#
# SU2 Project Website: https://su2code.github.io
#
# The SU2 Project is maintained by the SU2 Foundation
# (http://su2foundation.org)
#
# Copyright 2012-202... | unknown | codeparrot/codeparrot-clean | ||
<?php
$loader->load('container1.php');
$container->loadFromExtension('security', [
'password_hashers' => [
'JMS\FooBundle\Entity\User7' => [
'algorithm' => 'sodium',
'time_cost' => 8,
'memory_cost' => 128 * 1024,
],
],
]); | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/sodium_hasher.php |
# Copyright 2019 Google 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 to in writing, s... | unknown | codeparrot/codeparrot-clean | ||
import AxiosError from '../../../lib/core/AxiosError';
describe('core::AxiosError', function() {
it('should create an Error with message, config, code, request, response, stack and isAxiosError', function() {
const request = { path: '/foo' };
const response = { status: 200, data: { foo: 'bar' } };
const ... | javascript | github | https://github.com/axios/axios | test/specs/core/AxiosError.spec.js |
import logging
import re
from collections import defaultdict
from itertools import permutations
from copy import deepcopy as copy
from fst import FSA, FST
from matcher import KRPosMatcher
from pymachine.machine import Machine
from pymachine.control import KRPosControl
from constants import deep_cases, deep_case_to_gra... | unknown | codeparrot/codeparrot-clean | ||
# 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 | ||
import { test } from '../../test';
export default test({
get props() {
return {
a: [{ id: 'foo' }, { id: 'bar' }, { id: 'baz' }]
};
},
html: `
<span>foo</span><span>bar</span><span>baz</span>
`,
test({ assert, component, target }) {
component.a = [{ id: 'yep' }, { id: 'nope' }];
assert.htmlEqual(
... | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/tests/runtime-legacy/samples/component-binding-each-object/_config.js |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009 Sharoon Thomas
# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it ... | unknown | codeparrot/codeparrot-clean | ||
/*
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
* This program is licensed under the same licence as Ruby.
* (See the file 'COPYING'.)
*/
#if !defined(_OSSL_SSL_H_)
#define _OSSL_SSL_H_
#define GetSSL(obj, ssl) do { \
TypedData_Get_St... | c | github | https://github.com/ruby/ruby | ext/openssl/ossl_ssl.h |
# test_getopt.py
# David Goodger <dgoodger@bigfoot.com> 2000-08-19
from test.test_support import verbose, run_doctest, run_unittest, EnvironmentVarGuard
import unittest
import getopt
sentinel = object()
class GetoptTests(unittest.TestCase):
def setUp(self):
self.env = EnvironmentVarGuard()
if "P... | unknown | codeparrot/codeparrot-clean | ||
"""
Support for statistics for sensor values.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.statistics/
"""
import logging
import statistics
from collections import deque
import voluptuous as vol
import homeassistant.helpers.config_validation a... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.