code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.retrievers import (
AzureAISearchRetriever,
AzureCognitiveSearchRetriever,
)
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logi... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/retrievers/azure_ai_search.py |
from pathlib import Path
from test.support.import_helper import unload
from test.support.warnings_helper import check_warnings
import unittest
import sys
import importlib
from importlib.util import spec_from_file_location
import pkgutil
import os
import os.path
import tempfile
import shutil
import zipfile
from test.su... | python | github | https://github.com/python/cpython | Lib/test/test_pkgutil.py |
"""Base class for sparse matrices"""
import numpy as np
from .sputils import (isdense, isscalarlike, isintlike,
get_sum_dtype, validateaxis, check_reshape_kwargs,
check_shape, asmatrix)
__all__ = ['spmatrix', 'isspmatrix', 'issparse',
'SparseWarning', 'SparseEffi... | unknown | codeparrot/codeparrot-clean | ||
import collections
import contextlib
import errno
import hashlib
import json
import os
import io
import re
import shutil
import signal
import stat
import struct
import tarfile
import tempfile
import zipfile
import fcntl
from datetime import datetime
from django import forms
from django.conf import settings
from djang... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
# License: AGPLv3 s.t. "Commons Clause" – read LICENSE.md for details
"""
Open and modify Microsoft Word 2007 docx files (called 'OpenXML' and
'Office OpenXML' by Microsoft)
Part of Python's docx module - http://... | unknown | codeparrot/codeparrot-clean | ||
# AOT metadata errors
The following are metadata errors you may encounter, with explanations and suggested corrections.
## Expression form not supported
HELPFUL: The compiler encountered an expression it didn't understand while evaluating Angular metadata.
Language features outside of the compiler's [restricted exp... | unknown | github | https://github.com/angular/angular | adev/src/content/tools/cli/aot-metadata-errors.md |
# Copyright 2014: 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 required b... | unknown | codeparrot/codeparrot-clean | ||
# vim: set encoding=utf-8
# Copyright (c) 2016 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... | unknown | codeparrot/codeparrot-clean | ||
/*
Package filters provides tools for encoding a mapping of keys to a set of
multiple values.
*/
package filters
import (
"encoding/json"
"maps"
"regexp"
"strings"
)
// Args stores a mapping of keys to a set of multiple values.
type Args struct {
fields map[string]map[string]bool
}
// KeyValuePair are used to i... | go | github | https://github.com/moby/moby | daemon/internal/filters/parse.go |
/* Copyright 2010 Google Inc. All Rights Reserved.
Distributed under MIT license.
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/
/* Entropy encoding (Huffman) utilities. */
#include "entropy_encode.h"
#include "../common/constants.h"
#include "../common/platform.h"
#if defined(... | c | github | https://github.com/nodejs/node | deps/brotli/c/enc/entropy_encode.c |
// Copyright The Prometheus 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 w... | go | github | https://github.com/prometheus/prometheus | storage/remote/otlptranslator/prometheusremotewrite/helper_test.go |
from sympy import Symbol, floor, nan, oo, E, symbols, ceiling, pi, Rational, \
Float, I, sin, exp, log, factorial, frac
from sympy.utilities.pytest import XFAIL
x = Symbol('x')
i = Symbol('i', imaginary=True)
y = Symbol('y', real=True)
k, n = symbols('k,n', integer=True)
def test_floor():
assert floor(nan) ... | unknown | codeparrot/codeparrot-clean | ||
/* -*- c-file-style: "gnu" -*- */
/*
* This is a quick-and-dirty emulator of the nl_langinfo(CODESET)
* function defined in the Single Unix Specification for those systems
* (FreeBSD, etc.) that don't have one yet. It behaves as if it had
* been called after setlocale(LC_CTYPE, ""), that is it looks at
* the local... | c | github | https://github.com/ruby/ruby | missing/langinfo.c |
# 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 | ||
# Copyright 2011 OpenStack Foundation
#
# 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 l... | unknown | codeparrot/codeparrot-clean | ||
// Adapted from interp.cpp from Caffe util by Pauline Luc
// Originally developed by George Papandreou
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS
#include <ATen/core/Tensor.h>
#include <ATen/TensorMeta.h>
#include <ATen/native/UpSample.h>
#include <c10/util/irange.h>
#ifndef AT_PER_OPERATOR_HEADERS
#include <ATen/Fun... | cpp | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/UpSampleTrilinear3d.cpp |
# -*- coding: utf-8 -*-
# Copyright (c) 2010 Tom Burdick <thomas.burdick@gmail.com>
#
# 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 the rig... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2012 Google Inc. All Rights Reserved.
"""A sample app that uses GCS client to operate on bucket and file."""
import logging
import os
import cloudstorage as gcs
import webapp2
from google.appengine.api import app_identity
my_default_retry_params = gcs.RetryParams(initial_delay=0.2,
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('custom_attributes', '0005_auto_20150505_1639'),
]
operations = [
migrations.AddField(
model_name='issuecustomattr... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2015 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 a... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
_no_value = object()
class Gettable(object):
'''Allows a Future to accept a callable as a delegate. Wraps |f| in a .Get
interface requir... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# EditXT
# Copyright 2007-2016 Daniel Miller <millerdev@gmail.com>
#
# This file is part of EditXT, a programmer's text editor for Mac OS X,
# which can be found at http://editxt.org/.
#
# EditXT is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Publ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
from openerp.tests.common import TransactionCase
class TestSearch(TransactionCase):
"""Tests for search on name_search (account.account)
The name search on account.account is quite complexe, make sure
we have all the correct results
"""
def setUp(self):
super(TestSearch, self).setUp()
... | unknown | codeparrot/codeparrot-clean | ||
import httplib as http
from flask import request
from django.core.exceptions import ValidationError
from framework.auth.decorators import collect_auth
from osf.models import AbstractNode
from website.exceptions import InvalidTagError, NodeStateError, TagNotFoundError
from website.project.decorators import (
must_... | 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... | kotlin | github | https://github.com/spring-projects/spring-framework | framework-docs/src/main/kotlin/org/springframework/docs/web/webmvc/mvccontroller/mvcannexceptionhandlerexc/ExceptionController.kt |
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Yahoo! 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... | unknown | codeparrot/codeparrot-clean | ||
//===- bolt/Passes/AllocCombiner.cpp --------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | cpp | github | https://github.com/llvm/llvm-project | bolt/lib/Passes/AllocCombiner.cpp |
#!/bin/sh
if [ $# != "1" ]
then
echo "Usage: ./utils/releasetools/01_create_tarball.sh <version_tag>"
exit 1
fi
TAG=$1
TARNAME="redis-${TAG}.tar"
echo "Generating /tmp/${TARNAME}"
git archive $TAG --prefix redis-${TAG}/ > /tmp/$TARNAME || exit 1
echo "Gizipping the archive"
rm -f /tmp/$TARNAME.gz
gzip -9 /tmp/... | unknown | github | https://github.com/redis/redis | utils/releasetools/01_create_tarball.sh |
from unittest import TestCase
from project_checker.checker.gitservice import Branches
from project_checker.checker.gitservice import RemoteBranch
from project_checker.checker.gitservice import LocalBranch
class ServiceStub:
pass
class BranchTest(TestCase):
def test_branches_creation_no_branches(self):
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright (C) 2008 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 ... | unknown | codeparrot/codeparrot-clean | ||
- sections:
- local: index
title: 🤗 Transformers
- local: quicktour
title: Visite rapide
- local: installation
title: Installation
title: Démarrer
- sections:
- local: tutoriel_pipeline
title: Pipelines pour l'inférence
- local: autoclass_tutorial
title: Chargement d'instances pré-entra... | unknown | github | https://github.com/huggingface/transformers | docs/source/fr/_toctree.yml |
#
# 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 us... | unknown | codeparrot/codeparrot-clean | ||
#!/bin/bash
#
# Test script to verify that the test timeouts in resmoke_suite_test generate coredumps and are picked up for core analysis tasks.
#
# This script:
# 1. Runs a `bazel test` on a resmoke suite that is expected to fail and generate a core.
# 2. Runs evergreen/fetch_remote_test_results.sh, which downloads ... | unknown | github | https://github.com/mongodb/mongo | buildscripts/bazel_testbuilds/verify_resmoke_coredump_test.sh |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2014 University of Dundee & Open Microscopy Environment.
# All rights reserved. Use is subject to license terms supplied in LICENSE.txt
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General P... | unknown | codeparrot/codeparrot-clean | ||
"""
Diagnostics for regression estimations.
"""
__author__ = "Luc Anselin luc.anselin@asu.edu, Nicholas Malizia nicholas.malizia@asu.edu "
import pysal
from pysal.common import *
import scipy.sparse as SP
from math import sqrt
from utils import spmultiply, sphstack, spmin, spmax
__all__ = [
"f_stat", "t_stat", "... | unknown | codeparrot/codeparrot-clean | ||
"""Script for deleting orphans"""
from django.core.management.base import BaseCommand, CommandError
from contentstore.views.item import _delete_orphans
from opaque_keys.edx.keys import CourseKey
from opaque_keys import InvalidKeyError
from xmodule.modulestore import ModuleStoreEnum
class Command(BaseCommand):
"""C... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2014 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 | ||
"""
Tests for chunked adjustments.
"""
from itertools import chain
from textwrap import dedent
from unittest import TestCase
from nose_parameterized import parameterized
from numpy import (
arange,
array,
full,
)
from numpy.testing import assert_array_equal
from six.moves import zip_longest
from zipline.e... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2022 The Abseil 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 by applicable law or agr... | c | github | https://github.com/mysql/mysql-server | extra/abseil/abseil-cpp-20230802.1/absl/log/internal/log_sink_set.h |
# 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 a... | unknown | codeparrot/codeparrot-clean | ||
"""
Tests of student.roles
"""
import ddt
from django.test import TestCase
from courseware.tests.factories import UserFactory, StaffFactory, InstructorFactory
from student.tests.factories import AnonymousUserFactory
from student.roles import (
GlobalStaff, CourseRole, CourseStaffRole, CourseInstructorRole,
Or... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2020 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
from itertools import chain
import os
from django.conf import settings
from django.core.management.base import BaseCommand
from optparse import make_option
from panda.models import DataUpload, RelatedUpload
class Command(BaseCommand):
help = 'Audit uploads and local files, deleting any not... | unknown | codeparrot/codeparrot-clean | ||
# Natural Language Toolkit: Chat-80 KB Reader
# See http://www.w3.org/TR/swbp-skos-core-guide/
#
# Copyright (C) 2001-2017 NLTK Project
# Author: Ewan Klein <ewan@inf.ed.ac.uk>,
# URL: <http://nltk.sourceforge.net>
# For license information, see LICENSE.TXT
"""
Overview
========
Chat-80 was a natural language system ... | unknown | codeparrot/codeparrot-clean | ||
# Functions that already have the correct syntax or miscellaneous functions
__all__ = ['sort', 'copy_reg', 'clip', 'rank',
'sign', 'shape', 'types', 'allclose', 'size',
'choose', 'swapaxes', 'array_str',
'pi', 'math', 'concatenate', 'putmask', 'put',
'around', 'vdot', 'trans... | unknown | codeparrot/codeparrot-clean | ||
from app.config.cplog import CPLog
import base64
import cherrypy
import urllib
import urllib2
from httplib import HTTPSConnection
from urllib import urlencode
log = CPLog(__name__)
class PROWL:
keys = []
priority = []
def __init__(self):
self.enabled = self.conf('enabled');
self.keys = s... | unknown | codeparrot/codeparrot-clean | ||
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | python | github | https://github.com/ansible/ansible | lib/ansible/module_utils/facts/compat.py |
# (c) 2014, Brian Coca, Josh Drake, et al
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import with_statement
from rdflib import py3compat
__doc__ = py3compat.format_doctest_out("""
A Describer is a stateful utility for creating RDF statements in a
semi-declarative manner. It has methods for creating literal values, rel and
rev resource relatio... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2021 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 applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/core/framework/full_type_inference_util.h |
# 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.
"""
This module contains classes that help to emulate xcodebuild behavior on top of
other build systems, such as make and ninja.
"""
import gyp.common
import os.p... | unknown | codeparrot/codeparrot-clean | ||
# Example app with Storybook
This example shows a default set up of Storybook using [`@storybook/nextjs`](https://www.npmjs.com/package/@storybook/nextjs). Included in this example are stories that demonstrate the ability to use Next.js features in Storybook.
### TypeScript
As of v6.0, Storybook has built-in TypeScr... | unknown | github | https://github.com/vercel/next.js | examples/with-storybook/README.md |
"""Pathname and path-related operations for the Macintosh."""
import os
from stat import *
__all__ = ["normcase","isabs","join","splitdrive","split","splitext",
"basename","dirname","commonprefix","getsize","getmtime",
"getatime","getctime", "islink","exists","lexists","isdir","isfile",
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
Unit tests for the da.check.schema.lifecycle_product_class_register module.
---
type:
python_module
validation_level:
v00_minimum
protection:
k00_public
copyright:
"Copyright 2016 High Integrity Artificial Intelligence Systems"
license:
"Licensed under the Apache Lic... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
from mininet_extensions import MininetOSHI
from utility import unmountAll, PropertiesGenerator
import subprocess
def test_add_nodes_and_add_link():
verbose=True
net = MininetOSHI(verbose)
generator = PropertiesGenerator(False)
cr_os = ["cro1","cro2","cro3"]
pe_os = ["peo1","peo2","peo3"]
ctrl... | unknown | codeparrot/codeparrot-clean | ||
"""
Dummy database backend for Django.
Django uses this if the database ENGINE setting is empty (None or empty string).
Each of these API functions, except connection.close(), raises
ImproperlyConfigured.
"""
from django.core.exceptions import ImproperlyConfigured
from django.db.backends import *
from django.db.back... | unknown | codeparrot/codeparrot-clean | ||
import os
import fnmatch
import re # for htest
import sys
from tkinter import StringVar, BooleanVar, Checkbutton # for GrepDialog
from tkinter import Tk, Text, Button, SEL, END # for htest
from idlelib import SearchEngine
import itertools
from idlelib.SearchDialogBase import SearchDialogBase
# Importing OutputWindow... | unknown | codeparrot/codeparrot-clean | ||
---
navigation_title: "Azure Blob Storage"
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/reference/current/es-connectors-azure-blob.html
---
# Elastic Azure Blob Storage connector reference [es-connectors-azure-blob]
The *Elastic Azure Blob Storage connector* is a [connector](/reference/search-conne... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/search-connectors/es-connectors-azure-blob.md |
'''
Created on 10 Aug 2016
@author: bcub3d-build-ubuntu
Fills the fdm structure with data from the csv file
'''
import numpy as np
currTime = 10
def findClosestTime(currTime,timeVec):
'''Finds the time and index in the time vector
of a given current time.'''
# Get index
index = (np.abs(timeVec-curr... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package totp
import (
"bytes"
"context"
"encoding/base32"
"encoding/base64"
"fmt"
"image/png"
"net/url"
"strconv"
"strings"
"github.com/hashicorp/vault/sdk/framework"
"github.com/hashicorp/vault/sdk/logical"
otplib "github.com/pquerna... | go | github | https://github.com/hashicorp/vault | builtin/logical/totp/path_keys.go |
# Copyright (c) 2012 - Oscar Campos <oscar.campos@member.fsf.org>
# See LICENSE for more details
"""
Tests for mamba.utils.converter
"""
import decimal
from twisted.trial import unittest
from mamba.utils import json
from mamba.utils.converter import Converter
class ConverterTest(unittest.TestCase):
def setUp(... | unknown | codeparrot/codeparrot-clean | ||
"""Unit tests for buildscripts/resmokelib/utils/history.py."""
import unittest
from buildscripts.resmokelib.utils.history import HistoryDict, make_historic
class TestHistory(unittest.TestCase):
"""Unit tests for the HistoryDict class."""
def test_acts_like_dict(self):
test_dict = HistoryDict()
... | python | github | https://github.com/mongodb/mongo | buildscripts/tests/resmokelib/utils/test_history.py |
# Copyright 2024 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 applicabl... | python | github | https://github.com/huggingface/transformers | src/transformers/models/blenderbot/__init__.py |
# -*- coding: UTF-8 -*-
from django import forms
from django.conf import settings as dsettings
from django.contrib.admin import widgets as admin_widgets
from django.core import mail
from django.db import transaction
from django.forms import widgets
from django.forms.util import flatatt
from django.utils.encoding import... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import OpenImageIO as oiio
######################################################################
# main test starts here
try:
r = oiio.ROI()
print "ROI() =", r
print "r.defined =", r.defined
r = oiio.ROI (0, 640, 100, 200)
print "ROI(0, 640, 100, 200) =", r
r = oiio.ROI... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-boot | core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/task/TaskSchedulingAutoConfigurationTests.java |
#-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... | unknown | codeparrot/codeparrot-clean | ||
## Input
```javascript
function Foo() {
const getX = () => x;
console.log(getX());
let x = 4;
x += 5;
return <Stringify getX={getX} shouldInvokeFns={true} />;
}
export const FIXTURE_ENTRYPOINT = {
fn: Foo,
params: [],
};
```
## Code
```javascript
import { c as _c } from "react/compiler-runtime";
fu... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hoisting-invalid-tdz-let.expect.md |
/*
Copyright 2017 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/auth/nodeidentifier/default.go |
# We import importlib *ASAP* in order to test #15386
import importlib
import importlib.util
from importlib._bootstrap_external import _get_sourcefile
import builtins
import marshal
import os
import platform
import py_compile
import random
import stat
import sys
import unittest
import unittest.mock as mock
import textwr... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# (c) 2016, NetApp, 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | unknown | codeparrot/codeparrot-clean | ||
<!--⚠️ Note that this file is in Markdown but contain specific syntax for our doc-builder (similar to MDX) that may not be
rendered properly in your Markdown viewer.
-->
# 커뮤니티 [[community]]
이 페이지는 커뮤니티에서 개발한 🤗 Transformers 리소스를 재구성한 페이지입니다.
## 커뮤니티 리소스: [[community-resources]]
| 리소스 | 설명 | 만든이 ... | unknown | github | https://github.com/huggingface/transformers | docs/source/ko/community.md |
"""
Bruces, templating engine.
Contains different functions for compiling and displaying templates.
"""
import os
import tokenize
from cgi import escape
from copy import copy
from StringIO import StringIO
class TemplateCompiler(object):
"""
Class used to generate Python code from template source code.
""... | unknown | codeparrot/codeparrot-clean | ||
# 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 | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
This module contains basic interfaces used throughout the whole gensim package.
The interfaces are realized as abstract base classe... | unknown | codeparrot/codeparrot-clean | ||
package kotlinx.coroutines
import kotlinx.coroutines.testing.*
import kotlinx.coroutines.exceptions.*
import kotlinx.coroutines.internal.*
import kotlin.test.*
class ConcurrentExceptionsStressTest : TestBase() {
private val nWorkers = 4
private val nRepeat = 1000 * stressTestMultiplier
private var worker... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | kotlinx-coroutines-core/concurrent/test/ConcurrentExceptionsStressTest.kt |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateM... | unknown | codeparrot/codeparrot-clean | ||
import datetime
from django.utils.timezone import is_aware, utc
from django.utils.translation import ungettext, ugettext
def timesince(d, now=None, reversed=False):
"""
Takes two datetime objects and returns the time between d and now
as a nicely formatted string, e.g. "10 minutes". If d occurs after now... | unknown | codeparrot/codeparrot-clean | ||
/**
* Sampling Profiler Visualization
*/
(function () {
"use strict";
// ============================================================================
// Configuration
// ============================================================================
const TIMINGS = {
sampleIntervalMin: 100,
sampleInt... | javascript | github | https://github.com/python/cpython | Doc/_static/profiling-sampling-visualization.js |
# -*- coding: utf-8 -*-
# Copyright (C) 2012, Keith Smith
#
# Visvis is distributed under the terms of the (new) BSD License.
# The full license can be found in 'license.txt'.
#
# Thanks to Keith Smith for implementing the polar plot functionality.
import numpy as np
import visvis as vv
from visvis.utils.pypoints imp... | unknown | codeparrot/codeparrot-clean | ||
const fs = require('fs')
const path = require('path')
const JSON5 = require('next/dist/compiled/json5')
const serverExternals = JSON5.parse(
fs.readFileSync(
path.join(
__dirname,
'../packages/next/src/lib/server-external-packages.jsonc'
),
'utf8'
)
)
function validate(docPath) {
const d... | javascript | github | https://github.com/vercel/next.js | scripts/validate-externals-doc.js |
#!/usr/bin/python
#
# Copyright (c) 2019 Zim Kalinowski, <zikalino@microsoft.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | unknown | codeparrot/codeparrot-clean | ||
import enum
import errno
from http import client, HTTPStatus
import io
import itertools
import os
import array
import re
import socket
import threading
import unittest
from unittest import mock
TestCase = unittest.TestCase
from test import support
from test.support import os_helper
from test.support import socket_hel... | python | github | https://github.com/python/cpython | Lib/test/test_httplib.py |
// Copyright 2017 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
package cli
import (
"context"
"fmt"
"path/filepath"
"sort"
"strings"
"testing"
"time"
"github.com/cockroachdb/cockroach/pkg/base"
"github.com/cockroachdb/coc... | go | github | https://github.com/cockroachdb/cockroach | pkg/cli/debug_test.go |
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package terraform
import (
"slices"
"github.com/hashicorp/terraform/internal/addrs"
"github.com/hashicorp/terraform/internal/configs"
"github.com/hashicorp/terraform/internal/dag"
"github.com/hashicorp/terraform/internal/moduletest/mocking"
... | go | github | https://github.com/hashicorp/terraform | internal/terraform/graph_builder_apply.go |
/*
* 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/common/serialization/VoidSerializer.java |
from vtk import *
import os.path
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
data_dir = "../../../../VTKData/Data/Infovis/SQLite/"
if not os.path.exists(data_dir):
data_dir = "../../../../../VTKData/Data/Infovis/SQLite/"
if not os.path.exists(data_dir):
data_dir = "../../../../../../VTKData/Dat... | unknown | codeparrot/codeparrot-clean | ||
"""
The GA4GH data model. Defines all the methods required to translate
data in existing formats into GA4GH protocol types.
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import base64
import collections
import glob
import os
import ga4gh.exceptions a... | 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... | python | github | https://github.com/apache/airflow | airflow-core/src/airflow/listeners/types.py |
from thespian.actors import ActorAddress, ActorSystemConventionUpdate
from thespian.system.messages.convention import (ConventionRegister,
ConventionDeRegister,
ConventionInvite)
from thespian.system.admin.convention impor... | unknown | codeparrot/codeparrot-clean | ||
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/mux/mux-controller.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Common multiplexer controller provider
maintainers:
- Peter Rosin <peda@axentia.se>
description: |
A multiplexer (or mux) controller will have... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/mux/mux-controller.yaml |
# 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 | ||
# Copyright 2015 The Bazel 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 applicable la... | unknown | codeparrot/codeparrot-clean | ||
# This file is part of Bika LIMS
#
# Copyright 2011-2016 by it's authors.
# Some rights reserved. See LICENSE.txt, AUTHORS.txt.
from AccessControl import ClassSecurityInfo
from Products.ATExtensions.Extensions.utils import makeDisplayList
from Products.ATExtensions.ateapi import RecordField, RecordsField
from Products... | unknown | codeparrot/codeparrot-clean | ||
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Olivier Grisel <olivier.grisel@ensta.org>
# Gael Varoquaux <gael.varoquaux@inria.fr>
#
# License: BSD 3 clause
import sys
import warnings
from abc import ABCMeta, abstractmethod
import n... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/python3
"""
Allow simultaneous lock and transfer.
"""
import struct
import decimal
D = decimal.Decimal
from . import (config, util, exceptions, litecoin, util)
FORMAT_1 = '>QQ?'
LENGTH_1 = 8 + 8 + 1
FORMAT_2 = '>QQ??If'
LENGTH_2 = 8 + 8 + 1 + 1 + 4 + 4
ID = 20
# NOTE: Pascal strings are used for storing... | unknown | codeparrot/codeparrot-clean | ||
require 'optparse'
parser = OptionParser.new
parser.banner = "Usage: ruby help_banner.rb"
parser.parse! | ruby | github | https://github.com/ruby/ruby | doc/optparse/ruby/help_banner.rb |
# KidsCanCode - Game Development with Pygame video series
# Jumpy! (a platform game)
# Art from Kenney.nl
# Happy Tune by http://opengameart.org/users/syncopika
# Yippee by http://opengameart.org/users/snabisch
import pygame as pg
import random
from settings import *
from sprites import *
from os import path
class Ga... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.