code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
from collections import namedtuple, OrderedDict
from ast import literal_eval
import re
from datetime import datetime
import sys
ScriptFunction = \
namedtuple('Method', ['definition', 'signature', 'body', 'sha1'])
class Scripts(object):
def __init__(self):
self.namespaces = { 'default': {} }
def a... | unknown | codeparrot/codeparrot-clean | ||
# Guide to UI programming with coroutines
This guide assumes familiarity with basic coroutine concepts that are
covered in [Guide to kotlinx.coroutines](../docs/topics/coroutines-guide.md) and gives specific
examples on how to use coroutines in UI applications.
All UI application libraries have one thing in common. T... | unknown | github | https://github.com/Kotlin/kotlinx.coroutines | ui/coroutines-guide-ui.md |
# Authors: Mainak Jas <mainak@neuro.hut.fi>
# Teon Brooks <teon.brooks@gmail.com>
#
# License: BSD (3-clause)
import os
import os.path as op
import glob
import warnings
import shutil
from nose.tools import assert_true, assert_equal, assert_raises
from mne import Epochs, read_events, pick_types, read_evokeds
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
__license__ = 'GPL 3'
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
'''
Transform OEB content into PML markup
'''
import re
from lxml import etree
from calibre.ebooks.pdb.ereader import image_name
from calibre.ebooks.pml import unipmlcode... | 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.fir.test.cases.generated.cases.components.typeRelationChecker;
impo... | java | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/typeRelationChecker/FirIdeNormalAnalysisScriptSourceModuleLenientSubtypingTestGenerated.java |
{% extends "./dir2/../looped.html" %}
{% block content %}{{ block.super }} dir1 three{% endblock %} | html | github | https://github.com/django/django | tests/template_tests/relative_templates/dir1/looped.html |
<!---
Copyright 2024 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 ... | unknown | github | https://github.com/huggingface/transformers | i18n/README_de.md |
# (C) British Crown Copyright 2014, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any later ve... | 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 applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/core/kernels/conditional_accumulator_base.h |
from .es_query import HQESQuery
from . import filters
class FormES(HQESQuery):
index = 'forms'
default_filters = {
'is_xform_instance': {"term": {"doc_type": "xforminstance"}},
'has_xmlns': {"not": {"missing": {"field": "xmlns"}}},
'has_user': {"not": {"missing": {"field": "form.meta.us... | unknown | codeparrot/codeparrot-clean | ||
"""Tests for polynomial module.
"""
import pickle
from copy import deepcopy
from fractions import Fraction
from functools import reduce
import pytest
import numpy as np
import numpy.polynomial.polynomial as poly
from numpy.testing import (
assert_,
assert_almost_equal,
assert_array_equal,
assert_equa... | python | github | https://github.com/numpy/numpy | numpy/polynomial/tests/test_polynomial.py |
from django.conf import settings
# Depending on the Economic system and the way the Domain Model
# has been created the Agent Models should be
# overridden to best describe the environment.
RECEIVING_AGENT_MODEL = getattr(
settings,
'REA_RECEIVING_AGENT_MODEL',
'rea.Agent'
)
PROVIDING_AGENT_MODEL = getatt... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
"""
Unit tests of template.py.
"""
import codecs
import os
import sys
import unittest
from examples.simple import Simple
from pystache import Renderer
from pystache import TemplateSpec
from pystache.common import TemplateNotFoundError
from pystache.context import ContextStack, KeyNotFoundError
from ... | unknown | codeparrot/codeparrot-clean | ||
# -*- test-case-name: twisted.scripts.test.test_tap2rpm -*-
# Copyright (c) 2003-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
import sys, os, shutil, time, glob
import subprocess
import tempfile
import tarfile
from StringIO import StringIO
from twisted.python import usage, log
#######################... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2024 - 2025 R. Thomas
*
* 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... | unknown | github | https://github.com/nodejs/node | deps/LIEF/include/LIEF/canbe_unique.hpp |
# 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 distributed in the hope that it will be useful,
# bu... | unknown | codeparrot/codeparrot-clean | ||
[
{
"@level": "info",
"@message": "tfcoremock_list.list: Plan to create",
"@module": "terraform.ui",
"change": {
"action": "create",
"resource": {
"addr": "tfcoremock_list.list",
"implied_provider": "tfcoremock",
"module": "",
"resource": "tfcoremock_list.li... | json | github | https://github.com/hashicorp/terraform | testing/equivalence-tests/outputs/basic_list/apply.json |
from distutils.errors import DistutilsOptionError
from setuptools.command.setopt import edit_config, option_base, config_file
def shquote(arg):
"""Quote an argument for later parsing by shlex.split()"""
for c in '"', "'", "\\", "#":
if c in arg: return repr(arg)
if arg.split() != [arg]:
re... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# pylint: disable=C0111, C0325
import logging
import sys
from pprint import pprint
from cutlass import Project
from cutlass import iHMPSession
username = "test"
password = "test"
def set_logging():
""" Setup logging. """
root = logging.getLogger()
root.setLevel(logging.DEBUG)
c... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
"""
author: R. Essick (ressick@mit.edu)
date: 20 July 2012
this module written to help automate the process of estimating pdfs and cdfs from a set of observations.
we implement several simple algorithms, all based on the concept of kernal estimation. They are:
k-th nearest neighbor volume estimat... | unknown | codeparrot/codeparrot-clean | ||
from Screens.Screen import Screen
from Screens.ChoiceBox import ChoiceBox
from Screens.InputBox import InputBox
from Screens.MessageBox import MessageBox
from Screens.HelpMenu import HelpableScreen
from Components.ActionMap import HelpableActionMap, ActionMap
from Components.Sources.List import List
from Components.Sou... | unknown | codeparrot/codeparrot-clean | ||
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""
... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package terraform
import (
"fmt"
"log"
"strings"
"github.com/hashicorp/hcl/v2"
"github.com/hashicorp/hcl/v2/gohcl"
"github.com/zclconf/go-cty/cty"
"github.com/zclconf/go-cty/cty/convert"
"github.com/hashicorp/terraform/internal/addrs"
"g... | go | github | https://github.com/hashicorp/terraform | internal/terraform/eval_variable.go |
/* Generated file to emulate the ts namespace. */
export * from "../../compiler/_namespaces/ts.js"; | typescript | github | https://github.com/microsoft/TypeScript | src/tsc/_namespaces/ts.ts |
<?php declare(strict_types=1);
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Command... | php | github | https://github.com/composer/composer | src/Composer/Command/InstallCommand.php |
package stdcopymux
import (
"bytes"
"encoding/binary"
"errors"
"io"
"sync"
"github.com/moby/moby/api/pkg/stdcopy"
)
const (
stdWriterPrefixLen = 8
stdWriterFdIndex = 0
stdWriterSizeIndex = 4
)
var bufPool = &sync.Pool{New: func() any { return bytes.NewBuffer(nil) }}
// stdWriter is wrapper of io.Writer ... | go | github | https://github.com/moby/moby | daemon/internal/stdcopymux/writer.go |
package dockerfile
import (
"fmt"
"os"
"path/filepath"
"strings"
"github.com/Microsoft/go-winio"
"github.com/moby/moby/v2/daemon/internal/system"
"github.com/moby/sys/reexec"
"github.com/pkg/errors"
"golang.org/x/sys/windows"
)
var pathDenyList = map[string]bool{
`c:\`: true,
`c:\windows`: true,
}
... | go | github | https://github.com/moby/moby | daemon/builder/dockerfile/copy_windows.go |
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
//! Menu types and utilities.
mod builders;
mod check;
mod icon;
#[allow(clippy::module_inception)]
mod menu;
mod normal;
pub(crate) mod plugin;
mod predefined;
mod submenu;
use... | rust | github | https://github.com/tauri-apps/tauri | crates/tauri/src/menu/mod.rs |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel;
use Symfony\Component\HttpFoundation\Requ... | php | github | https://github.com/symfony/symfony | src/Symfony/Component/HttpKernel/HttpKernelInterface.php |
# Copyright 2006-2009 the V8 project authors. 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 co... | unknown | codeparrot/codeparrot-clean | ||
"""Differ module contains functions for comparing images and creating diff images
"""
import numpy as np
from PIL import Image
from ssim import compute_ssim
from .utils import extract_colors
def euclidean_distance(image1, image2):
"""Calculate `euclidean distance <https://en.wikipedia.org/wiki/Euclidean_distance>... | unknown | codeparrot/codeparrot-clean | ||
# 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.
"""A module to hold adb specific action implementations."""
import re
import cr
class Adb(object):
"""Exposes the functionality of the adb tool to the r... | unknown | codeparrot/codeparrot-clean | ||
/**
* Map of elements that have certain elements that are not allowed inside them, in the sense that they will auto-close the parent/ancestor element.
* Theoretically one could take advantage of it but most of the time it will just result in confusing behavior and break when SSR'd.
* There are more elements that are... | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/src/html-tree-validation.js |
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#ifndef _NGX_SHA1_H_INCLUDED_
#define _NGX_SHA1_H_INCLUDED_
#include <ngx_config.h>
#include <ngx_core.h>
typedef struct {
uint64_t bytes;
uint32_t a, b, c, d, e, f;
u_char buffer[64];
} ngx_sha1_t;
void ngx_sha1_init(ngx_sha1_t *ctx)... | c | github | https://github.com/nginx/nginx | src/core/ngx_sha1.h |
---
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
Title: CURLOPT_PIPEWAIT
Section: 3
Source: libcurl
See-also:
- CURLMOPT_MAX_HOST_CONNECTIONS (3)
- CURLMOPT_PIPELINING (3)
- CURLOPT_FORBID_REUSE (3)
- CURLOPT_FRESH_CONNECT (3)
Protocol:
- HTTP
Added-in: 7.43.0
---
... | unknown | github | https://github.com/curl/curl | docs/libcurl/opts/CURLOPT_PIPEWAIT.md |
h1 { margin-top: 0; }
/* Keep lists a bit narrow to maximize page estate regarding width. */
ol, ul {
margin: 0;
padding: 0 0 0 1.3em;
}
/* Images should never exceed the width of the page. */
img { max-width: 100%; }
/* Don't display URL after links, this is not print. */
.link-target { display: none; }
/*... | css | github | https://github.com/django/django | docs/_theme/djangodocs-epub/static/epub.css |
<?php
namespace Illuminate\Tests\Database;
use Illuminate\Database\Connection;
use Illuminate\Database\Query\Builder;
use Illuminate\Database\Query\Expression;
use Illuminate\Database\Query\Grammars\Grammar;
use Mockery as m;
use PHPUnit\Framework\TestCase;
use ReflectionClass;
class DatabaseQueryGrammarTest extends... | php | github | https://github.com/laravel/framework | tests/Database/DatabaseQueryGrammarTest.php |
from sqlobject import *
from sqlobject.tests.dbtest import *
from formencode import Invalid
########################################
## Enum test
########################################
class Enum1(SQLObject):
l = EnumCol(enumValues=['a', 'bcd', 'e'])
def testBad():
setupClass(Enum1)
for l in ['a', 'bc... | unknown | codeparrot/codeparrot-clean | ||
// @enableChangeVariableCodegen
function Component(props) {
const c_0 = [props.a, props.b.c];
return c_0;
}
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{a: 3.14, b: {c: true}}],
}; | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/option-enable-change-variable-codegen.js |
#!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# This example demonstrates adding two implicit models
# to produce an (unexpected!) result
# first we load in the standard vtk packages into tcl
geomObject1 = vtk.vtkCone()
geomObjec... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 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 ... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package azure
import (
"context"
"errors"
"fmt"
"io"
"net/url"
"os"
"regexp"
"sort"
"strconv"
"strings"
"time"
"github.com/Azure/azure-storage-blob-go/azblob"
"github.com/Azure/go-autorest/autorest/adal"
"github.com/Azure/go-autores... | go | github | https://github.com/hashicorp/vault | physical/azure/azure.go |
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/misc/nvidia,tegra20-apbmisc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: NVIDIA Tegra APBMISC block
maintainers:
- Thierry Reding <thierry.reding@gmail.com>
- Jon Hunter <jonathanh@nvi... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/misc/nvidia,tegra20-apbmisc.yaml |
from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.http import HttpResponse
from django.test import TestCase
from django.utils import unittest
from django.utils.http import urlencode
from rest_framework import HTTP_HEADER_ENCODING
from rest_framework import exceptions
from r... | unknown | codeparrot/codeparrot-clean | ||
import { test } from '../../test';
export default test({
get props() {
return { x: [{ z: 1 }, { z: 2 }] };
},
html: `
<p>does not change</p>
<p>does not change</p>
`
}); | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/tests/runtime-legacy/samples/each-block-keyed-static/_config.js |
#pragma once
#include <torch/csrc/api/include/torch/types.h>
#include <torch/csrc/autograd/InferenceMode.h>
#include <torch/csrc/autograd/custom_function.h>
#include <torch/csrc/autograd/generated/variable_factories.h>
#include <torch/csrc/autograd/grad_mode.h>
#include <torch/csrc/jit/runtime/custom_operator.h>
#incl... | c | github | https://github.com/pytorch/pytorch | torch/script.h |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2016, 2017 Canonical Ltd
#
# 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 distributed in... | unknown | codeparrot/codeparrot-clean | ||
import pytest
from aiohttp.test_utils import make_mocked_coro
async def test_find(mocker, snapshot, spawn_client, static_time):
client = await spawn_client(authorize=True)
await client.db.indexes.insert_many([
{
"_id": "bar",
"version": 1,
"created_at": static_time.... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python -u
# needed the index on hugoSymbol for this to work with any speed:
#
# This source code is part of tcga, a TCGA processing pipeline, written by Ivana Mihalek.
# Copyright (C) 2014-2016 Ivana Mihalek.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | 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 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 ... | 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 | ||
/*
* Copyright (C) 2013 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... | java | github | https://github.com/google/guava | android/guava-testlib/src/com/google/common/collect/testing/google/MultisetContainsTester.java |
import unittest
import docker
import requests.exceptions
import tempfile
import os
import shutil
import subprocess
import sys
import json
# Tests for crawlers in kubernetes crawlers configuration.
from containers_crawler import ContainersCrawler
from worker import Worker
from emitters_manager import EmittersManager
... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (c) 2007 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockito.plugins;
/**
* Mockito logger.
*
* <p>By default logs to console</p>
*
* <p>All mockito logging goes through this class and could be customized as usual Mockito plugin.</p>
... | java | github | https://github.com/mockito/mockito | mockito-core/src/main/java/org/mockito/plugins/MockitoLogger.java |
#!/usr/bin/env python
import json
import logging
from optparse import OptionParser
from service_old.models import Instance
import django
django.setup()
def export_instance_tags():
instance_tags = []
instances = Instance.objects.all()
added = 0
for i in instances:
if i.instance_tags:
... | unknown | codeparrot/codeparrot-clean | ||
from django.db import DEFAULT_DB_ALIAS, connections
from django.test import LiveServerTestCase, TransactionTestCase
from django.test.testcases import LiveServerThread
# Use TransactionTestCase instead of TestCase to run outside of a transaction,
# otherwise closing the connection would implicitly rollback and not set ... | python | github | https://github.com/django/django | tests/servers/test_liveserverthread.py |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
for amimoto_alexa
"""
from helpers import *
from debugger import *
import yaml
import random
def dispatch_question(intent, session):
"""Dispatch questions and return answer.
"""
session_attributes = build_session_attributes(session)
should_end_session... | unknown | codeparrot/codeparrot-clean | ||
import datetime
import pytz
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.shortcuts import redirect
from django_future.csrf import ensure_csrf_cookie
from edxmako.shortcuts import render_to_response
from track import tracker
from track import contexts
fr... | unknown | codeparrot/codeparrot-clean | ||
import os, sys, time
import zmq
#import chroma.api as api
#api.use_cuda()
import numpy as np
#from chroma.sim import Simulation
#from chroma.event import Photons
#import chroma.event
#from uboone import uboone
import ratchromadata_pb2
import photonHit_pb2
import cProfile
import message_pack_cpp
context = zmq.Context(... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright (C) 2015 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in th... | unknown | codeparrot/codeparrot-clean | ||
"""
Form Widget classes specific to the Django admin site.
"""
from __future__ import unicode_literals
import copy
from django import forms
from django.contrib.admin.templatetags.admin_static import static
from django.core.urlresolvers import reverse
from django.forms.widgets import RadioFieldRenderer
from django.for... | unknown | codeparrot/codeparrot-clean | ||
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import {CompilerDiagnostic, CompilerError, Effect} from '..';
import {ErrorCategory} from '../CompilerError';
import {HIRFunctio... | typescript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/Validation/ValidateLocalsNotReassignedAfterRender.ts |
# blob.py
# Copyright (C) 2008-2010 Michael Trier (mtrier@gmail.com) and contributors
#
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
import mimetypes
import os
import re
import time
from actor import Actor
from commit import Commit
clas... | unknown | codeparrot/codeparrot-clean | ||
#!/bin/sh
test_description='--ancestry-path'
# D---E-------F
# / \ \
# B---C---G---H---I---J
# / \
# A-------K---------------L--M
#
# D..M == E F G H I J K L M
# --ancestry-path D..M == E F H I J L M
# ... | unknown | github | https://github.com/git/git | t/t6019-rev-list-ancestry-path.sh |
#!/usr/bin/python
#
# 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
# "Lic... | unknown | codeparrot/codeparrot-clean | ||
import unittest
import libpipe
from unittest.mock import patch, Mock
from libpipe.cmds.base import BaseCmd
import logging
from remsci.lib.utility import customLogging
customLogging.config()
log = logging.getLogger(__name__)
class CmdSample(BaseCmd):
NAME = 'tmp'
INVOKE_STR = 'tmp'
ARGUMENTS = [
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import json
import os
import shutil
from pyramid.response import Response
from pyramid.request import Request
from pyramid.view import view_config
import uuid
import Image
from sqlalchemy.exc import DBAPIError
from pyramid.httpexceptions import HTTPFound, HTTPNotFound
from pyramid.security impo... | unknown | codeparrot/codeparrot-clean | ||
""" Code runnning support. """
import sys
from re import compile as re
from ._compat import StringIO
from .environment import env
encoding = re(r'#.*coding[:=]\s*([-\w.]+)')
def run_code():
""" Run python code in current buffer.
:returns: None
"""
errors, err = [], ''
line1, line2 = env.var('a:... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
from pandas import DataFrame
import pandas._testing as tm
def test_head_tail_generic(index, frame_or_series):
# GH#5370
ndim = 2 if frame_or_series is DataFrame else 1
shape = (len(index),) * ndim
vals = np.random.default_rng(2).standard_normal(shape)
obj = frame_or_series(vals... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/frame/methods/test_head_tail.py |
from __future__ import division, absolute_import, print_function
import os
import math
from numpy.testing import *
from numpy import array
import util
def _path(*a):
return os.path.join(*((os.path.dirname(__file__),) + a))
class TestSizeSumExample(util.F2PyTest):
sources = [_path('src', 'size', 'foo.f90'),... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = 'LexusLee'
from tornado.gen import coroutine
from tornado import gen
from foundation.log import logger
from serverApp.common.serverAppConfig import YOUDAO_LANG_TYPE
from serverApp.common.aha import RequestHandlerAha, ResponseJSON
from serverApp.tools.youdao import... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Console\Events;
use Illuminate\Console\Application;
class ArtisanStarting
{
/**
* Create a new event instance.
*
* @param \Illuminate\Console\Application $artisan The Artisan application instance.
*/
public function __construct(
public Application $ar... | php | github | https://github.com/laravel/framework | src/Illuminate/Console/Events/ArtisanStarting.php |
"""scharfsandhiWrapper.py
wrapper function is a decorator used by scharfsandhi.
This is one possible implementation, useful with ScharfSandhiArg.py.
"""
mdicttxt = """
rlvarnayormithahsavarnyam:1.1.9:fkAra kArayoH savarRaviDiH
idudeddvivacanampragrhyam:1.1.11:IdUdeddvivacanam pragfhyam
atororhasica:6.1.13:ato ror a... | unknown | codeparrot/codeparrot-clean | ||
from .utils import which
import os
import subprocess
def run_king(vcf_path, ped_obj):
king = which('king')
if king is None:
raise Exception("requested king analysis, but king executable not found")
plink = which('plink')
if plink is None:
raise Exception("requested king analysis, but p... | unknown | codeparrot/codeparrot-clean | ||
import sys
import os
import logging
from PyQt4 import QtGui
import fa
from fa.mods import checkMods
from fa.path import writeFAPathLua, validatePath
from fa.wizards import Wizard
from fa import binary
import mods
import util
logger = logging.getLogger(__name__)
def map(mapname, force=False, silent=False):
"""
... | unknown | codeparrot/codeparrot-clean | ||
#!/bin/sh
test_description='per-worktree refs'
. ./test-lib.sh
test_expect_success 'setup' '
test_commit initial &&
test_commit wt1 &&
test_commit wt2 &&
git worktree add wt1 wt1 &&
git worktree add wt2 wt2 &&
git checkout initial &&
git update-ref refs/worktree/foo HEAD &&
git -C wt1 update-ref refs/worktre... | unknown | github | https://github.com/git/git | t/t1415-worktree-refs.sh |
#
# 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 to ... | unknown | codeparrot/codeparrot-clean | ||
# coding = utf-8
"""
(2) 读写 Excel 文件
From: https://github.com/wizardforcel/pandas-official-tutorials-zh/blob/master/3.3.md
"""
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
plt.style.use("ggplot")
# 设置种子
np.random.seed(111)
# 生成测试数据的函数
def CreateDataSet(Number=1):
Output = list()
for i in ... | 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 applica... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
determine_ext,
ExtractorError,
float_or_none,
get_element_by_class,
int_or_none,
js_to_json,
NO_DEFAULT,
parse_iso8601,
remove_start,
strip_or_none,
url... | unknown | codeparrot/codeparrot-clean | ||
from ctypes import *
from ctypes import util
from .runtime import send_message, ObjCInstance
from .cocoatypes import *
######################################################################
# CORE FOUNDATION
cf = cdll.LoadLibrary(util.find_library('CoreFoundation'))
kCFStringEncodingUTF8 = 0x08000100
CFAllocatorR... | 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... | json | github | https://github.com/apache/kafka | clients/src/main/resources/common/message/OffsetFetchResponse.json |
#
# Copyright (c) 2008--2013 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 | ||
# -*- coding: utf-8 -*-
import arcpy
import collections
import mds
import mds.messages
import numpy
import numpy.lib.recfunctions
import os
import tempfile
#
# LIMITATIONS:
# > Chaining in ModelBuilder:
# Because we test whether an Input File or URL String dataset is valid by
# attempting to open the dataset, th... | unknown | codeparrot/codeparrot-clean | ||
#Extracts the top tweets given a search phrase,
#and generates a Mind-Map from the data.
#A handy tool to get an overall view of whats being talked about
#a particular topic.
##Requires the 'TwitterSearch' Python library.
##Get it here: https://github.com/ckoepp/TwitterSearch
from TwitterSearch import *
from mapgeist... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright (c) 2011 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.
"""Makes sure that all EXE and DLL files in the provided directory were built
correctly.
In essense it runs a subset of BinScope t... | unknown | codeparrot/codeparrot-clean | ||
------------------------------------------------------------------------------------------------
def sss_similarity(s1, s2, threshold=0.50, type='relation', corpus='webbase'):
sss_url = "http://swoogle.umbc.edu/SimService/GetSimilarity"
try:
response = get(sss_url,
params={'opera... | unknown | codeparrot/codeparrot-clean | ||
cfg_trace! {
macro_rules! trace_op {
($name:expr, $readiness:literal) => {
tracing::trace!(
target: "runtime::resource::poll_op",
op_name = $name,
is_ready = $readiness
);
}
}
macro_rules! trace_poll_op {
($name... | rust | github | https://github.com/tokio-rs/tokio | tokio/src/macros/trace.rs |
import { test } from '../../test';
export default test({
error: {
code: 'css_expected_identifier',
message: 'Expected a valid CSS identifier',
position: [9, 9]
}
}); | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/tests/compiler-errors/samples/style-unclosed/_config.js |
# -*- 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 | ||
"""
=============================
Byteswapping and byte order
=============================
Introduction to byte ordering and ndarrays
==========================================
The ``ndarray`` is an object that provide a python array interface to data
in memory.
It often happens that the memory that you want to v... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging as loggers
from abc import ABCMeta, abstractmethod
from deepy.trainers.base import NeuralTrainer
logging = loggers.getLogger(__name__)
THEANO_LINKER = 'cvm'
class CustomizeTrainer(NeuralTrainer):
"""
DEPRECATED !!!
A customized trainer.
"""... | unknown | codeparrot/codeparrot-clean | ||
##
# Copyright 2009-2013 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://vscentrum.be/nl/en),
# the Hercules foundation (htt... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
from wagtail.wagtailadmin.utils import get_object_usage
SNIPPET_MODELS = []
SNIPPET_CONTENT_TYPES = None
def get_snippet_content_types():
global SNIPPET_CONTENT_TYPES
... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2014-2022 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.client.engine.winhttp.internal
import kotlinx.cinterop.*
import platform.windows.*
import platform.windows.HINTERNET
import platform.winhttp.*
@OptIn(ExperimentalForeignApi::... | kotlin | github | https://github.com/ktorio/ktor | ktor-client/ktor-client-winhttp/windows/src/io/ktor/client/engine/winhttp/internal/WinHttpCallback.kt |
# -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from django.views.generic.base import TemplateView
from shoop.admin.dashboa... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2014 Mirantis Inc.
#
# 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 writ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
jinja2.compiler
~~~~~~~~~~~~~~~
Compiles nodes into python code.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from cStringIO import StringIO
from itertools import chain
from copy import deepcopy
from jinja2 import nodes
from j... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.