code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
# -*- encoding: utf-8 -*-
##############################################################################
#
# Account Payment Blocking module for Odoo
# Copyright (C) 2014-2015 ACSONE SA/NV (http://acsone.eu)
# @author Adrien Peiffer <adrien.peiffer@acsone.eu>
#
# This program is free software: you can redis... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2013 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 | ||
"""riscos specific module for conversion between pathnames and URLs.
Based on macurl2path.
Do not import directly, use urllib instead."""
import string
import urllib
__all__ = ["url2pathname","pathname2url"]
__slash_dot = string.maketrans("/.", "./")
def url2pathname(url):
"""OS-specific conversion from a relat... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
from bokeh.plotting import figure, output_file, show
from bokeh.models import HoverTool, ColumnDataSource
from bokeh.sampledata.les_mis import data
# EXERCISE: try out different sort orders for the names
nodes = data['nodes']
names = [node['name'] for node in sorted(data['nodes'], key=lambda x: x['... | unknown | codeparrot/codeparrot-clean | ||
#define USE_THE_REPOSITORY_VARIABLE
#include "git-compat-util.h"
#include "gettext.h"
#include "hex.h"
#include "walker.h"
#include "repository.h"
#include "odb.h"
#include "commit.h"
#include "strbuf.h"
#include "tree.h"
#include "tree-walk.h"
#include "tag.h"
#include "blob.h"
#include "refs.h"
#include "progress.h"... | c | github | https://github.com/git/git | walker.c |
{
"html": {
"type": "Fragment",
"start": 0,
"end": 83,
"children": [
{
"type": "Element",
"start": 0,
"end": 83,
"name": "div",
"attributes": [
{
"type": "Attribute",
"start": 5,
"end": 76,
"name": "data-foo",
"name_loc": {
"start": {
"li... | json | github | https://github.com/sveltejs/svelte | packages/svelte/tests/parser-legacy/samples/attribute-escaped/output.json |
## Code of Conduct
### Our Pledge
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, educat... | unknown | github | https://github.com/vercel/next.js | CODE_OF_CONDUCT.md |
/*
* 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.
*/
#pragma once
#include <inttypes.h>
#include <clog.h>
#ifndef PYTORCH_QNNP_LOG_LEVEL
#define PYTORC... | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/quantized/cpu/qnnpack/src/qnnpack/log.h |
#pragma once
#include <complex>
#include <c10/macros/Macros.h>
#include <c10/util/Half.h>
#include <torch/headeronly/util/complex.h>
// std functions
//
// The implementation of these functions also follow the design of C++20
namespace std {
template <typename T>
constexpr T real(const c10::complex<T>& z) {
retu... | c | github | https://github.com/pytorch/pytorch | c10/util/complex.h |
"""
Enough Mach-O to make your head spin.
See the relevant header files in /usr/include/mach-o
And also Apple's documentation.
"""
def __getattr__(name):
if name == "__version__":
from warnings import _deprecated
_deprecated("__version__", remove=(3, 20))
return "1.0" # Do not change
... | python | github | https://github.com/python/cpython | Lib/ctypes/macholib/__init__.py |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import time
import sys
import os.path
import shutil
import webbrowser
import warnings
import keyring
import numpy as np
import re
from bs4 import BeautifulSoup
from six import BytesIO
import six
from astropy.table import Table, Column
from astroquery imp... | 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 | ||
# 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
import re
import json
from itertools import chain
from ansible.module_utils._text import to_te... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
from __future__ import print_function
from sympy import symbols
from sympy.galgebra import MV, Format
from sympy.galgebra import xdvi
def main():
Format()
coords = (x, y, z) = symbols('x y z')
(ex, ey, ez, grad) = MV.setup('e*x|y|z', '[1,1,1]', coords=coords)
s = MV('s', 'sca... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
# pylint: disable=F0401
import mojo.embedder
from mojo.bindings import messaging
from mojo import system
class _ForwardingConnectionErrorHa... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2012, 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2012 Isaku Yamahata <yamahata at valinux co jp>
#
# 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
#
# h... | unknown | codeparrot/codeparrot-clean | ||
import {useRef} from 'react';
function Component() {
const ref = useRef({text: {value: null}});
const inputChanged = e => {
ref.current.text.value = e.target.value;
};
return <input onChange={inputChanged} />;
}
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{}],
}; | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ref-current-field-write-not-added-to-dep.js |
# 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.
"""A module for the run command."""
import cr
class DebugCommand(cr.Command):
"""The implementation of the debug command.
This is much like the run co... | 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 u... | python | github | https://github.com/apache/airflow | airflow-core/src/airflow/dag_processing/bundles/base.py |
global:
scrape_native_histograms: true
scrape_configs:
- job_name: prometheus
static_configs:
- targets: ['localhost:8080'] | unknown | github | https://github.com/prometheus/prometheus | config/testdata/global_enable_scrape_native_hist.good.yml |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import sys
from PyQt5.QtCore import (QObject, pyqtSignal, pyqtSlot, pyqtProperty, QUrl)
from PyQt5.QtGui import QCursor, QDesktopServices
from .utils import registerContext, duration_to_string
class UtilWorker(QObject):
__contextName__ = 'UtilWorker'
@regi... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# 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, software
... | unknown | codeparrot/codeparrot-clean | ||
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from os import getpid
import Queue
import logging
import threading
import time
import sys
import copy
import pymumble
import settings
from pymumble.constants import PYMUMBLE_CLBK_USERCREATED,\
PYMUMBLE_CLBK_USERUPDATED, PYMUMBLE_CLBK_USERREMOVED,\
PYMUMBLE_CLBK_T... | unknown | codeparrot/codeparrot-clean | ||
---
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
Long: unix-socket
Arg: <path>
Help: Connect through this Unix domain socket
Added: 7.40.0
Protocols: HTTP
Category: connection
Multi: single
See-also:
- abstract-unix-socket
Example:
- --unix-socket socket-path $URL
---
# ... | unknown | github | https://github.com/curl/curl | docs/cmdline-opts/unix-socket.md |
#!/bin/sh
# This requires git-manpages and/or git-htmldocs repositories
repository=${1?repository}
destdir=${2?destination}
GIT_MAN_REF=${3?master}
GIT_DIR=
for d in "$repository/.git" "$repository"
do
if GIT_DIR="$d" git rev-parse "$GIT_MAN_REF" >/dev/null 2>&1
then
GIT_DIR="$d"
export GIT_DIR
break
fi
done... | unknown | github | https://github.com/git/git | Documentation/install-doc-quick.sh |
.highlight {
.hll { background-color: #ffffcc }
.err { color: #ce342c } /* Error */
.c { color: #818181 } /* Comment */
.g { color: #ffffff } /* Generic */
.k { color: #ff4287 } /* Keyword */
.l { color: #ffffff } /* Literal */
.n { color: #ffffff } /* Name */
.o { color: #ffffff } /* Operator */
... | unknown | github | https://github.com/jekyll/jekyll | docs/_sass/_pygments.scss |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
/*
* 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/clients/admin/CreateTopicsOptions.java |
/**
* An [attachment](https://svelte.dev/docs/svelte/@attach) is a function that runs when an element is mounted
* to the DOM, and optionally returns a function that is called when the element is later removed.
*
* It can be attached to an element with an `{@attach ...}` tag, or by spreading an object containing
*... | typescript | github | https://github.com/sveltejs/svelte | packages/svelte/src/attachments/public.d.ts |
"""
Wrapper for loading templates from the filesystem.
"""
import errno
import io
from django.core.exceptions import SuspiciousFileOperation
from django.template.base import TemplateDoesNotExist
from django.utils._os import safe_join
from .base import Loader as BaseLoader
class Loader(BaseLoader):
def get_dirs... | unknown | codeparrot/codeparrot-clean | ||
from django import template
from django.template.defaultfilters import stringfilter
register = template.Library()
def trim(value, num):
return value[:num]
trim = stringfilter(trim)
register.filter(trim)
@register.simple_tag
def no_params():
"""Expected no_params __doc__"""
return "no_params - Expected r... | unknown | codeparrot/codeparrot-clean | ||
# Owner(s): ["oncall: package/deploy"]
from package.package_a.test_all_leaf_modules_tracer import ( # noqa: F401
TestAllLeafModulesTracer,
)
from package.package_a.test_nn_module import TestNnModule # noqa: F401
from package.test_analyze import TestAnalyze # noqa: F401
from package.test_dependency_api import Te... | python | github | https://github.com/pytorch/pytorch | test/test_package.py |
# Copyright 2013 Red Hat, 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 or agre... | unknown | codeparrot/codeparrot-clean | ||
assert_equal %q{ok}, %q{
def m
a = :ok
$b = binding
end
m
eval('a', $b)
}
assert_equal %q{[:ok, :ok2]}, %q{
def m
a = :ok
$b = binding
end
m
eval('b = :ok2', $b)
eval('[a, b]', $b)
}
assert_equal %q{[nil, 1]}, %q{
$ans = []
def m
$b = binding
end
m
$ans << eval(%q{
$a... | ruby | github | https://github.com/ruby/ruby | bootstraptest/test_eval.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 us... | unknown | github | https://github.com/apache/airflow | airflow-core/src/airflow/ui/public/i18n/README.md |
# Copyright (c) 2016 PaddlePaddle 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 applic... | 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 | ||
import collections
import numpy as np
import pytest
from pandas.errors import Pandas4Warning
from pandas.core.dtypes.dtypes import CategoricalDtype
import pandas as pd
from pandas import (
Categorical,
Index,
Series,
isna,
)
import pandas._testing as tm
class TestCategoricalMissing:
def test_is... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/arrays/categorical/test_missing.py |
import os
import socket
import sys
from django.db import models
from core.models import PlCoreBase, Site, Slice, Sliver, Controller
from core.models import ControllerLinkManager,ControllerLinkDeletionManager
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from ... | unknown | codeparrot/codeparrot-clean | ||
{
"severity": "error",
"summary": "Wrong noises",
"detail": "Biological sounds are not allowed",
"range": {
"filename": "test.tf",
"start": {
"line": 2,
"column": 9,
"byte": 42
},
"end": {
"line": 2,
"column": 26,
"byte": 59
}
},
"snippet": {
"cont... | json | github | https://github.com/hashicorp/terraform | internal/command/views/json/testdata/diagnostic/error-with-source-code-subject-and-unknown-expression-of-unknown-type.json |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Derek Carter<goozbach@friocorte.com>
#
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
import os
import sys
import fnmatch
import textwrap
from distutils.command.build_py import build_py as _build_py
from distutils.util import convert_path
from glob import glob
try:
from setuptools.lib2to3_ex import Mixin2to3
except ImportError:
class Mixin2to3:
def run_2to3(self, files, doctests=True):
... | unknown | codeparrot/codeparrot-clean | ||
'''
database.py - this file is part of S3QL (http://s3ql.googlecode.com)
Copyright (C) 2008-2009 Nikolaus Rath <Nikolaus@rath.org>
This program can be distributed under the terms of the GNU GPLv3.
Module Attributes:
-----------
:initsql: SQL commands that are executed whenever a new
connection i... | unknown | codeparrot/codeparrot-clean | ||
"""
stringhelpers
~~~~~~~~~~~~~
A set of various string helpers.
:copyright: (c) 2013 by Thomas Skaflem.
:license: MIT, see LICENSE for more details.
"""
__version__ = '2.1'
import re
import os
import random
def upcase(string):
"""Return a copy of `string` where all the alphabetic character... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2024 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/lite/transforms/tf_legalizations/while_loop_outline_pass.h |
# -* coding: utf-8 -*-
import json
from handlers.basehandler import BaseHandler, ExceptionHandler
from core.experiment import Experiment
class GetHourlyTheta(BaseHandler):
def get(self, exp_id):
""" Get a dict of all logged thetas.
+--------------------------------------------------------------... | unknown | codeparrot/codeparrot-clean | ||
# bad argument list samples
class A:
def foo(self, x, y):
pass
# no self, but so what
def bar(one, two):
pass
a = A()
a.foo(1,2)
a.bar(<warning descr="Parameter 'two' unfilled">)</warning>;
def f1():
pass
f1()
f1(<warning descr="Unexpected argument">1</warning>)
f1(<warning descr="... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
import unittest
from PySide.QtGui import QLabel, QPixmap
from helper import UsesQApplication
xpm = [
"27 22 206 2",
" c None",
". c #FEFEFE",
"+ c #FFFFFF",
"@ c #F9F9F9",
"# c #ECECEC",
"$ c #D5D5D5",
"% c #A0A0A0",
"& c #767676",
"* c #525252",
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Gimp-Python - allows the writing of Gimp plugins in Python.
# Copyright (C) 1997 James Henstridge <james@daa.com.au>
#
# 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 Fou... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Mathmaker creates automatically maths exercises sheets
# with their answers
# Copyright 2006-2018 Nicolas Hainaux <nh.techn@gmail.com>
# This file is part of Mathmaker.
# Mathmaker is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License... | unknown | codeparrot/codeparrot-clean | ||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
class Module:
def __init__(self, mainMenu, params=[]):
# metadata info about the module, not modified during runtime
self.info = {
# name for the module that will appear in module menus
'Name': 'Situational Awareness',
# list of one or more auth... | unknown | codeparrot/codeparrot-clean | ||
#
# Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com)
#
# Jockey 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, or (at your option) any
# later version.
#
# Jockey is distri... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import division, absolute_import, print_function
import sys
from os import path
import numpy as np
from numpy.testing import *
from numpy.compat import asbytes, asunicode
import warnings
import collections
import pickle
class TestFromrecords(TestCase):
def test_fromrecords(self):
r = np.r... | unknown | codeparrot/codeparrot-clean | ||
# Lint as: python3
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
//===--- ScanningLoaders.h - Swift module scanning --------------*- C++ -*-===//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2023 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt... | c | github | https://github.com/apple/swift | include/swift/Serialization/ScanningLoaders.h |
<!--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 agreed... | unknown | github | https://github.com/huggingface/transformers | docs/source/en/model_doc/sam3_video.md |
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations \u0026 Alerts",
"type": "dashb... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/conversion/testdata/input/migrated_dev_dashboards/datasource-elasticsearch/v1beta1.elasticsearch_simple.v42.json |
/**
* 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/token/TokenIdentifier.java |
# -*- coding: utf-8 -*-
#
# Cherokee-admin
#
# Authors:
# Alvaro Lopez Ortega <alvaro@alobbs.com>
#
# Copyright (C) 2001-2014 Alvaro Lopez Ortega
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License as published by the Free S... | unknown | codeparrot/codeparrot-clean | ||
from allauth.socialaccount.tests import create_oauth2_tests
from allauth.tests import MockedResponse
from allauth.socialaccount.providers import registry
from .provider import GitHubProvider
class GitHubTests(create_oauth2_tests(registry.by_id(GitHubProvider.id))):
def get_mocked_response(self):
return Mo... | 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/web/servlet/support/package-info.java |
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS
#include <ATen/Dispatch.h>
#include <ATen/native/TensorFactories.h>
#include <ATen/native/TensorIterator.h>
#include <ATen/native/cpu/Loops.h>
namespace at::native {
namespace {
void complex_kernel(TensorIterator& iter) {
AT_DISPATCH_FLOATING_TYPES_AND(kHalf, iter.input_dt... | cpp | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/cpu/ComplexKernel.cpp |
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package testing
import (
"fmt"
"github.com/zclconf/go-cty/cty"
"github.com/hashicorp/terraform/internal/providers"
"github.com/hashicorp/terraform/internal/tfdiags"
)
// resource is an interface that represents a resource that can be managed... | go | github | https://github.com/hashicorp/terraform | internal/stacks/stackruntime/testing/resource.go |
import jquery from 'jquery';
import moment from 'moment';
window.jQuery = jquery;
window.moment = moment; | typescript | github | https://github.com/prometheus/prometheus | web/ui/react-app/src/globals.ts |
////////////////////////////////////////////////////////////////////////////
//
// Copyright 2022 Realm 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/li... | swift | github | https://github.com/realm/realm-swift | Realm/ObjectServerTests/EventTests.swift |
"""
PCA object that can be fit to and transform data.
Written by Jesse Livezey.
Block functionality added by Eric Dodds.
"""
import numpy as np
class PCA:
def __init__(self, dim = None, whiten = False, eps= 1e-8):
"""PCA object that can be fit to and transform data.
Args:
dim: Dimens... | unknown | codeparrot/codeparrot-clean | ||
#
# This file is part of CasADi.
#
# CasADi -- A symbolic framework for dynamic optimization.
# Copyright (C) 2010-2014 Joel Andersson, Joris Gillis, Moritz Diehl,
# K.U. Leuven. All rights reserved.
# Copyright (C) 2011-2014 Greg Horn
#
# CasADi is free software; you can... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import os
import glob
from os import path as op
import subprocess
import sys
from mne.utils import run_subprocess, _replace_md5
def setup(app):
app.connect('builder-inited', generate_commands_rst)
def setup_module():
# HACK: Stop nosetests running setup() above
pass
# Header mar... | unknown | codeparrot/codeparrot-clean | ||
//! Tests for task instrumentation.
//!
//! These tests ensure that the instrumentation for task spawning and task
//! lifecycles is correct.
#![warn(rust_2018_idioms)]
#![cfg(all(tokio_unstable, feature = "tracing", target_has_atomic = "64"))]
use std::{mem, time::Duration};
use tokio::task;
use tracing_mock::{expec... | rust | github | https://github.com/tokio-rs/tokio | tokio/tests/tracing_task.rs |
#!/usr/bin/env python
"""CLI for storage, version v1."""
import code
import platform
import sys
import protorpc
from protorpc import message_types
from protorpc import messages
from google.apputils import appcommands
import gflags as flags
import apitools.base.py as apitools_base
from apitools.base.py import cli as... | unknown | codeparrot/codeparrot-clean | ||
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once
#include <spdlog/details/file_helper.h>
#include <spdlog/details/null_mutex.h>
#include <spdlog/details/synchronous_factory.h>
#include <spdlog/sinks/base_sink.h>
#i... | c | github | https://github.com/nodejs/node | deps/LIEF/third-party/spdlog/include/spdlog/sinks/rotating_file_sink.h |
# frozen_string_literal: true
require "cases/helper"
require "models/person"
module ActiveRecord
module ConnectionAdapters
class ConnectionSwappingNestedTest < ActiveRecord::TestCase
self.use_transactional_tests = false
fixtures :people
def teardown
clean_up_connection_handler
... | ruby | github | https://github.com/rails/rails | activerecord/test/cases/connection_adapters/connection_swapping_nested_test.rb |
- name: run App Control tests on Windows
hosts: windows
gather_facts: false
collections:
# This is important so that the temp ansible.windows is chosen over the ansible-test path
# which will not be signed
- ansible.windows
handlers:
- name: remove openauthenticode
shell: Uninstall-PSResource -Name... | unknown | github | https://github.com/ansible/ansible | test/integration/targets/win_app_control/main.yml |
# Copyright: (c) 2017, 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
import os
import shlex
import subprocess
import yaml
from ansible import context
from ansible.cli... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
try:
import gi, loggy
#gi.require_version('Gst', '1.0')
from gi.repository import GObject, Gst
except:
loggy.warn('Tagger 3 could not import required libraries')
GObject.threads_init()
Gst.init(None)
dbtags = {'artist':'',
'title':'',
'album':'',
'date':0,
... | unknown | codeparrot/codeparrot-clean | ||
## Input
```javascript
import {mutateAndReturn, Stringify, useIdentity} from 'shared-runtime';
function Component({value}) {
const arr = [{value: 'foo'}, {value: 'bar'}, {value}];
useIdentity();
const derived = Array.from(arr).map(mutateAndReturn);
return (
<Stringify>
{derived.at(0)}
{derived... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-from-maybemutates-arg0.expect.md |
"""
http://stackoverflow.com/questions/9860667/writing-robust-color-and-size-invariant-circle-detection-with-opencv-based-on
"""
import cv2
import math
import numpy as np
d_red = cv2.cv.RGB(150, 55, 65)
l_red = cv2.cv.RGB(250, 200, 200)
orig = cv2.imread("N16.png")
img = orig.copy()
img2 = cv2.cvtColor(img, cv2.COLOR... | unknown | codeparrot/codeparrot-clean | ||
from functools import update_wrapper
from django.apps import apps
from django.conf import settings
from django.contrib.admin import ModelAdmin, actions
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
from django.core.urlresolvers import NoRe... | unknown | codeparrot/codeparrot-clean | ||
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {ButtonComponent} from './button.component';... | typescript | github | https://github.com/angular/angular | devtools/projects/ng-devtools/src/lib/shared/button/button.component.spec.ts |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may n... | java | github | https://github.com/apache/kafka | clients/src/test/java/org/apache/kafka/clients/consumer/internals/FetcherTest.java |
import pytest
pytest.importorskip('numpy')
from dask.utils import skip
import dask.array as da
from dask.array.percentile import _percentile
import dask
import numpy as np
def eq(a, b):
if isinstance(a, da.Array):
a = a.compute(get=dask.get)
if isinstance(b, da.Array):
b = b.compute(get=dask.g... | unknown | codeparrot/codeparrot-clean | ||
use rustc_hir as hir;
use rustc_middle::ty;
use rustc_session::{declare_lint, declare_lint_pass};
use rustc_span::BytePos;
use crate::lints::{FunctionCastsAsIntegerDiag, FunctionCastsAsIntegerSugg};
use crate::{LateContext, LateLintPass};
declare_lint! {
/// The `function_casts_as_integer` lint detects cases wher... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_lint/src/function_cast_as_integer.rs |
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"incremental": true,
"esModuleInterop": true,
"module": "esnext",
"isolatedMod... | json | github | https://github.com/vercel/next.js | examples/with-ably/tsconfig.json |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import date
from dateutil.relativedelta import relativedelta
from unittest.mock import patch
from odoo import exceptions, fields
from odoo.addons.mail.tests.common import mail_new_test_user
from odoo.tests... | unknown | codeparrot/codeparrot-clean | ||
/*
* 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 | build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/precommit/InternalPrecommitTasks.java |
import logging
import requests
from sentry.utils import json
from sentry.utils.cache import cache
from simplejson.decoder import JSONDecodeError
from BeautifulSoup import BeautifulStoneSoup
from django.utils.datastructures import SortedDict
log = logging.getLogger(__name__)
CACHE_KEY = "SENTRY-JIRA-%s-%s"
class JIRA... | unknown | codeparrot/codeparrot-clean | ||
"""SCons.Tool
SCons tool selection.
This looks for modules that define a callable object that can modify
a construction environment as appropriate for a given tool (or tool
chain).
Note that because this subsystem just *selects* a callable that can
modify a construction environment, it's possible for people to defin... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python2
#
# Copyright (C) 2013-2017(H)
# Max Planck Institute for Polymer Research
#
# This file is part of ESPResSo++.
#
# ESPResSo++ 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, e... | unknown | codeparrot/codeparrot-clean | ||
"""
==========================================
One-class SVM with non-linear kernel (RBF)
==========================================
An example using a one-class SVM for novelty detection.
:ref:`One-class SVM <svm_outlier_detection>` is an unsupervised
algorithm that learns a decision function for novelty detection:
... | unknown | codeparrot/codeparrot-clean | ||
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (C) 2017 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 in... | java | github | https://github.com/google/guava | android/guava-tests/test/com/google/common/graph/TraverserTest.java |
# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: latin-1 -*-
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation; either version 3, or (at your option) any later
# version.
#
# This program is distributed in t... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2018 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
package sql
import (
"context"
"slices"
"strings"
"github.com/cockroachdb/cockroach/pkg/server/telemetry"
"github.com/cockroachdb/cockroach/pkg/settings"
"github... | go | github | https://github.com/cockroachdb/cockroach | pkg/sql/plan_opt.go |
#!/usr/bin/env python
# Copyright 2015 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... | unknown | codeparrot/codeparrot-clean | ||
"""
A small templating language
This implements a small templating language. This language implements
if/elif/else, for/continue/break, expressions, and blocks of Python
code. The syntax is::
{{any expression (function calls etc)}}
{{any expression | filter}}
{{for x in y}}...{{endfor}}
{{if x}}x{{elif y}}y... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (c) 2017 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockitousage.junitrule;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import org.junit.Rule;
import org.junit.Test;
import org.mockito.Inject... | java | github | https://github.com/mockito/mockito | mockito-core/src/test/java/org/mockitousage/junitrule/RuleTestWithParameterConstructorTest.java |
# -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from django.utils.translation import ugettext_lazy as _
from shoop.admin.ba... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.