code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
# Tweepy # Copyright 2009-2010 Joshua Roesslein # See LICENSE for details. from urllib2 import Request, urlopen import base64 from tweepy import oauth from tweepy.error import TweepError from tweepy.api import API class AuthHandler(object): def apply_auth(self, url, method, headers, parameters): """Appl...
unknown
codeparrot/codeparrot-clean
function Component(props) { const x = new Foo(...props.foo, null, ...[props.bar]); return x; }
javascript
github
https://github.com/facebook/react
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/new-spread.js
#============================================================================ # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in the hope th...
unknown
codeparrot/codeparrot-clean
--- - hosts: localhost gather_facts: no tasks: - name: test ansible.legacy short group name module_defaults: group/testgroup: data: test block: - legacy_ping: register: result - assert: that: "result.ping == 'pong'" - ansible.legacy.le...
unknown
github
https://github.com/ansible/ansible
test/integration/targets/module_defaults/test_action_groups.yml
#!/usr/bin/env python # # $Id: fix_copyright.py 9318 2011-06-10 02:37:10Z nathan_george $ # # Proprietary and confidential. # Copyright $Date:: 2011#$ Perfect Search Corporation. # All rights reserved. # import sys, os, re, sandbox, check_copyright, optparse from ioutil import * parser = optparse.OptionParser('Usage: ...
unknown
codeparrot/codeparrot-clean
import scipy import scipy.misc import scipy.cluster from scipy.cluster.vq import vq, kmeans import Image import webcolors import numpy LOG_LEVEL_REGULAR = 0 LOG_LEVEL_DEBUG = 1 class ColorDetector: NUM_OF_CLUSTERS = 10 log_level = LOG_LEVEL_REGULAR def log(self, msg, log_level=LOG_LEVEL_DEBUG): ...
unknown
codeparrot/codeparrot-clean
# Copyright 2010 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
unknown
codeparrot/codeparrot-clean
import unittest from ctypes import * formats = "bBhHiIlLqQfd" formats = c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint, \ c_long, c_ulonglong, c_float, c_double class ArrayTestCase(unittest.TestCase): def test_simple(self): # create classes holding simple numeric types, and check # v...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2011 Benoit HERVIER <khertan@khertan.net> # Licenced under GPLv3 # 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; version 3 only. # # ...
unknown
codeparrot/codeparrot-clean
import operator from functools import reduce from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured from django.core.paginator import InvalidPage from django.core.urlresolvers import reverse from django.db import models from django.db.models.fields import FieldDoesNotExist from django.utils.datas...
unknown
codeparrot/codeparrot-clean
############################################################################## # # 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 Affero General Public L...
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
build-plugin/spring-boot-maven-plugin/src/intTest/projects/run-exclude/src/main/java/org/test/SampleApplication.java
#!/usr/bin/env python import argparse import codecs import io import re from pycoin.serialize import h2b_rev from pycoin.services import get_tx_db from pycoin.tx import Tx def main(): parser = argparse.ArgumentParser(description="Add a transaction to tx cache.") parser.add_argument("tx_id_or_path", nargs="+"...
unknown
codeparrot/codeparrot-clean
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( int_or_none, parse_duration, parse_iso8601, clean_html, ) class CCMAIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?ccma\.cat/(?:[^/]+/)*?(?P<type>video|audio)/(?P<id>\d+...
unknown
codeparrot/codeparrot-clean
// Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // ...
c
github
https://github.com/opencv/opencv
3rdparty/protobuf/src/google/protobuf/map_field.h
""" You are given two arrays A and B each containing integers. You need to choose exactly one number from A and exactly one number from B such that the index of the two chosen numbers is not same and the sum of the 2 chosen values is minimum. Your objective is to find and print this minimum value. """ #!/bin/python3 ...
unknown
codeparrot/codeparrot-clean
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
unknown
codeparrot/codeparrot-clean
from ajenti.com import * from ajenti.apis import API from ajenti.api import CategoryPlugin, event from ajenti.ui import UI from ajenti import apis class Services(API): class IServiceManager(Interface): def list_all(self): pass def get_status(self, name): pass def s...
unknown
codeparrot/codeparrot-clean
from __future__ import print_function import copy import numpy import theano from theano import Variable, Constant from theano import tensor from theano.compile import SharedVariable from theano.sandbox.cuda.type import CudaNdarrayType try: # We must do those import to be able to create the full doc when nvcc ...
unknown
codeparrot/codeparrot-clean
"""Support for Waterfurnace.""" from homeassistant.components.sensor import ENTITY_ID_FORMAT from homeassistant.const import PERCENTAGE, POWER_WATT, TEMP_FAHRENHEIT from homeassistant.core import callback from homeassistant.helpers.entity import Entity from homeassistant.util import slugify from . import DOMAIN as WF...
unknown
codeparrot/codeparrot-clean
/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
go
github
https://github.com/kubernetes/kubernetes
cmd/kubeadm/app/cmd/util/cmdutil.go
# -*- coding: utf-8 -*- """ *************************************************************************** DeleteDuplicateGeometries.py --------------------- Date : May 2010 Copyright : (C) 2010 by Michael Minn Email : pyqgis at michaelminn dot com ***********...
unknown
codeparrot/codeparrot-clean
from django.contrib.auth.models import User from django.contrib.auth import authenticate from django.contrib.auth.tokens import default_token_generator from django.contrib.sites.models import get_current_site from django.template import Context, loader from django import forms from django.utils.translation import ugett...
unknown
codeparrot/codeparrot-clean
# The default ``config.py`` def set_prefs(prefs): """This function is called before opening the project""" # Specify which files and folders to ignore in the project. # Changes to ignored resources are not added to the history and # VCSs. Also they are not returned in `Project.get_files()`. # Not...
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
# 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 in...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python -tt # 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 distrib...
unknown
codeparrot/codeparrot-clean
from sympy.mpmath import * def test_sumem(): mp.dps = 15 assert sumem(lambda k: 1/k**2.5, [50, 100]).ae(0.0012524505324784962) assert sumem(lambda k: k**4 + 3*k + 1, [10, 100]).ae(2050333103) def test_nsum(): mp.dps = 15 assert nsum(lambda x: x**2, [1, 3]) == 14 assert nsum(lambda k: 1/factori...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # 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 Lic...
unknown
codeparrot/codeparrot-clean
"""Simple tutorial using code from the TensorFlow example for Regression. Parag K. Mital, Jan. 2016""" # pip3 install --upgrade # https://storage.googleapis.com/tensorflow/mac/tensorflow-0.6.0-py3-none-any.whl # %% import tensorflow as tf import tensorflow.examples.tutorials.mnist.input_data as input_data import numpy...
unknown
codeparrot/codeparrot-clean
"""Invocation: python manage.py verify_smartgrid Verifies that all of the existing smartgrid unlock condition strings are valid. Prints out the names of any invalid conditions.""" from apps.managers.challenge_mgr.challenge_mgr import MakahikiBaseCommand from apps.utils import utils from apps.widgets.smartgrid.model...
unknown
codeparrot/codeparrot-clean
# # Author: Pearu Peterson, March 2002 # # w/ additions by Travis Oliphant, March 2002 __all__ = ['solve', 'solve_triangular', 'solveh_banded', 'solve_banded', 'inv', 'det', 'lstsq', 'pinv', 'pinv2'] from numpy import asarray, zeros, sum, conjugate, dot, transpose, \ asarray_chkfinite, single imp...
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 for architecture output directory fixups.""" import cr class _ArchInitHookHelper(cr.InitHook): """Base class helper for CR_ARCH value fixups....
unknown
codeparrot/codeparrot-clean
/* * Copyright (c) 2009-Present, Redis Ltd. * All rights reserved. * * Licensed under your choice of (a) the Redis Source Available License 2.0 * (RSALv2); or (b) the Server Side Public License v1 (SSPLv1); or (c) the * GNU Affero General Public License v3 (AGPLv3). */ /* ---------------------------------------...
c
github
https://github.com/redis/redis
src/resp_parser.c
__copyright__ = "Copyright 2016, Leidos, Inc." __license__ = "Apache 2.0" __status__ = "Beta" __year__ = "2016" import sys import numpy from copy import deepcopy import requests import logging log = logging.getLogger(__name__) from .visualization import Visualization VALS_LIST = ['few', 'medium', 'many', 'infinite'...
unknown
codeparrot/codeparrot-clean
#****************************************************************************** # Eurecom OpenAirInterface # Copyright(c) 1999 - 2013 Eurecom # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published by ...
unknown
codeparrot/codeparrot-clean
# Copyright 2013 Red Hat, 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 a...
unknown
codeparrot/codeparrot-clean
<?php namespace Illuminate\Mail\Events; use Exception; use Illuminate\Mail\SentMessage; use Illuminate\Support\Collection; /** * @property \Symfony\Component\Mime\Email $message */ class MessageSent { /** * Create a new event instance. * * @param \Illuminate\Mail\SentMessage $sent The message...
php
github
https://github.com/laravel/framework
src/Illuminate/Mail/Events/MessageSent.php
import math from csaopt.utils import clamp from typing import MutableSequence, Sequence, Any, Tuple from math import pi # -- Globals m = 5 c = (1, 2, 5, 2, 3) A = ((3, 5), (5, 2), (2, 1), (1, 4), (7, 9)) # -- Globals # Configuration def empty_state() -> Tuple: return (0.0, 0.0) # Functions def cool(initial_...
unknown
codeparrot/codeparrot-clean
# (c) 2017 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_function) __metaclass__ = type DOCUMENTATION = """ lookup: aws_account_attribute author: - Sloane Hertel <shertel@redhat.com> version_added:...
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
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 IBM Corp. # 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/licen...
unknown
codeparrot/codeparrot-clean
#include "jemalloc/internal/jemalloc_preamble.h" #include "jemalloc/internal/jemalloc_internal_includes.h" #include "jemalloc/internal/sec.h" static edata_t *sec_alloc(tsdn_t *tsdn, pai_t *self, size_t size, size_t alignment, bool zero, bool guarded, bool frequent_reuse, bool *deferred_work_generated); static...
c
github
https://github.com/redis/redis
deps/jemalloc/src/sec.c
import datetime from stats.models import GlobalStat from mkt.monolith.models import MonolithRecord METRIC = 'apps_count_installed' def run(): """Backfill apps_count_installed.""" # Get the first metric and increment daily until today's date. today = datetime.datetime.today().replace(hour=0, minute=0, sec...
unknown
codeparrot/codeparrot-clean
import x from "./module-x"; export default function() { if(Math.random() < -1) { import(/* webpackChunkName: "a" */"./module-a"); import(/* webpackChunkName: "b" */"./module-b"); } return x; }
javascript
github
https://github.com/webpack/webpack
test/cases/chunks/circular-correctness/module-c.js
package loggerutils import ( "compress/gzip" "context" "encoding/json" "fmt" "io" "io/fs" "math" "os" "slices" "strconv" "sync" "time" "github.com/containerd/containerd/v2/pkg/tracing" "github.com/containerd/log" "github.com/moby/moby/v2/daemon/logger" "github.com/moby/moby/v2/pkg/pools" "github.com/...
go
github
https://github.com/moby/moby
daemon/logger/loggerutils/logfile.go
/* Copyright 2023 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/tfrt/ifrt/ifrt_serving_executable.h
<div cdkDropList class="example-list" (cdkDropListDropped)="drop($event)"> @for (movie of movies; track movie) { <div class="example-box" cdkDrag> <div class="example-custom-placeholder" *cdkDragPlaceholder></div> {{ movie }} </div> } </div>
html
github
https://github.com/angular/angular
adev/src/content/examples/drag-drop/src/custom-placeholder/app/app.html
/* * Copyright (C) Igor Sysoev * Copyright (C) Nginx, Inc. */ #ifndef _NGX_HTTP_H_INCLUDED_ #define _NGX_HTTP_H_INCLUDED_ #include <ngx_config.h> #include <ngx_core.h> typedef struct ngx_http_request_s ngx_http_request_t; typedef struct ngx_http_upstream_s ngx_http_upstream_t; typedef struct ngx_http_cache...
c
github
https://github.com/nginx/nginx
src/http/ngx_http.h
from __future__ import absolute_import from django.db import connection from django.db.models import Q from django.contrib.gis.geos import GEOSGeometry, LineString from django.contrib.gis.measure import D # alias for Distance from django.contrib.gis.tests.utils import oracle, postgis, spatialite, no_oracle, no_spatial...
unknown
codeparrot/codeparrot-clean
""" Management of trusting communities and Members Grid for Digital Security (G4DS) Both classes CommunityManager and UserManager are implemented using the Singleton Pattern. This way, only one instance must exist. Access this instance by L{communitymanager.getCommunityManager} for the CommunityManager, and L{commu...
unknown
codeparrot/codeparrot-clean
// MODULE: context // ISSUE: KT-68695 // FILE: context.kt class Clazz() { private lateinit var lateinitStr: String fun showLateinitStr() { <caret_context>lateinitStr } } // MODULE: main // MODULE_KIND: CodeFragment // CONTEXT_MODULE: context // FILE: fragment.kt // CODE_FRAGMENT_KIND: EXPRESSIO...
kotlin
github
https://github.com/JetBrains/kotlin
analysis/analysis-api/testData/components/compilerFacility/compilation/codeFragments/capturing/propertyReference.kt
#!/usr/bin/env python from generator.actions import Actions, Variable from collections import deque import random import string class TemplateGenerator(Actions): def start(self): self.results = 0 self.result_xml = [] self.balance = random.randint(1,20)*2 self.purchase_song_sid = "" self.price = 0 self.t...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- from pytils import numeral # in_words нужен для представления цифр словами print numeral.in_words(12) #-> двенадцать # вторым параметром можно задать пол: # мужской=numeral.MALE, женский=numeral.FEMALE, срелний=numeral.NEUTER (по умолчанию -- мужской) print numeral.in_w...
unknown
codeparrot/codeparrot-clean
import toplevel_existing import toplevel_nonexisting class MyClass: import toplevel_class_existing import toplevel_class_nonexisting if a == b: import toplevel_conditional_existing import toplevel_conditional_nonexisting try: import toplevel_conditional_import_existing import topl...
unknown
codeparrot/codeparrot-clean
import subprocess from pathlib import Path from django.core.management.base import BaseCommand from django.db.models import Avg, Sum, Max from django.utils.dateparse import parse_datetime from django.utils.timezone import make_aware from tabulate import tabulate from qcat.models import MemoryLog class Command(BaseCo...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # # SelfTest/Hash/MD2.py: Self-test for the MD2 hash function # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication ...
unknown
codeparrot/codeparrot-clean
--- - name: Verify handler can include other tasks (#47287) hosts: testhost tasks: - name: include a task from the tasks section include_tasks: handlers.yml - name: notify a handler debug: msg: notifying handler changed_when: yes notify: - include a task from the han...
unknown
github
https://github.com/ansible/ansible
test/integration/targets/handlers/test_handlers_including_task.yml
import { test } from '../../test'; export default test({ error: { code: 'tag_invalid_name', message: 'Expected a valid element or component name. Components must have a valid variable name or dot notation expression', position: [1, 8] } });
javascript
github
https://github.com/sveltejs/svelte
packages/svelte/tests/compiler-errors/samples/element-invalid-name/_config.js
{ "severity": "error", "summary": "Bad news", "detail": "It went wrong", "range": { "filename": "modules/oops/missing.tf", "start": { "line": 1, "column": 6, "byte": 5 }, "end": { "line": 2, "column": 12, "byte": 33 } } }
json
github
https://github.com/hashicorp/terraform
internal/command/views/json/testdata/diagnostic/error-with-source-code-unavailable.json
//// [tests/cases/conformance/classes/classStaticBlock/classStaticBlock24.ts] //// //// [classStaticBlock24.ts] export class C { static x: number; static { C.x = 1; } } //// [classStaticBlock24.js] export class C { } (() => { C.x = 1; })();
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/classStaticBlock24(module=es2022).js
from flask.ext.login import UserMixin from scytale.models import db, bcrypt, Point class Group(UserMixin, db.Model): gid = db.Column(db.Integer, primary_key=True) name = db.Column(db.Text, unique=True) password = db.Column(db.Text) def get_id(self): return str(self.gid) def set_password(...
unknown
codeparrot/codeparrot-clean
/* * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ package io.ktor.server.engine import io.ktor.events.* import io.ktor.server.application.* import io.ktor.server.config.* import io.ktor.utils.io.* import org.slf4j.* /** * Builder for confi...
kotlin
github
https://github.com/ktorio/ktor
ktor-server/ktor-server-core/jvm/src/io/ktor/server/engine/ApplicationEnvironmentJvm.kt
// (C) Copyright John Maddock 2000. // Use, modification and distribution are subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt). // // See http://www.boost.org/libs/type_traits for most recent version including document...
unknown
github
https://github.com/mysql/mysql-server
extra/boost/boost_1_87_0/boost/type_traits.hpp
//// [tests/cases/conformance/async/es5/asyncAliasReturnType_es5.ts] //// //// [asyncAliasReturnType_es5.ts] type PromiseAlias<T> = Promise<T>; async function f(): PromiseAlias<void> { } //// [asyncAliasReturnType_es5.js] "use strict"; function f() { return __awaiter(this, void 0, void 0, function* () { }); ...
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/asyncAliasReturnType_es5(target=es2015).js
# # The Python Imaging Library # $Id$ # # Adobe PSD 2.5/3.0 file handling # # History: # 1995-09-01 fl Created # 1997-01-03 fl Read most PSD images # 1997-01-18 fl Fixed P and CMYK support # 2001-10-21 fl Added seek/tell support (for layers) # # Copyright (c) 1997-2001 by Secret Labs AB. # Copyright (c) 1995-20...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python """The Python implementation of the GRPC rc.RC client.""" from __future__ import print_function import grpc, rc_pb2, rc_pb2_grpc, sys def main(): usage = "rc_client.py <server IP address or routable domain name> <commands to send to rc_server.py>" version = "Skadi Automation Client Version: 1...
unknown
codeparrot/codeparrot-clean
from __future__ import unicode_literals from csvkit import CSVKitWriter from calaccess_raw import models from django.db import connection from calaccess_raw.management.commands import CalAccessCommand class Command(CalAccessCommand): help = 'Dump all of the unique campaign contributor names' def handle(self, ...
unknown
codeparrot/codeparrot-clean
import unittest from django.db import connection from django.test import TransactionTestCase, skipUnlessDBFeature from ..models import Person, Square @unittest.skipUnless(connection.vendor == "oracle", "Oracle tests") class DatabaseSequenceTests(TransactionTestCase): available_apps = [] def test_get_sequenc...
python
github
https://github.com/django/django
tests/backends/oracle/test_introspection.py
# Copyright 2013-2014 MongoDB, 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 writin...
unknown
codeparrot/codeparrot-clean
''' Implementation of Bitcoin's p2p protocol ''' import random import sys import time from twisted.internet import protocol import p2pool from . import data as bitcoin_data from p2pool.util import deferral, p2protocol, pack, variable class Protocol(p2protocol.Protocol): def __init__(self, net): p2protoc...
unknown
codeparrot/codeparrot-clean
import unittest, random, sys, time, os sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_glm, h2o_browse as h2b, h2o_import as h2i, h2o_exec as h2e def write_syn_dataset(csvPathname, rowCount, colCount, SEED): r1 = random.Random(SEED) dsf = open(csvPathname, "w+") for i in range(rowCount):...
unknown
codeparrot/codeparrot-clean
# GUI frame for the hpsMorph_function.py from Tkinter import * import tkFileDialog, tkMessageBox import sys, os from scipy.io.wavfile import read import numpy as np import hpsMorph_function as hM sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../models/')) import utilFunctions as UF class ...
unknown
codeparrot/codeparrot-clean
# Copyright 2014 Hewlett-Packard Development Company, L.P. # # 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 applicabl...
unknown
codeparrot/codeparrot-clean
# # (c) 2016 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 option) any later version. # # Ansible is d...
unknown
codeparrot/codeparrot-clean
# Figures 8.3 and 8.4, pages 412 and 416. # Ellipsoidal approximations. from math import log, pi from cvxopt import blas, lapack, solvers, matrix, sqrt, mul, cos, sin #solvers.options['show_progress'] = False try: import pylab except ImportError: pylab_installed = False else: pylab_installed = True # Extreme points (...
unknown
codeparrot/codeparrot-clean
import EventHandler from '../../../src/dom/event-handler.js' import SelectorEngine from '../../../src/dom/selector-engine.js' import FocusTrap from '../../../src/util/focustrap.js' import { clearFixture, createEvent, getFixture } from '../../helpers/fixture.js' describe('FocusTrap', () => { let fixtureEl beforeAl...
javascript
github
https://github.com/twbs/bootstrap
js/tests/unit/util/focustrap.spec.js
''' v.0.0.1 QGIS-AIMS-Plugin - CreateNewTool_Test Copyright 2011 Crown copyright (c) Land Information New Zealand and the New Zealand Government. All rights reserved This program is released under the terms of the new BSD license. See the LICENSE file for more information. Tests on CreateNewTool class Created on 0...
unknown
codeparrot/codeparrot-clean
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
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
#!/usr/bin/env python try: import pacman except ImportError: import alpm pacman = alpm import os, tempfile, shutil, sys, re remove = False if len(sys.argv) > 1: if sys.argv[1] == "--help": print "no longer necessary %s fpms" % sys.argv[2] sys.exit(0) elif sys.argv[1] == "--remove": remove = True arch = s...
unknown
codeparrot/codeparrot-clean
/* * pg_upgrade.c * * main source file * * Copyright (c) 2010-2026, PostgreSQL Global Development Group * src/bin/pg_upgrade/pg_upgrade.c */ /* * To simplify the upgrade process, we force certain system values to be * identical between old and new clusters: * * We control all assignments of pg_class.oid (an...
c
github
https://github.com/postgres/postgres
src/bin/pg_upgrade/pg_upgrade.c
# -*- 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
#!/bin/sh test_description='rebase behavior when on-disk files are broken' . ./test-lib.sh test_expect_success 'set up conflicting branches' ' test_commit base file && git checkout -b branch1 && test_commit one file && git checkout -b branch2 HEAD^ && test_commit two file ' create_conflict () { test_when_fini...
unknown
github
https://github.com/git/git
t/t3438-rebase-broken-files.sh
## Input ```javascript function Foo({items}) { const results = []; try { for (let i = 0; i < items.length; i++) { results.push(items[i]); } } catch (e) { return <span>Error</span>; } return <span>{results.join(', ')}</span>; } export const FIXTURE_ENTRYPOINT = { fn: Foo, params: [{item...
unknown
github
https://github.com/facebook/react
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-for-loop-in-try.expect.md
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/florence2/modular_florence2.py. # Do NOT edit this file manually as any edits will be overwritten by the generati...
python
github
https://github.com/huggingface/transformers
src/transformers/models/florence2/modeling_florence2.py
__author__ = "Andre Merzky, Ole Weidner" __copyright__ = "Copyright 2012-2013, The SAGA Project" __license__ = "MIT" import saga.exceptions as se from saga.url import Url import radical.utils as ru def test_wrong_type(): """ Test that the right execption is thrown if Url is not initialized properl...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ prestans3.tools.cli ~~~~~~~~~~~~~~~~~~~ Command line interface definitions using click. :copyright: (c) 2017 by Anomaly Software. :license: Apache 2.0, see LICENSE for more details. """ from __future__ import absolute_import from __future__ import division from __futur...
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
/* Copyright 2014 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/client/kubelet_client.go
# # Copyright 2010 Free Software Foundation, Inc. # # This file was generated by gr_modtool, a tool from the GNU Radio framework # This file is a part of gr-howto # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Softw...
unknown
codeparrot/codeparrot-clean
"""This test case provides support for checking forking and wait behavior. To test different wait behavior, override the wait_impl method. We want fork1() semantics -- only the forking thread survives in the child after a fork(). On some systems (e.g. Solaris without posix threads) we find that all active threads su...
python
github
https://github.com/python/cpython
Lib/test/fork_wait.py
# Copyright (c) 2008 Twisted Matrix Laboratories. # See LICENSE for details. import sys try: from twisted.python import dist except ImportError: raise SystemExit("twisted.python.dist module not found. Make sure you " "have installed the Twisted core package before " ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # encoding: utf-8 # Matthias Jahn jahn dôt matthias ât freenet dôt de 2007 (pmarat) import os, sys, imp, types, ccroot import optparse import Utils, Configure, Options from Logs import debug cxx_compiler = { 'win32': ['msvc', 'g++'], 'cygwin': ['g++'], 'darwin': ['g++'], 'aix': ['xlc++', 'g+...
unknown
codeparrot/codeparrot-clean
# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
unknown
codeparrot/codeparrot-clean
import unittest from hcsvlab_robochef.utils.serialiser import * from hcsvlab_robochef.utils.statistics import * def unittests(): return unittest.makeSuite(UnitTest) class UnitTest(unittest.TestCase): configmanager.configinit() corpus_basedir = configmanager.get_config("CORPUS_BASEDIR", "../input/") f...
unknown
codeparrot/codeparrot-clean
use rustc_data_structures::profiling::SelfProfilerRef; use rustc_query_system::ich::StableHashingContext; use rustc_session::Session; use crate::ty::print::with_reduced_queries; use crate::ty::{self, TyCtxt}; #[macro_use] mod dep_node; mod dep_node_key; pub use rustc_query_system::dep_graph::debug::{DepNodeFilter, E...
rust
github
https://github.com/rust-lang/rust
compiler/rustc_middle/src/dep_graph/mod.rs
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor class MorningstarIE(InfoExtractor): IE_DESC = 'morningstar.com' _VALID_URL = r'https?://(?:(?:www|news)\.)morningstar\.com/[cC]over/video[cC]enter\.aspx\?id=(?P<id>[0-9]+)' _TESTS = [{ 'url': 'http...
unknown
codeparrot/codeparrot-clean
package kotlinx.coroutines.debug import kotlinx.coroutines.testing.* import kotlinx.coroutines.* import kotlinx.coroutines.channels.* import org.junit.* import reactor.blockhound.* @Suppress("UnusedEquals", "DeferredResultUnused", "BlockingMethodInNonBlockingContext") class BlockHoundTest : TestBase() { @Before ...
kotlin
github
https://github.com/Kotlin/kotlinx.coroutines
kotlinx-coroutines-debug/test/BlockHoundTest.kt
//! Bare MIPS32r2, little endian, softfloat, O32 calling convention //! //! Can be used for MIPS M4K core (e.g. on PIC32MX devices) use crate::spec::{ Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions, }; pub(crate) fn target() -> Target { Target { llvm_targ...
rust
github
https://github.com/rust-lang/rust
compiler/rustc_target/src/spec/targets/mipsel_unknown_none.rs