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 |
|---|---|---|---|---|---|
wisperwinter/OpenCC | deps/gtest-1.7.0/test/gtest_color_test.py | 3259 | 4911 | #!/usr/bin/env python
#
# Copyright 2008, 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... | apache-2.0 |
erdincay/youtube-dl | youtube_dl/extractor/bbc.py | 52 | 32832 | # coding: utf-8
from __future__ import unicode_literals
import re
import xml.etree.ElementTree
from .common import InfoExtractor
from ..utils import (
ExtractorError,
float_or_none,
int_or_none,
parse_duration,
parse_iso8601,
)
from ..compat import compat_HTTPError
class BBCCoUkIE(InfoExtractor)... | unlicense |
Microvellum/Fluid-Designer | win64-vc/2.78/Python/bin/2.78/scripts/addons_contrib/space_view3d_ruler_chromoly/va/math.py | 4 | 5702 | # coding: utf-8
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 p... | gpl-3.0 |
undefinedv/Jingubang | sqlmap/plugins/dbms/postgresql/fingerprint.py | 2 | 6416 | #!/usr/bin/env python
"""
Copyright (c) 2006-2016 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
from lib.core.common import Backend
from lib.core.common import Format
from lib.core.data import conf
from lib.core.data import kb
from lib.core.data import logger
from lib.co... | gpl-3.0 |
yesudeep/themoneybees | app/jinja2/tests/test_tests.py | 6 | 2295 | # -*- coding: utf-8 -*-
"""
unit test for the test functions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2009 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from jinja2 import Environment, Markup
env = Environment()
DEFINED = '''{{ missing is defined }}|{{ true is defined }}... | mit |
OpenNetworking/gcoin-community | qa/rpc-tests/test_framework/bignum.py | 230 | 1995 | #
#
# bignum.py
#
# This file is copied from python-bitcoinlib.
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
"""Bignum routines"""
from __future__ import absolute_import, division, print_function, unicode_literals
imp... | apache-2.0 |
def-/commandergenius | project/jni/python/src/Lib/distutils/command/bdist_rpm.py | 53 | 20189 | """distutils.command.bdist_rpm
Implements the Distutils 'bdist_rpm' command (create RPM source and binary
distributions)."""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id: bdist_rpm.py 61000 2008-02-23 17:40:11Z christian.heimes $"
import sys, os, string
from types import *
from distu... | lgpl-2.1 |
cr0wbar/fishnet | SettingsDialogUi.py | 1 | 3651 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'Settings.ui'
#
# Created: Sun Oct 26 18:16:48 2014
# by: PyQt5 UI code generator 5.3.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtWidgets
class Ui_SettingsDialog(object):
def setupUi(self,... | gpl-3.0 |
zackslash/scrapy | scrapy/utils/signal.py | 133 | 2969 | """Helper functions for working with signals"""
import logging
from twisted.internet.defer import maybeDeferred, DeferredList, Deferred
from twisted.python.failure import Failure
from pydispatch.dispatcher import Any, Anonymous, liveReceivers, \
getAllReceivers, disconnect
from pydispatch.robustapply import robu... | bsd-3-clause |
icarito/sugar-git-activity | console/interactiveconsole.py | 1 | 10357 | #!/usr/bin/env python
# GTK Interactive Console
# (C) 2003, Jon Anderson
# See www.python.org/2.2/license.html for
# license details.
#
import pygtk
pygtk.require('2.0')
import gtk
import gtk.gdk
import code
import sys
import pango
import __builtin__
import __main__
from sugar.graphics import style
banner = """... | gpl-3.0 |
ehabkost/avocado-vt | selftests/unit/test_nfs.py | 8 | 4071 | #!/usr/bin/python
import unittest
import os
import sys
from avocado.utils import path
from avocado.utils import process
# simple magic for using scripts within a source tree
basedir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if os.path.isdir(os.path.join(basedir, 'virttest')):
sys.path.append(b... | gpl-2.0 |
EricMuller/mywebmarks-backend | requirements/twisted/Twisted-17.1.0/src/twisted/test/test_usage.py | 13 | 23645 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.python.usage}, a command line option parsing library.
"""
from __future__ import division, absolute_import
from twisted.trial import unittest
from twisted.python import usage
class WellBehaved(usage.Options):
optPar... | mit |
xodus7/tensorflow | tensorflow/python/training/checkpointable/base_test.py | 18 | 2609 | # Copyright 2017 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 |
SunBuild/openoutreach-azure-webapp | profiles/openoutreach/libraries/openlayers/build/build.py | 86 | 6674 | #!/usr/bin/env python
import sys
import os
sys.path.append("../tools")
import mergejs
import optparse
def build(config_file = None, output_file = None, options = None):
have_compressor = []
try:
import jsmin
have_compressor.append("jsmin")
except ImportError:
print "No jsmin"
t... | gpl-2.0 |
niknow/scipy | scipy/stats/kde.py | 17 | 17717 | #-------------------------------------------------------------------------------
#
# Define classes for (uni/multi)-variate kernel density estimation.
#
# Currently, only Gaussian kernels are implemented.
#
# Written by: Robert Kern
#
# Date: 2004-08-09
#
# Modified: 2005-02-10 by Robert Kern.
# Contr... | bsd-3-clause |
fengbaicanhe/intellij-community | plugins/hg4idea/testData/bin/hgext/convert/monotone.py | 94 | 12947 | # monotone.py - monotone support for the convert extension
#
# Copyright 2008, 2009 Mikkel Fahnoe Jorgensen <mikkel@dvide.com> and
# others
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import os, re
from mercurial import util... | apache-2.0 |
vstoykov/django-cms | cms/tests/management.py | 6 | 19612 | # -*- coding: utf-8 -*-
from __future__ import with_statement
import uuid
from django.contrib.sites.models import Site
from django.core import management
from django.core.management import CommandError
from django.utils.six.moves import StringIO
from cms.api import create_page, add_plugin, create_title
from cms.manag... | bsd-3-clause |
seijim/cloud-robotics-azure-platform-v1-sdk | CloudRoboticsApi/ClientCode_Pepper/HeadWaters/PepperCode2/lib/cloudrobotics/message.py | 4 | 2665 | # -*- coding: utf-8 -*-
#
# Cloud Robotics FX メッセージ
#
# @author: Hiroki Wakabayashi <hiroki.wakabayashi@jbs.com>
# @version: 0.0.1
import json
import datetime
ROUTING_TYPE_D2D = 'D2D';
ROUTING_TYPE_LOG = 'LOG';
ROUTING_TYPE_CALL = 'CALL';
API_APP_ID = 'SbrApiServices';
class CRFXMessage(object):
def __init__(se... | mit |
sclabs/sitestatus-nonrel | django/db/models/deletion.py | 79 | 11027 | from operator import attrgetter
from django.db import connections, transaction, IntegrityError
from django.db.models import signals, sql
from django.db.models.sql.constants import GET_ITERATOR_CHUNK_SIZE
from django.utils.datastructures import SortedDict
from django.utils.functional import wraps
class ProtectedError... | bsd-3-clause |
adlnet-archive/edx-platform | lms/djangoapps/shoppingcart/migrations/0002_auto__add_field_paidcourseregistration_mode.py | 182 | 8687 | # -*- 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 'PaidCourseRegistration.mode'
db.add_column('shoppingcart_paidcourseregistration', 'mode',
... | agpl-3.0 |
cmunk/protwis | residue/views.py | 1 | 38438 | from django.conf import settings
from django.core.cache import cache
from django.db.models import Count, F, Q
from django.shortcuts import render
from django.views.generic import TemplateView
from common.views import AbsTargetSelection
from common.definitions import FULL_AMINO_ACIDS, STRUCTURAL_RULES, STRUCTURAL_SWI... | apache-2.0 |
Zerknechterer/pyload | module/lib/simplejson/scanner.py | 674 | 2560 | """JSON token scanner
"""
import re
def _import_c_make_scanner():
try:
from simplejson._speedups import make_scanner
return make_scanner
except ImportError:
return None
c_make_scanner = _import_c_make_scanner()
__all__ = ['make_scanner']
NUMBER_RE = re.compile(
r'(-?(?:0|[1-9]\d*))... | gpl-3.0 |
opencloudinfra/orchestrator | venv/Lib/site-packages/django/db/backends/sqlite3/features.py | 194 | 2656 | from __future__ import unicode_literals
from django.db import utils
from django.db.backends.base.features import BaseDatabaseFeatures
from django.utils import six
from django.utils.functional import cached_property
from .base import Database
try:
import pytz
except ImportError:
pytz = None
class DatabaseFe... | gpl-3.0 |
puzan/ansible | lib/ansible/modules/windows/win_regedit.py | 25 | 4763 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Adam Keech <akeech@chathamfinancial.com>, Josh Ludwig <jludwig@chathamfinancial.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Fr... | gpl-3.0 |
gurneyalex/OpenUpgrade | addons/l10n_ve/__init__.py | 975 | 1058 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
#... | agpl-3.0 |
swprojects/PyRoboToolTimer | wxsw/dialogs/filedialog.py | 2 | 2182 | import wx
class CustomFileDialog(wx.FileDialog):
# class CustomSpinCtrl(wx.Window):
"""
A custom class that replicates some of the functionalities of wx.SpinCtrl
"""
def __init__(self,
parent,
valueStr=0,
message=wx.FileSelectorPromptStr):
... | gpl-3.0 |
rfguri/vimfiles | bundle/ycm/third_party/ycmd/third_party/JediHTTP/vendor/waitress/waitress/tests/test_server.py | 31 | 10201 | import errno
import socket
import unittest
class TestWSGIServer(unittest.TestCase):
def _makeOne(self, application, host='127.0.0.1', port=0,
_dispatcher=None, adj=None, map=None, _start=True,
_sock=None, _server=None):
from waitress.server import create_server
re... | mit |
ktan2020/legacy-automation | win/Lib/test/test_sha.py | 13 | 1759 | # Testing sha module (NIST's Secure Hash Algorithm)
# use the three examples from Federal Information Processing Standards
# Publication 180-1, Secure Hash Standard, 1995 April 17
# http://www.itl.nist.gov/div897/pubs/fip180-1.htm
import warnings
warnings.filterwarnings("ignore", "the sha module is deprecated... | mit |
40423234/2017springcd_hw | plugin/summary/summary.py | 317 | 2852 | """
Summary
-------
This plugin allows easy, variable length summaries directly embedded into the
body of your articles.
"""
from __future__ import unicode_literals
from pelican import signals
from pelican.generators import ArticlesGenerator, StaticGenerator, PagesGenerator
def initialized(pelican):
from pelican... | agpl-3.0 |
henrytao-me/openerp.positionq | openerp/addons/l10n_be_invoice_bba/invoice.py | 43 | 12622 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# i... | agpl-3.0 |
phillipbonhomme/cmake.nvim | rplugin/python3/cmake/__init__.py | 1 | 2610 | import neovim
import json
from ..rtags import rtags
@neovim.plugin
class CMakeRTagsProject(object):
def __init__(self, vim):
self.vim = vim
if self.vim.vars.get("loaded_fzf") == 1:
self.selectionUI = "fzf"
else:
self.selectionUI = "location-list"
self.plugin... | unlicense |
amimof/ansible-websphere | library/ibmim.py | 1 | 11683 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Amir Mofasser <amir.mofasser@gmail.com> (@amimof)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
... | mit |
spadae22/odoo | addons/sale_journal/__init__.py | 443 | 1067 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
kzlin129/practice-typing | lib/python2.7/site-packages/pip/index.py | 343 | 40403 | """Routines related to PyPI, indexes"""
import sys
import os
import re
import mimetypes
import posixpath
from pip.log import logger
from pip.util import Inf, normalize_name, splitext, is_prerelease
from pip.exceptions import (DistributionNotFound, BestVersionAlreadyInstalled,
InstallationE... | apache-2.0 |
SunyataZero/buddhist-well-being-pyqt5 | bwb/window/date.py | 1 | 1841 | from PyQt5 import QtWidgets
from PyQt5 import QtCore
# from PyQt5 import QtGui
import sys
import time
class DateTimeDialog(QtWidgets.QDialog):
"""
Inspiration: Answer by lou here:
https://stackoverflow.com/questions/18196799/how-can-i-show-a-pyqt-modal-dialog-and-get-data-out-of-its-controls-once-its-clo
... | gpl-3.0 |
alphapapa/youtube-dl | youtube_dl/extractor/theplatform.py | 54 | 11715 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
import time
import hmac
import binascii
import hashlib
from .common import InfoExtractor
from ..compat import (
compat_parse_qs,
compat_urllib_parse_urlparse,
)
from ..utils import (
determine_ext,
ExtractorError,
xpath_wit... | unlicense |
andreatosatto90/NFD | .waf-tools/sphinx_build.py | 83 | 2681 | #!/usr/bin/env python
# encoding: utf-8
# inspired by code by Hans-Martin von Gaudecker, 2012
import os
from waflib import Node, Task, TaskGen, Errors, Logs, Build, Utils
class sphinx_build(Task.Task):
color = 'BLUE'
run_str = '${SPHINX_BUILD} -D ${VERSION} -D ${RELEASE} -q -b ${BUILDERNAME} -d ${DOCTREEDIR}... | gpl-3.0 |
alvin319/CarnotKE | jyhton/lib-python/2.7/plat-irix6/GET.py | 132 | 1025 | # Symbols from <gl/get.h>
from warnings import warnpy3k
warnpy3k("the GET module has been removed in Python 3.0", stacklevel=2)
del warnpy3k
BCKBUFFER = 0x1
FRNTBUFFER = 0x2
DRAWZBUFFER = 0x4
DMRGB = 0
DMSINGLE = 1
DMDOUBLE = 2
DMRGBDOUBLE = 5
HZ30 = 0
HZ60 = 1
NTSC = 2
HDTV = 3
VGA = 4
IRIS3K = 5
PR60 = 6
PAL = 9
HZ3... | apache-2.0 |
grevutiu-gabriel/sympy | sympy/matrices/expressions/blockmatrix.py | 66 | 14018 | from __future__ import print_function, division
from sympy import ask, Q
from sympy.core import Basic, Add, sympify
from sympy.core.compatibility import range
from sympy.strategies import typed, exhaust, condition, do_one, unpack
from sympy.strategies.traverse import bottom_up
from sympy.utilities import sift
from sy... | bsd-3-clause |
jmcarp/django | tests/template_tests/filter_tests/test_linebreaksbr.py | 331 | 1742 | from django.template.defaultfilters import linebreaksbr
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class LinebreaksbrTests(SimpleTestCase):
"""
The contents in "linebreaksbr" are escaped according to the current
autoescape setting.
"... | bsd-3-clause |
hachr/node-gyp | gyp/pylib/gyp/mac_tool.py | 377 | 19309 | #!/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.
"""Utility functions to perform Xcode-style build steps.
These functions are executed via gyp-mac-tool when using the Makefile generator.
""... | mit |
ysh329/Titanic-Machine-Learning-from-Disaster | Titanic/class_create_model_of_bayes.py | 1 | 6128 | # -*- coding: utf-8 -*-
# !/usr/bin/python
################################### PART0 DESCRIPTION #################################
# Filename: class_create_model_of_bayes.py
# Description:
#
# Author: Shuai Yuan
# E-mail: ysh329@sina.com
# Create: 2015-12-21 21:04:53
# Last:
__author__ = 'yuens'
####################... | mit |
DuraCopter/ardupilot | Tools/ardupilotwaf/ap_library.py | 21 | 6948 | # Copyright (C) 2016 Intel Corporation. All rights reserved.
#
# This file 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.
#
# This fi... | gpl-3.0 |
manassolanki/frappe | frappe/core/doctype/feedback_trigger/feedback_trigger.py | 11 | 7279 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import json
import frappe
from frappe import _
from frappe.utils import get_url
from frappe.model.document import Document
from frappe.utils.jinja... | mit |
ctu-osgeorel/subdayprecip-design | openlayers2/proj4js/tools/mergejs.py | 91 | 8240 | #!/usr/bin/env python
#
# Merge multiple JavaScript source code files into one.
#
# Usage:
# This script requires source files to have dependencies specified in them.
#
# Dependencies are specified with a comment of the form:
#
# // @requires <file path>
#
# e.g.
#
# // @requires Geo/DataSource.js
... | gpl-2.0 |
weblabdeusto/weblabdeusto | server/src/experiments/romie/romie_blocks.py | 3 | 3232 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005 onwards University of Deusto
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# This software consists of contributions made by many individuals,
# list... | bsd-2-clause |
joxeankoret/diaphora | pygments/util.py | 26 | 11789 | # -*- coding: utf-8 -*-
"""
pygments.util
~~~~~~~~~~~~~
Utility functions.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import sys
split_path_re = re.compile(r'[/\\ ]')
doctype_lookup_re = re.compile(r'''(?smx)
(<\?... | agpl-3.0 |
kaixinjxq/wpt-tools | lint/lint.py | 159 | 9915 | import os
import subprocess
import re
import sys
import fnmatch
from collections import defaultdict
from .. import localpaths
from manifest.sourcefile import SourceFile
here = os.path.abspath(os.path.split(__file__)[0])
repo_root = localpaths.repo_root
def git(command, *args):
args = list(args)
proc_kwargs... | bsd-3-clause |
NaturalGIS/QGIS | python/plugins/processing/modeler/EditModelAction.py | 10 | 2069 | # -*- coding: utf-8 -*-
"""
***************************************************************************
EditModelAction.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***********************... | gpl-2.0 |
iamutkarshtiwari/Browse-fiddleFeature | browser.py | 1 | 27765 | # Copyright (C) 2006, Red Hat, Inc.
# Copyright (C) 2007, One Laptop Per Child
# Copyright (C) 2009, Tomeu Vizoso, Simon Schampijer
#
# 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 versi... | gpl-2.0 |
wdzhou/mantid | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANS/SANSCreateAdjustmentWorkspaces.py | 2 | 13020 | # pylint: disable=invalid-name
""" SANSCreateAdjustmentWorkspaces algorithm creates workspaces for pixel adjustment
, wavelength adjustment and pixel-and-wavelength adjustment workspaces.
"""
from __future__ import (absolute_import, division, print_function)
from mantid.kernel import (Direction, PropertyManagerPr... | gpl-3.0 |
AsimmHirani/ISpyPi | tensorflow/contrib/tensorflow-master/tensorflow/contrib/rnn/python/ops/core_rnn_cell_impl.py | 6 | 30329 | # 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 |
amiguez/youtube-dl | youtube_dl/extractor/naver.py | 91 | 3756 | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urlparse,
)
from ..utils import (
ExtractorError,
clean_html,
)
class NaverIE(InfoExtractor):
_VALID_URL = r'https?://(?:m\.)?tvcast\.naver\.co... | unlicense |
mgit-at/ansible | lib/ansible/modules/network/aos/_aos_template.py | 27 | 8372 | #!/usr/bin/python
#
# (c) 2017 Apstra Inc, <community@apstra.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opt... | gpl-3.0 |
dydek/django | tests/utils_tests/test_termcolors.py | 337 | 6461 | import unittest
from django.utils.termcolors import (
DARK_PALETTE, DEFAULT_PALETTE, LIGHT_PALETTE, NOCOLOR_PALETTE, PALETTES,
colorize, parse_color_setting,
)
class TermColorTests(unittest.TestCase):
def test_empty_string(self):
self.assertEqual(parse_color_setting(''), PALETTES[DEFAULT_PALETTE... | bsd-3-clause |
gperciva/artifastring | research/make-constants/cutoff.py | 1 | 4535 | #!/usr/bin/env python
CUTOFF_DB_FINAL_AUDIO = 10
#STRINGS = [
# (0,0), (0,1), (0,2), (0,3), (0,4),
# (1,0), (1,1),
# (2,0), (2,1), (2,2), (2,3)
# ]
INST_FORCES = [
[1.5,1.0,1.0,0.5],
[1.75,1.0,1.0,0.5],
[2.0,0.9,0.8,0.6],
]
import sys
sys.path.append('../../build/swig')
sys.path.append('../../build/.lib... | gpl-3.0 |
ovnicraft/odoo | addons/edi/models/edi.py | 277 | 31944 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011-2014 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
tschneidereit/servo | tests/wpt/css-tests/css21_dev/html4/support/fonts/makegsubfonts.py | 820 | 14309 |
import os
import textwrap
from xml.etree import ElementTree
from fontTools.ttLib import TTFont, newTable
from fontTools.misc.psCharStrings import T2CharString
from fontTools.ttLib.tables.otTables import GSUB,\
ScriptList, ScriptRecord, Script, DefaultLangSys,\
FeatureList, FeatureRecord, Feature,\
LookupLi... | mpl-2.0 |
moylop260/odoo-dev | addons/mail/tests/test_message_read.py | 44 | 14606 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY 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 |
leoliujie/odoo | addons/auth_signup/controllers/main.py | 144 | 6049 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
iheitlager/django-rest-framework | rest_framework/utils/model_meta.py | 71 | 5904 | """
Helper function for returning the field information that is associated
with a model class. This includes returning all the forward and reverse
relationships and their associated metadata.
Usage: `get_field_info(model)` returns a `FieldInfo` instance.
"""
import inspect
from collections import namedtuple
from djan... | bsd-2-clause |
ujenmr/ansible | lib/ansible/modules/network/f5/bigip_gtm_monitor_firepass.py | 14 | 25665 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
vlajos/bitcoin | qa/rpc-tests/getblocktemplate_proposals.py | 145 | 6328 | #!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from binasci... | mit |
eusi/MissionPlanerHM | Lib/site-packages/scipy/misc/tests/test_pilutil.py | 53 | 1878 | import os.path
import numpy as np
from numpy.testing import assert_, assert_equal, \
dec, decorate_methods, TestCase, run_module_suite
try:
import PIL.Image
except ImportError:
_have_PIL = False
else:
_have_PIL = True
import scipy.misc.pilutil as pilutil
# Function / method decorator for skip... | gpl-3.0 |
mlperf/training_results_v0.6 | Google/benchmarks/mask/implementations/tpu-v3-128-mask/mask_rcnn/train_low_level_runner.py | 3 | 13676 | # Copyright 2018 Google. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 |
Cl3MM/metagoofil | hachoir_parser/container/ogg.py | 95 | 11864 | #
# Ogg parser
# Author Julien Muchembled <jm AT jm10.no-ip.com>
# Created: 10 june 2006
#
from hachoir_parser import Parser
from hachoir_core.field import (Field, FieldSet, createOrphanField,
NullBits, Bit, Bits, Enum, Fragment, MissingField, ParserError,
UInt8, UInt16, UInt24, UInt32, UInt64,
RawBytes, S... | gpl-2.0 |
Lujeni/ansible | lib/ansible/module_utils/network/ios/facts/vlans/vlans.py | 12 | 5089 | #
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The ios vlans fact class
It is in this file the configuration is collected from the device
for a given resource, parsed, and the facts tree is populated
based on the conf... | gpl-3.0 |
aio-libs/frozenlist | docs/conf.py | 1 | 10850 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# frozenlist documentation build configuration file, created by
# sphinx-quickstart on Wed Mar 5 12:35:35 2014.
#
# 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
#... | apache-2.0 |
mickaelsilva/pythonscripts | AlleleCalling/CompareSameLocus.py | 1 | 5474 | import HTSeq
import argparse
import os.path
from CommonFastaFunctions import Create_Blastdb
from CommonFastaFunctions import LoadAlelleFasta
from CommonFastaFunctions import LoadAlellicProfileGeneric
from CommonFastaFunctions import WriteFasta
from CommonFastaFunctions import runBlast
from CommonFastaFunctions import r... | gpl-2.0 |
zrhans/python | exemplos/Examples.lnk/bokeh/plotting/server/elements.py | 2 | 1506 | # The plot server must be running
# Go to http://localhost:5006/bokeh to view this plot
import pandas as pd
from bokeh.plotting import *
from bokeh.sampledata import periodic_table
elements = periodic_table.elements
elements = elements[elements["atomic number"] <= 82]
elements = elements[~pd.isnull(elements["melting... | gpl-2.0 |
pratikmallya/hue | desktop/core/ext-py/django-extensions-1.5.0/django_extensions/management/commands/drop_test_database.py | 35 | 5691 | import logging
from optparse import make_option
from django.conf import settings
from django.core.management.base import CommandError, BaseCommand
from django.db.backends.creation import TEST_DATABASE_PREFIX
from six.moves import input, configparser
from django_extensions.management.utils import signalcommand
class... | apache-2.0 |
Spiderlover/Toontown | toontown/ai/DistributedAprilToonsMgrAI.py | 2 | 1360 | from direct.distributed.DistributedObjectAI import DistributedObjectAI
from otp.ai.MagicWordGlobal import *
from direct.task import Task
from toontown.toonbase.AprilToonsGlobals import *
class DistributedAprilToonsMgrAI(DistributedObjectAI):
def __init__(self, air):
DistributedObjectAI.__init__(self, air)
... | mit |
ehealthafrica-ci/kivy | kivy/uix/__init__.py | 5 | 1780 | '''
Widgets
=======
A widget is an element of a graphical user interface.
The `kivy.uix` module contains classes for creating and managing Widgets.
First read: :doc:`api-kivy.uix.widget`
- **UX widgets**: Classical user interface widgets, perfect and ready to be
assembled to create more complex widgets.
:doc:... | mit |
SlimRoms/android_external_chromium_org | tools/telemetry/telemetry/core/exceptions.py | 17 | 1919 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
class NativeBrowserCrashException(Exception):
def __init__(self, browser=None, msg=''):
super(NativeBrowserCrashException, self).__init__(msg)
sel... | bsd-3-clause |
juanyaw/python | cpython/Lib/test/test_shelve.py | 91 | 6270 | import unittest
import shelve
import glob
from test import support
from collections.abc import MutableMapping
from test.test_dbm import dbm_iterator
def L1(s):
return s.decode("latin-1")
class byteskeydict(MutableMapping):
"Mapping that supports bytes keys"
def __init__(self):
self.d = {}
de... | bsd-3-clause |
crisely09/horton | horton/grid/base.py | 1 | 6180 | # -*- coding: utf-8 -*-
# HORTON: Helpful Open-source Research TOol for N-fermion systems.
# Copyright (C) 2011-2016 The HORTON Development Team
#
# This file is part of HORTON.
#
# HORTON is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by th... | gpl-3.0 |
qizenguf/MLC-STT | src/arch/x86/isa/insts/general_purpose/data_transfer/move.py | 40 | 9122 | # Copyright (c) 2007-2008 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 imp... | bsd-3-clause |
TathagataChakraborti/resource-conflicts | PLANROB-2015/seq-sat-lama/Python-2.5.2/Demo/tkinter/guido/AttrDialog.py | 47 | 14340 |
# The options of a widget are described by the following attributes
# of the Pack and Widget dialogs:
#
# Dialog.current: {name: value}
# -- changes during Widget's lifetime
#
# Dialog.options: {name: (default, klass)}
# -- depends on widget class only
#
# Dialog.classes: {klass: (v0, v1, v2, ...) | 'boolean' | 'other... | mit |
carlmw/oscar-wager | django/templatetags/l10n.py | 247 | 1845 | from django.conf import settings
from django.template import Node
from django.template import TemplateSyntaxError, Library
from django.utils import formats
from django.utils.encoding import force_unicode
register = Library()
def localize(value):
"""
Forces a value to be rendered as a localized value,
reg... | bsd-3-clause |
fredericlepied/ansible | lib/ansible/module_utils/connection.py | 17 | 5354 | #
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete ... | gpl-3.0 |
TianpeiLuke/GPy | GPy/likelihoods/student_t.py | 4 | 12651 | # Copyright (c) 2012-2014 Ricardo Andrade, Alan Saul
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import numpy as np
from scipy import stats, special
import scipy as sp
import link_functions
from scipy import stats, integrate
from scipy.special import gammaln, gamma
from likelihood import Likelihood
fro... | bsd-3-clause |
rmariotti/py_cli_rpg | entity.py | 1 | 1482 | #!/usr/bin/env python3
class Entity:
def __init__(self, name = "nome", hp = 10, velocity = 10,
strength = 10, intelligence = 10, hand = None, items = [], lvl = 1 ):
from random import random
self.name = name
self.lvl = lvl
self.hp = hp
self.velocity = velocit... | gpl-3.0 |
di0spyr0s/pants | src/python/pants/backend/jvm/tasks/jvm_compile/scala/zinc_analysis_parser.py | 7 | 2169 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from zincutils.zinc_... | apache-2.0 |
bguillot/OpenUpgrade | addons/l10n_fr/wizard/fr_report_compute_resultant.py | 374 | 2312 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
#... | agpl-3.0 |
DNFcode/edx-platform | common/djangoapps/embargo/models.py | 48 | 3847 | """
Models for embargoing visits to certain courses by IP address.
WE'RE USING MIGRATIONS!
If you make changes to this model, be sure to create an appropriate migration
file and check it in at the same time as your model changes. To do that,
1. Go to the edx-platform dir
2. ./manage.py lms schemamigration embargo --... | agpl-3.0 |
beezee/GAE-Django-base-app | django/template/debug.py | 232 | 3797 | from django.conf import settings
from django.template.base import Lexer, Parser, tag_re, NodeList, VariableNode, TemplateSyntaxError
from django.utils.encoding import force_unicode
from django.utils.html import escape
from django.utils.safestring import SafeData, EscapeData
from django.utils.formats import localize
cl... | bsd-3-clause |
dr4ke616/pinky | pinky/core/manhole.py | 1 | 3337 |
# -*- coding: utf8 -*-
# Copyright (c) 2013 Dedsert Ltd.
# See LICENSE for more details
"""
.. module:: manhole
:platform: Unix, Windows
:synopsys: ManHole Administrative Python Shell
.. moduleauthor:: Adam Drakeford <adamdrakeford@gmail.com>
"""
import string
from rlcompleter import Completer
from twiste... | mit |
mhotwagner/abackend | abackend-env/lib/python3.5/site-packages/django/utils/timesince.py | 109 | 2521 | from __future__ import unicode_literals
import datetime
from django.utils.html import avoid_wrapping
from django.utils.timezone import is_aware, utc
from django.utils.translation import ugettext, ungettext_lazy
TIMESINCE_CHUNKS = (
(60 * 60 * 24 * 365, ungettext_lazy('%d year', '%d years')),
(60 * 60 * 24 * ... | mit |
mcuringa/py-tutor | pytutor/social/migrations/0001_initial.py | 1 | 5250 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('tutor', '0004_auto_20150314_0420'),
... | agpl-3.0 |
blueboxgroup/neutron | neutron/db/migration/alembic_migrations/versions/4dbe243cd84d_nsxv.py | 3 | 7947 | # Copyright 2015 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 |
mas2df/phonograph | utils.py | 1 | 1691 | import requests
import logging
import json
from py2neo import Node, Relationship
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
spotify_api_url = "https://api.spotify.com/v1/"
artists_endpoint = "artists/"
related_artists_endpoint = "/related-artists"
def getArtistJson(artist_id):
""... | mit |
sidartaoliveira/ansible | lib/ansible/plugins/action/iosxr_config.py | 79 | 4164 | #
# (c) 2017, Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is... | gpl-3.0 |
GISAElkartea/bidasoamedia | project/articles/migrations/0001_initial.py | 1 | 2400 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-22 21:52
from __future__ import unicode_literals
import autoslug.fields
from django.db import migrations, models
import django.utils.timezone
import markitup.fields
import sorl.thumbnail.fields
class Migration(migrations.Migration):
initial = True
... | agpl-3.0 |
sankhesh/VTK | Filters/Core/Testing/Python/dispPlot.py | 20 | 1768 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# this is a tcl version of plate vibration
ren1 = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren1)
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow... | bsd-3-clause |
mxOBS/deb-pkg_trusty_chromium-browser | third_party/webdriver/pylib/selenium/webdriver/remote/utils.py | 37 | 3643 | # Copyright 2008-2009 WebDriver committers
# Copyright 2008-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 requ... | bsd-3-clause |
ryanahall/django | django/contrib/auth/tokens.py | 103 | 2667 | from datetime import date
from django.conf import settings
from django.utils import six
from django.utils.crypto import constant_time_compare, salted_hmac
from django.utils.http import base36_to_int, int_to_base36
class PasswordResetTokenGenerator(object):
"""
Strategy object used to generate and check token... | bsd-3-clause |
t4ngo/dragonfly | dragonfly/actions/action_pause.py | 5 | 1898 | #
# This file is part of Dragonfly.
# (c) Copyright 2007, 2008 by Christo Butcher
# Licensed under the LGPL.
#
# Dragonfly is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3... | lgpl-3.0 |
calvinchengx/django-haystack | haystack/backends/whoosh_backend.py | 1 | 29514 | import logging
import os
import re
import shutil
import threading
import warnings
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.models.loading import get_model
from django.utils.datetime_safe import datetime
from django.utils.encoding import force_unicode
from h... | bsd-3-clause |
villeneuvelab/vlpp | vlpp/utils.py | 1 | 2522 | # -*- coding: utf-8 -*-
import os
import json
import shlex
import shutil
import subprocess
from jinja2 import Environment, FileSystemLoader
PKG_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
TPL_PATH = os.path.join(PKG_PATH, "templates")
def load_json(filename):
with open(filename, 'r') as... | mit |
elingg/tensorflow | tensorflow/python/saved_model/signature_def_utils_impl.py | 58 | 5229 | # 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... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.