code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
from functools import partial import wx from gooey.gui.util import wx_util from gooey.gui.widgets import widget_pack class BaseGuiComponent(object): widget_class = None def __init__(self, parent, title, msg, choices=None): ''' :param data: field info (title, help, etc..) :param widget_pack: interna...
unknown
codeparrot/codeparrot-clean
from pexpect import TIMEOUT import pytest import time from tests.functional.utils import spawn, functional, bare dockerfile = u''' FROM ubuntu:latest RUN apt-get update RUN apt-get install -yy python3 python3-pip python3-dev git RUN pip3 install -U setuptools RUN ln -s /usr/bin/pip3 /usr/bin/pip RUN adduser --disabled...
unknown
codeparrot/codeparrot-clean
""" The :mod:`sklearn._loss` module includes loss function classes suitable for fitting classification and regression tasks. """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from sklearn._loss.loss import ( AbsoluteError, HalfBinomialLoss, HalfBinomialLossArrayAPI, Ha...
python
github
https://github.com/scikit-learn/scikit-learn
sklearn/_loss/__init__.py
/* * Copyright (c) 2018 Mockito contributors * This program is made available under the terms of the MIT License. */ package org.mockito.junit.jupiter.resolver; import org.junit.jupiter.api.extension.ExtensionContext; import org.junit.jupiter.api.extension.ParameterContext; import org.junit.jupiter.api.extension.Pa...
java
github
https://github.com/mockito/mockito
mockito-extensions/mockito-junit-jupiter/src/main/java/org/mockito/junit/jupiter/resolver/CompositeParameterResolver.java
# Natural Language Toolkit: Maximum Entropy Classifiers # # Copyright (C) 2001-2012 NLTK Project # Author: Edward Loper <edloper@gradient.cis.upenn.edu> # Dmitry Chichkov <dchichkov@gmail.com> (TypedMaxentFeatureEncoding) # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT """ A classifier...
unknown
codeparrot/codeparrot-clean
import urllib import sys, os sys.path.append(os.path.join(os.path.dirname(__file__), "../common/")) import sleep def main(request, response): index = request.request_path.index("?") args = request.request_path[index+1:].split("&") headers = [] statusSent = False headersSent = False for arg in a...
unknown
codeparrot/codeparrot-clean
from Screens.InfoBar import InfoBar from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Components.ActionMap import ActionMap from Components.ConfigList import ConfigListScreen from Components.Label import Label from Components.Sources.StaticText import StaticText from Components.config imp...
unknown
codeparrot/codeparrot-clean
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import division, unicode_literals """ This module implements functions to perform various useful operations on entries, such as grouping entries by structure. """ from six.moves import filter,...
unknown
codeparrot/codeparrot-clean
"""LangChain **Runnable** and the **LangChain Expression Language (LCEL)**. The LangChain Expression Language (LCEL) offers a declarative method to build production-grade programs that harness the power of LLMs. Programs created using LCEL and LangChain Runnables inherently support synchronous, asynchronous, batch, a...
python
github
https://github.com/langchain-ai/langchain
libs/langchain/langchain_classic/runnables/__init__.py
#!/usr/bin/env python # Simple tests for the ldb python bindings. # Copyright (C) 2007 Jelmer Vernooij <jelmer@samba.org> import os from unittest import TestCase import ldb def filename(): import tempfile try: dir_prefix = os.path.join(os.environ["SELFTEST_PREFIX"], "tmp") except KeyError: ...
unknown
codeparrot/codeparrot-clean
# Author: Wei Xue <xuewei4d@gmail.com> # Thierry Guillemot <thierry.guillemot.work@gmail.com> # License: BSD 3 clause import numpy as np from scipy.special import gammaln from sklearn.utils.testing import assert_raise_message from sklearn.utils.testing import assert_almost_equal from sklearn.mixture.bayesian...
unknown
codeparrot/codeparrot-clean
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
unknown
codeparrot/codeparrot-clean
from django.http import HttpResponseRedirect, HttpResponse from django.shortcuts import get_object_or_404, render #from django.http import Http404 #from django.template import RequestContext, loader from django.core.urlresolvers import reverse from django.views import generic # generic views documentation https://docs....
unknown
codeparrot/codeparrot-clean
from social.backends.oauth import BaseOAuth2 # This provides a backend for python-social-auth. This should not be confused # with officially battle.net offerings. This piece of code is not officially # affiliated with Blizzard Entertainment, copyrights to their respective # owners. See http://us.battle.net/en/forum/to...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Helpful routines for regression testing.""" import os import sys from binascii import hexlify, unhexl...
unknown
codeparrot/codeparrot-clean
import os import infra.basetest BASIC_TOOLCHAIN_CONFIG_HEADERS_AT_LEAST_3_14 = \ """ BR2_arm=y BR2_TOOLCHAIN_EXTERNAL=y BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-full-2019.05.1.tar.bz2...
unknown
codeparrot/codeparrot-clean
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details """Tests for the reportlab.platypus.paragraphs module. """ __version__=''' $Id: test_platypus_paragraphs.py 3959 2012-09-27 14:39:39Z robin $ ''' from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfile, printLocation s...
unknown
codeparrot/codeparrot-clean
""" Log-related functions and structures. """ from builtins import map import sys import logging from colorama import AnsiToWin32 from functools import partial from contextlib import contextmanager from .colorizer import Colorizer from .mark.objects import Mark from .stream import stream_has_color_support class Col...
unknown
codeparrot/codeparrot-clean
############################################################################### ## ## Copyright 2011,2012 Tavendo GmbH ## ## 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:...
unknown
codeparrot/codeparrot-clean
import sys import requests import json import urllib2 import time if len(sys.argv) < 5: print "Usage: feed.py rpcuser rpcpass port \"['delegate','list']\"" sys.exit(0) user = sys.argv[1] password = sys.argv[2] port = int(sys.argv[3]) delegates = [] if len(sys.argv[4]) < 3: for i in range(60): dele...
unknown
codeparrot/codeparrot-clean
import os import gettext as gettext_module from django import http from django.conf import settings from django.utils import importlib from django.utils.translation import check_for_language, activate, to_locale, get_language from django.utils.text import javascript_quote from django.utils.encoding import smart_text f...
unknown
codeparrot/codeparrot-clean
"""Support for MQTT switches.""" import logging import voluptuous as vol from homeassistant.components import mqtt, switch from homeassistant.components.switch import SwitchDevice from homeassistant.const import ( CONF_DEVICE, CONF_ICON, CONF_NAME, CONF_OPTIMISTIC, CONF_PAYLOAD_OFF, CONF_PAYLOAD_ON, CONF_VALU...
unknown
codeparrot/codeparrot-clean
/* 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/Engine.hpp
import pytest from mitmproxy.addons import onboarding from mitmproxy.test import taddons @pytest.fixture def client(): with onboarding.app.test_client() as client: yield client class TestApp: def addons(self): return [onboarding.Onboarding()] @pytest.mark.asyncio async def test_basic...
unknown
codeparrot/codeparrot-clean
from __future__ import annotations from typing import TYPE_CHECKING, Any, Literal, TypeAlias import numpy as np Device: TypeAlias = Literal["cpu"] if TYPE_CHECKING: # NumPy 1.x on Python 3.10 fails to parse np.dtype[] DType: TypeAlias = np.dtype[ np.bool_ | np.integer[Any] | np.floa...
python
github
https://github.com/scikit-learn/scikit-learn
sklearn/externals/array_api_compat/numpy/_typing.py
#!/bin/bash # Configure FwC test branches # We do not want 7.x branch and only to run for branches that: # - have released at least one minor version (not main) # - have previous minor unreleased (not the oldest development branch) FWC_BRANCHES=() for branch in "${BRANCHES[@]}"; do if [[ ! "$branch" =~ ^7\..* ]]; th...
unknown
github
https://github.com/elastic/elasticsearch
.buildkite/scripts/fwc-branches.sh
"""A collection of string constants. Public module variables: whitespace -- a string containing all ASCII whitespace ascii_lowercase -- a string containing all ASCII lowercase letters ascii_uppercase -- a string containing all ASCII uppercase letters ascii_letters -- a string containing all ASCII letters digits -- a ...
python
github
https://github.com/python/cpython
Lib/string/__init__.py
try: import simplejson as json except ImportError: import json import dateutil.parser from collections import namedtuple from .utils import unicode_class, resource_for_link, unresolvable from .resource import FieldsResource, Link, Resource """ contentful.content_type_field_types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
unknown
codeparrot/codeparrot-clean
# frozen_string_literal: true module Arel # :nodoc: all module FilterPredications def filter(expr) Nodes::Filter.new(self, expr) end end end
ruby
github
https://github.com/rails/rails
activerecord/lib/arel/filter_predications.rb
/* Copyright 2022 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/utils/graph_partition.h
""" REQUIREMENTS: - install pip with distribute (http://packages.python.org/distribute/) - sudo pip install Fabric """ from fabric.api import local def lang(mode="extract"): """ REQUIREMENTS: - Install before pip with distribute_setup.py (Read the environment setup document) ...
unknown
codeparrot/codeparrot-clean
/* * Copyright (C) 2012 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/io/ByteSinkTest.java
"""Chain pipeline where the outputs of one step feed directly into next.""" from typing import Any from langchain_core.callbacks import ( AsyncCallbackManagerForChainRun, CallbackManagerForChainRun, ) from langchain_core.utils.input import get_color_mapping from pydantic import ConfigDict, model_validator fro...
python
github
https://github.com/langchain-ai/langchain
libs/langchain/langchain_classic/chains/sequential.py
// Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 package command import ( "bytes" "fmt" "io/ioutil" "os" "path/filepath" "reflect" "strings" "testing" "github.com/davecgh/go-spew/spew" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/hashicorp/cli" "...
go
github
https://github.com/hashicorp/terraform
internal/command/refresh_test.go
"""Tests for asyncio/threads.py""" import asyncio import unittest from contextvars import ContextVar from unittest import mock def tearDownModule(): asyncio.events._set_event_loop_policy(None) class ToThreadTests(unittest.IsolatedAsyncioTestCase): async def test_to_thread(self): result = await async...
python
github
https://github.com/python/cpython
Lib/test/test_asyncio/test_threads.py
"""Lattice module. In this module the lattice of the corresponding accelerator is defined. """ import math as _math from pyaccel import lattice as _pyacc_lat, elements as _pyacc_ele, \ accelerator as _pyacc_acc, optics as _pyacc_opt from . import segmented_models as _segmented_models energy = 0.150e9 # [eV] def...
unknown
codeparrot/codeparrot-clean
# (c) 2012, Jeroen Hoekx <jeroen@hoekx.be> # # 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....
unknown
codeparrot/codeparrot-clean
function genLink(Ref) { // we treat the file paths different depending on if we're // serving via a http server or viewing from a local var Path = window.location.protocol.startsWith("file") ? `${window.location.protocol}//${RootPath}/${Ref.Path}` : `${window.location.protocol}//...
javascript
github
https://github.com/llvm/llvm-project
clang-tools-extra/clang-doc/assets/index.js
import os import glob import logging import pprint from virtualenvapi.manage import VirtualEnvironment import virtualenvapi.exceptions as ve from pyp2rpm.exceptions import VirtualenvFailException from pyp2rpm.settings import DEFAULT_PYTHON_VERSION, MODULE_SUFFIXES logger = logging.getLogger(__name__) def site_packa...
unknown
codeparrot/codeparrot-clean
//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===---------------------------...
cpp
github
https://github.com/llvm/llvm-project
clang-tools-extra/clang-tidy/llvm/PreferIsaOrDynCastInConditionalsCheck.cpp
"""Common credentials classes and constructors.""" from __future__ import print_function import datetime import json import os import urllib import urllib2 import httplib2 import oauth2client import oauth2client.client import oauth2client.gce import oauth2client.locked_file import oauth2client.multistore_file import ...
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
// SPDX-License-Identifier: GPL-2.0-or-later /* * tsacct.c - System accounting over taskstats interface * * Copyright (C) Jay Lan, <jlan@sgi.com> */ #include <linux/kernel.h> #include <linux/sched/signal.h> #include <linux/sched/mm.h> #include <linux/sched/cputime.h> #include <linux/tsacct_kern.h> #include <linux/...
c
github
https://github.com/torvalds/linux
kernel/tsacct.c
//===--- SourceLoc.h - ReST source location and source manager classes ----===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
c
github
https://github.com/apple/swift
include/swift/Markup/SourceLoc.h
from abc import ABCMeta, abstractmethod class Preprocess: __metaclass__ = ABCMeta def __init__(self, parent_preprocess=None): self._parent_preprocess = parent_preprocess def __call__(self, dset): return self.apply_preprocess(dset) def apply_preprocess(self, dset): try: ...
unknown
codeparrot/codeparrot-clean
from statistics import mode, StatisticsError VALUE = {k: v for k, v in zip("23456789TJQKA", range(13))} def poker(hands): values = list(map(hand_value, hands)) max_val = max(values) return [hand for hand, value in zip(hands, values) if value == max_val] def hand_value(hand): values = [VALUE[card[0]] ...
unknown
codeparrot/codeparrot-clean
/*------------------------------------------------------------------------- * * attmap.c * Attribute mapping support. * * This file provides utility routines to build and manage attribute * mappings by comparing input and output TupleDescs. Such mappings * are typically used by DDL operating on inheritance an...
c
github
https://github.com/postgres/postgres
src/backend/access/common/attmap.c
#!/usr/bin/env python """ Reads from and write to the config file, 'config.json'. """ import argparse from cjh.cli import Cli from cjh.config import Config __author__ = 'Chris Horn <hammerhorn@gmail.com>' def _parse_args(): """ Parse command-line arguments """ parser = argparse.ArgumentParser() p...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python """Python module for generating .ninja files. Note that this is emphatically not a required piece of Ninja; it's just a helpful utility for build-file-generation systems that already use Python. """ import textwrap import re def escape_spaces(word): return word.replace('$ ','$$ ').replace(' ',...
unknown
codeparrot/codeparrot-clean
# mode: run # ticket: 5 class CyTest(object): """ >>> cy = CyTest() >>> '_CyTest__private' in dir(cy) True >>> cy._CyTest__private() 8 >>> '__private' in dir(cy) False >>> '_CyTest__x' in dir(cy) True >>> '__x' in dir(cy) False """ __x = 1 def __private(self...
unknown
codeparrot/codeparrot-clean
# # Copyright 2015-2016 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2012 Rackspace Hosting # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
unknown
codeparrot/codeparrot-clean
# Copyright 2012 Nebula, Inc. # Copyright 2013 IBM Corp. # # 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...
unknown
codeparrot/codeparrot-clean
/* * Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ package io.ktor.client.webrtc import WebRTC.* import io.ktor.client.webrtc.media.* import kotlinx.cinterop.ExperimentalForeignApi import kotlinx.cinterop.ObjCSignatureOverride import kotlinx....
kotlin
github
https://github.com/ktorio/ktor
ktor-client/ktor-client-webrtc/ios/src/io/ktor/client/webrtc/PeerConnection.kt
// Copyright 2021 The Prometheus 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...
typescript
github
https://github.com/prometheus/prometheus
web/ui/module/codemirror-promql/src/complete/index.ts
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- import os from os.path import join as pjoin from setuptools import setu...
unknown
codeparrot/codeparrot-clean
--- title: Overview --- Svelte 5 introduced some significant changes to Svelte's API, including [runes](what-are-runes), [snippets](snippet) and event attributes. As a result, some Svelte 3/4 features are deprecated (though supported for now, unless otherwise specified) and will eventually be removed. We recommend tha...
unknown
github
https://github.com/sveltejs/svelte
documentation/docs/99-legacy/00-legacy-overview.md
# frozen_string_literal: true module ActiveRecord module Encryption # An encryptor that can encrypt data but can't decrypt it. class EncryptingOnlyEncryptor < Encryptor def decrypt(encrypted_text, key_provider: nil, cipher_options: {}) encrypted_text end end end end
ruby
github
https://github.com/rails/rails
activerecord/lib/active_record/encryption/encrypting_only_encryptor.rb
// Copyright 2015 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed t...
go
github
https://github.com/etcd-io/etcd
server/storage/mvcc/kvstore_test.go
#!/usr/bin/env python """ @package mi.dataset.parser.test.test_zplsc_c_dcl @file mi-dataset/mi/dataset/parser/test/test_zplsc_c_dcl.py @author Richard Han (Raytheon), Ronald Ronquillo (Raytheon) @brief Test code for a zplsc_c_dcl data parser """ import os from nose.plugins.attrib import attr from mi.core.log import...
unknown
codeparrot/codeparrot-clean
""" Support for Clementine Music Player as media player. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/media_player.clementine/ """ import asyncio from datetime import timedelta import logging import time import voluptuous as vol import homeassistant...
unknown
codeparrot/codeparrot-clean
# SPDX-License-Identifier: GPL-2.0-only %YAML 1.2 --- $id: http://devicetree.org/schemas/dma/snps,dma-spear1340.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# title: Synopsys Designware DMA Controller maintainers: - Viresh Kumar <vireshk@kernel.org> - Andy Shevchenko <andriy.shevchenko@linux.intel.c...
unknown
github
https://github.com/torvalds/linux
Documentation/devicetree/bindings/dma/snps,dma-spear1340.yaml
from matplotlib.lines import Line2D from matplotlib.ticker import AutoMinorLocator from numpy.core.multiarray import zeros from spatiotemporal.temporal_events.trapezium import TemporalEventTrapezium from spatiotemporal.time_intervals import TimeInterval from matplotlib import pyplot as plt from matplotlib import animat...
unknown
codeparrot/codeparrot-clean
--- c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. SPDX-License-Identifier: curl Long: metalink Help: Process given URLs as metalink XML file Added: 7.27.0 Category: deprecated Multi: single See-also: - parallel Example: - --metalink file $URL --- # `--metalink` This option was previously used to spec...
unknown
github
https://github.com/curl/curl
docs/cmdline-opts/metalink.md
<?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\HttpFoundation; /** * ServerBag is a container for H...
php
github
https://github.com/symfony/symfony
src/Symfony/Component/HttpFoundation/ServerBag.php
import numpy as np import pytest from pandas import ( MultiIndex, Series, date_range, ) import pandas._testing as tm def test_xs_datetimelike_wrapping(): # GH#31630 a case where we shouldn't wrap datetime64 in Timestamp arr = date_range("2016-01-01", periods=3)._data._ndarray ser = Series(arr...
python
github
https://github.com/pandas-dev/pandas
pandas/tests/series/indexing/test_xs.py
import os import sys from fmap import fmap from tempfile import mkstemp from subprocess import Popen, PIPE DIR = os.path.abspath(os.path.dirname(__file__)) TESTDIR = os.path.join(DIR, 'tree') #------------------------------------------------------------------------------- def test_fmap(): seen = [] def accum...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ jinja2.lexer ~~~~~~~~~~~~ This module implements a Jinja / Python combination lexer. The `Lexer` class provided by this module is used to do some preprocessing for Jinja. On the one hand it filters out invalid operators like the bitshift operators we don't allow...
unknown
codeparrot/codeparrot-clean
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
unknown
codeparrot/codeparrot-clean
/************************************************ constants.c - created at: Thu Mar 31 12:21:29 JST 1994 Copyright (C) 1993-2007 Yukihiro Matsumoto ************************************************/ #include "rubysocket.h" static VALUE rb_mSockConst; #include "constdefs.c" static int constant_arg(VALUE arg...
c
github
https://github.com/ruby/ruby
ext/socket/constants.c
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2019, Ansible by Red Hat, inc # 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', ...
unknown
codeparrot/codeparrot-clean
template = { "Description": "AWS CloudFormation Sample Template Gollum_Single_Instance_With_EBS_Volume: Gollum is a simple wiki system built on top of Git that powers GitHub Wikis. This template installs a Gollum Wiki stack on a single EC2 instance with an EBS volume for storage and demonstrates using the AWS Cloud...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- from sqlalchemy import ( Column, Index, Integer, Text, DateTime, String, Enum, ) from base import Base class SOrderLine(Base): __tablename__ = 'sorder_line' id = Column(Integer, primary_key=True) order_id = Column(String) product_id = Column(Stri...
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
#!/usr/bin/python # # (c) 2014, Pavel Antonov <antonov@adwz.ru> # # This file is part of Ansible # # This module 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
''' Created on 2015-01-19 @author: levi ''' import unittest import inspect from t_core.messages import Packet from t_core.iterator import Iterator from t_core.matcher import Matcher from t_core.rewriter import Rewriter from himesis_utils import graph_to_dot, print_graph from PyRamify import PyRamify from tests.Tes...
unknown
codeparrot/codeparrot-clean
<?php namespace Illuminate\Contracts\Validation; /** * @deprecated see ValidationRule */ interface ImplicitRule extends Rule { // }
php
github
https://github.com/laravel/framework
src/Illuminate/Contracts/Validation/ImplicitRule.php
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
unknown
codeparrot/codeparrot-clean
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2002-2006 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at you...
unknown
codeparrot/codeparrot-clean
## Input ```javascript import {useFragment} from 'shared-runtime'; function Component(props) { const post = useFragment( graphql` fragment F on T { id } `, props.post ); const allUrls = []; // `media` and `urls` are exported from the scope that will wrap this code, // but `co...
unknown
github
https://github.com/facebook/react
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructuring-mixed-scope-declarations-and-locals.expect.md
from __future__ import unicode_literals # Ensure 'assert_raises' context manager support for Python 2.6 import tests.backport_assert_raises from nose.tools import assert_raises import boto import boto3 from boto.exception import EC2ResponseError import sure # noqa from moto import mock_ec2_deprecated, mock_ec2 @moc...
unknown
codeparrot/codeparrot-clean
/* * cash.c * Written by D'Arcy J.M. Cain * darcy@druid.net * http://www.druid.net/darcy/ * * Functions to allow input and output of money normally but store * and handle it as 64 bit ints * * A slightly modified version of this file and a discussion of the * workings can be found in the book "Software Soluti...
c
github
https://github.com/postgres/postgres
src/backend/utils/adt/cash.c
#!/usr/bin/env python """create_min_chi2_table.py. Create Table of minimum Chi_2 values and save to a table. """ import argparse import os import sys import corner import matplotlib.pyplot as plt import pandas as pd import sqlalchemy as sa from joblib import Parallel, delayed from pandas.plotting import scatter_matri...
unknown
codeparrot/codeparrot-clean
__author__ = 'dcline' import os import sys os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../toNetCDF")) # lrauvNc4ToNetcdf.py is in sister toNetCDF dir sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../../")) # settings.py is t...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- import fcntl import json import os import psutil import stat import signal import sys import time import threading class Monitor: def __init__(self, app, filename): self.app = app self.pid = os.getpid() self.filename = filename self.thread = False sel...
unknown
codeparrot/codeparrot-clean
kind: Deployment apiVersion: apps/v1 metadata: name: calico-typha-vertical-autoscaler namespace: kube-system labels: k8s-app: calico-typha-autoscaler addonmanager.kubernetes.io/mode: Reconcile spec: replicas: 1 selector: matchLabels: k8s-app: calico-typha-autoscaler template: metadata:...
unknown
github
https://github.com/kubernetes/kubernetes
cluster/addons/calico-policy-controller/typha-vertical-autoscaler-deployment.yaml
# -*- coding: utf-8 -*- # # Copyright (C) 2012 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """Implementation of the Metadata for Python packages PEPs. Supports all metadata formats (1.0, 1.1, 1.2, and 2.0 experimental). """ from __future__ import unicode_literals import codecs from email...
unknown
codeparrot/codeparrot-clean
# frozen_string_literal: true module ActiveRecord module Encryption # A +KeyProvider+ serves keys: # # * An encryption key # * A list of potential decryption keys. Serving multiple decryption keys supports rotation-schemes # where new keys are added but old keys need to continue working cla...
ruby
github
https://github.com/rails/rails
activerecord/lib/active_record/encryption/key_provider.rb
# -*- encoding: utf-8 -*- import urllib2 import csv from util import * BGCOLOR_1 = '#ffffff' BGCOLOR_2 = '#eafcf2' def macro_ListEquipsInCategory(macro, _trailing_args=[]): request = macro.request formatter = macro.formatter parser = macro.parser requested_cat = _trailing_args[0] if len(_trailing_a...
unknown
codeparrot/codeparrot-clean
r""" If I repeat a paragraph using the following formula:: do text for pp in properties_list() and if `properties_list()` is a generator function, then appy.pod works only correctly if the generator function actually yields values. The following test works: >>> run_test(1,[ ... Property("Computer","good"), ... P...
unknown
codeparrot/codeparrot-clean
# -*- encoding: utf-8 -*- from __future__ import unicode_literals import re from unittest import skipUnless from django.core.management import call_command from django.db import connection from django.test import TestCase, skipUnlessDBFeature from django.utils.six import PY3, StringIO from .models import ColumnTypes...
unknown
codeparrot/codeparrot-clean
# Scan an Apple header file, generating a Python file of generator calls. import sys import os from bgenlocations import TOOLBOXDIR, BGENDIR sys.path.append(BGENDIR) from scantools import Scanner LONG = "LaunchServices" SHORT = "launch" OBJECT = "NOTUSED" def main(): input = LONG + ".h" output = SHORT + "gen...
unknown
codeparrot/codeparrot-clean
from win32inet import * from win32inetcon import * import winerror from pywin32_testutil import str2bytes # py3k-friendly helper import unittest class CookieTests(unittest.TestCase): def testCookies(self): data = "TestData=Test" InternetSetCookie("http://www.python.org", None, data) got = ...
unknown
codeparrot/codeparrot-clean
{ "GENPASS": { "summary": "Generates a pseudorandom, secure password that can be used to identify ACL users.", "complexity": "O(1)", "group": "server", "since": "6.0.0", "arity": -2, "container": "ACL", "function": "aclCommand", "command_flags": [ ...
json
github
https://github.com/redis/redis
src/commands/acl-genpass.json
# Copyright 2013 Dean Gardiner <gardiner91@gmail.com> # # 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
# -*- coding: utf-8 -*- import os from django.conf import settings from django.db import models from django.contrib.auth.models import User from kobo.shortcuts import random_string from kobo.types import Enum UPLOAD_STATES = Enum( "NEW", "STARTED", "FINISHED", "FAILED", ) class FileUpload(models.Mo...
unknown
codeparrot/codeparrot-clean
from django.db import models from django.contrib.auth.models import User class Test(models.Model): path = models.CharField(max_length=255, unique=True) rating = models.IntegerField(default=50) date = models.DateTimeField('date', null=True) title = models.CharField(max_length=255, null=True) te...
unknown
codeparrot/codeparrot-clean
# (c) 2014, Matt Martz <matt@sivel.net> # # 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. # ...
unknown
codeparrot/codeparrot-clean
"use strict"; /** @type {import("webpack").Configuration} */ const config = { output: { assetModuleFilename: "images/[hash][ext]" }, module: { rules: [ { test: /file\.(png|jpg|svg)$/, type: "asset" } ] } }; module.exports = config;
javascript
github
https://github.com/webpack/webpack
examples/asset/webpack.config.js
import unittest from p2pool.bitcoin import data, networks from p2pool.util import pack class Test(unittest.TestCase): def test_header_hash(self): assert data.hash256(data.block_header_type.pack(dict( version=1, previous_block=0x000000000000038a2a86b72387f93c51298298a732079b3b686df3...
unknown
codeparrot/codeparrot-clean