code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\... | c | github | https://github.com/curl/curl | src/tool_setopt.c |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi, Guewen Baconnier
# Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Lic... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
import pytest
from pandas import (
Index,
IntervalIndex,
Timestamp,
interval_range,
)
import pandas._testing as tm
def monotonic_index(start, end, dtype="int64", closed="right"):
return IntervalIndex.from_breaks(np.arange(start, end, dtype=dtype), closed=closed)
def empty_index... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/indexes/interval/test_setops.py |
# Exports a big code file into the State Decoded XML format (one section per file).
#
# Usage:
# python3 export_to_statedecoded.py ~/data/dc_code/state_decoded < ~/data/dc_code/2013-10.xml
import sys, os, os.path, lxml.etree
def make_node(parent, tag, text, **attrs):
"""Make a node in an XML document."""
n = lxml... | unknown | codeparrot/codeparrot-clean | ||
// SPDX-License-Identifier: GPL-2.0
/*
* linux/kernel/sys.c
*
* Copyright (C) 1991, 1992 Linus Torvalds
*/
#include <linux/export.h>
#include <linux/mm.h>
#include <linux/mm_inline.h>
#include <linux/utsname.h>
#include <linux/mman.h>
#include <linux/reboot.h>
#include <linux/prctl.h>
#include <linux/highuid.h>... | c | github | https://github.com/torvalds/linux | kernel/sys.c |
use rustc_abi::Endian;
use crate::spec::{
Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base,
};
pub(crate) fn target() -> Target {
let mut base = base::freebsd::opts();
// Extra hint to linker that we are generating secure-PLT code.
base.add_pre_link_args(
... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_target/src/spec/targets/powerpc_unknown_freebsd.rs |
/* 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/lib/random/exact_uniform_int.h |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright 2009, Florent Thiery, under the terms of LGPL
"""
import os
os.environ['GST_DEBUG_DUMP_DOT_DIR'] = '/tmp/'
import logging
logger = logging.getLogger('gst-gengui')
import gobject
gobject.threads_init()
from gstmanager.gstmanager import PipelineManager
if _... | unknown | codeparrot/codeparrot-clean | ||
{
"description": "Standard response templates for issue triage actions",
"templates": {
"redirect_to_forum": {
"action": "Close issue and add comment",
"use_when": "Issue is a usage question, not a bug report or feature request",
"comment": "Thank you for your interest in PyTorch! This issue a... | json | github | https://github.com/pytorch/pytorch | .claude/skills/triaging-issues/templates.json |
# This file is auto-generated. See .buildkite/pipelines/periodic.template.yml
# Smart Retries Configuration
# SMART_RETRIES=true enables intelligent test filtering on retry attempts.
# The pre-command hook fetches failed test history from Develocity API and
# the InternalTestRerunPlugin filters test execution to only r... | unknown | github | https://github.com/elastic/elasticsearch | .buildkite/pipelines/periodic.yml |
# -*- test-case-name: twisted.web2.test.test_client -*-
# Copyright (c) 2001-2007 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Client-side HTTP implementation.
"""
from zope.interface import implements
from twisted.internet.defer import Deferred
from twisted.protocols.basic import LineReceiver
from tw... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2021 PerfKitBenchmarker 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 appli... | unknown | codeparrot/codeparrot-clean | ||
"""
Utility functions for tests.
"""
import random
import hashlib
from struct import pack
from dht.node import Node
from dht.routing import RoutingTable
def mknode(nodeid=None, ip=None, port=None, intid=None):
"""
Make a node. Created a random id if not specified.
"""
if intid is not None:
no... | unknown | codeparrot/codeparrot-clean | ||
import os
import mock
import pytest
from datadog_checks.dev import docker_run, get_here
from datadog_checks.octoprint.check import BED_URL, EXTRUDER_URL, JOB_URL
from .common import (
INSTANCE,
MOCK_ACTIVE_JOB_RESPONSE,
MOCK_BED_RESPONSE,
MOCK_EMPTY_JOB_RESPONSE,
MOCK_EXTRUDER_RESPONSE,
URL,
... | unknown | codeparrot/codeparrot-clean | ||
use std::collections::HashMap;
use std::ffi::OsStr;
use std::fs::{File, remove_dir_all};
use std::io::{BufRead, BufReader};
use std::path::{Path, PathBuf};
use std::str::FromStr;
use crate::build;
use crate::config::{Channel, ConfigInfo};
use crate::utils::{
create_dir, get_sysroot_dir, get_toolchain, git_clone, g... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_codegen_gcc/build_system/src/test.rs |
###########################################
# Suppress matplotlib user warnings
# Necessary for newer version of matplotlib
import warnings
warnings.filterwarnings("ignore", category = UserWarning, module = "matplotlib")
###########################################
#
# Display inline matplotlib plots with IPython
from I... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2010 Google Inc.
# All Rights Reserved.
# Author: tschmelcher@google.com (Tristan Schmelcher)
"""Tool for helpers used in linux building process."""
import os
import SCons.Defaults
import subprocess
def _OutputFromShellCommand(command):
process = subprocess.Popen(command, shell=True, stdout=subprocess.... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
# This parser gets all real time interconnection flows from the
# Central American Electrical Interconnection System (SIEPAC).
import arrow
import pandas as pd
url = 'http://www.enteoperador.org/newsite/flash/data.csv'
def read_data():
"""
Reads csv data from the url.
Returns a pa... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2013 Communications Engineering Lab (CEL) / Karlsruhe Institute of Technology (KIT)
#
# This 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 v... | unknown | codeparrot/codeparrot-clean | ||
import waLBerla
import subprocess
import re
from collections import defaultdict
import sys
from datetime import timedelta
base = (32, 16, 2, 64)
BlOCK_SIZES_SQ = [(i, i, i) for i in base]
BLOCK_SIZES_RECT = [(i, i, i // 2) for i in base] + [(i, i // 2, i // 2) for i in base]
time_for_benchmark = 0.25
outer_iterations... | unknown | codeparrot/codeparrot-clean | ||
# example.js
```javascript
import { resetCounter, print } from "./methods";
setTimeout(async () => {
const counter = await import("./counter");
print(counter.value);
counter.increment();
counter.increment();
counter.increment();
print(counter.value);
await resetCounter();
print(counter.value);
}, 100);
```
#... | unknown | github | https://github.com/webpack/webpack | examples/module-code-splitting/README.md |
# -*- coding: utf-8 -*-
"""
***************************************************************************
r_li_pielou_ascii.py
--------------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
******************... | unknown | codeparrot/codeparrot-clean | ||
"""Support for HDMI CEC devices as media players."""
import logging
from pycec.commands import ( # pylint: disable=import-error
CecCommand,
KeyPressCommand,
KeyReleaseCommand,
)
from pycec.const import ( # pylint: disable=import-error
KEY_BACKWARD,
KEY_FORWARD,
KEY_MUTE_TOGGLE,
KEY_PAUSE,... | unknown | codeparrot/codeparrot-clean | ||
# -*- encoding: utf-8 -*-
from abjad import *
def test_scoretools_Note_grace_01():
r'''Attach one grace note.
'''
note = Note("c'4")
grace_container = scoretools.GraceContainer([Note(2, (1, 16))])
attach(grace_container, note)
assert systemtools.TestManager.compare(
note,
r'''... | unknown | codeparrot/codeparrot-clean | ||
##########################################################
# THIS IS A GENERATED FILE -- DO NOT MODIFY.
# IF YOU WISH TO MODIFY THIS SUITE, MODIFY THE CORRESPONDING MATRIX SUITE MAPPING FILE
# AND REGENERATE THE MATRIX SUITES.
#
# matrix suite mapping file: buildscripts/resmokeconfig/matrix_suites/mappings/vector_searc... | unknown | github | https://github.com/mongodb/mongo | buildscripts/resmokeconfig/matrix_suites/generated_suites/vector_search_extension_enabled_sharded_cluster.yml |
# -*- Mode: python; coding: utf-8; tab-width: 8; indent-tabs-mode: t; -*-
#
# Copyright (C) 2010 Kenny Meyer <knny.myer@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either versio... | unknown | codeparrot/codeparrot-clean | ||
from unittest import TestCase
import simplejson.encoder
CASES = [
(u'/\\"\ucafe\ubabe\uab98\ufcde\ubcda\uef4a\x08\x0c\n\r\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?', '"/\\\\\\"\\ucafe\\ubabe\\uab98\\ufcde\\ubcda\\uef4a\\b\\f\\n\\r\\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?"'),
(u'\u0123\u4567\u89ab\ucdef\uabcd\uef4a', '"\\u0... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# 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/.
#
# Contributor: Julien Vehent jvehent@mozilla.com [:ulfr]
# This script connects to the manageme... | unknown | codeparrot/codeparrot-clean | ||
"Test debugobj_r, coverage 56%."
from idlelib import debugobj_r
import unittest
class WrappedObjectTreeItemTest(unittest.TestCase):
def test_getattr(self):
ti = debugobj_r.WrappedObjectTreeItem(list)
self.assertEqual(ti.append, list.append)
class StubObjectTreeItemTest(unittest.TestCase):
d... | python | github | https://github.com/python/cpython | Lib/idlelib/idle_test/test_debugobj_r.py |
/* Copyright (c) 2020, 2025, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
This program is designed to work with certain software (including... | c | github | https://github.com/mysql/mysql-server | sql/sql_system_table_check.h |
/*
* 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 agre... | java | github | https://github.com/google/guava | android/guava-tests/test/com/google/common/base/OptionalTest.java |
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/gpio/gpio-mmio.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Generic MMIO GPIO
maintainers:
- Linus Walleij <linusw@kernel.org>
- Bartosz Golaszewski <brgl@bgdev.pl>
description:
Som... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/gpio/gpio-mmio.yaml |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may n... | java | github | https://github.com/apache/kafka | clients/src/test/java/org/apache/kafka/common/network/CertStores.java |
# 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 shutil
import sys
import uuid
from .. import testloader
from base import Step, StepRunner
from tree i... | unknown | codeparrot/codeparrot-clean | ||
import Image from "next/image";
import ViewSource from "../../components/view-source";
import styles from "../../styles.module.css";
import mountains from "../../public/mountains.jpg";
const BackgroundPage = () => (
<div>
<ViewSource pathname="app/background/page.tsx" />
<div className={styles.bgWrap}>
... | typescript | github | https://github.com/vercel/next.js | examples/image-component/app/background/page.tsx |
from hachoir_metadata.metadata import RootMetadata, registerExtractor
from hachoir_metadata.image import computeComprRate
from hachoir_parser.image.exif import ExifEntry
from hachoir_parser.image.jpeg import (
JpegFile, JpegChunk,
QUALITY_HASH_COLOR, QUALITY_SUM_COLOR,
QUALITY_HASH_GRAY, QUALITY_SUM_GRAY)
f... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# Copyright: (c) 2018, REY Remi
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview']... | unknown | codeparrot/codeparrot-clean | ||
# SConsBuildFramework - Copyright (C) 2014, Nicolas Papier.
# Distributed under the terms of the GNU General Public License (GPL)
# as published by the Free Software Foundation.
# Author Nicolas Papier
class Use_colladadom( IUse ):
def getName( self ):
return "colladadom"
def getVersions( self ):
return [ '2-1'... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from pyaudio import PyAudio, paInt16
import wave, os,time
import numpy as np
class AudioTool:
'''
This function include record and play, if you want to play and record,
please set the play is True.
The sample rate is 44100
Bit:16
'''
def __init__(self):
self.... | unknown | codeparrot/codeparrot-clean | ||
"""Read the magpy configuration file."""
import os
import re
import json
from copy import deepcopy
from magpy.server.utils import get_mag_path, make_cookie_secret
# Regular expression for comments
COMMENT_RE = re.compile(
r'(^)?[^\S\n]*/(?:\*(.*?)\*/[^\S\n]*|/[^\n]*)($)?',
re.DOTALL | re.MULTILINE
)
class M... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
from dateutil.zoneinfo import rebuild
import shutil
import sys
import os
import re
SERVER = "elsie.nci.nih.gov"
DIR = "/pub"
NAME = re.compile("tzdata(.*).tar.gz")
def main():
if len(sys.argv) == 2:
tzdata = sys.argv[1]
else:
from ftplib import FTP
print "Connecting t... | unknown | codeparrot/codeparrot-clean | ||
import json
import inspect
from functools import partial
from collections import OrderedDict
from coalib.bears.LocalBear import LocalBear
from coala_utils.decorators import enforce_signature
from coalib.misc.Shell import run_shell_command
from coalib.results.Result import Result
from coalib.results.SourceRange import ... | unknown | codeparrot/codeparrot-clean | ||
import argparse
from collections import defaultdict
import numpy as np
from glove import Glove, metrics
if __name__ == '__main__':
parser = argparse.ArgumentParser(description=('Evaluate a trained GloVe '
'model on an analogy task.'))
parser.add_argument('--t... | 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 n... | java | github | https://github.com/apache/kafka | connect/api/src/main/java/org/apache/kafka/connect/storage/ConverterConfig.java |
# apis_v1/views/views_twitter.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from config.base import get_environment_variable
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from import_export_twitter.controllers import twitter_sign_in_start_for_api, \
... | unknown | codeparrot/codeparrot-clean | ||
"""SCons.Tool.mslib
Tool-specific initialization for lib (MicroSoft library archiver).
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, ... | unknown | codeparrot/codeparrot-clean | ||
"""
TODO
prepare tasks, don't launch them (multiprocessing_tasks.py and celery_tasks.py will take care of
launching them with different processes and on different machines, respectively)
prepare tasks = create list of tasks to be executed in parallel, list of parameters to give
as input to one function that will be exe... | unknown | codeparrot/codeparrot-clean | ||
#ifndef DATE_TIME_TIME_ITERATOR_HPP___
#define DATE_TIME_TIME_ITERATOR_HPP___
/* Copyright (c) 2002,2003 CrystalClear Software, Inc.
* Use, modification and distribution is subject to the
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Auth... | unknown | github | https://github.com/mysql/mysql-server | extra/boost/boost_1_87_0/boost/date_time/time_iterator.hpp |
"""
Objects for dealing with Hermite series.
This module provides a number of objects (mostly functions) useful for
dealing with Hermite series, including a `Hermite` class that
encapsulates the usual arithmetic operations. (General information
on how this module represents and works with such polynomials is in the
d... | unknown | codeparrot/codeparrot-clean | ||
import unittest
from Selenium2Library.locators import TableElementFinder
from mockito import *
class ElementFinderTests(unittest.TestCase):
def test_find_with_implicit_css_locator(self):
finder = TableElementFinder()
browser = mock()
when(browser).find_elements_by_css_selector("table#test1... | unknown | codeparrot/codeparrot-clean | ||
"""
Example generation from python files.
Generate the rst files for the examples by iterating over the python
example files. Files that generate images should start with 'plot'.
To generate your own examples, add this extension to the list of
``extensions``in your Sphinx configuration file. In addition, make sure th... | unknown | codeparrot/codeparrot-clean | ||
from couchpotato.core.event import fireEvent
from couchpotato.core.helpers.encoding import toUnicode, tryUrlencode
from couchpotato.core.helpers.rss import RSS
from couchpotato.core.helpers.variable import tryInt
from couchpotato.core.logger import CPLog
from couchpotato.core.providers.nzb.base import NZBProvider
from ... | 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 distribut... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006-2008 (ita)
"""
Java support
Javac is one of the few compilers that behaves very badly:
* it outputs files where it wants to (-d is only for the package root)
* it recompiles files silently behind your back
* it outputs an undefined amount of files (inner cla... | unknown | codeparrot/codeparrot-clean | ||
from test import test_support
import types
import unittest
class FuncAttrsTest(unittest.TestCase):
def setUp(self):
class F:
def a(self):
pass
def b():
return 3
self.f = F
self.fi = F()
self.b = b
def cannot_set_attr(self,obj, nam... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
"""Action helper to sign a file with a provided private key using GPG.
This replaces the inline `_gpg_sign.sh` that `bazel/signing.bzl` used to generate.
Args (positional):
1) GPG: path to the gpg binary to execute
2) KEY: path to the ascii-armored private key file to import
3) PASSPHRASE... | python | github | https://github.com/mongodb/mongo | bazel/gpg_signer.py |
#-*- coding: utf-8 -*-
###########################################################################
## ##
## Copyrights Etienne Chové <chove@crans.org> 2009 ##
## ... | unknown | codeparrot/codeparrot-clean | ||
"""Utility for testing presence and usability of .pxd files in the installation
Usage:
------
python check_pxd_in_installation.py path/to/install_dir/of/scikit-learn
"""
import os
import sys
import pathlib
import tempfile
import textwrap
import subprocess
sklearn_dir = pathlib.Path(sys.argv[1])
pxd_files = list(skle... | 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 distribut... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import division, absolute_import, print_function
import os
import sys
import warnings
import collections
from . import multiarray
from . import umath
from .umath import (invert, sin, UFUNC_BUFSIZE_DEFAULT, ERR_IGNORE,
ERR_WARN, ERR_RAISE, ERR_CALL, ERR_PRINT, ERR_LOG,
... | unknown | codeparrot/codeparrot-clean | ||
import os
from coalib.output.dbus.DbusDocument import DbusDocument
class DbusApp:
"""
Stores data about each client that connects to the DbusServer
"""
def __init__(self, app_id, name=""):
self.app_id = app_id
self.name = name
self.docs = {}
self.__next_doc_id = 0
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('contributions', '0002_auto_20150131_2027'),
]
operations = [
migrations.AddField(
model_name='contribution',
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-09 12:06
from __future__ import unicode_literals
from django.db import migrations
import django_countries.fields
class Migration(migrations.Migration):
dependencies = [
('UserManagement', '0012_auto_20170309_1227'),
]
operations = [... | unknown | codeparrot/codeparrot-clean | ||
#!/bin/bash
_circle_token=$1
_grafana_version=$2
trigger_build_url="https://circleci.com/api/v1/project/grafana/grafana-docker/tree/master?circle-token=${_circle_token}"
post_data=$(cat <<EOF
{
"build_parameters": {
"GRAFANA_VERSION": "${_grafana_version}"
}
}
EOF
)
echo "${post_data}"
curl \
--header "Acc... | unknown | github | https://github.com/grafana/grafana | scripts/trigger_docker_build.sh |
import kotlinx.coroutines.testing.*
import kotlinx.coroutines.*
import kotlinx.coroutines.debug.*
import kotlinx.coroutines.debug.internal.*
import org.junit.*
/**
* This is fast but fragile version of [DebugLeaksStressTest] that check reachability of a captured object
* in [DebugProbesImpl] via [FieldWalker].
*/
@... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | kotlinx-coroutines-debug/test/DebugLeaksTest.kt |
"""
===========================
Pipeline bamstats
===========================
:Author: Adam Cribbs
:Release: $Id$
:Date: |today|
:Tags: Python
The intention of this pipeline is to perform QC statistics on
`.bam` files that are produced following mapping of fastq
files.
The pipeline requires a `.bam` file as an... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
""" Tests for student account views. """
import re
from unittest import skipUnless
from urllib import urlencode
import json
import mock
import ddt
from django.test import TestCase
from django.conf import settings
from django.core.urlresolvers import reverse
from django.core import mail
from dj... | unknown | codeparrot/codeparrot-clean | ||
import re
from xml.sax.saxutils import escape, unescape
from tokenizer import HTMLTokenizer
from constants import tokenTypes
class HTMLSanitizerMixin(object):
""" sanitization of XHTML+MathML+SVG and of inline style attributes."""
acceptable_elements = ['a', 'abbr', 'acronym', 'address', 'area',
'art... | unknown | codeparrot/codeparrot-clean | ||
"""
This bootstrap module should be used to setup parts of the version_tracker plugin
that need to exist before all controllers are loaded. It is best used to
define/register hooks, setup namespaces, and the like.
"""
from pkg_resources import get_distribution
from cement.core.namespace import CementNamespace, regis... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright (C) 2007 Kevin Ollivier 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 retain the above copyright
# notice, this li... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
from decimal import Decimal
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = ... | unknown | codeparrot/codeparrot-clean | ||
use std::future::Future;
use std::sync::Arc;
use std::task::Poll;
use tokio::sync::{OwnedSemaphorePermit, Semaphore};
use tokio_util::sync::PollSemaphore;
type SemRet = Option<OwnedSemaphorePermit>;
fn semaphore_poll(
sem: &mut PollSemaphore,
) -> tokio_test::task::Spawn<impl Future<Output = SemRet> + '_> {
l... | rust | github | https://github.com/tokio-rs/tokio | tokio-util/tests/poll_semaphore.rs |
#!/usr/bin/python
# Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unittests for the retry_stats.py module."""
from __future__ import print_function
import os
import StringIO
import sys
sys.path... | unknown | codeparrot/codeparrot-clean | ||
'use server'
export default async (a, b) => {
console.log(a, b)
} | javascript | github | https://github.com/vercel/next.js | crates/next-custom-transforms/tests/fixture/server-actions/server-graph/15/input.js |
# -*- encoding: utf-8 -*-
##############################################################################
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2020 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/compiler/mlir/tfr/passes/passes.h |
@file:JvmMultifileClass
@file:JvmName("FlowKt")
package kotlinx.coroutines.flow
import kotlin.jvm.*
/**
* Collects given flow into a [destination]
*/
public suspend fun <T> Flow<T>.toList(destination: MutableList<T> = ArrayList()): List<T> = toCollection(destination)
/**
* Collects given flow into a [destination... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | kotlinx-coroutines-core/common/src/flow/terminal/Collection.kt |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2007 Troy Melhase <troy@gci.net>
# Distributed under the terms of the GNU General Public License v2
# Author: Troy Melhase <troy@gci.net>
from PyQt4.QtCore import Qt, QModelIndex, QObject, QVariant, QAbstractItemModel
class BasicItem(object):
"""
"""... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python2.7
# encoding: utf-8
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Vers... | unknown | codeparrot/codeparrot-clean | ||
#ifndef NUMPY_CORE_SRC_MULTIARRAY_ARRAY_CONVERTER_H_
#define NUMPY_CORE_SRC_MULTIARRAY_ARRAY_CONVERTER_H_
#include "numpy/ndarraytypes.h"
extern NPY_NO_EXPORT PyTypeObject PyArrayArrayConverter_Type;
typedef enum {
NPY_CH_ALL_SCALARS = 1 << 0,
NPY_CH_ALL_PYSCALARS = 1 << 1,
} npy_array_converter_flags;
typed... | c | github | https://github.com/numpy/numpy | numpy/_core/src/multiarray/array_converter.h |
import io
import sys
import unittest
def resultFactory(*_):
return unittest.TestResult()
class TestSetups(unittest.TestCase):
def getRunner(self):
return unittest.TextTestRunner(resultclass=resultFactory,
stream=io.StringIO())
def runTests(self, *cases):... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import
from __future__ import with_statement
import new
from . import ir as I
from . import codegen
from .block import compile_time_eval, common_transform
from .preeval import evaluate_compile_time_values
from .purity import purep
from ..runtime.purity import register_pure
def make_fu... | unknown | codeparrot/codeparrot-clean | ||
#Apache OCW lib immports
from ocw.dataset import Dataset, Bounds
import ocw.data_source.local as local
import ocw.data_source.rcmed as rcmed
import ocw.dataset_processor as dsp
import ocw.evaluation as evaluation
import ocw.metrics as metrics
import ocw.plotter as plotter
import ocw.utils as utils
import datetime
impo... | unknown | codeparrot/codeparrot-clean | ||
from gi.repository import Gtk, Gdk
from src.gtk_helper import GtkHelper
class MainWindowViewModel:
_watch_cursor = Gdk.Cursor.new(Gdk.CursorType.WATCH)
def __init__(self, main_window, new_replications_window):
self._main_window = main_window
self._new_replications_window = new_replications_wi... | 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... | unknown | codeparrot/codeparrot-clean | ||
from sympy import (
Abs, acos, Add, atan, Basic, besselsimp, binomial, collect,
collect_const, combsimp, cos, cosh, cot, coth, count_ops, denom,
Derivative, diff, Dummy, E, Eq, erf, exp, exp_polar, expand,
expand_multinomial, exptrigsimp, factor, factorial, FallingFactorial,
Float, fraction, Functio... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package okta
import (
"context"
"strings"
"testing"
"time"
"github.com/go-test/deep"
log "github.com/hashicorp/go-hclog"
"github.com/hashicorp/vault/sdk/helper/logging"
"github.com/hashicorp/vault/sdk/logical"
)
func TestGroupsList(t *te... | go | github | https://github.com/hashicorp/vault | builtin/credential/okta/path_groups_test.go |
from rest_framework import serializers
from django.contrib.auth.models import User
from rest_framework_gis.serializers import GeoModelSerializer
from .models import Alert, HouseholdSurveyJSON, TeamMember, HouseholdMember
class JSONSerializerField(serializers.Field):
""" Serializer for JSONField -- required to ma... | unknown | codeparrot/codeparrot-clean | ||
from django.conf import settings
from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from oscar.core.application import Application
from oscar.core.loading import get_class
class CheckoutApplication(Application):
name = 'checkout'
index_view = get_class('checkout.views'... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from sanic import Sanic
from functools import wraps
from sanic.response import json
app = Sanic()
def check_request_for_authorization_status(request):
# Note: Define your check, for instance cookie, session.
flag = True
return flag
def authorized():
def decorator(f):
... | unknown | codeparrot/codeparrot-clean | ||
/* ----------------------------------------------------------------------------
Copyright (c) 2018-2023, Microsoft Research, Daan Leijen
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distri... | c | github | https://github.com/python/cpython | Include/internal/mimalloc/mimalloc/prim.h |
/* Copyright 2022 - 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/asm/riscv/registers.hpp |
#!/usr/bin/env python
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to us... | unknown | codeparrot/codeparrot-clean | ||
#
# Copyright 2012-2019 University of Southern California
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | unknown | codeparrot/codeparrot-clean | ||
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... | unknown | github | https://github.com/opencv/opencv | modules/core/include/opencv2/core/neon_utils.hpp |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Red Hat, Inc.
#
# 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 ... | 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 us... | unknown | codeparrot/codeparrot-clean | ||
{
"Id": "sha256:44cc64492fb6a6d78d3e6d087f380ae6e479aa1b2c79823b32cdacfcc2f3d715",
"RepoTags": [
"paketo-buildpacks/cnb:base",
"paketo-buildpacks/builder:base-platform-api-0.2"
],
"RepoDigests": [
"paketo-buidpacks/cnb@sha256:5b03a853e636b78c44e475bbc514e2b7b140cc41cca8ab907e9753431ae8c0b0"
],
"Parent": "",... | json | github | https://github.com/spring-projects/spring-boot | buildpack/spring-boot-buildpack-platform/src/test/resources/org/springframework/boot/buildpack/platform/build/image-with-run-image-different-registry.json |
import NIOConcurrencyHelpers
extension Application {
public struct Service<ServiceType> {
let application: Application
public init(application: Application) {
self.application = application
}
public struct Provider {
let run: (Application) -> ()
... | swift | github | https://github.com/vapor/vapor | Sources/Vapor/Services/Service.swift |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Main entry point for the NaCl SDK buildbot.
The entry point used to be build_sdk.py itself, but we want
to be able to simplify ... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.