code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
from fabric.operations import sudo
def stop_beanstalk():
sudo('service beanstalkd stop')
def start_beanstalk():
sudo('service beanstalkd start')
def restart_beanstalk():
stop_beanstalk()
start_beanstalk()
def stop_redis():
sudo('service redis-server stop')
def start_redis():
sudo('service r... | unknown | codeparrot/codeparrot-clean | ||
"""
This module provides functions to perform full Procrustes analysis.
This code was originally written by Justin Kucynski and ported over from
scikit-bio by Yoshiki Vazquez-Baeza.
"""
from __future__ import absolute_import, division, print_function
import numpy as np
from scipy.linalg import orthogonal_procrustes
... | unknown | codeparrot/codeparrot-clean | ||
input + div.svelte-xyz { color: red; }
input ~ div.svelte-xyz { color: red; }
input + h1.svelte-xyz { color: red; }
input ~ h1.svelte-xyz { color: red; }
input + p.svelte-xyz { color: red; }
input ~ p.svelte-xyz { color: red; }
/* (unused) :global(input) + span { color: red; }*/
/* (unused) :global(input... | css | github | https://github.com/sveltejs/svelte | packages/svelte/tests/css/samples/siblings-combinator-global/expected.css |
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | cpp | github | https://github.com/llvm/llvm-project | clang-tools-extra/clang-tidy/readability/RedundantMemberInitCheck.cpp |
#
# The Python Imaging Library.
# $Id$
#
# IM Tools support for PIL
#
# history:
# 1996-05-27 fl Created (read 8-bit images only)
# 2001-02-17 fl Use 're' instead of 'regex' (Python 2.1) (0.2)
#
# Copyright (c) Secret Labs AB 1997-2001.
# Copyright (c) Fredrik Lundh 1996-2001.
#
# See the README file for informatio... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# Sphinx RTD theme demo documentation build configuration file, created by
# sphinx-quickstart on Sun Nov 3 11:56:36 2013.
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
**Supported operators for device: XLA_GPU_JIT**
Operator | Type Constraint
------------------------------------- | ---------------
`Abs` | `T={double,float,int32,int64}`
`Acos` | `T={complex64,double,float,int32,int64}`
`Acosh`... | unknown | github | https://github.com/tensorflow/tensorflow | tensorflow/compiler/tf2xla/g3doc/gpu_supported_ops.md |
import iris
import iris.analysis
import iris.plot as iplt
import matplotlib.pyplot as plt
import matplotlib.colors
import numpy as np
global_air_temp = iris.load_cube(iris.sample_data_path("air_temp.pp"))
regional_ash = iris.load_cube(iris.sample_data_path("NAME_output.txt"))
regional_ash = regional_ash.collapsed("fl... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2018 João Pedro Rodrigues
#
# 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
#
# Unl... | unknown | codeparrot/codeparrot-clean | ||
from django.db import connection, migrations
if connection.features.supports_raster:
from django.contrib.postgres.operations import CreateExtension
class Migration(migrations.Migration):
operations = [
CreateExtension("postgis_raster"),
]
else:
class Migration(migrations.Migr... | python | github | https://github.com/django/django | tests/gis_tests/gis_migrations/migrations/0001_setup_extensions.py |
# Copyright 2014 Cloudbase Solutions Srl
#
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
from tests.factories import UserFactory
from nose.tools import *
from tests.base import OsfTestCase
from scripts.migration.migrate_personal_to_profile_websites import main, get_users_with_social_field
class TestMigrateProfileWebsites(OsfTestCase):
def setUp(self):
super(TestMigrateProfileWebsites, self).s... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2012 OpenStack Foundation
#
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
def is_interactive_env() -> bool:
"""Determine if running within IPython or Jupyter."""
import sys
return hasattr(sys, "ps2") | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/_api/interactive_env.py |
from rez.utils.data_utils import SourceCode
from rez.vendor import yaml
from rez.vendor.yaml.dumper import SafeDumper
from rez.vendor.yaml.nodes import ScalarNode, MappingNode
from rez.vendor.version.version import Version
from rez.vendor.version.requirement import Requirement
from types import FunctionType, BuiltinFun... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2014 The Oppia 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 ... | unknown | codeparrot/codeparrot-clean | ||
#mainscript
from __future__ import print_function
from collections import Counter
import csv,ast,re, itertools, glob,sys,os,datetime
import dresher_LSA as d
import main_1inventoryMover as m
import main_2inventoryParser2 as k
import main_3min_analysis as a1
import main_4efficiency_analysis as a2
"""
2017.01.04
created... | unknown | codeparrot/codeparrot-clean | ||
import re
import sys
from django.utils.six.moves import html_parser as _html_parser
current_version = sys.version_info
use_workaround = (
(current_version < (2, 7, 3)) or
(current_version >= (3, 0) and current_version < (3, 2, 3))
)
try:
HTMLParseError = _html_parser.HTMLParseError
except AttributeError... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2020 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
package geo
import (
"strconv"
"testing"
"github.com/stretchr/testify/require"
)
func TestNormalizeLongitudeDegrees(t *testing.T) {
testCases := []struct {
lng ... | go | github | https://github.com/cockroachdb/cockroach | pkg/geo/latlng_test.go |
/*
* Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.client.plugins
import io.ktor.client.*
import io.ktor.client.call.*
import io.ktor.client.plugins.api.*
import io.ktor.client.request.*
import io.ktor.client.statement.*
impor... | kotlin | github | https://github.com/ktorio/ktor | ktor-client/ktor-client-core/common/src/io/ktor/client/plugins/HttpCallValidator.kt |
#!/usr/bin/env python
# Copyright (c) 2012 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.
"""Helper script to repack paks for a list of locales.
Gyp doesn't have any built-in looping capability, so this just provides a w... | 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/cmd/completion.go |
# -*- coding: utf-8 -*-
# Coh-Metrix-Dementia - Automatic text analysis and classification for dementia.
# Copyright (C) 2014 Andre Luiz Verucci da Cunha
#
# 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 F... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | unknown | codeparrot/codeparrot-clean | ||
import React, { useState } from "react";
import {
Link,
LinkField,
Text,
TextField,
useSitecoreContext,
} from "@sitecore-jss/sitecore-jss-nextjs";
interface Fields {
Id: string;
DisplayName: string;
Title: TextField;
NavigationTitle: TextField;
Href: string;
Querystring: string;
Children: Arra... | typescript | github | https://github.com/vercel/next.js | examples/cms-sitecore-xmcloud/src/components/Navigation.tsx |
# Copyright 2025 the HuggingFace Inc. team and the Swiss AI Initiative. 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... | python | github | https://github.com/huggingface/transformers | src/transformers/models/apertus/modular_apertus.py |
#!/usr/bin/env python
"""
usage: %prog $input $out_file1
-1, --cols=N,N,N,N,N: Columns for start, end, strand in input file
-d, --dbkey=N: Genome build of input file
-o, --output_format=N: the data type of the output file
-g, --GALAXY_DATA_INDEX_DIR=N: the directory containing alignseq.loc
-I, --int... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2016 gRPC 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... | unknown | codeparrot/codeparrot-clean | ||
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Selected(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "histogram"
_path_str = "histogram.selected"
_valid_props = {"marker", "textfont"}
# ma... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (c) 1999-2000 Image Power, Inc. and the University of
* British Columbia.
* Copyright (c) 2001-2003 Michael David Adams.
* All rights reserved.
*/
/* __START_OF_JASPER_LICENSE__
*
* JasPer License Version 2.0
*
* Copyright (c) 2001-2006 Michael David Adams
* Copyright (c) 1999-2000 Image Pow... | c | github | https://github.com/opencv/opencv | 3rdparty/libjasper/jasper/jas_types.h |
---
navigation_title: "Variable width histogram"
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-variablewidthhistogram-aggregation.html
---
# Variable width histogram aggregation [search-aggregations-bucket-variablewidthhistogram-aggregation]
This is a mul... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/aggregations/search-aggregations-bucket-variablewidthhistogram-aggregation.md |
# Copyright (C) 2012 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | 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 | ||
# -*- 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 | ||
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/core/kernels/conv_ops.h |
"""
Forms to support third-party to first-party OAuth 2.0 access token exchange
"""
from django.contrib.auth.models import User
from django.forms import CharField
from edx_oauth2_provider.constants import SCOPE_NAMES
import provider.constants
from provider.forms import OAuthForm, OAuthValidationError
from provider.oaut... | 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-aop/src/testFixtures/java/org/springframework/aop/testfixture/advice/CountingBeforeAdvice.java |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class AuthOAuthProvider(models.Model):
"""Class defining the configuration values of an OAuth2 provider"""
_name = 'auth.oauth.provider'
_description = 'OAuth2 provider'
... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package awsauth
import (
"context"
"fmt"
"github.com/hashicorp/vault/sdk/framework"
"github.com/hashicorp/vault/sdk/logical"
)
// awsStsEntry is used to store details of an STS role for assumption
type awsStsEntry struct {
StsRole string... | go | github | https://github.com/hashicorp/vault | builtin/credential/aws/path_config_sts.go |
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th>0</th>
<th>1</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>0</td>
<td>0</td>
</tr>
</tbody>
</table> | html | github | https://github.com/pandas-dev/pandas | pandas/tests/io/formats/data/html/index_none_columns_unnamed_standard.html |
/*
This file exists so that we use the same weight layout for MoE grouped gemm and regular gemm when the weight is
quantized. The preprocessing code reads this template to know how to organize the quantized weight matrices
to be consumed by CUTLASS.
Note that for int4, ThreadBlockK MUST be 64.
*/
#pragma on... | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/cuda/cutlass_extensions/gemm/kernel/mixed_gemm_B_layout.h |
/*
* 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/DescribeClientQuotasRequest.java |
# encoding: utf-8
"""
Copyright 2013 Jérémie BOUTOILLE
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distri... | unknown | codeparrot/codeparrot-clean | ||
//===-- MemoryTreeTests.cpp -------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | cpp | github | https://github.com/llvm/llvm-project | clang-tools-extra/clangd/unittests/support/MemoryTreeTests.cpp |
from functools import wraps
from inspect import iscoroutinefunction
def no_append_slash(view_func):
"""
Mark a view function as excluded from CommonMiddleware's APPEND_SLASH
redirection.
"""
# view_func.should_append_slash = False would also work, but decorators are
# nicer if they don't have ... | python | github | https://github.com/django/django | django/views/decorators/common.py |
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
use std::sync::Arc;
use super::run_item_main_thread;
use super::sealed::ContextMenuBase;
use super::{
AboutMetadata, IsMenuItem, Menu, MenuInner, MenuItemKind, PredefinedMenuI... | rust | github | https://github.com/tauri-apps/tauri | crates/tauri/src/menu/menu.rs |
from ..Qt import QtGui, QtCore
from ..SignalProxy import SignalProxy
import sys
from ..pgcollections import OrderedDict
from ..python2_3 import asUnicode
class ComboBox(QtGui.QComboBox):
"""Extends QComboBox to add extra functionality.
* Handles dict mappings -- user selects a text key, and the ComboBox indic... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
All out rational-rules style gibbs on lexicons.
For MPI or local.
This is much slower than the vectorized versions.
MPI run:
$ mpiexec --hostfile ../../hosts.mpich2 -n 15 python Search_MCMC.py
"""
from LOTlib.MPI.MPI_map import MPI_map
from LOTlib import mh_sample
from LOTlib.FiniteBestSe... | unknown | codeparrot/codeparrot-clean | ||
5000000.times { 42.quo(3) } | ruby | github | https://github.com/ruby/ruby | benchmark/int_quo.rb |
# 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.
import logging
import psutil
import signal
from pylib.device import device_errors
from pylib.device import device_utils
def _KillWebServers():
for s in [... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env sh
set -e
EXITCODE=0
# bits of this were adapted from lxc-checkconfig
# see also https://github.com/lxc/lxc/blob/lxc-1.0.2/src/lxc/lxc-checkconfig.in
possibleConfigs="
/proc/config.gz
/boot/config-$(uname -r)
/usr/src/linux-$(uname -r)/.config
/usr/src/linux/.config
"
if [ $# -gt 0 ]; then
CONFI... | unknown | github | https://github.com/moby/moby | contrib/check-config.sh |
#!/usr/bin/env python
# Copyright (c) 2012 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.
"""Regenerates all the .isolated test data files.
Keep in sync with ../run_isolated_smoke_test.py.
"""
import glob
import hashlib... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import csv
from EPPs.common import StepEPP
class ParseFluidXScan(StepEPP):
_max_nb_input_containers = 1
# additional argument required to obtain the file location for newly create manifest in the LIMS step
def __init__(self, argv=None):
super().__init__(argv)
self.fl... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#Copyright (C) 2009-2011 :
# Denis GERMAIN, dt.germain@gmail.com
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
# Hartmut Goebel, h.goebel@goebel-consult.de
#
#This file is part of Shinken.
#
#Shinken is free softwa... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2007, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions ... | c | github | https://github.com/google/googletest | googlemock/test/gmock-matchers_test.h |
#! /usr/bin/env python
from __future__ import division, print_function, absolute_import
import numpy as np
import matplotlib.pyplot as plt
import ref_quat_float
import ref_quat_int
steps = 512 * 2
ref_eul_res = np.zeros((steps, 3))
ref_quat_res = np.zeros((steps, 3))
ref_quat_float.init()
ref_quat_int.init()
# re... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright (c) 2014 Rackspace
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Author: Costin Constantin <costin.c.constantin@intel.com>
# Copyright (c) 2015 Intel Corporation.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restrictio... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env bash
# Copyright IBM Corp. 2016, 2025
# SPDX-License-Identifier: BUSL-1.1
set -e
fail() {
echo "$1" 1>&2
exit 1
}
[[ -z "$EXPECTED_SEAL_TYPE" ]] && fail "EXPECTED_SEAL_TYPE env variable has not been set"
[[ -z "$VAULT_ADDR" ]] && fail "VAULT_ADDR env variable has not been set"
[[ -z "$VAULT_INSTAL... | unknown | github | https://github.com/hashicorp/vault | enos/modules/verify_seal_type/scripts/verify-seal-type.sh |
# -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
class CefSpiderMiddleware(object):
# Not all methods need to be defined. If a method is not defined,
# scrapy acts ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2014 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright 2005-2016 The Mumble Developers. All rights reserved.
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file at the root of the
# Mumble source tree or at <https://www.mumble.info/LICENSE>.
#
#
# cipherinfo.py
# Generate static TLS cipher... | unknown | codeparrot/codeparrot-clean | ||
from pytest import raises
from flexx.util.testing import run_tests_if_main
from flexx.pyscript import py2js, evaljs
from flexx.app.serialize import Serializer, serializer
class Foo:
def __init__(self, val):
self.val = val
def __json__(self):
return {'__type__': 'Foo', 'val': self.val}
def... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import datetime
import json
import functools
from Queue import Queue
import six
from twisted.application.service import Service
from twisted.internet import defer
from bouser.excs import SerializableBaseException, ExceptionWrapper
from twisted.web.http import Request
from bouser.web.cors import... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 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 | ||
""" Sahana Eden Module Automated Tests - Test Roles
@copyright: 2012 (c) Sahana Software Foundation
@license: MIT
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
r... | unknown | codeparrot/codeparrot-clean | ||
# Since this package contains a "django" module, this is required on Python 2.
from __future__ import absolute_import
import io
import string
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.template import TemplateDoesNotExist
from django.utils.html import conditio... | unknown | codeparrot/codeparrot-clean | ||
# the implementation here is a bit crappy.
from boxbranding import getBoxType
import time
from Directories import resolveFilename, SCOPE_CONFIG
PERCENTAGE_START = 0
PERCENTAGE_END = 100
profile_start = time.time()
profile_data = {}
total_time = 1
profile_file = None
try:
f = open(resolveFilename(SCOPE_CONFIG, "pro... | unknown | codeparrot/codeparrot-clean | ||
import contextlib
import os
import pickle
import signal
import sys
from textwrap import dedent
import threading
import types
import unittest
from test import support
from test.support import os_helper
from test.support import script_helper
from test.support import import_helper
from test.support.script_helper import a... | python | github | https://github.com/python/cpython | Lib/test/test_interpreters/test_api.py |
"""
COMMAND-LINE SPECIFIC STUFF
=============================================================================
The rest of the code is specifically for handling the case where Python
Markdown is called from the command line.
"""
import markdown
import sys
import logging
from logging import DEBUG, INFO, WARN, ERROR, CR... | unknown | codeparrot/codeparrot-clean | ||
# resb
<!-- cargo-rdme start -->
`resb` is a utility crate of the [`ICU4X`] project for working with ICU
resource bundle files.
It comprises modules for reading and optionally writing [`binary`] `.res`
files as well as optionally for reading [`text`] bundles.
[`ICU4X`]: ../icu/index.html
<!-- cargo-rdme end -->
#... | unknown | github | https://github.com/nodejs/node | deps/crates/vendor/resb/README.md |
"Test format, coverage 99%."
from idlelib import format as ft
import unittest
from unittest import mock
from test.support import requires
from tkinter import Tk, Text
from idlelib.editor import EditorWindow
from idlelib.idle_test.mock_idle import Editor as MockEditor
class Is_Get_Test(unittest.TestCase):
"""Test ... | python | github | https://github.com/python/cpython | Lib/idlelib/idle_test/test_format.py |
CREATE EXTENSION dblink;
-- directory paths and dlsuffix are passed to us in environment variables
\getenv abs_srcdir PG_ABS_SRCDIR
\getenv libdir PG_LIBDIR
\getenv dlsuffix PG_DLSUFFIX
\set regresslib :libdir '/regress' :dlsuffix
-- create some functions needed for tests
CREATE FUNCTION setenv(text, text)
RETURN... | sql | github | https://github.com/postgres/postgres | contrib/dblink/sql/dblink.sql |
-- the first program in every language
io.write("Hello world, from ",_VERSION,"!\n") | unknown | github | https://github.com/redis/redis | deps/lua/test/hello.lua |
from django.core.exceptions import ImproperlyConfigured
from django.shortcuts import get_object_or_404
class XFormIdStringLookupMixin(object):
lookup_id_string = 'id_string'
def get_object(self, queryset=None):
if queryset is None:
queryset = self.filter_queryset(self.get_queryset())
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2007 Red Hat, Inc.
# Copyright (C) 2008 One Laptop Per Child
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later ve... | unknown | codeparrot/codeparrot-clean | ||
from yowsup.structs import ProtocolTreeNode
from yowsup.layers.protocol_iq.protocolentities import ResultIqProtocolEntity
class SuccessAddParticipantsIqProtocolEntity(ResultIqProtocolEntity):
'''
<iq type="result" from="{{group_jid}}" id="{{id}}">
<add type="success" participant="{{jid}}"></add>
... | unknown | codeparrot/codeparrot-clean | ||
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... | unknown | codeparrot/codeparrot-clean | ||
# 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 | ||
/*
* 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.server.routing
import io.ktor.server.application.*
/**
* Gets the root of the routing block.
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.server.routing... | kotlin | github | https://github.com/ktorio/ktor | ktor-server/ktor-server-core/common/src/io/ktor/server/routing/RoutingIntrospection.kt |
## Input
```javascript
// @enableJsxOutlining
function Component({arr}) {
const x = useX();
return (
<>
{arr.map((i, id) => {
return (
<Bar key={id} x={x}>
<Baz i={i}></Baz>
<Joe j={i}></Joe>
<Foo k={i}></Foo>
</Bar>
);
})}
... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-outlining-separate-nested.expect.md |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.utils.encoding import python_2_unicode_compatible
from pg_fts.fields import TSVectorField
from django.db import models
@python_2_unicode_compatible
class TSQueryModel(models.Model):
title = models.CharField(max_length=50)
body = model... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (c) 2016 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockito.internal.configuration.plugins;
import org.mockito.plugins.PluginSwitch;
class DefaultPluginSwitch implements PluginSwitch {
@Override
public boolean isEnabled(String plu... | java | github | https://github.com/mockito/mockito | mockito-core/src/main/java/org/mockito/internal/configuration/plugins/DefaultPluginSwitch.java |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2014, Mario Vilas
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above... | unknown | codeparrot/codeparrot-clean | ||
const { CacheHandler } = require("@neshca/cache-handler");
const createRedisHandler = require("@neshca/cache-handler/redis-stack").default;
const createLruHandler = require("@neshca/cache-handler/local-lru").default;
const { createClient } = require("redis");
const { PHASE_PRODUCTION_BUILD } = require("next/constants")... | javascript | github | https://github.com/vercel/next.js | examples/cache-handler-redis/cache-handler.js |
// Copyright 2021 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 | tests/common/grpc_test.go |
#!/bin/bash
# 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 ... | unknown | github | https://github.com/apache/kafka | bin/kafka-share-groups.sh |
{
"SETID": {
"summary": "Sets the last-delivered ID of a consumer group.",
"complexity": "O(1)",
"group": "stream",
"since": "5.0.0",
"arity": -5,
"container": "XGROUP",
"function": "xgroupCommand",
"history": [
[
"7.0.0",
... | json | github | https://github.com/redis/redis | src/commands/xgroup-setid.json |
use anyhow::Result;
#[allow(unused_imports)]
use turbo_rcstr::RcStr;
use turbo_tasks::Vc;
use turbo_tasks_fs::FileSystemPath;
use turbopack::module_options::ModuleRule;
#[allow(unused_imports)]
use turbopack_core::{context::AssetContext, resolve::origin::ResolveOrigin};
use crate::next_config::NextConfig;
pub async f... | rust | github | https://github.com/vercel/next.js | crates/next-core/src/next_shared/transforms/swc_ecma_transform_plugins.rs |
from rest_framework import generics
from rest_framework import permissions as drf_permissions
from rest_framework.exceptions import NotFound
from api.base import permissions as base_permissions
from api.base.views import JSONAPIBaseView
from api.base.filters import ListFilterMixin
from api.base.pagination import MaxSi... | unknown | codeparrot/codeparrot-clean | ||
"""Read genome build configurations from Galaxy *.loc and bcbio-nextgen resource files.
"""
from six.moves import configparser
import glob
import os
import sys
from xml.etree import ElementTree
import toolz as tz
import yaml
from bcbio import utils
from bcbio.cwl import cwlutils
from bcbio.distributed import objectst... | unknown | codeparrot/codeparrot-clean | ||
import os
import platform
import re
import subprocess
import sys
import lit.formats
import lit.util
from lit.llvm import llvm_config
from lit.llvm.subst import ToolSubst
# Configuration file for the 'lit' test runner.
# name: The name of this test suite.
config.name = "cross-project-tests"
# testFormat: The test f... | python | github | https://github.com/llvm/llvm-project | cross-project-tests/lit.cfg.py |
import urlparse
from couchbase import Couchbase, exceptions as cb_exc
class CouchbaseStorage(object):
"""
A storage backend using Couchbase
You must supply a COUCHBASE_URL setting that is passed through urlparse.
All parameters supplied get passed through to Couchbase
Examples:
* couchbase:... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import datetime
from run_utils import *
class TestSuite(object):
def __init__(self, options, cache):
self.options = options
self.cache = cache
self.nameprefix = "opencv_" + self.options.mode + "_"
self.tests = self.cache.gatherTests(self.nameprefix + "*", self... | unknown | codeparrot/codeparrot-clean | ||
{
"format_version": "1.0",
"values": {
"root_module": {
"resources": [
{
"address": "tfcoremock_complex_resource.complex",
"mode": "managed",
"name": "complex",
"provider_name": "registry.terraform.io/hashicorp/tfcoremock",
"schema_version": 0,
... | json | github | https://github.com/hashicorp/terraform | testing/equivalence-tests/outputs/fully_populated_complex/state.json |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | unknown | codeparrot/codeparrot-clean | ||
#
# Copyright (c) 2005
# The President and Fellows of Harvard College.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2006-2007 The Regents of The University of Michigan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this ... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.