code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
#!/usr/bin/env python """ Sentry ====== Sentry is a realtime event logging and aggregation platform. It specializes in monitoring errors and extracting all the information needed to do a proper post-mortem without any of the hassle of the standard user feedback loop. Sentry is a Server ------------------ The Sentry ...
unknown
codeparrot/codeparrot-clean
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # -*- encoding: utf-8 -*- ############################################################################# # # Copyright (c) 2007 Martin Reisenhofer <martin.reisenhofer@funkring.net> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU G...
unknown
codeparrot/codeparrot-clean
/* ------------------------------------------------------------------------- * * contrib/sepgsql/schema.c * * Routines corresponding to schema objects * * Copyright (c) 2010-2026, PostgreSQL Global Development Group * * ------------------------------------------------------------------------- */ #include "post...
c
github
https://github.com/postgres/postgres
contrib/sepgsql/schema.c
"""Test Home Assistant location util methods.""" from unittest.mock import Mock, patch import aiohttp import pytest import homeassistant.util.location as location_util from tests.common import load_fixture # Paris COORDINATES_PARIS = (48.864716, 2.349014) # New York COORDINATES_NEW_YORK = (40.730610, -73.935242) #...
unknown
codeparrot/codeparrot-clean
""" Middleware for Language Preferences """ from django.conf import settings from django.utils.translation import LANGUAGE_SESSION_KEY from django.utils.translation.trans_real import parse_accept_lang_header from openedx.core.djangoapps.lang_pref import COOKIE_DURATION, LANGUAGE_HEADER, LANGUAGE_KEY from openedx.core...
unknown
codeparrot/codeparrot-clean
from pybench import Test # First imports: import os import package.submodule class SecondImport(Test): version = 2.0 operations = 5 * 5 rounds = 40000 def test(self): for i in xrange(self.rounds): import os import os import os import os ...
unknown
codeparrot/codeparrot-clean
// Copyright 2018 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
tools/etcd-dump-metrics/install_windows.go
#!/usr/bin/python # -*- coding: utf-8 -*- # Distributed under the terms of GPL version 2 or any later # Copyright (C) Alexey Nezhdanov 2004 # In-band-registration for xmppd.py # $Id: jep0077.py,v 1.2 2004/09/19 20:20:05 snakeru Exp $ from xmpp import * class IBR(PlugIn): NS = NS_REGISTER def plugin(self, se...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python ''' Run this script every time you change one of the png files. Using pngcrush, it will optimize the png files, remove various color profiles, remove ancillary chunks (alla) and text chunks (text). #pngcrush -brute -ow -rem gAMA -rem cHRM -rem iCCP -rem sRGB -rem alla -rem text ''' import os impor...
unknown
codeparrot/codeparrot-clean
############################################################################## # # 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 Affero General Public L...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python import rospy from geometry_msgs.msg import Twist, Pose2D from nav_msgs.msg import Odometry from capra_motor_calibrator.srv import * # use in straight hallway with a lot of detail def calibrate_service(req): # TODO: Change robot width from hardcoded value once URDF is in place rospy.logw...
unknown
codeparrot/codeparrot-clean
//! Signal handler for rustc //! Primarily used to extract a backtrace from stack overflow use std::alloc::{Layout, alloc}; use std::{fmt, mem, ptr, slice}; use rustc_interface::util::{DEFAULT_STACK_SIZE, STACK_SIZE}; /// Signals that represent that we have a bug, and our prompt termination has /// been ordered. #[r...
rust
github
https://github.com/rust-lang/rust
compiler/rustc_driver_impl/src/signal_handler.rs
/* * 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-testlib/src/com/google/common/collect/testing/google/MultimapReplaceValuesTester.java
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
unknown
codeparrot/codeparrot-clean
""" Collection of utilities to manipulate structured arrays. Most of these functions were initially implemented by John Hunter for matplotlib. They have been rewritten and extended for convenience. """ from __future__ import division, absolute_import, print_function import sys import itertools import numpy as np im...
unknown
codeparrot/codeparrot-clean
import { Metadata } from "next"; import { notFound } from "next/navigation"; import { getAllPosts, getPostBySlug } from "@/lib/api"; import { CMS_NAME } from "@/lib/constants"; import markdownToHtml from "@/lib/markdownToHtml"; import Alert from "@/app/_components/alert"; import Container from "@/app/_components/contai...
typescript
github
https://github.com/vercel/next.js
examples/blog-starter/src/app/posts/[slug]/page.tsx
#ifdef _MSC_VER #include <Intrin.h> #endif #include <arm_neon.h> int main(int argc, char **argv) { float16_t *src = (float16_t*)argv[argc-1]; float16x8_t vhp = vdupq_n_f16(src[0]); float16x4_t vlhp = vdup_n_f16(src[1]); int ret = (int)vgetq_lane_f16(vabdq_f16(vhp, vhp), 0); ret += (int...
c
github
https://github.com/numpy/numpy
numpy/_core/src/_simd/checks/cpu_asimdhp.c
# This file is NOT licensed under the GPLv3, which is the license for the rest # of YouCompleteMe. # # Here's the license text for this file: # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either...
unknown
codeparrot/codeparrot-clean
from functools import partial from slm_lab import ROOT_DIR from slm_lab.lib import logger, util import os import pydash as ps import torch import torch.nn as nn NN_LOWCASE_LOOKUP = {nn_name.lower(): nn_name for nn_name in nn.__dict__} logger = logger.get_logger(__name__) class NoOpLRScheduler: '''Symbolic LRSched...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2012 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later...
unknown
codeparrot/codeparrot-clean
# This file is part of Buildbot. Buildbot 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 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env bash # # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. set -e mkdir -p build/local CMAKE_ARGS=() # CMake-level configuration CMAKE_ARGS+=("-DCM...
unknown
github
https://github.com/pytorch/pytorch
aten/src/ATen/native/quantized/cpu/qnnpack/scripts/build-local.sh
// run //go:build !nacl && !js && gc && !wasip1 // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Test the compiler -linkobj flag. package main import ( "fmt" "io/ioutil" "log" "os" "os/exec" "stri...
go
github
https://github.com/golang/go
test/linkobj.go
"Test posix functions" from test import support # Skip these tests if there is no posix module. posix = support.import_module('posix') import errno import sys import time import os import fcntl import platform import pwd import shutil import stat import tempfile import unittest import warnings import _testcapi _DUM...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # create a rendering window renWin = vtk.vtkRenderWindow() renWin.SetMultiSamples(0) renWin.SetSize(200,200) wavelet = vtk.vtkRTAnalyticSource() wavelet.SetWholeExtent(-100,100,-100,1...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ End-to-end tests related to the cohort management on the LMS Instructor Dashboard """ from datetime import datetime from pytz import UTC, utc from bok_choy.promise import EmptyPromise from nose.plugins.attrib import attr from common.test.acceptance.tests.discussion.helpers import CohortTes...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector para netload # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import urlparse,urllib2,urllib,re import os from core impor...
unknown
codeparrot/codeparrot-clean
## Blender Export Script ## Copyright (C) 2012 Ingo Ruhnke <grumbel@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 version 3 of the License, or ## (at your option)...
unknown
codeparrot/codeparrot-clean
'''Test functions and SearchEngine class in idlelib.searchengine.py.''' # With mock replacements, the module does not use any gui widgets. # The use of tk.Text is avoided (for now, until mock Text is improved) # by patching instances with an index function returning what is needed. # This works because mock Text.get d...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # # Copyright 2007 Google 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 o...
unknown
codeparrot/codeparrot-clean
# -*-*- encoding: utf-8 -*-*- # # This is gdata.photos.media, implementing parts of the MediaRSS spec in gdata structures # # $Id: __init__.py 81 2007-10-03 14:41:42Z havard.gulldahl $ # # Copyright 2007 Håvard Gulldahl # Portions copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "Licen...
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...
typescript
github
https://github.com/apache/airflow
airflow-core/src/airflow/ui/src/queries/useDeleteVariable.ts
""" (GPL) GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. ...
unknown
codeparrot/codeparrot-clean
""" Create the numpy.core.umath namespace for backward compatibility. In v1.16 the multiarray and umath c-extension modules were merged into a single _multiarray_umath extension module. So we replicate the old namespace by importing from the extension module. """ from . import _multiarray_umath from ._multiarray_umat...
unknown
codeparrot/codeparrot-clean
#include "test/jemalloc_test.h" #include "test/bench.h" static void mallctl_short(void) { const char *version; size_t sz = sizeof(version); int err = mallctl("version", &version, &sz, NULL, 0); assert_d_eq(err, 0, "mallctl failure"); } size_t mib_short[1]; static void mallctlbymib_short(void) { size_t miblen = ...
c
github
https://github.com/redis/redis
deps/jemalloc/test/stress/mallctl.c
/* * Copyright 2002-present the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required b...
java
github
https://github.com/spring-projects/spring-framework
spring-context/src/test/java/example/scannable/CustomComponent.java
// Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 package stackconfig import ( "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/hashicorp/terraform/internal/tfdiags" ) // LocalValue is a declaration of a private local value within a particular // stack configur...
go
github
https://github.com/hashicorp/terraform
internal/stacks/stackconfig/local_value.go
<?php namespace Illuminate\Auth\Passwords; use Illuminate\Contracts\Auth\PasswordBrokerFactory as FactoryContract; use InvalidArgumentException; /** * @mixin \Illuminate\Contracts\Auth\PasswordBroker */ class PasswordBrokerManager implements FactoryContract { /** * The application instance. * * ...
php
github
https://github.com/laravel/framework
src/Illuminate/Auth/Passwords/PasswordBrokerManager.php
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 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 # #...
unknown
codeparrot/codeparrot-clean
from django.conf import settings from django.core.cache import caches from memoize import Memoizer from bedrock.utils.git import GitRepo def get_data_version(): """Add the git ref from the repo to the cache keys. This will ensure that the cache is invalidated when the repo is updated. """ repo = Git...
unknown
codeparrot/codeparrot-clean
try: from itertools import izip except ImportError: izip = zip from ..libmp.backend import xrange from .calculus import defun try: next = next except NameError: next = lambda _: _.next() @defun def richardson(ctx, seq): r""" Given a list ``seq`` of the first `N` elements of a slowly convergen...
unknown
codeparrot/codeparrot-clean
# =========================================================================== # eXe # Copyright 2004-2006, University of Auckland # Copyright 2004-2008 eXe Project, http://eXeLearning.org/ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as ...
unknown
codeparrot/codeparrot-clean
u""" Base classes for features that are backwards-incompatible. Usage: features = Features() features.add(Feature("py3k_feature", "power< 'py3k' any* >", "2.7")) PATTERN = features.PATTERN """ pattern_unformatted = u"%s=%s" # name=pattern, for dict lookups message_unformatted = u""" %s is only supported in Python %s ...
unknown
codeparrot/codeparrot-clean
{{ object_list }}
html
github
https://github.com/django/django
tests/templates/views/article_list.html
""" This library contains a set of facilities for constructing and applying :class:`~revscoring.Model` s to MediaWiki revisions. This library eases the training and testing of Machine Learning-based scoring strategies. * See the :ref:`API reference <api-reference>` for detailed information. Key Features ------------ ...
unknown
codeparrot/codeparrot-clean
""" Testing clustering algorithms in Clusterpy ** All the following tests take considerable time to complete ** """ from unittest import TestCase, skip from nose.plugins.attrib import attr import clusterpy from numpy.random import seed as make_static_random from clusterpy.core.toolboxes.cluster.componentsAlg import Ar...
unknown
codeparrot/codeparrot-clean
import logging from django.test import TestCase from raw.models import RawMember, Override logging.disable(logging.CRITICAL) class OverrideTestCase(TestCase): def setUp(self): self.obj = RawMember.objects.create() def test_create_from(self): override = Override.objects.create_from(self.obj) ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Mark Theunissen <mark.theunissen@gmail.com> # Sponsored by Four Kitchens http://fourkitchens.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 publishe...
unknown
codeparrot/codeparrot-clean
from rit_lib import * from slList import * class Rooms(struct): """ The HashTable data structure contains a collection of values where each value is located by a hashable key. No two values may have the same key, but more than one key may have the same value. table is the lis...
unknown
codeparrot/codeparrot-clean
# frozen_string_literal: true require_relative "vendored_thor" module Bundler module FriendlyErrors module_function def enable! @disabled = false end def disabled? @disabled end def disable! @disabled = true end def log_error(error) case error when Y...
ruby
github
https://github.com/ruby/ruby
lib/bundler/friendly_errors.rb
import numpy as np import zmq import json import matplotlib as mpl from matplotlib.figure import Figure from mpl_toolkits.mplot3d import Axes3D from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg as NavigationToolbar #...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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 ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python import subprocess, shlex import sys, os.path import logging as logger import argparse import time parser = argparse.ArgumentParser( description='Use git archive and file times from the current repo to' 'checkout a subset of a git repo with file dates taken from the' ...
unknown
codeparrot/codeparrot-clean
The documentation has been moved to the [https://kotlinlang.org/docs/composing-suspending-functions.html](https://kotlinlang.org/docs/composing-suspending-functions.html) page. To edit the documentation, open the [topics/composing-suspending-functions.md](topics/composing-suspending-functions.md) page.
unknown
github
https://github.com/Kotlin/kotlinx.coroutines
docs/composing-suspending-functions.md
# # This file is part of pysnmp software. # # Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com> # License: http://pysnmp.sf.net/license.html # import socket import errno import sys from pysnmp.carrier.asyncore.base import AbstractSocketTransport from pysnmp.carrier import sockfix, sockmsg, error from pysnmp imp...
unknown
codeparrot/codeparrot-clean
""" All of the Enums that are used throughout the chardet package. :author: Dan Blanchard (dan.blanchard@gmail.com) """ class InputState(object): """ This enum represents the different states a universal detector can be in. """ PURE_ASCII = 0 ESC_ASCII = 1 HIGH_BYTE = 2 class LanguageFilter(o...
unknown
codeparrot/codeparrot-clean
# # -*- coding: utf-8 -*- # import logging # from unittest import TestCase # # from auxlib import logz # from auxlib.path import PackageFile, find_file_in_site_packages, open_package_file # # log = logging.getLogger(__name__) # # # class PackageFileTests(TestCase): # # @classmethod # def setUpClass(cls): # ...
unknown
codeparrot/codeparrot-clean
from __future__ import unicode_literals import base64 import binascii import hashlib import importlib from collections import OrderedDict from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.signals import setting_changed from django.dispatch import receiver from d...
unknown
codeparrot/codeparrot-clean
from sklearn.datasets import fetch_lfw_people from sklearn.cross_validation import train_test_split from sklearn.decomposition import RandomizedPCA from sklearn.grid_search import GridSearchCV from sklearn.svm import SVC from sklearn.metrics import confusion_matrix import pylab as pl # Downloading the data lfw_peopl...
unknown
codeparrot/codeparrot-clean
% This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it. **Description** Calculates the count over time value of a field.
unknown
github
https://github.com/elastic/elasticsearch
docs/reference/query-languages/esql/_snippets/functions/description/count_over_time.md
one: id: 1 value: 1000
unknown
github
https://github.com/rails/rails
activerecord/test/fixtures/warehouse-things.yml
[ { "pk": "1", "model": "fixtures.article", "fields": { "headline": "Breaking news", "pub_date": null } } ]
json
github
https://github.com/django/django
tests/fixtures/fixtures/invalid.json
- name: Test collection lookup bypass host list hosts: all connection: local gather_facts: false collections: - testns.testcoll tasks: - bypass_host_loop: register: bypass - run_once: true vars: bypass_hosts: '{{ hostvars|dictsort|map(attribute="1.bypass.bypass_inventory_hostn...
unknown
github
https://github.com/ansible/ansible
test/integration/targets/collections/test_bypass_host_loop.yml
from django.conf import settings from django.http import HttpResponseForbidden from django.template import Context, Engine, TemplateDoesNotExist, loader from django.utils.translation import ugettext as _ from django.utils.version import get_docs_version # We include the template inline since we need to be able to reli...
unknown
codeparrot/codeparrot-clean
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, float_or_none, srt_subtitles_timecode, ) class KanalPlayIE(InfoExtractor): IE_DESC = 'Kanal 5/9/11 Play' _VALID_URL = r'https?://(?:www\.)?kanal(?P<channel_id>...
unknown
codeparrot/codeparrot-clean
""" Support for Ecobee. For more details about this component, please refer to the documentation at https://home-assistant.io/components/ecobee/ """ import logging import os from datetime import timedelta from homeassistant.helpers import discovery from homeassistant.const import CONF_API_KEY from homeassistant.loade...
unknown
codeparrot/codeparrot-clean
import re import unicodedata from datetime import date, datetime, timedelta from loguru import logger from requests.exceptions import HTTPError, RequestException from flexget import plugin from flexget.entry import Entry from flexget.event import event from flexget.utils.requests import Session as RequestSession from...
unknown
codeparrot/codeparrot-clean
# Copyright 2017 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
# Author: Marvin Pinto <me@marvinp.ca> # Author: Dennis Lutter <lad1337@gmail.com> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 Soft...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # # Copyright 2011-2015 Splunk, 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...
unknown
codeparrot/codeparrot-clean
# django imports from django.contrib.auth.decorators import permission_required from django.core.urlresolvers import reverse from django.http import HttpResponse from django.http import HttpResponseRedirect from django.shortcuts import render_to_response from django.shortcuts import get_object_or_404 from django.templa...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
unknown
codeparrot/codeparrot-clean
import redis import click import boto3 import botocore import backoff from itertools import zip_longest max_tries = 5 class RedisWrapper(object): def __init__(self, *args, **kwargs): self.redis = redis.StrictRedis(*args, **kwargs) @backoff.on_exception(backoff.expo, (redis.e...
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/bugprone/AssignmentInIfConditionCheck.cpp
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Daniel Jaouen <dcj24@cornell.edu> # (c) 2016, Indrajit Raychaudhuri <irc+code@indrajit.com> # # 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_...
unknown
codeparrot/codeparrot-clean
""" Testing of docstring related issues and especially ``jedi.docstrings``. """ from textwrap import dedent import jedi from ..helpers import unittest try: import numpydoc except ImportError: numpydoc_unavailable = True else: numpydoc_unavailable = False class TestDocstring(unittest.TestCase): def te...
unknown
codeparrot/codeparrot-clean
# # Copyright (C) 2010-2019 Nexedi SA # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed...
unknown
codeparrot/codeparrot-clean
# -*- 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
#!/usr/bin/env python3 """Tests for the unregister command Ensure that a users controller can be unregistered. Test plan: - add user - run juju register command from previous step - verify controller shows up in juju list-controllers - 'juju unregister' the controller - verify the controller is no longer listed ...
unknown
codeparrot/codeparrot-clean
# This file is part of audioread. # Copyright 2013, Adrian Sampson. # # 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 use, co...
unknown
codeparrot/codeparrot-clean
from urllib.parse import urlparse from urllib.request import url2pathname from asgiref.sync import sync_to_async from django.conf import settings from django.contrib.staticfiles import utils from django.contrib.staticfiles.views import serve from django.core.handlers.asgi import ASGIHandler from django.core.handlers....
python
github
https://github.com/django/django
django/contrib/staticfiles/handlers.py
# Introduction Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you. ## Dependency management Composer is **not** a package manager in the same sense as Yum or Apt are. Yes, it deals with "packages" or lib...
unknown
github
https://github.com/composer/composer
doc/00-intro.md
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings import django_extensions.db.fields class Migration(migrations.Migration): dependencies = [ ('jury', '__first__'), migrations.swappable_dependency(settings.AUTH...
unknown
codeparrot/codeparrot-clean
# # Copyright 2005 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 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 Telemetry page_action that performs the "seek" action on media elements. Action parameters are: - seconds: The media time to seek to. Test fails if not...
unknown
codeparrot/codeparrot-clean
function fn() { fn = function () {}; return fn.apply(this, arguments); } export function getStaticProps() { fn; }
javascript
github
https://github.com/vercel/next.js
crates/next-custom-transforms/tests/fixture/strip-page-exports/getStaticProps/support-babel-style-memoized-function/output-data.js
/* * Copyright 2021 Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
c
github
https://github.com/opencv/opencv
3rdparty/flatbuffers/include/flatbuffers/table.h
# -*- coding: utf-8 -*- # # Copyright (C) 2003-2009 Edgewall Software # Copyright (C) 2003-2006 Jonas Borgström <jonas@edgewall.com> # Copyright (C) 2006 Matthew Good <trac@matt-good.net> # Copyright (C) 2005-2006 Christian Boos <cboos@edgewall.org> # All rights reserved. # # This software is licensed as described in t...
unknown
codeparrot/codeparrot-clean
import { useSelector, useDispatch } from "react-redux"; const useCounter = () => { const count = useSelector((state) => state.count); const dispatch = useDispatch(); const increment = () => dispatch({ type: "INCREMENT", }); const decrement = () => dispatch({ type: "DECREMENT", }); ...
javascript
github
https://github.com/vercel/next.js
examples/with-apollo-and-redux/components/Counter.js
#!/usr/bin/env bash # Copyright 2025 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 a...
unknown
github
https://github.com/etcd-io/etcd
scripts/fix/yamllint.sh
/* * The copyright in this software is being made available under the 2-clauses * BSD License, included below. This software may be subject to other third * party and contributor rights, including patent rights, and no such rights * are granted under this license. * * Copyright (c) 2002-2014, Universite catholiqu...
c
github
https://github.com/opencv/opencv
3rdparty/openjpeg/openjp2/tgt.c
# -*- coding: utf-8 -*- # Copyright 2012 gandalf authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. import os from fabric.api import abort, cd, env, local, put, run current_dir = os.path.abspath(os.path.dirname(__file__)) env.user = 'gi...
unknown
codeparrot/codeparrot-clean
import { x } from "./dep?b"; export default function abc() { return x; }
javascript
github
https://github.com/webpack/webpack
test/cases/inner-graph/export-default-named/b.js
#===== # # Copyright 2010 Dr D Studios Pty Limited (ACN 127 184 954) (Dr. D Studios), # its affiliates and/or its licensors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source cod...
unknown
codeparrot/codeparrot-clean
# Copyright 2017, OpenCensus 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 w...
unknown
codeparrot/codeparrot-clean
import web import sys import importlib import unittest, doctest from operator import itemgetter #sorting urls programID = "Endpoint Simulator v1.0" urls = ('/(.*)', 'base') def prependPackageToClassnames(urls, packageName): """Take web.py formatted url/endpoint tuples and prepend a packageName to each of the endpoi...
unknown
codeparrot/codeparrot-clean
import sys import base64 from xen.lowlevel import flask from xen.util import xsconstants from xen.xend import sxp #Functions exported through XML-RPC xmlrpc_exports = [ 'on', 'set_policy', 'getenforce', 'setenforce' ] def err(msg): """Raise XSM-Flask exception. """ sys.stderr.write("XSM-FlaskError...
unknown
codeparrot/codeparrot-clean
# Copyright 2012 Grid Dynamics # Copyright 2013 Inktank Storage, Inc. # Copyright 2014 Mirantis, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.or...
unknown
codeparrot/codeparrot-clean
# (c) Copyright 2014 Hewlett-Packard Development Company, L.P. # 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/LI...
unknown
codeparrot/codeparrot-clean