code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.retrievers import BM25Retriever
from langchain_community.retrievers.bm25 import default_preprocessing_func
# Create a way to dynamically look up deprecated imports.
# Used to co... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/retrievers/bm25.py |
# -*- coding: utf-8 -*-
# MinIO Python Library for Amazon S3 Compatible Cloud Storage,
# (C) 2015-2020 MinIO, 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.or... | unknown | codeparrot/codeparrot-clean | ||
test_kind: js_test
selector:
roots:
- jstests/core/**/*.js
- jstests/core_sharding/**/*.js
- jstests/fle2/**/*.js
- src/mongo/db/modules/*/jstests/fle2/**/*.js
exclude_files:
# These tests run in the jscore_txn passthrough suites.
- jstests/core/txns/**/*.js
# The following tests fail ... | unknown | github | https://github.com/mongodb/mongo | buildscripts/resmokeconfig/suites/sharded_collections_jscore_passthrough_base.yml |
"""
Copyright (c) 2014 Brian Muller
Copyright (c) 2015 OpenBazaar
"""
from collections import Counter
from twisted.internet import defer
from log import Logger
from dht.utils import deferredDict
from dht.node import Node, NodeHeap
from protos import objects
class SpiderCrawl(object):
"""
Crawl the network ... | unknown | codeparrot/codeparrot-clean | ||
<!--Copyright 2021 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | unknown | github | https://github.com/huggingface/transformers | docs/source/ko/model_doc/big_bird.md |
# Python test set -- part 2, opcodes
from test_support import *
print '2. Opcodes'
print 'XXX Not yet fully implemented'
print '2.1 try inside for loop'
n = 0
for i in range(10):
n = n+i
try: 1/0
except NameError: pass
except ZeroDivisionError: pass
except TypeError: pass
... | unknown | codeparrot/codeparrot-clean | ||
import gtk
import ns.core
import ns.network
from visualizer.base import InformationWindow
NODE_STATISTICS_MEMORY = 10
## StatisticsCollector class
class StatisticsCollector(object):
"""
Collects interface statistics for all nodes.
"""
## @var node_statistics
# node statistics
## @var visualiz... | unknown | codeparrot/codeparrot-clean | ||
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
#include "frameProcessor.hpp"
#include "rotationConverters.hpp"
#include <opencv2/calib3d.hpp>
#include <opencv2/imgproc.hpp... | cpp | github | https://github.com/opencv/opencv | apps/interactive-calibration/frameProcessor.cpp |
# 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 in the hope that ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# coding: utf8
"""
Dropbox Authentication for web2py
Developed by Massimo Di Pierro (2012)
Same License as Web2py License
"""
# mind here session is dropbox session, not current.session
import os
import re
import urllib
from dropbox import client, rest, session
from gluon import *
from gluon.to... | unknown | codeparrot/codeparrot-clean | ||
"""
Test address breakpoints set with shared library of SBAddress work correctly.
"""
from __future__ import print_function
import lldb
import lldbsuite.test.lldbutil as lldbutil
from lldbsuite.test.lldbtest import *
class AddressBreakpointTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
NO_DEB... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Functions for working with the Inventory service
"""
from __future__ import division
from __future__ import absolute_import
from __future__ import unicode_literals
import logging
import os
import re
from marshmallow import Schema, fields
import requests
import dgpars... | unknown | codeparrot/codeparrot-clean | ||
"""
Provide user facing operators for doing the split part of the
split-apply-combine paradigm.
"""
from __future__ import annotations
from itertools import pairwise
from typing import (
TYPE_CHECKING,
final,
)
import numpy as np
from pandas._libs import (
algos as libalgos,
)
from pandas._libs.tslibs i... | python | github | https://github.com/pandas-dev/pandas | pandas/core/groupby/grouper.py |
/**
* 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... | c | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/main/winutils/chmod.c |
# -*- coding: utf-8; mode: python -*-
# pylint: disable=R0903, C0330, R0914, R0912, E0401
import os
import sys
from sphinx.util.pycompat import execfile_
# ------------------------------------------------------------------------------
def loadConfig(namespace):
# ------------------------------------------------------... | unknown | codeparrot/codeparrot-clean | ||
test_kind: js_test
selector:
roots:
- jstests/core/**/*.js
- jstests/fle2/**/*.js
- src/mongo/db/modules/*/jstests/fle2/**/*.js
exclude_with_any_tags:
- assumes_standalone_mongod
- incompatible_with_initial_sync
# Tests that query the system.profile collection cannot run in this suite sinc... | unknown | github | https://github.com/mongodb/mongo | buildscripts/resmokeconfig/suites/replica_sets_initsync_lagged_sync_source_jscore_passthrough.yml |
from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.document_loaders import PolarsDataFrameLoader
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling o... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/document_loaders/polars_dataframe.py |
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package audit
import (
"context"
"fmt"
"strings"
"sync"
"github.com/hashicorp/vault/sdk/logical"
)
// N.B.: While we could use textproto to get the canonical mime header, HTTP/2
// requires all headers to be converted to lower case, so we j... | go | github | https://github.com/hashicorp/vault | audit/headers.go |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
use Symfony\... | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Resources/config/fragment_listener.php |
__author__ = 'jdaniel'
from AthenaOpt.configuration import Configuration
from AthenaOpt.configuration import encode_configuration
from os import urandom
import json
__author__ = 'jldaniel'
algorithm = 'SERIAL'
model = 'ZDT1'
pop_size = 2048
conv_tol = 0
crossover_index = 15
mutation_index = 20
crossover_probability ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
###############################################################################
#
# CoCalc: Collaborative Calculation in the Cloud
#
# Copyright (C) 2016, Sagemath Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Publ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4 coding=utf-8
import os
import glob
import csv
from django.core.management.base import BaseCommand, CommandError
from django.utils.translation import ugettext_lazy
from odk_logger.models.xform import XForm, DuplicateUUIDError
from optparse import make_option
from utils... | unknown | codeparrot/codeparrot-clean | ||
# IDL (Interface Definition Language)
- [IDL (Interface Definition Language)](#idl-interface-definition-language)
- [Key Features](#key-features)
- [Overview](#overview)
- [Getting started](#getting-started)
- [Getting Started with Commands](#getting-started-with-commands)
- [The IDL file](#the-idl-file)
... | unknown | github | https://github.com/mongodb/mongo | docs/idl.md |
"""$Id: __init__.py 699 2006-09-25 02:01:18Z rubys $"""
__author__ = "Sam Ruby <http://intertwingly.net/> and Mark Pilgrim <http://diveintomark.org/>"
__version__ = "$Revision: 699 $"
__date__ = "$Date: 2006-09-25 02:01:18 +0000 (Mon, 25 Sep 2006) $"
__copyright__ = "Copyright (c) 2002 Sam Ruby and Mark Pilgrim"
impo... | unknown | codeparrot/codeparrot-clean | ||
"""
Open-ended response in the courseware.
"""
from bok_choy.page_object import PageObject
from bok_choy.promise import EmptyPromise
from .rubric import RubricPage
class OpenResponsePage(PageObject):
"""
Open-ended response in the courseware.
"""
url = None
def is_browser_on_page(self):
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python2
"""
setup.py file for SWIG example
"""
from setuptools import setup, Extension
from setuptools.command.install import install
from subprocess import call
import numpy
import os
import sys
try:
numpy_include = numpy.get_include()
except AttributeError:
numpy_include = numpy.get_numpy_in... | unknown | codeparrot/codeparrot-clean | ||
//go:build windows
/*
Copyright 2024 The Kubernetes 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 ag... | go | github | https://github.com/kubernetes/kubernetes | pkg/kubelet/nodeshutdown/nodeshutdown_manager_windows_test.go |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
orm.Version.objects.filter(type=2).delete()
orm.Revision.objects.filt... | unknown | codeparrot/codeparrot-clean | ||
{
"extends": "eslint:recommended",
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 8
}
} | json | github | https://github.com/d3/d3 | .eslintrc.json |
# frozen_string_literal: true
module ActiveModel
module Type
module SerializeCastValue # :nodoc:
extend ActiveSupport::Concern
module ClassMethods
def serialize_cast_value_compatible?
return @serialize_cast_value_compatible if defined?(@serialize_cast_value_compatible)
@s... | ruby | github | https://github.com/rails/rails | activemodel/lib/active_model/type/serialize_cast_value.rb |
#include <linux/libfdt_env.h>
#include "../scripts/dtc/libfdt/fdt.c" | c | github | https://github.com/torvalds/linux | lib/fdt.c |
//===--- Tweak.cpp -----------------------------------------------*- 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
//
//===---------------------------... | cpp | github | https://github.com/llvm/llvm-project | clang-tools-extra/clangd/refactor/Tweak.cpp |
#!/usr/bin/env python
import sys
import os
import zipfile
from argparse import ArgumentParser
from plist.nextstep import NSPlistReader
import pbxproj
from pbxproj.merge import merge_pbxs
from pbxproj.merge.pbxmerge import MergeException
def get_argument_parser():
parser = ArgumentParser()
parser.add_argumen... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Log\Context;
use Illuminate\Contracts\Log\ContextLogProcessor as ContextLogProcessorContract;
use Illuminate\Queue\Events\JobProcessing;
use Illuminate\Queue\Queue;
use Illuminate\Support\Env;
use Illuminate\Support\Facades\Context;
use Illuminate\Support\ServiceProvider;
class ContextServ... | php | github | https://github.com/laravel/framework | src/Illuminate/Log/Context/ContextServiceProvider.php |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import time
from FastBitSet import FastBitSet
ISOTIMEFORMAT = '%Y-%m-%d %X'
cap = 500000
size = 64
listSize = 8
indexes = [1, 555, 687987, 73521, 53821, 1287, 36746, 2165]
print('start BitSet test.')
print()
print('cap:', cap, '; size:', size, '; bites:', cap * size)
print... | unknown | codeparrot/codeparrot-clean | ||
//go:build linux
package ipvlan
import (
"context"
"fmt"
"strconv"
"strings"
"github.com/containerd/log"
"github.com/moby/moby/v2/daemon/libnetwork/ns"
"github.com/vishvananda/netlink"
)
const (
dummyPrefix = "di-" // prefix for dummy ipvlan parent interfaces.
dummyIDLength = 12 // length for dumm... | go | github | https://github.com/moby/moby | daemon/libnetwork/drivers/ipvlan/ipvlan_setup.go |
import logging
import os
import pycbc
import numpy
import lal
from six import u as unicode
from glue.ligolw import ligolw
from glue.ligolw import lsctables
from glue.ligolw import utils as ligolw_utils
from glue.ligolw.utils import process as ligolw_process
from glue.ligolw import param as ligolw_param
from pycbc impor... | unknown | codeparrot/codeparrot-clean | ||
"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2014 Alex Forencich
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... | unknown | codeparrot/codeparrot-clean | ||
#!/bin/bash -eu
# Copyright IBM Corp. 2016, 2025
# SPDX-License-Identifier: BUSL-1.1
#
# fdb-go-install.sh
#
# Installs the FoundationDB Go bindings for a client. This will download
# the repository from the remote repo either into the go directory
# with the appropriate semantic version. It will then build a few
# ge... | unknown | github | https://github.com/hashicorp/vault | physical/foundationdb/fdb-go-install.sh |
"""
PHP FPM Support
"""
import logging
from newrelic_plugin_agent.plugins import base
LOGGER = logging.getLogger(__name__)
class FPM(base.JSONStatsPlugin):
GUID = 'com.meetme.newrelic_php_fpm_agent'
def add_datapoints(self, stats):
"""Add all of the data points for a fpm-pool
:param dict ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import fauxfactory
import pytest
from cfme.common.provider import cleanup_vm
from cfme.services.catalogs.catalog_item import CatalogItem
from cfme.services.catalogs.catalog_item import CatalogBundle
from cfme.services.catalogs.service_catalogs import ServiceCatalogs
from cfme.services import re... | unknown | codeparrot/codeparrot-clean | ||
# coding: UTF-8
"""
Copyright (c) 2008 Marian Tietz
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 a... | unknown | codeparrot/codeparrot-clean | ||
///////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2004, Industrial Light & Magic, a division of Lucas
// Digital Ltd. LLC
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the fol... | c | github | https://github.com/opencv/opencv | 3rdparty/openexr/IlmImf/ImfTileOffsets.h |
/*-------------------------------------------------------------------------
*
* basebackup.c
* code for taking a base backup and streaming it to a standby
*
* Portions Copyright (c) 2010-2026, PostgreSQL Global Development Group
*
* IDENTIFICATION
* src/backend/backup/basebackup.c
*
*---------------------... | c | github | https://github.com/postgres/postgres | src/backend/backup/basebackup.c |
/*
* 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/webmvc/mvcconfig/mvcconfigstaticresources/WebConfiguration.kt |
# -*- coding:utf-8 -*-
#
# This file is part of OpenFisca.
# OpenFisca is a socio-fiscal microsimulation software
# Copyright © 2011 Clément Schaff, Mahdi Ben Jelloul
# Licensed under the terms of the GVPLv3 or later license
# (see openfisca/__init__.py for details)
# This file is inspired by Spyder, see openfisca/spy... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
""" Sahana Eden Messaging Model
@copyright: 2009-2015 (c) Sahana Software Foundation
@license: MIT
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 wit... | unknown | codeparrot/codeparrot-clean | ||
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""
... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
module ActiveModel
module Attributes
module Normalization
extend ActiveSupport::Concern
included do
include ActiveModel::Dirty
include ActiveModel::Validations::Callbacks
class_attribute :normalized_attributes, default: Set.new
before_v... | ruby | github | https://github.com/rails/rails | activemodel/lib/active_model/attributes/normalization.rb |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
mig... | unknown | codeparrot/codeparrot-clean | ||
def _name_to_value(name):
val = {'A': 0, 'B': 2, 'C': 3, 'D': 5, 'E': 7, 'F': 8, 'G': 10}
mod = {'#': 1, 'b': -1}
result = val[name[0]] + sum(mod[m] for m in name[1:])
return result % 12
def _value_to_name(value, accidentals='#'):
name = {0: 'A', 2: 'B', 3: 'C', 5: 'D', 7: 'E', 8: 'F', 10: 'G'}
... | unknown | codeparrot/codeparrot-clean | ||
# ERPNext - web based ERP (http://erpnext.com)
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
#
# 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 3 of the License, or
# (at you... | 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 applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/core/kernels/pooling_ops_common.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 not us... | unknown | codeparrot/codeparrot-clean | ||
import contextlib
import importlib
import importlib.abc
import importlib.machinery
import os
import sys
import tempfile
import unittest
from test.test_importlib import util
# needed tests:
#
# need to test when nested, so that the top-level path isn't sys.path
# need to test dynamic path detection, both at top-level ... | python | github | https://github.com/python/cpython | Lib/test/test_importlib/test_namespace_pkgs.py |
/*[clinic input]
preserve
[clinic start generated code]*/
#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_abstract.h" // _PyNumber_Index()
#include "pycore_modsupport.h" // _PyArg_U... | c | github | https://github.com/python/cpython | Modules/clinic/sha3module.c.h |
"""
A variant of simple_tcp_server.py that measures the time it takes to
send N messages for a range of N. (This was O(N**2) in a previous
version of Tulip.)
Note that running this example starts both the TCP server and client
in the same process. It listens on port 1234 on 127.0.0.1, so it will
fail if this port is... | unknown | codeparrot/codeparrot-clean | ||
import os
import unittest
import tempfile
import shutil
try:
from catkin.package_version import _replace_version, update_versions
except ImportError as impe:
raise ImportError(
'Please adjust your pythonpath before running this test: %s' % str(impe))
class PackageVersionTest(unittest.TestCase):
d... | unknown | codeparrot/codeparrot-clean | ||
###
# Copyright 2011 Diamond Light Source Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | unknown | codeparrot/codeparrot-clean | ||
#ifndef RUBY_BACKWARD2_RMODULE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY_BACKWARD2_RMODULE_H
/**
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistr... | c | github | https://github.com/ruby/ruby | include/ruby/backward/2/rmodule.h |
package kotlinx.coroutines
import kotlinx.coroutines.testing.*
import kotlin.coroutines.*
import kotlin.test.*
class UndispatchedResultTest : TestBase() {
@Test
fun testWithContext() = runTest {
invokeTest { block -> withContext(wrapperDispatcher(coroutineContext), block) }
}
@Test
fun t... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | kotlinx-coroutines-core/common/test/UndispatchedResultTest.kt |
from datetime import datetime
from functools import partial
from typing import Collection, Dict, Union
from typing import Iterable, List, Sequence, Type
import pandas as pd
from pypika import (
Query,
enums,
terms,
)
from pypika import Table, functions as fn
from pypika.queries import QueryBuilder
from pyp... | unknown | codeparrot/codeparrot-clean | ||
# NEWS for Ruby 3.0.0
This document is a list of user visible feature changes
since the **2.7.0** release, except for bug fixes.
Note that each entry is kept to a minimum, see links for details.
## Language changes
* Keyword arguments are now separated from positional arguments.
Code that resulted in deprecation ... | unknown | github | https://github.com/ruby/ruby | doc/NEWS/NEWS-3.0.0.md |
import asyncio
import time
import math
import logging
logger = logging.getLogger()
class DampingForward:
def __init__(self, component):
self.component = component
self.is_running = True
self._value = None
def cancel(self):
self.is_running = False
self.component._value... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2014 Red Hat, Inc., Peter Portante <peter.portante@redhat.com>
# 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 v... | unknown | codeparrot/codeparrot-clean | ||
import sys
from textwrap import dedent
import py
import pytest
import tox
import tox.config
from tox.config import * # noqa
from tox.venv import VirtualEnv
class TestVenvConfig:
def test_config_parsing_minimal(self, tmpdir, newconfig):
config = newconfig([], """
[testenv:py1]
""")
... | unknown | codeparrot/codeparrot-clean | ||
from setuptools import setup, find_packages
setup(
name='django-postman',
version=__import__('postman').__version__,
description='User-to-User messaging system for Django, with gateway to AnonymousUser,' \
' moderation and thread management, user & exchange filters, inbox/sent/archives/trash folder... | 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.platform.modification
import org.jetbrains.kotlin.analysis.api.KaPl... | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-platform-interface/src/org/jetbrains/kotlin/analysis/api/platform/modification/KotlinGlobalModuleStateModificationEvent.kt |
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## Copyright © 2007-2012, Matthias Urlichs <matthias@urlichs.de>
##
## 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 3 of the L... | unknown | codeparrot/codeparrot-clean | ||
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*
Copyright The Kubernetes 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... | go | github | https://github.com/kubernetes/kubernetes | pkg/apis/resource/v1beta2/zz_generated.validations.go |
"""
Distribution class
"""
# To do:
#
# - wrap bins for cyclic histograms
# - check use of float() in count_mag() etc
# - clarify comment about negative selectivity
#
# - function to return value in a range (like a real histogram)
# - cache values
# - assumes cyclic axes start at 0: include a shift based on range
#
# -... | unknown | codeparrot/codeparrot-clean | ||
from django.contrib import admin
from amanda.articles.models import Article, Author
class ArticleAdmin(admin.ModelAdmin):
list_display = ('title', 'slug', 'datetime', 'is_published', 'is_featured', 'hidden')
list_filter = ('is_published', 'is_featured', 'hidden', 'author')
search_fields = ('title', 'slug'... | unknown | codeparrot/codeparrot-clean | ||
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Krzysztof Magosa <krzysztof@magosa.pl>
# Copyright: (c) 2017, Ansible Project
# 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__ = t... | unknown | codeparrot/codeparrot-clean | ||
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
import pytest
import math as m
import numpy as np
import sisl
pytestmark = pytest.mark.version
def test_version():
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread 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:
# 1. Redistributions of source code must retain the above copyright
# ... | unknown | codeparrot/codeparrot-clean | ||
"""Fixtures for the forum models."""
import datetime
import pytest
from flaskbb.forum.models import Forum, Category, Topic, Post, ForumsRead, \
TopicsRead
@pytest.fixture
def category(database):
"""A single category."""
category = Category(title="Test Category")
category.save()
return category
@p... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Olivier Boukili <boukili.olivier@gmail.com>
# 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 | ||
# Copyright 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 requir... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2017 CERN.
#
# Invenio is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-framework | spring-context/src/main/java/org/springframework/format/datetime/standard/Jsr310DateTimeFormatAnnotationFormatterFactory.java |
# (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 | ||
import sys
from math import sqrt
from rlib.arithmetic import (
ovfcheck,
LONG_BIT,
bigint_from_int,
string_to_int,
bigint_from_str,
ParseStringOverflowError,
)
from rlib.llop import as_32_bit_unsigned_value, unsigned_right_shift
from som.primitives.primitives import Primitives
from som.vm.glo... | unknown | codeparrot/codeparrot-clean | ||
<!--Copyright 2023 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | unknown | github | https://github.com/huggingface/transformers | docs/source/en/main_classes/backbones.md |
#!/usr/bin/python
# coding: utf8
from __future__ import absolute_import
from geocoder.base import Base
from geocoder.keys import app_id, app_code
from geocoder.location import Location
from geocoder.here import Here
class HereReverse(Here, Base):
"""
HERE Geocoding REST API
=======================
Sen... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from openerp import http
from openerp.http import request
from openerp.addons.web_editor.controllers.main import Web_Editor
class Web_Editor(Web_Editor):
@http.route(["/website_mass_mailing/field/popup_content"], type='http', auth="user")
def mass_mailing_FieldTextHtmlPopupTemplate(se... | unknown | codeparrot/codeparrot-clean | ||
///////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2002, Industrial Light & Magic, a division of Lucas
// Digital Ltd. LLC
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the fol... | c | github | https://github.com/opencv/opencv | 3rdparty/openexr/Half/half.h |
<?php declare(strict_types=1);
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Command... | php | github | https://github.com/composer/composer | src/Composer/Command/ValidateCommand.php |
#!/usr/bin/env python
# -*- coding: utf8 -*-
#
# Copyright (c) 2014 unfoldingWord
# http://creativecommons.org/licenses/MIT/
# See LICENSE file for details.
#
# Contributors:
# Jesse Griffin <jesse@distantshores.org>
"""
This script renames the DokuWiki export UTB files to appropriate USFM
filenames.
Requires th... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | unknown | codeparrot/codeparrot-clean | ||
{
"values": {
"id": {
"string": "F40F2AB4-100C-4AE8-BFD0-BF332A158415"
},
"list": {
"list": [
{
"object": {
"id": {
"string": "3BFC1A84-023F-44FA-A8EE-EFD88E18B8F7"
}
}
},
{
"object": {
"id"... | json | github | https://github.com/hashicorp/terraform | testing/equivalence-tests/tests/replace_within_list/terraform.resource/F40F2AB4-100C-4AE8-BFD0-BF332A158415.json |
# obsolete - should be deleted if there are no objections.
__author__ = 'Thomas Rueckstiess, ruecksti@in.tum.de'
from pybrain.utilities import abstractMethod
import threading
class Renderer(threading.Thread):
""" The general interface for a class displays what is happening in an environment.
The renderer... | unknown | codeparrot/codeparrot-clean | ||
# The contents of this file are subject to the BitTorrent Open Source License
# Version 1.1 (the License). You may not copy or use this file, in either
# source code or executable form, except in compliance with the License. You
# may obtain a copy of the License at http://www.bittorrent.com/license/.
#
# Software di... | unknown | codeparrot/codeparrot-clean | ||
from os.path import dirname
from django.test import TestCase
from django.conf import settings
from django.test.utils import override_settings
import oscar
from oscar.core.loading import (
get_model, AppNotFoundError, get_classes, get_class, ClassNotFoundError)
from tests import temporary_python_path
class TestCl... | unknown | codeparrot/codeparrot-clean | ||
import os
import shutil
import glob
def gen_xml(args):
wildcard = "*.*"
path = args.data + "/" + args.input
filelist = glob.glob(path + "/" + args.wildcard)
dest = open(args.data + "/" + args.out, "w")
write = dest.write
write("<resources>\n")
write("\t<set path=\"%s\"/>\n" % (args.input,... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import, unicode_literals
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.test import TestCase, override_settings
class TestPageExplorer(TestCase):
@override_settings(MESSAGE_TAGS={
messages.DEBUG: 'my-custom-tag',
message... | 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 'Cart'
db.create_table(u'cart_cart', (
(u'id', self.gf('django.db.models.fields.Au... | unknown | codeparrot/codeparrot-clean | ||
from unittest import mock
from django.apps.registry import apps as global_apps
from django.db import DatabaseError, connection, migrations, models
from django.db.migrations.exceptions import InvalidMigrationPlan
from django.db.migrations.executor import MigrationExecutor
from django.db.migrations.graph import Migratio... | python | github | https://github.com/django/django | tests/migrations/test_executor.py |
#!/bin/bash
set -ex
# Most of the time, NCCL version won't diverge for different CUDA versions,
# so we can just use the default NCCL version.
NCCL_VERSION=$(cat ci_commit_pins/nccl.txt)
# If NCCL version diverges for different CUDA versions, uncomment the following
# block and add the appropriate files (using CUDA ... | unknown | github | https://github.com/pytorch/pytorch | .ci/docker/common/install_nccl.sh |
"""
Helpers for logging.
This module needs much love to become useful.
"""
# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# Copyright (c) 2008 Gael Varoquaux
# License: BSD Style, 3 clauses.
from __future__ import print_function
import time
import sys
import os
import shutil
import logging
impo... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.