code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
from collections.abc import Mapping from asciitree import draw_tree class Node(object): def __init__(self, name, children): self.name = name self.children = children def __str__(self): return self.name class GraphDict(Mapping): """ GraphDict class takes a dict to represent it ...
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
buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/LifecycleVersionTests.java
# Copyright 2005-2006 Daniel Henninger <jadestorm@nc.rr.com> # Licensed for distribution under the GPL version 2, check COPYING for details # # Ported to PostgreSQL by sh!zeeg <shizeeque@gmail.com> # # PostgreSQL database storage. See db-setup.pgsql in the tools directory in # the root of the distribution, as well as ...
unknown
codeparrot/codeparrot-clean
""" Linear Discriminant Analysis and Quadratic Discriminant Analysis """ # Authors: Clemens Brunner # Martin Billinger # Matthieu Perrot # Mathieu Blondel # License: BSD 3-Clause from __future__ import print_function import warnings import numpy as np from scipy import linalg from .extern...
unknown
codeparrot/codeparrot-clean
""" Wrapper for loading templates from "templates" directories in INSTALLED_APPS packages. """ import os import sys from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.template.base import TemplateDoesNotExist from django.template.loader import BaseLoader from django.u...
unknown
codeparrot/codeparrot-clean
import os import sys import time os.environ["NOSETPS"] = "yes" import anyjson JSONIMP = os.environ.get("JSONIMP") if JSONIMP: anyjson.force_implementation(JSONIMP) print("anyjson implementation: %r" % (anyjson.implementation.name, )) from celery import Celery, group DEFAULT_ITS = 40000 BROKER_TRANSPORT = os.e...
unknown
codeparrot/codeparrot-clean
/* Copyright (c) 2016, 2025, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by the Free Software Foundation. This program is designed to work with certain software (including but not lim...
c
github
https://github.com/mysql/mysql-server
include/scope_guard.h
# configobj.py # A config file reader/writer that supports nested sections in config files. # Copyright (C) 2005-2008 Michael Foord, Nicola Larosa # E-mail: fuzzyman AT voidspace DOT org DOT uk # nico AT tekNico DOT net # ConfigObj 4 # http://www.voidspace.org.uk/python/configobj.html # Released subject to th...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # # CodeIgniter documentation build configuration file, created by # sphinx-quickstart on Sun Aug 28 07:24:38 2011. # # 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 # autogenerated file. # #...
unknown
codeparrot/codeparrot-clean
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
unknown
codeparrot/codeparrot-clean
from copy import deepcopy class EmptyError(Exception): pass class OutOfSpaceError(Exception): pass class Stack: def __init__(self): self._buffer = [] self._min_buffer = [] def push(self, i): if self.is_empty() or i < self._min_buffer[-1]: self._min_buffer.append(i...
unknown
codeparrot/codeparrot-clean
import unittest from mock import MagicMock from steinlib.exceptions import SteinlibParsingException from steinlib.instance import SteinlibInstance from steinlib.parser import RootEofParser class TestRootEofParser(unittest.TestCase): graph = SteinlibInstance() def test_valid_eof(self): upper_case_eof...
unknown
codeparrot/codeparrot-clean
use std::borrow::Cow; use std::fmt::Display; use rustc_ast::AttrId; use rustc_ast::attr::AttributeExt; use rustc_data_structures::fx::FxIndexSet; use rustc_data_structures::stable_hasher::{ HashStable, StableCompare, StableHasher, ToStableHashKey, }; use rustc_error_messages::{DiagArgValue, IntoDiagArg, MultiSpan}...
rust
github
https://github.com/rust-lang/rust
compiler/rustc_lint_defs/src/lib.rs
############################################################################### # # 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 -u ''' ADOdb version update script Updates the version number, and release date in all php and html files ''' from datetime import date import getopt import os from os import path import re import subprocess import sys # ADOdb version validation regex # These are used by sed - they are not ...
unknown
codeparrot/codeparrot-clean
#!/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 # # 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 # "...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 17.1.1 # # Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses...
unknown
codeparrot/codeparrot-clean
# Copyright 2019 Open Source Robotics Foundation, 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
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2 --- $id: http://devicetree.org/schemas/memory-controllers/renesas,dbsc.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# title: Renesas DDR Bus Controllers maintainers: - Geert Uytterhoeven <geert+renesas@glider.be> description: | Ren...
unknown
github
https://github.com/torvalds/linux
Documentation/devicetree/bindings/memory-controllers/renesas,dbsc.yaml
#![cfg_attr( not(all(feature = "rt", feature = "net", feature = "io-uring", tokio_unstable)), allow(dead_code) )] mod driver; use driver::{Direction, Tick}; pub(crate) use driver::{Driver, Handle, ReadyEvent}; mod registration; pub(crate) use registration::Registration; mod registration_set; use registration_...
rust
github
https://github.com/tokio-rs/tokio
tokio/src/runtime/io/mod.rs
/* * Copyright (c) 2007 Mockito contributors * This program is made available under the terms of the MIT License. */ package org.mockito.internal.invocation; import static org.junit.Assert.*; import java.io.ByteArrayOutputStream; import java.io.ObjectOutputStream; import java.lang.reflect.Method; import org.junit...
java
github
https://github.com/mockito/mockito
mockito-core/src/test/java/org/mockito/internal/invocation/SerializableMethodTest.java
""" Support for MQTT Template lights. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/light.mqtt_template/ """ import logging import voluptuous as vol from homeassistant.core import callback from homeassistant.components import mqtt from homeassistant.co...
unknown
codeparrot/codeparrot-clean
""" Support for Homematic thermostats. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/climate.homematic/ """ import logging from homeassistant.components.climate import ( STATE_AUTO, SUPPORT_OPERATION_MODE, SUPPORT_TARGET_TEMPERATURE, ClimateDev...
unknown
codeparrot/codeparrot-clean
import unittest import pingo from pingo.test import level0 from pingo.test import level1 from pingo.detect import check_board running_on_galileo = check_board(pingo.intel.Edison) class EdisonTest(unittest.TestCase): def setUp(self): self.board = pingo.intel.Edison() # Level0 Parameters s...
unknown
codeparrot/codeparrot-clean
# # Copyright 2013-2014, 2018 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 your option) # any later v...
unknown
codeparrot/codeparrot-clean
" Test history, coverage 100%." from idlelib.history import History import unittest from test.support import requires import tkinter as tk from tkinter import Text as tkText from idlelib.idle_test.mock_tk import Text as mkText from idlelib.config import idleConf line1 = 'a = 7' line2 = 'b = a' class StoreTest(unitt...
python
github
https://github.com/python/cpython
Lib/idlelib/idle_test/test_history.py
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2015 Salton Massally (<smassally@idtlabs.sl>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # ...
unknown
codeparrot/codeparrot-clean
# Package releaseauth Test Data Signing Key This directory contains a private key that is only used for signing the test data, along with the public key that the package uses to verfify the signing. Here are the steps to reproduce the test data, which would be necessary if the archive and checksum changes. 1. Import ...
unknown
github
https://github.com/hashicorp/terraform
internal/releaseauth/testdata/sample.md
#!/usr/bin/python import sys import time import os import string import StringIO sys.path.insert(0, "python") import libxml2 # Memory debug specific libxml2.debugMemory(1) debug = 0 verbose = 0 quiet = 1 # # the testsuite description # CONF=os.path.join(os.path.dirname(__file__), "test/relaxng/OASIS/spectest.xml") LO...
unknown
codeparrot/codeparrot-clean
"""Generic socket server classes. This module tries to capture the various aspects of defining a server: For socket-based servers: - address family: - AF_INET{,6}: IP (Internet Protocol) sockets (default) - AF_UNIX: Unix domain sockets - others, e.g. AF_DECNET are conceivable (see <socket.h> ...
unknown
codeparrot/codeparrot-clean
#! /usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2006-2008 (ita) "GLib2 support" import Task, Utils from TaskGen import taskgen, before, after, feature # # glib-genmarshal # @taskgen def add_marshal_file(self, filename, prefix): if not hasattr(self, 'marshal_list'): self.marshal_list = [] self.meths.appe...
unknown
codeparrot/codeparrot-clean
import os, sys, re,string,FCFileTools verbose = 0 dcount = fcount = 0 def replaceTemplate(dirName, oldName, newName): """ modify contents from dirName and below, replace oldName by newName """ for file in os.listdir(dirName): pathName = os.path.join(dirName, file) if not os.path.isdir(pathName): try: pr...
unknown
codeparrot/codeparrot-clean
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
unknown
codeparrot/codeparrot-clean
# (c) 2012, 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) any lat...
unknown
codeparrot/codeparrot-clean
from __future__ import unicode_literals from django.test import SimpleTestCase from localflavor.id_.forms import (IDPhoneNumberField, IDPostCodeField, IDNationalIdentityNumberField, IDLicensePlateField, IDProvince...
unknown
codeparrot/codeparrot-clean
## Input ```javascript function Component(props) { let items = []; for (const key in props) { items.push(<div key={key}>{key}</div>); } return <div>{items}</div>; } export const FIXTURE_ENTRYPOINT = { fn: Component, params: [{hello: null, world: undefined, '!': true}], sequentialRenders: [ {a: n...
unknown
github
https://github.com/facebook/react
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-in-statement.expect.md
"""Provide access to Python's configuration information. """ import sys import os from os.path import pardir, realpath _INSTALL_SCHEMES = { 'posix_prefix': { 'stdlib': '{base}/lib/python{py_version_short}', 'platstdlib': '{platbase}/lib/python{py_version_short}', 'purelib': '{base}/lib/pyt...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python """Creates slice background markers for a volume through its reference mask.""" # build-in modules from argparse import RawTextHelpFormatter import argparse import logging import os import scipy # third-party modules import numpy from nibabel.loadsave import load, save from nibabel.spatialimages im...
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/lombok/LombokDeprecatedSingleProperty.java
// Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // ...
c
github
https://github.com/opencv/opencv
3rdparty/protobuf/src/google/protobuf/stubs/strutil.h
#!/usr/bin/env python """ Copyright (c) 2012 The Ohio State University. 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 req...
unknown
codeparrot/codeparrot-clean
from .api import Account, Charges, Customers, Events, Tokens from . import errors import requests import json class WebPay: """Main interface of webpay library. See `API reference<https://webpay.jp/docs/api/python>`. """ _headers = { 'Content-Type': 'application/json', 'Accept': 'app...
unknown
codeparrot/codeparrot-clean
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) """This package contains modules with hooks for various stages in the Spack install process. You can add modules here ...
unknown
codeparrot/codeparrot-clean
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing_extensions import Literal from .._models import BaseModel __all__ = ["VectorStoreDeleted"] class VectorStoreDeleted(BaseModel): id: str deleted: bool object: Literal["vector_store.deleted"]
python
github
https://github.com/openai/openai-python
src/openai/types/vector_store_deleted.py
import pytest from thefuck.types import Command from thefuck.rules.brew_link import get_new_command, match @pytest.fixture def output(): return ("Error: Could not symlink bin/gcp\n" "Target /usr/local/bin/gcp\n" "already exists. You may want to remove it:\n" " rm '/usr/local/bi...
unknown
codeparrot/codeparrot-clean
use crate::io::util::read_until::read_until_internal; use crate::io::AsyncBufRead; use pin_project_lite::pin_project; use std::io; use std::mem; use std::pin::Pin; use std::task::{ready, Context, Poll}; pin_project! { /// Splitter for the [`split`](crate::io::AsyncBufReadExt::split) method. /// /// A `Spl...
rust
github
https://github.com/tokio-rs/tokio
tokio/src/io/util/split.rs
/* * 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/context/event/ApplicationEventMulticaster.java
# frozen_string_literal: true module ActiveRecord module ValidationsRepairHelper extend ActiveSupport::Concern module ClassMethods def repair_validations(*model_classes) teardown do model_classes.each(&:clear_validators!) end end end def repair_validations(*mod...
ruby
github
https://github.com/rails/rails
activerecord/test/cases/validations_repair_helper.rb
# # 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...
python
github
https://github.com/apache/airflow
airflow-core/src/airflow/ti_deps/deps/mapped_task_expanded.py
{ "assetSchedule": "{{count}} di {{total}} assets aggiornati", "dagActions": { "delete": { "button": "Elimina Dag", "warning": "Questo rimuoverà tutti i metadati relativi al Dag, compresi i Run e le Task." } }, "favoriteDag": "Dag Preferito", "filters": { "allRunTypes": "Tutti i Tipi d...
json
github
https://github.com/apache/airflow
airflow-core/src/airflow/ui/public/i18n/locales/it/dags.json
#!/usr/bin/env python # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Helper script to generate unit test lists for the Chromecast build scripts. """ import glob import optparse import sys def Combine...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # # Copyright 2011,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 your optio...
unknown
codeparrot/codeparrot-clean
""" Helper module for python+domoticz Every script_device_*.py script has the following variables * changed_device: the current device that changed (object of Device) * changed_device_name: name of current device (same as changed_device.name) * is_daytime: boolean, true when it is is daytime * is_nighttime: same fo...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' :py:mod:`mathutils.py` - Math utils ----------------------------------- Miscellaneous math utilities used throughout the code. ''' from __future__ import division, print_function, absolute_import, \ unicode_literals import numpy as np from scipy.signal import me...
unknown
codeparrot/codeparrot-clean
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import glob import os import subprocess import sys from telemetry.internal.platform import profiler _PGOSWEEP_EXECUTABLE = 'pgosweep.exe' class WinPGOProf...
unknown
codeparrot/codeparrot-clean
import Avatar from "../components/avatar"; import DateFormatter from "../components/date-formatter"; import CoverImage from "../components/cover-image"; import Link from "next/link"; type HeroPostProps = { title: string; coverImage: string; date: string | null; excerpt: string; author: { name: string; ...
typescript
github
https://github.com/vercel/next.js
examples/cms-kontent-ai/components/hero-post.tsx
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Unit tests for abc.py.""" import unittest from test import support import abc from inspect import isabstract class TestLegacyAPI(unittest.TestCase): def test_abstractproperty_basics(self): @abc.abstra...
unknown
codeparrot/codeparrot-clean
############################################################################### ## ## Copyright (C) 2014-2015, New York University. ## Copyright (C) 2011-2014, NYU-Poly. ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## ...
unknown
codeparrot/codeparrot-clean
# Copyright 2013 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. """A module for the Installer base class.""" import cr class Installer(cr.Action, cr.Plugin.Type): """Base class for implementing installers. Installe...
unknown
codeparrot/codeparrot-clean
# Copyright 2002, 2003, 2004, 2005 Ben Escoto # # This file is part of rdiff-backup. # # rdiff-backup is free software; you can redistribute it and/or modify # 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 lat...
unknown
codeparrot/codeparrot-clean
import scrapy from scrapy.crawler import AsyncCrawlerProcess class NoRequestsSpider(scrapy.Spider): name = "no_request" async def start(self): return yield process = AsyncCrawlerProcess( settings={ "TWISTED_ENABLED": False, "DOWNLOAD_HANDLERS": { "http": None, ...
python
github
https://github.com/scrapy/scrapy
tests/AsyncCrawlerProcess/reactorless_telnetconsole_disabled.py
import logging import os import os.path from anoisetools import run def build_parser(subparsers): parser = subparsers.add_parser("seqnoise", help="Run SeqNoise", parents=[run.base_parser()]) snoise_opts = parser.add_argument_group("SeqNoise Options") snoise_opts.add_argument('-s', '--sigma', ...
unknown
codeparrot/codeparrot-clean
######################################################################### # # XmlSerial # # Copyright (c) 2011 panStamp <contact@panstamp.com> # # This file is part of the panStamp project. # # panStamp is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public Licens...
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 use ...
unknown
codeparrot/codeparrot-clean
"""Unittests for the various HTTPServer modules. Written by Cody A.W. Somerville <cody-somerville@ubuntu.com>, Josip Dzolonga, and Michael Otteneder for the 2007/08 GHOP contest. """ from http.server import BaseHTTPRequestHandler, HTTPServer, \ SimpleHTTPRequestHandler, CGIHTTPRequestHandler from http import ser...
unknown
codeparrot/codeparrot-clean
from .. import widgets from .core import StringField, BooleanField __all__ = ( 'BooleanField', 'TextAreaField', 'PasswordField', 'FileField', 'HiddenField', 'SubmitField', 'TextField' ) class TextField(StringField): """ Legacy alias for StringField """ class TextAreaField(TextField): """ ...
unknown
codeparrot/codeparrot-clean
# Copyright 2000-2010 Michael Hudson-Doyle <micahel@gmail.com> # Antonio Cuni # Armin Rigo # # All Rights Reserved # # # Permission to use, copy, modify, and distribute this software and # its documentation for any purpose is hereby granted without fe...
python
github
https://github.com/python/cpython
Lib/_pyrepl/unix_console.py
""" PyArchiver Compression and Archiving Library @author: Clivern U{hello@clivern.com} """ from setuptools import setup from pyarchiver import __VERSION__ import os # Utility function to read the README file. def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name = "...
unknown
codeparrot/codeparrot-clean
from refract.elements.base import Element, Attributes, Metadata class String(Element): """ Refract String Element >>> String(content='Hello') """ element = 'string' def __init__(self, meta: Metadata = None, attributes: Attributes = None, content: str = None) -> None: ...
unknown
codeparrot/codeparrot-clean
<!--Copyright 2020 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/perplexity.md
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing_extensions import Literal from ..._models import BaseModel from .realtime_response import RealtimeResponse __all__ = ["ResponseDoneEvent"] class ResponseDoneEvent(BaseModel): """Returned when a Response is done str...
python
github
https://github.com/openai/openai-python
src/openai/types/realtime/response_done_event.py
framework: trusted_proxies: private_ranges
unknown
github
https://github.com/symfony/symfony
src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/trusted_proxies_private_ranges.yml
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {TestBed} from '@angular/core/testing'; import {SettingsStore} from './settings_store'; import {ApplicationOp...
typescript
github
https://github.com/angular/angular
devtools/projects/ng-devtools/src/lib/application-services/settings_store_spec.ts
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
unknown
codeparrot/codeparrot-clean
import sys if sys.version_info[0:2] < (2, 7) or \ sys.version_info[0:2] in ( (3, 0), (3, 1) ): try: import unittest2 as unittest except ImportError: import unittest else: import unittest from pysmi.parser.smi import parserFactory from pysmi.codegen.pysnmp import PySnmpCodeGen from pysmi.c...
unknown
codeparrot/codeparrot-clean
# frozen_string_literal: true require 'test/unit' require 'delegate' class TestDelegateClass < Test::Unit::TestCase module M attr_reader :m end def test_extend obj = DelegateClass(Array).new([]) obj.instance_eval { @m = :m } obj.extend M assert_equal(:m, obj.m, "[ruby-dev:33116]") end d...
ruby
github
https://github.com/ruby/ruby
test/test_delegate.rb
<!--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/ja/model_doc/bark.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 may n...
java
github
https://github.com/apache/kafka
clients/src/test/java/org/apache/kafka/common/network/EchoServer.java
# Copyright (c) 2011 OpenStack Foundation # 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 ...
unknown
codeparrot/codeparrot-clean
package kotlinx.coroutines import kotlinx.coroutines.testing.* import org.junit.* import org.junit.Test import java.lang.IllegalStateException import kotlin.test.* @Suppress("RedundantAsync") class ThreadLocalTest : TestBase() { private val stringThreadLocal = ThreadLocal<String?>() private val intThreadLocal...
kotlin
github
https://github.com/Kotlin/kotlinx.coroutines
kotlinx-coroutines-core/jvm/test/ThreadLocalTest.kt
import math import sys from flask import abort from flask import render_template from flask import request from peewee import Database from peewee import DoesNotExist from peewee import Model from peewee import Proxy from peewee import SelectQuery from playhouse.db_url import connect as db_url_connect class Paginated...
unknown
codeparrot/codeparrot-clean
import WebIDL def WebIDLTest(parser, harness): parser.parse(""" dictionary Dict {}; interface RecordArg { void foo(record<DOMString, Dict> arg); }; """) results = parser.finish() harness.check(len(results), 2, "Should know about two things"); harness.ok(isinstanc...
unknown
codeparrot/codeparrot-clean
""" A script to create some dummy users """ from django.core.management.base import BaseCommand from student.models import CourseEnrollment from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import CourseKey from opaque_keys.edx.locations import SlashSeparatedCourseKey from student.views import _do_creat...
unknown
codeparrot/codeparrot-clean
/* contrib/btree_gin/btree_gin--1.3--1.4.sql */ -- complain if script is sourced in psql, rather than via CREATE EXTENSION \echo Use "ALTER EXTENSION btree_gin UPDATE TO '1.4'" to load this file. \quit -- -- Cross-type operator support is new in 1.4. We only need to worry -- about this for cross-type operators that ...
sql
github
https://github.com/postgres/postgres
contrib/btree_gin/btree_gin--1.3--1.4.sql
#!/usr/bin/python # # Autofocosing routines. # # You will need: scipy matplotlib sextractor # This should work on Debian/ubuntu: # sudo apt-get install python-matplotlib python-scipy python-pyfits sextractor # # If you would like to see sextractor results, get DS9 and pyds9: # # http://hea-www.harvard.edu/saord/ds9/ # ...
unknown
codeparrot/codeparrot-clean
//go:build !windows package libnetwork import "fmt" // DriverInfo returns a collection of driver operational data related to this endpoint retrieved from the driver. func (ep *Endpoint) DriverInfo() (map[string]any, error) { ep, err := ep.retrieveFromStore() if err != nil { return nil, err } n, err := ep.getN...
go
github
https://github.com/moby/moby
daemon/libnetwork/endpoint_info_unix.go
# Copyright 2016 <Yi Jing Zhu/IBM> # # 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
<?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\Bridge\Twig\Mime; use League\HTMLToMarkdown\HtmlConverterInterf...
php
github
https://github.com/symfony/symfony
src/Symfony/Bridge/Twig/Mime/BodyRenderer.php
import sqlite3 as lite import sys from datetime import datetime #con = lite.connect('zthb.sqlite') # with con: # cur = con.cursor() # # cur.execute("UPDATE user_comment SET u_comment=? WHERE u_comment=?", ("__DOLLFACE__","OMG")) # con.commit() # # print "Number of rows updated: %d" % cur.rowcount # w...
unknown
codeparrot/codeparrot-clean
"""Provides a common base for Apache proxies""" import re import os import subprocess import mock import zope.interface from letsencrypt import configuration from letsencrypt import errors as le_errors from letsencrypt_apache import configurator from letsencrypt_compatibility_test import errors from letsencrypt_compa...
unknown
codeparrot/codeparrot-clean
import logging import os import sys import zipfile from os.path import join as opj import openerp from openerp.osv import osv from openerp.tools import convert_file from openerp.tools.translate import _ _logger = logging.getLogger(__name__) MAX_FILE_SIZE = 100 * 1024 * 1024 # in megabytes class view(osv.osv): _...
unknown
codeparrot/codeparrot-clean
apiVersion: apps/v1 kind: DaemonSet metadata: name: bind labels: service: bind spec: selector: matchLabels: service: bind updateStrategy: type: RollingUpdate rollingUpdate: maxUnavailable: 10% template: metadata: labels: service: bind spec: affinity: ...
unknown
github
https://github.com/kubernetes/kubernetes
hack/testdata/rollingupdate-daemonset.yaml
<?php namespace Installer; use Composer\Composer; use Composer\IO\IOInterface; use Composer\Plugin\PluginInterface; class Plugin1 implements PluginInterface { public $name = 'plugin1'; public $version = 'installer-v4'; public function activate(Composer $composer, IOInterface $io) { $io->writ...
php
github
https://github.com/composer/composer
tests/Composer/Test/Plugin/Fixtures/plugin-v4/Installer/Plugin1.php
#file for creating the hash key-values import os import sys from rooster.hashfunc import * from rooster.parsedata import * #creates a directory in python def createrooster(directory): if not os.path.exists(directory): os.makedirs(directory) else: raise FileExistsError("directory name already e...
unknown
codeparrot/codeparrot-clean
--- title: Template reference sort_rank: 5 --- Prometheus supports templating in the annotations and labels of alerts, as well as in served console pages. Templates have the ability to run queries against the local database, iterate over data, use conditionals, format data, etc. The Prometheus templating language is b...
unknown
github
https://github.com/prometheus/prometheus
docs/configuration/template_reference.md
# -*- coding: iso-8859-1 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Canal para SOFACINE # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import urlparse,urllib2,urllib,re try: from core impo...
unknown
codeparrot/codeparrot-clean
import logging import os import signal import sys import warnings import re # primary public APIs def configure_logging(logging_config, **kwargs): """ Configure the logging module using the specific configuration object, which should be an instance of logging_config.LoggingConfig (usually of a subclas...
unknown
codeparrot/codeparrot-clean
/*M/////////////////////////////////////////////////////////////////////////////////////// // // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. // // By downloading, copying, installing or using the software you agree to this license. // If you do not agree to this license, do not download, instal...
unknown
github
https://github.com/opencv/opencv
modules/core/include/opencv2/core/traits.hpp
# example.js This example illustrates how to filter the ContextModule results of `import()` statements. Only `.js` files that don't end in `.noimport.js` within the `templates` folder will be bundled. ```javascript async function getTemplate(templateName) { try { let template = await import( /* webpackInclude: ...
unknown
github
https://github.com/webpack/webpack
examples/code-splitting-native-import-context-filter/README.md