code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
# -*- coding: utf-8 -*-
""" Sahana Eden Population Outreach Models
@copyright: 2015 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Softwa... | 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
#
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | unknown | codeparrot/codeparrot-clean | ||
pub mod canonical; | rust | github | https://github.com/rust-lang/rust | compiler/rustc_middle/src/infer/mod.rs |
# coding: utf8
{
'!langcode!': 'pl',
'!langname!': 'Polska',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"Uaktualnij" jest dodatkowym wyrażeniem postaci "pole1=\'nowawartość\'". Nie możesz uaktualnić lub usunąć wyników z JOIN:',
'%s %%{row} delete... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Station.capacity'
db.alter_column(u'divvy_station', 'ca... | unknown | codeparrot/codeparrot-clean | ||
"""Color Database.
This file contains one class, called ColorDB, and several utility functions.
The class must be instantiated by the get_colordb() function in this file,
passing it a filename to read a database out of.
The get_colordb() function will try to examine the file to figure out what the
format of the file ... | unknown | codeparrot/codeparrot-clean | ||
"Utilities for loading models and the modules that contain them."
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.datastructures import SortedDict
import sys
import os
import threading
__all__ = ('get_apps', 'get_app', 'get_models', 'get_model', 'register_mo... | unknown | codeparrot/codeparrot-clean | ||
"""
Tests for offset behavior with indices.
"""
import pytest
from pandas import (
Series,
date_range,
)
from pandas.tseries.offsets import (
BMonthBegin,
BMonthEnd,
BQuarterBegin,
BQuarterEnd,
BYearBegin,
BYearEnd,
MonthBegin,
MonthEnd,
QuarterBegin,
QuarterEnd,
Y... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/tseries/offsets/test_index.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 ... | java | github | https://github.com/apache/hadoop | hadoop-cloud-storage-project/hadoop-tos/src/main/java/org/apache/hadoop/fs/tosfs/RawFileStatus.java |
<!--Copyright 2022 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/pt/training.md |
#!/bin/sh
#
# Copyright (c) 2007 Johannes E. Schindelin
#
test_description='Test commit notes index (expensive!)'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
create_repo () {
number_of_commits=$1
nr=0
test -d .git || {
git init &&
(
while test $nr -lt... | unknown | github | https://github.com/git/git | t/t3302-notes-index-expensive.sh |
'''
Created on 07.07.2015
@author: marscher
'''
import warnings
import numbers
import numpy as np
import scipy.sparse as sp
import six
from inspect import getargspec
class NotFittedError(Exception):
pass
def _num_samples(x):
"""Return number of samples in array-like x."""
if hasattr(x, 'fit'):
... | unknown | codeparrot/codeparrot-clean | ||
"""
Module implementing `xblock.runtime.Runtime` functionality for the LMS
"""
import re
import xblock.reference.plugins
from django.core.urlresolvers import reverse
from django.conf import settings
from request_cache.middleware import RequestCache
from lms.djangoapps.lms_xblock.models import XBlockAsidesConfig
from ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2015 Mirantis, 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 requir... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Author: Leonardo Pistone
# Copyright 2014 Camptocamp SA
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (C) 2014 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/graph/NetworkEquivalenceTest.java |
/*
* 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 | benchmarks/src/main/java/org/elasticsearch/benchmark/vector/scorer/VectorImplementation.java |
#
# Copyright (c) 2012 Joshua Hughes <kivhift@gmail.com>
#
from nose.tools import assert_raises
import os
import StringIO
import tempfile
import pu.serializer
_data_dir = 'data'
def _path(name):
return os.path.join(_data_dir, name)
class EqHelper(pu.serializer.SelfSerializer):
def __eq__(self, other):
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2017 OSGeo
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 ... | unknown | codeparrot/codeparrot-clean | ||
import logging
from collections import namedtuple
from unittest import main, TestCase
from unittest.mock import patch
import requests
import ticketutil.ticket
import ticketutil.bugzilla as bugzilla
logging.disable(logging.CRITICAL)
URL = 'bugzilla.com'
PROJECT = 'PROJECT'
TICKET_ID = 'PROJECT-007'
TICKET_ID2 = 'PROJ... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
module ActiveRecord
module ConnectionAdapters
module MySQL
module ColumnMethods
extend ActiveSupport::Concern
extend ConnectionAdapters::ColumnMethods::ClassMethods
##
# :method: blob
# :call-seq: blob(*names, **options)
##
... | ruby | github | https://github.com/rails/rails | activerecord/lib/active_record/connection_adapters/mysql/schema_definitions.rb |
#pragma once
#include <limits>
#include <c10/util/Exception.h>
namespace at::cuda::detail {
// CUDA: grid stride looping
//
// int64_t _i_n_d_e_x specifically prevents overflow in the loop increment.
// If input.numel() < INT_MAX, _i_n_d_e_x < INT_MAX, except after the final
// iteration of the loop where _i_n_d_e_x... | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/cuda/detail/KernelUtils.h |
# Copyright 2022 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... | python | github | https://github.com/tensorflow/tensorflow | tensorflow/core/function/runtime_client/runtime_client.py |
## Generalized Linear Models (Formula)
# This notebook illustrates how you can use R-style formulas to fit Generalized Linear Models.
#
# To begin, we load the ``Star98`` dataset and we construct a formula and pre-process the data:
from __future__ import print_function
import statsmodels.api as sm
import statsmodels.... | unknown | codeparrot/codeparrot-clean | ||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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.apach... | unknown | codeparrot/codeparrot-clean | ||
"""
===============================================================
Partial Dependence and Individual Conditional Expectation Plots
===============================================================
Partial dependence plots show the dependence between the target function [2]_
and a set of features of interest, marginaliz... | python | github | https://github.com/scikit-learn/scikit-learn | examples/inspection/plot_partial_dependence.py |
// metadata without generateMetadata is ok.
export const metadata = {}
export default function () {
return null
} | javascript | github | https://github.com/vercel/next.js | crates/next-custom-transforms/tests/errors/react-server-components/server-graph/metadata/page.js |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2024 The HuggingFace Inc. team.
#
# 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 ... | python | github | https://github.com/huggingface/transformers | src/transformers/models/gemma/tokenization_gemma.py |
/*
* Copyright (c) 2007 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockito.internal.reporting;
public final class Pluralizer {
public static String pluralize(int number) {
return number == 1 ? "1 time" : number + " times";
}
public ... | java | github | https://github.com/mockito/mockito | mockito-core/src/main/java/org/mockito/internal/reporting/Pluralizer.java |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
'''Unit tests for grit.tclib'''
import sys
import os.path
if __name__ == '__main__':
sys.path.append(os.path.join(os.path.dirnam... | unknown | codeparrot/codeparrot-clean | ||
import os
from configparser import ConfigParser
infile = os.path.expanduser("~/.abook/addressbook")
class AddressBook(object):
def __init__(self, contacts):
self.contacts = contacts
for i in self.contacts:
i["email"] = list(filter(None, i.get("email", '').split(",")))
def __getite... | 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/directx.hpp |
# -*- coding: utf-8; mode: python -*-
# pylint: disable=W0141,C0113,C0103,C0325
u"""
cdomain
~~~~~~~
Replacement for the sphinx c-domain.
:copyright: Copyright (C) 2016 Markus Heiser
:license: GPL Version 2, June 1991 see Linux/COPYING for details.
List of customizations:
* Moved th... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import os
import sys
import unittest
from api_data_source import (_JSCModel,
_FormatValue... | 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\Bundle\SecurityBundle\DependencyInjection\Compiler;
use Symfony... | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/SortFirewallListenersPass.php |
# Status: being ported by Steven Watanabe
# Base revision: 47077
#
# Copyright (C) Andre Hentz 2003. Permission to copy, use, modify, sell and
# distribute this software is granted provided this copyright notice appears in
# all copies. This software is provided "as is" without express or implied
# warranty, and wi... | 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
"License")... | unknown | codeparrot/codeparrot-clean | ||
// @flow
export hook useItemLanguage(items) {
return useMemo(() => {
let language: ?string = null;
items.forEach(item => {
if (item.language != null) {
language = item.language;
}
});
return language;
}, [items]);
} | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reassign-variable-in-usememo.js |
# This script will produce:
#
# 1. Colorfill of desired oceanic data in Eckert IV projection (Equal-Area, but with some distortion; easy to look at, however).
# 2. Masked land, so only ocean data shows up.
#
from mpl_toolkits.basemap import Basemap,shiftgrid,interp
import numpy as np
import matplotlib.pyplot as plt
im... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# (C) Copyright IBM Corporation 2004
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# on the... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Pretty-prints the contents of a GYP file."""
import sys
import re
# Regex to remove comments when we're counting braces.
COMMENT_RE = r... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2015, Damian Johnson and The Tor Project
# See LICENSE for licensing information
"""
Helper functions for testing.
.. versionadded:: 1.2.0
::
clean_orphaned_pyc - delete *.pyc files without corresponding *.py
is_pyflakes_available - checks if pyflakes is available
is_pep8_available - checks if pe... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Course.intro_text'
db.add_column(u'core_course', 'intro_te... | unknown | codeparrot/codeparrot-clean | ||
use crate::loom::sync::{Mutex, MutexGuard};
use crate::runtime::signal::Handle as SignalHandle;
use crate::signal::unix::{signal_with_handle, SignalKind};
use crate::sync::watch;
use std::io;
use std::process::ExitStatus;
/// An interface for waiting on a process to exit.
pub(crate) trait Wait {
/// Get the identi... | rust | github | https://github.com/tokio-rs/tokio | tokio/src/process/unix/orphan.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... | kotlin | github | https://github.com/spring-projects/spring-framework | framework-docs/src/main/kotlin/org/springframework/docs/testing/mockmvc/assertj/mockmvctesterrequestsmultipart/MultipartControllerTests.kt |
from sqlalchemy import Column, Enum, Integer
from sqlalchemy.types import BLOB
from sqlalchemy.orm import validates
from inbox.models.base import MailSyncBase
from inbox.security.oracles import get_encryption_oracle, get_decryption_oracle
class Secret(MailSyncBase):
"""Simple local secrets table."""
_secret =... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Database\Events;
class ModelsPruned
{
/**
* Create a new event instance.
*
* @param string $model The class name of the model that was pruned.
* @param int $count The number of pruned records.
*/
public function __construct(
public $model,
... | php | github | https://github.com/laravel/framework | src/Illuminate/Database/Events/ModelsPruned.php |
import sublime
import sublime_plugin
import re
import sys
import traceback
from threading import Thread
from ..deps import requests
from ..deps.graphql.parser import GraphQLParser
from ..deps.graphql.lexer import GraphQLLexer
from ..core import RequestCommandMixin
from ..core.parsers import parse_requests
from ..cor... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import roslib, rospy
roslib.load_manifest('hil_mix_control')
import sys
import time
from geometry_msgs.msg import PoseWithCovarianceStamped, PoseStamped
from math import pi as PI
from math import atan2, sin, cos, sqrt
from tf.transformations import euler_from_quaternion, quaternion_from_euler
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import numpy as np
np.set_printoptions(threshold=np.nan)
import tensorflow as tf
import time
from PIL import Image as im
def convolve_inner_layers(x, W, b):
y = tf.nn.conv2d(x, W, strides = [1,1,1,1], padding='SAME')
y = tf.nn.bias_add(y, ... | unknown | codeparrot/codeparrot-clean | ||
/* pngwrite.c - general routines to write a PNG file
*
* Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
*
* This code is released under the libpng license.
* ... | c | github | https://github.com/opencv/opencv | 3rdparty/libpng/pngwrite.c |
# -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# encoding: utf-8
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import re
with open('nonstdlib/__init__.py') as file:
version_pattern = re.compile("__version__ = '(.*)'")
version = version_pattern.search(file.read()).group(1)
with open('R... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from openerp import api, fields, models, _
class AssetDepreciationConfirmationWizard(models.TransientModel):
_name = "asset.depreciation.confirmation.wizard"
_description = "asset.depreciation.confirmation.wizard"
date = fields.Date('Account Date', required=True, help="Choose the p... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from aldryn_client import forms
class Form(forms.BaseForm):
def to_settings(self, cleaned_data, settings_dict):
import aldryn_geoip
settings_dict.setdefault('GEOIP_PATH', aldryn_geoip.where())
# django.contrib.gis.geoip.GeoIP.GEOIP_STANDARD
settings_dict.s... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
from ..utils import ExtractorError
class TuneInIE(InfoExtractor):
_VALID_URL = r'''(?x)https?://(?:www\.)?
(?:
tunein\.com/
(?:
radio/.*?-s|
station/.*?Stati... | unknown | codeparrot/codeparrot-clean | ||
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2013,2014,2015,2016 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obt... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2017 Ansible Project
#
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign... | unknown | codeparrot/codeparrot-clean | ||
"""
Conceptual Spaces modelling of natural language
"""
#!/usr/bin/env python
# Python 2.7
import re
import random
import numpy
DATA = "../data_files/"
def create_histogram(infilename, outfilename):
"Create histogram of POS data in outfile, from data in infile"
# TODO: This function used to need numpy
#... | unknown | codeparrot/codeparrot-clean | ||
"""
This is the default template for our main set of AWS servers.
Before importing this settings file the following MUST be
defined in the environment:
* SERVICE_VARIANT - can be either "lms" or "cms"
* CONFIG_ROOT - the directory where the application
yaml config files are located
"""
#... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2014 Cisco Systems, 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 requir... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-framework | spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomDateEditor.java |
/*
* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.server.http
import io.ktor.http.*
import io.ktor.server.application.*
import io.ktor.server.response.*
import io.ktor.util.*
import io.ktor.utils.io.*
/**
* Produces HTTP/2 ... | kotlin | github | https://github.com/ktorio/ktor | ktor-server/ktor-server-core/common/src/io/ktor/server/http/Push.kt |
from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.document_loaders import YoutubeAudioLoader
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling opti... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/document_loaders/blob_loaders/youtube_audio.py |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
use Symfony\... | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/SecurityBundle/Resources/config/security.php |
# -*- 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 | ||
package client
import (
"context"
"github.com/moby/moby/api/types/swarm"
)
// SwarmUnlockOptions specifies options for unlocking a swarm.
type SwarmUnlockOptions struct {
Key string
}
// SwarmUnlockResult represents the result of unlocking a swarm.
type SwarmUnlockResult struct{}
// SwarmUnlock unlocks locked s... | go | github | https://github.com/moby/moby | client/swarm_unlock.go |
# -*- coding: utf-8 -*-
# Open Source Initiative OSI - The MIT License (MIT):Licensing
#
# The MIT License (MIT)
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Softwa... | unknown | codeparrot/codeparrot-clean | ||
import sys
from enum import Enum
from copy import deepcopy
import pickle
import itertools as it
import tkinter as tk
from tkinter import filedialog
from PIL import ImageTk, Image
import CanvasX as CX
from linalg import (point,vector,unit,norm,norm2,perp2,para,perp,refl,
unit_length,dot,mul,invers... | 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\Bundle\FrameworkBundle\Tests\Functional;
class SubRequestsTest ... | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SubRequestsTest.php |
#
# shift_jis_2004.py: Python Unicode Codec for SHIFT_JIS_2004
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_jp, codecs
import _multibytecodec as mbc
codec = _codecs_jp.getcodec('shift_jis_2004')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEnc... | unknown | codeparrot/codeparrot-clean | ||
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS
#include <ATen/core/Tensor.h>
#include <ATen/Dispatch.h>
#include <ATen/Parallel.h>
#include <ATen/TensorUtils.h>
#include <ATen/div_rtn.h>
#include <ATen/native/ConvolutionMM3d.h>
#include <ATen/native/CPUBlas.h>
#include <ATen/native/TransposeType.h>
#include <ATen/native/Un... | cpp | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/ConvolutionMM3d.cpp |
from array import array
import rootpy
import ROOT
rootpy.log.basic_config_colorized()
from rootpy.io import root_open
from rootpy.plotting import Canvas,Graph
from rootpy.plotting import set_style
from statstools.finalfit_uncertband_plot import getPostFitPlottingObjects
from statstools.finalfit_uncertband_plot import ... | unknown | codeparrot/codeparrot-clean | ||
import logging
logger = logging.getLogger(name=__name__)
import pyqtgraph as pg
import numpy as np
import time
from qtpy import QtCore
from .test_redpitaya import TestRedpitaya
from .. import APP
from ..async_utils import sleep as async_sleep
class TestPyqtgraph(TestRedpitaya):
""" This test case creates a maximal... | unknown | codeparrot/codeparrot-clean | ||
import hashlib
import re
from django.conf import settings
from django import http
from django.core.mail import mail_managers
from django.utils.http import urlquote
from django.core import urlresolvers
from django.utils.log import getLogger
logger = getLogger('django.request')
class CommonMiddleware(object):
"""
... | unknown | codeparrot/codeparrot-clean | ||
---
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
Title: curl_formget
Section: 3
Source: libcurl
See-also:
- curl_formadd (3)
- curl_mime_init (3)
Protocol:
- HTTP
Added-in: 7.15.5
---
# NAME
curl_formget - serialize a multipart form POST chain
# SYNOPSIS
~~~c
#inclu... | unknown | github | https://github.com/curl/curl | docs/libcurl/curl_formget.md |
/*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/cuda.hpp |
# coding: utf-8
from __future__ import unicode_literals
from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import SomeClass, SomeOtherException, UTF8Class, setup
class FilterSyntaxTests(SimpleTestCase):
@setup({'filter-syntax01': '{{ var|upper }}'})
def test_... | unknown | codeparrot/codeparrot-clean | ||
from pandas.core.arrays.arrow.accessors import (
ListAccessor,
StructAccessor,
)
from pandas.core.arrays.arrow.array import ArrowExtensionArray
__all__ = ["ArrowExtensionArray", "ListAccessor", "StructAccessor"] | python | github | https://github.com/pandas-dev/pandas | pandas/core/arrays/arrow/__init__.py |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Citrix Systems
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | unknown | codeparrot/codeparrot-clean | ||
use std::borrow::Cow;
use crate::spec::crt_objects::pre_mingw_self_contained;
use crate::spec::{
Abi, BinaryFormat, Cc, DebuginfoKind, Env, LinkSelfContainedDefault, LinkerFlavor, Lld, Os,
SplitDebuginfo, TargetOptions, add_link_args, cvs,
};
pub(crate) fn opts() -> TargetOptions {
// We cannot use `-node... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_target/src/spec/base/windows_gnullvm.rs |
import discord
from sigma.core.utilities.data_processing import user_avatar
from .nodes.item_core import ItemCore
item_core = None
async def forage(cmd, message, args):
global item_core
if not item_core:
item_core = ItemCore(cmd.resource('data'))
if not cmd.bot.cool_down.on_cooldown(cmd.name, me... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.client.plugins
import io.ktor.client.*
import io.ktor.client.call.*
import io.ktor.client.plugins.api.*
import io.ktor.client.request.*
import io.ktor.client.statement.*
import ... | kotlin | github | https://github.com/ktorio/ktor | ktor-client/ktor-client-core/common/src/io/ktor/client/plugins/HttpRedirect.kt |
"""SCons.Tool.tar
Tool-specific initialization for tar.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# P... | 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... | typescript | github | https://github.com/apache/airflow | airflow-core/src/airflow/ui/src/components/TaskTrySelect.tsx |
#!/usr/bin/env python
import subprocess, sys, traceback, os, multiprocessing
configurations = []
# Building functions
def prepare_configuration():
if subprocess.call(["mkdir", "build"]):
raise ValueError("Preparation of build folder failed.")
os.chdir("build")
def config_configuration(config):
args = ["cmake"]... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
require "abstract_unit"
require "fileutils"
require "action_view/dependency_tracker"
class FixtureFinder < ActionView::LookupContext
FIXTURES_DIR = File.expand_path("../fixtures/digestor", __dir__)
def self.build(details = {})
new(ActionView::PathSet.new(["digestor", "digestor/a... | ruby | github | https://github.com/rails/rails | actionview/test/template/digestor_test.rb |
#!/usr/bin/env python
#
# Copyright 2007 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 o... | unknown | codeparrot/codeparrot-clean | ||
from jeeves.conf import settings
from jeeves.core.plugin import CommandPlugin
from jeeves.core import exceptions
import unicodedata
try:
import json
except ImportError:
try:
import simplejson as json
except ImportError:
raise ImportError("You need to have a json parser, easy_install simplej... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2022 The etcd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed t... | go | github | https://github.com/etcd-io/etcd | tests/common/auth_util.go |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import BaseHTTPServer
import logging
import multiprocessing
import os
import SimpleHTTPServer # pylint: disable=W0... | unknown | codeparrot/codeparrot-clean | ||
# -*- test-case-name: twisted.conch.test.test_channel -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
#
"""
The parent class for all the SSH Channels. Currently implemented channels
are session. direct-tcp, and forwarded-tcp.
Maintainer: Paul Swartz
"""
from zope.interface import impleme... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# DBUS Server Example of use PySide with PyDBus library
import dbus
import dbus.service
import dbus.mainloop.glib
import random
from PySide.QtCore import *
from PySide.QtGui import QPushButton, QApplication
# The adaptor, MUST inherit dbus.service.Object
class DBusWidge... | unknown | codeparrot/codeparrot-clean | ||
/*-------------------------------------------------------------------------
*
* rbtree.c
* implementation for PostgreSQL generic Red-Black binary tree package
* Adopted from http://algolist.manual.ru/ds/rbtree.php
*
* This code comes from Thomas Niemann's "Sorting and Searching Algorithms:
* a Cookbook".
*
... | c | github | https://github.com/postgres/postgres | src/backend/lib/rbtree.c |
#!/usr/bin/python
#
# This is a 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.
#
# This Ansible library is distributed in the hope that i... | unknown | codeparrot/codeparrot-clean | ||
import os
import datetime
from django.conf import settings
from windmill.authoring import djangotest
from lfs.core.models import Shop
from lfs.catalog.models import Product
class CartPriceIntegrationTest(djangotest.WindmillDjangoUnitTest):
test_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'wind... | unknown | codeparrot/codeparrot-clean | ||
# -*- test-case-name: twisted.test.test_newcred -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
The point of integration of application and authentication.
"""
from twisted.internet import defer
from twisted.internet.defer import maybeDeferred
from twisted.python import failure, refle... | unknown | codeparrot/codeparrot-clean | ||
import doctest
import traceback
import unittest
from test.support import BrokenIter
doctests = """
########### Tests mostly copied from test_listcomps.py ############
Test simple loop with conditional
>>> sum({i*i for i in range(100) if i&1 == 1})
166650
Test simple case
>>> {2*y + x + 1 for x in (0,)... | python | github | https://github.com/python/cpython | Lib/test/test_setcomps.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.