code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
#!/usr/bin/env python
# encoding: utf-8
# (c) Siddharth Bharat Purohit, 3DRobotics Inc.
"""
The **mavgen.py** program is a code generator which creates mavlink header files.
"""
from waflib import Logs, Task, Utils, Node
from waflib.TaskGen import feature, before_method, extension
import os, sys
import os.path
from x... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2019 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/jit/xla_activity_listener.h |
# Tweepy
# Copyright 2010 Joshua Roesslein
# See LICENSE for details.
from datetime import datetime
import time
import htmlentitydefs
import re
import locale
from urllib import quote
def parse_datetime(string):
# Set locale for date parsing
locale.setlocale(locale.LC_TIME, 'C')
# We must parse datetime t... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
# pylint: disable=R0201,E1101,W0232,R0904
#
# Copyright 2015 by Leipzig University Library, http://ub.uni-leipzig.de
# by The Finc Authors, http://finc.info
# by Martin Czygan, <martin.czygan@uni-leipzig.de>
#
# This file is part of some open source application.
#
# Some... | unknown | codeparrot/codeparrot-clean | ||
#!env/python3
# coding: utf-8
import ipdb
import os
import json
import datetime
import uuid
import psycopg2
import hashlib
import asyncio
import ped_parser
from config import *
from core.framework.common import *
from core.model import *
# =============================================================================... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-boot | core/spring-boot/src/main/java/org/springframework/boot/logging/logback/Extractor.java |
# coding: utf-8
"""
OpenAPI spec version:
Generated by: https://github.com/swagger-api/swagger-codegen.git
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.... | unknown | codeparrot/codeparrot-clean | ||
from django.db.models import F
from django.test import TestCase
from .models import Comment, Tenant, User
class CompositePKOrderByTests(TestCase):
maxDiff = None
@classmethod
def setUpTestData(cls):
cls.tenant_1 = Tenant.objects.create()
cls.tenant_2 = Tenant.objects.create()
cls.... | python | github | https://github.com/django/django | tests/composite_pk/test_order_by.py |
# coding: utf-8
import datetime
from django.core.validators import RegexValidator
from django.db import models
from django.urls import reverse
from django.utils.html import format_html
from django.utils.safestring import mark_safe
from django.utils.translation import gettext_lazy as _
from . import managers
from spec... | unknown | codeparrot/codeparrot-clean | ||
"""
URLs for the certificates app.
"""
from django.conf import settings
from django.conf.urls import url
from lms.djangoapps.certificates import views
app_name = 'certificates'
urlpatterns = [
# Certificates HTML view end point to render web certs by user and course
url(
r'^user/(?P<user_id>[^/]*)/co... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2019 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | java | github | https://github.com/google/guava | android/guava/src/com/google/common/io/IgnoreJRERequirement.java |
## Input
```javascript
function Component(props) {
const x = [];
x.push(props.value);
const {length: y} = x;
foo(y);
return [x, y];
}
```
## Code
```javascript
import { c as _c } from "react/compiler-runtime";
function Component(props) {
const $ = _c(5);
let x;
if ($[0] !== props.value) {
x = []... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructuring-property-inference.expect.md |
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*
Copyright 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... | go | github | https://github.com/kubernetes/kubernetes | pkg/apis/resource/v1beta1/zz_generated.validations.go |
#
# Copyright 2010-2015 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0
#
# or in the "license" file ... | 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 appl... | unknown | codeparrot/codeparrot-clean | ||
---
title: Defining recording rules
nav_title: Recording rules
sort_rank: 2
---
## Configuring rules
Prometheus supports two types of rules which may be configured and then
evaluated at regular intervals: recording rules and [alerting
rules](alerting_rules.md). To include rules in Prometheus, create a file
containing... | unknown | github | https://github.com/prometheus/prometheus | docs/configuration/recording_rules.md |
#!/usr/bin/env python
# Author: Jon Trulson <jtrulson@ics.com>
# Copyright (c) 2015 Intel Corporation.
#
# 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
# witho... | unknown | codeparrot/codeparrot-clean | ||
% This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it.
**Description**
Returns the median absolute deviation, a measure of variability. It is a robust statistic, meaning that it is useful for describing data that may have outliers, or may not be normally dis... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/query-languages/esql/_snippets/functions/description/median_absolute_deviation.md |
#!/usr/bin/python
# Copyright 2013 Google 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 vers... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""
(c) 2002, 2003, 2004, 2005 Simon Burton <simon@arrowtheory.com>
Released under GNU LGPL license.
"""
import sys
from lexer import Lexer
from parse_core import Symbols, Parser
import node as node_module
class Node(node_module.Node):
def is_typedef(self):
for x in self:
if isi... | unknown | codeparrot/codeparrot-clean | ||
from django.test import TestCase
from .models import Article, Author, Comment, Forum, Post, SystemInfo
class NullFkOrderingTests(TestCase):
def test_ordering_across_null_fk(self):
"""
Regression test for #7512
ordering across nullable Foreign Keys shouldn't exclude results
"""
... | 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-cloud-storage-project/hadoop-huaweicloud/src/test/java/org/apache/hadoop/fs/obs/TestOBSFileContextMainOperations.java |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks 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 | ||
# -*- coding: utf-8 -*-
"""
celery.task.sets
~~~~~~~~~~~~~~~~
Creating and applying groups of tasks.
:copyright: (c) 2009 - 2012 by Ask Solem.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from __future__ import with_statement
from .. import registry
fro... | unknown | codeparrot/codeparrot-clean | ||
#![warn(rust_2018_idioms)]
#![cfg(all(feature = "full", unix, not(miri)))]
use tokio::process::Command;
#[tokio::test]
async fn arg0() {
let mut cmd = Command::new("sh");
cmd.arg0("test_string").arg("-c").arg("echo $0");
let output = cmd.output().await.unwrap();
assert_eq!(output.stdout, b"test_strin... | rust | github | https://github.com/tokio-rs/tokio | tokio/tests/process_arg0.rs |
"Base Cache class."
from __future__ import unicode_literals
import time
import warnings
from django.core.exceptions import ImproperlyConfigured, DjangoRuntimeWarning
from django.utils.module_loading import import_string
class InvalidCacheBackendError(ImproperlyConfigured):
pass
class CacheKeyWarning(DjangoRunti... | unknown | codeparrot/codeparrot-clean | ||
"""Miscellaneous functions for testing masked arrays and subclasses
:author: Pierre Gerard-Marchant
:contact: pierregm_at_uga_dot_edu
"""
import operator
import numpy as np
import numpy._core.umath as umath
import numpy.testing
from numpy import ndarray
from numpy.testing import ( # noqa: F401
assert_,
asse... | python | github | https://github.com/numpy/numpy | numpy/ma/testutils.py |
# -*- coding: utf-8 -*-
"""
pygments.lexers.make
~~~~~~~~~~~~~~~~~~~~
Lexers for Makefiles and similar.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, include, bygroups, \
... | unknown | codeparrot/codeparrot-clean | ||
services:
next-app:
container_name: next-app
build:
context: ./next-app
dockerfile: dev.Dockerfile
# Set environment variables directly in the compose file
environment:
ENV_VARIABLE: ${ENV_VARIABLE}
NEXT_PUBLIC_ENV_VARIABLE: ${NEXT_PUBLIC_ENV_VARIABLE}
# Set environment v... | unknown | github | https://github.com/vercel/next.js | examples/with-docker-compose/compose.dev.yaml |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe, unittest, os
from frappe.utils import cint
from frappe.model.naming import revert_series_if_last, make_autoname, parse_naming_series
class TestDocument(unittest.Te... | unknown | codeparrot/codeparrot-clean | ||
from threading import Thread, Timer
from socket import socket, AF_INET, SOCK_DGRAM
from urllib2 import urlopen
import time
import re
#------------------_EVT_ACTIONS----------------------#
ERR_TIMEOUT = 'e0'
ERR_BAD_RCON_PASSWORD = 'e1'
EVT_CHAT = 'ev0'
EVT_ELIM = 'ev1'
EVT_RESPAWN = 'ev2'
EVT_MAPCHANGE = 'ev3'
EVT_DATE... | unknown | codeparrot/codeparrot-clean | ||
/* Small bzip2 deflate implementation, by Rob Landley (rob@landley.net).
Based on bzip2 decompression code by Julian R Seward (jseward@acm.org),
which also acknowledges contributions by Mike Burrows, David Wheeler,
Peter Fenwick, Alistair Moffat, Radford Neal, Ian H. Witten,
Robert Sedgewick, and Jon L. Bentley.
... | c | github | https://github.com/torvalds/linux | lib/decompress_bunzip2.c |
from math import pi
from sympy.core import sympify
from sympy.functions.elementary.trigonometric import sin, cos
def fn(n, z):
"""
Coefficients for the spherical Bessel functions.
Those are only needed in the jn() function.
The coefficients are calculated from:
fn(0, z) = 1/z
fn(1, z) = 1/z... | unknown | codeparrot/codeparrot-clean | ||
use crate::spec::{Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::hurd_gnu::opts();
base.cpu = "pentium4".into();
base.max_atomic_width = Some(64);
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m32"]);... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_target/src/spec/targets/i686_unknown_hurd_gnu.rs |
/*
* Copyright 2010-2026 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.symbols.pointers
import org.jetbrains.kotlin.analysis.api.fir.K... | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/symbols/pointers/KaFirJavaSyntheticPropertyAccessorFunctionSymbolPointer.kt |
# Copyright 2011 University of Southern California
# 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
#
# ... | unknown | codeparrot/codeparrot-clean | ||
'''
ustvnow XBMC Plugin
Copyright (C) 2013 ddurdle
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 the License, or
(at your option) any later version.
... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
#
# = open3.rb: Popen, but with stderr, too
#
# Author:: Yukihiro Matsumoto
# Documentation:: Konrad Meyer
#
# Open3 gives you access to stdin, stdout, and stderr when running other
# programs.
#
#
# Open3 grants you access to stdin, stdout, stderr and a thread to wait for the
# child pr... | ruby | github | https://github.com/ruby/ruby | lib/open3.rb |
###############################################################################
###
### Data container class definitions for the MRTOnline script
### Author: Nathanael Lampe
### Created: June 2015
### Last Modified: June 16, 2015
###
### Brief summary:
### MRT tables are a well defined standard used in astrophysi... | unknown | codeparrot/codeparrot-clean | ||
#pragma once
#include <c10/core/Device.h>
#include <c10/util/Exception.h>
#include <c10/util/Registry.h>
#include <ATen/detail/AcceleratorHooksInterface.h>
C10_DIAGNOSTIC_PUSH_AND_IGNORED_IF_DEFINED("-Wunused-parameter")
namespace at {
namespace xpu {
// Forward-declares at::xpu::LevelZero
struct LevelZero;
} // n... | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/detail/XPUHooksInterface.h |
# Python test set -- part 1, grammar.
# This just tests whether the parser accepts them all.
from test.test_support import run_unittest, check_syntax_error, \
check_py3k_warnings
import unittest
import sys
# testing import *
from sys import *
class TokenTests(unittest.TestCase):
def... | unknown | codeparrot/codeparrot-clean | ||
import logging
from autotest.client.shared import error
from virttest import virsh, utils_libvirtd
def run_virsh_domname(test, params, env):
"""
Test command: virsh domname <id/uuid>.
1) Prepare libvirtd status and test environment.
2) Try to get domname through valid and invalid command.
3) Recov... | unknown | codeparrot/codeparrot-clean | ||
{"files":{"Cargo.toml":"1564fee10504e497a68aad04f7a6ebacb467956f4a50a85415227eaafa55b96e","LICENSE":"9ebf8c4cc0b735ca13a766451f7b8097db3185975ceb2ba94b5abf439156a91f","README.md":"cf4421c888471876bf715ce49aabe59ace32d165b1cd9878fa8d8f5ecd005fc1","src/lib.rs":"3ccbc7d11f612c33b8e5beb966ebda4aee777132ac1568c6a9f77a3d5fe0... | json | github | https://github.com/nodejs/node | deps/crates/vendor/core_maths/.cargo-checksum.json |
# Copyright (c) 2012 Adam Stokes <adam.stokes@canonical.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 Foundation; either version 2 of the License, or
# (at your option) any later version.
# This pro... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2016 The etcd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed t... | go | github | https://github.com/etcd-io/etcd | client/pkg/transport/tls.go |
// RUN: %check_clang_tidy %s bugprone-inaccurate-erase %t
namespace std {
template <typename T> struct vec_iterator {
T ptr;
vec_iterator operator++(int);
template <typename X>
vec_iterator(const vec_iterator<X> &); // Omit enable_if<...>.
};
template <typename T> struct vector {
typedef vec_iterator<T*> i... | cpp | github | https://github.com/llvm/llvm-project | clang-tools-extra/test/clang-tidy/checkers/bugprone/inaccurate-erase.cpp |
# encoding: 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):
# Adding field 'DocRelationshipName.revname'
db.add_column('name_docrelationshipname', 'revname', self.gf('django.... | unknown | codeparrot/codeparrot-clean | ||
"""
===========================
Read/Write streamline files
===========================
Overview
========
dipy_ can read and write many different file formats. In this example
we give a short introduction on how to use it for loading or saving streamlines.
Read :ref:`faq`
"""
import numpy as np
from dipy.data imp... | unknown | codeparrot/codeparrot-clean | ||
#!/bin/bash
set -e
set -x
if [[ "$GITHUB_EVENT_NAME" == "schedule" \
|| "$GITHUB_EVENT_NAME" == "workflow_dispatch" ]]; then
ANACONDA_ORG="scientific-python-nightly-wheels"
ANACONDA_TOKEN="$SCIKIT_LEARN_NIGHTLY_UPLOAD_TOKEN"
else
ANACONDA_ORG="scikit-learn-wheels-staging"
ANACONDA_TOKEN="$SC... | unknown | github | https://github.com/scikit-learn/scikit-learn | build_tools/github/upload_anaconda.sh |
# -*- coding: utf-8 -*-
# Copyright (c) 2012 Thomas Parslow http://almostobsolete.net/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation th... | 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 | ||
from django.conf.urls import patterns, include, url
from django.conf.urls.i18n import i18n_patterns
from django.contrib import admin
from django.conf import settings
admin.autodiscover()
import django.contrib.auth.urls
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'myapp.views.home', name='home'),
#... | unknown | codeparrot/codeparrot-clean | ||
from datetime import (
datetime,
timezone,
)
import zoneinfo
import numpy as np
from pandas import Timestamp
from .tslib import _tzs
class TimestampConstruction:
def setup(self):
self.npdatetime64 = np.datetime64("2020-01-01 00:00:00")
self.dttime_unaware = datetime(2020, 1, 1, 0, 0, 0)
... | python | github | https://github.com/pandas-dev/pandas | asv_bench/benchmarks/tslibs/timestamp.py |
# Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# <Lettuce - Behaviour Driven Development for python>
# Copyright (C) <2010-2011> Gabriel Falcão <gabriel@nacaolivre.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 Foundatio... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright 2005 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... | unknown | codeparrot/codeparrot-clean | ||
import re
import numpy as np
import pytest
from pandas._libs.tslibs import Timestamp
import pandas as pd
from pandas import (
DataFrame,
HDFStore,
Index,
MultiIndex,
Series,
_testing as tm,
concat,
date_range,
)
from pandas.util import _test_decorators as td
pytestmark = [pytest.mark... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/io/pytables/test_put.py |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | unknown | codeparrot/codeparrot-clean | ||
"""
This module implements a class which returns the appropriate Response class
based on different criteria.
"""
from mimetypes import MimeTypes
from pkgutil import get_data
from io import StringIO
import six
from scrapy.http import Response
from scrapy.utils.misc import load_object
from scrapy.utils.python import i... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2020-present 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... | python | github | https://github.com/huggingface/transformers | src/transformers/trainer_utils.py |
# Copyright 2017, Google LLC All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/conformance/moduleResolution/bundler/bundlerSyntaxRestrictions.ts] ////
//// [index.d.ts]
declare var require: (...args: any[]) => any;
//// [ambient.d.ts]
declare module "fs" {
export function readFileSync(path: string, encoding?: string): string;
}
declare module "path" {
import fs = requi... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/bundlerSyntaxRestrictions(module=esnext).js |
/*
* jidctfst.c
*
* Copyright (C) 1994-1998, Thomas G. Lane.
* Modified 2015-2017 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
* This file contains a fast, not so accurate integer implementation o... | c | github | https://github.com/opencv/opencv | 3rdparty/libjpeg/jidctfst.c |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python2.7
# Copyright 2016, 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 lis... | unknown | codeparrot/codeparrot-clean | ||
"""Documention for writing gamemodules.
A game server module is a python module in the gamemodules package somewhere
the python import mechanism can find it. It defines various attributes and
functions that provide the functionality for that particular game server.
The attributes and functions that can be specified i... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# (c) 2018, 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 | ||
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
DOCUMENTATION = """
options:
display_skipped_hosts:
name: Show skipped hosts
description: "Toggle to control displaying skipped task/ho... | unknown | codeparrot/codeparrot-clean | ||
'use strict';
const common = require('../common.js');
const { posix } = require('path');
const bench = common.createBenchmark(main, {
paths: [
['/data/orandea/test/aaa', '/data/orandea/impl/bbb'].join('|'),
['/', '/var'].join('|'),
['/', '/'].join('|'),
['/var', '/bin'].join('|'),
['/foo/bar/baz/... | javascript | github | https://github.com/nodejs/node | benchmark/path/relative-posix.js |
import unittest, time, sys, random
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i
def write_syn_dataset(csvPathname, rowCount, headerData):
dsf = open(csvPathname, "w+")
# output is just 0 or 1 randomly
dsf.write(headerData + "\n")
# add random output. just ... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-boot | configuration-metadata/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/inheritance/ChildPropertiesConfig.java |
# Reporting Security Issues
The Bootstrap team and community take security issues in Bootstrap seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions.
To report a security issue, email [security@getbootstrap.com](mailto:security@getboo... | unknown | github | https://github.com/twbs/bootstrap | SECURITY.md |
/* Copyright (c) 2016, 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 Foundation.
This program is designed to work with certain software (including
but not lim... | c | github | https://github.com/mysql/mysql-server | components/libminchassis/mysql_component_imp.h |
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
mod listener;
pub(crate) mod plugin;
use std::{convert::Infallible, str::FromStr};
pub(crate) use listener::Listeners;
use serde::{Deserialize, Serialize};
mod event_name;
pub... | rust | github | https://github.com/tauri-apps/tauri | crates/tauri/src/event/mod.rs |
# -*- test-case-name: twisted.conch.test.test_cftp -*-
# Copyright (c) 2001-2009 Twisted Matrix Laboratories.
# See LICENSE file for details.
"""
Tests for L{twisted.conch.scripts.cftp}.
"""
import locale
import time, sys, os, operator, getpass, struct
from StringIO import StringIO
from twisted.conch.test.test_ssh i... | unknown | codeparrot/codeparrot-clean | ||
import os
import socket
import sys
import csv
LB_BASE_DIR = '/var/lib/contrail/loadbalancer/'
STATS_MAP = {
'active_connections': 'qcur',
'max_connections': 'qmax',
'current_sessions': 'scur',
'max_sessions': 'smax',
'total_sessions': 'stot',
'bytes_in': 'bin',
'bytes_out': 'bout',
'co... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package addrs
import (
"testing"
"github.com/go-test/deep"
"github.com/hashicorp/hcl/v2"
"github.com/hashicorp/hcl/v2/hclsyntax"
"github.com/zclconf/go-cty/cty"
"github.com/hashicorp/terraform/internal/tfdiags"
)
func TestParseRefInTesting... | go | github | https://github.com/hashicorp/terraform | internal/addrs/parse_ref_test.go |
from ..Qt import QtGui, QtCore
__all__ = ['LayoutWidget']
class LayoutWidget(QtGui.QWidget):
"""
Convenience class used for laying out QWidgets in a grid.
(It's just a little less effort to use than QGridLayout)
"""
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
... | unknown | codeparrot/codeparrot-clean | ||
// Test SCRAM iterationCount defaults.
function runOpt(params, sha1Value, sha256Value) {
const conn = MongoRunner.runMongod({auth: "", setParameter: params});
const adminDB = conn.getDB("admin");
adminDB.createUser({user: "user1", pwd: "pass", roles: jsTest.adminUserRoles});
assert(adminDB.auth({user:... | javascript | github | https://github.com/mongodb/mongo | jstests/auth/iteration_count_defaults.js |
/*
* 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/protocol/ApiKeys.java |
# -*- coding: utf-8 -*-
#
# This file is part of EUDAT B2Share.
# Copyright (C) 2016 CERN.
#
# B2Share 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... | unknown | codeparrot/codeparrot-clean | ||
# pylearn2 tutorial example: make_dataset.py by Ian Goodfellow
# See README before reading this file
#
#
# This script creates a preprocessed version of a dataset using pylearn2.
# It's not necessary to save preprocessed versions of your dataset to
# disk but this is an instructive example, because later we can show
# ... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
import pandas
from sklearn.cross_validation import KFold
from sklearn.cross_validation import cross_val_score
from sklearn.neighbors import KNeighborsClassifier
from sklearn.preprocessing import scale
def get_k_score(x, cv, y):
res = []
for k in range(1, 51):
neigh = KNeighborsClassi... | 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/security/alias/LocalJavaKeyStoreProvider.java |
import Adafruit_BluefruitLE
from Adafruit_BluefruitLE.services import UART as OriginalUART
# from ble import uart
from ble.uart import UART
from ble.readdata import Device
import time
import atexit
import logging
log = logging.getLogger(__name__)
class App (object):
""" A high level application object.
Any applic... | unknown | codeparrot/codeparrot-clean | ||
$gutter-border: 1px solid var(--senary-contrast) !important;
as-split {
::ng-deep .as-split-gutter {
flex-basis: 5px !important;
background-color: inherit !important;
position: relative;
}
&.as-horizontal.docs-editor {
::ng-deep .as-split-gutter {
border-inline: $gutter-border;
}
}
... | unknown | github | https://github.com/angular/angular | adev/shared-docs/styles/_split.scss |
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_stream.h>
typedef struct {
in_addr_t mask;
in_addr_t addr;
ngx_uint_t deny; /* unsigned deny:1; */
} ngx_stream_access_rule_t;
#if (NGX_HAVE_INET6)
ty... | c | github | https://github.com/nginx/nginx | src/stream/ngx_stream_access_module.c |
from __future__ import unicode_literals
from django.db.models.signals import post_save, pre_save
from django.test import TestCase
from .models import Account, Employee, Person, Profile, ProxyEmployee
class UpdateOnlyFieldsTests(TestCase):
def test_update_fields_basic(self):
s = Person.objects.create(name... | unknown | codeparrot/codeparrot-clean | ||
import sys
import os
import os.path
from glob import glob
import optparse
VALGRIND_CMD = 'valgrind --tool=memcheck --leak-check=yes --undef-value-errors=yes '
def compareOutputs( expected, actual, message ):
expected = expected.strip().replace('\r','').split('\n')
actual = actual.strip().replace('\r','').spli... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2011 Camptocamp SA
# @author Guewen Baconnier
# Original code from module base_partner_merge by Tiny and Camptocamp
#
# WARNING: This program as such is intended to be used by... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/compiler/mlir/tensorflow/utils/verification_utils.h |
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Peter Sprygada <psprygada@ansible.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
# Standard files documentation fragment
DOCUMENTATION = r'''
options:
provider:
description... | unknown | codeparrot/codeparrot-clean | ||
"""
Settings for OpenStack deployments.
"""
from .aws import * # pylint: disable=wildcard-import, unused-wildcard-import
SWIFT_AUTH_URL = AUTH_TOKENS.get('SWIFT_AUTH_URL')
SWIFT_AUTH_VERSION = AUTH_TOKENS.get('SWIFT_AUTH_VERSION', 1)
SWIFT_USERNAME = AUTH_TOKENS.get('SWIFT_USERNAME')
SWIFT_KEY = AUTH_TOKENS.get('SWI... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | 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 applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/java/src/main/native/graph_jni.h |
/* Copyright 2017 - 2025 R. Thomas
* Copyright 2017 - 2025 Quarkslab
*
* 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 req... | cpp | github | https://github.com/nodejs/node | deps/LIEF/src/PE/LoadConfigurations/DynamicRelocation/FunctionOverride.cpp |
#!/usr/bin/env python
import os, util2, gen_settingsstructs, trans_langs
"""
TODO:
* for gen_langs_html, show languages that don't have enough translations
in a separate table
"""
g_version = util2.get_sumatrapdf_version()
html_tmpl = """\
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="... | unknown | codeparrot/codeparrot-clean | ||
config:
allow-labels:
- test-fips
steps:
- label: part-4-fips-140-3
command: .ci/scripts/run-gradle.sh -Dignore.tests.seed -Dtests.fips.enabled=true -Dtests.fips.mode=140-3 checkPart4
timeout_in_minutes: 300
agents:
provider: gcp
image: family/elasticsearch-ubuntu-2404
machineType:... | unknown | github | https://github.com/elastic/elasticsearch | .buildkite/pipelines/pull-request/part-4-fips-140-3.yml |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | java | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-annotations/src/main/java/org/apache/hadoop/classification/tools/HadoopDocEnvImpl.java |
// Copyright 2023 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
package server
import (
"bytes"
"sort"
"testing"
"time"
"github.com/cockroachdb/cockroach/pkg/server/serverpb"
"github.com/cockroachdb/cockroach/pkg/sql/execinfr... | go | github | https://github.com/cockroachdb/cockroach | pkg/server/distsql_flows_test.go |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.