code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
#!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2014, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
'''
Setup ins... | unknown | codeparrot/codeparrot-clean | ||
"""Crypto utilities."""
import contextlib
import logging
import socket
import sys
from six.moves import range # pylint: disable=import-error,redefined-builtin
import OpenSSL
from acme import errors
logger = logging.getLogger(__name__)
# TLSSNI01 certificate serving and probing is not affected by SSL
# vulnerabili... | unknown | codeparrot/codeparrot-clean | ||
#ifndef JEMALLOC_INTERNAL_BACKGROUND_THREAD_EXTERNS_H
#define JEMALLOC_INTERNAL_BACKGROUND_THREAD_EXTERNS_H
extern bool opt_background_thread;
extern size_t opt_max_background_threads;
extern malloc_mutex_t background_thread_lock;
extern atomic_b_t background_thread_enabled_state;
extern size_t n_background_threads;
e... | c | github | https://github.com/redis/redis | deps/jemalloc/include/jemalloc/internal/background_thread_externs.h |
// Copyright 2015 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.
//go:build ignore
// detect attempts to autodetect the correct
// values of the environment variables
// used by go_ios_exec.
// detect shells out to idevicein... | go | github | https://github.com/golang/go | misc/ios/detect.go |
# Copyright 2018 Open Source Robotics Foundation, 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... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import plotly.offline as py
import plotly.graph_objs as go
from plotly.graph_objs import *
import plotly.tools as tls
import seaborn as sns
import plotly
plotly.offline.init_notebook_mode()
def plot_pollutants(df, year, state):
... | 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 | ||
import sqlite3
con = sqlite3.connect(":memory:")
cur = con.cursor()
# Create the table
con.execute("create table person(lastname, firstname)")
AUSTRIA = "\xd6sterreich"
# by default, rows are returned as Unicode
cur.execute("select ?", (AUSTRIA,))
row = cur.fetchone()
assert row[0] == AUSTRIA
# but we can make sql... | unknown | codeparrot/codeparrot-clean | ||
# Module doctest.
# Released to the public domain 16-Jan-2001, by Tim Peters (tim@python.org).
# Major enhancements and refactoring by:
# Jim Fulton
# Edward Loper
# Provided as-is; use at your own risk; no warranty; no promises; enjoy!
r"""Module doctest -- a framework for running examples in docstrings.
In... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package schema
import (
"fmt"
"log"
"strconv"
"strings"
"sync"
"github.com/hashicorp/terraform/internal/legacy/terraform"
"github.com/mitchellh/mapstructure"
)
// ConfigFieldReader reads fields out of an untyped map[string]string to the
//... | go | github | https://github.com/hashicorp/terraform | internal/legacy/helper/schema/field_reader_config.go |
#-------------------------------------------------------------
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python2.4
import sys, os
from cStringIO import StringIO
import re
from Plex import *
from Plex.Traditional import re as Re
class MyScanner(Scanner):
def __init__(self, info, name='<default>'):
Scanner.__init__(self, self.lexicon, info, name)
def begin(self, state_name):
# if se... | unknown | codeparrot/codeparrot-clean | ||
# Modules User Model
A `module` is the primary unit of code
sharing in Swift. This document describes the experience of using
modules in Swift: what they are and what they provide for the user.
> *Warning:* This document was used in planning Swift 1.0; it has not been kept up to
date.
## High-Level Overview
### A m... | unknown | github | https://github.com/apple/swift | docs/Modules.md |
# Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.python.threadpool}
"""
import pickle, time, weakref, gc, threading
from twisted.trial import unittest, util
from twisted.python import threadpool, threadable, failure, context
from twisted.internet import reacto... | unknown | codeparrot/codeparrot-clean | ||
#ifndef __FAST_FLOAT_STRTOD_H__
#define __FAST_FLOAT_STRTOD_H__
#if defined(__cplusplus)
extern "C"
{
#endif
double fast_float_strtod(const char *in, char **out);
#if defined(__cplusplus)
}
#endif
#endif /* __FAST_FLOAT_STRTOD_H__ */ | c | github | https://github.com/redis/redis | deps/fast_float/fast_float_strtod.h |
# This file was created automatically by SWIG.
import __init___
#-------------- SHADOW WRAPPERS ------------------
def gluPickMatrix(x, y, width, height, viewport = None):
'gluPickMatrix(x, y, width, height, viewport = None) -> None'
return __gluPickMatrix(x, y, width, height, viewport)
def gluProject(objx, o... | unknown | codeparrot/codeparrot-clean | ||
from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.document_loaders import JoplinLoader
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional i... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/document_loaders/joplin.py |
# this is based on jsarray.py
# todo check everything :)
from ..base import *
try:
import numpy
except:
pass
@Js
def ArrayBuffer():
a = arguments[0]
if isinstance(a, PyJsNumber):
length = a.to_uint32()
if length!=a.value:
raise MakeError('RangeError', 'Invalid array length... | unknown | codeparrot/codeparrot-clean | ||
/*-------------------------------------------------------------------------
*
* resowner.c
* POSTGRES resource owner management code.
*
* Query-lifespan resources are tracked by associating them with
* ResourceOwner objects. This provides a simple mechanism for ensuring
* that such resources are freed at the ... | c | github | https://github.com/postgres/postgres | src/backend/utils/resowner/resowner.c |
# -*- coding: utf-8 -*-
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, perpetual, royalty-free,
# non-exclusive license to e... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# 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
#... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2004 Python Software Foundation.
# All rights reserved.
# Written by Eric Price <eprice at tjhsst.edu>
# and Facundo Batista <facundo at taniquetil.com.ar>
# and Raymond Hettinger <python at rcn.com>
# and Aahz <aahz at pobox.com>
# and Tim Peters
# This module should be kept in sync with ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2014 Rackspace, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2012,2013
# Max Planck Institute for Polymer Research
# Copyright (C) 2008,2009,2010,2011
# Max-Planck-Institute for Polymer Research & Fraunhofer SCAI
#
# This file is part of ESPResSo++.
#
# ESPResSo++ is free software: you can redistribute it and/or modify
# it under the terms of the G... | unknown | codeparrot/codeparrot-clean | ||
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import {CompilerDiagnostic, CompilerError} from '..';
import {ErrorCategory} from '../CompilerError';
import {HIRFunction} from ... | typescript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/Validation/ValidateNoImpureFunctionsInRender.ts |
/**
* @jest-environment node
*/
import urlDataStrategy from "./utils/urlDataStrategy";
import type {
StaticHandler,
StaticHandlerContext,
} from "../../lib/router/router";
import {
createStaticHandler,
getStaticContextFromError,
} from "../../lib/router/router";
import {
ErrorResponseImpl,
isRouteErrorRe... | typescript | github | https://github.com/remix-run/react-router | packages/react-router/__tests__/router/ssr-test.ts |
import sys
import os
# Debug mode
DEBUG = False
# Enable debug mode if --debug
for argument in sys.argv:
if argument == '--debug':
DEBUG = True
# Host, Port
HOST = '127.0.0.1'
PORT = 8080
# Domain
SERVER_NAME = 'localhost:8080'
# Database
SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://poss:poss@localhost/p... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright 2014 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... | go | github | https://github.com/kubernetes/kubernetes | pkg/apis/core/doc.go |
from __future__ import print_function, division
from warnings import warn
from collections import namedtuple
from copy import deepcopy
from .hashable import Hashable
from .utils import flatten_2d_list
from nilm_metadata import get_appliance_types
ApplianceID = namedtuple('ApplianceID', ['type', 'instance'])
DEFAULT_ON... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) University of Tennessee Health Science Center, Memphis, TN.
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License
# as published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any la... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
module Jekyll
module Utils
# Based on the pattern and code from
# https://emptysqua.re/blog/an-event-synchronization-primitive-for-ruby/
class ThreadEvent
attr_reader :flag
def initialize
@lock = Mutex.new
@cond = ConditionVariable.new
@f... | ruby | github | https://github.com/jekyll/jekyll | lib/jekyll/utils/thread_event.rb |
'''
Update the transformation files of active transformations given an InputDataQuery fetched from the Transformation Service.
Possibility to speedup the query time by only fetching files that were added since the last iteration.
Use the CS option RefreshOnly (False by default) and set the DateKey (empty by default) t... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2015 0xc0170
#
# 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, soft... | unknown | codeparrot/codeparrot-clean | ||
import wx
import peringatan
import edit_data_kemiskinan
import frm_sideka_menu
def create(parent):
return Dialog1(parent)
[wxID_DIALOG1, wxID_DIALOG1BUTTON1, wxID_DIALOG1BUTTON2,
wxID_DIALOG1STATICLINE1, wxID_DIALOG1STATICTEXT1, wxID_DIALOG1STATICTEXT2,
wxID_DIALOG1TEXTCTRL1,
] = [wx.NewId() for _init_ctrls in ... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright 2020 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... | go | github | https://github.com/kubernetes/kubernetes | pkg/apis/certificates/validation/validation_test.go |
from __future__ import unicode_literals
import uuid
from django.conf import settings
from django.db.backends.base.operations import BaseDatabaseOperations
from django.utils import six, timezone
from django.utils.encoding import force_text
class DatabaseOperations(BaseDatabaseOperations):
compiler_module = "djang... | unknown | codeparrot/codeparrot-clean | ||
extern crate autocfg;
fn main() {
// Normally, cargo will set `OUT_DIR` for build scripts.
let ac = autocfg::AutoCfg::with_dir("target").unwrap();
for i in 3..8 {
ac.emit_has_type(&format!("i{}", 1 << i));
}
} | rust | github | https://github.com/nodejs/node | deps/crates/vendor/autocfg/examples/integers.rs |
#include "locking-selftest-rlock.h"
#include "locking-selftest-softirq.h" | c | github | https://github.com/torvalds/linux | lib/locking-selftest-rlock-softirq.h |
from __future__ import absolute_import
from __future__ import with_statement
import sys
import socket
from nose import SkipTest
from celery.exceptions import ImproperlyConfigured
from celery import states
from celery.utils import uuid
from celery.backends import redis
from celery.backends.redis import RedisBackend
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# Copyright 2013 Google 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 vers... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
// Code generated by go-swagger; DO NOT EDIT.
package plugin
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
// Env env
//
// swagger:model Env
type Env struct {
// description
// Required: true
Description string `json:"Descrip... | go | github | https://github.com/moby/moby | api/types/plugin/env.go |
use std::{
fmt,
marker::PhantomData,
net,
rc::Rc,
task::{Context, Poll},
};
use actix_codec::{AsyncRead, AsyncWrite, Framed};
use actix_rt::net::TcpStream;
use actix_service::{
fn_service, IntoServiceFactory, Service, ServiceFactory, ServiceFactoryExt as _,
};
use actix_utils::future::ready;
us... | rust | github | https://github.com/actix/actix-web | actix-http/src/h1/service.rs |
from pyasn1 import error
class TagMap:
def __init__(self, posMap={}, negMap={}, defType=None):
self.__posMap = posMap.copy()
self.__negMap = negMap.copy()
self.__defType = defType
def __contains__(self, tagSet):
return tagSet in self.__posMap or \
self.__defType ... | unknown | codeparrot/codeparrot-clean | ||
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
# This code is supporting material for the book
# Building Machine Learning Systems with Python
# by Willi Richert and Luis Pedro Coelho
# published by PACKT Publishing
#
# It is made available under the MIT License
# This script fits several forms of penalized regression
from __future__ import print_function
import ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Addons modules by CLEARCORP S.A.
# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
#
# This program is free software: you can redistribute... | unknown | codeparrot/codeparrot-clean | ||
List_of_plants = []
List_of_produce = []
class ambrosia():
name = 'ambrosia'
plantname = 'Ambrosia Vulgaris'
Description = "These seeds grow into common ambrosia, a plant grown by and from medicine."
icon_state = 'seed-ambrosiavulgaris'
lifespan = 60
endurance = 25
production = 6
plant_yield = 6
potency = 5
w... | unknown | codeparrot/codeparrot-clean | ||
#pragma once
#include <c10/core/Allocator.h>
#include <c10/util/Exception.h>
#include <c10/util/Registry.h>
#include <ATen/detail/AcceleratorHooksInterface.h>
// NB: Class must live in `at` due to limitations of Registry.h.
namespace at {
// Forward-declares at::cuda::NVRTC
namespace cuda {
struct NVRTC;
} // names... | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/detail/CUDAHooksInterface.h |
"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2014 Alex Forencich
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... | unknown | codeparrot/codeparrot-clean | ||
import os
import tempfile
from importlib import import_module
from django import conf
from django.contrib import admin
from django.test import TestCase, override_settings
from django.test.utils import extend_sys_path
from django.utils._os import npath, upath
from django.utils.autoreload import gen_filenames
LOCALE_PA... | unknown | codeparrot/codeparrot-clean | ||
#
# Part of p5: A Python package based on Processing
# Copyright (C) 2017-2019 Abhik Pal
#
# 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 | ||
########################################################################
#
# File Name: HTMLCollection.py
#
#
"""
WWW: http://4suite.com/4DOM e-mail: support@4suite.com
Copyright (c) 2000 Fourthought Inc, USA. All Rights Reserved.
See http://4suite.com/COPYRIGHT for license and copyright informa... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
pythoncompat
"""
from .packages import chardet
import sys
# -------
# Pythons
# -------
# Syntax sugar.
_ver = sys.version_info
#: Python 2.x?
is_py2 = (_ver[0] == 2)
#: Python 3.x?
is_py3 = (_ver[0] == 3)
#: Python 3.0.x
is_py30 = (is_py3 and _ver[1] == 0)
#: Python 3.1.x
is_py31 =... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# coding: latin-1
# Imagem Cinemática is a free software intended to be used as a tool for teachers
# and students. It utilizes Computer Vision techniques to extract the trajectory
# of moving objects from video data.
#
# The code contained in this project follows the Google Python Style Guide
# R... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation (FSF), e... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
import pytest
from pandas._libs import lib
import pandas as pd
from pandas import (
Index,
MultiIndex,
)
import pandas._testing as tm
@pytest.mark.parametrize(
"input_index, input_columns, input_values, "
"expected_values, expected_columns, expected_index",
[
(
... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/reshape/test_pivot_multilevel.py |
from south.db import db
from django.db import models
from ella.positions.models import *
class Migration:
depends_on = (
("core", "0001_initial"),
)
def forwards(self, orm):
# Adding model 'Position'
db.create_table('positions_position', (
('id', models.AutoField(prim... | unknown | codeparrot/codeparrot-clean | ||
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may n... | java | github | https://github.com/apache/kafka | connect/api/src/main/java/org/apache/kafka/connect/data/Decimal.java |
# -*- coding: utf-8 -*-
import re
from module.plugins.internal.MultiHook import MultiHook
class LinkdecrypterComHook(MultiHook):
__name__ = "LinkdecrypterComHook"
__type__ = "hook"
__version__ = "1.07"
__status__ = "testing"
__config__ = [("activated" , "bool" , "Activat... | unknown | codeparrot/codeparrot-clean | ||
import os
import sys
execfile('/etc/courtlistener')
sys.path.append(INSTALL_ROOT)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
from alert.search.models import Document, Citation
from alert.lib.db_tools import queryset_generator
from alert.lib.string_utils import clean_string
from alert.lib.string_utils... | unknown | codeparrot/codeparrot-clean | ||
"""Unit tests for buildscripts/resmokelib/testing/hooks/fuzz_runtime_parameters.py."""
import random
import sys
import unittest
import mock
from buildscripts.resmokelib.testing.hooks import fuzz_runtime_parameters as _runtime_fuzzer
class TestRuntimeFuzzGeneration(unittest.TestCase):
def assert_parameter_values... | python | github | https://github.com/mongodb/mongo | buildscripts/tests/resmokelib/testing/hooks/test_runtime_parameter_fuzzing.py |
"""Test the covtype loader, if the data is available,
or if specifically requested via environment variable
(e.g. for CI jobs)."""
from functools import partial
import pytest
from sklearn.datasets.tests.test_common import check_return_X_y
def test_fetch(fetch_covtype_fxt, global_random_seed):
data1 = fetch_covt... | python | github | https://github.com/scikit-learn/scikit-learn | sklearn/datasets/tests/test_covtype.py |
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_event.h>
#include <ngx_mail.h>
static char *ngx_mail_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
static ngx_int_t ngx_mail_add_ports(ngx_conf_t *cf, ngx_array_t *ports,
ngx_mail_... | c | github | https://github.com/nginx/nginx | src/mail/ngx_mail.c |
#!/usr/bin/python
#
# Copyright (C) 2006 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 ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Famille.description'
db.add_column(u'famille_famille', 'de... | unknown | codeparrot/codeparrot-clean | ||
from django import forms
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as AuthUserAdmin
from django.contrib.auth.forms import UserChangeForm, UserCreationForm
from .models import User
class MyUserChangeForm(UserChangeForm):
class Meta(UserChangeForm.Meta):
model = User
... | unknown | codeparrot/codeparrot-clean | ||
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Bundle\FrameworkBu... | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Security/bundles.php |
#ifndef SQL_JOIN_CACHE_INCLUDED
#define SQL_JOIN_CACHE_INCLUDED
/* Copyright (c) 2000, 2025, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
... | c | github | https://github.com/mysql/mysql-server | sql/sql_join_buffer.h |
#################################################################################################
# @file App.py #
# @brief The App class representing an Android app. #
# @update 2014-02-02 19:59:00 (Sun Feb 2, 2014 at 7:59 PM) #
# @author Paolo Rovelli #
######... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Flexible python representation of a symbolic mathematical formula.
Acceptes Presentation MathML, Content MathML (and could also do OpenMath).
Provides sympy representation.
"""
#
# File: formula.py
# Date: 04-May-12 (creation)
# Author: I. Chuang <ichuang@mit.edu>
#
im... | unknown | codeparrot/codeparrot-clean | ||
"""
Data format classes ("responders") that can be plugged
into model_resource.ModelResource and determine how
the objects of a ModelResource instance are rendered
(e.g. serialized to XML, rendered by templates, ...).
"""
from django.core import serializers
from django.core.handlers.wsgi import STATUS_CODE_TEXT
from dj... | unknown | codeparrot/codeparrot-clean | ||
# ERPNext - web based ERP (http://erpnext.com)
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
#
# 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 you... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# 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
# "L... | unknown | codeparrot/codeparrot-clean | ||
---
navigation_title: "MySQL"
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/reference/current/es-connectors-mysql.html
---
# Elastic MySQL connector reference [es-connectors-mysql]
The *Elastic MySQL connector* is a [connector](/reference/search-connectors/index.md) for [MySQL](https://www.mysql.com... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/search-connectors/es-connectors-mysql.md |
fun foo(a: Int) {
val b: Int = 1
loop1@ for (p in 1..b) {
loop2@ for (n in 1..b) {
<expr>if (a > 0) throw Exception("")
if (a + b > 0) break@loop2
if (a - b > 0) continue@loop1</expr>
}
}
} | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api/testData/components/dataFlowInfoProvider/exitPointSnapshot/controlFlow/breakContinue2.kt |
#!/bin/sh
# Copyright (c) 2011, Google Inc.
test_description='adding and checking out large blobs'
. ./test-lib.sh
test_expect_success 'core.bigFileThreshold must be non-negative' '
: >input &&
test_must_fail git -c core.bigFileThreshold=-1 hash-object input >out 2>err &&
grep "bad numeric config value" err &&
t... | unknown | github | https://github.com/git/git | t/t1050-large.sh |
import numpy as np
def sigmoid(x):
"""
Compute the sigmoid function for the input here.
"""
x = 1./(1 + np.exp(-x))
return x
def sigmoid_grad(f):
"""
Compute the gradient for the sigmoid function here. Note that
for this implementation, the input f should be the sigmoid
function ... | unknown | codeparrot/codeparrot-clean | ||
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | python | github | https://github.com/apache/airflow | airflow-core/tests/unit/migrations/test_no_orm_refs_in_migration_scripts.py |
/*
* 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-beans/src/testFixtures/java/org/springframework/beans/factory/aot/TestBeanRegistrationsAotProcessor.java |
#pep : current path endpoint (for finding next segment(s))
#ipath : array of indices on this path
#iredund : if available, indices to ignore (from previous juncture analyses)
#pl : path length to reach
def main(pep, ipath, iredund, pl, index, strt, end, cid, rb):
import numpy as np
import length_builder
#IDEA... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import
from bokeh.exceptions import DataIntegrityException
class UnauthorizedException(Exception):
pass
class ServerModel(object):
idfield = None
typename = None
@classmethod
def modelkey(cls, objid):
return "model:%s:%s"% (cls.typename, objid)
def my... | unknown | codeparrot/codeparrot-clean | ||
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
// Copyright (C) 2025, Institute of Software, Chinese Academy of Sciences.
#include "rvv_hal.hpp"
#include "common.hpp"
nam... | cpp | github | https://github.com/opencv/opencv | hal/riscv-rvv/src/imgproc/filter.cpp |
"""Tests for PEP 810 lazy imports."""
import io
import dis
import subprocess
import sys
import textwrap
import threading
import types
import unittest
try:
import _testcapi
except ImportError:
_testcapi = None
class LazyImportTests(unittest.TestCase):
"""Tests for basic lazy import functionality."""
... | python | github | https://github.com/python/cpython | Lib/test/test_import/test_lazy_imports.py |
"""GUIMiner - graphical frontend to Bitcoin miners.
Currently supports:
- m0mchil's "poclbm"
- puddinpop's "rpcminer"
- jedi95's "Phoenix"
- ufasoft's "bitcoin-miner"
Copyright 2011 Chris MacLeod
This program is released under the GNU GPL. See LICENSE.txt for details.
"""
import sys, os, subprocess, errno, re, threa... | unknown | codeparrot/codeparrot-clean | ||
"""
Test all things related to the ``jedi.cache`` module.
"""
import time
import pytest
import jedi
from jedi import settings, cache
from jedi.cache import ParserCacheItem, ParserPickling
ParserPicklingCls = type(ParserPickling)
ParserPickling = ParserPicklingCls()
def test_modulepickling_change_cache_dir(monkeypa... | unknown | codeparrot/codeparrot-clean | ||
<!-- This file is generated by scripts/process-messages/index.js. Do not edit! -->
### experimental_async_required
```
Cannot use `%name%(...)` unless the `experimental.async` compiler option is `true`
```
### invalid_default_snippet
```
Cannot use `{@render children(...)}` if the parent component uses `let:` direc... | unknown | github | https://github.com/sveltejs/svelte | documentation/docs/98-reference/.generated/shared-errors.md |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: POGOProtos/Networking/Responses/AttackGymResponse.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from g... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of the Ansible Documentation
#
# 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 th... | unknown | codeparrot/codeparrot-clean | ||
!/usr/bin/python
# emon logger
# elha 20141220
# version 1.0
#
# inspired by OpenEnergyMonitor.org
import math
import time
import requests
import Queue
import threading
# const
NUMBER_OF_SAMPLES = 850 # take 850 Samples per Measurement (takes approx 1.2 secs)
ICAL = 1000 / 33 # CT 1000:1 / Bur... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | unknown | codeparrot/codeparrot-clean | ||
import cPickle
import ann
import theano
import numpy
from createData import plot_all, plot
from numpy.random import choice
import matplotlib.pyplot as plt
import theano.tensor as T
def load_data(num = None):
data, y = cPickle.load(open('data.dat', 'rb'))
less_xx = 0
if less_xx:
less = min([(y==i... | unknown | codeparrot/codeparrot-clean | ||
#!/bin/env python
#Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/lib/randomtext.py
__version__=''' $Id$ '''
###############################################################################
# gene... | unknown | codeparrot/codeparrot-clean | ||
/* crc32_fold.c -- crc32 folding interface
* Copyright (C) 2021 Nathan Moinvaziri
* For conditions of distribution and use, see copyright notice in zlib.h
*/
#include "zbuild.h"
#include "zutil.h"
#include "functable.h"
#include "crc32.h"
Z_INTERNAL uint32_t crc32_fold_reset_c(crc32_fold *crc) {
crc->value = CR... | c | github | https://github.com/opencv/opencv | 3rdparty/zlib-ng/arch/generic/crc32_fold_c.c |
/**
* 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/test/java/org/apache/hadoop/fs/FileContextURIBase.java |
# -*- coding: utf-8 -*-
# This file is part of Casia - CAS server based on Django
# Copyright (C) 2013 Mateusz Małek
# Casia is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# L... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package blocktoattr
import (
"testing"
"github.com/hashicorp/hcl/v2"
"github.com/hashicorp/hcl/v2/ext/dynblock"
"github.com/hashicorp/hcl/v2/hcldec"
"github.com/hashicorp/hcl/v2/hclsyntax"
hcljson "github.com/hashicorp/hcl/v2/json"
"github.... | go | github | https://github.com/hashicorp/terraform | internal/lang/blocktoattr/fixup_test.go |
import WebIDL
def WebIDLTest(parser, harness):
parser.parse("""
interface TestIncompleteTypes {
attribute FooInterface attr1;
FooInterface method1(FooInterface arg);
};
interface FooInterface {
};
""")
results = parser.finish()
harness.ok(True, "T... | 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 | spring-context/src/test/java/org/springframework/cache/config/EnableCachingTests.java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.