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
import roslib; roslib.load_manifest('articulation_structure')
import rospy
import sys
from visualization_msgs.msg import Marker, MarkerArray
from geometry_msgs.msg import Vector3, Point, Pose, PoseArray
from std_msgs.msg import ColorRGBA
from sensor_msgs.msg import ChannelFloat32
from articulatio... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
from __future__ import print_function
import abc
import traceback
from threading import Thread
import os
import time
import configparser
import errno
import subprocess
import sys
import logging
import requests
_base_path = os.path.dirname(os.path.abspath(__file__))
def eprint(*args, **kwargs):
... | unknown | codeparrot/codeparrot-clean | ||
"""For performing many refactorings as a single command
`changestack` module can be used to perform many refactorings on top
of each other as one bigger command. It can be used like::
stack = ChangeStack(project, 'my big command')
#..
stack.push(refactoring1.get_changes())
#..
stack.push(refactoring2.get_... | unknown | codeparrot/codeparrot-clean | ||
CHAR_MAX = 127
CHAR_MIN = -128
DBL_MAX = 1.7976931348623157e+308
DBL_MIN = 2.2250738585072014e-308
FLT_MAX = 3.4028234663852886e+38
FLT_MIN = 1.1754943508222875e-38
INT_MAX = 2147483647
INT_MIN = -2147483648
LLONG_MAX = 9223372036854775807
LLONG_MIN = -9223372036854775808
LONG_MAX = 2147483647
LONG_MIN = -21... | unknown | codeparrot/codeparrot-clean | ||
scrape_configs:
- job_name: foo
lightsail_sd_configs:
- region: us-east-1
bearer_token: foo
bearer_token_file: foo | unknown | github | https://github.com/prometheus/prometheus | config/testdata/lightsail_token_file.bad.yml |
# Copyright (c) 2009-2010 Mitch Garnaat http://garnaat.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 restriction, including
# without limitation the rights to use, copy, modi... | unknown | codeparrot/codeparrot-clean | ||
from flask import request
import logging
from .proxy_config import ProxyConfig
from .cookie_utils import cookie_to_json
from .blueprint import blueprint as config_override_bp
logger = logging.getLogger(__name__)
class ConfigOverride(object):
"""
Flask extension used to control the config override mechanism.
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# This software consists of v... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python2
# Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test ZMQ interface
#
from test_framework.test_framework import BitcoinTestFramework
from test_framework.u... | unknown | codeparrot/codeparrot-clean | ||
"""
Tests for the threading module.
"""
import test.support
from test.support import threading_helper, requires_subprocess, requires_gil_enabled
from test.support import verbose, cpython_only, os_helper
from test.support.import_helper import ensure_lazy_imports, import_module
from test.support.script_helper import ass... | python | github | https://github.com/python/cpython | Lib/test/test_threading.py |
pub mod context;
pub mod entry;
pub mod route_regex;
pub mod unsupported; | rust | github | https://github.com/vercel/next.js | crates/next-core/src/next_edge/mod.rs |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2009, 2010, 2011, 2012 Andrey Golovizin
#
# 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 restriction, including
# without limitation the rights to use, copy, modify,... | unknown | codeparrot/codeparrot-clean | ||
<?php
$container->loadFromExtension('framework', [
'csrf_protection' => false,
'form' => [
'csrf_protection' => true,
],
]); | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/form_csrf_disabled.php |
#!/usr/bin/env bash
# Copyright IBM Corp. 2016, 2025
# SPDX-License-Identifier: BUSL-1.1
set -euo pipefail
pkill prometheus || true
sleep 2
prom_dir="$HOME/prom"
"$prom_dir"/prometheus --web.enable-remote-write-receiver --config.file="$prom_dir/prometheus.yml" >> "$prom_dir"/prom.log 2>&1 & | unknown | github | https://github.com/hashicorp/vault | enos/modules/benchmark/set_up_telemetry_collector/scripts/run-prometheus.sh |
# Copyright 2014 Google 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
#
# Unless required by applicable law or ... | unknown | codeparrot/codeparrot-clean | ||
This is Carotene, a low-level library containing optimized CPU routines
that are useful for computer vision algorithms. | unknown | github | https://github.com/opencv/opencv | hal/carotene/README.md |
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsSQLStatement.
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
"""
_... | unknown | codeparrot/codeparrot-clean | ||
import Avatar from "./avatar";
import DateFormatter from "./date-formatter";
import CoverImage from "./cover-image";
import Link from "next/link";
import { Post } from "@/viewmodels/post";
type PostPreviewProps = {
post: Post;
};
export default function PostPreview({ post }: PostPreviewProps) {
return (
<div>... | typescript | github | https://github.com/vercel/next.js | examples/cms-kontent-ai/components/post-preview.tsx |
#!/usr/env python
# -*- coding: utf-8 -*-
__author__ = 'macieski'
import datetime
import logging
from datetime import date
from requests.exceptions import HTTPError
from wscacicneo import config
from liblightbase.lbbase.struct import Base, BaseMetadata
from liblightbase.lbbase.lbstruct.group import *
from liblightbase... | unknown | codeparrot/codeparrot-clean | ||
//! Lints in the Rust compiler.
//!
//! This contains lints which can feasibly be implemented as their own
//! AST visitor. Also see `rustc_session::lint::builtin`, which contains the
//! definitions of lints that are emitted directly inside the main compiler.
//!
//! To add a new lint to rustc, declare it here using [... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_lint/src/builtin.rs |
# frozen_string_literal: true
require "cases/helper"
module ActiveRecord
module ConnectionAdapters
class TypesTest < ActiveRecord::TestCase
def test_attributes_which_are_invalid_for_database_can_still_be_reassigned
type_which_cannot_go_to_the_database = Type::Value.new
def type_which_canno... | ruby | github | https://github.com/rails/rails | activerecord/test/cases/types_test.rb |
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsComposerPicture.
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
""... | unknown | codeparrot/codeparrot-clean | ||
# -*- 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 = 'j. E Y'
TIME_FORMAT = 'G.i'
DATET... | unknown | codeparrot/codeparrot-clean | ||
"""Games, or Adversarial Search (Chapter 5)"""
from collections import namedtuple
import random
from utils import argmax
from canvas import Canvas
infinity = float('inf')
GameState = namedtuple('GameState', 'to_move, utility, board, moves')
# _________________________________________________________________________... | unknown | codeparrot/codeparrot-clean | ||
package kotlinx.coroutines.flow
import kotlinx.coroutines.testing.*
import kotlinx.coroutines.*
import kotlin.test.*
class SafeFlowTest : TestBase() {
@Test
fun testEmissionsFromDifferentStateMachine() = runTest {
val result = flow<Int> {
emit1(1)
emit2(2)
}.onEach { y... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | kotlinx-coroutines-core/common/test/flow/SafeFlowTest.kt |
# frozen_string_literal: true
require "cases/helper"
class PostgresqlRenameTableTest < ActiveRecord::PostgreSQLTestCase
def setup
@connection = ActiveRecord::Base.lease_connection
end
def teardown
@connection.drop_table "before_rename", if_exists: true
@connection.drop_table "after_rename", if_exis... | ruby | github | https://github.com/rails/rails | activerecord/test/cases/adapters/postgresql/rename_table_test.rb |
import unittest
from conans.client import tools
from conans.test.utils.tools import TestClient
from conans.test.utils.cpp_test_files import cpp_hello_conan_files
from conans.util.files import save, load
import os
from conans.paths import CONANFILE
from collections import OrderedDict
from conans.test.utils.test_files i... | unknown | codeparrot/codeparrot-clean | ||
//! This module defines a generic file format that allows to check if a given
//! file generated by incremental compilation was generated by a compatible
//! compiler version. This file format is used for the on-disk version of the
//! dependency graph and the exported metadata hashes.
//!
//! In practice "compatible c... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_incremental/src/persist/file_format.rs |
# Copyright 2015, Hewlett-Packard Development Company, L.P.
# Copyright 2016 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
#
# Un... | unknown | codeparrot/codeparrot-clean | ||
#
# -*- 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 auto generated by ... | unknown | codeparrot/codeparrot-clean | ||
'''SSL with SNI_-support for Python 2. Follow these instructions if you would
like to verify SSL certificates in Python 2. Note, the default libraries do
*not* do certificate checking; you need to do additional work to validate
certificates yourself.
This needs the following packages installed:
* pyOpenSSL (tested wi... | unknown | codeparrot/codeparrot-clean | ||
#######################################################################
# Recipies / wrapper functions using toolbox methods for disease,
# drug and network analysis
# e.g. 10/2015
#######################################################################
import diana.toolbox.network_utilities as network_utilities # For D... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2009, 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 f... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import
from django.core.urlresolvers import reverse
from sentry.testutils import TestCase
class ReactPageViewTest(TestCase):
def test_superuser_can_load(self):
org = self.create_organization(owner=self.user)
path = reverse('sentry-organization-home', args=[org.slug... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2011 Hakan Kjellerstrand hakank@bonetmail.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | unknown | codeparrot/codeparrot-clean | ||
// @compilationMode:"infer" @enableResetCacheOnSourceFileChanges @validateExhaustiveMemoizationDependencies:false
import {useEffect, useMemo, useState} from 'react';
import {ValidateMemoization} from 'shared-runtime';
let pretendConst = 0;
function unsafeResetConst() {
pretendConst = 0;
}
function unsafeUpdateCons... | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fast-refresh-refresh-on-const-changes-dev.js |
<!-- markdownlint-disable MD003 MD004 MD007 MD012 MD022 MD024 MD040 -->
etcdctl
========
`etcdctl` is a command line client for [etcd][etcd].
The v3 API is used by default on main branch. For the v2 API, make sure to set environment variable `ETCDCTL_API=2`. See also [READMEv2][READMEv2].
If using released versions... | unknown | github | https://github.com/etcd-io/etcd | etcdctl/README.md |
// Copyright 2012 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 sync_test
import (
"fmt"
"os"
"sync"
)
type httpPkg struct{}
func (httpPkg) Get(url string) {}
var http httpPkg
// This example fetches several ... | go | github | https://github.com/golang/go | src/sync/example_test.go |
from setuptools import Command
from distutils.errors import DistutilsOptionError
import sys
from pkg_resources import *
from unittest import TestLoader, main
class ScanningLoader(TestLoader):
def loadTestsFromModule(self, module):
"""Return a suite of all tests cases contained in the given module
... | unknown | codeparrot/codeparrot-clean | ||
/**
* \file psa/crypto_adjust_config_dependencies.h
* \brief Adjust PSA configuration by resolving some dependencies.
*
* This is an internal header. Do not include it directly.
*
* See docs/proposed/psa-conditional-inclusion-c.md.
* If the Mbed TLS implementation of a cryptographic mechanism A depends on a
* c... | c | github | https://github.com/nodejs/node | deps/LIEF/third-party/mbedtls/include/psa/crypto_adjust_config_dependencies.h |
from pygame import Rect
from thorpy.elements.ghost import Ghost
from thorpy.elements.text import OneLineText
from thorpy.elements.clickable import Clickable
from thorpy.elements.launchers._launcher import _Launcher
from thorpy.elements.box import Box
from thorpy.miscgui import constants, functions, style, painterstyle... | unknown | codeparrot/codeparrot-clean | ||
# 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, software
# d... | unknown | codeparrot/codeparrot-clean | ||
"""
Tests for split_migrator
"""
import random
import uuid
import mock
from nose.plugins.attrib import attr
from xblock.fields import Reference, ReferenceList, ReferenceValueDict, UNIQUE_ID
from xmodule.modulestore.split_migrator import SplitMigrator
from xmodule.modulestore.tests.test_split_w_old_mongo import Split... | unknown | codeparrot/codeparrot-clean | ||
"""
Implements factorial() function.
"""
from .factorial import factorial
def choose(n, k):
"""
The choose function calculates the `binomial coefficient`_
as used in combinatorics and other counting problems.
.. _`binomial coefficient`: https://en.wikipedia.org/wiki/Binomial_coefficient
The bino... | 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... | kotlin | github | https://github.com/spring-projects/spring-framework | framework-docs/src/main/kotlin/org/springframework/docs/integration/cache/cacheannotationenable/CacheConfiguration.kt |
# 🦜✂️ LangChain Text Splitters
[](https://pypi.org/project/langchain-text-splitters/#history)
[](https://opensource.org/licenses/MIT)
[ 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013 YAMAMOTO Takashi <yamamoto at valinux co jp>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:... | unknown | codeparrot/codeparrot-clean | ||
"""
.. module: lemur.sources.cli
:platform: Unix
:copyright: (c) 2018 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
.. moduleauthor:: Kevin Glisson <kglisson@netflix.com>
"""
import sys
import time
from tabulate import tabulate
from flask_script import Manager
from f... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.
#... | unknown | codeparrot/codeparrot-clean | ||
# 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, software
# distributed under t... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2013 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 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/io/MapWritable.java |
//===- bolt/Passes/ReorderUtils.h -------------------------------*- 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 | bolt/include/bolt/Passes/ReorderUtils.h |
# -*- test-case-name: twisted.conch.test.test_insults -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.trial import unittest
from twisted.test.proto_helpers import StringTransport
from twisted.conch.insults.insults import ServerProtocol, ClientProtocol
from twisted.conch.insult... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function
__all__ = ["results"]
import os
import triangle
import numpy as np
import cPickle as pickle
import matplotlib.pyplot as pl
def results(fn):
model, sampler = pickle.load(open(fn, "rb"))
mu = np.median(model.f)
p... | unknown | codeparrot/codeparrot-clean | ||
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-boot | core/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationMetadataLoader.java |
#!/usr/bin/python
#
# Copyright 2013 Google 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
#
# Unless required b... | unknown | codeparrot/codeparrot-clean | ||
#----------------------------------------------------------------------
# Copyright (c) 2008 Board of Trustees, Princeton University
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without restriction, i... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Section'
db.create_table('resume_section', (
('id', self.gf('django.db.models.fie... | unknown | codeparrot/codeparrot-clean | ||
# -*- Mode:Python -*-
##########################################################################
# #
# This file is part of AVANGO. #
# ... | unknown | codeparrot/codeparrot-clean | ||
'''
Copyright (C) 2015 Dato, Inc.
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
'''
from .. import extensions, set_runtime_config, get_runtime_config
from .. import connect as _mt
def connect_odbc(conn_str):
"""
Create ... | unknown | codeparrot/codeparrot-clean | ||
# 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 to in... | unknown | codeparrot/codeparrot-clean | ||
""" Fixtures ensuring that a VM/instance is in the specified state for the test
"""
import pytest
from cfme.common.vm import VM
def _get_vm_obj_if_exists_on_provider(provider, vm_name):
vm = VM.factory(vm_name, provider)
if not vm.does_vm_exist_on_provider():
raise ValueError(
"Unable to e... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from django.contrib.sites.models import Site
from cms.models import Page
from cms.api import create_page, assign_user_to_page
from cms.cache.permissions import (get_permission_cache, set_permission_cache,
clear_user_permission_cache)
from cms.test_utils.testcas... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2003-2005 Maxim Sobolev. All rights reserved.
# Copyright (c) 2006-2014 Sippy Software, Inc. All rights reserved.
#
# 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. Redistrib... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2013 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | unknown | codeparrot/codeparrot-clean | ||
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""Easy install Tests
"""
from __future__ import absolute_import
import sys
import os
import shutil
import tempfile
import site
import contextlib
import tarfile
import logging
import itertools
import distutils.errors
import pytest
try:
from unittest import mock
except ImportError:
imp... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Notification.data'
db.add_column('notifications_notification', 'data',
... | unknown | codeparrot/codeparrot-clean | ||
// Copyright The Prometheus 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 to in w... | go | github | https://github.com/prometheus/prometheus | notifier/sendloop_test.go |
"""Implementation of the univariate g-and-k example model."""
from functools import partial
import numpy as np
import scipy.stats as ss
import elfi
def GNK(A, B, g, k, c=0.8, n_obs=50, batch_size=1, random_state=None):
"""Sample the univariate g-and-k distribution.
References
----------
[1] Drovand... | 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... | kotlin | github | https://github.com/spring-projects/spring-framework | framework-docs/src/main/kotlin/org/springframework/docs/web/websocket/websocketserverruntimeconfiguration/MyEchoHandler.kt |
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you... | java | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/service/BreakableService.java |
/**********************************************************************
signal.c -
$Author$
created at: Tue Dec 20 10:13:44 JST 1994
Copyright (C) 1993-2007 Yukihiro Matsumoto
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
Copyright (C) 2000 Information-technology Promotion Agency, J... | c | github | https://github.com/ruby/ruby | signal.c |
// RUN: %check_clang_tidy -std=c++11,c++14 %s bugprone-exception-copy-constructor-throws %t -- -- -fcxx-exceptions
// FIXME: Split off parts of this test that rely on dynamic exception
// specifications, and run this test in all language modes.
// FIXME: Fix the checker to work in C++17 or later mode.
struct S {};
stru... | cpp | github | https://github.com/llvm/llvm-project | clang-tools-extra/test/clang-tidy/checkers/bugprone/exception-copy-constructor-throws.cpp |
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#ifndef _NGX_STRING_H_INCLUDED_
#define _NGX_STRING_H_INCLUDED_
#include <ngx_config.h>
#include <ngx_core.h>
typedef struct {
size_t len;
u_char *data;
} ngx_str_t;
typedef struct {
ngx_str_t key;
ngx_str_t value;
} ngx_k... | c | github | https://github.com/nginx/nginx | src/core/ngx_string.h |
//===--- IRGen.cpp - Swift LLVM IR Generation -----------------------------===//
//
// 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... | cpp | github | https://github.com/apple/swift | lib/IRGen/IRGen.cpp |
"""Views for the node settings page."""
# -*- coding: utf-8 -*-
import httplib as http
from django.core.exceptions import ValidationError
from furl import furl
import requests
from flask import request
from framework.auth.decorators import must_be_logged_in
from website.addons.base import generic_views
from website.o... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2010-2025 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.standalone.base.declarations
import org.jetbrains.kotlin.name.Calla... | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-standalone/analysis-api-standalone-base/src/org/jetbrains/kotlin/analysis/api/standalone/base/declarations/KotlinStandaloneDeclarationIndex.kt |
#!/usr/bin/python
# Copyright (C) 2010, Nokia (ivan.frade@nokia.com)
#
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
#!/bin/sh
"""": # -*-python-*-
bup_python="$(dirname "$0")/bup-python" || exit $?
exec "$bup_python" "$0" ${1+"$@"}
"""
# end of bup preamble
import sys, glob, tempfile
from bup import options, git, bloom
from bup.helpers import *
optspec = """
bup bloom [options...]
--
ruin ruin the specified bloom file (cleari... | unknown | codeparrot/codeparrot-clean | ||
#define COMMON_DIGEST_FOR_OPENSSL 1
#include <CommonCrypto/CommonDigest.h>
#define SHA1_BLOCK_LENGTH CC_SHA1_BLOCK_BYTES
#define SHA1_DIGEST_LENGTH CC_SHA1_DIGEST_LENGTH
#define SHA1_CTX CC_SHA1_CTX
static DEFINE_UPDATE_FUNC_FOR_UINT(SHA1)
static DEFINE_FINISH_FUNC_FROM_FINAL(SHA1)
#undef SHA1_Update
#undef SHA1_Fi... | c | github | https://github.com/ruby/ruby | ext/digest/sha1/sha1cc.h |
{
"route_1": {
"path": "\/hello\/{name}",
"pathRegex": "#PATH_REGEX#",
"host": "localhost",
"hostRegex": "#HOST_REGEX#",
"scheme": "http|https",
"method": "GET|HEAD",
"class": "Symfony\\Bundle\\FrameworkBundle\\Tests\\Console\\Descriptor\\RouteStub",
"... | json | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_2.json |
'''
This example uses Kivy Garden Graph addon to draw graphs plotting the
accelerometer values in X,Y and Z axes.
The package is installed in the directory: ./libs/garden/garden.graph
To read more about kivy garden, visit: http://kivy-garden.github.io/.
'''
import kivy
from kivy.app import App
from kivy.uix.boxlayout ... | unknown | codeparrot/codeparrot-clean | ||
import {makeObject_Primitives, mutateAndReturn, toJSON} from 'shared-runtime';
function Component(_props) {
const collection = [makeObject_Primitives()];
const results = [];
for (const item of collection) {
results.push(<div key={toJSON(item)}>{toJSON(mutateAndReturn(item))}</div>);
}
return <div>{result... | typescript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-of-mutate.tsx |
#!/usr/bin/env python
"""Tests for grr_response_server.flows.general.filetypes."""
import os
from absl import app
from grr_response_client.client_actions import plist
from grr_response_core.lib.rdfvalues import paths as rdf_paths
from grr_response_core.lib.rdfvalues import plist as rdf_plist
from grr_response_server... | unknown | codeparrot/codeparrot-clean | ||
# rename file
require 'tempfile'
max = 100_000
tmp = [ Tempfile.new('rename-a'), Tempfile.new('rename-b') ]
a, b = tmp.map { |x| x.path }
tmp.each { |t| t.close } # Windows can't rename files without closing them
max.times do
File.rename(a, b)
File.rename(b, a)
end | ruby | github | https://github.com/ruby/ruby | benchmark/file_rename.rb |
#
# Copyright (c) 2011 Red Hat, Inc.
#
# This software is licensed to you under the GNU Lesser General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (LGPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or implied,
# includin... | unknown | codeparrot/codeparrot-clean | ||
/*!
Parses command line arguments into a structured and typed representation.
*/
use std::{borrow::Cow, collections::BTreeSet, ffi::OsString};
use anyhow::Context;
use crate::flags::{
Flag, FlagValue,
defs::FLAGS,
hiargs::HiArgs,
lowargs::{LoggingMode, LowArgs, SpecialMode},
};
/// The result of par... | rust | github | https://github.com/BurntSushi/ripgrep | crates/core/flags/parse.rs |
#!/bin/sh
# Copyright 2005, Ryan Anderson <ryan@michonline.com>
#
# This file is licensed under the GPL v2, or a later version
# at the discretion of Linus Torvalds.
SUBDIRECTORY_OK='Yes'
OPTIONS_KEEPDASHDASH=
OPTIONS_STUCKLONG=
OPTIONS_SPEC='git request-pull [options] start url [end]
--
p show patch text as well
'... | unknown | github | https://github.com/git/git | git-request-pull.sh |
# Copyright 2012 the V8 project authors. 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 conditi... | 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 | ||
{
"name": "symfony/console",
"type": "library",
"description": "Eases the creation of beautiful and testable command line interfaces",
"keywords": ["console", "cli", "command-line", "terminal"],
"homepage": "https://symfony.com",
"license": "MIT",
"authors": [
{
"name": "... | json | github | https://github.com/symfony/symfony | src/Symfony/Component/Console/composer.json |
"""
The :mod:`sklearn.cluster` module gathers popular unsupervised clustering
algorithms.
"""
from .spectral import spectral_clustering, SpectralClustering
from .mean_shift_ import (mean_shift, MeanShift,
estimate_bandwidth, get_bin_seeds)
from .affinity_propagation_ import affinity_propagati... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/conformance/async/es5/awaitUnion_es5.ts] ////
//// [awaitUnion_es5.ts]
declare let a: number | string;
declare let b: PromiseLike<number> | PromiseLike<string>;
declare let c: PromiseLike<number | string>;
declare let d: number | PromiseLike<string>;
declare let e: number | PromiseLike<number | strin... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/awaitUnion_es5(target=es5).js |
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | unknown | codeparrot/codeparrot-clean | ||
# Service Worker configuration file
This topic describes the properties of the service worker configuration file.
## Modifying the configuration
The `ngsw-config.json` JSON configuration file specifies which files and data URLs the Angular service worker should cache and how it should update the cached files and dat... | unknown | github | https://github.com/angular/angular | adev/src/content/ecosystem/service-workers/config.md |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from .brightcove import BrightcoveLegacyIE
from ..compat import (
compat_parse_qs,
compat_urlparse,
)
class TlcDeIE(InfoExtractor):
IE_NAME = 'tlc.de'
_VALID_URL = r'https?://(?:www\.)?tlc\.de/(?:[^/]+... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.