code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
import unittest, textwrap
import util
import nltk.tree as T
class UtilTest(unittest.TestCase):
maxDiff = None
def test_safeJson(self):
d = dict(foo = 'foo"bar')
s = util.safe_json(d)
self.assertEqual(s, '{"foo": "foo\"bar"}')
def test_queryVersionCookie(self)... | unknown | codeparrot/codeparrot-clean | ||
import time
from helper import PackageHelper
import cocos
class PackageInfo(object):
@staticmethod
def plugin_name():
return "info"
@staticmethod
def brief_description():
return cocos.MultiLanguage.get_string('PACKAGE_INFO_BRIEF')
def parse_args(self, argv):
from argpars... | unknown | codeparrot/codeparrot-clean | ||
{
"Modules": [
{
"Key": "",
"Source": "",
"Dir": "."
},
{
"Key": "child",
"Source": "./child",
"Dir": "testdata/child-provider-grandchild-count/child"
},
{
"Key": "child.grandchild",
... | json | github | https://github.com/hashicorp/terraform | internal/configs/configload/testdata/child-provider-grandchild-count/.terraform/modules/modules.json |
//===--- Consumption.h - Value consumption for SIL --------------*- C++ -*-===//
//
// 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... | c | github | https://github.com/apple/swift | include/swift/SIL/Consumption.h |
# Copyright 2019 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import print_function
import os
import shutil
import string
from importlib import import_module
from os.path import join, dirname, abspath, exists, splitext
import scrapy
from scrapy.commands import ScrapyCommand
from scrapy.utils.template import render_templatefile, string_camelcase
from scrapy.excep... | unknown | codeparrot/codeparrot-clean | ||
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS
#include <ATen/core/Tensor.h>
#include <ATen/Dispatch.h>
#include <ATen/ExpandUtils.h>
#include <torch/library.h>
#include <ATen/native/TensorIterator.h>
#include <ATen/native/cpu/Loops.h>
#include <ATen/native/quantized/cpu/OnednnUtils.h>
#include <ATen/native/quantized/cpu/Q... | cpp | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/quantized/cpu/qmul.cpp |
# Copyright (c) Twisted Matrix Laboratories
# See LICENSE for details
"""
A PTY server that spawns a shell upon connection.
Run this example by typing in:
> python ptyserv.py
Telnet to the server once you start it by typing in:
> telnet localhost 5823
"""
from twisted.internet import reactor, protocol
class FakeTe... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
class Placeholders(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually."""
def __init__(self):
"""
Attributes:
swaggerTypes (dict): The key is attribute name and the value is attribute type.
... | unknown | codeparrot/codeparrot-clean | ||
from pyramid.httpexceptions import (
HTTPException,
HTTPFound,
HTTPNotFound,
HTTPBadRequest,
HTTPConflict,
)
from pyramid.security import Authenticated
from pyramid.view import view_config
from perpetualfailure.db import session
from perpetualfailure.knowledgebase.models import (
KB_Article,
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2011 Eldar Nugaev
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
import json
import re
import azurelinuxagent.common.utils.restutil as restutil
from azurelinuxagent.common.exception import HttpError
from azurelinuxagent.common.future import ustr
import azure... | unknown | codeparrot/codeparrot-clean | ||
# A example scrape configuration for running Prometheus with
# STACKIT.
scrape_configs:
# Make Prometheus scrape itself for metrics.
- job_name: "prometheus"
static_configs:
- targets: ["localhost:9090"]
# Discover Node Exporter instances to scrape.
- job_name: "node"
stackit_sd_configs:
... | unknown | github | https://github.com/prometheus/prometheus | documentation/examples/prometheus-stackit.yml |
import numpy as np
import bisect
import pybasis
import pyam
import read_matel
np.set_printoptions(threshold=np.nan)
def set_up_sp_basis(filename):
with open(filename) as fp:
orbitals = pybasis.nlj_orbital.ParseOrbitalPNStream(fp, True)
sp_subspace = pybasis.m_scheme.SingleParticleSubspacePN(
... | unknown | codeparrot/codeparrot-clean | ||
# Amazon build variants for testing development environments
#
# After the branching variants in this file
# should continue to run on a new rapid release (v7.1, v7.2 etc.)
# and LTS release (v7.0, v6.0 etc.) branch projects
variables:
# THIS HAS COPIES IN:
# - etc/evergreen_yml_components/variants/amazon/test_dev... | unknown | github | https://github.com/mongodb/mongo | etc/evergreen_yml_components/variants/amazon/test_dev.yml |
#!/usr/bin/env bash
# Copyright 2023 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.
set -exuo pipefail
source "$(dirname "${0}")/../../../teamcity-support.sh"
source "$(dirname "${0}")/../../../teamcity-bazel-support.sh" # For run_baze... | unknown | github | https://github.com/cockroachdb/cockroach | build/teamcity/cockroach/nightlies/teamcity-roachtest-stress.sh |
/* Copyright 2023 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/compiler/mlir/quantization/stablehlo/cc/calibration/statistics.h |
# $Id: presence.py 2171 2008-07-24 09:01:33Z bennylp $
#
# Presence and instant messaging
#
# Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
#
# 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 Foun... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from flask import Flask, render_template
from .wizard import wizard
from .exts import db, mail, migrate
from .wizard import wizard
from .expert import expert
from .summary import summary
from .main import main
def create_app(config=None):
"""Creates the Flask app."""
app = Flask(__name... | unknown | codeparrot/codeparrot-clean | ||
"""A parser for HTML and XHTML."""
# This file is based on sgmllib.py, but the API is slightly different.
# XXX There should be a way to distinguish between PCDATA (parsed
# character data -- the normal case), RCDATA (replaceable character
# data -- only char and entity references and end tags are special)
# and CDAT... | unknown | codeparrot/codeparrot-clean | ||
#define USE_THE_REPOSITORY_VARIABLE
#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "config.h"
#include "commit.h"
#include "diff.h"
#include "environment.h"
#include "gettext.h"
#include "hex.h"
#include "revision.h"
#include "refs.h"
#include "list-objects.h"
#include "quote.h"
#include "... | c | github | https://github.com/git/git | bisect.c |
#!/usr/bin/env python
#! -*- coding: utf-8 -*-
###
# Copyright (c) Paul Brian 2013
# This software is subject to
# the provisions of the GNU Affero General
# Public License version 3 (AGPLv3).
# See LICENCE.txt for details.
###
"""
setup for HomeSpendWatch
"""
from setuptools import setup, find_packages
import os, ... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (c) Facebook, Inc. and its affiliates.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <arm_neon.h>
#include <qnnpack/common.h>
#include <qnnpack/q8vadd.h>
void pytorch_q8vadd_u... | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/quantized/cpu/qnnpack/src/q8vadd/neon.c |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2005-2006 CamptoCamp
# Copyright (c) 2006-2010 OpenERP S.A
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all po... | 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 | ||
# (c) 2016 Red Hat 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
# (at your option) any later version.
#
# Ansible is dis... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... | unknown | codeparrot/codeparrot-clean | ||
#include "builtin.h"
#include "transport.h"
static const char usage_msg[] =
"git remote-fd <remote> <url>";
/*
* URL syntax:
* 'fd::<inoutfd>[/<anything>]' Read/write socket pair
* <inoutfd>.
* 'fd::<infd>,<outfd>[/<anything>]' Read pipe <infd> and write
* pipe <outfd>.
* [foo] indicates 'foo' is op... | c | github | https://github.com/git/git | builtin/remote-fd.c |
#!/usr/bin/env python
import logging
from setuptools import setup
import subprocess
import os
logging.basicConfig(level=logging.WARNING)
logger = logging.getLogger(__name__)
classifiers = [
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD Licen... | unknown | codeparrot/codeparrot-clean | ||
---
applies_to:
stack:
serverless:
navigation_title: "Histogram"
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/reference/current/histogram.html
---
# Histogram field type [histogram]
A field to store pre-aggregated numerical data representing a histogram. This data is defined using two paired ar... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/elasticsearch/mapping-reference/histogram.md |
{
"allRuns": "جميع التشغيلات",
"blockingDeps": {
"dependency": "التبعية",
"reason": "السبب",
"title": "التبعيات التي تمنع جدولة المهمة"
},
"calendar": {
"daily": "يومي",
"hourly": "ساعي",
"legend": {
"less": "أقل",
"mixed": "مختلط",
"more": "أكثر"
},
"navigation... | json | github | https://github.com/apache/airflow | airflow-core/src/airflow/ui/public/i18n/locales/ar/dag.json |
import RoutingKit
import NIOHTTP1
/// Determines how an incoming HTTP request's body is collected.
public enum HTTPBodyStreamStrategy: Sendable {
/// The HTTP request's body will be collected into memory up to a maximum size
/// before the route handler is called. The application's configured default max body
... | swift | github | https://github.com/vapor/vapor | Sources/Vapor/Routing/RoutesBuilder+Method.swift |
--
-- Only superusers and roles with privileges of the pg_read_all_stats role
-- are allowed to see the SQL text and queryid of queries executed by
-- other users. Other users can see the statistics.
--
SET pg_stat_statements.track_utility = FALSE;
CREATE ROLE regress_stats_superuser SUPERUSER;
CREATE ROLE regress_sta... | sql | github | https://github.com/postgres/postgres | contrib/pg_stat_statements/sql/privileges.sql |
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsGraduatedSymbolRenderer
.. note:: 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 2 of the License, or
(at your option) any later vers... | unknown | codeparrot/codeparrot-clean | ||
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/media/qcom,sc8280xp-camss.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Qualcomm SC8280XP Camera Subsystem (CAMSS)
maintainers:
- Bryan O'Donoghue <bryan.odonoghue@linaro.org>
description: |
... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/media/qcom,sc8280xp-camss.yaml |
#!/usr/bin/env python
"""
Copyright (C) 2003-2005 Jeremy O'Donoghue and others
License: This work is licensed under the PSF. A copy should be included
with this source code, and is also available at
http://www.python.org/psf/license.html
"""
import sys, time, os, gc
import matplotlib
matplotlib.use('WXAgg')
from ma... | unknown | codeparrot/codeparrot-clean | ||
""" Parse a custom formated geography file
Headers should look like so
sumlev,name,custom_name,geo_id,geo_id_segements,year
"""
from django.core.management.base import BaseCommand, CommandError
from census.tools.geography import parse_file, get_sum_lev_name, SUPPORTED_DATASETS, geo_id_to_segments
from django.co... | unknown | codeparrot/codeparrot-clean | ||
from optparse import OptionParser
import pandas as pd
import json
ontology_term = {}
ontology_gene = {}
node_index = {}
def read_gen_ontology():
df = pd.read_csv(filepath_or_buffer="gen_ontology.csv")
return df
def read_ft():
ft = set([])
with open("TFs.txt", "r") as f:
for line in f.readline... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
***************************************************************************
extractprojection.py
---------------------
Date : September 2013
Copyright : (C) 2013 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
*****... | unknown | codeparrot/codeparrot-clean | ||
#!/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 | ||
/*-------------------------------------------------------------------------
*
* Utility routines for SQL dumping
*
* Basically this is stuff that is useful in both pg_dump and pg_dumpall.
*
*
* Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the Un... | c | github | https://github.com/postgres/postgres | src/bin/pg_dump/dumputils.h |
# -*- coding: utf-8 -*-
""" Commerce app tests package. """
import datetime
import json
from django.conf import settings
from django.contrib.auth.models import User
from django.test import TestCase
from django.test.utils import override_settings
from freezegun import freeze_time
import httpretty
import jwt
import mock... | unknown | codeparrot/codeparrot-clean | ||
import os
import unittest
from test.support import import_helper, threading_helper
from test.support.threading_helper import run_concurrently
from uuid import SafeUUID
c_uuid = import_helper.import_module("_uuid")
NTHREADS = 10
UUID_PER_THREAD = 1000
@threading_helper.requires_working_threading()
class UUIDTests(un... | python | github | https://github.com/python/cpython | Lib/test/test_free_threading/test_uuid.py |
<html>
<head>
<link
href="../third_party/fonts.google.com/material-symbols-outlined/outlined.css"
rel="stylesheet"
/>
<style>
* {
margin: 0;
padding: 0;
}
.header-text {
margin: 0px;
text-align: center;
padding-bottom: 8px;
}
... | html | github | https://github.com/angular/angular | devtools/projects/shell-browser/src/popups/unsupported.html |
def gen():
i = 0
while 1:
yield i
i += 1
g = gen()
try:
g.pend_throw
except AttributeError:
print("SKIP")
raise SystemExit
# Verify that an injected exception will be raised from next().
print(next(g))
print(next(g))
g.pend_throw(ValueError())
v = None
try:
v = next(g)
except... | unknown | codeparrot/codeparrot-clean | ||
// Copyright David Abrahams 2006. Distributed under the Boost
// Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_CONCEPT_REQUIRES_DWA2006430_HPP
# define BOOST_CONCEPT_REQUIRES_DWA2006430_HPP
# include <boost/config.hpp>
# include ... | unknown | github | https://github.com/mysql/mysql-server | extra/boost/boost_1_87_0/boost/concept/requires.hpp |
#!/usr/bin/env python
import sys
def gen_test(n):
print "CREATE TABLE t (a BINARY(%d));" % (n)
for v in [ 0, 1, 2, 4, 8, 16, 32, 64, 126, 127 ]:
print "INSERT INTO t VALUES (%d);" % (v)
for i in range(2,256):
if i < n:
print "--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/"
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
import os
stack = [ "push", "pop" ]
alu = {
"add": "+",
"adc": "+",
"sub": "-",
"sbc": "-",
"xor": "^",
"or": "|",
"and": "&",
}
carry = [ "adc", "sbc" ]
def create_asm(instruction):
out = open("temp.asm", "w")
use_rs_form = False
instruction = instruction.replace("#", "... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package stackaddrs
import (
"testing"
"github.com/hashicorp/terraform/internal/addrs"
)
func TestStackInstance_Contains(t *testing.T) {
tests := []struct {
name string
parent StackInstance
arg StackInstance
want bool
}{
{
... | go | github | https://github.com/hashicorp/terraform | internal/stacks/stackaddrs/stack_test.go |
import { test, ok } from '../../assert';
export default test({
mode: ['client'],
async test({ assert, target }) {
const audio = target.querySelector('audio');
const button = target.querySelector('button');
ok(audio);
assert.equal(audio.muted, false);
audio.muted = true;
audio.dispatchEvent(new CustomEv... | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/tests/runtime-browser/samples/bind-muted/_config.js |
/*
* Copyright (c) 2016 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockito.internal.creation.instance;
import static org.mockito.internal.util.StringUtil.join;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
imp... | java | github | https://github.com/mockito/mockito | mockito-core/src/main/java/org/mockito/internal/creation/instance/ConstructorInstantiator.java |
# Copyright 2014 NEC Corporation. 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 ... | unknown | codeparrot/codeparrot-clean | ||
"""Test functionality related to length based selector."""
import pytest
from langchain_core.example_selectors import (
LengthBasedExampleSelector,
)
from langchain_core.prompts import PromptTemplate
EXAMPLES = [
{"question": "Question: who are you?\nAnswer: foo"},
{"question": "Question: who are you?\nA... | python | github | https://github.com/langchain-ai/langchain | libs/core/tests/unit_tests/example_selectors/test_length_based_example_selector.py |
name: pandas-dev
channels:
- conda-forge
dependencies:
- python=3.13
# build dependencies
- versioneer
- cython<4.0.0a0
- meson=1.10.0
- meson-python=0.18.0
# test dependencies
- pytest>=8.3.4
- pytest-cov
- pytest-xdist>=3.6.1
- hypothesis>=6.116.0
# required dependencies
- python-dateut... | unknown | github | https://github.com/pandas-dev/pandas | ci/deps/actions-313-pyarrownightly.yaml |
import unittest
from app import app
class TestCase(unittest.TestCase):
def setUp(self):
self.app = app.test_client()
def test_save(self):
result = self.app.post('/save', data={'title': 'titulo', 'content': 'test'})
self.assertEqual(result.data, b'test')
self.assertEqual(result... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: UTF-8 -*-
# !/usr/bin/python
# 配置文件
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
# 配置类
SECRET_KEY = os.environ.get('SECRET_KEY') or 'hard to guess string'
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
@staticmethod
def init_app(app):
pass
class Devel... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding:utf-8 -*-
'''
___________________________________
___/ YOUR GOOGLE APPENGINE FOLDER PATH \__________________________________________________
'''
GOOGLE_APPENGINE_PATH = "C:\\Program Files (x86)\\Google\\google_appe... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
## Invenio bibconvert unit tests.
## This file is part of Invenio.
## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 CERN.
##
## Invenio 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 F... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
from django.apps import apps
from django.db import models
from django.db.utils import IntegrityError, OperationalError, ProgrammingError
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
class Conte... | unknown | codeparrot/codeparrot-clean | ||
__author__ = 'Scott Ficarro, William Max Alexander'
__version__ = '1.0'
#Filter management
import re
def Onms1(filter_dict, id):
filter_dict["mode"]="ms1"
filter_dict["analyzer"]=id.groups()[0]
filter_dict["data"]= "+cent" if id.groups()[1]== "c" else "+prof"
filter_dict["mr"]='[' + id.groups()[2]+'-'... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi
# Copyright 2013 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
# publi... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from random import randint
from odoo import api, fields, models, tools, SUPERUSER_ID
from odoo.tools.translate import _
from odoo.exceptions import UserError
AVAILABLE_PRIORITIES = [
('0', 'Normal'),
('1', 'Goo... | unknown | codeparrot/codeparrot-clean | ||
// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (c) 2021 IBM Corporation
*/
#include <linux/module.h>
#include <crypto/internal/ecc.h>
#include <crypto/internal/sig.h>
#include <crypto/ecdh.h>
#include <crypto/sha2.h>
#include <crypto/sig.h>
struct ecc_ctx {
unsigned int curve_id;
const struct ecc_curve *curv... | c | github | https://github.com/torvalds/linux | crypto/ecdsa.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 n... | java | github | https://github.com/apache/kafka | clients/src/main/java/org/apache/kafka/common/security/oauthbearer/internals/secured/OAuthBearerConfigurable.java |
<!--Copyright 2025 The Qwen Team and The HuggingFace Inc. 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 a... | unknown | github | https://github.com/huggingface/transformers | docs/source/en/model_doc/ernie4_5_vl_moe.md |
/**
* \file psa/crypto_sizes.h
*
* \brief PSA cryptography module: Mbed TLS buffer size macros
*
* \note This file may not be included directly. Applications must
* include psa/crypto.h.
*
* This file contains the definitions of macros that are useful to
* compute buffer sizes. The signatures and semantics of ... | c | github | https://github.com/nodejs/node | deps/LIEF/third-party/mbedtls/include/psa/crypto_sizes.h |
#include <ATen/ATen.h>
namespace at::native {
// alias for to_padded_tensor in nested namespace
Tensor nested_to_padded_tensor(
const Tensor& t,
double padding,
OptionalIntArrayRef output_size) {
return t.to_padded_tensor(padding, output_size);
}
} // namespace at::native | cpp | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/nested/NestedTensorAliases.cpp |
## Input
```javascript
import {identity, createHookWrapper} from 'shared-runtime';
function useHook({isCond, value}) {
return isCond
? identity({
getValue() {
return value;
},
})
: 42;
}
export const FIXTURE_ENTRYPOINT = {
fn: createHookWrapper(useHook),
params: [{isCond... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-literal-method-derived-in-ternary-consequent.expect.md |
#!/usr/bin/env python
from nose.tools import *
from nose import SkipTest
import networkx as nx
class TestFloydNumpy(object):
numpy=1 # nosetests attribute, use nosetests -a 'not numpy' to skip test
@classmethod
def setupClass(cls):
global numpy
global assert_equal
global assert_almo... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
import warnings
from django.contrib.localflavor.id.forms import (IDPhoneNumberField,
IDPostCodeField, IDNationalIdentityNumberField, IDLicensePlateField,
IDProvinceSelect, IDLicensePlatePrefixSelect)
from django.test import SimpleTestCase
class IDLocalFlavorTests(Simp... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Testserver for the two phase upload protocol."""
import base64
import BaseHTTPServer
import hashlib
import os
import sys
import url... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##################################################################################
#
# Copyright (c) 2005-2006 Axelor SARL. (http://www.axelor.com)
# and 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# $Id: hr.py 4656 2006-11-24 09:58:42Z Cyp $
#
# This program is free software: you can redistri... | unknown | codeparrot/codeparrot-clean | ||
from unittest import TestCase
from django import VERSION
from .main.models import PizzeriaBar
# under Django 1.11 this fails with
# django.core.exceptions.FieldError: Local field u'street' in class 'PizzeriaBar' clashes with field of the same name from base class 'Pizzeria'.
class DocTest(TestCase):
def test_dja... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2012 - 2014 EMC Corporation.
# 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 2023 Meta Platforms, Inc. and The HuggingFace Inc. 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
#
... | python | github | https://github.com/huggingface/transformers | src/transformers/models/convnextv2/modeling_convnextv2.py |
#pragma once
#include <c10/core/Device.h>
#include <c10/core/Layout.h>
#include <c10/core/MemoryFormat.h>
#include <c10/core/ScalarType.h>
#include <optional>
namespace at {
class Tensor;
namespace native {
bool to_will_alias(
const Tensor& self,
std::optional<ScalarType> dtype,
std::optional<Layout> layo... | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/TensorConversions.h |
# boykovkolmogorov.py - Boykov Kolmogorov algorithm for maximum flow problems.
#
# Copyright 2016 NetworkX developers.
#
# This file is part of NetworkX.
#
# NetworkX is distributed under a BSD license; see LICENSE.txt for more
# information.
#
# Author: Jordi Torrents <jordi.t21@gmail.com>
"""
Boykov-Kolmogorov algori... | unknown | codeparrot/codeparrot-clean | ||
from django.db.utils import IntegrityError
from social_auth.utils import setting
from social_auth.models import UserSocialAuth
from social_auth.backends.pipeline import warn_setting
from social_auth.backends.exceptions import AuthException
from django.utils.translation import ugettext
def social_auth_user(backend, ui... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright 2023 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... | go | github | https://github.com/kubernetes/kubernetes | pkg/controlplane/apiserver/options/validation.go |
<!--
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
-->
# TLS Sessions and Tickets
The TLS protocol offers methods of "resuming" a previous "session". A
TLS "session" is a negotiated security context across a connection
(which may be via TCP or UDP or other transports.)
By "re... | unknown | github | https://github.com/curl/curl | docs/internals/TLS-SESSIONS.md |
#!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Test for -rpcbind, as well as -rpcallowip and -rpcconnect
# Add python-bitcoinrpc to module search path:
im... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) Facebook, Inc. and its affiliates.
// All rights reserved.
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.
#include <ATen/functorch/BatchRulesHelper.h>
#include <ATen/Operators.h>
#include <ATen/functorch/PlumbingHe... | cpp | github | https://github.com/pytorch/pytorch | aten/src/ATen/functorch/BatchRulesScatterOps.cpp |
/*
* 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/fs/statistics/impl/IOStatisticsStoreBuilder.java |
#!/usr/bin/python
#
# Copyright (c) 2008--2016 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/conformance/classes/propertyMemberDeclarations/autoAccessorDisallowedModifiers.ts] ////
//// [autoAccessorDisallowedModifiers.ts]
abstract class C1 {
accessor accessor a: any;
readonly accessor b: any;
declare accessor c: any;
accessor public d: any;
accessor private e: any;
a... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/autoAccessorDisallowedModifiers(target=es2017).js |
from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.chat_models.databricks import ChatDatabricks
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling op... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/chat_models/databricks.py |
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsHighlight.
.. note:: 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 2 of the License, or
(at your option) any later version.
"""
__au... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from nose.tools import eq_
from utilities import execution_path, run_all
import os, mapnik
def setup():
# All of the paths used are relative, if we run the tests
# from another directory we need to chdir()
os.chdir(execution_path('.'))
if 'osm' in mapnik.Data... | unknown | codeparrot/codeparrot-clean | ||
"""
Events which have to do with a user doing something with more than one course, such
as enrolling in a certain number, completing a certain number, or completing a specific set of courses.
"""
from badges.models import CourseEventBadgesConfiguration, BadgeClass
from badges.utils import requires_badges_enabled
def ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# coding=utf-8
##########################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
from diamond.collector import Collector
from ntp import NtpCollec... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | unknown | codeparrot/codeparrot-clean | ||
{
"private": true,
"main": "firebaseFunctions.js",
"scripts": {
"dev": "next src/",
"build": "next build src/",
"start": "next start src/",
"serve": "npm run build && firebase emulators:start --only functions,hosting",
"shell": "npm run build && firebase functions:shell",
"deploy": "fireba... | json | github | https://github.com/vercel/next.js | examples/with-firebase-hosting/package.json |
# Selecting elements
A *selection* is a set of elements from the DOM. Typically these elements are identified by [selectors](http://www.w3.org/TR/selectors-api/) such as `.fancy` for elements with the class *fancy*, or `div` to select DIV elements.
Selection methods come in two forms, **select** and **selectAll**: th... | unknown | github | https://github.com/d3/d3 | docs/d3-selection/selecting.md |
//===----------------------------------------------------------------------===//
//
// 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/llvm/PreferRegisterOverUnsignedCheck.cpp |
"""
homeassistant.components.sensor.systemmonitor
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Shows system monitor values such as: disk, memory, and processor use.
Configuration:
To use the System monitor sensor you will need to add something like the
following to your configuration.yaml file.
sensor:
platform: ... | unknown | codeparrot/codeparrot-clean | ||
"""
Trig RDF graph serializer for RDFLib.
See <http://www.w3.org/TR/trig/> for syntax specification.
"""
from collections import defaultdict
from rdflib.plugins.serializers.turtle import TurtleSerializer, _GEN_QNAME_FOR_DT, VERB
from rdflib.term import BNode, Literal
__all__ = ['TrigSerializer']
class TrigSerializ... | unknown | codeparrot/codeparrot-clean | ||
#pragma once
#include <ATen/cpu/vec/intrinsics.h>
#include <ATen/cpu/vec/vec256/vsx/vsx_helpers.h>
#include <ATen/cpu/vec/vec_base.h>
// Note: header order is important here
#include <ATen/cpu/vec/vec256/vsx/vec256_double_vsx.h>
#include <ATen/cpu/vec/vec256/vsx/vec256_float_vsx.h>
#include <ATen/cpu/vec/vec256/vsx/v... | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/cpu/vec/vec256/vsx/vec256_common_vsx.h |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, 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',
... | unknown | codeparrot/codeparrot-clean | ||
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2013 Savoir-faire Linux
# (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or m... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: proto/lib/python/int.proto
"""Generated protocol buffer code."""
# third party
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _ref... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.