code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
import datetime
import os
import random
from typing import Tuple, Union, TypeVar, List, Callable
import libnacl.secret
from base58 import b58decode
from common.serializers.serialization import serialize_msg_for_signing
from plenum.common.types import f
from plenum.common.util import isHex, cryptonymToHex
from common.e... | unknown | codeparrot/codeparrot-clean | ||
# Class definition:
# NordugridATLASSiteInformation
# This class is the Nordugrid-ATLAS site information class inheriting from ATLASSiteInformation
# Instances are generated with SiteInformationFactory via pUtil::getSiteInformation()
# Implemented as a singleton class
# http://stackoverflow.com/questions/4255... | unknown | codeparrot/codeparrot-clean | ||
import pandas as pd
import numpy as np
import pickle
import os
import math
import glob
from include.dataset_fnames import generate_station_data_fname, generate_data_fname, generate_response_data_fname, train_categorical_onehot_filename
from random import shuffle
from datetime import datetime
def load_and_compress_da... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
from unittest import skipUnless
from django.contrib.gis.tests.utils import HAS_SPATIAL_DB
from django.core.management import call_command
from django.db import connection
from django.test import override_settings, override_system_checks, TransactionTestCase
class MigrateTests(... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
import decimal
import types
import unicodedata
import urllib
def DisplayFriendlySize(bytes):
"""DisplayFriendlySize -- turn a number of bytes into a nice string"""
t = type(bytes)
if t != types.LongType and t != types.IntType and t != decimal.Decimal:
return 'NotANumber(%s=%s)' %(t, bytes... | unknown | codeparrot/codeparrot-clean | ||
# The MIT License (MIT)
#
# Copyright (c) 2015 Leon Jacobs
#
# 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, copy, modif... | unknown | codeparrot/codeparrot-clean | ||
pr: 140684
summary: "MMR Command: Grammar and Logical Plan"
area: ES|QL
type: feature
issues: [] | unknown | github | https://github.com/elastic/elasticsearch | docs/changelog/140684.yaml |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | unknown | codeparrot/codeparrot-clean | ||
import re
import urllib
from HTMLParser import HTMLParser
class BlogAttachmentPageParser(HTMLParser):
"""HTMLParser used to extract the url of Bing images from a Blog Post Attachment Page from www.iorise.com
(e.g.: http://www.iorise.com/blog/?attachment_id=44)"""
def __init__(self, result_list):
... | unknown | codeparrot/codeparrot-clean | ||
package dockerfile
import (
"os"
"path/filepath"
"testing"
)
// createTestTempFile creates a temporary file within dir with specific contents and permissions.
// When an error occurs, it terminates the test
func createTestTempFile(t *testing.T, dir, filename, contents string, perm os.FileMode) string {
filePath :... | go | github | https://github.com/moby/moby | daemon/builder/dockerfile/utils_test.go |
'''
Created on 2016年2月10日
@author: Darren
'''
from SimpleDatabase import SimpleDatabase
import os
import unittest
from random import random
class Test(unittest.TestCase):
def setUp(self):
unittest.TestCase.setUp(self)
self.testClass=SimpleDatabase()
self.testClass.print_flag=False
de... | unknown | codeparrot/codeparrot-clean | ||
/* MIT License
*
* Copyright (c) 1998 Massachusetts Institute of Technology
* Copyright (c) 2007 Daniel Stenberg
*
* 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, ... | c | github | https://github.com/nodejs/node | deps/cares/src/lib/ares_sysconfig_win.c |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import ast
from pan... | unknown | codeparrot/codeparrot-clean | ||
import os
import random
import signal
import sys
from buildscripts.resmokelib.testing.hooks.bghook import BGHook
class PeriodicStackTrace(BGHook):
"""Test hook that sends the stacktracing signal to mongo processes at randomized intervals."""
DESCRIPTION = "Sends the stacktracing signal to mongo processes at ... | python | github | https://github.com/mongodb/mongo | buildscripts/resmokelib/testing/hooks/periodic_stack_trace.py |
"""
Configuration for the ``student`` Django application.
"""
from __future__ import absolute_import
import os
from django.apps import AppConfig
from django.contrib.auth.signals import user_logged_in
from django.db.models.signals import pre_save
class StudentConfig(AppConfig):
"""
Default configuration for t... | unknown | codeparrot/codeparrot-clean | ||
"""jsite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based... | unknown | codeparrot/codeparrot-clean | ||
---
title: Special elements
--- | unknown | github | https://github.com/sveltejs/svelte | documentation/docs/05-special-elements/index.md |
# stdlib
from socket import socket
import unittest
import xmlrpclib
# 3p
from mock import patch
# project
from checks import AgentCheck
from tests.checks.common import get_check
class TestSupervisordCheck(unittest.TestCase):
TEST_CASES = [{
'yaml': """
init_config:
instances:
- name: server1
... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 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 in w... | go | github | https://github.com/prometheus/prometheus | tsdb/fileutil/mmap.go |
no_wheels:
name: boeing-with-no-wheels
manufactured_at: 2024-01-01
no_manufactured_at:
name: boeing-with-no-manufactured-at
wheels_count: 2 | unknown | github | https://github.com/rails/rails | activerecord/test/fixtures/aircrafts.yml |
import PropTypes from "prop-types";
const ErrorMessage = ({ message }) => (
<aside>
{message}
<style jsx>{`
aside {
padding: 1.5em;
font-size: 14px;
color: white;
background-color: red;
}
`}</style>
</aside>
);
ErrorMessage.propTypes = {
message: PropTypes... | javascript | github | https://github.com/vercel/next.js | examples/with-apollo-and-redux/components/ErrorMessage.js |
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not us... | unknown | github | https://github.com/apache/airflow | dev/README_RELEASE_HELM_CHART.md |
# Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.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 ... | unknown | codeparrot/codeparrot-clean | ||
function Component(props) {
let x = {};
// onChange should be inferred as immutable, because the value
// it captures (`x`) is frozen by the time the function is referenced
const onChange = e => {
maybeMutate(x, e.target.value);
};
if (props.cond) {
<div>{x}</div>;
}
return <Foo value={x} onChan... | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/function-expression-captures-value-later-frozen-jsx.js |
import os
import sys
import magic
import re
import logging
import subprocess
from time import sleep
import RPi.GPIO as GPIO
from utils import findBin, whichUSBboard, getBoardConfigs
from target import Target
from pin import Pin
class NAsatbus(Target):
""" Return an instance of Target specific to the NanoAvionics S... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# (c) 2016, Marcin Skarbek <github@skarbek.name>
# (c) 2016, Andreas Olsson <andreas@arrakis.se>
# (c) 2017, Loic Blot <loic.blot@unix-experience.fr>
#
# This module was ported from https://github.com/mskarbek/ansible-nsupdate
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/l... | unknown | codeparrot/codeparrot-clean | ||
/*
* 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.configurators
import com.intellij.mock.MockProj... | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-standalone/testFixtures/org/jetbrains/kotlin/analysis/api/standalone/fir/test/configurators/StandaloneModeTestServiceRegistrar.kt |
"""Test the cross_validation module"""
from __future__ import division
import warnings
import numpy as np
from scipy.sparse import coo_matrix
from scipy.sparse import csr_matrix
from scipy import stats
from sklearn.exceptions import ConvergenceWarning
from sklearn.utils.testing import assert_true
from sklearn.utils.t... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
The Pygments reStructuredText directive
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This fragment is a Docutils_ 0.5 directive that renders source code
(to HTML only, currently) via Pygments.
To use it, adjust the options below and copy the code into a module
that you i... | unknown | codeparrot/codeparrot-clean | ||
/* 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/dtensor/mlir/expansions/slice_spmd_expander.h |
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-boot | build-plugin/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/SinglePublishedArtifact.java |
{
"html": {
"type": "Fragment",
"start": 0,
"end": 17,
"children": [
{
"type": "IfBlock",
"start": 0,
"end": 17,
"expression": {
"type": "Identifier",
"start": 5,
"end": 8,
"loc": {
"start": {
"line": 1,
"column": 5
},
"end": {
"line... | json | github | https://github.com/sveltejs/svelte | packages/svelte/tests/parser-legacy/samples/if-block/output.json |
# (c) 2005 Clark C. Evans
# This module is part of the Python Paste Project and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
# This code was written with funding by http://prometheusresearch.com
"""
WSGI Test Server
This builds upon paste.util.baseserver to customize it for r... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (c) 1999-2000 Image Power, Inc. and the University of
* British Columbia.
* Copyright (c) 2001-2002 Michael David Adams.
* All rights reserved.
*/
/* __START_OF_JASPER_LICENSE__
*
* JasPer License Version 2.0
*
* Copyright (c) 2001-2006 Michael David Adams
* Copyright (c) 1999-2000 Image Pow... | c | github | https://github.com/opencv/opencv | 3rdparty/libjasper/jasper/jas_getopt.h |
#!/usr/bin/env python
import mozprofile
import os
import shutil
import tempfile
import unittest
here = os.path.dirname(os.path.abspath(__file__))
class Bug758250(unittest.TestCase):
"""
use of --profile in mozrunner just blows away addon sources:
https://bugzilla.mozilla.org/show_bug.cgi?id=758250
""... | unknown | codeparrot/codeparrot-clean | ||
"""Provides the constants needed for component."""
# All activity disabled / Device is off/standby
HVAC_MODE_OFF = "off"
# Heating
HVAC_MODE_HEAT = "heat"
# Cooling
HVAC_MODE_COOL = "cool"
# The device supports heating/cooling to a range
HVAC_MODE_HEAT_COOL = "heat_cool"
# The temperature is set based on a schedul... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | unknown | codeparrot/codeparrot-clean | ||
# Test data file to be stored within a zip file.
FAVORITE_NUMBER = 5 | python | github | https://github.com/python/cpython | Lib/test/archivetestdata/testdata_module_inside_zip.py |
# Copyright 2013 UnitedStack 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... | unknown | codeparrot/codeparrot-clean | ||
#*
#* GRUB -- GRand Unified Bootloader
#* Copyright (C) 2010 Free Software Foundation, Inc.
#*
#* GRUB 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 | ||
# Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Tests for the raise statement."""
from test import support
import sys
import types
import unittest
def get_tb():
try:
raise OSError()
except OSError as e:
return e.__traceback__
class Conte... | python | github | https://github.com/python/cpython | Lib/test/test_raise.py |
#! /usr/bin/env python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions ... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
from PyQt4 import QtCore, QtGui
import h5py
from utils import *
class DataStream():
def __init__(self, path, dataPath):
"""Initializes a HDF5 DataStream. PATH is the path to the
.hdf5 file, and DATAPATH is the path within the file to the
specific dataset.
"""
... | unknown | codeparrot/codeparrot-clean | ||
DOCUMENTATION:
name: unique
author: Brian Coca (@bcoca)
version_added: "1.4"
short_description: set of unique items of a list
description:
- Creates a list of unique elements (a set) from the provided input list.
options:
_input:
description: A list.
type: list
required: true
c... | unknown | github | https://github.com/ansible/ansible | lib/ansible/plugins/filter/unique.yml |
import { report } from "../tick";
import "./d";
report("async2 before");
await 0;
report("async2 middle");
await 0;
report("async2 after"); | javascript | github | https://github.com/webpack/webpack | test/cases/async-modules/micro-ticks-parents/case-a/async2.js |
# coding=utf-8
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open p... | unknown | codeparrot/codeparrot-clean | ||
/*-------------------------------------------------------------------------
*
* bufmask.c
* Routines for buffer masking. Used to mask certain bits
* in a page which can be different when the WAL is generated
* and when the WAL is applied.
*
* Portions Copyright (c) 2016-2026, PostgreSQL Global Development ... | c | github | https://github.com/postgres/postgres | src/backend/access/common/bufmask.c |
# Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for callable().
This converts callable(obj) into isinstance(obj, collections.Callable), adding a
collections import if needed."""
# Local imports
from lib2to3 import fixer_base
from lib2to3.fixer_util import ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-04-11 13:00
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Create... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import os
import vtk
from vtk.test import Testing
class SimpleGlyph:
"""A simple class used to test vtkTensorGlyph."""
def __init__(self, reader):
self.reader = reader
sg = self.src_glyph = vtk.vtkSphereSource()
sg.SetRadius(0.5)
sg.SetCenter(0.5, 0.0, 0.... | unknown | codeparrot/codeparrot-clean | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import Optional
from typing_extensions import Literal
from ..._models import BaseModel
__all__ = ["ConversationCreatedEvent", "Conversation"]
class Conversation(BaseModel):
"""The conversation resource."""
id:... | python | github | https://github.com/openai/openai-python | src/openai/types/realtime/conversation_created_event.py |
benchmark:
- (1..1_000_000).last(100)
- (1..1_000_000).last(1000)
- (1..1_000_000).last(10000) | unknown | github | https://github.com/ruby/ruby | benchmark/range_last.yml |
/*
* Copyright (C) 2005 Junio C Hamano
*/
#include "git-compat-util.h"
#include "gettext.h"
#include "diff.h"
#include "diffcore.h"
#include "wildmatch.h"
static char **order;
static int order_cnt;
static void prepare_order(const char *orderfile)
{
int cnt, pass;
struct strbuf sb = STRBUF_INIT;
const char *cp, ... | c | github | https://github.com/git/git | diffcore-order.c |
import os
import sys
import cocotb
import logging
from cocotb.result import TestFailure
from cocotb.clock import Clock
import time
from array import array as Array
from cocotb.triggers import Timer, FallingEdge
from cocotb.drivers.amba import AXI4LiteMaster
from cocotb.drivers.amba import AXI4StreamMaster
from cocotb.... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright 2015 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.
"""Unpacks pre-built sanitizer-instrumented third-party libraries."""
import os
import subprocess
import shutil
import sys
import dow... | unknown | codeparrot/codeparrot-clean | ||
import threading
import time
from unittest import mock
from multiple_database.routers import TestRouter
from django.core.exceptions import FieldError
from django.db import (
DatabaseError,
NotSupportedError,
connection,
connections,
router,
transaction,
)
from django.db.models import F, Value
... | python | github | https://github.com/django/django | tests/select_for_update/tests.py |
<button ngMenuTrigger #origin #trigger="ngMenuTrigger" [menu]="formatMenu()">Open Menu</button>
<ng-template
[cdkConnectedOverlayOpen]="trigger.expanded()"
[cdkConnectedOverlay]="{origin, usePopover: 'inline'}"
[cdkConnectedOverlayPositions]="[
{originX: 'start', originY: 'bottom', overlayX: 'start', overlay... | html | github | https://github.com/angular/angular | adev/src/content/examples/aria/menu/src/menu-trigger/app/app.html |
# Copyright (c) 2015, MapR Technologies
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
import unittest, time, sys, random, math, getpass
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_import as h2i, h2o_util, h2o_print as h2p
import h2o_summ
print "Like test_summary_uniform, but with integers only"
print "focuses on numbers from 2B to 3B, which seem to have been dropped by another tes... | unknown | codeparrot/codeparrot-clean | ||
import logging
import requests
import json
class PassiveTotal(object):
base_url = "https://api.passivetotal.org"
headers = { 'Content-Type': 'application/json' }
api_versions = {"v2": "/v2",
"current": "/current"}
GET_resources = {"metadata": "/metadata",
"p... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2002-2005 Stephen Kennedy <stevek@gnome.org>
# Copyright (C) 2005 Aaron Bentley <aaron.bentley@utoronto.ca>
# Copyright (C) 2007 José Fonseca <j_r_fonseca@yahoo.co.uk>
# Copyright (C) 2010-2015 Kai Willadsen <kai.willadsen@gmail.com>
# Redistribution and use in source and binary forms, with or without
... | unknown | codeparrot/codeparrot-clean | ||
# https://github.com/dinoboff/github-tools/blob/master/src/github/tools/sphinx.py
#
# Copyright (c) 2009, Damien Lebrun
# 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... | unknown | codeparrot/codeparrot-clean | ||
# -*- test-case-name: twisted.test.test_internet -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Select reactor
"""
from __future__ import division, absolute_import
from time import sleep
import sys, select, socket
from errno import EINTR, EBADF
from zope.interface import implementer... | unknown | codeparrot/codeparrot-clean | ||
/*!
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
export const enum TsVfsWorkerActions {
INIT_DEFAULT_FILE_SYSTEM_MAP = 'default-fs-ready',
CREATE_VFS_ENV_REQUEST... | typescript | github | https://github.com/angular/angular | adev/src/app/editor/code-editor/workers/enums/actions.ts |
# -*- coding: utf-8 -*-
"""
***************************************************************************
GridAverage.py
---------------------
Date : October 2013
Copyright : (C) 2013 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
*************... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Contracts\Debug;
interface ShouldntReport
{
//
} | php | github | https://github.com/laravel/framework | src/Illuminate/Contracts/Debug/ShouldntReport.php |
"""
Interface to Constrained Optimization By Linear Approximation
Functions
---------
.. autosummary::
:toctree: generated/
fmin_cobyla
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from scipy.lib.six import callable
from scipy.optimize import _cobyla
from .optimize... | unknown | codeparrot/codeparrot-clean | ||
from twilio.rest.base import TwilioClient
from twilio.rest.resources import (
UNSET_TIMEOUT,
Accounts,
Applications,
AuthorizedConnectApps,
CallFeedback,
CallFeedbackFactory,
CallerIds,
Calls,
Conferences,
ConnectApps,
DependentPhoneNumbers,
MediaList,
Members,
Me... | unknown | codeparrot/codeparrot-clean | ||
# sqlite/base.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: sqlite
:name: SQLite
.. _sqlite_datetime:
Date and Time Types
... | unknown | codeparrot/codeparrot-clean | ||
"""Unit tests for graph building"""
# Copyright (C) 2013 Garth N. Wells
#
# This file is part of DOLFIN.
#
# DOLFIN is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package local
import (
"path/filepath"
"testing"
"github.com/zclconf/go-cty/cty"
"github.com/hashicorp/terraform/internal/addrs"
"github.com/hashicorp/terraform/internal/backend"
"github.com/hashicorp/terraform/internal/configs/configschema... | go | github | https://github.com/hashicorp/terraform | internal/backend/local/testing.go |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier, David Beal
# Copyright 2013 Camptocamp SA
# Copyright 2013 Akretion
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | unknown | codeparrot/codeparrot-clean | ||
"""Config flow to configure the SimpliSafe component."""
from simplipy import API
from simplipy.errors import (
InvalidCredentialsError,
PendingAuthorizationError,
SimplipyError,
)
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_CODE, CONF_PASSWORD, CO... | unknown | codeparrot/codeparrot-clean | ||
/*
* 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 | framework-docs/src/main/java/org/springframework/docs/core/aop/ataspectj/aopataspectjexample/ApplicationConfiguration.java |
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-boot | configuration-metadata/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/immutable/ImmutableInnerClassProperties.java |
import os
import sys
def get_console_type(use_colors=True):
if use_colors and sys.stdout.isatty() and sys.stderr.isatty():
import platform
if platform.system() == 'Windows':
import lixian_colors_win32
return lixian_colors_win32.WinConsole
else:
import lixian_colors_linux
return lixian_colors_linux.A... | unknown | codeparrot/codeparrot-clean | ||
"""
=============================================================
Online Latent Dirichlet Allocation with variational inference
=============================================================
This implementation is modified from Matthew D. Hoffman's onlineldavb code
Link: http://www.cs.princeton.edu/~mdhoffma/code/onli... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: MPL-2.0
package logical
import (
"encoding/json"
"errors"
"fmt"
"net/http"
"strconv"
"strings"
"github.com/hashicorp/errwrap"
metrics "github.com/hashicorp/go-metrics/compat"
multierror "github.com/hashicorp/go-multierror"
"github.com/hashicorp/... | go | github | https://github.com/hashicorp/vault | sdk/logical/response_util.go |
#!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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, copy, modify, merge, publish,
... | unknown | codeparrot/codeparrot-clean | ||
import asyncio
import logging
import platform
import re
import signal
import subprocess
import sys
import warnings
from abc import ABC, abstractmethod
from collections.abc import Generator
from pathlib import Path
from typing import Any
import pytest
from packaging.version import parse as parse_version
from pexpect.po... | python | github | https://github.com/scrapy/scrapy | tests/test_crawler.py |
# This is a variant of the very old (early 90's) file
# Demo/threads/bug.py. It simply provokes a number of threads into
# trying to import the same module "at the same time".
# There are no pleasant failure modes -- most likely is that Python
# complains several times about module random having no attribute
# randran... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 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; eit... | unknown | codeparrot/codeparrot-clean | ||
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
class DeviceStorageTestCommon(object):
def is_sdcard_available(self):
ret_check_sdcard = self.marionette.ex... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
# django imports
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
# Main FileBrowser Directory. Relative to site.storage.location.
# DO NOT USE A SLASH AT THE BEGINNING, DO NOT FORGET THE TRAILING SLASH AT THE END.
DIRECTORY = getattr(settings, "FILEBROWSER_DIRE... | unknown | codeparrot/codeparrot-clean | ||
import unittest
import os, glob
from test_all import db, test_support, get_new_environment_path, \
get_new_database_path
#----------------------------------------------------------------------
class pget_bugTestCase(unittest.TestCase):
"""Verify that cursor.pget works properly"""
db_name = 'test-curs... | unknown | codeparrot/codeparrot-clean | ||
#!/bin/sh
test_description='basic branch output coloring'
. ./test-lib.sh
test_expect_success 'set up some sample branches' '
test_commit foo &&
git branch -M main &&
git update-ref refs/remotes/origin/main HEAD &&
git update-ref refs/heads/other HEAD
'
# choose non-default colors to make sure config
# is taking... | unknown | github | https://github.com/git/git | t/t3205-branch-color.sh |
#!/usr/bin/env python
from nose.tools import *
from nose import SkipTest
import networkx as nx
def test_valid_degree_sequence1():
n = 100
p = .3
for i in range(10):
G = nx.erdos_renyi_graph(n,p)
deg = list(G.degree().values())
assert_true( nx.is_valid_degree_sequence(deg, method='eg... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2017 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
package sql
import (
"context"
"fmt"
"slices"
"strings"
"time"
"github.com/cockroachdb/cockroach/pkg/keys"
"github.com/cockroachdb/cockroach/pkg/kv/kvserver/pro... | go | github | https://github.com/cockroachdb/cockroach | pkg/sql/show_fingerprints.go |
# 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 may ... | 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 may ... | unknown | codeparrot/codeparrot-clean | ||
global:
metric_name_validation_scheme: legacy
metric_name_escaping_scheme: dots
scrape_configs:
- job_name: prometheus | unknown | github | https://github.com/prometheus/prometheus | config/testdata/scrape_config_global_validation_mode.yml |
#!/usr/bin/env python
# Copyright 2010 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... | unknown | codeparrot/codeparrot-clean | ||
/*
* jcdiffct.c
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1994-1997, Thomas G. Lane.
* Lossless JPEG Modifications:
* Copyright (C) 1999, Ken Murchison.
* libjpeg-turbo Modifications:
* Copyright (C) 2022, 2024, D. R. Commander.
* For conditions of distribution and use, s... | c | github | https://github.com/opencv/opencv | 3rdparty/libjpeg-turbo/src/jcdiffct.c |
// MARK: - Sessions
extension SessionData {
@available(*, deprecated, message: "use SessionData.init(initialData:)")
public init(_ data: [String: String]) { self.init(initialData: data) }
} | swift | github | https://github.com/vapor/vapor | Sources/Vapor/_Deprecations.swift |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage PaloAltoNetworks Firewall
# (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish... | unknown | codeparrot/codeparrot-clean | ||
/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/sq",[],function(){return{errorLoading:function(){return"Rezultatet nuk mund të ngarkoheshin."},inputTooLong:fun... | javascript | github | https://github.com/django/django | django/contrib/admin/static/admin/js/vendor/select2/i18n/sq.js |
/* Copyright 2019 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/compiler/mlir/tensorflow/translate/mlir_roundtrip_flags.h |
#! python
# Python Serial Port Extension for Win32, Linux, BSD, Jython
# see __init__.py
#
# (C) 2001-2009 Chris Liechti <cliechti@gmx.net>
# this is distributed under a free software license, see license.txt
# compatibility folder Python < 2.6
try:
bytes
bytearray
except (NameError, AttributeError):
# Pyt... | 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 ... | java | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/impl/VectorIOBufferPool.java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.