repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
guillermogineste/marinarocadie-theme | node_modules/node-gyp/gyp/buildbot/buildbot_run.py | 1467 | 4228 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Argument-less script to select what to run on the buildbots."""
import os
import shutil
import subprocess
import sys
BUILDBOT_DIR = os.... | gpl-3.0 |
catch22/moment_polytopes | tests/test_third_party.py | 1 | 8150 | from __future__ import absolute_import, print_function
import logging, pytest
from sage.all import QQ, vector
from moment_polytopes import *
logger = logging.getLogger(__name__)
def test_fermi_3_6():
# check bare inequalities
bare_hrepr = third_party.klyachko_fermi_hrepr(3, 6, bare=True)
bare_hrepr_expec... | mit |
chooowai/codecombat | scripts/analytics/parseStripePayments.py | 97 | 10435 | # Parse Stripe payment info via exported payments.csv files
import sys
from datetime import tzinfo, timedelta, datetime
# TODO: use stripe_customers.csv to match payments to our db data
# Stripe file format
# id,Description,Created (UTC),Amount,Amount Refunded,Currency,Converted Amount,Converted Amount Refunded,Fee,... | mit |
ThinkingBridge/platform_external_chromium_org | native_client_sdk/src/tools/tests/httpd_test.py | 72 | 3450 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import Queue
import sys
import subprocess
import threading
import unittest
import urllib2
SCRIPT_DIR = os.path.dirname(o... | bsd-3-clause |
Luke092/MLDM_SFCrime | src/featureEngineering.py | 1 | 9541 | from utilities import *
from sklearn.cluster import KMeans
from sklearn import preprocessing
import pandas as pd
import time
import re
import os
def removeAtts(ds, intest, atts):
if not atts:
return ds, intest
for att in atts:
intest.remove(att)
for i in range(len(ds)):
for att in... | gpl-3.0 |
jdobes/spacewalk | client/rhel/yum-rhn-plugin/test/settestpath.py | 19 | 1057 | # yum-rhn-plugin - RHN support for yum
#
# Copyright (c) 2006--2011 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 optio... | gpl-2.0 |
alberts/check_mk | mkeventd/lib/check_mkevents.py | 4 | 5412 | #!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ /... | gpl-2.0 |
quamilek/django | django/conf/locale/sv/formats.py | 504 | 1569 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F Y'
TIME_FORMAT = 'H:i'
DATETI... | bsd-3-clause |
fstagni/DIRAC | Resources/Computing/BatchSystems/GE.py | 1 | 6947 | ############################################################################
# GE class representing SGE batch system
# 10.11.2014
# Author: A.T.
############################################################################
""" Torque.py is a DIRAC independent class representing Torque batch system.
Torque objec... | gpl-3.0 |
glmcdona/meddle | examples/base/Lib/sunaudio.py | 286 | 1399 | """Interpret sun audio headers."""
from warnings import warnpy3k
warnpy3k("the sunaudio module has been removed in Python 3.0; "
"use the sunau module instead", stacklevel=2)
del warnpy3k
MAGIC = '.snd'
class error(Exception):
pass
def get_long_be(s):
"""Convert a 4-char value to integer."""
r... | mit |
onitake/ansible | lib/ansible/modules/cloud/google/gcp_compute_target_pool.py | 7 | 17972 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | gpl-3.0 |
ballbillow/kosmosfs | scripts.solaris/kfslaunch.py | 28 | 4429 | #!/usr/bin/env python
#
# $Id: kfslaunch.py 36 2007-11-12 02:43:36Z sriramsrao $
#
# Copyright 2007 Kosmix Corp.
#
# This file is part of Kosmos File System (KFS).
#
# 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 co... | apache-2.0 |
rtindru/django | django/contrib/auth/password_validation.py | 229 | 7041 | from __future__ import unicode_literals
import gzip
import os
import re
from difflib import SequenceMatcher
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured, ValidationError
from django.utils import lru_cache
from django.utils._os import upath
from django.utils.encoding import ... | bsd-3-clause |
p-l-/miasm | test/utils/screendisplay.py | 6 | 3617 | import time
import signal
from cosmetics import getTerminalSize, colors
global_state = {"termSize": getTerminalSize(),
"message": "",
"pstate": []}
def print_conf(conf, value):
"Print a configuration line"
return colors["green"] + conf + ": " + colors["end"] + str(value)
de... | gpl-2.0 |
onceuponatimeforever/oh-mainline | vendor/packages/requests/requests/packages/urllib3/packages/ordered_dict.py | 2040 | 8935 | # Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy.
# Passes Python2.7's test suite and incorporates all the latest updates.
# Copyright 2009 Raymond Hettinger, released under the MIT License.
# http://code.activestate.com/recipes/576693/
try:
from thread import get_ident as _get_iden... | agpl-3.0 |
metacloud/oslo.config | oslo/config/cfg.py | 5 | 79774 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | apache-2.0 |
fingeronthebutton/RIDE | src/robotide/controller/tags.py | 1 | 1934 | # Copyright 2008-2015 Nokia Solutions and Networks
#
# 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 l... | apache-2.0 |
Donald-Otto/SpeedDreamsForkProject | src/tools/ceguidemo/menuresults.py | 3 | 3956 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Results menu.
"""
# Import: std
import sys
# Import: PyCEGUI
import PyCEGUI
# Import: Configuration
from configuration import TheConfig
# Import: Menus
from menu import Menu
from menumanager import MenuManager
# Results menu
class MenuResults(Menu):
# Static d... | gpl-2.0 |
jasondunsmore/heat | heat/engine/resources/openstack/senlin/policy.py | 3 | 7126 | #
# 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
# ... | apache-2.0 |
kiran/bart-sign | venv/lib/python2.7/site-packages/requests/__init__.py | 175 | 2007 | # -*- coding: utf-8 -*-
# __
# /__) _ _ _ _ _/ _
# / ( (- (/ (/ (- _) / _)
# /
"""
Requests HTTP library
~~~~~~~~~~~~~~~~~~~~~
Requests is an HTTP library, written in Python, for human beings. Basic GET
usage:
>>> import requests
>>> r = requests.get('https://www.python.org')
>>> ... | mit |
OPM/opm-cmake | python/pybind11/tests/conftest.py | 11 | 6634 | """pytest configuration
Extends output capture as needed by pybind11: ignore constructors, optional unordered lines.
Adds docstring and exceptions message sanitizers: ignore Python 2 vs 3 differences.
"""
import pytest
import textwrap
import difflib
import re
import sys
import contextlib
import platform
import gc
_u... | gpl-3.0 |
coinorama/coinorama | src/markets/watcher/watcher-bitfinexLTC.py | 1 | 5761 | #!/usr/bin/python
#
# Coinorama/coinref: watch and store raw Bitfinex LTC market info
#
# This file is part of Coinorama <http://coinorama.net>
#
# Copyright (C) 2013-2016 Nicolas BENOIT
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Licens... | agpl-3.0 |
mabotech/mabo.io | py/vision/vision25/dc2.py | 4 | 1288 |
"""
http://stackoverflow.com/questions/9860667/writing-robust-color-and-size-invariant-circle-detection-with-opencv-based-on
"""
import cv2
import math
import numpy as np
d_red = cv2.cv.RGB(150, 55, 65)
l_red = cv2.cv.RGB(250, 200, 200)
orig = cv2.imread("N16.png")
img = orig.copy()
img2 = cv2.cvtColor(img, cv2.COL... | mit |
chaos33/httpie | httpie/client.py | 3 | 4023 | import json
import sys
from pprint import pformat
import requests
from requests.packages import urllib3
from httpie import sessions
from httpie import __version__
from httpie.compat import str
from httpie.plugins import plugin_manager
# https://urllib3.readthedocs.org/en/latest/security.html
urllib3.disable_warning... | bsd-3-clause |
sharifulgeo/google-appengine-wx-launcher | launcher/mainframe_selection_helper_unittest.py | 28 | 13408 | #!/usr/bin/env python
#
# Copyright 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 |
rapilabs/django | tests/auth_tests/test_views.py | 35 | 44018 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import itertools
import os
import re
from importlib import import_module
from django.apps import apps
from django.conf import settings
from django.contrib.admin.models import LogEntry
from django.contrib.auth import REDIRECT_FIELD_NAME, S... | bsd-3-clause |
waltBB/neutron_read | neutron/db/migration/alembic_migrations/firewall_init_ops.py | 61 | 3536 | # Copyright 2014 OpenStack Foundation
#
# 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 ... | apache-2.0 |
bdero/edx-platform | common/djangoapps/course_modes/migrations/0007_add_description.py | 25 | 2269 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'CourseMode.description'
db.add_column('course_modes_coursemode', 'description',
... | agpl-3.0 |
jimsize/PySolFC | pysollib/pysolgtk/timeoutsdialog.py | 1 | 3304 | #!/usr/bin/env python
# -*- mode: python; coding: utf-8; -*-
# ---------------------------------------------------------------------------##
#
# Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer
# Copyright (C) 2003 Mt. Hood Playing Card Co.
# Copyright (C) 2005-2009 Skomoroh
#
# This program is free softwa... | gpl-3.0 |
putinclassic/putic | contrib/linearize/linearize-data.py | 131 | 8604 | #!/usr/bin/python
#
# linearize-data.py: Construct a linear, no-fork version of the chain.
#
# Copyright (c) 2013-2014 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from __future__ import print_funct... | mit |
ambikeshwar1991/sandhi-2 | module/gr36/gnuradio-core/src/python/gnuradio/gr/qa_fft_filter.py | 17 | 12873 | #!/usr/bin/env python
#
# Copyright 2004,2005,2007,2010 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at ... | gpl-3.0 |
jjmiranda/edx-platform | common/djangoapps/django_comment_common/models.py | 2 | 6185 | import logging
from django.db import models
from django.contrib.auth.models import User
from django.dispatch import receiver
from django.db.models.signals import post_save
from django.utils.translation import ugettext_noop
from config_models.models import ConfigurationModel
from student.models import CourseEnrollmen... | agpl-3.0 |
ahmadio/edx-platform | common/lib/xmodule/xmodule/modulestore/perf_tests/test_asset_import_export.py | 62 | 11683 | """
Performance test for asset metadata in the modulestore.
"""
from path import path
import unittest
from tempfile import mkdtemp
import itertools
from shutil import rmtree
from bson.code import Code
import datetime
import ddt
#from nose.plugins.attrib import attr
from nose.plugins.skip import SkipTest
from xmodule.a... | agpl-3.0 |
jose36/jmdl2 | servers/onefichier.py | 35 | 1318 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para 1fichier
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core impo... | gpl-2.0 |
MrStaticVoid/kernel_m8 | scripts/gcc-wrapper.py | 1276 | 3382 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2012, The Linux Foundation. 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 th... | gpl-2.0 |
Cadair/jupyter_environment_kernels | environment_kernels/activate_helper.py | 1 | 21251 | # -*- coding: utf-8 -*-
# Copyright 2015, the xonsh developers. All rights reserved.
"""Helpers to activate an environment and prepare the environment variables for the kernel.
Copied from xonsh"""
# Changes from xonsh:
# - replace the xonsh environment cache with os.environ
# - remove aliases and func handling -> we ... | bsd-2-clause |
AmberJBlue/aima-python | submissions/Conklin/myBayes.py | 15 | 1185 | import traceback
from submissions.Conklin import music
class DataFrame:
data = []
feature_names = []
target = []
target_names = []
musicECHP = DataFrame()
musicECHP.data = []
targetInfo = []
list_of_songs = music.get_songs()
for song in list_of_songs:
try:
tempo = float(song['song']["te... | mit |
wangyikai/grpc | src/python/grpcio/grpc/framework/base/_expiration.py | 39 | 6338 | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
murphy214/berrl | build/lib/berrl/pipehtml.py | 2 | 33070 | import os
import json
import itertools
import SimpleHTTPServer
import SocketServer
def server_server():
PORT = 8000
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
try:
httpd = SocketServer.TCPServer(("", PORT), Handler)
print "serving at port", PORT
httpd.serve_forever()
except Exception:
pass
pr... | apache-2.0 |
shtouff/django | tests/admin_views/test_adminsite.py | 10 | 3010 | from __future__ import unicode_literals
import datetime
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase, override_settings
from django.test.client import RequestFactory
... | bsd-3-clause |
dustywind/bachelor-thesis | impl/recommender/vector/productvectormanager.py | 1 | 2497 |
from .vectormanager import VectorManager
from .vectortablecreator import VectorTableCreator
from .df import DocumentFrequencyVectorCreator
from .tf import TermFrequencyVectorCreator
from .tfidf import TfIdfVectorCreator
from .idf import InverseDocumentFrequencyVectorCreator
class ProductVectorManager(VectorManager):... | mit |
liangwang/m5 | ext/ply/test/yacc_notfunc.py | 174 | 1476 | # -----------------------------------------------------------------------------
# yacc_notfunc.py
#
# p_rule not defined as a function
# -----------------------------------------------------------------------------
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.yacc as yacc
from calclex import... | bsd-3-clause |
vs4vijay/linux | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
effa/wikicorpora | configuration/configuration.py | 1 | 1920 | #!/usr/bin/env python
# encoding: utf-8
from __future__ import unicode_literals
import yaml
class Configuration(object):
"""Class for reprezentation of configuration"""
def __init__(self, path):
"""Loads configuration.
:path: unicode
path to configuration file in YAML format
... | gpl-2.0 |
mitocw/edx-platform | openedx/core/djangoapps/schedules/content_highlights.py | 3 | 6018 | """
Contains methods for accessing weekly course highlights. Weekly highlights is a
schedule experience built on the Schedules app.
"""
import logging
from openedx.core.djangoapps.course_date_signals.utils import spaced_out_sections
from openedx.core.djangoapps.schedules.config import COURSE_UPDATE_WAFFLE_FLAG
from ... | agpl-3.0 |
ngbusca/pyLyA | py/pylya/cf.py | 1 | 1690 | import scipy as sp
import sys
from healpy import query_disc
from multiprocessing import Pool
np = None
nt = None
rp_max = None
rt_max = None
angmax = None
nside = None
counter = None
lock = None
npix = None
z0 = None
alpha= None
def fill_neighs(data):
for i,p1 in enumerate(data):
if i%10==0:
... | gpl-3.0 |
maduhu/mifos-head | resources/scripts/JunitToTestNgConverterUsingSuiteXml.py | 9 | 8960 | #!/usr/bin/env python
"""Converts Java JUnit3.8 test classes to TestNG, with ordering dependencies.
"""
import os.path, sys
from gnosis.xml.objectify import XML_Objectify, DOM
class JunitToTestNgConverterUsingSuiteXml:
def __init__(self):
self.testNgTestImportLine = "import org.testng.annotations.Test;"
... | apache-2.0 |
jhjguxin/blogserver | lib/python2.7/site-packages/django/core/validators.py | 51 | 8035 | import platform
import re
import urllib2
import urlparse
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
# These values, if given to validate(), will trigger the self.required check.
EMPTY_VALUES = (None, '', []... | mit |
manazhao/tf_recsys | tensorflow/python/kernel_tests/bias_op_test.py | 133 | 9303 | # 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... | apache-2.0 |
FrancoisJ/ShareCoin | share/qt/extract_strings_qt.py | 2945 | 1844 | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
they can be picked up by Qt linguist.
'''
from subprocess import Popen, PIPE
import glob
import operator
OUT_CPP="src/qt/bitcoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' format produced by x... | mit |
dustinlarimer/collab-pad | src/node_modules/npm/node_modules/node-gyp/gyp/test/configurations/target_platform/gyptest-target_platform.py | 351 | 1112 | #!/usr/bin/env python
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Tests the msvs specific msvs_target_platform option.
"""
import TestGyp
import TestCommon
def RunX64(exe, stdout):
try:
test.ru... | apache-2.0 |
apple/llvm-project | lldb/test/API/functionalities/signal/TestSendSignal.py | 4 | 4269 | """Test that lldb command 'process signal SIGUSR1' to send a signal to the inferior works."""
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class SendSignalTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
def set... | apache-2.0 |
hoangt/gem5v | src/arch/x86/isa/insts/general_purpose/rotate_and_shift/rotate.py | 91 | 5877 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
samliu/servo | tests/wpt/css-tests/tools/pywebsocket/src/test/test_stream.py | 496 | 2872 | #!/usr/bin/env python
#
# Copyright 2011, 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... | mpl-2.0 |
mattskone/garage_alarm | models.py | 2 | 1467 | """
A module to return a trained model.
This module can be invoked manually to train a new model from existing samples.
$ python ./models.py
"""
import logging
import os
import pickle
from sklearn import svm
from sklearn.cross_validation import cross_val_score
import config
import samples
logger = logging.getLogger(... | mit |
prmtl/fuel-web | nailgun/nailgun/expression/objects.py | 7 | 2627 | # Copyright 2014 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
neuroidss/nupic.research | projects/sensorimotor/experiments/capacity/data_utils.py | 22 | 6537 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | agpl-3.0 |
ardiloot/NonlinearTMM | Examples/ExampleSecondOrderNonlinearTmm.py | 1 | 1446 | import numpy as np
import pylab as plt
from NonlinearTMM import SecondOrderNLTMM, Material
if __name__ == "__main__":
# Define params
wlP1 = 1000e-9
wlP2 = 1000e-9
polP1 = "s"
polP2 = "s"
polGen = "s"
I0P1 = 1.0
I0P2 = I0P1
betas = np.linspace(0.0, 0.99, 10000)
cry... | mit |
rsvip/Django | tests/model_meta/models.py | 99 | 4711 | from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
class Relation(models.Model):
pass
class AbstractPerson(models.Model):
# DATA fields
data_abstract = models.CharField(max_len... | bsd-3-clause |
sam-m888/addons-source | DescendantCount/DescendantCount.py | 2 | 5643 | # Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2009 Douglas S. Blank <doug.blank@gmail.com>
# Copyright (C) 2016 Serge Noiraud <serge.noiraud@free.fr>
# Copyright (C) 2017 Paul Culley <paulr2787@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the term... | gpl-2.0 |
tmm1/pygments.rb | vendor/pygments-main/pygments/styles/manni.py | 1 | 2374 | # -*- coding: utf-8 -*-
"""
pygments.styles.manni
~~~~~~~~~~~~~~~~~~~~~
A colorful style, inspired by the terminal highlighting style.
This is a port of the style used in the `php port`_ of pygments
by Manni. The style is called 'default' there.
:copyright: Copyright 2006-2020 by the Pygments... | mit |
evernym/zeno | plenum/test/txn_author_agreement/acceptance/conftest.py | 2 | 7254 | import json
from datetime import datetime, date
from enum import Enum
import pytest
from plenum.common.types import f
from plenum.common.constants import AML
from plenum.common.util import get_utc_epoch
from plenum.common.request import SafeRequest
from plenum.common.exceptions import (
InvalidClientTaaAcceptanceE... | apache-2.0 |
remotesyssupport/cobbler-template-files | cobbler/action_replicate.py | 1 | 8344 | """
Replicate from a cobbler master.
Copyright 2007-2008, Red Hat, Inc
Michael DeHaan <mdehaan@redhat.com>
Scott Henson <shenson@redhat.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either ve... | gpl-2.0 |
psycofdj/xtd | xtd/core/error.py | 2 | 4281 | # -*- coding: utf-8
#------------------------------------------------------------------#
__author__ = "Xavier MARCELET <xavier@marcelet.com>"
#------------------------------------------------------------------#
class XtdError(BaseException):
def __init__(self, p_module, p_message, *p_args, **p_kwds):
self.m... | gpl-3.0 |
Ban3/Limnoria | plugins/Owner/plugin.py | 2 | 26932 | ###
# Copyright (c) 2002-2005, Jeremiah Fincher
# Copyright (c) 2008-2009, James McCoy
# 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 ... | bsd-3-clause |
sidnarayanan/BAdNet | train/gen/adv/models/shallow/v4_etaphi/setup.py | 6 | 1640 |
# auto-generated. do not edit!
from subtlenet import config
from subtlenet.generators import gen_singletons as generator
config.gen_singletons = {'2_3_1': 12, '2_3_2': 13, '2_4_2': 15, 'tau1': 33, '2_4_1': 14, '2_1_2': 9, '2_1_1': 8, '2_2_1': 10, '2_2_2': 11, 'partonm': 29, '1_2_2': 3, '1_2_1': 2, 'pt': 32, 'tau2': 35... | mit |
kapilt/cloud-custodian | c7n/executor.py | 6 | 2929 | # Copyright 2015-2017 Capital One Services, 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 ... | apache-2.0 |
jawed123/django-user-accounts | account/conf.py | 9 | 2229 | from __future__ import unicode_literals
import importlib
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.translation import get_language_info
import pytz
from appconf import AppConf
from account.timezones import TIMEZONES
def load_path_attr(path):
i ... | mit |
ramitalat/odoo | openerp/addons/base/module/module.py | 70 | 37453 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2014 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
kohnle-lernmodule/exeLearningPlus1_04 | exe/webui/errorpage.py | 15 | 1917 | # ===========================================================================
# eXe
# Copyright 2004-2006, University of Auckland
#
# 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... | gpl-2.0 |
etherkit/OpenBeacon2 | client/macos/venv/lib/python3.8/site-packages/pip/_vendor/html5lib/html5parser.py | 22 | 117186 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import with_metaclass, viewkeys
import types
from . import _inputstream
from . import _tokenizer
from . import treebuilders
from .treebuilders.base import Marker
from . import _utils
from .constants import (
spaceCharacters,... | gpl-3.0 |
atruberg/django-custom | django/utils/simplejson.py | 116 | 1101 | # Django 1.5 only supports Python >= 2.6, where the standard library includes
# the json module. Previous version of Django shipped a copy for Python < 2.6.
# For backwards compatibility, we're keeping an importable json module
# at this location, with the same lookup sequence.
# Avoid shadowing the simplejson module... | bsd-3-clause |
xindus40223115/w17_test | static/Brython3.1.3-20150514-095342/Lib/_csv.py | 639 | 21705 | """CSV parsing and writing.
[Copied from PyPy
https://bitbucket-assetroot.s3.amazonaws.com/pypy/pypy/1400171824.19/641/_csv.py?Signature=cc%2Bc8m06cBMbsxt2e15XXXUDACk%3D&Expires=1404136251&AWSAccessKeyId=0EMWEFSGA12Z1HF1TZ82
and adapted to Python 3 syntax for Brython]
This module provides classes that assist in the ... | gpl-3.0 |
the-zebulan/CodeWars | tests/kyu_3_tests/test_finding_an_appointment.py | 1 | 2838 | import unittest
from katas.kyu_3.finding_an_appointment import get_start_time
class GetStartTimeTestCase(unittest.TestCase):
def setUp(self):
self.schedule_1 = [
[['09:00', '11:30'], ['13:30', '16:00'], ['16:00', '17:30'],
['17:45', '19:00']],
[['09:15', '12:00'], ['1... | mit |
tiagocardosos/stoq | stoqlib/domain/test/test_attachment.py | 2 | 1283 | # -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
##
## Copyright (C) 2013 Async Open Source <http://www.async.com.br>
## All rights reserved
##
## 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 Foundati... | gpl-2.0 |
StackOps/fabuloso-catalog-havana | neutron/l3_agent_scheduler.py | 1 | 15590 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2013 OpenStack Foundation.
# 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-2.0 |
mirzasany/mirza | plugin.video.shahidmbcnet/resources/community/genericPlayer.py | 2 | 34963 | # -*- coding: utf-8 -*-
import xbmc, xbmcgui, xbmcplugin
import urllib2,urllib,cgi, re
import HTMLParser
import xbmcaddon
import json
import traceback
import os
from BeautifulSoup import BeautifulStoneSoup, BeautifulSoup, BeautifulSOAP
import time
import sys
import CustomPlayer
import base64
__addon__ = xbmcaddo... | gpl-2.0 |
phooky/ToorDoor | menu.py | 1 | 1067 |
class Menu:
def __init__(self,parent,title,description='Select an entry:'):
self.parent = parent
self.title = title
self.description = description
self.entries = []
def add_entry(self,text,fn):
self.entries.append((text,fn))
def display(self,client):
client.s... | gpl-2.0 |
zetaops/SpiffWorkflow | tests/SpiffWorkflow/pytests/test_servicetask.py | 1 | 1459 | # -*- coding: utf-8 -*-
""""""
# -
# Copyright (C) 2015 ZetaOps Inc.
#
# This file is licensed under the GNU General Public License v3
# (GPLv3). See LICENSE.txt for details.
from SpiffWorkflow import Task
from SpiffWorkflow.bpmn.BpmnWorkflow import BpmnWorkflow
from tests.SpiffWorkflow.pytests.testengine import Bpmn... | lgpl-3.0 |
perkinslr/pypyjs | website/js/pypy.js-0.2.0/lib/modules/fileinput.py | 28 | 14147 | """Helper class to quickly write a loop over all standard input files.
Typical use is:
import fileinput
for line in fileinput.input():
process(line)
This iterates over the lines of all files listed in sys.argv[1:],
defaulting to sys.stdin if the list is empty. If a filename is '-' it
is also replace... | mit |
Netflix-Skunkworks/napalm-base | test/unit/TestHelpers.py | 1 | 15536 | """
Test base helpers.
"""
# Python3 support
from __future__ import print_function
from __future__ import unicode_literals
# Python std lib
import os
import sys
import unittest
# third party libs
try:
import jinja2 # noqa
HAS_JINJA = True
except ImportError:
HAS_JINJA = False
try:
import jtextfsm a... | apache-2.0 |
Immortalin/python-for-android | python3-alpha/extra_modules/atom/auth.py | 297 | 1199 | #!/usr/bin/env python
#
# Copyright (C) 2009 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... | apache-2.0 |
lasigeBioTM/ssm | ssmpy/metrics.py | 1 | 13717 | from ssmpy.data import *
from ssmpy.calculations import *
import multiprocessing as mp
def get_all_commom_ancestors(all_ancestors, it1, it2):
"""
Get all common ancestors for it1 and it2
:param all_ancestors: pandas DataFrame of all ancestors
:param it1: entity 1 (id)
:param it2: entity 2 (id)
... | apache-2.0 |
bjornlevi/5thpower | kosningakerfi/env/lib/python3.6/site-packages/pip/operations/check.py | 342 | 1590 |
def check_requirements(installed_dists):
missing_reqs_dict = {}
incompatible_reqs_dict = {}
for dist in installed_dists:
key = '%s==%s' % (dist.project_name, dist.version)
missing_reqs = list(get_missing_reqs(dist, installed_dists))
if missing_reqs:
missing_reqs_dict[... | mit |
nhr/openshift-ansible | roles/lib_openshift/src/class/oc_service.py | 19 | 5663 | # pylint: skip-file
# flake8: noqa
# pylint: disable=too-many-instance-attributes
class OCService(OpenShiftCLI):
''' Class to wrap the oc command line tools '''
kind = 'service'
# pylint allows 5
# pylint: disable=too-many-arguments
def __init__(self,
sname,
name... | apache-2.0 |
XXMrHyde/android_external_chromium_org | native_client_sdk/src/build_tools/build_app.py | 23 | 5260 | #!/usr/bin/env python
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import optparse
import os
import re
import sys
if sys.version_info < (2, 6, 0):
sys.stderr.write("python 2.6 or late... | bsd-3-clause |
saquiba2/numpytry | numpy/distutils/tests/test_npy_pkg_config.py | 64 | 3146 | from __future__ import division, absolute_import, print_function
import os
from tempfile import mkstemp
from numpy.distutils.npy_pkg_config import read_config, parse_flags
from numpy.testing import TestCase, run_module_suite
simple = """\
[meta]
Name = foo
Description = foo lib
Version = 0.1
[default]
cflags = -I/u... | bsd-3-clause |
vanCopper/tgerm | code/CPU.py | 1 | 1134 | #!/usr/bin/env Python
from __future__ import print_function
from collections import OrderedDict
import pprint
def CPUinfo():
''' Return the information in /proc/CPUinfo
as a dictionary in the following format:
CPU_info['proc0']={...}
CPU_info['proc1']={...}
'''
CPUinfo=OrderedDict()
procin... | mit |
nozuono/calibre-webserver | src/calibre/utils/opensearch/__init__.py | 24 | 1335 | '''
Based on the OpenSearch Python module by Ed Summers <ehs@pobox.com> from
https://github.com/edsu/opensearch .
This module is heavily modified and does not implement all the features from
the original. The ability for the the module to perform a search and retrieve
search results has been removed. The original mod... | gpl-3.0 |
sugiany/blender_mmd_tools | mmd_tools/panels/prop_material.py | 1 | 4215 | # -*- coding: utf-8 -*-
from bpy.types import Panel
class MMDMaterialPanel(Panel):
bl_idname = 'MATERIAL_PT_mmd_tools_material'
bl_label = 'MMD Material'
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = 'material'
@classmethod
def poll(cls, context):
material = ... | mit |
Oslandia/vizitown_plugin | twisted/conch/ssh/forwarding.py | 59 | 5649 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
#
"""
This module contains the implementation of the TCP forwarding, which allows
clients and servers to forward arbitrary TCP data across the connection.
Maintainer: Paul Swartz
"""
import struct
from twisted.internet import protocol, reacto... | gpl-2.0 |
zencore-dobetter/zencore-utils | src/zencore/utils/design.py | 1 | 1776 | """
设计模式相关。
"""
import inspect
class Callable(object):
"""
将对象或函数转化成可回调对象。
如果输入参数是可回调对象(或函数),则调用后,返回回调结果。
如果输入参数是不可回调对象,则调用后,返回对象本身。
"""
def __init__(self, callback, signature=None, doc=None):
self.__signature__ = self.signature = signature or (callable(callback) and str(inspec... | mit |
gdelpierre/ansible-modules-core | cloud/openstack/_nova_keypair.py | 41 | 5486 | #!/usr/bin/python
#coding: utf-8 -*-
# (c) 2013, Benno Joy <benno@ansible.com>
# (c) 2013, John Dewey <john@dewey.ws>
#
# This module 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 Li... | gpl-3.0 |
WANdisco/amplab-hive | testutils/ptest/Buffer.py | 18 | 1331 | # 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 use ... | apache-2.0 |
afeyrer/Final-Project | ggame/pygamedeps.py | 228 | 12266 | def module_exists(module_name):
try:
__import__(module_name)
except ImportError:
return False
else:
return True
# PYTHON 3 and PYGAME DEPENDENCIES
if module_exists('pygame'):
import pygame
class _body(object):
def __init__(self):
self.events = {}
def appe... | mit |
samuelhavron/heroku-buildpack-python | Python-3.4.3/Lib/test/test_charmapcodec.py | 175 | 1794 | """ Python character mapping codec test
This uses the test codec in testcodec.py and thus also tests the
encodings package lookup scheme.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright 2000 Guido van Rossum.
"""#"
import test.support, unittest
import codecs
# Register a search function which know... | mit |
Dabz/dstat | plugins/dstat_condor_queue.py | 4 | 4331 | ### Author: <krikava$gmail,com>
### Condor queue plugin
### Display information about jobs in queue (using condor_q(1))
###
### WARNING: with many jobs in the queue, the condor_q might take quite
### some time to execute and use quite a bit of resources. Consider
### using a longer delay.
import os
import re
global ... | gpl-2.0 |
M1kol4j/helita | helita/utils/congrid.py | 2 | 4123 | import numpy as np
import scipy.interpolate
import scipy.ndimage
def congrid(a, newdims, method='linear', centre=False, minusone=False):
'''Arbitrary resampling of source array to new dimension sizes.
Currently only supports maintaining the same number of dimensions.
To use 1-D arrays, first promote them ... | bsd-3-clause |
polimediaupv/edx-platform | common/lib/xmodule/xmodule/annotator_token.py | 211 | 1542 | """
This file contains a function used to retrieve the token for the annotation backend
without having to create a view, but just returning a string instead.
It can be called from other files by using the following:
from xmodule.annotator_token import retrieve_token
"""
import datetime
from firebase_token_generator im... | agpl-3.0 |
sephii/django | django/contrib/gis/db/backends/spatialite/base.py | 5 | 4572 | import sys
from ctypes.util import find_library
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.backends.sqlite3.base import (Database,
DatabaseWrapper as SQLiteDatabaseWrapper,
DatabaseFeatures as SQLiteDatabaseFeatures, SQLiteCursorWrapper)
from django.... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.