code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Anscombe'] , ['MovingAverage'] , ['NoCycle'] , ['SVR'] ); | antoinecarme/pyaf | tests/model_control/detailed/transf_Anscombe/model_control_one_enabled_Anscombe_MovingAverage_NoCycle_SVR.py | Python | bsd-3-clause | 153 |
from setuptools import setup
with open('requirements.txt') as f:
required = f.read().splitlines()
setup(
name='pyRedisBridge',
version='0.0.8',
license='MIT',
url='https://github.com/sourceperl/pyRedisBridge',
platforms='any',
install_requires=required,
scripts=[
'redis_serial_... | sourceperl/pyRedisBridge | setup.py | Python | mit | 334 |
# This file is generated by /tmp/pip-build-JIErOP/scipy/-c
# It contains system_info results at the time of building this package.
__all__ = ["get_info","show"]
atlas_3_10_blas_info={}
atlas_3_10_blas_threads_info={}
atlas_threads_info={'libraries': ['lapack', 'ptf77blas', 'ptcblas', 'atlas'], 'library_dirs': ['/usr/l... | ryfeus/lambda-packs | Sklearn_scipy_numpy/source/scipy/__config__.py | Python | mit | 1,747 |
from .tilegrids import GeoadminTileGridLV03, GeoadminTileGridLV95, \
GlobalMercatorTileGrid, GlobalGeodeticTileGrid
from .grid import Grid
def getTileGrid(srs):
assert srs in (21781, 2056, 3857, 4326), 'Unsupported tile grid'
if srs == 21781:
return GeoadminTileGridLV03
elif srs == 2056:
... | loicgasser/gatilegrid | gatilegrid/__init__.py | Python | mit | 471 |
# -*- coding: utf-8 -*-
# Taboot - Client utility for performing deployments with Func.
# Copyright © 2009-2012, Red Hat, Inc.
#
# 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 ... | tbielawa/Taboot | taboot/util.py | Python | gpl-3.0 | 6,426 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
i_evapo_mh.py
-------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
********************************... | drnextgis/QGIS | python/plugins/processing/algs/grass7/ext/i_evapo_mh.py | Python | gpl-2.0 | 1,626 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-01-02 03:54
from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('profiles', '0002_profile_homeaddress'),
]
... | sunlaiqi/fundiy | src/profiles/migrations/0003_auto_20170102_1154.py | Python | mit | 2,482 |
from django.forms import ModelForm, Textarea, TextInput, HiddenInput, CharField, IntegerField, Select
from django.utils.translation import ugettext as _
from .models import Person, PersonEvent, PersonRelation, PersonAttribute, Group, GroupMember, GroupAttribute, Tag, \
PersonTag, PersonLink, GroupLink, Event, Even... | teddy-michel/Mimir | base/forms.py | Python | gpl-3.0 | 6,913 |
from sys import stdin
from collections import deque
ALPHABET = "abcdefghijklmnopqrstuvwxyz"
def readdict():
d = set()
while True:
word = stdin.readline().strip()
if len(word) == 0:
break
d.add(word)
return d
def readwords():
cases = []
while True:
ca... | secnot/uva-onlinejudge-solutions | 10150 - Doublets/main.py | Python | mit | 2,083 |
#!/usr/bin/env python
"""Module collecting different functions to create lightness stimuli. Includes
Cornsweet edges
Todorovic's Cornsweet checkerboard
square waves
White's illusion in different forms
disc and ring stimuli
"""
import numpy as np
from stimuli.utils import degrees_to_pixels, resize_array
def cornswee... | TUBvision/stimuli | lightness/lightness.py | Python | gpl-2.0 | 16,367 |
"""Tests for control_flow_ops.py."""
import tensorflow.python.platform
from tensorflow.core.framework import graph_pb2
from tensorflow.python.framework import ops
from tensorflow.python.framework.test_util import TensorFlowTestCase
from tensorflow.python.ops import control_flow_ops
from tensorflow.python.ops import st... | liyu1990/tensorflow | tensorflow/python/ops/control_flow_ops_test.py | Python | apache-2.0 | 3,164 |
# Copyright (c) 2015, Julian Straub <jstraub@csail.mit.edu> Licensed
# under the MIT license. See the license file LICENSE.
#import matplotlib.pyplot as plt
#import matplotlib.cm as cm
import numpy as np
#import cv2
import scipy.io
import subprocess as subp
import os, re, time
import argparse
#from vpCluster.rgbd.rg... | jstraub/rtDDPvMF | python/evalNYU.py | Python | mit | 3,598 |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | Hybrid-Cloud/cinder | cinder/tests/unit/scheduler/test_scheduler.py | Python | apache-2.0 | 18,413 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Usage:
dashboard.py [options]
dashboard.py (-h | --help)
dashboard.py --version
Options:
--slurmjob-template <path> Slurm job dashboard template.
[default: /opt/qnib/grafana/templates/slurm_job.j2]
--slurm-templat... | ChristianKniep/docker-grafana | opt/qnib/grafana/bin/dashboard.py | Python | mit | 12,494 |
def list1():
def list2():
def list3():
def list4():
list1-[1,2,3]
list2=[1,2,3,4]
list3=[4,66,7]
list4=[66,77,7,4]
diff1=list(set(list1)-set(list2))
diff2=list(set(list3)-set(list4))
r... | evansmwangi/GitDay0 | Day3labs/missingnumber.py | Python | gpl-3.0 | 362 |
"""Remove any personally identifying information from the database"""
from django.core.management.base import BaseCommand
from django.conf import settings
from django.contrib.admin.models import LogEntry
from django_openid_auth.models import UserOpenID
from rest_framework.authtoken.models import Token
from reversion.mo... | lutris/website | common/management/commands/anon_db.py | Python | agpl-3.0 | 2,839 |
"""rename this to test_assumptions.py when the old assumptions system is deleted"""
from sympy.core import symbols
from sympy.assumptions import Assume, global_assumptions, Predicate
from sympy.assumptions.assume import eliminate_assume
from sympy.printing import pretty
from sympy.assumptions.ask import Q
from sympy.ut... | pernici/sympy | sympy/assumptions/tests/test_assumptions_2.py | Python | bsd-3-clause | 2,430 |
import logging
import os
import jieba
import Taiba
class Matcher(object):
"""
比對使用者輸入的句子與目標語料集,
回傳語料集中最相似的一個句子。
"""
def __init__(self, segLib="Taiba"):
logging.basicConfig(format='%(asctime)s : %(threadName)s : %(levelname)s : %(message)s', level=logging.INFO)
self.titles = [] #... | nickbanana/chatbot-backend | Chatbot/QuestionAnswering/Matcher/matcher.py | Python | gpl-3.0 | 3,827 |
#!/usr/bin/env python
"""
Copyright 2012 GroupDocs.
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... | liosha2007/temporary-groupdocs-python3-sdk | groupdocs/models/GetQuestionnaireResult.py | Python | apache-2.0 | 958 |
# -*- coding: utf-8 -*-
# © 2016 Daniel Reis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import models, fields, api
from openerp import SUPERUSER_ID
from openerp import tools
# Extended name search is only used on some operators
ALLOWED_OPS = set(['ilike', 'like'])
@tools.ormcache(... | Benniphx/server-tools | base_name_search_improved/models/ir_model.py | Python | agpl-3.0 | 2,973 |
#!/usr/bin/env python
# pylint: disable=C0103,W0622
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015 Leandro Toledo de Souza <leandrotoeldodesouza@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public ... | AndrewSamokhvalov/python-telegram-bot | telegram/user.py | Python | gpl-3.0 | 2,099 |
from flask import Flask, request, send_from_directory
from time import sleep
app = Flask(__name__, static_url_path='/public')
@app.route('/')
def root():
return send_from_directory('./', 'index.html')
@app.route('/feedback.js')
def script():
return send_from_directory('./', 'feedback.js')
@app.route('/feedb... | deviantintegral/feedback | src/listener.py | Python | mit | 622 |
#!/usr/bin/python2
import optparse
import os
import shutil
import stat
import subprocess
import sys
from builds.GpBuild import GpBuild
def install_gpdb(dependency_name):
status = subprocess.call("mkdir -p /usr/local/gpdb", shell=True)
if status:
return status
status = subprocess.call(
"t... | Chibin/gpdb | concourse/scripts/test_gpdb.py | Python | apache-2.0 | 3,133 |
import sys, os
import shutil
pymunk_src_path = "../chipmunk_src"
if len(sys.argv) > 1:
chipmunk_svn_path = sys.argv[1]
else:
chipmunk_svn_path = raw_input('Enter path to chipmunk source')
def copyfiles(basepath, subpath=""):
path = os.path.join(basepath, subpath)
for fn in os.listdir(pa... | cfobel/python___pymunk | tools/update_chipmunk_src.py | Python | mit | 1,037 |
# 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... | dougwig/a10-neutron-lbaas | a10_neutron_lbaas/db/models/scaling_group.py | Python | apache-2.0 | 10,831 |
import datetime
from django import forms
from .models import Profile, Event
class EventForm(forms.Form):
event = forms.ModelChoiceField(queryset=Event.objects.filter(event_date__lte=datetime.datetime.today()))
class ProfileForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(ProfileFor... | endthestart/photocontest | photocontest/photocontest/forms.py | Python | mit | 486 |
from pylab import *
import numpy as np
data = loadtxt("analy")
r = data[:,0]
r = r /(1.543*10.0**20.0)
vc = data[:,1]
sigma2 = data[:,2]
data = loadtxt("ai05")
ai = data[:,1]
data = loadtxt("bh")
bh = data[:,1]
plot(np.log10((r)), np.log10(ai), label="Numerical beta = 0.5")
plot(np.log10(r),np.log10(bh), label ="Nu... | ZacByrne/galaxy-sim | plotaibh.py | Python | gpl-3.0 | 645 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__authors__ = 'Bruno Adelé <bruno@adele.im>'
__copyright__ = 'Copyright (C) 2015 Bruno Adelé'
__description__ = """Unittest"""
__license__ = 'GPLv3'
import os
import sys
import shutil
from cStringIO import StringIO
import unittest
import git
from gitcheck import gitchec... | tmartinfr/gitcheck | tests.py | Python | gpl-3.0 | 2,753 |
# -*- coding: utf-8 -*-
#
# nimblenet documentation build configuration file, created by
# sphinx-quickstart on Thu Jul 14 08:11:55 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
#... | jorgenkg/python-neural-network | docs/source/conf.py | Python | bsd-2-clause | 9,824 |
import ckan.plugins.toolkit as toolkit
import ckan.lib.helpers as helpers
import ckan.plugins as p
from ckan.lib.base import BaseController, response, request
import json
import db
import Levenshtein
from unidecode import unidecode
c = p.toolkit.c
render = p.toolkit.render
class TagmanagerController(BaseControlle... | alantygel/ckanext-tagmanager | ckanext/tagmanager/controller.py | Python | agpl-3.0 | 5,591 |
# -*-coding:Utf-8 -*
# Copyright (c) 2010 LE GOFF Vincent
# 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
# l... | stormi/tsunami | src/primaires/format/config.py | Python | bsd-3-clause | 3,909 |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2021, Shuup Commerce Inc. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
import logging
from django.contrib.auth import get_user_model
from... | shoopio/shoop | shuup/importer/tasks.py | Python | agpl-3.0 | 2,821 |
# -*- coding: utf-8 -*-
"""
pygments.formatter
~~~~~~~~~~~~~~~~~~
Base formatter class.
:copyright: Copyright 2006-2011 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import codecs
from pygments.util import get_bool_opt
from pygments.styles import get_style_by_nam... | markandrewj/pygments | pygments/formatter.py | Python | bsd-2-clause | 2,790 |
# -*- coding: utf-8 -*-
#
# (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com>
#
# See LICENSE comming with the source of 'trex' for details.
#
import warnings
from django.core.paginator import Page
from django.db.models import Sum
from rest_framework.serializers import (
HyperlinkedModelSerializer, HyperlinkedIdent... | bjoernricks/trex | trex/serializers.py | Python | mit | 5,009 |
import numpy as np
import pandas as pd
import xarray as xr
from . import parameterized, randn, requires_dask
nx = 300
long_nx = 30000
ny = 200
nt = 100
window = 20
randn_xy = randn((nx, ny), frac_nan=0.1)
randn_xt = randn((nx, nt))
randn_t = randn((nt,))
randn_long = randn((long_nx,), frac_nan=0.1)
class Rolling:... | pydata/xarray | asv_bench/benchmarks/rolling.py | Python | apache-2.0 | 4,603 |
import json
import socket
import time
from flask import Flask
from flask import render_template
from flask import request
from flask import redirect
from werkzeug.wrappers import Response
app = Flask(__name__)
def timePassed(oldtime, membership):
if membership == 'lifetime':
timer = 15
elif membership == '10se... | randomrandomlol123/fewgewgewgewhg | webapp.py | Python | gpl-3.0 | 3,198 |
# coding: utf-8
"""
Алгоритм обхода графа в ширину (BFS).
"""
# TODO: переписать
import queue
n, m = map(int, input().split()) # количество вершин и ребер в графе
adj = [[] for i in range(n)] # список смежности
used = [False for i in range(n)] # массив для хранения информации о пройденных и не пройденных вершинах
... | vladworldss/algo | struct/graph/bfs.py | Python | gpl-3.0 | 1,905 |
#
# ImageView.py -- base class for the display of image files
#
# Eric Jeschke (eric@naoj.org)
#
# Copyright (c) Eric R. Jeschke. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import numpy
import math
import logging
import threading
i... | eteq/ginga | ginga/ImageView.py | Python | bsd-3-clause | 68,628 |
#!/usr/bin/env python3 -u
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import numpy as np
import sys
def get_parser():
parser = argparse.ArgumentParser(
desc... | pytorch/fairseq | examples/wav2vec/unsupervised/scripts/phonemize_with_sil.py | Python | mit | 2,045 |
# -*- coding: utf-8 -*-
#
# This file is part of hopr: https://github.com/hopr/hopr.
#
# Hopr 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 ve... | hopr/hopr | hopr/tool/test_run.py | Python | gpl-3.0 | 5,871 |
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import logging
from pants.base.exceptions import TaskError
from pants.reporting.reporting_server import ReportingServerManager
from pants.task.task import QuietTaskMixin, Task
from pants.... | tdyas/pants | src/python/pants/core_tasks/reporting_server_run.py | Python | apache-2.0 | 2,593 |
# 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 ... | Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_express_route_cross_connection_peerings_operations.py | Python | mit | 22,362 |
import os
COURSERA_DOCKER_LABEL = 'courseraResearchExport'
COURSERA_LOCAL_FOLDER = os.path.expanduser('~/.coursera/exports/')
POSTGRES_DOCKER_IMAGE = 'postgres:9.5'
POSTGRES_INIT_MSG = 'PostgreSQL init process complete; ready for start up.'
POSTGRES_READY_MSG = 'database system is ready to accept connections'
| coursera/courseraresearchexports | courseraresearchexports/constants/container_constants.py | Python | apache-2.0 | 312 |
X = 42
N = 42
A = 11
M = 24
K = 21
T = 28
a = N + M + T + 1
O = 22
def f():
print(a) | jwren/intellij-community | python/testData/refactoring/introduceConstant/insertAfterAllGlobalVariablesOnWhichDepends.after.py | Python | apache-2.0 | 90 |
#! /usr/local/bin/python3
from discoursesso import DiscourseSSO
"""
These are the credentials used in the example
https://meta.discourse.org/t/official-single-sign-on-for-discourse/13045
"""
payload = "bm9uY2U9Y2I2ODI1MWVlZmI1MjExZTU4YzAwZmYxMzk1ZjBjMGI%3D%0A"
secret_key = "d836444a9e4084d5b224a60c208dce14"
sig =... | ravikiranj/discourse-sso-python-ldap | runner.py | Python | bsd-2-clause | 765 |
from pywb.utils.canonicalize import UrlCanonicalizer
from pywb.utils.wbexception import NotFoundException
from pywb.cdx.cdxops import cdx_load
from pywb.cdx.cdxsource import CDXSource, CDXFile, RemoteCDXSource, RedisCDXSource
from pywb.cdx.zipnum import ZipNumCluster
from pywb.cdx.cdxobject import CDXObject, CDXExcept... | pombredanne/pywb | pywb/cdx/cdxserver.py | Python | gpl-3.0 | 7,874 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# $Id: tst-a1.py 56295 2015-06-09 14:29:55Z vboxsync $
"""
Analyzer Experiment 1.
"""
__copyright__ = \
"""
Copyright (C) 2010-2015 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This file is fr... | carmark/vbox | src/VBox/ValidationKit/testanalysis/tst-a1.py | Python | gpl-2.0 | 3,077 |
#!/usr/bin/env python
from builtins import map
import os
import sys
from PyAnalysisTools.AnalysisTools.CutFlowAnalyser import CutflowAnalyser as ca
from PyAnalysisTools.AnalysisTools.CutFlowAnalyser import ExtendedCutFlowAnalyser as eca
from PyAnalysisTools import base
try:
from tabulate.tabulate import tabulate_... | morgenst/PyAnalysisTools | run_scripts/print_cutflow.py | Python | mit | 3,152 |
# 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... | npuichigo/ttsflow | third_party/tensorflow/tensorflow/python/client/session_benchmark.py | Python | apache-2.0 | 8,973 |
"""
Tests related to deprecation warnings. Also a convenient place
to document how deprecations should eventually be turned into errors.
"""
from __future__ import division, absolute_import, print_function
import datetime
import sys
import operator
import warnings
import pytest
import shutil
import tempfile
import n... | MSeifert04/numpy | numpy/core/tests/test_deprecations.py | Python | bsd-3-clause | 24,541 |
lines = open('line.txt', 'r').readlines()
lines_set = set(lines)
out = open('workfile.txt', 'w')
for line in lines_set:
out.write(line)
| miller-tamil/research_on_email_marketting | web1_ads/Line_separator.py | Python | apache-2.0 | 144 |
__version__ = "1.3.15"
| F5Networks/f5-icontrol-rest-python | icontrol/__init__.py | Python | apache-2.0 | 23 |
import cherrypy
# 這是 CDBG30 類別的定義
class CDBG30(object):
# 各組利用 index 引導隨後的程式執行
@cherrypy.expose
def index(self, *args, **kwargs):
outstring = '''
這是 2014CDB 協同專案下的 cdbg30 分組程式開發網頁, 以下為 W12 的任務執行內容.<br />
<!-- 這裡採用相對連結, 而非網址的絕對連結 (這一段為 html 註解) -->
<a href="cube1">cdbg30 正方體參數繪圖</a>(尺寸變數 a, b, c)<br... | 2014cdbg5/cdbg5 | wsgi/programs/cdbg30/__init__.py | Python | gpl-2.0 | 32,107 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | 30loops/nova | nova/api/ec2/cloud.py | Python | apache-2.0 | 75,405 |
from django.contrib.admin.views.decorators import staff_member_required
from task_queue import tasks
from api.v3.resources.activity_view_resources import HttpResponse
# PARSE TASKS
@staff_member_required
def add_task(request):
import django_rq
task = request.GET.get('task')
parameters = request.GET.get('... | catalpainternational/OIPA | OIPA/task_queue/views.py | Python | agpl-3.0 | 7,273 |
import os
root_folder = "/mnt/Data/Music/"
class Main:
@staticmethod
def get_all_artists():
for artist in os.listdir(root_folder):
if os.path.isdir(os.path.join(root_folder, artist)):
absolute_path = os.path.join(root_folder, artist)
icon_name = Main.get_ic... | beschoenen/BulkIconChanger | main.py | Python | mit | 1,668 |
# Roundware Server is released under the GNU Affero General Public License v3.
# See COPYRIGHT.txt, AUTHORS.txt, and LICENSE.txt in the project root directory.
# TODO: Figure out how to get the main pipeline to send EOS
# when all audiotracks are finished (only happens
# when repeat is off)
# TODO: Reimplement pan... | probabble/roundware-server | roundwared/audiotrack.py | Python | agpl-3.0 | 10,047 |
# Lint as: python3
# Copyright 2021 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 ... | tensorflow/lingvo | lingvo/jax/layers/recurrent.py | Python | apache-2.0 | 17,731 |
# Python < 3 needs this: coding=utf-8
import pytest
from pybind11_tests import builtin_casters as m
from pybind11_tests import UserType, IncType
def test_simple_string():
assert m.string_roundtrip("const char *") == "const char *"
def test_unicode_conversion():
"""Tests unicode conversion and error reporti... | Lemma1/MAC-POSTS | src/pybinder/pybind11/tests/test_builtin_casters.py | Python | mit | 11,540 |
# 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 ... | fhoring/autorest | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDictionary/autorestswaggerbatdictionaryservice/operations/dictionary_operations.py | Python | mit | 110,391 |
# import itertools
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
from netCDF4 import Dataset
from postladim import ParticleFile
# ---------------
# User settings
# ---------------
# Files
particle_file = "streak.nc"
grid_file = "../data/ocean_avg_0014.nc"
# Subgrid... | bjornaa/ladim | examples/streak/animate.py | Python | mit | 2,388 |
# -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014-2017 CERN.
#
# INSPIRE 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 ... | inspirehep/inspire-next | inspirehep/modules/workflows/errors.py | Python | gpl-3.0 | 5,348 |
#
# Copyright (C) 2018 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed ... | wgwoods/lorax | tests/pylorax/test_ltmpl.py | Python | gpl-2.0 | 13,602 |
import numpy as np
from bokeh.objects import ColumnDataSource, DataRange1d, Plot, Glyph, LinearAxis, Grid
from bokeh.widgetobjects import VBox, Tabs, Panel
from bokeh.glyphs import (AnnularWedge, Annulus, Arc, Bezier, Circle, Line, MultiLine, Oval,
Patch, Patches, Quad, Quadratic, Ray, Rect, Segment, Square, Wedge... | the13fools/Bokeh_Examples | glyphs/glyphs.py | Python | bsd-3-clause | 4,858 |
import os
def foo():
print(hello_world)
| AtomLinter/linter-pyflakes | spec/fixtures/invalid.py | Python | mit | 46 |
# This file is generated by /home/leo/pycode/nrg_mapping/source/setup.py
# It contains system_info results at the time of building this package.
__all__ = ["get_info","show"]
def get_info(name):
g = globals()
return g.get(name, g.get(name + "_info", {}))
def show():
for name,info_dict in globals().items(... | GiggleLiu/nrg_mapping | nrgmap/__config__.py | Python | mit | 689 |
# -*- coding: utf-8 -*-
"""
@author: Fabio Erculiani <lxnay@sabayon.org>
@contact: lxnay@sabayon.org
@copyright: Fabio Erculiani
@license: GPL-2
B{Entropy Infrastructure Toolkit}.
"""
import sys
import os
import subprocess
import argparse
from entropy.const import const_file_readable
from entrop... | Sabayon/entropy | server/eit/commands/log.py | Python | gpl-2.0 | 2,260 |
"""Contains the Credit (coin play) mode code"""
# credits.py
# Mission Pinball Framework
# Written by Brian Madden & Gabe Knuth
# Released under the MIT License. (See license info at the end of this file.)
# Documentation and more info at http://missionpinball.com/mpf
from math import floor
from mpf.system.data_manag... | qcapen/mpf | mpf/modes/credits/code/credits.py | Python | mit | 17,280 |
"""
toasterReflow.py
Alexander Hiam
A web interface for the toasterReflow reflow toaster oven control
library.
Apache 2.0 license.
"""
import inspect, json, threading
from flask import Flask, g, redirect, url_for, request,\
session, render_template, flash
from functools import wraps
from toa... | whatnick/toasterReflow | toasterReflow.py | Python | apache-2.0 | 6,699 |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | tseaver/google-cloud-python | translate/setup.py | Python | apache-2.0 | 2,783 |
#!/usr/bin/env python3
from python_utility.command_process import CommandProcess
def main():
process = CommandProcess(
arguments=[
'flake8',
'--exclude', '.git,.idea,.tox',
'--verbose',
'--max-complexity', '5'
],
)
process.print_output()
i... | FunTimeCoding/jenkins-job-manager | script/python/flake8.py | Python | mit | 357 |
#
# This file is part of python-dbusx. Python-dbusx is free software
# available under the terms of the MIT license. See the file "LICENSE" that
# was provided together with this source file for the licensing terms.
#
# Copyright (c) 2012-2013 the python-dbusx authors. See the file "AUTHORS"
# for a complete list.
imp... | geertj/python-dbusx | lib/dbusx/message.py | Python | mit | 4,446 |
from time import sleep
from benchmarking.benchmark import Benchmark
from benchmarking.evaluator import SimpleEvaluator
def _benchmark_test():
# TODO: Remove this function before finishing project. This method is for testing/example purposes only!
def method1(arg):
sleep(1)
return arg
def ... | Waszker/Bioinformatics | program/main.py | Python | mit | 845 |
#!/usr/bin/env python
#
# Copyright (C) 2011, 2012 Google Inc.
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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
# (... | amchoukir/ycmd | ycmd/completers/objc/hook.py | Python | gpl-3.0 | 957 |
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
import os
import pytest
from translate.fil... | unho/pootle | tests/models/translationproject.py | Python | gpl-3.0 | 5,854 |
import tensorflow as tf
from tensorflow.contrib import layers
from tensorflow.contrib.framework import arg_scope
from tensormate.graph import TfGgraphBuilder
class ImageGraphBuilder(TfGgraphBuilder):
def __init__(self, scope=None, device=None, plain=False, data_format="NHWC",
data_format_ops=(l... | songgc/tensormate | tensormate/graph/image_graph.py | Python | apache-2.0 | 1,742 |
#-*- coding: utf-8 -*-
# Creation Date : 2016-10-18
# Created by : Antoine LeBel
import archive
import intranet_copy
import local_copy
import web_copy
print("Le programme démarre")
archive = archive.Archive()
try:
print("Tentative de copy")
archive.perform_location_copy()
except AttributeError:
print("Le ... | Pobux/pattern_conception | strategy/main.py | Python | mit | 803 |
import asyncio
from gear import Database
from gear.cloud_config import get_gcp_config
from hailtop import aiotools
from hailtop.aiocloud import aiogoogle
from hailtop.utils import RateLimit, periodically_call
from ....driver.driver import CloudDriver, process_outstanding_events
from ....driver.instance_collection imp... | hail-is/hail | batch/batch/cloud/gcp/driver/driver.py | Python | mit | 5,479 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Clearbit Slack Notifier documentation build configuration file, created by
# sphinx-quickstart on Wed Sep 2 00:49:26 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are pres... | 15five/clearbit-slack-python | docs/conf.py | Python | mit | 9,661 |
"""Main PAC class."""
import numpy as np
import logging
from tensorpac.spectral import spectral, hilbertm
from tensorpac.methods import (get_pac_fcn, pacstr, compute_surrogates,
erpac, ergcpac, _ergcpac_perm, preferred_phase,
normalize)
from tensorpac.gcmi ... | EtienneCmb/tensorpac | tensorpac/pac.py | Python | bsd-3-clause | 36,901 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2002-2011 Zuza Software Foundation
#
# This file is part of the Translate Toolkit.
#
# 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; e... | mozilla/verbatim | vendor/lib/python/translate/storage/fpo.py | Python | gpl-2.0 | 22,052 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#-----------------------------------------------------------------
#-- Servo class
#-- Juan Gonzalez-Gomez (obijuan). May-2013
#-----------------------------------------------------------------
#-- Controlling the position of servos from the PC
#-- The Arduino / skymega or an... | Obijuan/protocoder-apps | servos/python-client/Servo.py | Python | gpl-2.0 | 1,675 |
import datetime
from datetime import timedelta, time
from django.test import TestCase
from ..libs import (
get_user_realname,
format_totaltime,
format_hours_float,
format_time,
get_localtime,
get_thismonth_1st,
export_csv_task,
)
class TestLib(TestCase):
fixtures = ['test_views.json'... | dictoss/active-task-summary | ats/tests/tests_libs.py | Python | bsd-2-clause | 6,226 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""'Database' management."""
# ChestTimer, an agenda creator for GW2 chests.
# Copyright (C) 2014 Julio Biason
#
# 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 Soft... | jbiason/chesttimer | api/chesttimer/db/__init__.py | Python | gpl-3.0 | 793 |
import boto.swf.layer2 as swf
DOMAIN = 'stackoverflow'
VERSION = '1.0'
class PrioritizingWorker(swf.ActivityWorker):
domain = DOMAIN
version = VERSION
def run(self):
urgent_task_count = swf.Domain(name=DOMAIN).count_pending_activity_tasks('urgent_tasks').get('count', 0)
if urgent_task_c... | oozie/stackoverflow | amazon-swf/priority_tasks/worker.py | Python | bsd-3-clause | 675 |
#-*- encoding: utf-8 -*-
#Note: The YouTube Data API (v2) has been officially deprecated as of March 4, 2014. Please refer to our deprecation policy for more information.
#https://developers.google.com/youtube/2.0/developers_guide_protocol_api_query_parameters
try:
from urllib.request import urlopen, Request
f... | ingwinlu/simpleMediaCenter | simpleMediaCenter/helpers/youtube/__init__.py | Python | gpl-2.0 | 3,580 |
from django.contrib import admin
from django.urls import include, path
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('tracks.urls'))
]
| jochenklar/bike | config/urls.py | Python | apache-2.0 | 164 |
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
"""
The pex.pex utility builds PEX environments and .pex files specified by
sources, requirements and their dependencies.
"""
from __future__ import absolute_import, print_function
impor... | snyaggarwal/pex | pex/bin/pex.py | Python | apache-2.0 | 19,324 |
import balanced
balanced.configure('ak-test-1o9QKwUCrwstHWO5sGxICtIJdQXFTjnrV')
card = balanced.Card.fetch('/cards/CC4OTo7bbk25ZWmhdQCdXkPu')
card.unstore() | trenton42/txbalanced | scenarios/card_delete/executable.py | Python | mit | 158 |
# Copyright 2005 Joe Wreschnig, Michael Urman
# 2021 Nick Boultbee
#
# 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 ve... | quodlibet/quodlibet | quodlibet/qltk/msg.py | Python | gpl-2.0 | 4,091 |
# Bob build tool
# Copyright (C) 2021 Jan Klötzke
#
# SPDX-License-Identifier: GPL-3.0-or-later
from ...errors import BuildError
from ...tty import Warn, WarnOnce
from ...utils import asHexStr, hashDirectoryWithSize, isWindows
import errno
import os, os.path
import json
import shutil
import sys
import tempfile
warnR... | BobBuildTool/bob | pym/bob/cmds/build/share.py | Python | gpl-3.0 | 12,327 |
# Copyright 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 ag... | froyobin/ironic | ironic/common/dhcp_factory.py | Python | apache-2.0 | 3,294 |
from typing import Any
from unittest.mock import patch
import ujson
from django.http import HttpResponse
from zerver.lib.test_classes import ZulipTestCase
from zerver.lib.users import get_api_key
from zerver.models import get_realm, get_user
class ZephyrTest(ZulipTestCase):
def test_webathena_kerberos_login(sel... | shubhamdhama/zulip | zerver/tests/test_zephyr.py | Python | apache-2.0 | 3,450 |
#
# crowbar - a geometry manipulation program
# Copyright (C) 2020 Dylan Scott Grafmyre
#
# 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, ... | thorsummoner/crowbar | crowbar/ext/new_objects/__init__.py | Python | unlicense | 1,078 |
# ===============================================================================
# Copyright 2019 ross
#
# 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/LICE... | UManPychron/pychron | pychron/hardware/gauges/qtegra/qtegra_gauge_controller.py | Python | apache-2.0 | 1,410 |
# Copyright 2014 Huawei Technologies Co. Ltd
#
# 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... | baigk/compass-core | compass/actions/health_check/check_apache.py | Python | apache-2.0 | 3,123 |
from django.http import HttpResponseRedirect
from django.utils.decorators import method_decorator
from django.views.generic import TemplateView
from .compat import login_required
from .models import NoticeType, NOTICE_MEDIA
from .utils import notice_setting_for_user
class NoticeSettingsView(TemplateView):
templa... | synasius/pinax-notifications | pinax/notifications/views.py | Python | mit | 2,586 |
# -*- coding: utf-8 -*-
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
from __future__ import division # just to be safe...
import numpy as np
###############################################################################
# Ut... | Eric89GXL/vispy | vispy/color/color_space.py | Python | bsd-3-clause | 6,042 |
"""
provide a generic structure to support window functions,
similar to how we have a Groupby object
"""
from __future__ import division
import warnings
import numpy as np
from collections import defaultdict
from datetime import timedelta
from pandas.core.dtypes.generic import (
ABCSeries,
ABCDataFrame,
... | NixaSoftware/CVis | venv/lib/python2.7/site-packages/pandas/core/window.py | Python | apache-2.0 | 68,731 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
import os
from nose.tools import eq_, raises
import mapnik
from .utilities import execution_path, run_all
def setup():
# All of the paths used are relative, if we run the tests
# from another directory we ... | tomhughes/python-mapnik | test/python_tests/webp_encoding_test.py | Python | lgpl-2.1 | 7,128 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.