code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
# 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
from __future__ import unicode_literals from django.apps import apps from django.db import models from django.template import Context, Template from django.test import TestCase, override_settings from django.utils.encoding import force_text from .models import ( AbstractBase1, AbstractBase2, AbstractBase3, Child1...
unknown
codeparrot/codeparrot-clean
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" è un\'espressione opzionale come "campo1=\'nuovo valore\'". Non si può fare "update" o "delete" dei risultati di un JOIN ', '%Y-%m-%d': '%d/%m/%Y', '%Y-%m-%d %H:%M:%S': '%d/%m/%...
unknown
codeparrot/codeparrot-clean
//// [tests/cases/conformance/statements/for-ofStatements/ES5For-of9.ts] //// //// [ES5For-of9.ts] function foo() { return { x: 0 }; } for (foo().x of []) { for (foo().x of []) { var p = foo().x; } } //// [ES5For-of9.js] "use strict"; function foo() { return { x: 0 }; } for (foo().x of []) { ...
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/ES5For-of9(target=es2015).js
/** * -------------------------------------------------------------------------- * Bootstrap scrollspy.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * -------------------------------------------------------------------------- */ import BaseComponent from './base-component.js' impor...
javascript
github
https://github.com/twbs/bootstrap
js/src/scrollspy.js
# -*- coding: utf-8 -*- # Copyright (C) 2012-2014 by the Free Software Foundation, Inc. # # This file is part of Postorius. # # Postorius 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...
unknown
codeparrot/codeparrot-clean
"""This is an integration test for the Dataproc-luigi binding. This test requires credentials that can access GCS & access to a bucket below. Follow the directions in the gcloud tools to set up local credentials. """ import unittest try: import google.auth from luigi.contrib import dataproc from googleapi...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2014, 2015, Oracle and/or its affiliates. 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 ...
unknown
codeparrot/codeparrot-clean
/** * @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 {ChangeDetectionStrategy, Component, input} from '@angular/core'; type ButtonType = 'primary' | 'secondary' ...
typescript
github
https://github.com/angular/angular
devtools/projects/ng-devtools/src/lib/shared/button/button.component.ts
# -*- test-case-name: twisted.python.test.test_runtime -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. from __future__ import division, absolute_import import os import sys import time import imp import warnings from twisted.python import compat if compat._PY3: _threadModule = "_thre...
unknown
codeparrot/codeparrot-clean
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) %YAML 1.2 --- $id: http://devicetree.org/schemas/hwmon/ti,lm87.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# title: Texas Instruments LM87 Hardware Monitor maintainers: - Javier Carrasco <javier.carrasco.cruz@gmail.com> description: | The LM87 i...
unknown
github
https://github.com/torvalds/linux
Documentation/devicetree/bindings/hwmon/ti,lm87.yaml
# -*- test-case-name: twisted.news.test -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ News server backend implementations. """ import getpass, pickle, time, socket import os import StringIO from hashlib import md5 from email.Message import Message from email.Generator import Generato...
unknown
codeparrot/codeparrot-clean
from django.conf import settings from django.conf.urls import patterns, url from django.views.decorators.cache import cache_page from regulations.views.about import about from regulations.views.chrome_breakaway import ChromeSXSView from regulations.views.chrome import ( ChromeInterpView, ChromeLandingView, ChromeP...
unknown
codeparrot/codeparrot-clean
from numpy._core.strings import * from numpy._core.strings import __all__, __doc__
python
github
https://github.com/numpy/numpy
numpy/strings/__init__.py
# Copyright 2012 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 requ...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- import hashlib import hmac import time import urlparse import unittest from lxml import objectify import odoo from odoo.addons.payment.models.payment_acquirer import ValidationError from odoo.addons.payment.tests.common import PaymentAcquirerCommon from odoo.addons.payment_authorize.controller...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # # Copyright 2015-2015 breakwa11 # # 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 la...
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\Component\BrowserKit; use Symfony\Component\BrowserKit\Exceptio...
php
github
https://github.com/symfony/symfony
src/Symfony/Component/BrowserKit/AbstractBrowser.php
"""This file contains the TestCommandLog class.""" import unittest import mock import pygame from src.CommandLog import CommandLog from src.CustomEvent import CustomEvent from src.Point import Point class TestCommandLog(unittest.TestCase): """This test class unit tests the CommandLog class.""" def setUp(self...
unknown
codeparrot/codeparrot-clean
# Copyright 2012 Nebula, Inc. # Copyright 2014 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
unknown
codeparrot/codeparrot-clean
# Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ''' >>> from enum_ext import * >>> identity(color.red) # in case of duplicated enums it always take the last enum enum_ext.color.blood ...
unknown
codeparrot/codeparrot-clean
/* Copyright 2025 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/credentialprovider/plugin/metrics_test.go
"""Sanity test for symlinks in the bin directory.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os from ... import types as t from . import ( SanityVersionNeutral, SanityMessage, SanityFailure, SanitySuccess, ) from ...config import ( SanityCon...
unknown
codeparrot/codeparrot-clean
""" Many-to-many relationships To define a many-to-many relationship, use ``ManyToManyField()``. In this example, an ``Article`` can be published in multiple ``Publication`` objects, and a ``Publication`` has multiple ``Article`` objects. """ from django.db import models class Publication(models.Model): title =...
python
github
https://github.com/django/django
tests/many_to_many/models.py
/* MIT License * * Copyright (c) 1998 Massachusetts Institute of Technology * Copyright (c) The c-ares project and its contributors * * 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 wi...
c
github
https://github.com/nodejs/node
deps/cares/src/lib/ares_gethostbyaddr.c
# See https://zulip.readthedocs.io/en/latest/subsystems/events-system.html for # high-level documentation on how this system works. import copy from typing import Any, Callable, Collection, Dict, Iterable, Optional, Sequence, Set from django.conf import settings from django.utils.translation import gettext as _ from ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright IBM Corp. 2016 # Author(s): Andreas Nafpliotis <nafpliot@de.ibm.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 Found...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python3 # # linearize-hashes.py: List blocks in a linear, no-fork version of the chain. # # Copyright (c) 2013-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from http.client imp...
unknown
codeparrot/codeparrot-clean
--- title: Route Module order: 3 --- # Route Module [MODES: framework] ## Introduction The files referenced in `routes.ts` are called Route Modules. ```tsx filename=app/routes.ts route("teams/:teamId", "./team.tsx"), // route module ^^^^^^^^ ``` Route modules are the foundation of React Router's framewo...
unknown
github
https://github.com/remix-run/react-router
docs/start/framework/route-module.md
"""This file contains tests for the technicals module of the DJ Scrooge backtesting API. Copyright (C) 2012 James Adam Cataldo This file is part of Pengoe. Pengoe 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 Soft...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ pygments.lexers.dotnet ~~~~~~~~~~~~~~~~~~~~~~ Lexers for .net languages. :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, DelegatingLexer, bygroups, using, th...
unknown
codeparrot/codeparrot-clean
from django.test import TestCase from django.http import HttpRequest, HttpResponse, HttpResponseBadRequest from django.template import Template, Context from django.template.loader import render_to_string from django.conf import settings from honeypot.middleware import HoneypotViewMiddleware, HoneypotResponseMiddleware...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- import os import tarfile import zipfile from urllib.parse import urlsplit from django import forms from django.conf import settings from django.core.files.storage import default_storage as storage from django.core.validators import MinLengthValidator from django.db.models import Q from django....
unknown
codeparrot/codeparrot-clean
# This file is part of Viper - https://github.com/viper-framework/viper # See the file 'LICENSE' for copying permission. import os import re import datetime import tempfile import time from viper.common.constants import VIPER_ROOT try: import pefile import peutils HAVE_PEFILE = True except ImportError: ...
unknown
codeparrot/codeparrot-clean
#!/bin/sh test_description='basic tests of rev-list --disk-usage' . ./test-lib.sh # we want a mix of reachable and unreachable, as well as # objects in the bitmapped pack and some outside of it test_expect_success 'set up repository' ' test_commit --no-tag one && test_commit --no-tag two && git repack -adb && gi...
unknown
github
https://github.com/git/git
t/t6115-rev-list-du.sh
# -*- coding: utf-8 -*- """ Created on Mon Oct 31 15:45:22 2016 @author: wang """ #from matplotlib import pylab as plt #from numpy import fft, fromstring, int16, linspace #import wave from read_wav_xml_good_1 import* from matrix_24_2 import* from max_matrix_norm import* import numpy as np # open a wave file #filenam...
unknown
codeparrot/codeparrot-clean
/* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the "Elastic License * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side * Public License v 1"; you may not use this file except in compliance with, ...
java
github
https://github.com/elastic/elasticsearch
distribution/tools/server-cli/src/test/java/org/elasticsearch/server/cli/OverheadSystemMemoryInfoTests.java
<div ngListbox aria-label="Amenities" orientation="horizontal" selectionMode="explicit" multi> @for (amenity of amenities; track amenity) { <div ngOption [value]="amenity" [label]="amenity"> <span class="option-label">{{ amenity }}</span> </div> } </div>
html
github
https://github.com/angular/angular
adev/src/content/examples/aria/listbox/src/horizontal/app/app.html
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
unknown
codeparrot/codeparrot-clean
//go:build windows /* Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ag...
go
github
https://github.com/kubernetes/kubernetes
pkg/kubelet/winstats/perfcounters_test.go
############################################################################################## # Copyright 2014-2015 Cloud Media Sdn. Bhd. # # This file is part of Xuan Application Development SDK. # # Xuan Application Development SDK is free software: you can redistribute it and/or modify # it under the terms of the G...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # Copyright 2015 Mirantis, 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 requi...
unknown
codeparrot/codeparrot-clean
import json import orca import numpy as np import pandas as pd import pandas.testing as pdt import pytest from .. import server @pytest.fixture def tapp(): server.app.config['TESTING'] = True return server.app.test_client() @pytest.fixture(scope='module') def dfa(): return pd.DataFrame( {'a': [1...
unknown
codeparrot/codeparrot-clean
import feedparser import re feedlist=['http://today.reuters.com/rss/topNews', 'http://today.reuters.com/rss/domesticNews', 'http://today.reuters.com/rss/worldNews', 'http://hosted.ap.org/lineups/TOPHEADS-rss_2.0.xml', 'http://hosted.ap.org/lineups/USHEADS-rss_2.0.xml', ...
unknown
codeparrot/codeparrot-clean
# coding: utf-8 from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Author(models.Model): name = models.CharField(max_length=100) age = models.IntegerField() friends = models.ManyToManyField('self', blank=True) def __str__(self)...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # 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 import os import json import pytest import sys if sys.version_info < (2...
unknown
codeparrot/codeparrot-clean
# -------------------------------------------------------------- # Copyright (c) 2015, Nicolas VERDIER (contact@n1nj4.eu) # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: # # 1. Redistributions of so...
unknown
codeparrot/codeparrot-clean
############################################################################## # 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
""" Python character mapping codec test This uses the test codec in testcodec.py and thus also tests the encodings package lookup scheme. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright 2000 Guido van Rossum. """#" import test.support, unittest import codecs # Register a search function which know...
unknown
codeparrot/codeparrot-clean
#ifndef ISO_FORMAT_HPP___ #define ISO_FORMAT_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Gar...
unknown
github
https://github.com/mysql/mysql-server
extra/boost/boost_1_87_0/boost/date_time/iso_format.hpp
############################################################################## # # Copyright (c) 2002, 2003 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # T...
unknown
codeparrot/codeparrot-clean
#pragma once #include <c10/core/SymBool.h> #include <c10/core/SymNodeImpl.h> #include <c10/macros/Export.h> #include <c10/macros/Macros.h> #include <c10/util/Exception.h> #include <c10/util/Optional.h> #include <algorithm> #include <cstdint> #include <iterator> #include <numeric> #include <optional> #include <ostream...
c
github
https://github.com/pytorch/pytorch
c10/core/SymInt.h
//go:build !ignore_autogenerated // +build !ignore_autogenerated /* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0...
go
github
https://github.com/kubernetes/kubernetes
pkg/apis/coordination/zz_generated.deepcopy.go
import os import sys OldPy = sys.version_info[0] == 2 and sys.version_info[1] < 7 class TestingConfig: """" TestingConfig - Information on the tests inside a suite. """ @staticmethod def fromdefaults(litConfig): """ fromdefaults(litConfig) -> TestingConfig Create a Testin...
unknown
codeparrot/codeparrot-clean
/* Copyright 2025 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/kubelet/userns/types.go
package network import ( "github.com/moby/moby/v2/daemon/server/router" ) // networkRouter is a router to talk with the network controller type networkRouter struct { backend Backend cluster ClusterBackend routes []router.Route } // NewRouter initializes a new network router func NewRouter(b Backend, c ClusterB...
go
github
https://github.com/moby/moby
daemon/server/router/network/network.go
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2016 STI (<https://github.com/sumihai-tekindo>). # @author Pambudi Satria <pambudi.satria@yahoo.com> # # This program is free software: you can redistribute it and/or modify # it under th...
unknown
codeparrot/codeparrot-clean
"""Base callback handler for LangChain.""" from __future__ import annotations import logging from typing import TYPE_CHECKING, Any if TYPE_CHECKING: from collections.abc import Sequence from uuid import UUID from tenacity import RetryCallState from typing_extensions import Self from langchain_c...
python
github
https://github.com/langchain-ai/langchain
libs/core/langchain_core/callbacks/base.py
from twisted.trial import unittest from twisted.internet import defer from scrapy.utils.testsite import SiteTest from scrapy.utils.testproc import ProcessTest class ShellTest(ProcessTest, SiteTest, unittest.TestCase): command = 'shell' @defer.inlineCallbacks def test_empty(self): _, out, _ = yie...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2019, Thomas Moore (@tmmruk) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # this is a windows documentation stub. actual code lives in the .ps1 # file of the same name from __future__ import (absolute_import, ...
unknown
codeparrot/codeparrot-clean
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2007 Zuza Software Foundation # # This file is part of translate. # # translate 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 t...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- ############################################################################# # File : Filter.py # Package : rpmlint # Author : Frederic Lepied # Created on : Sat Oct 23 15:52:27 1999 # Purpose : filter the output of rpmlint to allow exceptions. ###################...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # textventure.py ################# ## Textventure ## ## ckjbgames #### ## 2017 ######### ################# ## Imports import random # Map randomization import pickle # For game saving import sys # Various uses import socket # Eventually for connections import MySQLdb # For connecting to My...
unknown
codeparrot/codeparrot-clean
import urllib import json import pprint class WpSeekApi: def find_similar(self, keyword, limit): finder = SimilarFinder() result = finder.find(keyword, limit) self.return_to_vim(result) def find_topics(self, keyword, limit): finder = TopicFinder() result = finder.find(...
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
server/etcdserver/api/v3rpc/maintenance.go
/* * Copyright 2014-2023 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ package io.ktor.tests.server.jetty.jakarta import io.ktor.server.jetty.jakarta.* import io.ktor.server.testing.suites.* import kotlin.test.Ignore import kotlin.time.Duration.Companion.millise...
kotlin
github
https://github.com/ktorio/ktor
ktor-server/ktor-server-jetty-jakarta/jvm/test/io/ktor/tests/server/jetty/jakarta/JettyBlockingServletContainerTest.kt
/*------------------------------------------------------------------------- * * xlogwait.h * Declarations for WAL flush, write, and replay waiting routines. * * Copyright (c) 2025-2026, PostgreSQL Global Development Group * * src/include/access/xlogwait.h * *--------------------------------------------------...
c
github
https://github.com/postgres/postgres
src/include/access/xlogwait.h
-- temperature conversion table (celsius to farenheit) for c0=-20,50-1,10 do io.write("C ") for c=c0,c0+10-1 do io.write(string.format("%3.0f ",c)) end io.write("\n") io.write("F ") for c=c0,c0+10-1 do f=(9/5)*c+32 io.write(string.format("%3.0f ",f)) end io.write("\n\n") end
unknown
github
https://github.com/redis/redis
deps/lua/test/cf.lua
/* * 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/scheduling/concurrent/DefaultManagedAwareThreadFactory.java
from email.parser import FeedParser import os import imp import locale import re import sys import shutil import tempfile import textwrap import zipfile from distutils.util import change_root from pip.locations import (bin_py, running_under_virtualenv,PIP_DELETE_MARKER_FILENAME, write_delete...
unknown
codeparrot/codeparrot-clean
class FileProxyMixin: """ A mixin class used to forward file methods to an underlaying file object. The internal file object has to be called "file":: class FileProxy(FileProxyMixin): def __init__(self, file): self.file = file """ encoding = property(lambda sel...
unknown
codeparrot/codeparrot-clean
## @file # process GUIDed section generation # # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2018, Hewlett Packard Enterprise Development, L.P.<BR> # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD L...
unknown
codeparrot/codeparrot-clean
prelude: | max, min = 1000.0, -1000.0 a = Complex(rand(max)+min, rand(max)+min) b = Complex(rand(max)+min, rand(max)+min) benchmark: complex_float_add: c = a + b loop_count: 1000000
unknown
github
https://github.com/ruby/ruby
benchmark/complex_float_add.yml
from PySide import QtCore, QtGui from androguard.session import Session from androguard.core import androconf from androguard.gui.fileloading import FileLoadingThread from androguard.gui.treewindow import TreeWindow from androguard.gui.sourcewindow import SourceWindow from androguard.gui.stringswindow import StringsWi...
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 SearchAPIResults, SearchAPIRun """SearchApi.io API Toolkit.""" """Tool for the SearchApi.io Google SERP API.""" # Create a way to dynamically look up deprecated import...
python
github
https://github.com/langchain-ai/langchain
libs/langchain/langchain_classic/tools/searchapi/__init__.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
from typing import TYPE_CHECKING, Any from langchain_classic._api import create_importer if TYPE_CHECKING: from langchain_community.tools import AzureCogsText2SpeechTool # Create a way to dynamically look up deprecated imports. # Used to consolidate logic for raising deprecation warnings and # handling optional ...
python
github
https://github.com/langchain-ai/langchain
libs/langchain/langchain_classic/tools/azure_cognitive_services/text2speech.py
import sys import argparse def evaluateIdentifier(gold, pred): """ Performs an intrinsic evaluation of a Complex Word Identification approach. @param gold: A vector containing gold-standard labels. @param pred: A vector containing predicted labels. @return: Precision, Recall and F-1. """ #Initialize variables...
unknown
codeparrot/codeparrot-clean
import json from datetime import datetime from django.test import TestCase from pytz import UTC from track.utils import DateTimeJSONEncoder class TestDateTimeJSONEncoder(TestCase): def test_datetime_encoding(self): a_naive_datetime = datetime(2012, 05, 01, 07, 27, 10, 20000) a_tz_datetime = datet...
unknown
codeparrot/codeparrot-clean
# Copyright 2012 Sascha Peilicke <saschpe@gmx.de> # # 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 appl...
unknown
codeparrot/codeparrot-clean
__all__ = ["send", "track_send_item", "send_shipment", "receive", "track_recv_item", "recv_shipment", "recv_sent_shipment", "send_rec", "send_get_id", "send_get_ref", "recv_rec", "recv_get_id", ...
unknown
codeparrot/codeparrot-clean
""" Application-specific exceptions raised by the block structure framework. """ class BlockStructureException(Exception): """ Base class for all Block Structure framework exceptions. """ pass class TransformerException(BlockStructureException): """ Exception class for Transformer related erro...
unknown
codeparrot/codeparrot-clean
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT use std::{ fs::create_dir_all, path::{Path, PathBuf}, }; use ureq::ResponseExt; use crate::utils::http_utils::{base_ureq_agent, download}; pub const WEBVIEW2_BOOTSTRAPPER_U...
rust
github
https://github.com/tauri-apps/tauri
crates/tauri-bundler/src/bundle/windows/util.rs
<!--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/ja/model_doc/dialogpt.md
//===--- GenDistributed.h - IRGen for distributed features ------*- C++ -*-===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2020 - 2021 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
c
github
https://github.com/apple/swift
lib/IRGen/GenDistributed.h
"""A user profile shows the publically available information about a user.""" from django.contrib.auth.models import User from django.db import models from django.db.models.signals import post_save import datetime class UserProfile(models.Model): """Public user profile.""" user = models.ForeignKey(User, relat...
unknown
codeparrot/codeparrot-clean
""" Diese Klasse dient zum Laden von Assets, die nicht direkt mit den Planeten in Verbindung stehen. Dazu gehoert das Setzen einer Hintergrundfarbe, aber auch das Laden von Musik, welche im Hintergrund spielt. """ __author__ = 'Thomas Taschner, Michael Weinberger' __date__ = 20151209 __version__ = 1.0 class Ambiance:...
unknown
codeparrot/codeparrot-clean
# Copyright 2015 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 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 n...
java
github
https://github.com/apache/kafka
clients/src/main/java/org/apache/kafka/clients/consumer/StickyAssignor.java
""" web.py Contains functions for interacting with web services. Created by: - Bjorn Neergaard <https://github.com/neersighted> Maintainer: - Luke Rogers <https://github.com/lukeroge> License: GPL v3 """ import json import logging import requests from requests import RequestException # Constants DEFA...
unknown
codeparrot/codeparrot-clean
""" Classes to represent the definitions of aggregate functions. """ from django.core.exceptions import FieldError from django.db.models.expressions import Func, Value from django.db.models.fields import FloatField, IntegerField __all__ = [ 'Aggregate', 'Avg', 'Count', 'Max', 'Min', 'StdDev', 'Sum', 'Variance', ] ...
unknown
codeparrot/codeparrot-clean
''' backends/s3c.py - this file is part of S3QL (http://s3ql.googlecode.com) Copyright © 2008 Nikolaus Rath <Nikolaus@rath.org> This program can be distributed under the terms of the GNU GPLv3. ''' from ..logging import logging, QuietError # Ensure use of custom logger class from .. import BUFSIZE from .common impor...
unknown
codeparrot/codeparrot-clean
Trait objects must include the `dyn` keyword. Erroneous code example: ```edition2021,compile_fail,E0782 trait Foo {} fn test(arg: Box<Foo>) {} // error! ``` Trait objects are a way to call methods on types that are not known until runtime but conform to some trait. Trait objects should be formed with `Box<dyn Foo>`...
unknown
github
https://github.com/rust-lang/rust
compiler/rustc_error_codes/src/error_codes/E0782.md
# Copyright (c) 2015 Intel Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- from __future__ import absolute_import from unittest import TestCase from functools import wraps from nose.plugins.skip import SkipTest from nltk.util import py26 def skip(reason): """ Unconditionally skip a test. """ def decorator(test_item): is_test_class = isinstance(...
unknown
codeparrot/codeparrot-clean
from django.shortcuts import render from django.http import HttpResponse from django.contrib.auth.decorators import login_required from django.http import JsonResponse from shaker.shaker_core import * from shaker.nodegroups import * @login_required(login_url="/account/login/") def manage_group(request): group = No...
unknown
codeparrot/codeparrot-clean
# Copyright 2016 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 ag...
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
client/v3/yaml/config_test.go
""" Test functions for limits module. """ import types import warnings import pytest import numpy as np from numpy import double, half, longdouble, single from numpy._core import finfo, iinfo from numpy.testing import assert_, assert_equal, assert_raises ################################################## class Tes...
python
github
https://github.com/numpy/numpy
numpy/_core/tests/test_getlimits.py