code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
#!/usr/bin/env python3
# Copyright (C) 2017 Hamburg University of Applied Sciences
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
import sys
from testrunner import run
def testfunc(child):
c... | unknown | codeparrot/codeparrot-clean | ||
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import subprocess
import sys
import mozinfo
from mozprocess import ProcessHandler
from mozprofile import Fire... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/conformance/async/es5/awaitCallExpression/awaitCallExpression5_es5.ts] ////
//// [awaitCallExpression5_es5.ts]
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boole... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/awaitCallExpression5_es5(target=es2015).js |
import serial
import time
class ControlUnit:
def __init__(self, ser, protocol):
self.ser = ser
self.protocol = protocol
def getCommand(self, commandId):
self.ser.write([commandId])
responseId = self.read_byte()
if (responseId < 11 or responseId > 20):
return False
data = 0
if (responseId == 12):
... | unknown | codeparrot/codeparrot-clean | ||
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from src/transformers/models/glm46v/modular_glm46v.py.
# Do NOT edit this file manually as any edits will be overwritten by the generation of
... | python | github | https://github.com/huggingface/transformers | src/transformers/models/glm46v/video_processing_glm46v.py |
from unittest import TestCase
import simplejson as json
# from http://json.org/JSON_checker/test/pass1.json
JSON = r'''
[
"JSON Test Pattern pass1",
{"object with 1 member":["array with 1 element"]},
{},
[],
-42,
true,
false,
null,
{
"integer": 1234567890,
"real": -... | unknown | codeparrot/codeparrot-clean | ||
package service
import "strings"
// normalizeVolumeName is a platform specific function to normalize the name
// of a volume. On Windows, as NTFS is case insensitive, under
// c:\ProgramData\Docker\Volumes\, the folders John and john would be synonymous.
// Hence we can't allow the volume "John" and "john" to be crea... | go | github | https://github.com/moby/moby | daemon/volume/service/store_windows.go |
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... | unknown | codeparrot/codeparrot-clean | ||
"Database cache backend."
import base64
from datetime import datetime
try:
from django.utils.six.moves import cPickle as pickle
except ImportError:
import pickle
from django.conf import settings
from django.core.cache.backends.base import BaseCache, DEFAULT_TIMEOUT
from django.db import connections, transacti... | unknown | codeparrot/codeparrot-clean | ||
# coding=utf-8
"""
The FlutendCollector monitors fluentd and data about the kinesis stream.
#### Dependencies
* flutend
#### Example config
```
enabled = True
host = localhost
port = 24220
[[[collect]]]
kinesis = buffer_queue_length, buffer_total_queued_size, retry_count
```
"""
import d... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
from bottle import run,route,app,request,response,template,default_app,Bottle,debug,abort
import sys
import os
import platform
import subprocess
import re
#from flup.server.fcgi import WSGIServer
#from cStringIO import StringIO
#import memcache
app = Bottle()
default_app.push(app)
VERSION = "2.2"
p... | unknown | codeparrot/codeparrot-clean | ||
import { test } from '../../test';
export default test({
hasGlobal: false
}); | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/tests/css/samples/global-local-nested/_config.js |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2015, Toshio Kuraotmi <tkuratomi@ansible.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, eithe... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import annotations
import functools
import re
import textwrap
from typing import (
TYPE_CHECKING,
Literal,
cast,
)
import unicodedata
import numpy as np
from pandas._libs import lib
import pandas._libs.missing as libmissing
import pandas._libs.ops as libops
from pandas.util._validators im... | python | github | https://github.com/pandas-dev/pandas | pandas/core/strings/object_array.py |
"""multipart/form-data encoding module
This module provides functions that faciliate encoding name/value pairs
as multipart/form-data suitable for a HTTP POST or PUT request.
multipart/form-data is the standard way to upload files over HTTP"""
__all__ = ['gen_boundary', 'encode_and_quote', 'MultipartParam',
... | unknown | codeparrot/codeparrot-clean | ||
import { render, fireEvent, waitFor, screen } from "@testing-library/react";
import "@testing-library/jest-dom";
import * as React from "react";
import * as TestRenderer from "react-test-renderer";
import {
BrowserRouter,
MemoryRouter,
Routes,
Route,
RouterProvider,
NavLink,
Outlet,
createBrowserRouter,... | typescript | github | https://github.com/remix-run/react-router | packages/react-router/__tests__/dom/nav-link-active-test.tsx |
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/hwmon/amd,sbtsi.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: >
Sideband interface Temperature Sensor Interface (SB-TSI) compliant
AMD SoC temperature device
maintainers:
- Kun Yi <ku... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/hwmon/amd,sbtsi.yaml |
"""Cross-interpreter Queues High Level Module."""
import queue
import time
import weakref
import _interpqueues as _queues
from . import _crossinterp
# aliases:
from _interpqueues import (
QueueError, QueueNotFoundError,
)
from ._crossinterp import (
UNBOUND_ERROR, UNBOUND_REMOVE,
)
__all__ = [
'UNBOUND',... | python | github | https://github.com/python/cpython | Lib/concurrent/interpreters/_queues.py |
<!--Copyright 2022 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | unknown | github | https://github.com/huggingface/transformers | docs/source/en/tasks/audio_classification.md |
//===----------------------------------------------------------------------===//
//
// 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
//
//===---------------------------... | c | github | https://github.com/llvm/llvm-project | clang-tools-extra/clang-tidy/abseil/DurationRewriter.h |
import pytest
from pandas import Series
mpl = pytest.importorskip("matplotlib")
plt = pytest.importorskip("matplotlib.pyplot")
from pandas.plotting._matplotlib.style import get_standard_colors
class TestGetStandardColors:
@pytest.mark.parametrize(
"num_colors, expected",
[
(3, ["red",... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/plotting/test_style.py |
#!/usr/bin/env python
# Copyright (c) 2012 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 that app bundles are built correctly.
"""
import TestGyp
import TestMac
import os
import plistlib
import subprocess
import sy... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (c) 2018 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockito.internal.listeners;
/**
* Listener that is automatically cleaned up (removed from the the global list of subscribers).
* For now, we don't intend to make this interface public.
... | java | github | https://github.com/mockito/mockito | mockito-core/src/main/java/org/mockito/internal/listeners/AutoCleanableListener.java |
import Image from "next/image";
export default function Avatar({ name, picture }) {
return (
<div className="flex items-center">
<div className="w-12 h-12 relative mr-4">
<Image
src={picture}
layout="fill"
className="rounded-full"
alt={name}
/>
... | javascript | github | https://github.com/vercel/next.js | examples/cms-graphcms/components/avatar.js |
import unittest
from tornado.options import define, options
from m2core.utils.tests import RESTTest
from m2core.utils.data_helper import DataHelper
from m2core import M2Core
from m2core.bases import http_statuses
from tornado.escape import json_decode
from example.models import User
# init empty object to pass it thro... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright 2012 Nicolas Wack <wackou@gmail.com>
#
# This file is part of subliminal.
#
# subliminal 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 Licen... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#===============================================================================
# objdump2vmh.py
#===============================================================================
#
# -h --help Display this message
# -v --verbose Verbose mode
# -f --file Objdump file to parse
#
# Author... | unknown | codeparrot/codeparrot-clean | ||
# SkinDesigner: A Plugin for Building Skin Design (GPL) started by Santiago Garay
# This file is part of SkinDesigner.
#
# Copyright (c) 2017, Santiago Garay <sgaray1970@gmail.com>
# SkinDesigner is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published... | unknown | codeparrot/codeparrot-clean | ||
/*-------------------------------------------------------------------------
*
* parse_func.c
* handle function calls in parser
*
* Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* src/backend/... | c | github | https://github.com/postgres/postgres | src/backend/parser/parse_func.c |
#!/usr/bin/env python
#
# Copyright 2011,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your optio... | unknown | codeparrot/codeparrot-clean | ||
{
"version": 6,
"cmakeMinimumRequired": {
"major": 3,
"minor": 20,
"patch": 0
},
"configurePresets": [
{
"name": "llvm-build-shared-libs",
"hidden": true,
"description": "Build shared libraries",
"cacheVariables": {
"BUILD_SHARED_LIBS": true
}
},
{
... | json | github | https://github.com/llvm/llvm-project | llvm/CMakePresets.json |
# -*- coding: utf-8 -*-
#
# Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | unknown | codeparrot/codeparrot-clean | ||
import tempfile
import os
from oeqa.oetest import oeRuntimeTest
from oeqa.utils.helper import get_files_dir
TESTCMD = b"""
export ROS_ROOT=/opt/ros
export ROS_DISTRO=indigo
export ROS_PACKAGE_PATH=/opt/ros/indigo/share
export PATH=$PATH:/opt/ros/indigo/bin
export LD_LIBRARY_PATH=/opt/ros/indigo/lib
export PYTHONPATH=/... | 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/main/java/org/springframework/aop/aspectj/AspectInstanceFactory.java |
/*-------------------------------------------------------------------------
*
* char.c
* Functions for the built-in type "char" (not to be confused with
* bpchar, which is the SQL CHAR(n) type).
*
* Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents o... | c | github | https://github.com/postgres/postgres | src/backend/utils/adt/char.c |
# 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.
# This file is based on gdb_rsp.py file from NaCl repository.
import re
import socket
import time
def RspChecksum(data):
checksum = 0
for char in d... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
import theano
import theano.tensor as T
import lasagne as nn
import data
import load
import nn_plankton
import dihedral
import dihedral_fast
import tmp_dnn
import tta
validation_split_path = "splits/bagging_split_10.pkl"
patch_size = (92, 92)
augmentation_params = {
'zoom_range': (1 / 1.6, 1... | 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/test/java/org/springframework/aop/aspectj/BeforeAdviceBindingTests.java |
# coding: utf-8
import re
import sublime
DEFAULT_STRATEGIES_FILE = 'Encoding Manager Strategies - Default.sublime-settings'
USER_STRATEFIES_FILE = 'Encoding Manager Strategies - User.sublime-settings'
class StrategiesManager:
"""
Load and manage strategies for plugin.
"""
def __init__(self):
default ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
gateway tests - Rendering Defaults
Copyright 2009-2013 Glencoe Software, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
pytest fixtures used as defined in conftest.py:
- gatewaywrapper
- author_testimg_tiny
- au... | unknown | codeparrot/codeparrot-clean | ||
#ifndef OPENCV_CORE_HAL_INTERFACE_H
#define OPENCV_CORE_HAL_INTERFACE_H
//! @addtogroup core_hal_interface
//! @{
//! @name Return codes
//! @{
#define CV_HAL_ERROR_OK 0
#define CV_HAL_ERROR_NOT_IMPLEMENTED 1
#define CV_HAL_ERROR_UNKNOWN -1
//! @}
#ifdef __cplusplus
#include <cstddef>
#else
#include <stddef.h>
#incl... | c | github | https://github.com/opencv/opencv | modules/core/include/opencv2/core/hal/interface.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... | unknown | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/site/markdown/release/0.17.0/CHANGELOG.0.17.0.md |
/*
* 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/convert/StringToPeriodConverter.java |
import { useLocalStorage } from './useLocalStorage';
import { renderHook, act } from '@testing-library/react-hooks';
describe('useLocalStorage', () => {
it('returns the initialState', () => {
const initialState = { a: 1, b: 2 };
const { result } = renderHook(() => useLocalStorage('mystorage', initialState));... | typescript | github | https://github.com/prometheus/prometheus | web/ui/react-app/src/hooks/useLocalStorage.test.tsx |
// errorcheckwithauto -0 -m -d=inlfuncswithclosures=1
//go:build !goexperiment.newinliner
// Copyright 2015 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.
// Test, using compiler diagnostic flags, that inlining is working.
... | go | github | https://github.com/golang/go | test/inline.go |
#!/usr/bin/env python
# Copyright 2015 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 appli... | unknown | codeparrot/codeparrot-clean | ||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/net/apm,xgene-mdio-rgmii.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: APM X-Gene SoC MDIO
maintainers:
- Iyappan Subramanian <iyappan@os.amperecomputing.com>
- Keyur Chudgar <keyur@os.... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/net/apm,xgene-mdio-rgmii.yaml |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
import os.path as osp
import sys
import os
import six
import platform
BASEDIR = osp.abspath(osp.dirname(__file__))
if platform.system() == "Windows":
DLLNAME = 'cambdll.dll'
else:
DLLNAME = 'camblib.so'
CAMBL = osp.join(BASEDIR, DLLNAME)
mock_load = os.environ.get('READTHEDOCS', None)
if not mock_load:
i... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased
import org.jetbrains.kotlin.ana... | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-fe10/src/org/jetbrains/kotlin/analysis/api/descriptors/symbols/descriptorBased/KaFe10DescAnonymousObjectSymbol.kt |
---
applies_to:
stack:
serverless:
navigation_title: "Multivalued fields"
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/reference/current/esql-multivalued-fields.html
---
# {{esql}} multivalued fields [esql-multivalued-fields]
{{esql}} can read from multivalued fields:
$$$esql-multivalued-field... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/query-languages/esql/esql-multivalued-fields.md |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
### BEGIN LICENSE
# Copyright (C) 2009 Didier Roche <didrocks@ubuntu.com>
#This program is free software: you can redistribute it and/or modify it
#under the terms of the GNU General Public License version 3, as published
#by the Free Software Foundation.
#
#This program is... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2017 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 testing_test
import (
"sync"
"testing"
)
// The line numbering of this file is important for TestTBHelper.
func notHelper(t *testing.T, msg string)... | go | github | https://github.com/golang/go | src/testing/helperfuncs_test.go |
#!/usr/bin/env python
'''
EC2 external inventory script
=================================
Generates inventory that Ansible can understand by making API request to
AWS EC2 using the Boto library.
NOTE: This script assumes Ansible is being executed where the environment
variables needed for Boto have already been set:... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright 2011-2012 Andreas Wundsam
# Copyright 2011-2012 Colin Scott
# Copyright 2011-2013 James McCauley
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# h... | unknown | codeparrot/codeparrot-clean | ||
import datetime as dt
from wallstreet.blackandscholes import BlackandScholes as BS
class Option:
def __init__(self, type_, strike, expiration):
self.type = type_
self.strike = strike
self.expiration = expiration
def __str__(self):
return f'{self.expiration :%m/%d/%Y} {self.strike} {self.type}'
@staticmeth... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2023 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/robustness/report/client_test.go |
"""
URLResolver Addon for Kodi
Copyright (C) 2016 t0mm0, tknorris
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 late... | unknown | codeparrot/codeparrot-clean | ||
def find_First_Missing(array,start,end):
if (start > end):
return end + 1
if (start != array[start]):
return start;
mid = int((start + end) / 2)
if (array[mid] == mid):
return find_First_Missing(array,mid+1,end)
return find_First_Missing(array,start,mid) | unknown | mbpp | ||
/* Global input styles */
@use './typography';
@use './theme' as th;
.ng-input,
.ng-select,
.ng-textarea {
@extend %body-01;
color: var(--primary-contrast);
background: var(--color-foreground);
border: none;
padding: 0.375rem 0.75rem;
border-radius: 2rem;
box-sizing: border-box;
}
.ng-input {
&::place... | unknown | github | https://github.com/angular/angular | devtools/projects/ng-devtools/src/styles/_inputs.scss |
name: External PR labelling
on:
# We need "write" permissions on the PR to be able to add a label.
pull_request_target: # zizmor: ignore[dangerous-triggers] We need this to have labelling permissions. There are no user inputs here, so we should be fine.
types:
- opened
permissions: {}
jobs:
label-if-... | unknown | github | https://github.com/grafana/grafana | .github/workflows/pr-external-labelling.yml |
"""
MySensors notification service.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/notify.mysensors/
"""
from homeassistant.components import mysensors
from homeassistant.components.notify import (ATTR_TARGET,
Ba... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import os
from hashlib import md5
from io import BytesIO
from lxml import etree
from datetime import datetime
from scrapy.selector import Selector
from scrapy.spiders import Rule
from scrapy.linkextractors import LinkExtractor
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
#... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses... | unknown | codeparrot/codeparrot-clean | ||
# This file is originally from recaptcha-client 1.0.5 (obtained from pypi),
# now modified to use new Recaptcha.
import urllib
import urllib2
import config
import simplejson
from django.utils.html import escape
API_SSL_SERVER = 'https://www.google.com/recaptcha/api'
# We leave out the URL scheme so that browsers wo... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright 2016 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 appli... | unknown | codeparrot/codeparrot-clean | ||
This directory holds scripts called by `make.sh` in the parent directory.
Each script is named after the bundle it creates.
They should not be called directly - instead, pass it as argument to make.sh, for example:
```
./hack/make.sh binary ubuntu
# Or to run all default bundles:
./hack/make.sh
```
To add a bundle:... | unknown | github | https://github.com/moby/moby | hack/make/README.md |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
*********************************************
Nasa's picture of the day since 1995.
by Cecil Woebker (http://cwoebker.com)
*********************************************
Usage:
$ ./apod.py
Saves all pictures from Nasa's picture of the day archive to the current dire... | unknown | codeparrot/codeparrot-clean | ||
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Ivan Kopeykin @vankop
*/
"use strict";
/**
* @template T
*/
class AppendOnlyStackedSet {
/**
* @param {Set<T>[]} sets an optional array of sets
*/
constructor(sets = []) {
/** @type {Set<T>[]} */
this._sets = sets;
/** @type {Set... | javascript | github | https://github.com/webpack/webpack | lib/util/AppendOnlyStackedSet.js |
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package schema
import (
"log"
"reflect"
"strings"
"sync"
"time"
"github.com/hashicorp/terraform/internal/legacy/terraform"
"github.com/zclconf/go-cty/cty"
"github.com/zclconf/go-cty/cty/gocty"
)
// ResourceData is used to query and set th... | go | github | https://github.com/hashicorp/terraform | internal/legacy/helper/schema/resource_data.go |
import os
import tempfile
import pytest
from . import util
class TestAssumedShapeSumExample(util.F2PyTest):
sources = [
util.getpath("tests", "src", "assumed_shape", "foo_free.f90"),
util.getpath("tests", "src", "assumed_shape", "foo_use.f90"),
util.getpath("tests", "src", "assumed_shape"... | python | github | https://github.com/numpy/numpy | numpy/f2py/tests/test_assumed_shape.py |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Author: Artūras 'arturaz' Šlajus <x11@arturaz.net>
# Author: Naoya Nakazawa <naoya.n@gmail.com>
#
# This module is proudly sponsored by iGeolise (www.igeolise.com) and
# Tiny Lab Productions (www.tinylabproductions.com).
# GNU General Public License v3.0+ (see COPYING or ht... | unknown | codeparrot/codeparrot-clean | ||
from twisted.internet.defer import inlineCallbacks as coroutine
from autobahn.twisted.util import sleep
@coroutine
def component1_setup(reactor, session):
# the session is joined and ready for use.
def shutdown():
print('backend component: shutting down ..')
session.leave()
yield session.s... | unknown | codeparrot/codeparrot-clean | ||
"""
Creation of the `Layout` instance for the Python input/REPL.
"""
from __future__ import unicode_literals
from prompt_toolkit.enums import DEFAULT_BUFFER, SEARCH_BUFFER
from prompt_toolkit.filters import IsDone, HasCompletions, RendererHeightIsKnown, HasFocus, Condition
from prompt_toolkit.key_binding.vi_state impo... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import annotations
import contextlib
import functools
import io
import os
import logging
import discord
from pathlib import Path
from typing import Callable, TYPE_CHECKING, Union, Dict, Optional
from contextvars import ContextVar
import babel.localedata
from babel.core import Locale
if TYPE_CHECKING... | unknown | codeparrot/codeparrot-clean | ||
# META: timeout=long
import pytest
from tests.support.asserts import assert_error, assert_success, assert_dialog_handled
from tests.support.inline import inline
def get_element_css_value(session, element_id, prop):
return session.transport.send(
"GET",
"session/{session_id}/element/{element_id}/c... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import hamming, triang, blackmanharris
from scipy.fftpack import fft, ifft
import math
import sys, os, functools, time
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/'))
import stft as STFT
import... | unknown | codeparrot/codeparrot-clean | ||
# 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 required by applicable law or ag... | unknown | codeparrot/codeparrot-clean | ||
# simple webpage fetcher
# The code demonstrates how a multi-protocol client should be written.
# TCPSocket is using getaddrinfo() internally, so there should be no problem.
require "socket"
if ARGV.size != 1
STDERR.print "requires URL\n"
exit
end
url = ARGV[0]
if url !~ /^http:\/\/([^\/]+)(\/.*)$/
STDERR.pri... | ruby | github | https://github.com/ruby/ruby | sample/dualstack-fetch.rb |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, Brian Coca <bcoca@ansible.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 Licen... | unknown | codeparrot/codeparrot-clean | ||
#ifndef PACK_BITMAP_H
#define PACK_BITMAP_H
#include "ewah/ewok.h"
#include "khash.h"
#include "pack.h"
#include "pack-objects.h"
#include "string-list.h"
struct commit;
struct repository;
struct rev_info;
static const char BITMAP_IDX_SIGNATURE[] = {'B', 'I', 'T', 'M'};
struct bitmap_disk_header {
char magic[ARRAY... | c | github | https://github.com/git/git | pack-bitmap.h |
#! /usr/bin/env python
"""
requires two input files:
1. a csv file of the abundance of each sequence in each sample, with sequences as rows. You probably want transformed counts, i.e. proportions, not raw counts
2. a mothur taxonomy file, preferably after reformatting it with taxonomy_edit.py
usage:
make-node-attribu... | 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... | unknown | codeparrot/codeparrot-clean | ||
from pywb.rewrite.rewrite_live import LiveRewriter
from pywb.rewrite.url_rewriter import UrlRewriter
from pywb.rewrite.wburl import WbUrl
from pywb import get_test_dir
from io import BytesIO
# This module has some rewriting tests against the 'live web'
# As such, the content may change and the test may break
urlrew... | unknown | codeparrot/codeparrot-clean | ||
# This implementation is based on Kosuke Miyoshi code, under Apache License 2.0:
# https://miyosuda.github.io/
# https://github.com/miyosuda/unreal
from logbook import Logger, StreamHandler, WARNING
import sys
import numpy as np
from collections import deque
from btgym.algorithms.rollout import Rollout
class Memory(... | unknown | codeparrot/codeparrot-clean | ||
import asyncio
from random import randint
from operator import itemgetter
@asyncio.coroutine
def get_random_record(container):
pg = yield from container.engines['pg']
with (yield from pg.cursor()) as cur:
yield from cur.execute('SELECT id AS "Id", randomnumber AS "RandomNumber" FROM world WHERE id... | unknown | codeparrot/codeparrot-clean | ||
# -----------------------------------------------------------------------------
# yacc_unused_rule.py
#
# Grammar with an unused rule
# -----------------------------------------------------------------------------
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.yacc as yacc
from calclex import ... | unknown | codeparrot/codeparrot-clean | ||
import os
from wptserve.utils import isomorphic_decode
def get_template(template_basename):
script_directory = os.path.dirname(os.path.abspath(isomorphic_decode(__file__)))
template_directory = os.path.abspath(
os.path.join(script_directory, u"template"))
template_filename = os.path.join(template_director... | unknown | codeparrot/codeparrot-clean | ||
from tests.support.asserts import assert_error, assert_success
from tests.support.helpers import is_fullscreen
def fullscreen(session):
return session.transport.send(
"POST", "session/{session_id}/window/fullscreen".format(**vars(session)))
def test_no_browsing_context(session, closed_window):
respons... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-boot | core/spring-boot/src/main/java/org/springframework/boot/context/properties/source/AliasedIterableConfigurationPropertySource.java |
# Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
An error to represent bad things happening in Conch.
Maintainer: Paul Swartz
"""
from twisted.cred.error import UnauthorizedLogin
class ConchError(Exception):
def __init__(self, value, data = None):
Exception.__init__(... | unknown | codeparrot/codeparrot-clean | ||
base_suite: change_streams
# The change_stream overrides are copied from change_streams_sharded_collections_passthrough.yml
overrides:
- "change_streams.mongos_passthrough"
- "change_streams.base_eval"
- "multiversion.sharded_fixture_last_lts_new_old_old_new"
eval:
- "change_streams.sharded_collections_passthro... | unknown | github | https://github.com/mongodb/mongo | buildscripts/resmokeconfig/matrix_suites/mappings/change_streams_sharded_collections_passthrough_last_lts_new_old_old_new.yml |
# -*- 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
# -*- 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 unde... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import unittest
import string
import sys
import fc
import os.path
import struct
import math
import types
import filecmp
import commands
import testbase
import image
class Test(testbase.TestBase):
def testColossalImage(self):
try:
im = image.T(400000,300000)
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2014 Peter Oliver <ansible@mavit.org.uk>
#
# 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': '... | unknown | codeparrot/codeparrot-clean | ||
from django.contrib.auth.models import User
from django.test import TestCase
from django.utils import timezone
from django.utils.timezone import timedelta
from cities_light.models import City, Country
from django.contrib.contenttypes.models import ContentType
from meetup.forms import (AddMeetupForm, EditMeetupForm,
... | unknown | codeparrot/codeparrot-clean | ||
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | unknown | github | https://github.com/huggingface/transformers | docs/source/en/reference/environment_variables.md |
{
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v0alpha1",
"metadata": {
"name": "v37.legend_normalization.v42"
},
"spec": {
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/conversion/testdata/migrated_dashboards_output/v1beta1-mig-v37.legend_normalization.v42.v0alpha1.json |
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
# Copyright (C) Sunplus Ltd. Co. 2021
%YAML 1.2
---
$id: http://devicetree.org/schemas/mmc/sunplus,mmc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Sunplus MMC Controller
maintainers:
- Tony Huang <tonyhuang.sunplus@gmail.com>
- Li-h... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/mmc/sunplus,mmc.yaml |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.