code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\JsonLoginBundle\Se... | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/JsonLoginBundle/Security/Http/JsonAuthenticationSuccessHandler.php |
"""
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 agreed to in... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
from django.db.models.signals import post_save, pre_save
from django.test import TestCase
from .models import Account, Employee, Person, Profile, ProxyEmployee
class UpdateOnlyFieldsTests(TestCase):
def test_update_fields_basic(self):
s = Person.objects.create(name... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright (C) 2012, Almar Klein
#
# Visvis is distributed under the terms of the (new) BSD License.
# The full license can be found in 'license.txt'.
# Modified for wxPython Pheonix 3.0.0.0
# Keith Smith 15 Oct 2013
""" The WX backend.
"""
# NOTICE: wx has the same general problem with Ope... | unknown | codeparrot/codeparrot-clean | ||
import pytest
import pandas as pd
import pandas._testing as tm
tables = pytest.importorskip("tables")
@pytest.fixture
def pytables_hdf5_file(temp_h5_path):
"""
Use PyTables to create a simple HDF5 file.
"""
table_schema = {
"c0": tables.Time64Col(pos=0),
"c1": tables.StringCol(5, pos=... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/io/pytables/test_compat.py |
"""Test the cohere reranker."""
from langchain_classic.retrievers.document_compressors.cohere_rerank import CohereRerank
def test_cohere_reranker_init() -> None:
"""Test the cohere reranker initializes correctly."""
CohereRerank() | python | github | https://github.com/langchain-ai/langchain | libs/langchain/tests/integration_tests/retrievers/document_compressors/test_cohere_reranker.py |
- name: eval_query_shape_hash_stability
value:
eval: >-
await import("jstests/libs/override_methods/query_shape_hash_stability.js");
- name: fuzzer_selector
value:
selector:
roots:
- jstestfuzz/out/*.js
exclude_files: []
exclude_with_any_tags: []
- name: common_core_exclude... | unknown | github | https://github.com/mongodb/mongo | buildscripts/resmokeconfig/matrix_suites/overrides/query_shape_hash_stability.yml |
#!/usr/local/bin/python
import sys
import getopt
from genxmlif import GenXmlIfError
from xsvalErrorHandler import ErrorHandler, XsvalError
from minixsv import *
from pyxsval import parseAndValidate
##########################################
# minixsv Wrapper for calling minixsv from comma... | 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 | ||
# coding: utf-8
from sqlalchemy import BigInteger, Column, Date, ForeignKey, Index, Integer, String
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
metadata = Base.metadata
class Meetingdate(Base):
__tablename__ = 'MeetingDate'
__table_... | unknown | codeparrot/codeparrot-clean | ||
from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.utilities import SearxSearchWrapper
from langchain_community.utilities.searx_search import SearxResults
# Create a way to dynamically look up deprecated imports.
# Used to conso... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/utilities/searx_search.py |
#!/usr/bin/python
# coding: utf-8 -*-
# (c) 2018, Samuel Carpentier <samuelcarpentier0@gmail.ca>
# 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 | ||
#! /usr/bin/env python
# Python interface to the Internet finger daemon.
#
# Usage: finger [options] [user][@host] ...
#
# If no host is given, the finger daemon on the local host is contacted.
# Options are passed uninterpreted to the finger daemon!
import sys, string
from socket import *
# Hardcode the number of t... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python3
#####################################################################################
# #
# Prob: Implement a python code to download the stable version of kernel from #
# kernel.org and delete it. ... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import annotations
import json
import logging
from ipaddress import IPv4Address
from socket import gethostbyname
from typing import TYPE_CHECKING, Any
from urllib.parse import urlencode, urlparse
import pytest
from testfixtures import LogCapture
from twisted.internet.defer import succeed
from twisted.... | python | github | https://github.com/scrapy/scrapy | tests/test_crawl.py |
// Copyright 2010 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 math
// The original C code, the long comment, and the constants
// below are from http://netlib.sandia.gov/cephes/cprob/gamma.c.
// The go code is a s... | go | github | https://github.com/golang/go | src/math/gamma.go |
"""
@author: Nick Gk (@ngkogkos)
@license: The MIT License (MIT)
@contact: ngkogkos@protonmail.com
"""
# Volatility's stuff
import volatility.commands as commands
import volatility.scan as scan
import volatility.utils as utils
import volatility.addrspace as addrspace
import volatility.obj as obj
from v... | unknown | codeparrot/codeparrot-clean | ||
import mdp
from mdp import ClassifierCumulator
from mdp import numx
from itertools import count
"""General routines and base classes for Support Vector Machine classifiers.
TODO: Implement some scaling. Either by special Scaling Node or internally.
"""
class _LabelNormalizer(object):
"""This class provides a... | unknown | codeparrot/codeparrot-clean | ||
---
!Symbol
ID: 057557CEBF6E6B2D
Name: 'vector'
Scope: 'std::'
SymInfo:
Kind: Class
Lang: Cpp
CanonicalDeclaration:
FileURI: 'test:///vector.h'
Start:
Line: 215
Column: 10
End:
Line: 215
Column: ... | unknown | github | https://github.com/llvm/llvm-project | clang-tools-extra/clangd/test/Inputs/symbols.test.yaml |
#!/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 distributed... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2013 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | unknown | codeparrot/codeparrot-clean | ||
from unittest import TestCase
from pymple import Container
class A:
pass
class D(A):
pass
class B:
def __init__(self, param: A) -> None:
self.param = param
class C:
def __init__(self, param: B) -> None:
self.param = param
class TestContainer(TestCase):
def setUp(self) -> None:
... | 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."""
from __future__ import print_function
import os
imp... | unknown | codeparrot/codeparrot-clean | ||
import json
from collections.abc import Callable, Sequence
from dataclasses import asdict, is_dataclass
from typing import (
Any,
Literal,
)
from langchain_core.callbacks import CallbackManagerForLLMRun
from langchain_core.language_models import BaseChatModel, LanguageModelInput
from langchain_core.messages im... | python | github | https://github.com/langchain-ai/langchain | libs/langchain_v1/tests/unit_tests/agents/model.py |
use rustc_abi::Endian;
use crate::spec::{Arch, Cc, LinkerFlavor, Lld, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
let mut base = base::netbsd::opts();
base.cpu = "v9".into();
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64"]);
base.max_atomic_wi... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_target/src/spec/targets/sparc64_unknown_netbsd.rs |
# -*- coding: utf-8 -*-
# code for console Encoding difference. Dont' mind on it
import sys
import imp
imp.reload(sys)
try:
sys.setdefaultencoding('UTF8')
except Exception as E:
pass
import testValue
from popbill import TaxinvoiceService, PopbillException
taxinvoiceService = TaxinvoiceService(testValue.Link... | unknown | codeparrot/codeparrot-clean | ||
/* Auto-generated by generate-wrappers.py script. Do not modify */
#if defined(__i386__) || defined(__i686__) || defined(__x86_64__)
#include <x8zip/x3-sse2.c>
#endif /* defined(__i386__) || defined(__i686__) || defined(__x86_64__) */ | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/quantized/cpu/qnnpack/wrappers/x8zip/x3-sse2.c |
#ifndef NUMPY_CORE_SRC_MULTIARRAY_METHODS_H_
#define NUMPY_CORE_SRC_MULTIARRAY_METHODS_H_
#include "npy_static_data.h"
#include "npy_import.h"
extern NPY_NO_EXPORT PyMethodDef array_methods[];
/*
* Pathlib support, takes a borrowed reference and returns a new one.
* The new object may be the same as the old.
*/
s... | c | github | https://github.com/numpy/numpy | numpy/_core/src/multiarray/methods.h |
/*
* 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/quota/ClientQuotaFilterComponent.java |
# Copyright (c) 2016 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | unknown | codeparrot/codeparrot-clean | ||
"""Parse single-nucleotide polymorphism events from human-readable statements.
"""
import re
from collections import namedtuple
from probe_generator.probe import AbstractProbe, InvalidStatement
from probe_generator.sequence_range import SequenceRange
_STATEMENT_REGEX = re.compile(r"""
\s*
([a-zA-Z0-9... | unknown | codeparrot/codeparrot-clean | ||
blank_issues_enabled: true
contact_links:
- name: Ask a question
about: |
You've come to seek help or want to discuss something related to ripgrep.
url: https://github.com/BurntSushi/ripgrep/discussions/new | unknown | github | https://github.com/BurntSushi/ripgrep | .github/ISSUE_TEMPLATE/config.yml |
/* Copyright 2021 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/core/tfrt/mlrt/attribute/attribute.h |
#!/usr/bin/env python
# This example demonstrates how to use the vtkPlaneWidget to probe
# a dataset and then generate contours on the probed data.
import vtk
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# Start by loading some data.
pl3d = vtk.vtkPLOT3DReader()
pl3d.SetXYZFileName(VTK_D... | 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/test/java/org/springframework/boot/autoconfigure/jmx/JmxAutoConfigurationTests.java |
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... | cpp | github | https://github.com/opencv/opencv | modules/core/src/opengl.cpp |
// Copyright 2015 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 main_test
import (
"internal/testenv"
"runtime"
"testing"
"cmd/internal/buildid"
)
func TestNoteReading(t *testing.T) {
tooSlow(t, "runs build")... | go | github | https://github.com/golang/go | src/cmd/go/note_test.go |
// Copyright 2015 The etcd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed t... | go | github | https://github.com/etcd-io/etcd | client/pkg/transport/keepalive_listener_test.go |
# -*- encoding: utf8 -*-
from setuptools import setup, find_packages
from setuptools.command.test import test
from sorl import __version__, __author__, __maintainer__, __email__, __license__
class TestCommand(test):
def run(self):
from tests.runtests import runtests
runtests()
setup(
name='s... | unknown | codeparrot/codeparrot-clean | ||
# Generated from 'CarbonEvents.h'
def FOUR_CHAR_CODE(x): return x
def FOUR_CHAR_CODE(x): return x
false = 0
true = 1
keyAEEventClass = FOUR_CHAR_CODE('evcl')
keyAEEventID = FOUR_CHAR_CODE('evti')
eventAlreadyPostedErr = -9860
eventTargetBusyErr = -9861
eventClassInvalidErr = -9862
eventClassIncorrectErr = -9864
eventH... | unknown | codeparrot/codeparrot-clean | ||
"""Code-coverage tools for CherryPy.
To use this module, or the coverage tools in the test suite,
you need to download 'coverage.py', either Gareth Rees' original
implementation:
http://www.garethrees.org/2001/12/04/python-coverage/
or Ned Batchelder's enhanced version:
http://www.nedbatchelder.com/code/modules/cover... | unknown | codeparrot/codeparrot-clean | ||
---
navigation_title: "Data stream lifecycle settings"
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/reference/current/data-stream-lifecycle-settings.html
applies_to:
stack: all
---
# Data stream lifecycle settings in {{es}} [data-stream-lifecycle-settings]
These are the settings available for con... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/elasticsearch/configuration-reference/data-stream-lifecycle-settings.md |
/* Copyright 2024 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/compiler/mlir/lite/transforms/push_transpose_through_ewise_pass.h |
#! /usr/bin/env python
from mock import patch
from unittest import TestCase
import pandas as pd
from pandashells.bin.p_facet_grid import main
class MainTests(TestCase):
@patch(
'pandashells.bin.p_facet_grid.sys.argv',
'p.facet_grid --row c --map pl.plot --args a b'.split())
@patch('pandashell... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
require "cases/helper"
class AttributesDirtyTest < ActiveModel::TestCase
class DirtyModel
include ActiveModel::Model
include ActiveModel::Attributes
include ActiveModel::Dirty
attribute :name, :string
attribute :color, :string
attribute :size, :integer
def ... | ruby | github | https://github.com/rails/rails | activemodel/test/cases/attributes_dirty_test.rb |
import sys
import numpy as np
import discopy as dp
def remap(d1, d2):
z = d2.Z
r = d2.R
nq = d1.numQ
prim = []
for k in range(d2.numZ):
sheet = []
for j in range(d2.numR):
sheet.append(np.empty((d2.numPhi[k,j], nq),np.float))
prim.append(sheet)
for k in ra... | 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\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TransD... | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/TransDebug/TransPropertyService.php |
##############################################################################
#
# 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 Affero General Public L... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2015 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 | ||
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Utilidades para detectar vídeos de los diferentes conectores
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
#LvX Edited Patched
i... | unknown | codeparrot/codeparrot-clean | ||
import threading
import constants
import botcmd
class LineParsingError(Exception): None
# parse_line(line) → prefix, command, arguments
# Split the line into its component parts
def parse_line(line):
def read_byte():
# Read one byte and advance the index
nonlocal line, index
if eol():
raise LineParsingEr... | unknown | codeparrot/codeparrot-clean | ||
"""SCons.Action
This encapsulates information about executing any sort of action that
can build one or more target Nodes (typically files) from one or more
source Nodes (also typically files) given a specific Environment.
The base class here is ActionBase. The base class supplies just a few
OO utility methods and so... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
require "cases/helper"
require "models/numeric_data"
class NumericDataTest < ActiveRecord::TestCase
def test_big_decimal_conditions
m = NumericData.new(
bank_balance: 1586.43,
big_bank_balance: BigDecimal("1000234000567.95"),
world_population: 6000000000,
my... | ruby | github | https://github.com/rails/rails | activerecord/test/cases/numeric_data_test.rb |
# Copyright (c) 2014 Pure Storage, 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 re... | 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 | ||
// SPDX-License-Identifier: GPL-2.0
/*
* SLUB: A slab allocator with low overhead percpu array caches and mostly
* lockless freeing of objects to slabs in the slowpath.
*
* The allocator synchronizes using spin_trylock for percpu arrays in the
* fastpath, and cmpxchg_double (or bit spinlock) for slowpath freeing.
... | c | github | https://github.com/torvalds/linux | mm/slub.c |
# -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import NoAlertPresentException... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
werkzeug.testsuite.iterio
~~~~~~~~~~~~~~~~~~~~~~~~~
Tests the iterio object.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
from functools import partial
from werkzeug.testsuite import WerkzeugTestCase
from werk... | unknown | codeparrot/codeparrot-clean | ||
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/mstar,msc313-cpupll.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: MStar/Sigmastar MSC313 CPU PLL
maintainers:
- Daniel Palmer <daniel@thingy.jp>
description: |
The MStar/SigmaStar MSC... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/clock/mstar,msc313-cpupll.yaml |
"""Tests for the system health component init."""
import asyncio
from aiohttp.client_exceptions import ClientError
from homeassistant.components import system_health
from homeassistant.setup import async_setup_component
from tests.async_mock import AsyncMock, Mock, patch
from tests.common import get_system_health_in... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2014 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | unknown | codeparrot/codeparrot-clean | ||
# encoding: utf-8
class ICAPSerializer (object):
def __init__ (self, configuration, protocol):
self.configuration = configuration
self.protocol = protocol
def serialize (self, accept_addr, accept_port, peer, message, icap_message, http_header, path, icap_host):
if icap_message is not None and icap_message.met... | unknown | codeparrot/codeparrot-clean | ||
## Input
```javascript
import {useNoAlias} from 'shared-runtime';
function Component(props) {
const item = {a: props.a};
const x = useNoAlias(item, () => {
console.log(props);
}, [props.a]);
return [x, item];
}
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{a: {id: 42}}],
isComponent:... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hook-noAlias.expect.md |
''' Contains classes to connect to a remote session
'''
import requests
import json
import seismo
import numpy as np
from . import utils
class RemoteFunction(object):
'''
This class represents a remote function that can be called on a
seismo-server
'''
def __init__(self, name, host='http://localho... | unknown | codeparrot/codeparrot-clean | ||
"""
.. module:: annotation
:platform: Unix, OSX
:synopsis: A module of methods and utilities for annotating files, post-processing annotated VCFs, and transforming
into additional formats.
.. moduleauthor:: Daniel Gaston <daniel.gaston@dal.ca>
"""
import pipeline
def snpeff(job, config, name, input_vcf):
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2013 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 program is distributed in the hope t... | 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 | configuration-metadata/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/source/generation/ConfigurationPropertySourcesContainer.java |
#!/usr/bin/python
from __future__ import print_function
from utils.misc import MathMLAssociationCopyright
import fontforge
font = fontforge.font()
font.em = 1000
typoLineHeight = 2300
winHeight = 5000
name = "font-lineheight%d-typolineheight%d" % (winHeight, typoLineHeight)
font.fontname = name
font.familyname = name... | unknown | codeparrot/codeparrot-clean | ||
framework:
cache:
app: cache.adapter.redis_tag_aware | unknown | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/cache_app_redis_tag_aware.yml |
#ifndef JEMALLOC_INTERNAL_PRNG_H
#define JEMALLOC_INTERNAL_PRNG_H
#include "jemalloc/internal/bit_util.h"
/*
* Simple linear congruential pseudo-random number generator:
*
* prng(y) = (a*x + c) % m
*
* where the following constants ensure maximal period:
*
* a == Odd number (relatively prime to 2^n), and (... | c | github | https://github.com/redis/redis | deps/jemalloc/include/jemalloc/internal/prng.h |
"""
Todo: cross-check the F-value with stats model
"""
from __future__ import division
import itertools
import warnings
import numpy as np
from scipy import stats, sparse
from numpy.testing import run_module_suite
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from... | unknown | codeparrot/codeparrot-clean | ||
"""Tests for the solver itself."""
from testutils import *
class SimpleSolverTest(unittest.TestCase):
"""A simple suite of tests for this problem.
max (x+y) subject to
0.5*x + y <= 1
0 <= x <= 1
0 <= y <= 1
This should have optimal solution x=1, y=0.5."""
def setUp(self):
lp = se... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2021 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, ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp import models, api, _
from openerp.ex... | unknown | codeparrot/codeparrot-clean | ||
import sys
import threading
import weakref
from django.utils.six.moves import xrange
if sys.version_info < (3, 4):
from .weakref_backports import WeakMethod
else:
from weakref import WeakMethod
def _make_id(target):
if hasattr(target, '__func__'):
return (id(target.__self__), id(target.__func__))... | unknown | codeparrot/codeparrot-clean | ||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/gpio/cirrus,clps711x-mctrl-gpio.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: ARM Cirrus Logic CLPS711X SYSFLG1 MCTRL GPIOs
maintainers:
- Alexander Shiyan <shc_work@mail.ru>
properties:... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/gpio/cirrus,clps711x-mctrl-gpio.yaml |
(function(QUnit) {
QUnit.module('Backbone.Events');
QUnit.test('on and trigger', function(assert) {
assert.expect(2);
var obj = {counter: 0};
_.extend(obj, Backbone.Events);
obj.on('event', function() { obj.counter += 1; });
obj.trigger('event');
assert.equal(obj.counter, 1, 'counter shoul... | javascript | github | https://github.com/lodash/lodash | vendor/backbone/test/events.js |
#!/usr/bin/env python3
# Copyright (c) 2017-2018 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 wallet replace-by-fee capabilities in conjunction with the fallbackfee."""
from test_framework.tes... | unknown | codeparrot/codeparrot-clean | ||
function foo(a, b, c) {
let x = [];
if (a) {
let y = [];
if (b) {
y.push(c);
}
x.push(<div>{y}</div>);
}
return x;
}
export const FIXTURE_ENTRYPOINT = {
fn: foo,
params: ['TodoAdd'],
isComponent: 'TodoAdd',
}; | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/overlapping-scopes-shadowing-within-block.js |
# 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 use ... | unknown | codeparrot/codeparrot-clean | ||
#!python
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (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.mozilla.org/MPL/
#... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package stackaddrs
import (
"testing"
"github.com/google/go-cmp/cmp"
"github.com/hashicorp/hcl/v2"
"github.com/hashicorp/hcl/v2/hclsyntax"
"github.com/zclconf/go-cty/cty"
"github.com/hashicorp/terraform/internal/tfdiags"
)
func TestParseRe... | go | github | https://github.com/hashicorp/terraform | internal/stacks/stackaddrs/removed_test.go |
# Copyright 2014 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 codecs
import os
import sys
import collections
import StringIO
class WithableStringIO(StringIO.StringIO):
def __enter__(self, *args):
return sel... | unknown | codeparrot/codeparrot-clean | ||
/* This is a 5-point algorithm contributed to OpenCV by the author, Bo Li.
It implements the 5-point algorithm solver from Nister's paper:
Nister, An efficient solution to the five-point relative pose problem, PAMI, 2004.
*/
/* Copyright (c) 2013, Bo Li (prclibo@gmail.com), ETH Zurich
All rights reserved.
... | cpp | github | https://github.com/opencv/opencv | modules/calib3d/src/five-point.cpp |
#!/usr/bin/env python
'''
Model code for managing sprites
===============================
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
from pyglet.gl import *
from scene2d.drawable import *
class SpriteLayer(object):
'''Represents a group of sprites at the same z depth.
'''
def __init__(... | unknown | codeparrot/codeparrot-clean | ||
import datetime
from django.contrib.auth import get_user_model
from ..models import Submission
def make_users():
User = get_user_model()
user = User.objects.create_user(
'tester', 'tester@tester.com', 'tester')
admin_user = User.objects.create_superuser(
'admin_tester', 'admin_tester@test... | unknown | codeparrot/codeparrot-clean | ||
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\... | c | github | https://github.com/curl/curl | lib/progress.c |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com)
# Author : Vincent Renaville
from openerp.tools.translate import _
from openerp.osv import fields, osv
class report_webkit_actions(osv.osv_memory):
_na... | unknown | codeparrot/codeparrot-clean | ||
import scrapy
from scrapy.crawler import AsyncCrawlerProcess
class CachingHostnameResolverSpider(scrapy.Spider):
"""
Finishes without a scrapy.exceptions.CannotResolveHostError exception
"""
name = "caching_hostname_resolver_spider"
start_urls = ["http://[::1]"]
if __name__ == "__main__":
pro... | python | github | https://github.com/scrapy/scrapy | tests/AsyncCrawlerProcess/caching_hostname_resolver_ipv6.py |
#! /usr/bin/env python
# -*- coding: Latin-1 -*-
# Enregistrer les coordonnées des membres d'un club
def encodage():
"renvoie la liste des valeurs entrées, ou une liste vide"
print "*** Veuillez entrer les données (ou <Enter> pour terminer) :"
while 1:
nom = raw_input("Nom : ")
if nom == "... | unknown | codeparrot/codeparrot-clean | ||
"""Compute a Pade approximation for the principle branch of the
Lambert W function around 0 and compare it to various other
approximations.
"""
import numpy as np
try:
import mpmath
import matplotlib.pyplot as plt # type: ignore[import]
except ImportError:
pass
def lambertw_pade():
derivs = [mpmath.... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package agentproxyshared
import (
"context"
"errors"
"fmt"
"os"
"path/filepath"
"strings"
log "github.com/hashicorp/go-hclog"
"github.com/hashicorp/vault/command/agentproxyshared/auth"
"github.com/hashicorp/vault/command/agentproxyshared... | go | github | https://github.com/hashicorp/vault | command/agentproxyshared/helpers.go |
__author__ = 'beaver'
import cv2
import os
from time import sleep
cascPath = "/usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_alt2.xml"
faceCascade = cv2.CascadeClassifier(cascPath)
video_capture = cv2.VideoCapture(0)
width = 360
height = 360
def warn():
print("back off")
os.system("""
vol... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""Gather information from the registry on windows."""
from grr_response_core import config
from grr_response_core.lib import artifact_utils
from grr_response_core.lib.rdfvalues import file_finder as rdf_file_finder
from grr_response_core.lib.rdfvalues import paths as rdf_paths
from grr_response_... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for assertions provided by C{SynchronousTestCase} and C{TestCase},
provided by L{twisted.trial.unittest}.
L{TestFailureTests} demonstrates that L{SynchronousTestCase.fail} works, so that
is the only method on C{twisted.trial.unittest.Sy... | 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 | ||
"""
requests.hooks
~~~~~~~~~~~~~~
This module provides the capabilities for the Requests hooks system.
Available hooks:
``response``:
The response generated from a Request.
"""
HOOKS = ["response"]
def default_hooks():
return {event: [] for event in HOOKS}
# TODO: response is the only one
def dispatch_ho... | python | github | https://github.com/psf/requests | src/requests/hooks.py |
"""
SQL functions reference lists:
https://web.archive.org/web/20130407175746/https://www.gaia-gis.it/gaia-sins/spatialite-sql-4.0.0.html
https://www.gaia-gis.it/gaia-sins/spatialite-sql-4.2.1.html
"""
from django.contrib.gis.db.backends.base.operations import (
BaseSpatialOperations,
)
from django.contrib.gis.db.b... | unknown | codeparrot/codeparrot-clean | ||
# Licensed under a 3-clause BSD style license - see PYFITS.rst
import pytest
import numpy as np
from ....io import fits
from ..compression import compress_hdu
from . import FitsTestCase
MAX_INT = np.iinfo(np.intc).max
MAX_LONG = np.iinfo(np.long).max
MAX_LONGLONG = np.iinfo(np.longlong).max
class TestCompressionFu... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python2.7
# Copyright 2015, 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 li... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.