code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bridge\Twig\Node;
use Twig\Compiler;
use Twig\Node\Expression\A... | php | github | https://github.com/symfony/symfony | src/Symfony/Bridge/Twig/Node/SearchAndRenderBlockNode.php |
# -*- coding: utf-8 -*-
r"""
Writing to files
EXAMPLES::
sage: from slabbe.write_to_file import write_str_to_file
sage: filename = tmp_filename(ext='.tex')
sage: write_str_to_file('aaa', filename)
Creation of ...tex
AUTHOR:
- Sébastien Labbé, March 13, 2018
"""
#*********************************... | unknown | codeparrot/codeparrot-clean | ||
from itertools import izip
from datetime import date
from random import uniform
from stdnet.test import TestCase
from stdnet.contrib.timeserie.utils import dategenerator, default_parse_interval
from stdnet.utils import populate
from models import TimeSerie
NUM_DATES = 300
dates = populate('date',NUM_DATES)
value... | unknown | codeparrot/codeparrot-clean | ||
/**
* 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
* distribute... | java | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/server/AuthenticationHandlerUtil.java |
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2019, Bojan Vitnik <bvitnik@mainstream.rs>
# 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 sys
import importlib
import pytest
from .Fake... | unknown | codeparrot/codeparrot-clean | ||
remote_write:
- url: localhost:9090
name: queue1
- url: localhost:9091
name: queue1 | unknown | github | https://github.com/prometheus/prometheus | config/testdata/remote_write_dup.bad.yml |
export default function Container({ children }) {
return <div className="container mx-auto px-5">{children}</div>;
} | typescript | github | https://github.com/vercel/next.js | examples/cms-agilitycms/components/container.tsx |
# -*- coding=utf-8 -*-
from models import *
import utils
import copy
from heapq import heappop, heappush
"""
some algorithms below using models.EdgesetArray
"""
def TopoSort(DGlist):
"""
can not act as a visitor to visit this nodes, to get circle path,
because it has been confirmed: computer cannot judge ... | unknown | codeparrot/codeparrot-clean | ||
/*-------------------------------------------------------------------------
* norm_test.c
* Program to test Unicode normalization functions.
*
* Portions Copyright (c) 2017-2026, PostgreSQL Global Development Group
*
* IDENTIFICATION
* src/common/unicode/norm_test.c
*
*--------------------------------------... | c | github | https://github.com/postgres/postgres | src/common/unicode/norm_test.c |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import main.models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='ArchivistsToolkitConfig',
fields=[
... | unknown | codeparrot/codeparrot-clean | ||
/* _types module */
#include "Python.h"
#include "pycore_descrobject.h" // _PyMethodWrapper_Type
#include "pycore_lazyimportobject.h" // PyLazyImport_Type
#include "pycore_namespace.h" // _PyNamespace_Type
#include "pycore_object.h" // _PyNone_Type, _PyNotImplemented_Type
#include "pycore_unionobject.h" ... | c | github | https://github.com/python/cpython | Modules/_typesmodule.c |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2008 Zsolt Foldvari
#
# 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) ... | unknown | codeparrot/codeparrot-clean | ||
"""distutils.command.config
Implements the Distutils 'config' command, a (mostly) empty command class
that exists mainly to be sub-classed by specific module distributions and
applications. The idea is that while every "config" command is different,
at least they're all named the same, and users always see "config" i... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-framework | spring-context/src/main/java/org/springframework/context/config/PropertyOverrideBeanDefinitionParser.java |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from django.test import TestCase
from zerver.lib.test_helpers import (
AuthedTestCase,
most_recent_message,
most_recent_usermessage,
)
from zerver.models import (
get_display_recipient, get_stream, get_user_profile_by_email,
Recipient... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2015 The etcd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// 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/doc.go |
'''
Copyright 2020 hyouka266@gmail.com
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, softwa... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Tristan Fischer (sphere@dersphere.de)
#
# 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 Lice... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import certificates.models
import model_utils.fields
import xmodule_django.models
import django_extensions.db.fields
import django_extensions.db.fields.json
import django.db.models.deletion
import django.utils.time... | unknown | codeparrot/codeparrot-clean | ||
from boxsdk import Client, OAuth2
from boxsdk.network.default_network import DefaultNetwork
from pprint import pformat
import requests
print('Downloading public test data...')
PUBLIC_URL = 'https://berkeley.box.com/shared/static/c4tqpu0h601b2ypimpst3uutfc8e4s93.zip'
# Writes test_data_public.zip to test-data/
resp =... | unknown | codeparrot/codeparrot-clean | ||
/*
* 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 | android/guava/src/com/google/common/collect/ReverseNaturalOrdering.java |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | unknown | codeparrot/codeparrot-clean | ||
import re
from django import forms
from django.core.files.uploadedfile import InMemoryUploadedFile
from django.forms.util import flatatt
from django.forms.widgets import FileInput
from django.template import Context
from django.template.loader import render_to_string
from django.utils import formats, six
from django.u... | unknown | codeparrot/codeparrot-clean | ||
import _plotly_utils.basevalidators
class HoverlabelValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="hoverlabel", parent_name="densitymapbox", **kwargs):
super(HoverlabelValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_... | unknown | codeparrot/codeparrot-clean | ||
import dask.dataframe as dd
import pandas.util.testing as tm
import pandas as pd
def test_make_timeseries():
df = dd.demo.make_timeseries('2000', '2015', {'A': float, 'B': int, 'C': str},
freq='2D', partition_freq='6M')
assert df.divisions[0] == pd.Timestamp('2000-01-31', offs... | unknown | codeparrot/codeparrot-clean | ||
# (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 | ||
import numpy as np
import scipy.sparse as sp
from scipy import linalg
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_a... | 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 applica... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010 Zuza Software Foundation
#
# This file is part of the Translate Toolkit.
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
"""ACME plugin for integration tests."""
from __future__ import absolute_import, print_function
import os
import time
from lib.cloud import (
CloudProvider,
CloudEnvironment,
)
from lib.util import (
find_executable,
display,
ApplicationError,
SubprocessError,
)
from lib.http import (
Ht... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: 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 | ||
from keyword import iskeyword as _iskeyword
from operator import itemgetter as _itemgetter
import sys as _sys
def namedtuple(typename, field_names):
"""Returns a new subclass of tuple with named fields.
>>> Point = namedtuple('Point', 'x y')
>>> Point.__doc__ # docstring for the new clas... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
from unittest import TestCase
from wtforms.form import BaseForm, Form
from wtforms.meta import DefaultMeta
from wtforms.fields import TextField, IntegerField
from wtforms.validators import ValidationError
from tests.common import DummyPostData
class BaseFormTest(TestCase):
... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Support;
class DefaultProviders
{
/**
* The current providers.
*
* @var array
*/
protected $providers;
/**
* Create a new default provider collection.
*/
public function __construct(?array $providers = null)
{
$this->providers = $pr... | php | github | https://github.com/laravel/framework | src/Illuminate/Support/DefaultProviders.php |
from pyalgotrade import strategy
from pyalgotrade import plotter
from pyalgotrade.tools import yahoofinance
from pyalgotrade.technical import ma
from pyalgotrade.technical import cumret
from pyalgotrade.stratanalyzer import sharpe
from pyalgotrade.stratanalyzer import returns
class MarketTiming(strategy.BacktestingStr... | unknown | codeparrot/codeparrot-clean | ||
{
"name": "@next/swc-win32-arm64-msvc",
"version": "0.0.0",
"repository": {
"type": "git",
"url": "https://github.com/vercel/next.js",
"directory": "crates/next-napi-bindings/npm/win32-arm64-msvc"
},
"os": [
"win32"
],
"cpu": [
"arm64"
],
"main": "next-swc.win32-arm64-msvc.node",
... | json | github | https://github.com/vercel/next.js | crates/next-napi-bindings/npm/win32-arm64-msvc/package.json |
from collections import OrderedDict
import numpy as np
from bokeh.plotting import ColumnDataSource, figure, show, output_file
from bokeh.models import HoverTool
from bokeh.sampledata.unemployment1948 import data
# Read in the data with pandas. Convert the year column to string
data['Year'] = [str(x) for x in data['Y... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/conformance/ambient/ambientErrors.ts] ////
//// [ambientErrors.ts]
// Ambient variable with an initializer
declare var x = 4;
// Ambient functions with invalid overloads
declare function fn(x: number): string;
declare function fn(x: 'foo'): number;
// Ambient functions with duplicate signatures
dec... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/ambientErrors.js |
# Webhooks for external integrations.
from typing import Any, Dict
from django.http import HttpRequest, HttpResponse
from zerver.decorator import REQ, api_key_only_webhook_view, has_request_variables
from zerver.lib.response import json_success
from zerver.lib.webhooks.common import check_send_webhook_message
from ze... | unknown | codeparrot/codeparrot-clean | ||
"""
Standalone helper file that can be used without any other dependencies int
the software
"""
import errno
import os
import sys
import socket
from importlib import import_module
from urllib.request import urlopen
from urllib.parse import quote, unquote
import logging
log = logging.getLogger("opserv." + __na... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Foundation\Testing;
use Illuminate\Contracts\Console\Kernel;
use Illuminate\Database\ConnectionInterface;
use Illuminate\Foundation\Testing\Traits\CanConfigureMigrationCommands;
use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
trait DatabaseTruncation
{
use CanConfigureMi... | php | github | https://github.com/laravel/framework | src/Illuminate/Foundation/Testing/DatabaseTruncation.php |
#!/bin/sh
#
# Copyright (c) 2012 Peter Baumann
#
test_description='git svn reset clears memoized caches'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./lib-git-svn.sh
svn_ver="$(svn --version --quiet)"
case $svn_ver in
0.* | 1.[0-4].*)
skip_all="skipping git-svn test - SVN... | unknown | github | https://github.com/git/git | t/t9163-git-svn-reset-clears-caches.sh |
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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 the rights to use, copy, modi... | unknown | codeparrot/codeparrot-clean | ||
from fabric import colors
from fabric.api import task
from fabric.api import env
from fabric.api import run
from fabric.api import cd
from fabric.api import prefix
env.hosts = ['cloudtun.es']
env.user = 'cloudtunes'
env.key_filename = '~/.ssh/id_dsa'
GITHUB = 'git@github.com:jakubroztocil/cloudtunes.git'
ROOT = '~'
C... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright (c) 2011, 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... | c | github | https://github.com/mysql/mysql-server | include/my_compare.h |
# -*- coding: utf-8 -*-
##############################################################################
# 2013 E2OpenPlugins #
# #
# This file is open source software; you can redistribute... | unknown | codeparrot/codeparrot-clean | ||
"""
Created on Jul 1, 2012
@author: msouza
"""
import unittest
import os
import sys
import sifter
import FunctionModels.Sifter2
from pprint import pprint
class Test_Sifter_Deaminase(unittest.TestCase):
"""
Tests SIFTER inference and leave one out on a toy family.
"""
def setUp(self):
"""
... | unknown | codeparrot/codeparrot-clean | ||
// Copyright The Prometheus 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 w... | go | github | https://github.com/prometheus/prometheus | util/junitxml/junitxml.go |
'''tzinfo timezone information for Australia/South.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class South(DstTzInfo):
'''Australia/South timezone definition. See datetime.tzinfo for details'''
zone = 'Australia/South'
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'addaddressdialog.ui'
#
# Created: Sat Nov 30 20:35:38 2013
# by: PyQt4 UI code generator 4.10.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
exce... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import template
try:
from django.urls import reverse
except ImportError:
from django.core.urlresolvers import reverse
from cookie_consent.util import (
get_accepted_cookies,
get_cookie_string,
get_cookie_value_from_request... | unknown | codeparrot/codeparrot-clean | ||
# Owner(s): ["module: meta tensors"]
import copy
import gc
import random
import threading
import unittest
import torch
from torch.testing._internal.common_utils import IS_MACOS, run_tests, TestCase
from torch.testing._internal.torchbind_impls import load_torchbind_test_lib
from torch.utils.weak import _WeakHashRef, W... | python | github | https://github.com/pytorch/pytorch | test/test_weak.py |
{
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v2alpha1",
"metadata": {
"name": "v0alpha1.tall_dashboard.v42"
},
"spec": {
"annotations": [
{
"kind": "AnnotationQuery",
"spec": {
"datasource": {
"type": "grafana",
"uid": "-- Grafana ... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/conversion/testdata/output/migrated_dev_dashboards/scenarios/v0alpha1.tall_dashboard.v42.v2alpha1.json |
"""Module for SymPy containers
(SymPy objects that store other SymPy objects)
The containers implemented in this module are subclassed to Basic.
They are supposed to work seamlessly within the SymPy framework.
"""
from __future__ import print_function, division
from sympy.core.basic import Basic
from sy... | unknown | codeparrot/codeparrot-clean | ||
# ===========================================================================
# Copyright 2013 University of Limerick
#
# This file is part of DREAM.
#
# DREAM 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 Founda... | unknown | codeparrot/codeparrot-clean | ||
/*-------------------------------------------------------------------------
*
* geo_selfuncs.c
* Selectivity routines registered in the operator catalog in the
* "oprrest" and "oprjoin" attributes.
*
* Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regent... | c | github | https://github.com/postgres/postgres | src/backend/utils/adt/geo_selfuncs.c |
# frozen_string_literal: true
require_relative "../helper"
module Arel
module Nodes
class TestNamedFunction < Arel::Test
def test_construct
function = NamedFunction.new "omg", "zomg"
assert_equal "omg", function.name
assert_equal "zomg", function.expressions
end
def te... | ruby | github | https://github.com/rails/rails | activerecord/test/cases/arel/nodes/named_function_test.rb |
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User as DjangoUser
from anaf.core.models import Group, Perspective, ModuleSetting
from models import Message, MessageStream
from anaf.identities.models import Contact, ContactType
class MessagingModelsT... | unknown | codeparrot/codeparrot-clean | ||
#
# ip-reputation-monitoring documentation build configuration file, created by
# sphinx-quickstart on Wed Jan 13 16:16:10 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All conf... | unknown | codeparrot/codeparrot-clean | ||
from django.core.management.base import BaseCommand
class Command(BaseCommand):
def add_arguments(self, parser):
subparsers = parser.add_subparsers(dest="subcommand", required=True)
parser_foo = subparsers.add_parser("foo")
parser_foo.add_argument("--bar")
def handle(self, *args, **opt... | python | github | https://github.com/django/django | tests/user_commands/management/commands/subparser_dest.py |
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | unknown | codeparrot/codeparrot-clean | ||
#ifndef SRC_CPPGC_HELPERS_H_
#define SRC_CPPGC_HELPERS_H_
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#include <type_traits> // std::remove_reference
#include "cppgc/garbage-collected.h"
#include "cppgc/name-provider.h"
#include "cppgc/persistent.h"
#include "memory_tracker.h"
#include "util.h"
#include ... | c | github | https://github.com/nodejs/node | src/cppgc_helpers.h |
#!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
#
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (C) 2013 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 | android/guava-tests/test/com/google/common/util/concurrent/ServiceTest.java |
from django.utils.translation import ugettext_lazy as _
from django.views import generic
from django.views.generic import TemplateView
from adhocracy4.dashboard.blueprints import ProjectBlueprint
from adhocracy4.dashboard.components.forms.views import \
ProjectComponentFormView
from adhocracy4.dashboard.mixins imp... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""Python-Pinboard
Python script for downloading your saved stories and saved comments on Hacker News
and converting them to a JSON format for easy use.
Originally written on Pythonista on iPad
"""
__version__ = "1.1"
__license__ = "BSD"
__copyright__ = "Copyright 2013-2014, Luciano Fiandesio"
... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
from numpy.testing import assert_array_equal, assert_equal, assert_raises
from skimage.morphology import remove_small_objects
test_image = np.array([[0, 0, 0, 1, 0],
[1, 1, 1, 0, 0],
[1, 1, 1, 0, 1]], bool)
def test_one_connectivity():
expected = np... | unknown | codeparrot/codeparrot-clean | ||
import os, sys
import datetime
import iris
import iris.unit as unit
import iris.analysis.cartography
import numpy as np
import iris.analysis.geometry
from shapely.geometry import Polygon
from iris.coord_categorisation import add_categorised_coord
import imp
imp.load_source('UnrotateUpdateCube', '/nfs/see-fs-01_use... | unknown | codeparrot/codeparrot-clean | ||
"""HTML utilities suitable for global use."""
from __future__ import unicode_literals
import re
from django.utils import six
from django.utils.encoding import force_str, force_text
from django.utils.functional import allow_lazy
from django.utils.http import RFC3986_GENDELIMS, RFC3986_SUBDELIMS
from django.utils.safe... | unknown | codeparrot/codeparrot-clean | ||
# vim: set encoding=utf-8
# Copyright (c) 2016 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | 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... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2022 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.
//go:build goexperiment.arenas
package reflect
import "arena"
// ArenaNew returns a [Value] representing a pointer to a new zero value for the
// specified t... | go | github | https://github.com/golang/go | src/reflect/arena.go |
import operator_benchmark as op_bench
import torch
"""Microbenchmarks for arange operator"""
# Configs for PT stack operator
configs_short = op_bench.config_list(
attr_names=["start", "end", "step"],
attrs=[
[0, 1000, 2.5],
[-1024, 2048, 1],
],
cross_product_configs={"device": ["cpu"]... | python | github | https://github.com/pytorch/pytorch | benchmarks/operator_benchmark/pt/arange_test.py |
from books.karelians.extraction.extractors.baseExtractor import BaseExtractor
from books.karelians.extractionkeys import KEYS
from interface.valuewrapper import ValueWrapper
from books.karelians.extraction.extractionExceptions import OtherLocationException
from books.karelians.extraction.extractionExceptions import Kar... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
'''
Faraday Penetration Test IDE - Community Version
Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
See the file 'doc/LICENSE' for the license information
'''
'''
File: pickled_dict.py
Author: Daniel J. Foguelman
Description: A persist-to-disk picklebased dictionary with all the ... | unknown | codeparrot/codeparrot-clean | ||
import defaultEntry from "@react-router/dev/config/default-rsc-entries/entry.rsc";
import { RouterContextProvider } from "react-router";
export default {
fetch(request: Request) {
console.log("custom entry.rsc");
const requestContext = new RouterContextProvider();
return defaultEntry.fetch(request, req... | typescript | github | https://github.com/remix-run/react-router | playground/rsc-vite-framework/app/entry.rsc.ts |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Johann Prieur <johann.prieur@gmail.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) an... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2014 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 main
import (
"cmd/internal/archive"
"cmd/internal/telemetry/counter"
"fmt"
"io"
"io/fs"
"log"
"os"
"path/filepath"
)
const usageMessage = `Us... | go | github | https://github.com/golang/go | src/cmd/pack/pack.go |
/*
* Copyright (C) 2008 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 | android/guava-testlib/src/com/google/common/collect/testing/testers/QueuePollTester.java |
name: Build Release Packages
on:
workflow_dispatch:
inputs:
source-event:
description: If this workflow was triggered by another workflow, this value should be set to the GITHUB_EVENT_NAME of that source workflow.
type: string
required: false
default: workflow_dispatch
sche... | unknown | github | https://github.com/grafana/grafana | .github/workflows/release-build.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 may n... | java | github | https://github.com/apache/kafka | connect/runtime/src/main/java/org/apache/kafka/connect/storage/ConfigBackingStore.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 may n... | java | github | https://github.com/apache/kafka | clients/src/main/java/org/apache/kafka/common/requests/DeleteAclsRequest.java |
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
parse_duration,
parse_iso8601,
)
from ..compat import compat_str
class DiscoveryIE(InfoExtractor):
_VALID_URL = r'http://www\.discovery\.com\/[a-zA-Z0-9\-]*/[a-zA-Z0-9\-]*/videos/(?P<id>[a-zA-Z0-9_\-]*)(?:\.htm... | unknown | codeparrot/codeparrot-clean | ||
# GNU Solfege - free ear training software
# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2008, 2011 Tom Cato Amundsen
#
# 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 versio... | unknown | codeparrot/codeparrot-clean | ||
import pytest
INFIX_HYPHEN_TESTS = [
("Явым-төшем күләме.", "Явым-төшем күләме .".split()),
("Хатын-кыз киеме.", "Хатын-кыз киеме .".split()),
]
PUNC_INSIDE_WORDS_TESTS = [
(
"Пассаҗир саны - 2,13 млн — кеше/көндә (2010), 783,9 млн. кеше/елда.",
"Пассаҗир саны - 2,13 млн — кеше / көндә ( 2... | 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 ... | java | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Options.java |
# Copyright (c) 2010 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 | ||
---
- name: create test collection install directory - {{ test_id }}
file:
path: '{{ galaxy_dir }}/ansible_collections'
state: directory
- name: install simple collection from first accessible server
command: ansible-galaxy collection install namespace1.name1 -vvvv
environment:
ANSIBLE_COLLECTIONS_PA... | unknown | github | https://github.com/ansible/ansible | test/integration/targets/ansible-galaxy-collection/tasks/install.yml |
# Copyright 2008-2015 Nokia Solutions and Networks
#
# 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 l... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import json
import requests
from wechat_sdk.exceptions import OfficialAPIError
class WechatRequest(object):
""" WechatRequest 请求类
对微信服务器的请求响应处理进行封装
"""
def __init__(self, conf=None):
"""
:param conf: WechatConf 配置类实例
"""
self.__conf = conf
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2013-2017 Open Architects Consulting SPRL.
# Copyright (C) 2018- Coop IT Easy SCRLfs.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... | 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 | ||
from django.apps.registry import apps as global_apps
from django.db import migrations, router
from .exceptions import InvalidMigrationPlan
from .loader import MigrationLoader
from .recorder import MigrationRecorder
from .state import ProjectState
class MigrationExecutor:
"""
End-to-end migration execution - l... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.http.cio
import io.ktor.http.cio.internals.*
import io.ktor.utils.io.*
import io.ktor.utils.io.core.*
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Delica... | kotlin | github | https://github.com/ktorio/ktor | ktor-http/ktor-http-cio/common/src/io/ktor/http/cio/ChunkedTransferEncoding.kt |
/*
* 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/context/properties/ConfigurationPropertiesCharSequenceToObjectConverter.java |
# frozen_string_literal: true
module InlineJobsManager
def setup
ActiveJob::Base.queue_adapter = :inline
end
def clear_jobs
end
def start_workers
end
def stop_workers
end
end | ruby | github | https://github.com/rails/rails | activejob/test/support/integration/adapters/inline.rb |
# -*- coding: utf-8 -*-
from gluon import current
#from gluon.html import *
from gluon.storage import Storage
from s3 import S3CustomController
THEME = "CRMT"
# =============================================================================
class index(S3CustomController):
""" Custom Home Page """
def __call... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... | go | github | https://github.com/kubernetes/kubernetes | pkg/kubelet/eviction/memory_threshold_notifier.go |
# Partial copy of https://bitbucket.org/gutworth/six/src/8e634686c53a35092dd705172440a9231c90ddd1/six.py?at=default
# With some differences to take into account that the iterXXX version may be defined in user code.
# Original __author__ = "Benjamin Peterson <benjamin@python.org>"
# Base __version__ = "1.7.3"
# Copyri... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.