code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
# functions that implement analysis and synthesis of sounds using the Stochastic Model
# (for example usage check stochasticModel_function.py in the models_interface directory)
import numpy as np
from scipy.signal import hanning, resample
from scipy.fftpack import fft, ifft
import utilFunctions as UF
def stochasticMo... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2022 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | python | github | https://github.com/huggingface/transformers | src/transformers/models/dinat/configuration_dinat.py |
# (c) 2010 Marcos Dione <mdione@grulic.org.ar>
# This file is part of satyr.
# satyr is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
... | unknown | codeparrot/codeparrot-clean | ||
import unittest
from datetime import datetime
from pyprint.NullPrinter import NullPrinter
from pyprint.Printer import Printer
from pyprint.StringPrinter import StringPrinter
from coalib.misc import Constants
from coalib.output.printers.LogPrinter import LogPrinter
from coalib.processes.communication.LogMessage import... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
import nose.tools as nt
import mock
import hyperspy.api as hs
from hyperspy.misc.utils import slugify
class TestModelJacobians:
def setUp(self):
s = hs.signals.Spectrum(np.zeros(1))
m = s.create_model()
self.low_loss = 7.
self.weights = 0.3
m.axis.axis =... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Support;
use Carbon\CarbonInterface;
use Carbon\CarbonInterval;
use Illuminate\Support\Defer\DeferredCallback;
use Illuminate\Support\Defer\DeferredCallbackCollection;
use Illuminate\Support\Facades\Date;
use Symfony\Component\Process\PhpExecutableFinder;
if (! function_exists('Illuminate\... | php | github | https://github.com/laravel/framework | src/Illuminate/Support/functions.php |
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from examples/modular-transformers/modular_new_imgproc_model.py.
# Do NOT edit this file manually as any edits will be overwritten by the gene... | python | github | https://github.com/huggingface/transformers | examples/modular-transformers/image_processing_new_imgproc_model.py |
# Copyright 2020 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Foundation\Support\Providers;
use Closure;
use Illuminate\Contracts\Routing\UrlGenerator;
use Illuminate\Routing\Router;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Traits\ForwardsCalls;
/**
* @mixin \Illuminate\Routing\Router
*/
class RouteServiceProvider extends Serv... | php | github | https://github.com/laravel/framework | src/Illuminate/Foundation/Support/Providers/RouteServiceProvider.php |
# (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 | ||
#!/usr/bin/env python
# Copyright (c) 2006 Damien Miller <djm@mindrot.org>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
require "cases/helper"
class ModelTest < ActiveModel::TestCase
include ActiveModel::Lint::Tests
module DefaultValue
def self.included(klass)
klass.class_eval { attr_accessor :hello }
end
def initialize(*args)
@attr ||= "default value"
super
end
e... | ruby | github | https://github.com/rails/rails | activemodel/test/cases/model_test.rb |
## Input
```javascript
function foo(a, b, c) {
const x = [];
const y = [];
if (x) {
}
y.push(a);
x.push(b);
}
export const FIXTURE_ENTRYPOINT = {
fn: foo,
params: ['TodoAdd'],
isComponent: 'TodoAdd',
};
```
## Code
```javascript
function foo(a, b, c) {
const x = [];
const y = [];
if (x) ... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/overlapping-scopes-interleaved-by-terminal.expect.md |
import ipaddress
from functools import lru_cache
try:
from psycopg import ClientCursor, IsolationLevel, adapt, adapters, errors, sql
from psycopg.postgres import types
from psycopg.types.datetime import TimestamptzLoader
from psycopg.types.json import Jsonb
from psycopg.types.range import Range, Ra... | python | github | https://github.com/django/django | django/db/backends/postgresql/psycopg_any.py |
# coding=utf-8
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.backend.j... | unknown | codeparrot/codeparrot-clean | ||
#!/bin/sh
test_description='rebase topology tests with merges'
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-rebase.sh
test_revision_subjects () {
expected="$1"
shift
set -- $(git log --format=%s --no-walk=unsorted "$@")
test "$expected" = "$*"
}
# a---b-----------c
# \ \
# d-------e \
# ... | unknown | github | https://github.com/git/git | t/t3425-rebase-topology-merges.sh |
"""
Classes dealing with task repositories and their synchronization.
"""
import os
import subprocess
from pathlib import Path
from typing import Any, Iterator, Optional, Union
class Repository:
"""Local task repository that does not perform synchronization."""
def __init__(self, path: Union[str, Path]) -> N... | unknown | codeparrot/codeparrot-clean | ||
import { type RawSourceMap, SourceMapConsumer } from 'source-map-js'
import { parse as babelParse } from '@babel/parser'
import {
type SFCTemplateCompileOptions,
compileTemplate,
} from '../src/compileTemplate'
import { type SFCTemplateBlock, parse } from '../src/parse'
import { compileScript } from '../src'
import... | typescript | github | https://github.com/vuejs/core | packages/compiler-sfc/__tests__/compileTemplate.spec.ts |
/* Copyright 2022 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/core/kernels/data/experimental/distributed_save_op.h |
"""
Support for thr Free Mobile SMS platform.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/notify.free_mobile/
"""
import logging
import voluptuous as vol
from homeassistant.components.notify import (
PLATFORM_SCHEMA, BaseNotificationService)
fro... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# File: _test.py
import sys
import numpy as np
import cv2
import unittest
from .base import ImageAugmentor, AugmentorList
from .imgproc import Contrast
from .noise import SaltPepperNoise
from .misc import Flip, Resize
def _rand_image(shape=(20, 20)):
return np.random.rand(*shape).astype("... | unknown | codeparrot/codeparrot-clean | ||
'''
HIDInput: Native support of HID input from linux kernel
Support start from 2.6.32-ubuntu, or 2.6.34.
To configure HIDInput, put in your configuration ::
[input]
# devicename = hidinput,/dev/input/eventXX
# example with Stantum MTP4.3" screen
stantum = hidinput,/dev/input/event2
.. note::
You... | unknown | codeparrot/codeparrot-clean | ||
"""
An abstraction layer over OS-dependent file-like objects, that provides a
consistent view of a *duplex byte stream*.
"""
import sys
import os
import socket
import time
import errno
from rpyc.lib import safe_import
from rpyc.lib.compat import select, select_error, BYTES_LITERAL, get_exc_errno, maxint
win32file = saf... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2013 IBM Corp.
#
# 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... | 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 Annotated, TypeAlias
from ...._utils import PropertyInfo
from .file_path_delta_annotation import FilePathDeltaAnnotation
from .file_citation_delta_annotation import FileCitation... | python | github | https://github.com/openai/openai-python | src/openai/types/beta/threads/annotation_delta.py |
package opts
import (
"errors"
"fmt"
"os"
"runtime"
"testing"
"gotest.tools/v3/assert"
)
func TestValidateEnv(t *testing.T) {
type testCase struct {
value string
expected string
err error
}
tests := []testCase{
{
value: "a",
expected: "a",
},
{
value: "something",
expec... | go | github | https://github.com/moby/moby | daemon/pkg/opts/env_test.go |
Title in your templates: {{ obj }} | html | github | https://github.com/django/django | tests/syndication_tests/templates/syndication/title.html |
#
# LMS Interface to external queueing system (xqueue)
#
import hashlib
import json
import logging
import requests
import dogstats_wrapper as dog_stats_api
log = logging.getLogger(__name__)
dateformat = '%Y%m%d%H%M%S'
XQUEUE_METRIC_NAME = 'edxapp.xqueue'
# Wait time for response from Xqueue.
XQUEUE_TIMEOUT = 35 # s... | 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 n... | java | github | https://github.com/apache/kafka | clients/src/main/java/org/apache/kafka/common/Uuid.java |
# types.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Compatiblity namespace for sqlalchemy.sql.types.
"""
__all__ = ['TypeEngine', 'TypeDecor... | 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 | ||
/**
* hdr_histogram.h
* Written by Michael Barker and released to the public domain,
* as explained at http://creativecommons.org/publicdomain/zero/1.0/
*
* The source for the hdr_histogram utilises a few C99 constructs, specifically
* the use of stdint/stdbool and inline variable declaration.
*/
#ifndef HDR_HI... | c | github | https://github.com/redis/redis | deps/hdr_histogram/hdr_histogram.h |
"""Thin Python wrapper around C binary reader for profiling data."""
import _remote_debugging
from .gecko_collector import GeckoCollector
from .stack_collector import FlamegraphCollector, CollapsedStackCollector
from .pstats_collector import PstatsCollector
class BinaryReader:
"""High-performance binary reader u... | python | github | https://github.com/python/cpython | Lib/profiling/sampling/binary_reader.py |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE", "UNUSED")
package kotlinx.coroutines.debug
import kotlinx.coroutines.*
import kotlinx.coroutines.debug.internal.*
import kotlin.coroutines.*
import kotlin.coroutines.jvm.internal.*
/**
* Class describing coroutine info such as its context, state and stacktrac... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | kotlinx-coroutines-debug/src/CoroutineInfo.kt |
import sys
import itertools
if sys.version_info[0] < 3:
PY3 = False
basestring = basestring
import __builtin__ as builtins
import ConfigParser
from StringIO import StringIO
BytesIO = StringIO
execfile = execfile
func_code = lambda o: o.func_code
func_globals = lambda o: o.func_glob... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
import numpy as np
import matplotlib.pyplot as plt
ratio = np.arange(0, 1.01, 0.05)
# Data from AS 7018
# Other inputs are: main(7018, ratio, 3, 0.7, 0)
#cost7018Algo0= [0.32816886868289885, 0.2208175601847247, 0.19251093813725606, 0.19213511824943674, 0.13080090885015863, 0.11537045883303, 0.0963... | unknown | codeparrot/codeparrot-clean | ||
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2016-2017 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in ... | unknown | codeparrot/codeparrot-clean | ||
from MenuList import MenuList
from Tools.Directories import resolveFilename, SCOPE_CURRENT_SKIN
from enigma import eListboxPythonMultiContent, eListbox, gFont, RT_HALIGN_LEFT
from Tools.LoadPixmap import LoadPixmap
selectionpng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/sele... | unknown | codeparrot/codeparrot-clean | ||
"""
Improved support for Microsoft Visual C++ compilers.
Known supported compilers:
--------------------------
Microsoft Visual C++ 9.0:
Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64);
Microsoft Windows SDK 7.0 (x86, x64, ia64);
Microsoft Windows SDK 6.1 (x86, x64, ia64)
Microsoft Visual C++ 10... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/conformance/async/es6/awaitCallExpression/awaitCallExpression1_es6.ts] ////
//// [awaitCallExpression1_es6.ts]
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boole... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/awaitCallExpression1_es6.js |
import glob
import pandas as pd
import numpy as np
pd.set_option('display.max_columns', 50) # print all rows
import os
os.chdir("/gpfs/commons/home/biederstedte-934/evan_projects/correct_phylo_files")
cw154 = glob.glob("binary_position_RRBS_cw154*")
trito = glob.glob("binary_position_RRBS_trito_pool*")
print(len(cw1... | unknown | codeparrot/codeparrot-clean | ||
---
title: StaticRouterProvider
---
# StaticRouterProvider
<!--
⚠️ ⚠️ IMPORTANT ⚠️ ⚠️
Thank you for helping improve our documentation!
This file is auto-generated from the JSDoc comments in the source
code, so please edit the JSDoc comments in the file below and this
file will be re-generated once those changes are... | unknown | github | https://github.com/remix-run/react-router | docs/api/data-routers/StaticRouterProvider.md |
import unittest
from test import test_support, test_genericpath
import posixpath, os
from posixpath import realpath, abspath, dirname, basename
# An absolute path to a temporary filename for testing. We can't rely on TESTFN
# being an absolute path, so we need this.
ABSTFN = abspath(test_support.TESTFN)
def skip_if... | 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 | build-plugin/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/LoggingMainClassTimeoutWarningListener.java |
---
navigation_title: "Bucket sort"
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-bucket-sort-aggregation.html
---
# Bucket sort aggregation [search-aggregations-pipeline-bucket-sort-aggregation]
A parent pipeline aggregation which sorts the buckets of ... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/aggregations/search-aggregations-pipeline-bucket-sort-aggregation.md |
use rustc_abi::Endian;
use crate::spec::{Arch, LinkSelfContainedDefault, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
let mut base = base::linux_gnu::opts();
base.cpu = "M68020".into();
base.max_atomic_width = Some(32);
Target {
llvm_target: "m68k-unknown-l... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_target/src/spec/targets/m68k_unknown_linux_gnu.rs |
# -*- coding: utf-8 -*-
from collections import OrderedDict
palette = [
0x788084, 0x0000fc, 0x0000c4, 0x4028c4,
0x94008c, 0xac0028, 0xac1000, 0x8c1800,
0x503000, 0x007800, 0x006800, 0x005800,
0x004058, 0x000000, 0x000000, 0x000008,
0xbcc0c4, 0x0078fc, 0x0088fc, 0x6848fc,
0xdc00d4, 0xe40060, 0... | unknown | codeparrot/codeparrot-clean | ||
#
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | unknown | codeparrot/codeparrot-clean | ||
"""Enable unit testing of Ansible collections. PYTEST_DONT_REWRITE"""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import sys
# set by ansible-test to a single directory, rather than a list of directories as supported by Ansible itself
ANSIBLE_COLLECTIONS_PATH = os... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
Compatibility code to be able to use `cookielib.CookieJar` with requests.
requests.utils imports from here, so be careful with imports.
"""
import collections
from .compat import cookielib, urlparse, Morsel
try:
import threading
# grr, pyflakes: this fixes "redefinition of unused... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2012, Nachi Ueno, NTT MCL, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unles... | unknown | codeparrot/codeparrot-clean | ||
import datetime
import os
import uuid
from decimal import Decimal
import pytest
from django.http import QueryDict
from django.test import TestCase, override_settings
from django.utils import six, timezone
import rest_framework
from rest_framework import serializers
# Tests for field keyword arguments and core functi... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
pygments.styles.friendly
~~~~~~~~~~~~~~~~~~~~~~~~
A modern style based on the VIM pyte theme.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyw... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2011 Uninett AS
#
# This file is part of Network Administration Visualized (NAV).
#
# NAV is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License version 3 as published by the Free
# Software Foundation.
#
# This progr... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (C) 2010 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | java | github | https://github.com/google/guava | android/guava-tests/test/com/google/common/util/concurrent/MonitorTestCase.java |
import datetime
import os
import logging
import re
import six
from six.moves import cPickle
import numpy as np
import xarray as xr
import pandas as pd
import requests
log=logging.getLogger('usgs_nwis')
from ... import utils
from .. import rdb
from .common import periods
try:
import seawater
except ImportError:... | unknown | codeparrot/codeparrot-clean | ||
/*-------------------------------------------------------------------------
*
* enum.c
* I/O functions, operators, aggregates etc for enum types
*
* Copyright (c) 2006-2026, PostgreSQL Global Development Group
*
*
* IDENTIFICATION
* src/backend/utils/adt/enum.c
*
*----------------------------------------... | c | github | https://github.com/postgres/postgres | src/backend/utils/adt/enum.c |
import collections
import subprocess
import warnings
from . import compat
from . import protocols
from . import transports
from .coroutines import coroutine
from .log import logger
class BaseSubprocessTransport(transports.SubprocessTransport):
def __init__(self, loop, protocol, args, shell,
stdi... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2013 IBM Corp.
#
# 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 agree... | 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-cloud-storage-project/hadoop-tos/src/main/java/org/apache/hadoop/fs/tosfs/ops/package-info.java |
#!/usr/bin/env bash
set -eux
platform="$(uname)"
function setup() {
if [[ "${platform}" == "FreeBSD" ]] || [[ "${platform}" == "Darwin" ]]; then
ifconfig lo0
existing=$(ifconfig lo0 | grep '^[[:blank:]]inet 127\.0\.0\. ' || true)
echo "${existing}"
for i in 3 4 254; do
... | unknown | github | https://github.com/ansible/ansible | test/integration/targets/delegate_to/runme.sh |
from django.conf import settings
from django.contrib.sessions.backends.base import SessionBase
from django.core import signing
class SessionStore(SessionBase):
def load(self):
"""
We load the data from the key itself instead of fetching from
some external data store. Opposite of _get_sessi... | unknown | codeparrot/codeparrot-clean | ||
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | unknown | codeparrot/codeparrot-clean | ||
import operator
from numpy.fft.helper import fftshift, ifftshift, fftfreq
import scipy.fft._pocketfft.helper as _helper
import numpy as np
__all__ = ['fftshift', 'ifftshift', 'fftfreq', 'rfftfreq', 'next_fast_len']
def rfftfreq(n, d=1.0):
"""DFT sample frequencies (for usage with rfft, irfft).
The returned fl... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2014, DjaoDjin inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and t... | 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 may not... | python | github | https://github.com/apache/airflow | airflow-core/src/airflow/jobs/job.py |
# Copyright 2011-2013 Colin Scott
#
# 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 wri... | unknown | codeparrot/codeparrot-clean | ||
// Configuration shared with both libm and libm-test
use std::env;
use std::path::PathBuf;
#[allow(dead_code)]
pub struct Config {
pub manifest_dir: PathBuf,
pub out_dir: PathBuf,
pub opt_level: String,
pub cargo_features: Vec<String>,
pub target_arch: String,
pub target_env: String,
pub t... | rust | github | https://github.com/nodejs/node | deps/crates/vendor/libm/configure.rs |
from datetime import datetime
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from django.test import TestCase
from event.models import Event
from job.models import Job
from organization.models import Organization
from shift.models import Shift, VolunteerShift
from shif... | unknown | codeparrot/codeparrot-clean | ||
# coding=utf-8
from lib.Register import get_reg_class
__author__ = 'Anatoli Kalysch'
class Trace(list):
def __init__(self, reg_size=64, tr=None):
super(Trace, self).__init__()
self.peephole = False
self.constant_propagation = False
self.standardization = False
self.operand_... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.tests.hosts
import io.ktor.events.*
import io.ktor.http.*
import io.ktor.server.application.*
import io.ktor.server.engine.*
import io.ktor.server.request.*
import io.ktor.uti... | kotlin | github | https://github.com/ktorio/ktor | ktor-server/ktor-server-core/jvm/test/io/ktor/tests/hosts/ReceiveBlockingPrimitiveTest.kt |
"""Support for MQTT Template lights."""
import logging
import voluptuous as vol
from homeassistant.components import mqtt
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_EFFECT,
ATTR_FLASH,
ATTR_HS_COLOR,
ATTR_TRANSITION,
ATTR_WHITE_VALUE,
SUPPORT_BR... | unknown | codeparrot/codeparrot-clean | ||
"""
Django admin page for CourseAssetCacheTtlConfig, which allows you to configure the TTL
that gets used when sending cachability headers back with request course assets.
"""
from django.contrib import admin
from config_models.admin import ConfigurationModelAdmin
from .models import CourseAssetCacheTtlConfig, CdnUserA... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
"""
ORCID Member
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: Latest
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
fr... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package discovery
import (
"fmt"
"testing"
)
func TestPluginConstraintsAllows(t *testing.T) {
tests := []struct {
Constraints *PluginConstraints
Version string
Want bool
}{
{
&PluginConstraints{
Versions: AllVersions,... | go | github | https://github.com/hashicorp/terraform | internal/plugin/discovery/requirements_test.go |
/*
* 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/test/java/org/apache/hadoop/fs/gs/contract/ITestGoogleContractMkdir.java |
// RUN: %check_clang_tidy -std=c++11,c++14 -check-suffix=,CXX14 %s bugprone-dangling-handle %t -- \
// RUN: -config="{CheckOptions: \
// RUN: {bugprone-dangling-handle.HandleClasses: \
// RUN: 'std::basic_string_view; ::llvm::StringRef;'}}"
// RUN: %check_clang_tidy -std=c++17-or-later -che... | cpp | github | https://github.com/llvm/llvm-project | clang-tools-extra/test/clang-tidy/checkers/bugprone/dangling-handle.cpp |
# 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 logging
import traceback
from data_source import DataSource
from extensions_paths import EXAMPLES
from future import All, Future
from platform_ut... | unknown | codeparrot/codeparrot-clean | ||
"""
Convenience routines for creating non-trivial Field subclasses.
Add SubfieldBase as the __metaclass__ for your Field subclass, implement
to_python() and the other necessary methods and everything will work seamlessly.
"""
from django.utils.maxlength import LegacyMaxlength
class SubfieldBase(LegacyMaxlength):
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
werkzeug.testsuite.securecookie
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests the secure cookie.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
from werkzeug.testsuite import WerkzeugTestCase
from werkzeug.utils import... | unknown | codeparrot/codeparrot-clean | ||
"""
Mersenne Twister
----------------
Generates high quality pseudo random integers with a long period.
Used as the default random number generator for several
languages (including Python).
For a more technical overview, see the wikipedia entry.
Pseudocode: http://en.wikipedia.org/wiki/Mer... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python\<nl>\
# -*- coding: utf-8 -*-
"""
@author nik |
"""
import sys
from collections import namedtuple
# globals
MTLFILE = ''
DUMMY_MAPCALC_STRING_RADIANCE = 'Radiance'
DUMMY_MAPCALC_STRING_DN = 'DigitalNumber'
# helper functions
def set_mtlfile():
"""
Set user defined MTL file, if any
"""
... | unknown | codeparrot/codeparrot-clean | ||
from collections import Mapping, MutableMapping
try:
from threading import RLock
except ImportError: # Platform-specific: No threads available
class RLock:
def __enter__(self):
pass
def __exit__(self, exc_type, exc_value, traceback):
pass
try: # Python 2.7+
from c... | unknown | codeparrot/codeparrot-clean | ||
"""Helpers for tests."""
import json
import pytest
from .common import MQTTMessage
from tests.async_mock import patch
from tests.common import load_fixture
from tests.components.light.conftest import mock_light_profiles # noqa
@pytest.fixture(name="generic_data", scope="session")
def generic_data_fixture():
""... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
########################################################################
# $HeadURL$
# File : dirac-proxy-init.py
# Author : Adrian Casajus
########################################################################
__RCSID__ = "$Id$"
import sys
import getpass
import DIRAC
from DIRAC.Core.Base i... | unknown | codeparrot/codeparrot-clean | ||
import os
from setuptools import setup, find_packages
readme = open('README.rst', 'rt').read()
import sys
versionstr = '0.5.0'
if os.path.exists('./requirements.txt'):
with open('./requirements.txt', 'r') as reqs:
__requirements__ = [x.strip() for x in reqs.readlines() if not x.startswith('--')]
else:
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# This file is part of Invenio Demosite.
# Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010, 2011 CERN.
#
# Invenio Demosite 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 ver... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
#
# $Id$
#
# Copyright (c) 2004,2005 Minero Aoki
#
# This program is free software.
# You can distribute and/or modify this program under the Ruby License.
# For details of Ruby License, see ruby/COPYING.
#
require 'ripper/lexer'
class Ripper
# This class handles only scanner events,
... | ruby | github | https://github.com/ruby/ruby | ext/ripper/lib/ripper/filter.rb |
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the "Elastic License
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, ... | java | github | https://github.com/elastic/elasticsearch | build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/util/CiUtils.java |
@source "./**/*.ts";
@source "!./**/*.ts";
@plugin "./plugin.js";
@plugin "./what\"s-this.js"; | css | github | https://github.com/tailwindlabs/tailwindcss | packages/@tailwindcss-postcss/src/postcss-fix-relative-paths/fixtures/example-project/src/index.css |
const val TAG = <expr>"Analysis API".toString()</expr> | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api/testData/components/compileTimeConstantProvider/evaluate/string_toString.kt |
/*
* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.server.plugins
import io.ktor.http.*
import io.ktor.server.application.internal.*
import io.ktor.util.internal.*
import kotlinx.coroutines.*
import kotlinx.io.*
import kotlin.... | kotlin | github | https://github.com/ktorio/ktor | ktor-server/ktor-server-core/common/src/io/ktor/server/plugins/Errors.kt |
# -*- coding: 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 GNU... | 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 2010 Jacob Kaplan-Moss
# Copyright 2011 OpenStack LLC.
# Copyright (c)2012 Rackspace US, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#... | unknown | codeparrot/codeparrot-clean | ||
"""
A Python "serializer". Doesn't do much serializing per se -- just converts to
and from basic Python data types (lists, dicts, strings, etc.). Useful as a basis for
other serializers.
"""
from __future__ import unicode_literals
from django.apps import apps
from django.conf import settings
from django.core.serialize... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
##################################################################
# Copyright (c) 2012, Sergej Srepfler <sergej.srepfler@gmail.com>
# February 2012 -
# Version 0.3.1, Last change on Nov 15, 2012
# This software is distributed under the terms of BSD license.
#######################################... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.