code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
""" Pytest configuration and fixtures for the Numpy test suite. """ import os import tempfile import hypothesis import pytest import numpy from numpy.core._multiarray_tests import get_fpu_mode _old_fpu_mode = None _collect_results = {} # Use a known and persistent tmpdir for hypothesis' caches, which # can be autom...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python import sys import struct import string class QcowHeaderExtension: def __init__(self, magic, length, data): if length % 8 != 0: padding = 8 - (length % 8) data += "\0" * padding self.magic = magic self.length = length self.data = da...
unknown
codeparrot/codeparrot-clean
# Check every path through every method of UserList from UserList import UserList from test import test_support, list_tests class UserListTest(list_tests.CommonTest): type2test = UserList def test_getslice(self): super(UserListTest, self).test_getslice() l = [0, 1, 2, 3, 4] u = self.t...
unknown
codeparrot/codeparrot-clean
#! /usr/bin/env python # -*- coding: UTF-8 -*- #----------------------------------------------------------------------------------------------------------------------- import sys, os, subprocess, atexit #-----------------------------------------------------------------------------------------------------------------...
unknown
codeparrot/codeparrot-clean
""" SliderWidget :Authors: Berend Klein Haneveld """ from PySide.QtGui import QWidget from PySide.QtGui import QLabel from PySide.QtGui import QSlider from PySide.QtGui import QSpinBox # from PySide.QtGui import QHBoxLayout from PySide.QtGui import QGridLayout from PySide.QtCore import Signal from PySide.QtCore impor...
unknown
codeparrot/codeparrot-clean
# Config Fuzzer This is a testing feature of the mongod and mongos, built into resmoke.py! The config fuzzer is a resmoke feature that randomizes various server parameters of both mongod and mongos on startup. These fuzzed parameters should not affect the correctness of any tests. Therefore, the config fuzzer can be ...
unknown
github
https://github.com/mongodb/mongo
buildscripts/resmokelib/generate_fuzz_config/README.md
# mako/pyparser.py # Copyright (C) 2006-2016 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Handles parsing of Python code. Parsing to AST is done via _ast on Python > 2.5, otherwise th...
unknown
codeparrot/codeparrot-clean
import io import json try: from urllib2 import urlopen, HTTPError from urllib import urlencode except ImportError: from urllib.request import urlopen, HTTPError from urllib.parse import urlencode from pycoin.serialize import b2h, h2b from pycoin.tx import Spendable def payments_for_address(bitcoin_ad...
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-docker-compose/src/dockerTest/java/org/springframework/boot/docker/compose/core/DockerCliIntegrationTests.java
// Copyright 2020 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 import "testing" func TestPackageName(t *testing.T) { var tests = []struct { fileName, pkgName string }{ {"", ""}, {"///", ""}, {"fmt",...
go
github
https://github.com/golang/go
src/cmd/cover/pkgname_test.go
#include <c10/macros/Macros.h> #include <c10/util/Backtrace.h> #include <c10/util/Type.h> #include <c10/util/irange.h> #include <optional> #include <functional> #include <memory> #include <sstream> #include <string> #include <vector> #ifdef _MSC_VER #include <c10/util/Unicode.h> #include <c10/util/win32-headers.h> #i...
cpp
github
https://github.com/pytorch/pytorch
c10/util/Backtrace.cpp
#!/usr/bin/env python3 # from socket import gethostbyname import re import json import pprint import websocket import time # import slacker from slacker import Slacker # from mainbot.autoCommand import NickServLogin pp = pprint.PrettyPrinter(indent=4) class RTMHandler(): events = ["hello", "message", "user_typin...
unknown
codeparrot/codeparrot-clean
"use strict"; class CurrentScript { constructor(path = "", type = "text/javascript") { this.src = `https://test.cases/path/${path}index.js`; this.type = type; this.tagName = "script"; } } module.exports = CurrentScript;
javascript
github
https://github.com/webpack/webpack
test/helpers/CurrentScript.js
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
unknown
codeparrot/codeparrot-clean
""" Adds a sphinx directive that can be used to automatically document a plugin. this:: .. autoplugin :: nose.plugins.foo :plugin: Pluggy produces:: .. automodule :: nose.plugins.foo Options ------- .. cmdoption :: --foo=BAR, --fooble=BAR Do the foo thing to the new thing. Plugin ------ ...
unknown
codeparrot/codeparrot-clean
/* * This file derives from SFMT 1.3.3 * (http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/index.html), which was * released under the terms of the following license: * * Copyright (c) 2006,2007 Mutsuo Saito, Makoto Matsumoto and Hiroshima * University. All rights reserved. * * Redistribution and use ...
c
github
https://github.com/redis/redis
deps/jemalloc/test/include/test/SFMT-params86243.h
""" XXX: This module is deprecated and marked for replacement. """ from django.conf import settings from django.contrib import messages from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect, Http404 from django.shortcuts import render_to_response from django.template import RequestC...
unknown
codeparrot/codeparrot-clean
import sys import yaml import hashlib DEFINE = 'YAML_GEN_TESTS' EVENT_COUNT = 5 def encode_stream(line): for c in line: if c == '\n': yield '\\n' elif c == '"': yield '\\"' elif c == '\t': yield '\\t' elif ord(c) < 0x20: yield '\\x' +...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2011 Tencent Inc. # All rights reserved. # # Author: Michaelpeng <michaelpeng@tencent.com> # Date: October 20, 2011 """ This is the test module for lex_yacc_library target. """ import blade_test class TestLexYacc(blade_test.TargetTest): """Test lex_yacc """ def setUp(self): """set...
unknown
codeparrot/codeparrot-clean
# (c) 2019 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is dis...
unknown
codeparrot/codeparrot-clean
"""Zookeeper Locking Implementations :Maintainer: None :Status: Unknown Error Handling ============== It's highly recommended to add a state listener with :meth:`~KazooClient.add_listener` and watch for :attr:`~KazooState.LOST` and :attr:`~KazooState.SUSPENDED` state changes and re-act appropriately. In the event th...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ Helper functions for classification and quantization Created on Mon Dec 5 14:50:27 2016 @author: brady """ import os import numpy as np from sklearn.tree import tree, _tree def quantize(data, precision): """ Turns floating point into fixed point data :param data: vector to qu...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # Copyright: (c) 2012, Jayson Vantuyl <jayson@aggressive.ly> # 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_...
unknown
codeparrot/codeparrot-clean
<?php namespace Illuminate\Contracts\Queue; interface ShouldQueueAfterCommit extends ShouldQueue { // }
php
github
https://github.com/laravel/framework
src/Illuminate/Contracts/Queue/ShouldQueueAfterCommit.php
#!/usr/bin/env python import sys import yaml import csv from collections import OrderedDict import yaml_odict def convert_file(fname): reader = csv.reader(open(fname, 'r')) registers = OrderedDict() for register_name, lsb, width, field_name, description, reset_value, access in reader: if register...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- # # || ____ _ __ # +------+ / __ )(_) /_______________ _____ ___ # | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ # +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ # || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ # # Copyright (C) 20...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python3 #Not yet usable! # # Converts a Joomla HTML page with standard templates into markdown syntax. # Only main content in converted and everything else removed. # # This script might be used for other HTML page conversion # import getopt import os import re import sys opts, args = getopt.getopt(sys...
unknown
codeparrot/codeparrot-clean
from __future__ import absolute_import, unicode_literals import re import sqlparse from django.utils.html import escape from sqlparse import tokens as T class BoldKeywordFilter: """sqlparse filter to bold SQL keywords""" def process(self, stream): """Process the token stream""" for token_type...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- from django.conf import settings from django.test import TestCase from unittest.mock import patch from zerver.lib.avatar import ( avatar_url, get_avatar_field, ) from zerver.lib.avatar_hash import user_avatar_path from zerver.lib.bugdown import url_filename from zerver.lib.realm_icon im...
unknown
codeparrot/codeparrot-clean
{ "id": "post", "label": "Post", "repeatable": true, "status": true, "json": { "Main": { "title": { "type": "StructuredText", "config": { "label": "Title", "placeholder": "Title of the post", "allowTargetBlank": false, "single": "heading1" ...
json
github
https://github.com/vercel/next.js
examples/cms-prismic/customtypes/post/index.json
#!/usr/bin/env python3 """ Unicode character finder utility: find characters based on words in their official names. This can be used from the command line, just pass words as arguments. Here is the ``main`` function which makes it happen:: >>> main('rook') # doctest: +NORMALIZE_WHITESPACE U+2656 ♖ WHITE...
unknown
codeparrot/codeparrot-clean
# vim: set fileencoding=utf-8 : # Copyright (C) 2008 Joao Paulo de Souza Medeiros # # Author(s): Joao Paulo de Souza Medeiros <ignotus21@gmail.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 Foundat...
unknown
codeparrot/codeparrot-clean
# encoding: utf-8 """ Readbility url shortner api implementation Located at: https://readability.com/developers/api/shortener Doesnt' need anything from the app """ from .base import BaseShortener from ..exceptions import ShorteningErrorException, ExpandingErrorException class Readability(BaseShortener): api_url =...
unknown
codeparrot/codeparrot-clean
# minirst.py - minimal reStructuredText parser # # Copyright 2009, 2010 Matt Mackall <mpm@selenic.com> and others # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. """simplified reStructuredText parser. This parser knows just enoug...
unknown
codeparrot/codeparrot-clean
from django import http from django.conf import settings from django.contrib.sites.models import Site from django.core.exceptions import ImproperlyConfigured from django.test import TestCase, modify_settings, override_settings from django.utils import six from .middleware import RedirectFallbackMiddleware from .models...
unknown
codeparrot/codeparrot-clean
from __future__ import print_function import urllib.request as urlrequest import re import sys import datetime import os KLC_DIR = "C:\\kicad\\utils\\pcb" LIBS_DIR = "C:\\Kicad\\pretty-libs-master" GITHUB_FP_LIB_TABLE = "https://raw.githubusercontent.com/KiCad/kicad-library/master/template/fp-lib-table.for-github" ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # # Copyright (C) 2006 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 ...
unknown
codeparrot/codeparrot-clean
// Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 package renderers import ( "encoding/json" "strings" "testing" "github.com/hashicorp/terraform/internal/command/jsonformat/computed" "github.com/google/go-cmp/cmp" "github.com/mitchellh/colorstring" "github.com/zclconf/go-cty/cty" "githu...
go
github
https://github.com/hashicorp/terraform
internal/command/jsonformat/computed/renderers/renderer_test.go
from __future__ import absolute_import from datetime import timedelta from django.apps import apps from django.db import models from django.utils import timezone from uuid import uuid4 from sentry.db.models import BoundedBigIntegerField, JSONField, Model def default_guid(): return uuid4().hex def default_date_s...
unknown
codeparrot/codeparrot-clean
from django.contrib import messages from django.test import RequestFactory, SimpleTestCase from .utils import DummyStorage class ApiTests(SimpleTestCase): rf = RequestFactory() def setUp(self): self.request = self.rf.request() self.storage = DummyStorage() def test_ok(self): msg ...
python
github
https://github.com/django/django
tests/messages_tests/test_api.py
from openerp.osv import fields, osv import openerp.addons.decimal_precision as dp import datetime from dateutil import parser import openerp.netsvc import base64 import time import os class schedule_account_reports(osv.osv): _name = 'schedule.account.reports' def schedule_report_print(self, cr, uid, *args): #...
unknown
codeparrot/codeparrot-clean
#define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "abspath.h" #include "gettext.h" #include "setup.h" #include "strvec.h" #include "parse-options.h" #include "pkt-line.h" #include "bundle.h" /* * Basic handler for bundle files to connect repositories via sneakernet. * Invocation must include action. ...
c
github
https://github.com/git/git
builtin/bundle.c
# -*- coding: utf-8 -*- # # container-transform documentation build configuration file import os import re def get_version(): """ Extracts the version number from the version.py file. """ VERSION_FILE = '../container_transform/version.py' mo = re.search(r'^__version__ = [\'"]([^\'"]*)[\'"]', open(...
unknown
codeparrot/codeparrot-clean
/* * 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.scopeProvider; import com...
java
github
https://github.com/JetBrains/kotlin
analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/scopeProvider/FirIdeDependentAnalysisSourceModuleTypeScopeTestGenerated.java
# coding=utf-8 # Copyright 2016 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import unittest fro...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # 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 http://mozilla.org/MPL/2.0/. import sys import os from os import path import time import datetime import argparse import platf...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python2 # coding: utf-8 import unittest from pykit import utfjson from pykit import ututil from pykit.ectypes import BlockID from pykit.ectypes import BlockNotInRegion from pykit.ectypes import BlockAreadyInRegion from pykit.ectypes import LevelOutOfBound from pykit.ectypes import Region dd = ututil.d...
unknown
codeparrot/codeparrot-clean
""" ========================================================== Kernel PCA Solvers comparison benchmark: time vs n_samples ========================================================== This benchmark shows that the approximate solvers provided in Kernel PCA can help significantly improve its execution speed when an approx...
python
github
https://github.com/scikit-learn/scikit-learn
benchmarks/bench_kernel_pca_solvers_time_vs_n_samples.py
#! /usr/bin/env python # $Id: test_definition_lists.py 4564 2006-05-21 20:44:42Z wiemann $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Tests for states.py. """ from __init__ import DocutilsTestSupport def suite(): s = DocutilsTestSupport.Parser...
unknown
codeparrot/codeparrot-clean
/* * Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ package io.ktor.client.engine.cio import io.ktor.client.call.* import io.ktor.client.request.* import io.ktor.client.test.base.* import io.ktor.client.tests.utils.* import io.ktor.http.* impo...
kotlin
github
https://github.com/ktorio/ktor
ktor-client/ktor-client-cio/jvm/test/io/ktor/client/engine/cio/CIOSpecificHttpsTest.kt
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import print_function from .data_utils import get_file import string import random import os from six.moves import cPickle from six.moves import zip import numpy as np def make_reuters_dataset(path=os.path.join('datasets', 'temp', 'reuters2...
unknown
codeparrot/codeparrot-clean
# DO NOT EDIT: this file is generated from the specification found in the # following script to centralize the configuration for CI builds: # build_tools/update_environments_and_lock_files.py channels: - conda-forge dependencies: - python=3.13 - ccache - pip - pip: - numpy - scipy - cython - j...
unknown
github
https://github.com/scikit-learn/scikit-learn
build_tools/azure/pylatest_pip_openblas_pandas_environment.yml
:::{include} layout/in.md :::
unknown
github
https://github.com/elastic/elasticsearch
docs/reference/query-languages/esql/_snippets/operators/in.md
import unittest from django.contrib.gis.gdal import Driver, OGRException valid_drivers = ('ESRI Shapefile', 'MapInfo File', 'TIGER', 'S57', 'DGN', 'Memory', 'CSV', 'GML', 'KML') invalid_drivers = ('Foo baz', 'clucka', 'ESRI Shp') aliases = {'eSrI' : 'ESRI Shapefile', 'TigER/linE' : 'TIGER...
unknown
codeparrot/codeparrot-clean
/*------------------------------------------------------------------------- * * pg_backup_utils.c * Utility routines shared by pg_dump and pg_restore * * * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/bin/pg...
c
github
https://github.com/postgres/postgres
src/bin/pg_dump/pg_backup_utils.c
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('bulk_emai...
unknown
codeparrot/codeparrot-clean
///===-- Representation.h - ClangDoc Representation -------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===---------------------------...
c
github
https://github.com/llvm/llvm-project
clang-tools-extra/clang-doc/Representation.h
#!/usr/bin/env python # # This file is protected by Copyright. Please refer to the COPYRIGHT file # distributed with this source distribution. # # This file is part of GNUHAWK. # # GNUHAWK is free software: you can redistribute it and/or modify is under the # terms of the GNU General Public License as published by the ...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- from collections import defaultdict from ctypes import POINTER, create_string_buffer, c_char_p, c_int, c_void_p import re import numpy as np from pyfr.ctypesutil import load_library from pyfr.readers import BaseReader, NodalMeshAssembler from pyfr.readers.nodemaps import CGNSNodeMaps # Possi...
unknown
codeparrot/codeparrot-clean
# Copyright (C) 2012 Midokura Japan K.K. # Copyright (C) 2013 Midokura PTE LTD # 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.or...
unknown
codeparrot/codeparrot-clean
import errno import itertools import os import signal import subprocess import sys import threading import unittest from functools import partial from test import support from test.support import os_helper, force_not_colorized_test_class from test.support import script_helper, threading_helper from unittest import Tes...
python
github
https://github.com/python/cpython
Lib/test/test_pyrepl/test_unix_console.py
# 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
#! /usr/bin/env python # Copyright (C) 2011 Antoine Drouin # # This file is part of Paparazzi. # # Paparazzi 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, or (at your option) # any later ...
unknown
codeparrot/codeparrot-clean
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from __future__ import annotations import typing_extensions from typing import Union, Iterable, Optional from functools import partial from typing_extensions import Literal, overload import httpx from .... import _legacy_response ...
python
github
https://github.com/openai/openai-python
src/openai/resources/beta/threads/threads.py
""" homeassistant.components.rfxtrx ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Provides support for RFXtrx components. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/rfxtrx.html """ import logging from homeassistant.util import slugify DEPENDENCIES = [] REQUIREMEN...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python3 # # test_multibytecodec.py # Unit test for multibytecodec itself # from test import support from test.support import TESTFN import unittest, io, codecs, sys, os import _multibytecodec ALL_CJKENCODINGS = [ # _codecs_cn 'gb2312', 'gbk', 'gb18030', 'hz', # _codecs_hk 'big5hkscs', # _code...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # # Mustache Implementation in PHP 5.3 documentation build configuration file, created by # sphinx-quickstart on Thu Jul 19 23:58:18 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # ...
unknown
codeparrot/codeparrot-clean
# SetTempo.py # ----------- # This extension allows you to set the tempo for imported audio # by playing it back and tapping the space bar in time with the beat. import Jokosher.Extension import gtk import pkg_resources import time #========================================================================= class SetTe...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsLayoutItemLabel. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. ""...
unknown
codeparrot/codeparrot-clean
/** * 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/XAttrSetFlag.java
import requests import demjson from demjson import JSONDecodeError import datetime import time import pytz import pymongo import threading from pymongo import MongoClient import logging import ne_testprep import bd_testprep import sf_testprep import ne_scikit import bd_scikit import sf_scikit LOG_FILENAME = 'TTOBackg...
unknown
codeparrot/codeparrot-clean
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
unknown
codeparrot/codeparrot-clean
/* * Copyright (C) 2007 The Guava Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
java
github
https://github.com/google/guava
android/guava-tests/test/com/google/common/collect/LinkedListMultimapTest.java
from __future__ import unicode_literals import datetime from django.contrib.auth.models import User from django.contrib.sites.models import Site from django.test import TestCase from django.test.utils import override_settings from ..models import Article, Author, UrlArticle @override_settings(ROOT_URLCONF='view_tes...
unknown
codeparrot/codeparrot-clean
/* Copyright 2014 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 agreed to in writing, ...
go
github
https://github.com/kubernetes/kubernetes
pkg/apis/core/validation/events.go
from __future__ import absolute_import import logging import os import re from pip._vendor.six.moves.urllib import parse as urllib_parse from pip.index import Link from pip.utils import rmtree, display_path from pip.utils.logging import indent_log from pip.vcs import vcs, VersionControl _svn_xml_url_re = re.compile...
unknown
codeparrot/codeparrot-clean
import bcrypt def hash_pwd(password): return bcrypt.hashpw(password, bcrypt.gensalt()) def check_pwd(password, hashed): return bcrypt.hashpw(password, hashed) == hashed def fb_image_url(fbid, size='small'): url = 'https://graph.facebook.com/{}/picture?type={}'.format(fbid, size) print(size != 'small...
unknown
codeparrot/codeparrot-clean
from __future__ import absolute_import from __future__ import print_function from typing import Any from argparse import ArgumentParser from django.core.management.base import BaseCommand, CommandError from django.core.exceptions import ValidationError import glob import logging import os import shutil import tempfi...
unknown
codeparrot/codeparrot-clean
use crate::spec::{ Arch, Env, Os, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions, cvs, }; pub(crate) fn target() -> Target { Target { data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(), llvm_target: "riscv32".into(), metadata: TargetMetadata { description:...
rust
github
https://github.com/rust-lang/rust
compiler/rustc_target/src/spec/targets/riscv32imac_esp_espidf.rs
{ "LTRIM": { "summary": "Removes elements from both ends a list. Deletes the list if all elements were trimmed.", "complexity": "O(N) where N is the number of elements to be removed by the operation.", "group": "list", "since": "1.0.0", "arity": 4, "function": "ltrimC...
json
github
https://github.com/redis/redis
src/commands/ltrim.json
import numpy from numpy import cos, sin, pi from numpy.testing import TestCase, run_module_suite, assert_equal, \ assert_almost_equal, assert_allclose from scipy.integrate import quadrature, romberg, romb, newton_cotes class TestQuadrature(TestCase): def quad(self, x, a, b, args): raise NotImplemented...
unknown
codeparrot/codeparrot-clean
# ext/autohandler.py # Copyright (C) 2006-2012 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """adds autohandler functionality to Mako templates. requires that the TemplateLookup class is...
unknown
codeparrot/codeparrot-clean
from typing import TYPE_CHECKING, Any from langchain_classic._api import create_importer if TYPE_CHECKING: from langchain_community.embeddings import AzureOpenAIEmbeddings # Create a way to dynamically look up deprecated imports. # Used to consolidate logic for raising deprecation warnings and # handling optiona...
python
github
https://github.com/langchain-ai/langchain
libs/langchain/langchain_classic/embeddings/azure_openai.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...
unknown
codeparrot/codeparrot-clean
"use strict"; const { getSourceMappingURL } = require("../lib/util/extractSourceMap"); describe("getSourceMappingURL", () => { const cases = [ "/*#sourceMappingURL=absolute-sourceRoot-source-map.map*/", "/* #sourceMappingURL=absolute-sourceRoot-source-map.map */", "//#sourceMappingURL=absolute-sourceRoot-sou...
javascript
github
https://github.com/webpack/webpack
test/extractSourceMap.unittest.js
#!/usr/bin/env python3 """ Utility for parsing HTML entity definitions available from: http://www.w3.org/ as e.g. http://www.w3.org/TR/REC-html40/HTMLlat1.ent Input is read from stdin, output is written to stdout in form of a Python snippet defining a dictionary "entitydefs" mapping literal en...
unknown
codeparrot/codeparrot-clean
"""Constants used by insteon component.""" DOMAIN = "insteon" INSTEON_ENTITIES = "entities" CONF_IP_PORT = "ip_port" CONF_HUB_USERNAME = "username" CONF_HUB_PASSWORD = "password" CONF_HUB_VERSION = "hub_version" CONF_OVERRIDE = "device_override" CONF_PLM_HUB_MSG = "Must configure either a PLM port or a Hub host" CONF...
unknown
codeparrot/codeparrot-clean
# SPDX-License-Identifier: GPL-2.0-only %YAML 1.2 --- $id: http://devicetree.org/schemas/i2c/snps,designware-i2c.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# title: Synopsys DesignWare APB I2C Controller maintainers: - Jarkko Nikula <jarkko.nikula@linux.intel.com> allOf: - $ref: /schemas/i2c/i2c-...
unknown
github
https://github.com/torvalds/linux
Documentation/devicetree/bindings/i2c/snps,designware-i2c.yaml
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- ### BEGIN LICENSE # Copyright (C) 2012 Andrew Starr-Bochicchio <a.starr.b@gmail.com> # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published # by the F...
unknown
codeparrot/codeparrot-clean
# encoding: utf-8 # # Copyright 2015, Foxugly. All rights reserved. # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or (at # your option) any later vers...
unknown
codeparrot/codeparrot-clean
{ "annotations": { "list": [ { "builtIn": 1, "datasource": { "type": "datasource", "uid": "grafana" }, "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations \u0026 Alerts", "target": { ...
json
github
https://github.com/grafana/grafana
apps/dashboard/pkg/migration/conversion/testdata/input/migrated_dev_dashboards/panel-geomap/v1beta1.panel-geomap.v42.json
package client import ( "context" "errors" "fmt" "net/url" "github.com/distribution/reference" ) type ImageTagOptions struct { Source string Target string } type ImageTagResult struct{} // ImageTag tags an image in the docker host func (cli *Client) ImageTag(ctx context.Context, options ImageTagOptions) (Im...
go
github
https://github.com/moby/moby
client/image_tag.go
# Copyright 2012 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
unknown
codeparrot/codeparrot-clean
from ..broker import Broker class CLICredentialBroker(Broker): controller = "cli_credentials" def index(self, **kwargs): """Lists the available cli credentials. Any of the inputs listed may be be used to narrow the list; other inputs will be ignored. Of the various ways to query lists, using this meth...
unknown
codeparrot/codeparrot-clean
/** * AspectJ-based scheduling support. */ @NullMarked package org.springframework.scheduling.aspectj; import org.jspecify.annotations.NullMarked;
java
github
https://github.com/spring-projects/spring-framework
spring-aspects/src/main/java/org/springframework/scheduling/aspectj/package-info.java
use proc_macro2::TokenStream; use quote::quote; pub fn allow_deprecated(input: &syn::DeriveInput) -> Option<TokenStream> { if should_allow_deprecated(input) { Some(quote! { #[allow(deprecated)] }) } else { None } } /// Determine if an `#[allow(deprecated)]` should be added to the derived i...
rust
github
https://github.com/serde-rs/serde
serde_derive/src/deprecated.rs
#!/usr/bin/env python # -*- coding: latin-1 -*- ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import math import random import re import os.path import pyglet from pyglet.gl import * import xml.dom import xml.dom.minidom class SmoothLineGroup(pyglet.graphics.Group): def set_state(self): ...
unknown
codeparrot/codeparrot-clean
import newrelic.api.function_trace _methods = ['save', 'insert', 'update', 'drop', 'remove', 'find_one', 'find', 'count', 'create_index', 'ensure_index', 'drop_indexes', 'drop_index', 'reindex', 'index_information', 'options', 'group', 'rename', 'distinct', 'map_reduce', 'inline_map...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # # Copyright (C) 2013-2015 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # from io import BytesIO import logging import os import re import struct import sys from .compat import sysconfig, detect_encoding, ZipFi...
unknown
codeparrot/codeparrot-clean