code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
"""========================================
Interpolation (:mod:`scipy.interpolate`)
========================================
.. currentmodule:: scipy.interpolate
Sub-package for objects used in interpolation.
As listed below, this sub-package contains spline functions and classes,
one-dimensional and multi-dimensio... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
InaSAFE Disaster risk assessment tool developed by AusAid and World Bank
- **Functionality related to shake events.**
Contact : ole.moller.nielsen@gmail.com
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public Lice... | unknown | codeparrot/codeparrot-clean | ||
import dataclasses
import os
import random
import time
import warnings
from abc import ABC, abstractmethod
from datetime import datetime
from ftplib import FTP
from io import BytesIO
from pathlib import Path
from posixpath import split
from shutil import rmtree
from tempfile import mkdtemp
from typing import Any
from u... | python | github | https://github.com/scrapy/scrapy | tests/test_pipeline_files.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 us... | unknown | codeparrot/codeparrot-clean | ||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -fsigned-char types_freebsd.go
package syscall
const (
sizeofPtr = 0x4
sizeofShort = 0x2
sizeofInt = 0x4
sizeofLong = 0x4
sizeofLongLong = 0x8
)
type (
_C_short int16
_C_int int32
_C_long int32
_C_long_long ... | go | github | https://github.com/golang/go | src/syscall/ztypes_freebsd_arm.go |
"""
Tests for helper function provided by site_configuration app.
"""
from django.test import TestCase
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
from openedx.core.djangoapps.site_configuration.tests.test_util import (
with_site_configuration,
with_site_configurati... | unknown | codeparrot/codeparrot-clean | ||
- Feature Name: SQL Table Partitioning
- Status: in-progress
- Start Date: 2017-01-25
- Authors: Nikhil Benesch, Daniel Harrison, David Taylor
- RFC PR: [#18683]
# Summary
Table partitioning provides row-level control over how and where data is stored.
Specifically, `CREATE TABLE`, `ALTER TABLE`, and their `INDEX` ... | unknown | github | https://github.com/cockroachdb/cockroach | docs/RFCS/20170921_sql_partitioning.md |
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License ... | cpp | github | https://github.com/opencv/opencv | modules/calib3d/test/test_translation_2d_estimator.cpp |
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
use super::{AppSettings, DevProcess, ExitReason, Options, RustAppSettings, RustupTarget};
use crate::{
error::{Context, ErrorExt},
CommandExt, Error,
};
use shared_child::Sh... | rust | github | https://github.com/tauri-apps/tauri | crates/tauri-cli/src/interface/rust/desktop.rs |
---
title: "this is a test!"
---
wheee | unknown | github | https://github.com/jekyll/jekyll | test/source/_methods/3940394-21-9393050-fifif1323-test.md |
# (c) 2014, Chris Church <chris@ninemoreminutes.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 License, or
# (at your option) any lat... | unknown | codeparrot/codeparrot-clean | ||
export var __N_SSG = true;
export const revalidateInSeconds = 5 * 60;
export default function Home({}) {
return __jsx("div", null, __jsx("p", null, "Hello World"));
} | javascript | github | https://github.com/vercel/next.js | crates/next-custom-transforms/tests/fixture/ssg/getStaticProps/issue-31855/output.js |
---
applies_to:
stack:
serverless:
navigation_title: "Use cases"
---
# Use cases for {{esql}}
These pages detail how to use {{esql}} for search and cybersecurity use cases:
- [ES|QL for search](docs-content://solutions/search/esql-for-search.md): Learn how to use {{esql}} for lexical (keyword) search, relevance ... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/query-languages/esql/esql-use-cases.md |
from pandas.core._numba.kernels.mean_ import (
grouped_mean,
sliding_mean,
)
from pandas.core._numba.kernels.min_max_ import (
grouped_min_max,
sliding_min_max,
)
from pandas.core._numba.kernels.sum_ import (
grouped_sum,
sliding_sum,
)
from pandas.core._numba.kernels.var_ import (
grouped_v... | python | github | https://github.com/pandas-dev/pandas | pandas/core/_numba/kernels/__init__.py |
#!/usr/bin/env python
import socket, string, re, os, sys, ConfigParser, time
HOST = '127.0.0.1'
PORT = 6666
config = ConfigParser.ConfigParser()
config.read(os.getenv('HOME') + '/.omgsm/config')
gsmpath = config.get('Main', 'GSMPATH')
gsmkrakenhost = config.get('Main', 'GSMKRAKENHOST')
gsmkrakenport = config.getint... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
pygments.formatters._mapping
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Formatter mapping defintions. This file is generated by itself. Everytime
you change something on a builtin formatter defintion, run this script from
the formatters folder to update it.
Do not alter the FORMA... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import
from django.test import TestCase
from django.utils import six
from .models import Person, Book, Car, PersonManager, PublishedBookManager
class CustomManagerTests(TestCase):
def test_manager(self):
p1 = Person.objects.create(first_name="Bugs", last_name="Bunny", fun=... | unknown | codeparrot/codeparrot-clean | ||
import json
import six
from six.moves.urllib.request import urlopen, Request
from libqtile.widget import base
class GenPollText(base.ThreadedPollText):
"""
A generic text widget that polls using poll function to get the text.
"""
orientations = base.ORIENTATION_HORIZONTAL
defaults = [
... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (c) Facebook, Inc. and its affiliates.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <assert.h>
#include <qnnpack/x8lut.h>
void pytorch_x8lut_ukernel__scalar(
size_t n,
... | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/quantized/cpu/qnnpack/src/x8lut/scalar.c |
from nose.tools import * # flake8: noqa
from api.base.settings.defaults import API_BASE
from tests.base import ApiTestCase
from tests.factories import ProjectFactory, AuthUserFactory, CommentFactory
class TestReportDetailView(ApiTestCase):
def setUp(self):
super(TestReportDetailView, self).setUp()
... | 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/serialization/definitions/notset.py |
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const LazySet = require("../util/LazySet");
const makeSerializable = require("../util/makeSerializable");
/** @typedef {import("enhanced-resolve").ResolveContext} ResolveContext */
/** @typedef {import("... | javascript | github | https://github.com/webpack/webpack | lib/cache/ResolverCachePlugin.js |
{
"name": "ssr-data-router",
"private": true,
"scripts": {
"dev": "cross-env NODE_ENV=development node server.js",
"build": "npm run build:client && npm run build:server",
"build:client": "vite build --outDir dist/client --ssrManifest",
"build:server": "vite build --ssr src/entry.server.tsx --outD... | json | github | https://github.com/remix-run/react-router | examples/ssr-data-router/package.json |
#-------------------------------------------------------------------------------
# Name: module2
# Purpose:
#
# Author: patr5136
#
# Created: 23/08/2013
# Copyright: (c) patr5136 2013
# Licence: <your licence>
#-------------------------------------------------------------------------------
import ... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/conformance/classes/classStaticBlock/classStaticBlock13.ts] ////
//// [classStaticBlock13.ts]
class C {
static #x = 123;
static {
console.log(C.#x)
}
foo () {
return C.#x;
}
}
//// [classStaticBlock13.js]
"use strict";
class C {
static #x = 123;
static {
console.l... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/classStaticBlock13(target=es2022).js |
#! python
# -*- coding: utf-8 -*-
# (c) 2007 Werner Mayer LGPL
# Create HTML documentation from FreeCAD's Python modules and classes.
import pydoc, pkgutil, sys, os, dircache, zipfile
def generateDoc():
# Get the path to the FreeCAD module relative to this directory
toolspath = os.path.dirname(__file__)
homepat... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
'''Notify-OSD Apport interface
Copyright (C) 2009 Canonical Ltd.
Author: Ara Pulido <ara.pulido@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 ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... | go | github | https://github.com/kubernetes/kubernetes | cmd/kubeadm/app/features/features.go |
/*
* Copyright (C) 2007 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 agre... | java | github | https://github.com/google/guava | guava/src/com/google/common/collect/AbstractMapBasedMultiset.java |
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you... | java | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/Stat.java |
from datetime import datetime
from django.contrib.auth.models import User
from django.db import models
from django.utils.translation import ugettext_lazy as _
from djblets.util.db import ConcurrencyManager
from djblets.util.fields import CounterField
from reviewboard.reviews.models import Group, ReviewRequest
from r... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright 2014 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 require... | unknown | codeparrot/codeparrot-clean | ||
#ifndef Py_CPYTHON_DESCROBJECT_H
# error "this header file must not be included directly"
#endif
typedef PyObject *(*wrapperfunc)(PyObject *self, PyObject *args,
void *wrapped);
typedef PyObject *(*wrapperfunc_kwds)(PyObject *self, PyObject *args,
... | c | github | https://github.com/python/cpython | Include/cpython/descrobject.h |
#!/usr/bin/env python
# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies simple rules when using an explicit build target of 'all'.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('actions... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package terraform
import (
"bytes"
"fmt"
"log"
"sort"
"strings"
"time"
"github.com/zclconf/go-cty/cty"
"github.com/hashicorp/terraform/internal/addrs"
"github.com/hashicorp/terraform/internal/collections"
"github.com/hashicorp/terraform... | go | github | https://github.com/hashicorp/terraform | internal/terraform/context_plan.go |
#include "../git-compat-util.h"
#include "../strbuf.h"
/* Adapted from libiberty's basename.c. */
char *gitbasename (char *path)
{
const char *base;
if (path)
skip_dos_drive_prefix(&path);
if (!path || !*path)
/*
* basename(3P) is mis-specified because it returns a
* non-constant pointer even though it... | c | github | https://github.com/git/git | compat/basename.c |
# frozen_string_literal: true
module ActiveRecord
module ConnectionAdapters
module MySQL
class ExplainPrettyPrinter # :nodoc:
# Pretty prints the result of an EXPLAIN in a way that resembles the output of the
# MySQL shell:
#
# +----+-------------+-------+-------+---------... | ruby | github | https://github.com/rails/rails | activerecord/lib/active_record/connection_adapters/mysql/explain_pretty_printer.rb |
# vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import os
from powerline.lib.config import ConfigLoader
from tests import TestCase
from tests.lib.fsconfig import FSTree
FILE_ROOT = os.path.join(os.path.dirname(__file__), 'cfglib')
class LoadedList(... | unknown | codeparrot/codeparrot-clean | ||
'''
Created on 18.03.2011
@author: Gena
'''
from PyQt4 import QtCore, QtGui
import platform
from ltcore.consts import *
from ltcore.cvprocessor import CvProcessor
from ltcore.ltactions import addActions,createAction
import imagercc
#from ltgui.cvlabel import CvLabel
from ltgui.cvgraphics import CvGraphics
from lt... | 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/api_fastapi/core_api/routes/public/dag_run.py |
/*
* 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-context/src/main/java/org/springframework/cache/annotation/CacheEvict.java |
Generics have been used on an auto trait.
Erroneous code example:
```compile_fail,E0567
#![feature(auto_traits)]
auto trait Generic<T> {} // error!
# fn main() {}
```
Since an auto trait is implemented on all existing types, the
compiler would not be able to infer the types of the trait's generic
parameters.
To fi... | unknown | github | https://github.com/rust-lang/rust | compiler/rustc_error_codes/src/error_codes/E0567.md |
# -*- coding: utf-8 -*-
#
# jQuery File Upload Plugin GAE Python Example 2.2.0
# https://github.com/blueimp/jQuery-File-Upload
#
# Copyright 2011, Sebastian Tschan
# https://blueimp.net
#
# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT
#
from __future__ import with_statement
from google.appe... | unknown | codeparrot/codeparrot-clean | ||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/goodix,gt7375p.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Goodix GT7375P touchscreen
maintainers:
- Douglas Anderson <dianders@chromium.org>
description:
Supports the Goodix G... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/input/goodix,gt7375p.yaml |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012 Tristan Fischer
#
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
##########################################################################
#
# Copyright (c) 2013, Image Engine Design 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:
#
# * Redistrib... | unknown | codeparrot/codeparrot-clean | ||
"""
Python Markdown
A Python implementation of John Gruber's Markdown.
Documentation: https://python-markdown.github.io/
GitHub: https://github.com/Python-Markdown/markdown/
PyPI: https://pypi.org/project/Markdown/
Started by Manfred Stienstra (http://www.dwerg.net/).
Maintained for a few years by Yuri Takhteyev (ht... | unknown | codeparrot/codeparrot-clean | ||
#!/bin/sh
test_description='reset --hard unmerged'
. ./test-lib.sh
test_expect_success setup '
mkdir before later &&
>before/1 &&
>before/2 &&
>hello &&
>later/3 &&
git add before hello later &&
git commit -m world &&
H=$(git rev-parse :hello) &&
git rm --cached hello &&
echo "100644 $H 2 hello" | git up... | unknown | github | https://github.com/git/git | t/t7104-reset-hard.sh |
"""
.. dialect:: drizzle+mysqldb
:name: MySQL-Python
:dbapi: mysqldb
:connectstring: drizzle+mysqldb://<user>:<password>@<host>[:<port>]/<dbname>
:url: http://sourceforge.net/projects/mysql-python
"""
from sqlalchemy.dialects.drizzle.base import (
DrizzleDialect,
DrizzleExecutionContext,
D... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import, division, print_function
import pytest
pyspark = pytest.importorskip('pyspark')
import pandas as pd
from blaze import compute, symbol, summary, exp, by, join, merge
from toolz import identity
data = [['Alice', 100, 1],
['Bob', 200, 2],
['Alice', 50, 3]]
data2 ... | unknown | codeparrot/codeparrot-clean | ||
import sys
import numpy as np
from numpy.ctypeslib import ndpointer, load_library
from numpy.testing import *
try:
cdll = load_library('multiarray', np.core.multiarray.__file__)
_HAS_CTYPE = True
except ImportError:
_HAS_CTYPE = False
class TestLoadLibrary(TestCase):
@dec.skipif(not _HAS_CTYPE, "ctyp... | unknown | codeparrot/codeparrot-clean | ||
## -*- coding: utf-8 -*-
#
# This software is licensed as described in the file license.txt, which
# you should have received as part of this distribution.
from trac.core import *
from trac.db import Table, Column, Index
from trac.db import DatabaseManager
from trac.env import IEnvironmentSetupParticipant
schema_vers... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2025 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | python | github | https://github.com/huggingface/transformers | src/transformers/models/blt/configuration_blt.py |
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/mfd/realtek,rtd1xxx.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Realtek RTD1xxx system controllers
maintainers:
- Andreas Färber <afaerber@suse.de>
properties:
compatible:
items:
... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/mfd/realtek,rtd1xxx.yaml |
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# All rights reserved.
#
# 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 withou... | unknown | codeparrot/codeparrot-clean | ||
import os
from copy import deepcopy
from os import fsdecode
import logging
import zipfile
import enum
from collections import OrderedDict
import fs
import fs.base
import fs.subfs
import fs.errors
import fs.copy
import fs.osfs
import fs.zipfs
import fs.tempfs
import fs.tools
from fontTools.misc import plistlib
from font... | unknown | codeparrot/codeparrot-clean | ||
"""
This module contains the spatial lookup types, and the `get_geo_where_clause`
routine for Oracle Spatial.
Please note that WKT support is broken on the XE version, and thus
this backend will not work on such platforms. Specifically, XE lacks
support for an internal JVM, and Java libraries are required to use... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding:utf-8 -*-
__author__ = "lbin"
import xml.dom
import xml.dom.minidom
import os
from PIL import Image
'''
根据下面的路径和文件,将output.txt制作成xml的标注
'''
# xml文件规范定义
_INDENT = ' ' * 4
_NEW_LINE = '\n'
_FOLDER_NODE = 'VOC2007'
_ROOT_NODE = 'annotation'
_DATABASE_NAME = 'sjtu'
#_CLASS = 'person'
_ANNOTATION = 'PASCAL... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import botocore
from lamvery.clients.base import BaseClient
class EventsClient(BaseClient):
def __init__(self, *args, **kwargs):
super(EventsClient, self).__init__(*args, **kwargs)
self._events = self._session.client('events')
def get_rules_by_target(self, arn):
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from __future__ import unicode_literals
import bisect
import io
import logging
import os
import pkgutil
import shutil
import sys
import types... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# encoding: utf-8
# Copyright (C) 2017 John Törnblom
#
# This file is part of pyxtuml.
#
# pyxtuml 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 of the License... | unknown | codeparrot/codeparrot-clean | ||
""" Prototype for Tori 4.0+ and Imagination 1.10+
:Author: Juti Noppornpitak
"""
import argparse
import json
import os
import sys
from imagination.loader import Loader
from .core import Core
from .ext.helper import activate
from .helper import Reflector
from .interface import ICommand, IExtension, al... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package math
/*
Bessel function of the first and second kinds of order zero.
*/
// The original C code and the long comment below are
// from FreeBSD's /usr/... | go | github | https://github.com/golang/go | src/math/j0.go |
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS
#include <ATen/native/cuda/Sorting.h>
#include <ATen/core/Tensor.h>
#include <ATen/core/NamedTensor.h>
#include <ATen/Context.h>
#include <ATen/TensorUtils.h>
#include <ATen/MemoryOverlap.h>
#include <ATen/WrapDimUtils.h>
#include <ATen/cuda/CUDAContext.h>
#include <ATen/cuda/... | cpp | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/cuda/Sorting.cpp |
import numpy as np
import invesalius.data.coordinates as dco
import invesalius.data.transformations as tr
import invesalius.data.coregistration as dcr
def angle_calculation(ap_axis, coil_axis):
"""
Calculate angle between two given axis (in degrees)
:param ap_axis: anterior posterior axis represented
... | unknown | codeparrot/codeparrot-clean | ||
# Rubik's cube solver using Thistlethwaite's algorithm
#
# Python translation of Stefan Pochmann's C++ implementation
# http://www.stefan-pochmann.info/spocc/other_stuff/tools/
# by Mark Dufour (mark.dufour@gmail.com)
#
# cube 'state' is a list with 40 entries, the first 20
# are a permutation of {0,...,19} and describ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, Darren Worrall <darren@iweb.co.uk>
# (c) 2015, René Moser <mail@renemoser.net>
#
# 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 So... | unknown | codeparrot/codeparrot-clean | ||
//go:build linux
package journald
import (
"testing"
)
func TestSanitizeKeyMod(t *testing.T) {
entries := map[string]string{
"io.kubernetes.pod.name": "IO_KUBERNETES_POD_NAME",
"io?.kubernetes.pod.name": "IO__KUBERNETES_POD_NAME",
"?io.kubernetes.pod.name": "IO_KUBERNETES_POD_NAME",
"io123.kub... | go | github | https://github.com/moby/moby | daemon/logger/journald/journald_test.go |
{
"openFiles": ["src/app/app.ts", "src/app/app.css"],
"type": "editor",
"title": "Deriving state with computed signals"
} | json | github | https://github.com/angular/angular | adev/src/content/tutorials/signals/steps/2-deriving-state-with-computed-signals/config.json |
# Restoring the cursor does the following things that are not testable:
# * Turn off character attributes
# * Maps the ASCII character set into GL, and the DEC Supplemental Graphic set into GR.
# * Status bar has a separate saved cursor.
# From the Xterm docs, there are several variants of DECRC with different names.
... | 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.
# pylint: disable=W0401,W0614
from telemetry.page.actions.all_page_actions import *
from telemetry.page import page as page_module
from telemetry.page import ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from matplotlib import pyplot as plt
from numpy import arange
"""
__author__: 'kmunve'
"""
def _temperature_plot(values, xticks=None, p_title=None, p_xlabel='Time', p_ylabel='Temperature'):
"""
TODO: add a check if the values are in Kelvin, Fahrenheit, or Celsiu... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2022 The Abseil 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 by applicable law or agr... | c | github | https://github.com/mysql/mysql-server | extra/abseil/abseil-cpp-20230802.1/absl/crc/internal/crc32c_inline.h |
# (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# stdlib
import logging
import os.path
import tempfile
log = logging.getLogger(__name__)
class PidFile(object):
""" A small helper class for pidfiles. """
@classmethod
def get_dir(cls, run_dir=None)... | unknown | codeparrot/codeparrot-clean | ||
#
# Authors: Travis Oliphant, Ed Schofield, Robert Cimrman, Nathan Bell, and others
""" Test functions for sparse matrices. Each class in the "Matrix class
based tests" section become subclasses of the classes in the "Generic
tests" section. This is done by the functions in the "Tailored base
class for generic tests" ... | unknown | codeparrot/codeparrot-clean | ||
"""
set_default_site.py
"""
import socket
from optparse import make_option
from django.core.management.base import NoArgsCommand, CommandError
from django_extensions.management.utils import signalcommand
class Command(NoArgsCommand):
option_list = NoArgsCommand.option_list + (
make_option('--name', dest=... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
#
# Copyright (c) 2019 Zim Kalinowski, (@zikalino)
#
# 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 | ||
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html
#ifndef SRC_STAT_HPP
#define SRC_STAT_HPP
#include "opencv2/core/mat.hpp"
namespace cv {
#ifdef HAVE_OPENCL
enum { OCL_OP_... | unknown | github | https://github.com/opencv/opencv | modules/core/src/stat.hpp |
from abc import ABCMeta, abstractmethod
from six import with_metaclass
class CryptoTransform(with_metaclass(ABCMeta, object)):
def __enter__(self):
return self
def __exit__(self, exc_type, exc_val, exc_tb):
self.dispose()
@abstractmethod
def transform(self, data):
raise NotIm... | unknown | codeparrot/codeparrot-clean | ||
/* 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/MachO/SourceVersion.cpp |
# Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) for numbers, according to PEP 3141.
TODO: Fill out more detailed documentation on the operators."""
from abc import ABCMeta, abstractmethod
__all__ = ["Number", "Complex", "Real", "Rat... | unknown | codeparrot/codeparrot-clean | ||
"""Helper to handle a set of topics to subscribe to."""
import logging
from typing import Any, Callable, Dict, Optional
import attr
from homeassistant.components import mqtt
from homeassistant.helpers.typing import HomeAssistantType
from homeassistant.loader import bind_hass
from . import DEFAULT_QOS, MessageCallbac... | 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/configurationprocessor/metadata/TestJsonConverter.java |
from __future__ import absolute_import
import mock
from bokeh.core.validation import check_integrity
from bokeh.models.layouts import LayoutDOM
from bokeh.models.tools import Toolbar, ToolbarBox
# TODO (bev) validate entire list of props
def test_Toolbar():
tb = Toolbar()
assert tb.active_drag == 'auto'
... | unknown | codeparrot/codeparrot-clean | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import Union
from typing_extensions import Annotated, TypeAlias
from .._utils import PropertyInfo
from .image_edit_completed_event import ImageEditCompletedEvent
from .image_edit_partial_image_event import ImageEditParti... | python | github | https://github.com/openai/openai-python | src/openai/types/image_edit_stream_event.py |
# -*- coding:utf-8 -*-
from selenium import webdriver
import requests
import sqlite3
browser = webdriver.Firefox()
browser.get('http://www.mouser.cn')
html_source = browser.page_source
print html_source
coon = sqlite3.connect('/root/.mozilla/firefox/gmfs2ivm.default/cookies.sqlite')
cursor = coon.cursor()
cursor.exe... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
'''
Run this script inside of src/ and it will look for all the files
that were changed this year that still have the last year in the
copyright headers, and it will fix the headers on that file using
a perl regex one liner.
For example: if it finds something like this and we're in 2014
// Copyr... | unknown | codeparrot/codeparrot-clean | ||
""" Run rocket.wasm in Python!
* Load the wasm module, compile to PPCI IR and then to native.
* Load the native object in memory, feed it the API it needs (wasm imports).
* Implement a Python app that uses the exposed API (wasm exports).
At the moment, the game is text based. But we can use Qt or SDL2 (or tk?)
to run... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Contracts\Support;
interface Renderable
{
/**
* Get the evaluated contents of the object.
*
* @return string
*/
public function render();
} | php | github | https://github.com/laravel/framework | src/Illuminate/Contracts/Support/Renderable.php |
from django.db import models
class MinimalUser(models.Model):
REQUIRED_FIELDS = ()
USERNAME_FIELD = "id" | python | github | https://github.com/django/django | tests/auth_tests/models/minimal.py |
import json
import os
import shutil
import tempfile
import unittest
from avocado.utils import process
from avocado.utils import script
from virttest import data_dir
BASE_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..')
BASE_DIR = os.path.abspath(BASE_DIR)
TEST_STATUSES_PY = """from avocado.... | unknown | codeparrot/codeparrot-clean | ||
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'j \d\e F \d\e Y'
TIME_FORMAT = '... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package cliconfig
import (
"os"
"path/filepath"
"reflect"
"testing"
"github.com/davecgh/go-spew/spew"
"github.com/google/go-cmp/cmp"
"github.com/hashicorp/terraform/internal/tfdiags"
)
// This is the directory where our test fixtures are.
... | go | github | https://github.com/hashicorp/terraform | internal/command/cliconfig/cliconfig_test.go |
# Copyright 2013 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 | ||
"""
This module implements the Response class which is used to represent HTTP
responses in Scrapy.
See documentation in docs/topics/request-response.rst
"""
import copy
from scrapy.http.headers import Headers
from scrapy.utils.trackref import object_ref
from scrapy.http.common import deprecated_setter
class Respons... | unknown | codeparrot/codeparrot-clean | ||
month = int(input("Please enter your birthday month"))
day = int(input("Please enter your birthday day"))
if month == 1:
if day < 20:
print("Capricorn")
else:
print("Aquarius")
if month == 2:
if day < 20:
print("Aquarius")
else:
print("Pisces")
if month == 3:
if day <... | 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-annotations/src/main/java/org/apache/hadoop/classification/tools/StabilityOptions.java |
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Hiroaki Nakamura <hnakamur@gmail.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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.