code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Optional from ..._models import BaseModel __all__ = ["FineTuningJobWandbIntegration"] class FineTuningJobWandbIntegration(BaseModel): """The settings for your integration with Weights and Biases. ...
python
github
https://github.com/openai/openai-python
src/openai/types/fine_tuning/fine_tuning_job_wandb_integration.py
# -*- coding: utf-8 -*- """ Created on Fri Feb 19 16:37:13 2016 @author: Stella Psomadaki """ import pointcloud.morton as morton import numpy import math from pointcloud.structures.geometry import Cube, Point3D class Octree: def __init__(self, domain, numLevels, numBits): if min(domain) < 0: r...
unknown
codeparrot/codeparrot-clean
% This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it. **Description** Returns the logarithm of a value to a base. The input can be any numeric value, the return value is always a double. Logs of zero, negative numbers, and base of one return `null` as well...
unknown
github
https://github.com/elastic/elasticsearch
docs/reference/query-languages/esql/_snippets/functions/description/log.md
from math import pi, sqrt import pytest from bcam import calc_utils # Test AABB. @pytest.mark.parametrize('box, point, expected', [ ([1, 2, 3, 4], [0, 0], False), ([1, 2, 3, 4], [1, 2], True), ([1, 2, 3, 4], [1.5, 2.5], True), ([1, 2, 3, 4], [1, 3], True), ([1, 2, 3, 4], [1, 4], True), ([1, 2, ...
unknown
codeparrot/codeparrot-clean
{ "PEXPIRE": { "summary": "Sets the expiration time of a key in milliseconds.", "complexity": "O(1)", "group": "generic", "since": "2.6.0", "arity": -3, "function": "pexpireCommand", "history": [ [ "7.0.0", "Added op...
json
github
https://github.com/redis/redis
src/commands/pexpire.json
# Module kotlinx-coroutines-core Core primitives to work with coroutines. Coroutine builder functions: | **Name** | **Result** | **Scope** | **Description** | ---------------------...
unknown
github
https://github.com/Kotlin/kotlinx.coroutines
kotlinx-coroutines-core/README.md
/** * 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/fs/permission/FsCreateModes.java
# # Note that the content used in this module has been compiled _manually_ by scraping Enrico Fucile's WMO No 306 Vol I.3 code table D-2 document, # adding in sub-types of qudt:QuantityKind (e.g. qudt:ThermodynamicsQuantityKind) for the Type defintion and, finally, adding in a few things # that weren't in Enrico's list...
unknown
codeparrot/codeparrot-clean
"""Base classes for all estimators.""" # Author: Gael Varoquaux <gael.varoquaux@normalesup.org> # License: BSD 3 clause import copy import warnings import numpy as np from scipy import sparse from .externals import six from .utils.fixes import signature from .utils.deprecation import deprecated from .exceptions impo...
unknown
codeparrot/codeparrot-clean
test_kind: js_test selector: roots: - jstests/change_streams/**/*.js exclude_files: # Only relevant for single-collection change streams. - jstests/change_streams/metadata_notifications.js # This test exercises the internal behavior of $changeStream v1 and is not compatible with v2. - jstests/...
unknown
github
https://github.com/mongodb/mongo
buildscripts/resmokeconfig/suites/change_streams_whole_db_passthrough_v2.yml
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt # For license information, please see license.txt from __future__ import unicode_literals import webnotes from webnotes import _ class DocType: def __init__(self, d, dl): self.doc, sel...
unknown
codeparrot/codeparrot-clean
from distutils.command.build_ext import build_ext as _du_build_ext try: # Attempt to use Pyrex for building extensions, if available from Pyrex.Distutils.build_ext import build_ext as _build_ext except ImportError: _build_ext = _du_build_ext import os, sys from distutils.file_util import copy_file from set...
unknown
codeparrot/codeparrot-clean
import logging import json, yaml from run import BaseTestCase from call_server.political_data.geocode import LOCAL_USDATA_SERVICE, NOMINATIM_SERVICE from call_server.political_data.countries.us import USDataProvider class TestGeocoders(BaseTestCase): @classmethod def setUpClass(cls): cls.mock_cache ...
unknown
codeparrot/codeparrot-clean
# (c) 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 re...
unknown
codeparrot/codeparrot-clean
import os, sys, copy, argparse, shutil, pickle, subprocess, logging def process_args(args): parser = argparse.ArgumentParser(description='Evaluate BLEU score') parser.add_argument('--result-path', dest='result_path', type=str, required=True, help=('Result file co...
unknown
codeparrot/codeparrot-clean
#!/bin/sh # # Copyright (c) 2013 Paul Walmsley - based on t9134 by Vitaly Shukela # test_description='git svn property tests' . ./lib-git-svn.sh test_expect_success 'setup test repository' ' svn_cmd co "$svnrepo" s && ( cd s && mkdir qqq www xxx && echo test_qqq > qqq/test_qqq.txt && echo test_www > www/tes...
unknown
github
https://github.com/git/git
t/t9147-git-svn-include-paths.sh
"File-based cache backend" import os import time import shutil try: import cPickle as pickle except ImportError: import pickle from django.core.cache.backends.base import BaseCache from django.utils.hashcompat import md5_constructor class FileBasedCache(BaseCache): def __init__(self, dir, params): ...
unknown
codeparrot/codeparrot-clean
//// [tests/cases/conformance/async/es5/asyncQualifiedReturnType_es5.ts] //// //// [asyncQualifiedReturnType_es5.ts] namespace X { export class MyPromise<T> extends Promise<T> { } } async function f(): X.MyPromise<void> { } //// [asyncQualifiedReturnType_es5.js] "use strict"; var X; (function (X) { class...
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/asyncQualifiedReturnType_es5(target=es2015).js
#!/bin/sh # Copyright (c) 2011, Google Inc. test_description='diff --stat-count' . ./test-lib.sh test_expect_success 'setup' ' >a && >b && >c && >d && git add a b c d && git commit -m initial ' test_expect_success 'mode-only change show as a 0-line change' ' git reset --hard && test_chmod +x b d && echo a ...
unknown
github
https://github.com/git/git
t/t4049-diff-stat-count.sh
# coding: utf-8 """Model zoo for pre-trained models.""" from __future__ import print_function __all__ = ['get_model_file', 'purge'] import hashlib import os import zipfile from ...test_utils import download _model_sha1 = {name: checksum for checksum, name in [ ('44335d1f0046b328243b32a26a4fbd62d9057b45', 'alexnet...
unknown
codeparrot/codeparrot-clean
from langchain_core.example_selectors.semantic_similarity import ( MaxMarginalRelevanceExampleSelector, SemanticSimilarityExampleSelector, sorted_values, ) __all__ = [ "MaxMarginalRelevanceExampleSelector", "SemanticSimilarityExampleSelector", "sorted_values", ]
python
github
https://github.com/langchain-ai/langchain
libs/langchain/langchain_classic/prompts/example_selector/semantic_similarity.py
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that app bundles are rebuilt correctly. """ import TestGyp import sys if sys.platform == 'darwin': test = TestGyp.TestGyp(...
unknown
codeparrot/codeparrot-clean
{ "title": "v42 Migration Test - HideFrom Tooltip", "schemaVersion": 41, "panels": [ { "id": 1, "title": "Panel with hideFrom.viz = true", "type": "timeseries", "fieldConfig": { "defaults": {}, "overrides": [ { "matcher": { "id": "byN...
json
github
https://github.com/grafana/grafana
apps/dashboard/pkg/migration/testdata/input/v42.hidefrom_tooltip.json
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateM...
unknown
codeparrot/codeparrot-clean
#ifndef SRC_JS_NATIVE_API_H_ #define SRC_JS_NATIVE_API_H_ // This file needs to be compatible with C compilers. #include <stdbool.h> // NOLINT(modernize-deprecated-headers) #include <stddef.h> // NOLINT(modernize-deprecated-headers) #include "js_native_api_types.h" // If you need __declspec(dllimport), either inc...
c
github
https://github.com/nodejs/node
src/js_native_api.h
/* * 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.impl.base.components import com.intellij.psi.PsiElement import com....
kotlin
github
https://github.com/JetBrains/kotlin
analysis/analysis-api-impl-base/src/org/jetbrains/kotlin/analysis/api/impl/base/components/KaBaseAnalysisScopeProviderImpl.kt
from django.contrib.syndication.views import Feed from django.contrib.sites.models import get_current_site from django.contrib import comments from django.utils.translation import ugettext as _ class LatestCommentFeed(Feed): """Feed of latest comments on the current site.""" def __call__(self, request, *args,...
unknown
codeparrot/codeparrot-clean
/* * Copyright 2012-present the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required b...
java
github
https://github.com/spring-projects/spring-boot
core/spring-boot/src/main/java/org/springframework/boot/task/SimpleAsyncTaskSchedulerCustomizer.java
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2 --- $id: http://devicetree.org/schemas/i2c/realtek,rtl9301-i2c.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# title: Realtek RTL I2C Controller maintainers: - Chris Packham <chris.packham@alliedtelesis.co.nz> description: RTL9300 S...
unknown
github
https://github.com/torvalds/linux
Documentation/devicetree/bindings/i2c/realtek,rtl9301-i2c.yaml
# # Copyright 2018 www.privaz.io Valletech AB # Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause) import time import ssl from os import environ from ansible.module_utils.six import string_types from ansible.module_utils.basic import AnsibleModule HAS_PYONE = True...
unknown
codeparrot/codeparrot-clean
from bernard.i18n.translator import ( Sentence, SentenceGroup, SortingDict, TransItem, ) def test_sentence(): item1 = TransItem('FOO', 1, 'foo 1', {}) item2 = TransItem('FOO', 1, 'foo 2', {}) s = Sentence() assert not s.check() s.append(item1) s.append(item2) assert s.chec...
unknown
codeparrot/codeparrot-clean
from PyQt5.QtWidgets import QStackedWidget from qgis._core import QgsWkbTypes, QgsGeometry, QgsPoint from roam.ui.ui_geomwidget import Ui_GeomWidget class GeomWidget(Ui_GeomWidget, QStackedWidget): def __init__(self, parent=None): super(GeomWidget, self).__init__(parent) self.setupUi(self) ...
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/specific/BuilderPojo.java
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # # This file is part of Sequana software # # Copyright (c) 2018 - Sequana Development Team # # File author(s): # Thomas Cokelaer <thomas.cokelaer@pasteur.fr> # # Distributed under the terms of the 3-clause BSD license. # The full license is in the LICENSE file, distributed with this s...
unknown
codeparrot/codeparrot-clean
import json import sys from collections import defaultdict from pymisp import MISPEvent class Comparer(): def __init__(self, filename1, filename2): event1 = MISPEvent() event1.load_file(filename1) event2 = MISPEvent() event2.load_file(filename2) self.__jq_misp_event(filename...
unknown
codeparrot/codeparrot-clean
import toontown.minigame.MinigameCreatorAI from toontown.distributed.ToontownInternalRepository import ToontownInternalRepository from direct.distributed.PyDatagram import * from otp.distributed.DistributedDirectoryAI import DistributedDirectoryAI from otp.distributed.OtpDoGlobals import * class ToontownUberRepository...
unknown
codeparrot/codeparrot-clean
/* * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ @file:Suppress("DEPRECATION", "DEPRECATION_ERROR") package io.ktor.client.plugins.jackson import com.fasterxml.jackson.databind.* import com.fasterxml.jackson.module.kotlin.* import io.ktor....
kotlin
github
https://github.com/ktorio/ktor
ktor-client/ktor-client-plugins/ktor-client-json/ktor-client-jackson/jvm/src/io/ktor/client/plugins/jackson/JacksonSerializer.kt
# Dynamic Types ## Goal Interoperability with native JavaScript ## Examples Unbounded dynamic type: ``` kotlin fun jsFun(p: dynamic): dynamic ``` ## TODO - [ ] Dynamic functions? - [ ] what is the default return type? - [ ] Can we omit `return` expressions when the return type is `dynamic`? - [ ] Can we ret...
unknown
github
https://github.com/JetBrains/kotlin
spec-docs/dynamic-types.md
import unittest from test import support from random import random from math import atan2, isnan, copysign import operator INF = float("inf") NAN = float("nan") # These tests ensure that complex math does the right thing class ComplexTest(unittest.TestCase): def assertAlmostEqual(self, a, b): if isinsta...
unknown
codeparrot/codeparrot-clean
// Copyright 2016 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
tests/framework/integration/cluster_direct.go
/********************************************************************** io.c - $Author$ created at: Fri Oct 15 18:08:59 JST 1993 Copyright (C) 1993-2007 Yukihiro Matsumoto Copyright (C) 2000 Network Applied Communication Laboratory, Inc. Copyright (C) 2000 Information-technology Promotion Agency, Japan...
c
github
https://github.com/ruby/ruby
io.c
/* this file was generated by Tools/unicode/makeunicodedata.py 3.3 */ #define UNIDATA_VERSION "17.0.0" /* a list of unique database records */ const _PyUnicode_DatabaseRecord _PyUnicode_Database_Records[] = { {0, 0, 0, 0, 0, 0, 0, 0, 0}, {13, 0, 15, 0, 0, 0, 4, 0, 0}, {13, 0, 17, 0, 0, 0, 4, 0, 0}, {13...
c
github
https://github.com/python/cpython
Modules/unicodedata_db.h
#!/usr/bin/env python # Adapted from https://github.com/mrafayaleem/kafka-jython from __future__ import absolute_import, print_function import argparse import pprint import sys import threading import traceback from kafka.vendor.six.moves import range from kafka import KafkaProducer from test.fixtures import KafkaF...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python import sys if sys.version_info < (2, 7): print("This script requires at least Python 2.7.") print("Please, update to a newer version: http://www.python.org/download/releases/") exit() import argparse import json import os import re import shutil import tempfile def main(argv=None): parser...
unknown
codeparrot/codeparrot-clean
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may n...
java
github
https://github.com/apache/kafka
clients/src/test/java/org/apache/kafka/common/record/internal/AbstractLegacyRecordBatchTest.java
#include "npy_cpu_features.h" #include "npy_cpu_dispatch.h" // To guarantee the CPU baseline definitions are in scope. #include "numpy/npy_common.h" #include "numpy/npy_cpu.h" // To guarantee the CPU definitions are in scope. /******************** Private Definitions *********************/ // This is initialized duri...
c
github
https://github.com/numpy/numpy
numpy/_core/src/common/npy_cpu_features.c
#include "ruby.h" #include "ruby/encoding.h" VALUE bug_rb_define_dummy_encoding(VALUE self, VALUE name) { int idx = rb_define_dummy_encoding(RSTRING_PTR(name)); return rb_enc_from_encoding(rb_enc_from_index(idx)); } void Init_string_enc_dummy(VALUE klass) { rb_define_singleton_method(klass, "rb_define_dum...
c
github
https://github.com/ruby/ruby
ext/-test-/string/enc_dummy.c
# Copyright (c) 2006-2007 The Regents of The University of Michigan # 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 ...
unknown
codeparrot/codeparrot-clean
/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; const Stats = require("./Stats"); /** @typedef {import("../declarations/WebpackOptions").WatchOptions} WatchOptions */ /** @typedef {import("./Compilation")} Compilation */ /** @typedef {import("./Compil...
javascript
github
https://github.com/webpack/webpack
lib/Watching.js
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # # Copyright (c) 2016 Matt Davis, <mdavis@ansible.com> # Chris Houseknecht, <house@redhat.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 ANSI...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ Unit tests for analytics logic in framework/analytics/__init__.py """ import unittest import pytest from django.utils import timezone from nose.tools import * # flake8: noqa (PEP8 asserts) from flask import Flask from datetime import datetime from framework import analytics, sessions f...
unknown
codeparrot/codeparrot-clean
# 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. """Base class for running tests on a single device.""" import logging import time from pylib import ports from pylib.chrome_test_server_spawner import ...
unknown
codeparrot/codeparrot-clean
//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===---------------------------...
c
github
https://github.com/llvm/llvm-project
clang-tools-extra/clang-tidy/performance/NoIntToPtrCheck.h
/* * Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.analysis.api.fir.test.cases.generated.cases.components.diagnosticProvider; impor...
java
github
https://github.com/JetBrains/kotlin
analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/diagnosticProvider/FirIdeNormalAnalysisScriptSourceModuleCollectDiagnosticsTestGenerated.java
<h1>Root Default</h1>
html
github
https://github.com/vapor/vapor
Tests/VaporTests/Utilities/index.html
use serde_derive::Deserialize; #[derive(Deserialize)] struct Test<'a> { #[serde(borrow = "'a + 'a")] s: &'a str, } fn main() {}
rust
github
https://github.com/serde-rs/serde
test_suite/tests/ui/borrow/duplicate_lifetime.rs
# 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, s...
unknown
codeparrot/codeparrot-clean
'use strict'; const common = require('../common.js'); const assert = require('assert'); const groupedInputs = { group_common: ['undefined', 'utf8', 'utf-8', 'base64', 'binary', 'latin1', 'ucs2'], group_upper: ['UTF-8', 'UTF8', 'UCS2', 'UTF16LE', 'BASE64', 'UCS2'], group_uncommon...
javascript
github
https://github.com/nodejs/node
benchmark/util/normalize-encoding.js
from ckeditor.widgets import DEFAULT_CONFIG DEFAULT_CONFIG.update({'allowedContent': True}) DEFAULT_CONFIG.update({'height': 350}) DEFAULT_CONFIG.update({'toolbar_Full': [ ["Cut", "Copy", "Paste", "PasteText", "PasteFromWord", "-", "Undo", "Redo"], ["Find", "Replace", "-", "SelectAll", "-", "SpellChecker...
unknown
codeparrot/codeparrot-clean
from typing import TYPE_CHECKING, Any from langchain_classic._api import create_importer if TYPE_CHECKING: from langchain_community.llms import Cohere # Create a way to dynamically look up deprecated imports. # Used to consolidate logic for raising deprecation warnings and # handling optional imports. DEPRECATED...
python
github
https://github.com/langchain-ai/langchain
libs/langchain/langchain_classic/llms/cohere.py
// Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 package terraform import ( "fmt" "log" "sort" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/terraform/internal/addrs" "github.com/hashicorp/terraform/internal/configs/configschema" "github.com/hashicorp/terraform/internal/dag" "gith...
go
github
https://github.com/hashicorp/terraform
internal/terraform/transform_reference.go
"""AXI Memory Mapped Slave Model.""" from ..abshdl.module import HDLModule, HDLModuleParameter from ..abshdl.port import HDLModulePort from ..abshdl.expr import HDLExpression from ..abshdl.signal import HDLSignal from ..abshdl.comment import HDLComment, make_comment from ..abshdl.assign import HDLAssignment from ..abs...
unknown
codeparrot/codeparrot-clean
""" Stub implementation of EdxNotes for acceptance tests """ import json import re from uuid import uuid4 from datetime import datetime from copy import deepcopy from .http import StubHttpRequestHandler, StubHttpService # pylint: disable=invalid-name class StubEdxNotesServiceHandler(StubHttpRequestHandler): """ ...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- import types import numpy as np from PyQt4.QtGui import (QDialog, QGridLayout, QSlider, QLabel, QCheckBox, QWidget, QLineEdit, QFrame, QSizePolicy, QHBoxLayout, QPushButton, QMenuBar, QAction, QMenu, QKeySequence, QVBoxLayout, QFileDialog, QPi...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ requests.adapters ~~~~~~~~~~~~~~~~~ This module contains the transport adapters that Requests uses to define and maintain connections. """ import os.path import socket from .models import Response from .packages.urllib3.poolmanager import PoolManager, proxy_from_url from .packages.urllib...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community' } DOCUMENTATION = ''' --- module: aws_ses_identity_policy s...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # encoding: utf-8 """ This script demonstrates how to use pyo to apply processing on an up sampled sound. Steps are: 1 - Up sampling the source. 2 - Offline processing on the up sampled sound. 3 - Down sampled the processed sound. """ import os from pyo import * UP = 8 DOWN = 8 SIZE = 512 IN_SN...
unknown
codeparrot/codeparrot-clean
from typing import TYPE_CHECKING, Any from langchain_classic._api import create_importer if TYPE_CHECKING: from langchain_community.tools import ( BaseSQLDatabaseTool, InfoSQLDatabaseTool, ListSQLDatabaseTool, QuerySQLCheckerTool, QuerySQLDataBaseTool, ) # Create a way...
python
github
https://github.com/langchain-ai/langchain
libs/langchain/langchain_classic/tools/sql_database/tool.py
#!/usr/bin/env python # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import annotations import configparser import sys ini_file = sys.argv[1] c = configparser.ConfigParser(strict=True, inline_comment_prefixes=(';',)) c.read_file(open(ini_file))
python
github
https://github.com/ansible/ansible
test/integration/targets/ansible-config/files/ini_dupes.py
//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===---------------------------...
c
github
https://github.com/llvm/llvm-project
clang-tools-extra/clang-tidy/readability/UseAnyOfAllOfCheck.h
#pragma once #include <c10/core/SymInt.h> #include <c10/util/ArrayRef.h> #include <c10/util/DimVector.h> #include <c10/util/Exception.h> #include <c10/util/irange.h> #include <cstdint> #include <optional> namespace c10 { using SymIntArrayRef = ArrayRef<SymInt>; inline at::IntArrayRef asIntArrayRefUnchecked(c10::SymI...
c
github
https://github.com/pytorch/pytorch
c10/core/SymIntArrayRef.h
# Copyright (c) 2012 Intel Corporation. # 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
<!--- # 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...
unknown
github
https://github.com/apache/hadoop
hadoop-common-project/hadoop-common/src/site/markdown/release/2.0.0-alpha/CHANGELOG.2.0.0-alpha.md
from pandas.core.indexers.utils import ( check_array_indexer, check_key_length, check_setitem_lengths, disallow_ndim_indexing, getitem_returns_view, is_empty_indexer, is_list_like_indexer, is_scalar_indexer, is_valid_positional_slice, length_of_indexer, maybe_convert_indices,...
python
github
https://github.com/pandas-dev/pandas
pandas/core/indexers/__init__.py
#!/usr/bin/env python # Author: Brendan Le Foll <brendan.le.foll@intel.com> # Copyright (c) 2014 Intel Corporation. # # 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, inc...
unknown
codeparrot/codeparrot-clean
/* * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ package io.ktor.utils.io.core import kotlinx.io.* /** * Copy all bytes to the [output]. * Depending on actual input and output implementation it could be zero-copy or copy byte per byte. ...
kotlin
github
https://github.com/ktorio/ktor
ktor-io/common/src/io/ktor/utils/io/core/Copy.kt
// Copyright IBM Corp. 2016, 2025 // SPDX-License-Identifier: BUSL-1.1 package transit import ( "context" "crypto" "crypto/ed25519" cryptoRand "crypto/rand" "crypto/x509" "encoding/base64" "encoding/pem" "fmt" "io" "math/rand" "os" "path" "reflect" "strconv" "strings" "sync" "sync/atomic" "testing" ...
go
github
https://github.com/hashicorp/vault
builtin/logical/transit/backend_test.go
## This file is part of Invenio. ## Copyright (C) 2008, 2009, 2010, 2011, 2013 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any ...
unknown
codeparrot/codeparrot-clean
<?php namespace Illuminate\Tests\Foundation; use Illuminate\Foundation\Application; use PHPUnit\Framework\TestCase; class FoundationApplicationBuilderTest extends TestCase { protected function tearDown(): void { unset($_ENV['APP_BASE_PATH']); unset($_ENV['LARAVEL_STORAGE_PATH'], $_SERVER['LA...
php
github
https://github.com/laravel/framework
tests/Foundation/FoundationApplicationBuilderTest.php
# -*- coding: utf-8 -*- import sys import os import math #读写文件接口函数文件函数 def read_write_file(rfname,wfname,resource_files): readf = open(rfname,'r') writef = open(wfname,'w') for line in readf: #add other functions to deal with each line result_line = location_extr(line.strip(),resource_files) writef.write(resu...
unknown
codeparrot/codeparrot-clean
//! Some lints that are only useful in the compiler or crates that use compiler internals, such as //! Clippy. use rustc_hir::attrs::AttributeKind; use rustc_hir::def::Res; use rustc_hir::def_id::DefId; use rustc_hir::{Expr, ExprKind, HirId, find_attr}; use rustc_middle::ty::{self, GenericArgsRef, PredicatePolarity}; ...
rust
github
https://github.com/rust-lang/rust
compiler/rustc_lint/src/internal.rs
#._cv_part guppy.etc.tkcursors # A Tk window that shows what cursor shapes are available. # Moving the mouse over the cursor name shows the cursor in that shape. from Tkinter import * def tkcursors(master=None): if master is None: root = Tk() else: root = master for i, cursor in enumerate(( 'X_cursor'...
unknown
codeparrot/codeparrot-clean
from __future__ import unicode_literals import re import json from .common import InfoExtractor from ..utils import ( determine_ext, int_or_none, qualities, unescapeHTML, ) class GiantBombIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?giantbomb\.com/videos/(?P<display_id>[^/]+)/(?P<id>\d+-\...
unknown
codeparrot/codeparrot-clean
#! /usr/bin/env python # -*- coding: utf-8 -*- # #dictionary.py # by billy basdras # # this is a small script to practice english # Use # # I didn't include many assertions and checks # Not much checking # so it can be useful in other languages # #it loads file and creates dictionary and then it ...
unknown
codeparrot/codeparrot-clean
#List of all apps and menu to open them #copyright (c) 2015 Tyler Spadgenske #GPL License ############################### #To be packaged with stock TYOS ############################### import sys, time import pygame class Run(): def __init__(self, fona): #Stuff to follow app protocol self.exit = ...
unknown
codeparrot/codeparrot-clean
import numpy as np import math from movielens import tableau_des_notes, tableau_bricole_de_l_lignes_et_c_colonnes def fonction_cout(Y, theta, X): """ :param Y: tableau de notes avec utilisateurs en lignes et films en colonnes :param theta: tableau avec des lignes de profils d'utilisateurs :param X: tab...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # # Copyright 2004,2006,2007,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at ...
unknown
codeparrot/codeparrot-clean
DOCUMENTATION: name: python_literal_eval version_added: "2.19" short_description: evaluate a Python literal expression string description: - Evaluates the input string as a Python literal expression, returning the resulting data structure. - Previous versions of Ansible applied this behavior to all temp...
unknown
github
https://github.com/ansible/ansible
lib/ansible/_internal/ansible_collections/ansible/_protomatter/plugins/filter/python_literal_eval.yml
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import annotations DOCUMENTATION = """ module: check_mode_attribute_5 short_description: Test for check mode attribute 5 description: Test for check mode attribute 5. author: - Ansible Core...
python
github
https://github.com/ansible/ansible
test/integration/targets/ansible-test-sanity-validate-modules/ansible_collections/ns/col/plugins/modules/check_mode_attribute_5.py
from __future__ import print_function __authors__ = "Heng Luo" from pylearn2.testing.skip import skip_if_no_gpu skip_if_no_gpu() import numpy as np from theano.compat.six.moves import xrange from theano import shared from theano.tensor import grad, constant from pylearn2.sandbox.cuda_convnet.filter_acts import Filter...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python """Implement access to the windows registry.""" import ctypes import ctypes.wintypes import exceptions import os import stat import StringIO import _winreg from grr.client import vfs from grr.lib import rdfvalue from grr.lib import utils # Difference between 1 Jan 1601 and 1 Jan 1970. WIN_UNIX_...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, René Moser <mail@renemoser.net> # # 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 Lice...
unknown
codeparrot/codeparrot-clean
#! /usr/bin/python2.4 # # Copyright 2007 Google Inc. # # 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 ...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('sites', '0001_initial'), ('api_admin', '0003_auto_20160404_1618'), ] operations = [ migrations.AddField( model_n...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python -tt # 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 distrib...
unknown
codeparrot/codeparrot-clean
import luigi import luigi.date_interval import luigi.interface import luigi.notifications from helpers import LuigiTestCase, RunOnceTask class LuigiTestCaseTest(LuigiTestCase): def test_1(self): class MyClass(luigi.Task): pass self.assertTrue(self.run_locally(['MyClass'])) def te...
unknown
codeparrot/codeparrot-clean