code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
"""
Given an array of integers nums, write a method that returns the "pivot" index of this array.
We define the pivot index as the index where the sum of the numbers to the left of the index is equal to the sum of the numbers to the right of the index.
If no such index exists, we should return -1. If there are multip... | unknown | codeparrot/codeparrot-clean | ||
"""RPC Implemention, originally written for the Python Idle IDE
For security reasons, GvR requested that Idle's Python execution server process
connect to the Idle process, which listens for the connection. Since Idle has
only one client per server, this was not a limitation.
+---------------------------------+ +... | unknown | codeparrot/codeparrot-clean | ||
@import "link-button"; | unknown | github | https://github.com/vercel/next.js | examples/cms-sitecore-xmcloud/src/assets/sass/base/links/index.scss |
# $Id: en.py 7179 2011-10-15 22:06:45Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be
# translated f... | unknown | codeparrot/codeparrot-clean | ||
/*
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 applicable law or agreed to in writing, ... | go | github | https://github.com/kubernetes/kubernetes | pkg/kubelet/kubelet_network.go |
# 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 | ||
from social.backends.oauth import BaseOAuth2
class DigitalOceanOAuth(BaseOAuth2):
"""
DigitalOcean OAuth authentication backend.
Docs: https://developers.digitalocean.com/documentation/oauth/
"""
name = 'digitalocean'
AUTHORIZATION_URL = 'https://cloud.digitalocean.com/v1/oauth/authorize'
... | unknown | codeparrot/codeparrot-clean | ||
import re
def _parse6(addr):
cnt = addr.count(':')
m = re.findall(r'::+', addr)
if cnt <= 7 and len(m) == 1:
addr = addr.replace(m[0], ':' + '0:'*(6 - cnt + len(m[0])))
cnt = 7
if cnt == 7:
return [0 if x == '' else int(x, 16) for x in addr.split(':')]
return None
def _pars... | unknown | codeparrot/codeparrot-clean | ||
#include "redismodule.h"
#include <string.h>
#include <assert.h>
#include <unistd.h>
#include <errno.h>
#include <limits.h>
#define UNUSED(x) (void)(x)
static int n_events = 0;
static int KeySpace_NotificationModuleKeyMissExpired(RedisModuleCtx *ctx, int type, const char *event, RedisModuleString *key) {
UNUSED... | c | github | https://github.com/redis/redis | tests/modules/misc.c |
Previous change logs can be found at [CHANGELOG-3.6](https://github.com/etcd-io/etcd/blob/main/CHANGELOG/CHANGELOG-3.6.md).
---
## v3.7.0 (TBD)
### Breaking Changes
- [Removed all deprecated experimental flags](https://github.com/etcd-io/etcd/pull/19959)
- [Removed v2discovery](https://github.com/etcd-io/etcd/pull/... | unknown | github | https://github.com/etcd-io/etcd | CHANGELOG/CHANGELOG-3.7.md |
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
from django.contrib.auth.models import User, Group
import models
from spiff.api.tests import APITestMix... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
#
# Author: Guewen Baconnier
# Copyright 2011 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License... | unknown | codeparrot/codeparrot-clean | ||
##
# Copyright 2014 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (FWO) (... | unknown | codeparrot/codeparrot-clean | ||
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'Y年n月j日' # 2016年9月5... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard 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,... | unknown | codeparrot/codeparrot-clean | ||
"""
This object provides quoting for GEOS geometries into PostgreSQL/PostGIS.
"""
from psycopg2 import Binary
from psycopg2.extensions import ISQLQuote
from django.contrib.gis.db.backends.postgis.pgraster import to_pgraster
from django.contrib.gis.geos import GEOSGeometry
class PostGISAdapter:
def __init__(self,... | unknown | codeparrot/codeparrot-clean | ||
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributi... | 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... | python | github | https://github.com/tensorflow/tensorflow | tensorflow/compiler/tests/matrix_solve_op_test.py |
from __future__ import print_function
import warnings
import sys
import traceback
import inspect
import pickle
from copy import deepcopy
import numpy as np
from scipy import sparse
import struct
from sklearn.externals.six.moves import zip
from sklearn.externals.joblib import hash
from sklearn.utils.testing import as... | unknown | codeparrot/codeparrot-clean | ||
# this is a virtual module that is entirely implemented server side
DOCUMENTATION = '''
---
module: raw
version_added: historical
short_description: Executes a low-down and dirty SSH command
options:
free_form:
description:
- the raw module takes a free form command to run
required: true
executable:
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
"""\
List python source files.
There are three functions to check whether a file is a Python source, listed
here with increasing complexity:
- has_python_ext() checks whether a file name ends in '.py[w]'.
- look_like_python() checks whether the file is not binary and either has
the '.py[w]' ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""QGIS Unit tests for the OGR/Shapefile provider.
.. note:: 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 ver... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunctionCapturesThis_es6.ts] ////
//// [asyncArrowFunctionCapturesThis_es6.ts]
class C {
method() {
var fn = async () => await this;
}
}
//// [asyncArrowFunctionCapturesThis_es6.js]
"use strict";
class C {
method() {
var fn =... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/asyncArrowFunctionCapturesThis_es6.js |
from base64 import urlsafe_b64encode, urlsafe_b64decode
from hashlib import sha256
import json
from Crypto.Cipher import AES
from Crypto import Random
from django.conf import settings
from django.contrib.auth.models import User
from django.core.exceptions import PermissionDenied
from django.http import Http404, HttpRe... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
sysinfo.py [host1] [host2] [options]
obtain system info from remote machine.
(c) Holger Krekel, MIT license
"""
import optparse
import re
import sys
import execnet
import py
parser = optparse.OptionParser(usage=__doc__)
parser.add_option(
"-f",
"--sshconfig",
action="store",
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
Tests dtype specification during parsing
for all of the parsers defined in parsers.py
"""
import pytest
import numpy as np
import pandas as pd
import pandas.util.testing as tm
from pandas import DataFrame, Series, Index, MultiIndex, Categorical
from pandas.compat import StringIO
from pan... | unknown | codeparrot/codeparrot-clean | ||
//! A Serde ast, parsed from the Syn ast and ready to generate Rust code.
use crate::internals::{attr, check, Ctxt, Derive};
use proc_macro2::Ident;
use syn::punctuated::Punctuated;
use syn::Token;
/// A source data structure annotated with `#[derive(Serialize)]` and/or `#[derive(Deserialize)]`,
/// parsed into an in... | rust | github | https://github.com/serde-rs/serde | serde_derive/src/internals/ast.rs |
# Copyright 2014 Rackspace Hosting
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | unknown | codeparrot/codeparrot-clean | ||
# edit-mode: -*- python -*-
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
... | unknown | codeparrot/codeparrot-clean | ||
package caps
import (
"context"
"slices"
"sync"
ccaps "github.com/containerd/containerd/v2/pkg/cap"
"github.com/containerd/log"
)
var initCapsOnce sync.Once
func initCaps() {
initCapsOnce.Do(func() {
rawCaps := ccaps.Known()
curCaps, err := ccaps.Current()
if err != nil {
log.G(context.TODO()).WithEr... | go | github | https://github.com/moby/moby | daemon/pkg/oci/caps/utils_linux.go |
import urlparse
from openerp import sql_db, tools
from qunitsuite.suite import QUnitSuite
class WebSuite(QUnitSuite):
def __init__(self):
url = urlparse.urlunsplit([
'http',
'localhost:{port}'.format(port=tools.config['xmlrpc_port']),
'/web/tests',
'mod=*&sou... | unknown | codeparrot/codeparrot-clean | ||
"""Script to read in all the costs and write to csv."""
import os
import cPickle as pickle
from collections import defaultdict
import cobra
from fba_utils import *
def collate_cluster_output(modelPath):
modelName = modelPath.split('/')[-1][:-4]
modelDir = '../models/' + modelName
clusterDir = os.path.join... | unknown | codeparrot/codeparrot-clean | ||
/* -*- coding: utf-8; mode: css -*-
*
* Sphinx HTML theme customization: read the doc
* Please don't add any color definition here, as the theme should
* work for both normal and dark modes.
*/
/* Improve contrast and increase size for easier reading. */
body {
font-family: serif;
font-size: 100%;
}
h1, h2, .... | css | github | https://github.com/torvalds/linux | Documentation/sphinx-static/theme_overrides.css |
/*
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 | pkg/controller/nodeipam/ipam/sync/sync_test.go |
# Copyright (c) 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 ... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
import cv2
import time
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib import rcParams
import SimpleITK as sitk
from multiprocessing import Process, Pipe, Value
from matplotlib.widgets import Slider, Button
rcParams['font.family'] = 'serif'
#ps aux | grep pyth... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import optparse
from telemetry import decorators
from telemetry.internal import story_runner
from telemetry.internal.util import command_line
from telemetry... | unknown | codeparrot/codeparrot-clean | ||
#
# Module implementing queues
#
# multiprocessing/queues.py
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
# 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 ret... | unknown | codeparrot/codeparrot-clean | ||
const val x: Int
get() = 6
fun main() {
<expr>x</expr>
} | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api/testData/components/compileTimeConstantProvider/evaluate/withErrors/constFieldWithCustomGetter.kt |
"""
Provide functionality to interact with Cast devices on the network.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.cast/
"""
import asyncio
import logging
import threading
from typing import Optional, Tuple
import attr
import voluptuous... | unknown | codeparrot/codeparrot-clean | ||
'use strict';
const common = require('../common.js');
const fs = require('fs');
const path = require('path');
const searchStrings = [
'@',
'SQ',
'--l',
'Alice',
'Gryphon',
'Ou est ma chatte?',
'found it very',
'neighbouring pool',
'aaaaaaaaaaaaaaaaa',
'venture to go near the house till she had brou... | javascript | github | https://github.com/nodejs/node | benchmark/buffers/buffer-indexof.js |
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you... | java | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/CryptoProtocolVersion.java |
# -*- 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 | ||
use std::ffi::OsStr;
use std::path::PathBuf;
use std::process::Command;
use crate::path::{Dirs, RelPath};
use crate::prepare::{GitRepo, apply_patches};
use crate::rustc_info::get_default_sysroot;
use crate::shared_utils::rustflags_from_env;
use crate::utils::{CargoProject, Compiler, LogGroup, ensure_empty_dir, spawn_a... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_codegen_cranelift/build_system/tests.rs |
"""
Copyright 2015 SYSTRAN Software, 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... | unknown | codeparrot/codeparrot-clean | ||
/* contrib/pg_freespacemap/pg_freespacemap--1.1.sql */
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION pg_freespacemap" to load this file. \quit
-- Register the C function.
CREATE FUNCTION pg_freespace(regclass, bigint)
RETURNS int2
AS 'MODULE_PATHNAME', 'pg_free... | sql | github | https://github.com/postgres/postgres | contrib/pg_freespacemap/pg_freespacemap--1.1.sql |
#!/usr/bin/env python
from __future__ import unicode_literals
import unittest
from cola import textwrap
class WordWrapTestCase(unittest.TestCase):
def setUp(self):
self.tabwidth = 8
self.limit = None
def wrap(self, text):
return textwrap.word_wrap(text, self.tabwidth, self.limit)
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# @Author: oesteban
# @Date: 2016-01-05 11:29:40
# @Email: code@oscaresteban.es
# @Last modified by: oesteban
# @Last Modified time: 2016-11-10 17:14:23
... | unknown | codeparrot/codeparrot-clean | ||
"""
Global Django exception and warning classes.
"""
from django.utils.encoding import force_text
class FieldDoesNotExist(Exception):
"""The requested model field does not exist"""
pass
class DjangoRuntimeWarning(RuntimeWarning):
pass
class AppRegistryNotReady(Exception):
"""The django.apps registry ... | unknown | codeparrot/codeparrot-clean | ||
from .main import Core
from uuid import uuid4
def start():
return Core()
config = [{
'name': 'core',
'order': 1,
'groups': [
{
'tab': 'general',
'name': 'basics',
'description': 'Needs restart before changes take effect.',
'wizard': True,
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-18 18:58
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('mocker', '0001_initial'),
]
operations = [
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import StringIO
import sys
import time
from nose import tools
from docker_registry.core import exceptions
import docker_registry.testing as testing
from docker_registry.testing import mock_boto # noqa
from . import mock_s3 # noqa
class StringIOWithError(StringIO.StringIO):
'''Throw ... | unknown | codeparrot/codeparrot-clean | ||
# oracle/cx_oracle.py
# Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Support for the Oracle database via the cx_oracle driver.
Driver
------
The O... | unknown | codeparrot/codeparrot-clean | ||
@com.google.errorprone.annotations.CheckReturnValue
package com.google.common.collect.testing.testers; | java | github | https://github.com/google/guava | android/guava-testlib/src/com/google/common/collect/testing/testers/package-info.java |
# -*- coding: utf-8 -*-
# =================================================================
#
# Authors: Tom Kralidis <tomkralidis@gmail.com>
#
# Copyright (c) 2015 Tom Kralidis
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the ... | unknown | codeparrot/codeparrot-clean | ||
#include <ruby.h>
#include "stringify_target.h"
VALUE
stt_any_method(VALUE klass)
{
return rb_str_new_cstr("from target");
}
void
Init_stringify_target(void)
{
VALUE mod = rb_define_module("StringifyTarget");
rb_define_singleton_method(mod, "any_method", stt_any_method, 0);
} | c | github | https://github.com/ruby/ruby | ext/-test-/load/stringify_target/stringify_target.c |
# -*- coding: utf-8 -*-
"""ResNet50 model for Keras.
# Reference:
- [Deep Residual Learning for Image Recognition](https://arxiv.org/abs/1512.03385)
Adapted from code contributed by BigMoyan.
"""
from __future__ import print_function
from __future__ import absolute_import
import warnings
from ..layers import Input... | unknown | codeparrot/codeparrot-clean | ||
import logging
from pylons import request, response, session, tmpl_context as c
from zkpylons.lib.helpers import redirect_to
from pylons.decorators import validate
from pylons.decorators.rest import dispatch_on
from formencode import validators, htmlfill, ForEach, Invalid
from formencode.variabledecode import NestedV... | unknown | codeparrot/codeparrot-clean | ||
#
# sources.py
#
# Convert source code comments to multi-line blocks (library file).
#
# Copyright 2002-2015 by
# David Turner.
#
# This file is part of the FreeType project, and may only be used,
# modified, and distributed under the terms of the FreeType project
# license, LICENSE.TXT. By continuing to use,... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui_settingsmanager.ui'
#
# Created: Thu Apr 3 15:51:39 2014
# 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
ex... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (C) 2011 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... | java | github | https://github.com/google/guava | android/guava-testlib/src/com/google/common/collect/testing/google/MultisetNavigationTester.java |
'''
.. Created 2015
.. codeauthor:: Hstau Y Liao <hstau.y.liao@gmail.com>
'''
import sys
import spider
import eulerangles as eu
import numpy as np, logging
import math
#import glob
from arachnid.core.image import ndimage_file
from arachnid.core.metadata import format
def get_unitv(phi, theta):
u = np.cos(phi) *... | unknown | codeparrot/codeparrot-clean | ||
from config import config, ConfigSelection, ConfigSubsection, ConfigOnOff, ConfigText
from Components.Timezones import timezones
from Components.Language import language
from Components.Keyboard import keyboard
def InitSetupDevices():
def timezoneNotifier(configElement):
timezones.activateTimezone(configElement.in... | unknown | codeparrot/codeparrot-clean | ||
import sys
import os
import datetime
import pickle
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import matplotlib.colors as colors
from matplotlib import dates
from pprint import pprint
import sqlite3
import calendar
from datetime import datetime
from datetime import timedelta
import ma... | unknown | codeparrot/codeparrot-clean | ||
#! python
# -*- coding: utf-8 -*-
# (c) 2007 Jürgen Riegel GPL
Usage = """BuildRelease - Build script to build a complete FreeCAD release
Usage:
BuildRelease [Optionen] ReleaseNbr
Options:
-h, --help print this help
-b, --buildPath specify the output path where the build takes place
-i, --ini-fil... | unknown | codeparrot/codeparrot-clean | ||
/*-------------------------------------------------------------------------
*
* pg_opfamily.h
* definition of the "operator family" system catalog (pg_opfamily)
*
*
* Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
... | c | github | https://github.com/postgres/postgres | src/include/catalog/pg_opfamily.h |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import telemetry.timeline.counter as tracing_counter
import telemetry.timeline.event as event_module
import telemetry.timeline.event_container as event_conta... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-boot | configuration-metadata/spring-boot-configuration-metadata/src/main/java/org/springframework/boot/configurationmetadata/ConfigurationMetadataSource.java |
/*
* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.client.plugins.websocket
import io.ktor.client.call.*
import io.ktor.client.plugins.*
import io.ktor.serialization.*
import io.ktor.util.*
import io.ktor.util.reflect.*
import i... | kotlin | github | https://github.com/ktorio/ktor | ktor-client/ktor-client-core/common/src/io/ktor/client/plugins/websocket/ClientSessions.kt |
:root {
--z-index-mini-menu: 200;
--z-index-top-level-banner: 150;
--z-index-nav: 100;
--z-index-cookie-consent: 200;
--z-index-nav-tutorial: 75;
--z-index-content: 50;
--z-index-icon: 10;
} | unknown | github | https://github.com/angular/angular | adev/shared-docs/styles/_z-index.scss |
#!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | unknown | codeparrot/codeparrot-clean | ||
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/components/*": ["components/*"],
"@/lib/*": ["lib/*"],
"@/css/*": ["css/*"]
}
}
} | json | github | https://github.com/vercel/next.js | examples/cms-buttercms/jsconfig.json |
#
# Copyright (c) 2008--2015 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2013 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 or agreed to in... | unknown | codeparrot/codeparrot-clean | ||
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Ivan Kopeykin @vankop
*/
"use strict";
const InitFragment = require("../InitFragment");
const makeSerializable = require("../util/makeSerializable");
/** @typedef {import("webpack-sources").Source} Source */
/** @typedef {import("../Generator... | javascript | github | https://github.com/webpack/webpack | lib/dependencies/ExternalModuleInitFragment.js |
import sys
import re
import math
#from datetime import time, timedelta
import datetime
data_set = []
def retrieveFile(filename):
f = open(filename,'r')
Data = f.readlines()
lines=Data[0].split("\r");
f.close()
return lines
def computeDistance(a,b,c,d):
Coords1=[]
Coords2=[]
## Coords1[... | unknown | codeparrot/codeparrot-clean | ||
""" Cisco_IOS_XR_infra_sla_cfg
This module contains a collection of YANG definitions
for Cisco IOS\-XR infra\-sla package configuration.
This module contains definitions
for the following management objects\:
sla\: SLA prtocol and profile Configuration
Copyright (c) 2013\-2015 by Cisco Systems, Inc.
All rights res... | unknown | codeparrot/codeparrot-clean | ||
"""
Quantilization functions and related stuff
"""
from __future__ import annotations
from typing import (
TYPE_CHECKING,
Any,
Literal,
cast,
)
import numpy as np
from pandas._libs import (
Timedelta,
Timestamp,
lib,
)
from pandas.util._decorators import set_module
from pandas.core.dtyp... | python | github | https://github.com/pandas-dev/pandas | pandas/core/reshape/tile.py |
from lib.analysis.author import generate_cl_curve_fits, generate_rt_curve_fits
from lib.analysis.thread import generate_time_stats_threads
# mailbox_list = [d for d in os.listdir('data') if os.path.isdir(os.path.join('data', d))]
mailbox_list = ['lkml', 'opensuse', 'opensuse-bugs', 'opensuse-factory', 'opensuse-featur... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package remote
import (
"bufio"
"context"
"fmt"
"io"
"log"
tfe "github.com/hashicorp/go-tfe"
version "github.com/hashicorp/go-version"
"github.com/hashicorp/terraform/internal/backend/backendrun"
"github.com/hashicorp/terraform/internal/... | go | github | https://github.com/hashicorp/terraform | internal/backend/remote/backend_apply.go |
# This is only used by tests.test_downloader_handlers_http_base.TestSimpleHttpsBase
from __future__ import annotations
from twisted.web import resource
from twisted.web.static import Data
from .http_base import BaseMockServer, main_factory
class Root(resource.Resource):
def __init__(self):
resource.Reso... | python | github | https://github.com/scrapy/scrapy | tests/mockserver/simple_https.py |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | 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/support/annotation/AnnotationMethodMatcher.java |
from django.http import HttpResponse
from django.utils import six
from .loader import get_template, select_template
class ContentNotRenderedError(Exception):
pass
class SimpleTemplateResponse(HttpResponse):
rendering_attrs = ['template_name', 'context_data', '_post_render_callbacks']
def __init__(self, ... | 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 | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Sebastian Kornehl <sebastian.kornehl@asideas.de>
# 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_versi... | unknown | codeparrot/codeparrot-clean | ||
"""
coco result analyzer
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import collections
import json
import os
import time
import numpy as np
from pycocotools.coco import COCO
from pycocotools.cocoeval import COCOeval
from PIL impor... | unknown | codeparrot/codeparrot-clean | ||
cfg_io_driver! {
pub(crate) mod bit;
}
#[cfg(feature = "fs")]
pub(crate) mod as_ref;
#[cfg(feature = "rt")]
pub(crate) mod atomic_cell;
#[cfg(feature = "net")]
mod blocking_check;
#[cfg(feature = "net")]
#[allow(unused_imports)]
pub(crate) use blocking_check::check_socket_for_blocking;
pub(crate) mod metric_ato... | rust | github | https://github.com/tokio-rs/tokio | tokio/src/util/mod.rs |
# example.js
```javascript
// insert router here
import(`./pages/${page}`);
```
# pages/Dashboard.js
```javascript
import { Button, Checkbox } from "../components";
const Dashboard = () => {
return (
<>
<Button />
<Checkbox />
</>
);
};
export default Dashboard;
```
# pages/Login.js
```javascript
impo... | unknown | github | https://github.com/webpack/webpack | examples/reexport-components/README.md |
import os
from director.componentgraph import ComponentFactory
from director import consoleapp
import director.objectmodel as om
import director.visualization as vis
from director.fieldcontainer import FieldContainer
from director import applogic
from director import appsettings
from director import drcargs
import fun... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2016 Toshio Kuratomi <tkuratomi@ansible.com>
# (c) 2017-2018 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_func... | unknown | codeparrot/codeparrot-clean | ||
#------------------------------------------------------------------------------
# Copyright 2013 Esri
# 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/LICENS... | unknown | codeparrot/codeparrot-clean | ||
import unittest
from test import test_support
import string
import StringIO
mimetools = test_support.import_module("mimetools", deprecated=True)
msgtext1 = mimetools.Message(StringIO.StringIO(
"""Content-Type: text/plain; charset=iso-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Foo!
"""))
class MimeToolsT... | unknown | codeparrot/codeparrot-clean | ||
import sys
import os
import hashlib
import urllib
import itertools
import re
import json
import glob
import shutil
try:
import genshi
from genshi.template import MarkupTemplate
from html5lib.tests import support
except ImportError:
print """This script requires the Genshi templating library and html5l... | unknown | codeparrot/codeparrot-clean | ||
/*
* pgbench.c
*
* A simple benchmark program for PostgreSQL
* Originally written by Tatsuo Ishii and enhanced by many contributors.
*
* src/bin/pgbench/pgbench.c
* Copyright (c) 2000-2026, PostgreSQL Global Development Group
* ALL RIGHTS RESERVED;
*
* Permission to use, copy, modify, and distribute this soft... | c | github | https://github.com/postgres/postgres | src/bin/pgbench/pgbench.c |
/*
* 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.client.webrtc
import io.ktor.client.webrtc.media.*
import org.webrtc.DtmfSender
import org.webrtc.RtpParameters
import org.webrtc.RtpSender
public class AndroidRtpSender(inte... | kotlin | github | https://github.com/ktorio/ktor | ktor-client/ktor-client-webrtc/android/src/io/ktor/client/webrtc/Senders.kt |
/*
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 applicable law or agreed to in writing, ... | go | github | https://github.com/kubernetes/kubernetes | pkg/apis/autoscaling/v1/defaults_test.go |
//===----------------------------------------------------------------------===//
//
// 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/misc/RedundantExpressionCheck.cpp |
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
//go:build !enterprise
package vault
import (
"github.com/hashicorp/vault/helper/namespace"
)
func (i *IdentityStore) listNamespaces() []*namespace.Namespace {
return []*namespace.Namespace{namespace.RootNamespace}
} | go | github | https://github.com/hashicorp/vault | vault/identity_store_oidc_util.go |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import rospy
from nav_msgs.msg import Odometry
from geometry_msgs.msg import Twist
from geometry_msgs.msg import PoseStamped
from tf.transformations import euler_from_quaternion
import numpy as np
def minAngle(ang):
return np.arctan2(np.sin(ang), np.cos(ang))
def ori... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.