code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
#
# $Id$
#
__all__ = \
[
"basic_block",
"defines",
"function",
"instruction",
"module",
]
from basic_block import *
from defines import *
from function import *
from instruction import *
from module import *
# we don't want to make wx an required module for PIDA.
try: import wx
exc... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import frappe
import json
import frappe.defaults
from frappe.utils import nowdate, nowtime, cstr, flt
from erpnext.stock.stock_ledger im... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package database
import (
"context"
"fmt"
"reflect"
"testing"
"time"
v4 "github.com/hashicorp/vault/sdk/database/dbplugin"
v5 "github.com/hashicorp/vault/sdk/database/dbplugin/v5"
"github.com/hashicorp/vault/sdk/logical"
"github.com/stre... | go | github | https://github.com/hashicorp/vault | builtin/logical/database/version_wrapper_test.go |
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsLayoutNorthArrowHandler.
.. note:: 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 ver... | unknown | codeparrot/codeparrot-clean | ||
#
# Copyright (C) 2010-2013 Stanislav Bohm
# 2011 Ondrej Garncarz
#
# This file is part of Kaira.
#
# Kaira 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 of t... | unknown | codeparrot/codeparrot-clean | ||
import re
import time
import string
import omdb
import socket
import click
import webbrowser
import requests
import requests.packages.urllib3
__VERSION__ = '2.0.1'
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
requests.packages.urllib3.disable_warnings()
# Users on python 2.7.6 repeatedly show insecure w... | unknown | codeparrot/codeparrot-clean | ||
import {exec, getTags} from "./repo.js";
import fs from "fs";
import {colorize} from "./helpers/colorize.js";
const {version} = JSON.parse(fs.readFileSync('./package.json'));
const [major] = version.split('.');
const tags = await getTags();
const latestTag = (tags[0] || '').replace(/^v/, '');
const isBeta = !/^v?(\d... | javascript | github | https://github.com/axios/axios | bin/resolveNPMTag.js |
# 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 | ||
#!/usr/bin/env python
import os, fnmatch,csv,re
pjoin = os.path.join
matches = {}
csvfile_name = 'data_test_record_0417.csv'
def file_proc(filepath):
match_line=[]
with open(filepath,'r') as datafile:
for line in datafile:
line = line.rstrip()
if re.search('Total DFT energy',line):
match_line = line.lst... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from datetime import *
import pytest
import os
import sys
from v8 import *
from v8.utils import *
if is_py3k:
def toUnicodeString(s):
return s
else:
def toUnicodeString(s, encoding='utf-8'):
return s if isinstance(s, unicode) else unicode(s, encoding)
def testObject():
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
from __future__ import absolute_import, division, print_function, with_statement
import gc
import locale # system locale module, not tornado.locale
import logging
import operator
import textwrap
import sys
from tornado.httpclient import AsyncHTTPClient
from tornado.httpserver import HTTPServer
f... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
import theano
import theano.tensor as T
from theano.tensor.shared_randomstreams import RandomStreams
from theano import pp
from collections import OrderedDict
def custom_momentum(loss_or_grads, params, learning_rate=0.01, momentum=0.9, tau=0.0):
if not isinstance(loss_or_grads, list):
... | unknown | codeparrot/codeparrot-clean | ||
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'AnnotatedBug'
db.create_table('bugsets_annotatedbug', (
('id', self.gf('django.db.mode... | unknown | codeparrot/codeparrot-clean | ||
class FSMError(Exception):
"""An exception class for StateMachine.
"""
def __init__(self, msg):
self.msg = msg
class StateMachine(object):
""" A class to represent a Finite State Machine.
"""
def __init__(self):
self.handlers = {}
self.arrival_handlers = {}
self.... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright 2016 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | go | github | https://github.com/tensorflow/tensorflow | tensorflow/go/operation_test.go |
"""Utility functions for copying and archiving files and directory trees.
XXX The functions here don't copy the resource fork or other metadata on Mac.
"""
import os
import sys
import stat
from os.path import abspath
import fnmatch
import collections
import errno
import tarfile
try:
import bz2
del bz2
_... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import
import datetime
from django.contrib.auth.models import User
from django.test import TestCase
from django.utils.datastructures import SortedDict
from .models import TestObject, Order, RevisionableModel
class ExtraRegressTests(TestCase):
def setUp(self):
self.u = Us... | unknown | codeparrot/codeparrot-clean | ||
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | unknown | codeparrot/codeparrot-clean | ||
export interface HousingLocationInfo {
id: number;
name: string;
city: string;
state: string;
photo: string;
availableUnits: number;
wifi: boolean;
laundry: boolean;
} | typescript | github | https://github.com/angular/angular | adev/src/content/tutorials/first-app/steps/05-inputs/src/app/housinglocation.ts |
import {CdkDrag, CdkDragHandle} from '@angular/cdk/drag-drop';
import {Component} from '@angular/core';
/**
* @title Drag&Drop with a handle
*/
@Component({
selector: 'cdk-drag-drop-handle-example',
templateUrl: 'app.html',
styleUrl: 'app.css',
imports: [CdkDrag, CdkDragHandle],
})
export class CdkDragDropHa... | typescript | github | https://github.com/angular/angular | adev/src/content/examples/drag-drop/src/custom-handle/app/app.ts |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
**Project Name:** MakeHuman
**Product Home Page:** http://www.makehuman.org/
**Code Home Page:** http://code.google.com/p/makehuman/
**Authors:** Thomas Larsson
**Copyright(c):** MakeHuman Team 2001-2014
**Licensing:** AGPL3 (see also ht... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2012 NTT DOCOMO, 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 requ... | unknown | codeparrot/codeparrot-clean | ||
"use strict";
/** @type {import("webpack").Configuration} */
const config = {
// mode: "development" || "production",
optimization: {
concatenateModules: false
}
};
module.exports = config; | javascript | github | https://github.com/webpack/webpack | examples/harmony-unused/webpack.config.js |
#!/usr/bin/env python3
"""
Utility functions for the Endor Labs API via endorctl
"""
import json
import logging
import subprocess
import time
from datetime import datetime
from enum import Enum
logger = logging.getLogger("generate_sbom")
logger.setLevel(logging.NOTSET)
default_field_masks = {
"PackageVersion": ... | python | github | https://github.com/mongodb/mongo | buildscripts/sbom/endorctl_utils.py |
#ifdef JEMALLOC_INTERNAL_TSD_TLS_H
#error This file should be included only once, by tsd.h.
#endif
#define JEMALLOC_INTERNAL_TSD_TLS_H
#define JEMALLOC_TSD_TYPE_ATTR(type) __thread type JEMALLOC_TLS_MODEL
extern JEMALLOC_TSD_TYPE_ATTR(tsd_t) tsd_tls;
extern pthread_key_t tsd_tsd;
extern bool tsd_booted;
/* Initializ... | c | github | https://github.com/redis/redis | deps/jemalloc/include/jemalloc/internal/tsd_tls.h |
#!/usr/bin/env python
# Copyright (c) 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.
"""Prepare Performance Test Bisect Tool
This script is used by a trybot to create a working directory and sync an
initial copy of ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from time import sleep
from django.core.urlresolvers import reverse
from django.core import mail
from registration.models import RegistrationProfile
from treemap.tests.ui import UITes... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, 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... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2021 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
package repstream
import (
"context"
"github.com/cockroachdb/cockroach/pkg/sql/catalog/descs"
"github.com/cockroachdb/cockroach/pkg/sql/catalog/resolver"
"github.c... | go | github | https://github.com/cockroachdb/cockroach | pkg/repstream/api.go |
"""Add TranslationSyncLogs
Revision ID: 21e927fdf78c
Revises: 44d704928d8c
Create Date: 2015-04-20 23:34:51.724151
"""
# revision identifiers, used by Alembic.
revision = '21e927fdf78c'
down_revision = '44d704928d8c'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by A... | 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
# d... | unknown | codeparrot/codeparrot-clean | ||
from difflib import unified_diff
import os
import sys
from conf import hook
from exc.test_failed import TestFailed
""" Post-Test Hook: ExpectedFiles
This is a Post-Test hook that checks the test directory for the files it
contains. A dictionary object is passed to it, which contains a mapping of
filenames and contents... | unknown | codeparrot/codeparrot-clean | ||
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS
#include <ATen/core/Tensor.h>
#include <ATen/MemoryOverlap.h>
#include <ATen/Context.h>
#include <c10/core/Storage.h>
#include <ATen/EmptyTensor.h>
#ifndef AT_PER_OPERATOR_HEADERS
#include <ATen/Functions.h>
#include <ATen/NativeFunctions.h>
#include <ATen/CPUFunctions.h>
#el... | cpp | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/Memory.cpp |
#
# iso2022_jp_2.py: Python Unicode Codec for ISO2022_JP_2
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_jp_2')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class Incrementa... | unknown | codeparrot/codeparrot-clean | ||
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# write an experiment that raises an exception
import sys
import os
BOREALISPATH = os.environ['BOREALISPATH']
sys.path.append(BOREALISPATH)
import experiments.superdarn_common_fields as scf
from experiment_prototype.experiment_prototype import ExperimentPrototype
class TestExperiment(ExperimentPr... | unknown | codeparrot/codeparrot-clean | ||
#
# tsne.py
#
# Implementation of t-SNE in Python. The implementation was tested on Python 2.7.10, and it requires a working
# installation of NumPy. The implementation comes with an example on the MNIST dataset. In order to plot the
# results of this example, a working installation of matplotlib is required.
#
# The ... | unknown | codeparrot/codeparrot-clean | ||
/**
* Copyright 2013, GitHub, Inc
* Copyright 2009-2013, Daniel Lemire, Cliff Moon,
* David McIntosh, Robert Becho, Google Inc. and Veronika Zenz
*
* 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 Fou... | c | github | https://github.com/git/git | ewah/ewah_io.c |
import json
import datetime
import urllib.parse
import mysql.connector
from eventall2016_credentials import *
def tweet_spliter():
f = open('twitter_stream.json', 'r+')
d = f.readlines()
--f.seek(0)
count = 0
for data in d:
if count >= 700000:
data = data.strip(',')
... | unknown | codeparrot/codeparrot-clean | ||
# This will create a dist directory containing the executable file, all the data
# directories. All Libraries will be bundled in executable file.
#
# Run the build process by entering 'pygame2exe.py' or
# 'python pygame2exe.py' in a console prompt.
#
# To build exe, python, pygame, and py2exe have to be installed. Afte... | unknown | codeparrot/codeparrot-clean | ||
"""An implementation of qubits and gates acting on them.
Todo:
* Update docstrings.
* Update tests.
* Implement apply using decompose.
* Implement represent using decompose or something smarter. For this to
work we first have to implement represent for SWAP.
* Decide if we want upper index to be inclusive in the co... | 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.
import logging
import os
import traceback
from chroot_file_system import ChrootFileSystem
from content_provider import ContentProvider
import environment
fr... | unknown | codeparrot/codeparrot-clean | ||
import json
import pymongo.errors
import pymongo.collection
import logging
import time
from pymongo import MongoClient, CursorType
logger = logging.getLogger(__name__)
logger.addHandler(logging.StreamHandler())
logger.setLevel(logging.DEBUG)
mongo_config_dict = {'mongodb_ip':'localhost',
'mongodb... | unknown | codeparrot/codeparrot-clean | ||
{
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "eslint ."
},
"dependencies": {
"@elastic/elasticsearch": "^8.6.0",
"next": "latest",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/node":... | json | github | https://github.com/vercel/next.js | examples/with-elasticsearch/package.json |
/*
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.analysis.api.standalone.fir.test.cases.generated.cases.components.typeInfoProvide... | java | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-standalone/tests-gen/org/jetbrains/kotlin/analysis/api/standalone/fir/test/cases/generated/cases/components/typeInfoProvider/FirStandaloneNormalAnalysisSourceModuleIsDenotableTestGenerated.java |
################################################################################
#
# Python script to test tetra-tetra contact detection for different possible
# contact modes. Some tests are run twice to test the symmetry of the law.
#
# It runs several tests, making pause before each one. If run with GUI, you can
# a... | unknown | codeparrot/codeparrot-clean | ||
{
"html": {
"type": "Fragment",
"start": 0,
"end": 292,
"children": [
{
"type": "Element",
"name": "svelte:element",
"start": 0,
"end": 44,
"tag": "div",
"attributes": [],
"children": []
},
{
"type": "Text",
"start": 44,
"end": 45,
"raw": "\n",
"data": "... | json | github | https://github.com/sveltejs/svelte | packages/svelte/tests/parser-legacy/samples/dynamic-element-string/output.json |
# frozen_string_literal: true
require "abstract_unit"
class IntegrationController < ActionController::Base
def yaml_params
render plain: params.to_yaml
end
def permit_params
params.permit(
key1: {}
)
render plain: "Home"
end
end
class ActionControllerParametersIntegrationTest < Action... | ruby | github | https://github.com/rails/rails | actionpack/test/controller/parameters_integration_test.rb |
from mailu import models
from mailu.ui import ui, forms, access
import flask
import flask_login
@ui.route('/manager/list/<domain_name>', methods=['GET'])
@access.domain_admin(models.Domain, 'domain_name')
def manager_list(domain_name):
domain = models.Domain.query.get(domain_name) or flask.abort(404)
return f... | unknown | codeparrot/codeparrot-clean | ||
package xfer
import (
"context"
"errors"
"time"
"github.com/containerd/log"
"github.com/docker/distribution"
"github.com/moby/moby/v2/daemon/internal/layer"
"github.com/moby/moby/v2/daemon/internal/progress"
)
const maxUploadAttempts = 5
// LayerUploadManager provides task management and progress reporting f... | go | github | https://github.com/moby/moby | daemon/internal/distribution/xfer/upload.go |
# 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 | ||
import unittest
from unittest import mock
from tests.recipes.recipe_lib_test import BaseTestForMakeRecipe
class TestLibvorbisRecipe(BaseTestForMakeRecipe, unittest.TestCase):
"""
An unittest for recipe :mod:`~pythonforandroid.recipes.libvorbis`
"""
recipe_name = "libvorbis"
sh_command_calls = ["./c... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2010-2026 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.analysis.api.fir.symbols
import com.intellij.psi.PsiElement
import org.jetbrains... | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/symbols/KaFirDefaultSetterValueParameter.kt |
# -*- coding: utf-8 -*-
# Copyright (C) 2012-2014 Bastian Kleineidam
# Copyright (C) 2016 Tobias Gruetzmacher
"""
Functions to load plugin modules.
Example usage:
modules = loader.get_modules('plugins')
plugins = loader.get_plugins(modules, PluginClass)
"""
from __future__ import absolute_import, division, p... | unknown | codeparrot/codeparrot-clean | ||
"""
Creates permissions for all installed apps that need permissions.
"""
from __future__ import unicode_literals
import getpass
import unicodedata
from django.contrib.auth import (models as auth_app, get_permission_codename,
get_user_model)
from django.core import exceptions
from django.core.management.base impo... | unknown | codeparrot/codeparrot-clean | ||
//===--- MarshallingTests.cpp ------------------------------------*- C++-*-===//
//
// 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/clangd/unittests/remote/MarshallingTests.cpp |
test_kind: js_test
selector:
roots:
- buildscripts/tests/resmoke_end2end/testfiles/validatecollections/test_pass.js
executor:
hooks:
- class: ValidateCollectionsTesting
fixture:
class: MongoDFixtureTesting | unknown | github | https://github.com/mongodb/mongo | buildscripts/tests/resmoke_end2end/suites/resmoke_test_module_worked.yml |
'''
Using onePK and the VTY Service obtain the output from the 'show version'
command. Use 'terminal length 0' to disable output paging (i.e. disable
'--More--' prompting).
'''
from onepk_helper import NetworkDevice
from onep.vty import VtyService
def main():
'''
Using onePK and the VTY Service obtain the ou... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright 2020 The HuggingFace Team All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | python | github | https://github.com/huggingface/transformers | examples/pytorch/language-modeling/run_plm.py |
import json
import logging
LOG = logging.getLogger(__name__)
VOLUME_TYPE_1 = {
"id": "241",
"name": "san",
"extra_specs": {
"capabilities:volume_backend_name": "sjc01",
"drivers:display_name": "default",
"drivers:san_backed_disk": True,
"drivers:exact_capacity": False
... | unknown | codeparrot/codeparrot-clean | ||
# Next.js server-side benchmarks
## Installation
Follow the steps in [contributing.md](../../contributing.md)
Both benchmarks use `ab`. So make sure you have that installed.
## Usage
Before running the test:
```
npm run start
```
Then run one of these tests:
- Stateless application which renders `<h1>My compone... | unknown | github | https://github.com/vercel/next.js | bench/rendering/readme.md |
#*****************************************************************************
# Copyright 2004-2008 Steve Menard
#
# 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.... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: cp1252 -*-
##
# Module/script example of the xlrd API for extracting information
# about named references, named constants, etc.
#
# <p>Copyright © 2006 Stephen John Machin, Lingfo Pty Ltd</p>
# <p>This module is part of the xlrd package, which is released under a BSD-style licence.</p>
##
from __future_... | unknown | codeparrot/codeparrot-clean | ||
import codecs
from fractions import Fraction
import unittest
from .chemcalc import (
compare_chemical_expression,
divide_chemical_expression,
render_to_html,
chemical_equations_equal,
)
import miller
local_debug = None
def log(s, output_type=None):
if local_debug:
print s
if outp... | unknown | codeparrot/codeparrot-clean | ||
from yowsup.layers import YowProtocolLayer
from yowsup.common import YowConstants
from .protocolentities import *
class YowIqProtocolLayer(YowProtocolLayer):
def __init__(self):
handleMap = {
"iq": (self.recvIq, self.sendIq)
}
super(YowIqProtocolLayer, self).__init__(handleMap)
... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Queue;
use DateTimeInterface;
use Illuminate\Contracts\Queue\Job as JobContract;
use Illuminate\Queue\Jobs\FakeJob;
use Illuminate\Support\InteractsWithTime;
use InvalidArgumentException;
use PHPUnit\Framework\Assert as PHPUnit;
use RuntimeException;
use Throwable;
trait InteractsWithQueue... | php | github | https://github.com/laravel/framework | src/Illuminate/Queue/InteractsWithQueue.php |
"""
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the 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.... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package cache
import (
"context"
"errors"
"fmt"
"slices"
"strings"
"time"
"github.com/gammazero/workerpool"
"github.com/hashicorp/go-hclog"
"github.com/hashicorp/vault/api"
"github.com/hashicorp/vault/command/agentproxyshared/cache/cach... | go | github | https://github.com/hashicorp/vault | command/agentproxyshared/cache/static_secret_capability_manager.go |
import pygame
Black = (0, 0, 0)
White = (255, 255, 255)
Blue = (0, 0, 255)
Red = (255, 0, 0)
Green = (0,255,0,)
Yellow = (255,255,0)
Gold = (255,215,0)
SCREEN_WIDTH = 820
SCREEN_HEIGHT = 510
P1Health = 5
P2Health = 5
P3Health = 5
P4Health = 5
bg = pygame.image.load("eurimast.jpg")
bg = pygame.transform.scale(bg, (S... | unknown | codeparrot/codeparrot-clean | ||
## Input
```javascript
import {makeArray} from 'shared-runtime';
/**
* This fixture tests what happens when a reactive has no declarations (other than an early return),
* no reassignments, and no dependencies. In this case the only thing we can use to decide if we
* should take the if or else branch is the early r... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/early-return-no-declarations-reassignments-dependencies.expect.md |
from logging import getLogger
from django.http import Http404
from api.api_views import APIView
# noinspection PyProtectedMember
from api.fields import get_boolean_value
from api.exceptions import PermissionDenied
from api.task.response import FailureTaskResponse, mgmt_task_response
from api.mon import MonitoringServ... | 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.server.plugins.di.annotations
/**
* Used for populating parameters with configuration property values when using classpath
* references with the dependency injection plugin.... | kotlin | github | https://github.com/ktorio/ktor | ktor-server/ktor-server-plugins/ktor-server-di/common/src/io/ktor/server/plugins/di/annotations/Property.kt |
# Test sensors.py ability to read from two sensor boards.
import pytest
import responses
from panoptes.pocs.sensor import remote
from panoptes.pocs.sensor import power
from panoptes.utils import error
@pytest.fixture
def remote_response():
return {
"data": {
"source": "sleeping",
... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/python
import sys
import os
import argparse
import shutil
DESCRIPTION = "\n" \
"Update pyqt4-visual-graph with the most recent version of the library\n"
EPILOG = "\n" \
"Examples:\n" + \
"\n" + \
"update_visual_graph.py\n" + \
"\tupdates the xilinx build with the files in ~/Projects/visual_graph\n" + \
"... | unknown | codeparrot/codeparrot-clean | ||
import { useRouter } from "next/router";
import ErrorPage from "next/error";
import Head from "next/head";
import {
getPathsFromContext,
getResourceCollectionFromContext,
getResourceFromContext,
} from "next-drupal";
import Container from "../components/container";
import PostBody from "../components/post-body";... | javascript | github | https://github.com/vercel/next.js | examples/cms-drupal/pages/[...slug].js |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Project: Create a Proxy Class
#
# In this assignment, create a proxy class (one is started for you
# below). You should be able to initialize the proxy object with any
# object. Any attributes called on the proxy object should be forwarded
# to the target object. As e... | unknown | codeparrot/codeparrot-clean | ||
# This file is part of the MapProxy project.
# Copyright (C) 2012 Omniscale <http://omniscale.de>
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
#
# Copyright 2009 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 b... | unknown | codeparrot/codeparrot-clean | ||
cloud: AzurePublic
oauth:
client_id: 00000000-0000-0000-0000-000000000000
client_secret: Cl1ent$ecret!
tenant_id: 00000000-a12b-3cd4-e56f-000000000000
scope: "https://custom-app.com/.default" | unknown | github | https://github.com/prometheus/prometheus | storage/remote/azuread/testdata/azuread_good_oauth_customscope.yaml |
# Copyright (c) 2010-2017 openpyxl
class IndexedList(list):
"""
List with optimised access by value
Based on Alex Martelli's recipe
http://code.activestate.com/recipes/52303-the-auxiliary-dictionary-idiom-for-sequences-with-/
"""
def __init__(self, iterable=None):
self.clean = True
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import flt, nowdate
import frappe.defaults
from frappe.model.document import Document
class Bin(Document):
def before_... | unknown | codeparrot/codeparrot-clean | ||
git_for_each_ref=${git_for_each_ref:-git for-each-ref}
GNUPGHOME_NOT_USED=$GNUPGHOME
. "$TEST_DIRECTORY"/lib-gpg.sh
. "$TEST_DIRECTORY"/lib-terminal.sh
# Mon Jul 3 23:18:43 2006 +0000
datestamp=1151968723
setdate_and_increment () {
GIT_COMMITTER_DATE="$datestamp +0200"
datestamp=$(expr "$datestamp" + 1)
GI... | unknown | github | https://github.com/git/git | t/for-each-ref-tests.sh |
#!/usr/bin/env python
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
A clone of 'free' cmdline utility.
$ python examples/free.py
total used free shared buffers ... | unknown | codeparrot/codeparrot-clean | ||
class Solution:
# @param start, a string
# @param end, a string
# @param dict, a set of string
# @return an integer
def ladderLength(self, start, end, dict):
queue = []
queue.append(start)
prev = {}
prev[start] = None
# Remove words that are same as start
... | unknown | codeparrot/codeparrot-clean | ||
from nltk.stem import WordNetLemmatizer
from nltk.stem.porter import PorterStemmer
from nltk.tokenize import sent_tokenize, TreebankWordTokenizer
import itertools
import string
class Term(object):
def __init__(self, full_word):
self.full_word = full_word
#TODO: lematization requires downloads
... | unknown | codeparrot/codeparrot-clean | ||
"""Tests for the login and registration form rendering. """
import urllib
import unittest
import ddt
from mock import patch
from django.conf import settings
from django.core.urlresolvers import reverse
from util.testing import UrlResetMixin
from xmodule.modulestore.tests.factories import CourseFactory
from third_part... | unknown | codeparrot/codeparrot-clean | ||
import { test } from '../../test';
export default test({
error: {
code: 'rune_missing_parentheses',
message: 'Cannot use rune without parentheses'
}
}); | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/tests/compiler-errors/samples/runes-bindable-not-called/_config.js |
"""
Order matching objects.
"""
import json
class _Singleton(type):
_instances = {}
def __call__(cls, *args, **kwargs):
if cls not in cls._instances:
cls._instances[cls] = super(_Singleton, cls).__call__(*args, **kwargs)
return cls._instances[cls]
class Singleton(_Singleton('Single... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
## This file is part of Invenio.
## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 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... | 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 | ||
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.analysis.api.fir.annotations
import org.jetbrains.kotlin.analysis.api.annotation... | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/annotations/KaFirAnnotationListForDeclaration.kt |
#
# (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 | ||
# -*- test-case-name: twisted.test.test_factories,twisted.internet.test.test_protocol -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Standard implementations of Twisted protocol-related interfaces.
Start here if you are looking to write a new protocol implementation for
Twisted. The ... | unknown | codeparrot/codeparrot-clean | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
from typing import Union
from typing_extensions import Literal, TypeAlias, TypedDict
__all__ = ["RealtimeAudioFormatsParam", "AudioPCM", "AudioPCMU", "AudioPCMA"]
class AudioPCM(TypedDict, total=... | python | github | https://github.com/openai/openai-python | src/openai/types/realtime/realtime_audio_formats_param.py |
from __future__ import absolute_import, print_function
import click
import logging
import os
import six
from django.conf import settings
from sentry.utils import metrics, warnings
from sentry.utils.sdk import configure_sdk
from sentry.utils.warnings import DeprecatedSettingWarning
from sentry.utils.compat import map... | unknown | codeparrot/codeparrot-clean | ||
"""turtledemo/forest.py
Displays a 'forest' of 3 breadth-first trees,
similar to the one in tree.py.
For further details, see tree.py.
This example is a breadth-first rewrite of
a Logo program by Erich Neuwirth.
"""
from turtle import Turtle, colormode, tracer, mainloop
from random import randrange
from time import p... | python | github | https://github.com/python/cpython | Lib/turtledemo/forest.py |
#!/usr/bin/python
from Tkinter import *
from phue import Bridge
'''
This example creates 3 sliders for the first 3 lights
and shows the name of the light under each slider.
There is also a checkbox to toggle the light.
'''
b = Bridge() # Enter bridge IP here.
#If running for the first time, press button on bridge an... | unknown | codeparrot/codeparrot-clean | ||
use rustc_ast::{BinOpKind, BorrowKind, Expr, ExprKind, MetaItem, Mutability, Safety};
use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::{Span, sym};
use thin_vec::thin_vec;
use crate::deriving::generic::ty::*;
use crate::deriving::generic::*;
use crate::deriving::{path_local, path_std};
/// Expands a `#... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_builtin_macros/src/deriving/cmp/partial_eq.rs |
from __future__ import annotations
import re
from collections.abc import Mapping
from enum import Enum
from typing import Any
from langchain_core.callbacks import Callbacks
from langchain_core.language_models import BaseLanguageModel
from langchain_core.output_parsers import BaseOutputParser
from langchain_core.promp... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/evaluation/criteria/eval_chain.py |
# Code Heatmaps
BOLT has gained the ability to print code heatmaps based on
sampling-based profiles generated by `perf`, either with `brstack` data or not.
The output is produced in colored ASCII to be displayed in a color-capable
terminal. It looks something like this:

Heatmaps can be generated f... | unknown | github | https://github.com/llvm/llvm-project | bolt/docs/Heatmaps.md |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.