code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
use crate::spec::{Arch, Cc, LinkerFlavor, Lld, Os, Target, TargetMetadata, TargetOptions, cvs}; pub(crate) fn target() -> Target { let mut base = TargetOptions::default(); base.add_pre_link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &["-G0"]); Target { llvm_target: "hexagon-unknown-elf".into(), ...
rust
github
https://github.com/rust-lang/rust
compiler/rustc_target/src/spec/targets/hexagon_unknown_qurt.rs
#ifndef DATE_TIME_FORMAT_DATE_PARSER_HPP__ #define DATE_TIME_FORMAT_DATE_PARSER_HPP__ /* Copyright (c) 2004-2005 CrystalClear Software, Inc. * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)...
unknown
github
https://github.com/mysql/mysql-server
extra/boost/boost_1_87_0/boost/date_time/format_date_parser.hpp
from typing import Literal from langchain_core.documents import Document from langchain_core.indexing.api import _get_document_with_hash def test_hashed_document_hashing() -> None: document = Document( uid="123", page_content="Lorem ipsum dolor sit amet", metadata={"key": "value"} ) hashed_documen...
python
github
https://github.com/langchain-ai/langchain
libs/core/tests/unit_tests/indexing/test_hashed_document.py
import math import scipy.signal import numpy def result(): start = 0e-6 # part used for amplitude calculation end = 50e-6 # # ------------------------------------------------------------------------------ mag = MeasurementResult("Amplitude") for timesignal in results: ...
unknown
codeparrot/codeparrot-clean
# iSCSI configuration dialog # # Copyright (C) 2013 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is distribute...
unknown
codeparrot/codeparrot-clean
/*M/////////////////////////////////////////////////////////////////////////////////////// // // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. // // By downloading, copying, installing or using the software you agree to this license. // If you do not agree to this license, do not download, instal...
unknown
github
https://github.com/opencv/opencv
modules/core/include/opencv2/core/cuda_stream_accessor.hpp
//go:build windows /* Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ag...
go
github
https://github.com/kubernetes/kubernetes
pkg/kubelet/kuberuntime/kuberuntime_sandbox_windows.go
# Copyright 2011, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
unknown
codeparrot/codeparrot-clean
from sympy.solvers.decompogen import decompogen, compogen from sympy import sin, cos, sqrt, Abs from sympy import symbols from sympy.utilities.pytest import XFAIL, raises x, y = symbols('x y') def test_decompogen(): assert decompogen(sin(cos(x)), x) == [sin(x), cos(x)] assert decompogen(sin(x)**2 + sin(x) + 1...
unknown
codeparrot/codeparrot-clean
console.log(require("../dll/alpha")); console.log(require("../dll/a")); console.log(require("beta/beta")); console.log(require("beta/b")); console.log(require("beta/c")); console.log(require("module"));
javascript
github
https://github.com/webpack/webpack
examples/dll-user/example.js
# This file is NOT licensed under the GPLv3, which is the license for the rest # of YouCompleteMe. # # Here's the license text for this file: # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either...
unknown
codeparrot/codeparrot-clean
class OrderedDict(dict): """ A dictionary that keeps its keys in the order in which they're inserted. Copied from Django's SortedDict with some modifications. """ def __new__(cls, *args, **kwargs): instance = super(OrderedDict, cls).__new__(cls, *args, **kwargs) instance.keyOrder =...
unknown
codeparrot/codeparrot-clean
//===--- ImportType.cpp - Import Clang Types ------------------------------===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2018 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/ClangImporter/ImportType.cpp
# Converted from RDS_Snapshot_On_Delete.template located at: # http://aws.amazon.com/cloudformation/aws-cloudformation-templates/ from troposphere import GetAtt, Join, Output from troposphere import Template from troposphere.rds import DBInstance t = Template() t.add_version("2010-09-09") t.add_description( "AW...
unknown
codeparrot/codeparrot-clean
""" Form components for working with trees. """ from django import forms from django.forms.forms import NON_FIELD_ERRORS from django.forms.util import ErrorList from django.utils.encoding import smart_unicode from django.utils.translation import ugettext_lazy as _ from mptt.exceptions import InvalidMove __all__ = ('T...
unknown
codeparrot/codeparrot-clean
#! python import sys import os import socket import thread import math try: import cryptoIDlib cryptoIDlibLoaded = True except: cryptoIDlibLoaded = False if __name__ != "__main__": raise "This must be run as a command, not used as a module!" from tlslite.api import * if len(sys.argv) == 1 or (len(s...
unknown
codeparrot/codeparrot-clean
// This code has been modified from its original form by The Cockroach Authors. // All modifications are Copyright 2024 The Cockroach Authors. // // Copyright 2015 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. /...
go
github
https://github.com/cockroachdb/cockroach
pkg/raft/raft.go
# Copyright 2013 NTT Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # # Scans the .test files on the command line and parses each, running # the tests listed. Results are printed out. # # This could all be done with bash, but I wanted to use python. =) # Anyway, this was all done while waiting in the Denver airport. # * @author Guy Maurel since version 0.62 for ...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import cstr from frappe import _ from frappe.model.document import Document class CustomField(Document): def autoname(self): self.set_fieldname...
unknown
codeparrot/codeparrot-clean
# Copyright The IETF Trust 2007, All Rights Reserved # Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). # All rights reserved. Contact: Pasi Eronen <pasi.eronen@nokia.com> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
unknown
codeparrot/codeparrot-clean
"""Store and retrieve wheel signing / verifying keys. Given a scope (a package name, + meaning "all packages", or - meaning "no packages"), return a list of verifying keys that are trusted for that scope. Given a package name, return a list of (scope, key) suggested keys to sign that package (only the verifying keys;...
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
import sys import os import json import inspect import subprocess import site from setuptools import setup from distutils import log from distutils.command.install import install from distutils.sysconfig import get_python_lib try: # Python 3 from urllib.request import urlretrieve except ImportError: # Pyt...
unknown
codeparrot/codeparrot-clean
import inspect import logging from datetime import datetime from functools import lru_cache, wraps from itertools import zip_longest from numbers import Number from typing import Any, List, Optional, Set, Union import numpy as np import pandas as pd from dateutil.parser import parse from scipy import stats from great...
unknown
codeparrot/codeparrot-clean
from django.db.models.signals import post_save,m2m_changed, pre_delete from django.contrib.comments.signals import comment_was_posted from django.contrib.comments.models import Comment from django.contrib.contenttypes.models import ContentType from planet.models import Feed, Post from actstream import action, follow fr...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python from .main import * from .transaction import * from .bci import * from .deterministic import * from .blocks import * # Takes privkey, address, value (satoshis), fee (satoshis) def send(frm, to, value, fee=10000): return sendmultitx(frm, to + ":" + str(value), fee) # Takes privkey, "address1:valu...
unknown
codeparrot/codeparrot-clean
""" Django settings for testproject project. Generated by 'django-admin startproject' using Django 1.11.8. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ impor...
unknown
codeparrot/codeparrot-clean
''' Camera ====== The :class:`Camera` is to capture pictures and make videos. .. note:: - On Android the `CAMERA` , `WRITE_EXTERNAL_STORAGE`, `READ_EXTERNAL_STORAGE` permissions are needed. Simple Examples --------------- Setup callback function. >>> from os.path import exists, join >>> f...
unknown
codeparrot/codeparrot-clean
/* * Copyright 2002-present the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required b...
java
github
https://github.com/spring-projects/spring-framework
framework-docs/src/main/java/org/springframework/docs/integration/observability/jms/process/JmsConfiguration.java
/* Copyright 2018 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/common_runtime/eager/context.h
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Console; use Symfony\Comp...
php
github
https://github.com/symfony/symfony
src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Console/AutoTaggedValueResolver.php
#! /usr/bin/env python """ :: cm config ------------ Command to generate rc files from our cloudmesh configuration files. Usage: cm defaults [FILENAME] - stores also alias cm defaults clear - clears the defaults cm set PREFIX INDEX - automatic index index must be of the form 00001 from which to ...
unknown
codeparrot/codeparrot-clean
from tests import BaseTestCase from redash.models import Alert, AlertSubscription, db class TestAlertResourceGet(BaseTestCase): def test_returns_200_if_allowed(self): alert = self.factory.create_alert() rv = self.make_request('get', "/api/alerts/{}".format(alert.id)) self.assertEqual(rv.s...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/ruby # -*- Ruby -*- # $Id: nestedloop-ruby.code,v 1.4 2004/11/13 07:42:22 bfulgham Exp $ # http://www.bagley.org/~doug/shootout/ # from Avi Bryant n = 16 # Integer(ARGV.shift || 1) x = 0 n.times do n.times do n.times do n.times do n.times do n.time...
ruby
github
https://github.com/ruby/ruby
benchmark/so_nested_loop.rb
# Generated by h2py from /usr/include/sys/stropts.h # Included from sys/feature_tests.h # Included from sys/isa_defs.h _CHAR_ALIGNMENT = 1 _SHORT_ALIGNMENT = 2 _INT_ALIGNMENT = 4 _LONG_ALIGNMENT = 8 _LONG_LONG_ALIGNMENT = 8 _DOUBLE_ALIGNMENT = 8 _LONG_DOUBLE_ALIGNMENT = 16 _POINTER_ALIGNMENT = 8 _MAX_ALIGNMENT = 16 _...
unknown
codeparrot/codeparrot-clean
"""SCons.Executor A module for executing actions with specific lists of target and source Nodes. """ # # Copyright (c) 2001 - 2014 The SCons Foundation # # 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...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # # Copyright (C) 2015 Matt Martz <matt@sivel.net> # Copyright (C) 2015 Rackspace US, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of ...
unknown
codeparrot/codeparrot-clean
<?php namespace Illuminate\Database; use Exception; use Illuminate\Database\Query\Grammars\PostgresGrammar as QueryGrammar; use Illuminate\Database\Query\Processors\PostgresProcessor; use Illuminate\Database\Schema\Grammars\PostgresGrammar as SchemaGrammar; use Illuminate\Database\Schema\PostgresBuilder; use Illumina...
php
github
https://github.com/laravel/framework
src/Illuminate/Database/PostgresConnection.php
#!/usr/bin/python ### # Copyright (c) 2002-2005, Jeremiah Fincher # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # ...
unknown
codeparrot/codeparrot-clean
"use strict"; const path = require("path"); /** @type {import("webpack").Configuration} */ const config = { output: { path: path.join(__dirname, "dist"), filename: "output.js" }, stats: "summary" }; module.exports = config;
javascript
github
https://github.com/webpack/webpack
examples/stats-summary/webpack.config.js
/* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the "Elastic License * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side * Public License v 1"; you may not use this file except in compliance with, ...
java
github
https://github.com/elastic/elasticsearch
distribution/tools/server-cli/src/main/java/org/elasticsearch/server/cli/ServerProcess.java
# frozen_string_literal: true class Membership < ActiveRecord::Base enum :type, %i(Membership CurrentMembership SuperMembership SelectedMembership TenantMembership) belongs_to :member belongs_to :club has_one :sponsor, through: :club belongs_to :simple_member, foreign_key: "member_id" end class CurrentMemb...
ruby
github
https://github.com/rails/rails
activerecord/test/models/membership.rb
# # 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/api_fastapi/core_api/services/ui/task_group.py
import type { Snippet } from 'svelte'; const return_type: ReturnType<Snippet> = null as any; // @ts-expect-error const a: Snippet<{ text: string }> = () => {}; // @ts-expect-error const b: Snippet<boolean> = (a, b) => { return return_type; }; // @ts-expect-error const c: Snippet<boolean> = (a: string) => { return r...
typescript
github
https://github.com/sveltejs/svelte
packages/svelte/tests/types/snippet.ts
import uuid from django.db import models from editormd.models import EditorMdField from mptt.models import MPTTModel, TreeForeignKey import reversion from django.conf import settings class Version(MPTTModel): id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) name = models.CharField(ma...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
unknown
codeparrot/codeparrot-clean
# (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
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
unknown
codeparrot/codeparrot-clean
/*------------------------------------------------------------------------- * * walmethods.c - implementations of different ways to write received wal * * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group * * IDENTIFICATION * src/bin/pg_basebackup/walmethods.c *---------------------------...
c
github
https://github.com/postgres/postgres
src/bin/pg_basebackup/walmethods.c
""" Copyright (c) 2013 The Regents of the University of California, AMERICAN INSTITUTES FOR RESEARCH All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the abo...
unknown
codeparrot/codeparrot-clean
import contextlib import json import shutil import socket import tarfile import tempfile import threading import pytest import six from six.moves import BaseHTTPServer from six.moves import socketserver import docker from .. import helpers BUSYBOX = helpers.BUSYBOX class ListImagesTest(helpers.BaseTestCase): d...
unknown
codeparrot/codeparrot-clean
//// [tests/cases/compiler/cannotInvokeNewOnIndexExpression.ts] //// //// [cannotInvokeNewOnIndexExpression.ts] var test: any[] = new any[1]; //// [cannotInvokeNewOnIndexExpression.js] "use strict"; var test = new any[1];
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/cannotInvokeNewOnIndexExpression.js
import numpy as np import unittest import chainer from chainer import testing from chainer.testing import attr from chainercv.experimental.links.model.fcis import FCIS from chainercv.utils import assert_is_instance_segmentation_link from chainercv.utils import generate_random_bbox def _random_array(xp, shape): r...
unknown
codeparrot/codeparrot-clean
# Copyright 2010-2011 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...
unknown
codeparrot/codeparrot-clean
"""distutils.dist Provides the Distribution class, which represents the module distribution being built/installed/distributed. """ # This module should be kept compatible with Python 2.1. __revision__ = "$Id: dist.py 38697 2005-03-23 18:54:36Z loewis $" import sys, os, string, re from types import * from copy impor...
unknown
codeparrot/codeparrot-clean
import os import shutil import socket from twisted.internet import defer from twisted.web import error from ooni import errors as e from ooni.settings import config from ooni.oonibclient import OONIBClient from ooni.tests.bases import ConfigTestCase input_id = '37e60e13536f6afe47a830bfb6b371b5cf65da66d7ad65137344679...
unknown
codeparrot/codeparrot-clean
"""All integration tests for chains."""
python
github
https://github.com/langchain-ai/langchain
libs/langchain/tests/integration_tests/chains/__init__.py
from __future__ import absolute_import import six from sentry import tagstore from sentry.testutils import APITestCase class GroupTagDetailsTest(APITestCase): def test_simple(self): group = self.create_group() group.data['tags'] = (['foo', 'bar'], ) group.save() key, value = grou...
unknown
codeparrot/codeparrot-clean
# 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. from compiled_file_system import Unicode from extensions_paths import ( API_FEATURES, JSON_TEMPLATES, MANIFEST_FEATURES, PERMISSION_FEATURES) import feat...
unknown
codeparrot/codeparrot-clean
import re import urllib.parse import requests from lxml import etree from cloudbot import hook from cloudbot.util import web, formatting # security parser = etree.XMLParser(resolve_entities=False, no_network=True) api_url = 'http://api.wolframalpha.com/v2/query' query_url = 'http://www.wolframalpha.com/input/?i={}'...
unknown
codeparrot/codeparrot-clean
#include "locking-selftest-wlock.h" #include "locking-selftest-softirq.h"
c
github
https://github.com/torvalds/linux
lib/locking-selftest-wlock-softirq.h
# Copyright 2018 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 (c) 2003-2009 Ralph Meijer # See LICENSE for details. """ Tests for L{wokkel.pubsub} """ from zope.interface import verify from twisted.trial import unittest from twisted.internet import defer from twisted.words.xish import domish from twisted.words.protocols.jabber import error from twisted.words.protoc...
unknown
codeparrot/codeparrot-clean
test_kind: js_test description: | This suite runs tests that are targeted for extensions against a two node sharded cluster. It assumes that extensions (and the corresponding .so files) have already been installed with 'install-extensions'. This suite spins up a mongos and two mongods. Collections in this suit...
unknown
github
https://github.com/mongodb/mongo
buildscripts/resmokeconfig/suites/extensions_sharded_collections.yml
#Copyright (C) 2007-2010, Erik Hetzner #This file is part of Ervin. Ervin 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. #Ervin is dis...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python import os import sys import env import apihelper print "env = %s" % str(os.environ) print os.environ['HOME'] print os.environ.get('HOME') print os.environ.get('JOB_NAME', 'job_name') print sys.prefix def pinfos(): pinfo(env) def pinfo(object): print print "---------------------------...
unknown
codeparrot/codeparrot-clean
/* * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ package io.ktor.network.util import io.ktor.network.sockets.* import kotlinx.cinterop.ExperimentalForeignApi import kotlinx.cinterop.convert import platform.posix.AF_UNIX internal val SocketAd...
kotlin
github
https://github.com/ktorio/ktor
ktor-network/posix/src/io/ktor/network/util/SocketAddressUtils.kt
import * as React from "react"; import * as TestRenderer from "react-test-renderer"; import { MemoryRouter, useLocation } from "react-router"; describe("<Router>", () => { let consoleError: jest.SpyInstance; beforeEach(() => { consoleError = jest.spyOn(console, "error").mockImplementation(() => {}); }); a...
typescript
github
https://github.com/remix-run/react-router
packages/react-router/__tests__/Router-test.tsx
from cgi import escape import gzip as gzip_module import re import time import types import uuid from cStringIO import StringIO def resolve_content(response): return b"".join(item for item in response.iter_content(read_file=True)) class Pipeline(object): pipes = {} def __init__(self, pipe_string): ...
unknown
codeparrot/codeparrot-clean
# -*- encoding: utf-8 -*- # Module iadist from numpy import * from string import upper from iasecross import iasecross def iadist(f, Bc=iasecross(), METRIC=None): from iagray import iagray from iaintersec import iaintersec from iaisequal import iaisequal from iaero import iaero from iasebox import...
unknown
codeparrot/codeparrot-clean
/* Written in 2015 by Sebastiano Vigna (vigna@acm.org) To the extent possible under law, the author has dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty. See <http://creativecommons.org/publicdomain/zero/1.0/...
c
github
https://github.com/numpy/numpy
numpy/random/src/splitmix64/splitmix64.orig.c
use tokio_stream::{self as stream, StreamExt}; use tokio_test::{assert_pending, assert_ready, assert_ready_err, assert_ready_ok, task}; mod support { pub(crate) mod mpsc; } use support::mpsc; #[allow(clippy::let_unit_value)] #[tokio::test] async fn empty_unit() { // Drains the stream. let mut iter = vec!...
rust
github
https://github.com/tokio-rs/tokio
tokio-stream/tests/stream_collect.rs
""" 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 this ...
unknown
codeparrot/codeparrot-clean
# # Author: Gregory Fleischer (gfleischer@gmail.com) # # Copyright (c) 2011 RAFT Team # # This file is part of RAFT. # # RAFT 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
# -*- coding: utf-8 -*- # # # TheVirtualBrain-Scientific Package. This package holds all simulators, and # analysers necessary to run brain-simulations. You can use it stand alone or # in conjunction with TheVirtualBrain-Framework Package. See content of the # documentation-folder for more details. See also http://www....
unknown
codeparrot/codeparrot-clean
/// Rounds the number toward 0 to the closest integral value (f16). /// /// This effectively removes the decimal part of the number, leaving the integral part. #[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)] pub fn truncf16(x: f16) -> f16 { super::generic::trunc(x) }
rust
github
https://github.com/nodejs/node
deps/crates/vendor/libm/src/math/truncf16.rs
from twisted.internet import reactor, ssl from twisted.web.server import Site from web_server import ServicesPage from share_server import ShareServerFactory from share_manager import ShareManager from conf import Conf from session_manager import SessionManager import getpass class MySite(Site): def getResourceF...
unknown
codeparrot/codeparrot-clean
//===--- ProtocolConformanceRef.h - AST Protocol Conformance ----*- 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/AST/ProtocolConformanceRef.h
""" cclib (http://cclib.sf.net) is (c) 2006, the cclib development team and licensed under the LGPL (http://www.gnu.org/copyleft/lgpl.html). """ __revision__ = "$Revision: 865 $" def convertor(value, fromunits, tounits): """Convert from one set of units to another. >>> print "%.1f" % convertor(8, "eV", "cm-1...
unknown
codeparrot/codeparrot-clean
from json import dumps from webtest import TestApp from six import b as b_ from pecan import Pecan, expose, abort from pecan.tests import PecanTestCase class TestGeneric(PecanTestCase): def test_simple_generic(self): class RootController(object): @expose(generic=True) def index(s...
unknown
codeparrot/codeparrot-clean
"""Manage shelves of pickled objects. A "shelf" is a persistent, dictionary-like object. The difference with dbm databases is that the values (not the keys!) in a shelf can be essentially arbitrary Python objects -- anything that the "pickle" module can handle. This includes most class instances, recursive data type...
unknown
codeparrot/codeparrot-clean
# See readme.md for instructions on running this code. class FollowupHandler(object): ''' This plugin facilitates creating follow-up tasks when you are using Zulip to conduct a virtual meeting. It looks for messages starting with '@mention-bot'. In this example, we write follow up items to a spec...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env bash # Copyright 2020 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 applica...
unknown
github
https://github.com/kubernetes/kubernetes
hack/module-graph.sh
#!/usr/bin/python # (c) 2016, Timothy Vandenbrande <timothy.vandenbrande@gmail.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.0', ...
unknown
codeparrot/codeparrot-clean
import math import numpy as np FULL_RANGE = 1024 class VectoringThrusterData(object): def __init__(self, position, axis, start, angle, offset, _reversed = False): vector_axis = np.array(axis) vector_1 = np.array(start) self.vector_axis = vector_axis / np.linalg.norm(vector_axis) self.force_1 = vecto...
unknown
codeparrot/codeparrot-clean
#------------------------------------------------------------------------------- # elftools: elf/structs.py # # Encapsulation of Construct structs for parsing an ELF file, adjusted for # correct endianness and word-size. # # Eli Bendersky (eliben@gmail.com) # This code is in the public domain #-------------------------...
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/migrations/versions/0077_3_1_0_add_trigger_id_to_deadline.py
import configparser import json import logging import subprocess import sys from dataclasses import dataclass from pprint import pformat from typing import Any, List import bottle logging.basicConfig(stream=sys.stdout, level=logging.INFO, format='%(asctime)-15s %(levelname)s: %(message)s') log = l...
unknown
codeparrot/codeparrot-clean
/* * Copyright 2002-present the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required b...
java
github
https://github.com/spring-projects/spring-framework
spring-beans/src/main/java/org/springframework/beans/factory/parsing/AliasDefinition.java
# postgresql/__init__.py # Copyright (C) 2005-2020 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from . import base from . import pg8000 # noqa from . import psycopg2 # noq...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # # 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 # w...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. """ module used to build the django wsgi application """ from __future__ import print_function import os import re import sys import time try: from StringIO import StringIO except: fr...
unknown
codeparrot/codeparrot-clean
<!--- Copyright 2025 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ...
unknown
github
https://github.com/huggingface/transformers
MIGRATION_GUIDE_V5.md
# # Module which supports allocation of memory from an mmap # # multiprocessing/heap.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # import bisect import mmap import os import sys import tempfile import threading from . import context from . import reduction from . import ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python3 # Copyright (c) 2014-2020 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 the -alertnotify, -blocknotify and -walletnotify options.""" import os from test_framework.addres...
unknown
codeparrot/codeparrot-clean
from ctypes.util import find_library from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db.backends.sqlite3.base import ( _sqlite_extract, _sqlite_date_trunc, _sqlite_regexp, _sqlite_format_dtdelta, connection_created, Database, DatabaseWrapper as SQLiteDatabas...
unknown
codeparrot/codeparrot-clean
# # ElementTree # $Id$ # # A simple XML tree builder, based on the sgmlop library. # # Note that this version does not support namespaces. This may be # changed in future versions. # # history: # 2004-03-28 fl created # # Copyright (c) 1999-2004 by Fredrik Lundh. All rights reserved. # # fredrik@pythonware.com # ht...
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
# 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