code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
import json
from datetime import datetime
import argparse
import apache_beam as beam
from apache_beam.io import WriteToBigQuery
from apache_beam.options.pipeline_options import PipelineOptions
from apache_beam.io.gcp.internal.clients import bigquery
import logging
from apache_beam.io import ReadFromText
import random
... | unknown | codeparrot/codeparrot-clean | ||
'''OpenGL extension ATI.text_fragment_shader
This module customises the behaviour of the
OpenGL.raw.GL.ATI.text_fragment_shader to provide a more
Python-friendly API
Overview (from the spec)
The ATI_fragment_shader extension exposes a powerful fragment
processing model that provides a very general means of express... | unknown | codeparrot/codeparrot-clean | ||
"""
This file is part of ntv2generator.
ntv2generator 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.
ntv2generator... | unknown | codeparrot/codeparrot-clean | ||
#ifndef SRC_JS_NATIVE_API_TYPES_H_
#define SRC_JS_NATIVE_API_TYPES_H_
// Use INT_MAX, this should only be consumed by the pre-processor anyway.
#define NAPI_VERSION_EXPERIMENTAL 2147483647
#ifndef NAPI_VERSION
#ifdef NAPI_EXPERIMENTAL
#define NAPI_VERSION NAPI_VERSION_EXPERIMENTAL
#else
// The baseline version for Nod... | c | github | https://github.com/nodejs/node | src/js_native_api_types.h |
from sympy import diff, Integral, Limit, sin, Symbol, Integer, Rational, cos, \
tan, asin, acos, atan, sinh, cosh, tanh, asinh, acosh, atanh, E, I, oo, \
pi, GoldenRatio, EulerGamma, Sum, Eq, Ne, Ge, Lt, Float
from sympy.core.compatibility import u
from sympy.printing.mathml import mathml, MathMLPrinter
from s... | unknown | codeparrot/codeparrot-clean | ||
#ifndef JEMALLOC_INTERNAL_EXP_GROW_H
#define JEMALLOC_INTERNAL_EXP_GROW_H
typedef struct exp_grow_s exp_grow_t;
struct exp_grow_s {
/*
* Next extent size class in a growing series to use when satisfying a
* request via the extent hooks (only if opt_retain). This limits the
* number of disjoint virtual memory r... | c | github | https://github.com/redis/redis | deps/jemalloc/include/jemalloc/internal/exp_grow.h |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may n... | java | github | https://github.com/apache/kafka | clients/src/test/java/org/apache/kafka/common/message/NullableStructMessageTest.java |
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once
#include "registry.h"
namespace spdlog {
// Default logger factory- creates synchronous loggers
class logger;
struct synchronous_factory {
template <typename ... | c | github | https://github.com/nodejs/node | deps/LIEF/third-party/spdlog/include/spdlog/details/synchronous_factory.h |
# -*- coding: utf-8 -*-
##############################################################################
#
# account_group_invoice_lines module for Odoo
# Copyright (C) 2012-2015 SYLEAM Info Services (<http://www.syleam.fr/>)
# Copyright (C) 2015 Akretion (http://www.akretion.com)
# @author: Sébastien LANGE <... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8; -*-
"""
Copyright (C) 2007-2012 Lincoln de Sousa <lincoln@minaslivre.org>
Copyright (C) 2007 Gabriel Falcão <gabrielteratos@gmail.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundat... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from openslides.core.config import config
def change_font_default_path(apps, schema_editor):
"""
Writes the new default font path into the database.
"""
ConfigStore = apps.get_model("core", "ConfigStore")... | unknown | codeparrot/codeparrot-clean | ||
def Check_Solution(a,b,c):
if (a == c):
return ("Yes");
else:
return ("No"); | unknown | mbpp | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
TARGETS = [
'examplejs.py',
]
PACKAGE = {
'title': 'jsimport',
'desc': 'JS import example',
}
def setup(targets):
'''Setup example for translation, MUST call util.setup(targets).'''
util.setup(targets)
def translate():
'''Translate example, MUST ... | unknown | codeparrot/codeparrot-clean | ||
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP863.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors='strict'):
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2021 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 | utils/tests_fetcher.py |
# See https://zulip.readthedocs.io/en/latest/subsystems/hotspots.html
# for documentation on this subsystem.
from typing import Dict, List
from django.conf import settings
from django.utils.functional import Promise
from django.utils.translation import gettext_lazy
from zerver.models import UserHotspot, UserProfile
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016 F5 Networks Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# ... | unknown | codeparrot/codeparrot-clean | ||
"""Summarization checker chain for verifying accuracy of text generation.
Chain that tries to verify the accuracy of text generation by splitting it into a
list of facts, then checking if those facts are true or not, and rewriting
the text to make it more truthful. It will repeat this loop until it hits `max_tries` or... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/chains/llm_summarization_checker/__init__.py |
from argparse import ArgumentParser
from typing import Any, List
from django.contrib.auth.tokens import default_token_generator
from zerver.forms import generate_password_reset_url
from zerver.lib.management import CommandError, ZulipBaseCommand
from zerver.lib.send_email import FromAddress, send_email
from zerver.mo... | unknown | codeparrot/codeparrot-clean | ||
#simple fixes
print 8+(2 if 1 else 3)
print repr('\377ai\37aoi\001123\00hoi\01hoi\0hoi')
# add_strs()
print 'x'+'x'+'x'
#os.path
import os.path
print os.path.join('heuk')
print os.path.join('heuk', 'emeuk')
print os.path.join('heuk', 'emeuk', 'meuk')
from os.path import *
print join('a','b','c')
realpath('run.py'... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
pipe2py.modules.pipecurrencyformat
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
from functools import partial
from itertools import starmap
from babel.numbers import format_currency
from twisted.internet.defer import inlineCallbacks, returnValue, maybeDeferred
f... | 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.
"""Build script to generate a new sdk_tools bundle.
This script packages the files necessary to generate the SDK updater -- the
to... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""
Output override files for apt-ftparchive and indices/
@contact: Debian FTP Master <ftpmaster@debian.org>
@copyright: 2000, 2001, 2002, 2004, 2006 James Troup <james@nocrew.org>
@license: GNU General Public License version 2 or later
"""
# This program is free software; you can redistribute ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
############################################################################
#
# Copyright (C) 2012, 2013 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are m... | unknown | codeparrot/codeparrot-clean | ||
#
# Copyright 2018 Red Hat | Ansible
#
# 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 -*-
"""
BPMN diagram for FOMDES process 1
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from bpmn_pgv import *
import pygraphviz as pgv
__author__ = 'mapologo'
PROCE... | unknown | codeparrot/codeparrot-clean | ||
#
# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
#... | unknown | codeparrot/codeparrot-clean | ||
r"""
=====================================================================
The Johnson-Lindenstrauss bound for embedding with random projections
=====================================================================
The `Johnson-Lindenstrauss lemma`_ states that any high dimensional
dataset can be randomly projected in... | unknown | codeparrot/codeparrot-clean | ||
# 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/loss/loss_utils.py |
# (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# stdlib
from pprint import pprint
import inspect
import os
import sys
# datadog
from config import get_checksd_path, get_confd_path
from util import get_os
def run_check(name, path=None):
"""
Test custo... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
import six
from django.uti... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2005 Divmod, Inc.
# See LICENSE for details.
import sys, errno, os, time
from twisted.trial import unittest
from twisted.python.util import sibpath
from twisted.python.filepath import FilePath
from twisted import plugin, plugins
# Indicates whether or not the unit tests are being run. This is
# ins... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2022 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/conditional_detr/convert_conditional_detr_original_pytorch_checkpoint_to_pytorch.py |
from gettext import gettext as _
import os
import shutil
import logging
from pulp.common.config import read_json_config
from pulp.plugins.importer import Importer
from pulp.server.db.model.criteria import UnitAssociationCriteria
from pulp_openstack.common import constants, models
_logger = logging.getLogger(__name_... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.analysis.api.fir.test.cases.generated.cases.components.typeRelationChecker;
impo... | java | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/typeRelationChecker/FirIdeDependentAnalysisSourceModuleLenientClassIdSubtypingTypeRelationTestGenerated.java |
import fs.osfs
import os, os.path
from capa.capa_problem import LoncapaProblem
from mock import Mock, MagicMock
import xml.sax.saxutils as saxutils
TEST_DIR = os.path.dirname(os.path.realpath(__file__))
def tst_render_template(template, context):
"""
A test version of render to template. Renders to the rep... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2015 The Tornado 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... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2004-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
#
"""
Tests for L{twisted.trial.util}
"""
import os
from zope.interface import implements
from twisted.internet.interfaces import IProcessTransport
from twisted.internet import defer
from twisted.internet.base import DelayedCall
from... | unknown | codeparrot/codeparrot-clean | ||
//===----------------------------------------------------------------------===//
//
// 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 | clang-tools-extra/clang-tidy/plugin/ClangTidyPlugin.cpp |
//===--- GenProto.cpp - Swift IR Generation for Protocols -----------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... | cpp | github | https://github.com/apple/swift | lib/IRGen/GenProto.cpp |
"""
Based on "python-archive" -- http://pypi.python.org/pypi/python-archive/
Copyright (c) 2010 Gary Wilson Jr. <gary.wilson@gmail.com> and 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 So... | unknown | codeparrot/codeparrot-clean | ||
"""Routine to "compile" a .py file to a .pyc (or .pyo) file.
This module has intimate knowledge of the format of .pyc files.
"""
import importlib._bootstrap
import importlib.machinery
import importlib.util
import os
import os.path
import sys
import traceback
__all__ = ["compile", "main", "PyCompileError"]
class PyC... | unknown | codeparrot/codeparrot-clean | ||
A function was given both the `ffi_const` and `ffi_pure` attributes.
Erroneous code example:
```compile_fail,E0757
#![feature(ffi_const, ffi_pure)]
extern "C" {
#[unsafe(ffi_const)]
#[unsafe(ffi_pure)]
//~^ ERROR `#[ffi_const]` function cannot be `#[ffi_pure]`
pub fn square(num: i32) -> i32;
}
```
A... | unknown | github | https://github.com/rust-lang/rust | compiler/rustc_error_codes/src/error_codes/E0757.md |
"""
Repositories in cobbler are way to create a local mirror of a yum repository.
When used in conjunction with a mirrored kickstart tree (see "cobbler import")
outside bandwidth needs can be reduced and/or eliminated.
Copyright 2006-2009, Red Hat, Inc
Michael DeHaan <mdehaan@redhat.com>
This program is free software... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
from sys import exit
from os import environ # to set LC_ALL
from test.http_test import HTTPTest
from misc.wget_file import WgetFile
"""
This test ensures that Wget keeps reserved characters in URLs in non-UTF-8 charsets.
"""
# This bug only happened with ASCII charset,
# so we need to set LC_ALL... | unknown | codeparrot/codeparrot-clean | ||
'''
Video Gstplayer
===============
.. versionadded:: 1.8.0
Implementation of a VideoBase with Kivy :class:`~kivy.lib.gstplayer.GstPlayer`
This player is the prefered player, using Gstreamer 1.0, working on both Python
2 and 3.
'''
from kivy.lib.gstplayer import GstPlayer, get_gst_version
from kivy.graphics.texture ... | unknown | codeparrot/codeparrot-clean | ||
{
"private": true,
"scripts": {
"dev": "next",
"build": "next build",
"start": "next start"
},
"dependencies": {
"@apollo/client": "^3.0.0",
"deepmerge": "^4.2.2",
"graphql": "14.5.8",
"lodash": "4.17.20",
"next": "latest",
"prop-types": "^15.6.0",
"react": "^18.2.0",
... | json | github | https://github.com/vercel/next.js | examples/with-apollo-and-redux/package.json |
// Package modprobe attempts to load kernel modules. It may have more success
// than simply running "modprobe", particularly for docker-in-docker.
package modprobe
import (
"context"
"errors"
"fmt"
"os/exec"
"strings"
"github.com/containerd/log"
"golang.org/x/sys/unix"
)
// LoadModules attempts to load kerne... | go | github | https://github.com/moby/moby | daemon/libnetwork/internal/modprobe/modprobe_linux.go |
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS
#include <ATen/cuda/CUDAContext.h>
#include <c10/util/Exception.h>
#include <ATen/cuda/Exceptions.h>
#include <ATen/native/sparse/cuda/SparseCUDABlas.h>
#include <c10/cuda/CUDACachingAllocator.h>
#include <cusparse.h>
#include <library_types.h>
namespace at::native::sparse:... | cpp | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/sparse/cuda/SparseCUDABlas.cpp |
# Copyright (c) 2006-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
import sys
from cStringIO import StringIO
from twisted.python.versions import getVersionString, IncomparableVersions
from twisted.python.versions import Version, _inf
from twisted.python.filepath import FilePath
from twisted.trial impo... | unknown | codeparrot/codeparrot-clean | ||
#
# test cases for related fields, etc.
#
import unittest
from openerp.osv import fields
from openerp.tests import common
class TestRelatedField(common.TransactionCase):
def setUp(self):
super(TestRelatedField, self).setUp()
self.partner = self.registry('res.partner')
self.company = self.... | unknown | codeparrot/codeparrot-clean | ||
/** @import { Derived, Reaction, Value } from '#client' */
import { UNINITIALIZED } from '../../../constants.js';
import { snapshot } from '../../shared/clone.js';
import { DERIVED, ASYNC, PROXY_PATH_SYMBOL, STATE_SYMBOL } from '#client/constants';
import { effect_tracking } from '../reactivity/effects.js';
import { ac... | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/src/internal/client/dev/tracing.js |
#ifndef TZTIME_INCLUDED
#define TZTIME_INCLUDED
#include "my_config.h"
/* Copyright (c) 2004, 2025, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundatio... | c | github | https://github.com/mysql/mysql-server | sql/tztime.h |
#pragma once
#include <ATen/native/DispatchStub.h>
#include <ATen/Generator.h>
#include <c10/core/Scalar.h>
namespace at {
class Tensor;
class TensorBase;
struct TensorIteratorBase;
}
namespace at::native {
using unary_fn = void(*)(TensorIteratorBase&);
using unary_fn_with_scalar = void(*)(TensorIteratorBase&, cons... | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/UnaryOps.h |
from __future__ import division
import hashlib
import random
import p2pool
from p2pool.util import math, pack
def hash256(data):
return pack.IntType(256).unpack(hashlib.sha256(hashlib.sha256(data).digest()).digest())
def hash160(data):
if data == '04ffd03de44a6e11b9917f3a29f9443283d9871c9d743ef30d5eddcd3709... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
werkzeug.testsuite.test
~~~~~~~~~~~~~~~~~~~~~~~
Tests the testing tools.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement
import sys
import unittest
from io import BytesIO
from werkzeug._com... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Authors: Eric Larson <larson.eric.d@gmail.com>
# Matti Hamalainen <msh@nmr.mgh.harvard.edu>
#
# License: BSD (3-clause)
import os
from os import path as op
import numpy as np
from numpy.testing import assert_allclose
from mne import read_evokeds
from mne.datasets import testing
from... | unknown | codeparrot/codeparrot-clean | ||
<as-split unit="percent" [direction]="splitDirection()" [gutterSize]="9">
<as-split-area #directiveForestSplitArea size="60">
<as-split
[ngResponsiveSplit]="responsiveSplitConfig"
(directionChange)="onResponsiveSplitDirChange($event)"
direction="vertical"
[gutterSize]="9"
unit="perce... | html | github | https://github.com/angular/angular | devtools/projects/ng-devtools/src/lib/devtools-tabs/directive-explorer/directive-explorer.component.html |
#!/usr/bin/env python
# pylint: disable=missing-docstring
# flake8: noqa: T001
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ ... | 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 | ||
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.cm as cm
import matplotlib.mlab as mlab
def smooth1d(x, window_len):
# copied from http://www.scipy.org/Cookbook/SignalSmooth
s=np.r_[2*x[0]-x[window_len:1:-1],x,2*x[-1]-x[-1:-window_len:-1]]
w = np.hanning(window_len)
y=np.convolve... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import division, print_function, absolute_import
from warnings import warn
import numpy as np
from numpy import asarray, empty, ravel, nonzero
from scipy.sparse import (isspmatrix_csc, isspmatrix_csr, isspmatrix,
SparseEfficiencyWarning, csc_matrix)
from . import _superlu
n... | 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 | ||
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2018 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... | unknown | codeparrot/codeparrot-clean | ||
import logging
from django import http
from django.conf import settings
from common import api
from common import clean
from common.models import ExternalProfile
from common import memcache
from common import twitter
from common import user
from common import util
def get_nick_from_email(email):
nick = util.displa... | unknown | codeparrot/codeparrot-clean | ||
## Input
```javascript
// @validateRefAccessDuringRender
function Component(props) {
const ref = useRef(null);
const renderItem = item => {
const current = ref.current;
return <Foo item={item} current={current} />;
};
return <Items>{props.items.map(item => renderItem(item))}</Items>;
}
```
## Error
... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.invalid-ref-in-callback-invoked-during-render.expect.md |
name: Merge Ready
on: pull_request_target
# Declare default permissions as read only.
permissions: {}
jobs:
status:
runs-on: ubuntu-latest
steps:
- uses: angular/dev-infra/github-actions/unified-status-check@8757d815eb39854621b7a42ed742fd34e1c448d9
with:
angular-robot-key: ${{ secre... | unknown | github | https://github.com/angular/angular | .github/workflows/merge-ready-status.yml |
import os
import sys
from django.db.backends.creation import BaseDatabaseCreation
from django.utils.six.moves import input
class DatabaseCreation(BaseDatabaseCreation):
# SQLite doesn't actually support most of these types, but it "does the right
# thing" given more verbose field definitions, so leave them as ... | 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/images/metrics.go |
import requests
import hashlib
class ApiMethod(object):
"""Basic API Class to handle API requests"""
email = ""
password = ""
host = None
token = None
user_id = None
domain_id = ""
team_id = ""
call_response = None
def __init__(self, api_version="1.0", host=None):
su... | unknown | codeparrot/codeparrot-clean | ||
package daemon
import (
"context"
"errors"
"strconv"
"time"
"github.com/moby/moby/api/types/events"
"github.com/moby/moby/v2/errdefs"
)
// ContainerResize changes the size of the TTY of the process running
// in the container with the given name to the given height and width.
func (daemon *Daemon) ContainerRes... | go | github | https://github.com/moby/moby | daemon/resize.go |
#ifndef Py_INTERNAL_BACKOFF_H
#define Py_INTERNAL_BACKOFF_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef Py_BUILD_CORE
# error "this header requires Py_BUILD_CORE define"
#endif
#include <assert.h>
#include <stdbool.h>
#include "pycore_structs.h" // _Py_BackoffCounter
#include "pycore_interp_structs.h" // _P... | c | github | https://github.com/python/cpython | Include/internal/pycore_backoff.h |
#
# 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/tests/unit/ti_deps/deps/test_pool_slots_available_dep.py |
#
# The Python Imaging Library
# $Id$
#
# GRIB stub adapter
#
# Copyright (c) 1996-2003 by Fredrik Lundh
#
# See the README file for information on usage and redistribution.
#
from . import Image, ImageFile
from ._binary import i8
_handler = None
def register_handler(handler):
"""
Install application-specifi... | unknown | codeparrot/codeparrot-clean | ||
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you... | java | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/NativeRSRawDecoder.java |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting model 'LearnSkills'
db.delete_table(u'users_learnskills')
# Deleting model 'TeachSkills'
... | unknown | codeparrot/codeparrot-clean | ||
from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.retrievers import ArxivRetriever
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional impor... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/retrievers/arxiv.py |
class Node(object):
def __init__(self, tag, value, start_mark, end_mark):
self.tag = tag
self.value = value
self.start_mark = start_mark
self.end_mark = end_mark
def __repr__(self):
value = self.value
#if isinstance(value, list):
# if len(value) == 0:
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | unknown | codeparrot/codeparrot-clean | ||
from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_message_histories import CosmosDBChatMessageHistory
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
#... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/memory/chat_message_histories/cosmos_db.py |
#pragma once
#define MR 8
#define COL_BLOCK_SIZE 4
#define PACKED_A_BLOCK_SIZE COL_BLOCK_SIZE*MR | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/quantized/cpu/qnnpack/src/q8gemm_sparse/8x4c1x4-packed-sse2.h |
#!/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 BaseHTTPServer
import imp
import logging
import multiprocessing
import optparse
import os
import SimpleHTTPServer # pylint:... | unknown | codeparrot/codeparrot-clean | ||
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iommu/apple,dart.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Apple DART IOMMU
maintainers:
- Sven Peter <sven@svenpeter.dev>
description: |+
Apple SoCs may contain an implementation of th... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/iommu/apple,dart.yaml |
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>React Router - Search Params Example</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</htm... | html | github | https://github.com/remix-run/react-router | examples/search-params/index.html |
# -*- 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 | ||
import asyncio
import logging
import pathlib
import jinja2
import aiohttp_jinja2
from aiohttp import web
from aiohttpdemo_polls.db import init_postgres
from aiohttpdemo_polls.middlewares import setup_middlewares
from aiohttpdemo_polls.routes import setup_routes
from aiohttpdemo_polls.utils import load_config
PROJ_RO... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
require "cases/helper"
require "models/post"
require "models/tag"
require "models/author"
require "models/comment"
require "models/category"
require "models/categorization"
require "models/tagging"
module Remembered
extend ActiveSupport::Concern
included do
after_create :remembe... | ruby | github | https://github.com/rails/rails | activerecord/test/cases/associations/eager_load_nested_include_test.rb |
#
# peepdf is a tool to analyse and modify PDF files
# http://peepdf.eternal-todo.com
# By Jose Miguel Esparza <jesparza AT eternal-todo.com>
#
# Copyright (C) 2012-2014 Jose Miguel Esparza
#
# This file is part of peepdf.
#
# peepdf is free software: you can redistribute it and/or modify
# ... | unknown | codeparrot/codeparrot-clean | ||
from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.vectorstores import Rockset
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
D... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/vectorstores/rocksetdb.py |
#!/usr/bin/python
import h5py
import matplotlib.pylab as plt
import matplotlib as mpl
import sys
import numpy as np;
plt.rcParams.update({'font.size': 28})
# set tick width
mpl.rcParams['xtick.major.size'] = 10
mpl.rcParams['xtick.major.width'] = 5
mpl.rcParams['xtick.minor.size'] = 10
mpl.rcParams['xtick.minor.width... | unknown | codeparrot/codeparrot-clean | ||
#/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2010-2012 Cidadania S. Coop. Galega
#
# This file is part of e-cidadania.
#
# e-cidadania 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 v... | unknown | codeparrot/codeparrot-clean | ||
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from cmsplugin_filer_utils.migration import rename_tables_new_to_old
class Migration(SchemaMigration):
cms_plugin_table_mapping = (
# (old_name, new_name),
('cmsplugin_filert... | 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/test/java/org/apache/kafka/common/security/oauthbearer/OAuthBearerValidatorCallbackTest.java |
# CliHelloWorldLazy
This test checks bundle sizes when there is a lazy module. It also checks if the `ngDevMode` global variable and string references in `packages/core/src/util/ng_dev_mode.ts` are correctly removed.
This test contains a lazy route to ensure `ngDevMode` removal happens even across chunks, and a paylo... | unknown | github | https://github.com/angular/angular | integration/cli-hello-world-lazy/README.md |
def extract_unique(test_dict):
res = list(sorted({ele for val in test_dict.values() for ele in val}))
return res | unknown | mbpp | ||
#ifndef BOOST_ARCHIVE_POLYMORPHIC_TEXT_IARCHIVE_HPP
#define BOOST_ARCHIVE_POLYMORPHIC_TEXT_IARCHIVE_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// polymorphic_text_iarchive.hpp
// (C) C... | unknown | github | https://github.com/mysql/mysql-server | extra/boost/boost_1_87_0/boost/archive/polymorphic_text_iarchive.hpp |
'''
OpenCV Camera: Implement CameraBase with OpenCV
'''
#
# TODO: make usage of thread or multiprocess
#
__all__ = ('CameraOpenCV')
from kivy.logger import Logger
from kivy.clock import Clock
from kivy.graphics.texture import Texture
from kivy.core.camera import CameraBase
try:
import opencv as cv
import op... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Contracts\Validation;
interface DataAwareRule
{
/**
* Set the data under validation.
*
* @param array $data
* @return $this
*/
public function setData(array $data);
} | php | github | https://github.com/laravel/framework | src/Illuminate/Contracts/Validation/DataAwareRule.php |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.