repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
cernops/nova | nova/tests/unit/objects/test_monitor_metric.py | 11 | 3769 | # 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... | apache-2.0 |
tommy-u/chaco | examples/demo/logo.py | 3 | 3210 | """ LOGO overlay """
from __future__ import with_statement
from numpy import array, cos, invert, isnan, nan, pi, sin, vstack
from traits.api import Array, Enum, Float, Range
from traitsui.api import Group, Item, View
from enable.api import ColorTrait
from chaco.api import arg_find_runs, AbstractOverlay
class Turtle... | bsd-3-clause |
ericblau/ipf-xsede | ipf/glue2/sge.py | 1 | 26848 |
###############################################################################
# Copyright 2011-2014 The University of Texas at Austin #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #... | apache-2.0 |
carlgao/lenga | images/lenny64-peon/usr/share/fail2ban/server/action.py | 2 | 7669 | # This file is part of Fail2Ban.
#
# Fail2Ban 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.
#
# Fail2Ban is distributed in the hope t... | mit |
roshan/thrift | tutorial/py.tornado/PythonServer.py | 2 | 2986 | #!/usr/bin/env python
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "L... | apache-2.0 |
HyperloopTeam/FullOpenMDAO | lib/python2.7/site-packages/openmdao.util-0.13.0-py2.7.egg/openmdao/util/publickey.py | 1 | 18058 | """
Support for generation, use, and storage of public/private key pairs.
The :func:`pk_encrypt`, :func:`pk_decrypt`, :func:`pk_sign`, and
:func:`pk_verify` functions provide a thin interface over
:class:`Crypto.PublicKey.RSA` methods for easier use and to work around some
issues found with some keys read from ssh ``id... | gpl-2.0 |
lseyesl/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/checkout/scm/scm.py | 119 | 9007 | # Copyright (c) 2009, Google Inc. All rights reserved.
# Copyright (c) 2009 Apple 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 abov... | bsd-3-clause |
tkzeng/molecular-design-toolkit | moldesign/molecules/bonds.py | 1 | 3249 | # Copyright 2016 Autodesk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | apache-2.0 |
CCI-MOC/nova | nova/tests/unit/compute/test_rpcapi.py | 5 | 21500 | # 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
#
# Unless required by applicable law or agr... | apache-2.0 |
oliverhr/odoo | addons/account_bank_statement_extensions/wizard/cancel_statement_line.py | 381 | 1484 | # -*- 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
# it under ... | agpl-3.0 |
hrautila/go.opt | tests/py/testsocp.py | 1 | 1173 | #
# This is copied from CVXOPT examples and modified to be used as test reference
# for corresponding Go program.
#
from cvxopt import matrix, solvers
import helpers
def testsocp(opts):
c = matrix([-2., 1., 5.])
G = [matrix( [[12., 13., 12.],
[ 6., -3., -12.],
[-5.,... | lgpl-3.0 |
xanderdunn/ycmd | cpp/ycm/tests/gmock/gtest/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... | gpl-3.0 |
niklasf/syzygy-tables.info | syzygy_tables_info/model.py | 1 | 3448 | # This file is part of the syzygy-tables.info tablebase probing website.
# Copyright (C) 2015-2020 Niklas Fiekas <niklas.fiekas@backscattering.de>
#
# 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 Fo... | agpl-3.0 |
zishell/shadowsocks | tests/test_udp_src.py | 1009 | 2482 | #!/usr/bin/python
import socket
import socks
SERVER_IP = '127.0.0.1'
SERVER_PORT = 1081
if __name__ == '__main__':
# Test 1: same source port IPv4
sock_out = socks.socksocket(socket.AF_INET, socket.SOCK_DGRAM,
socket.SOL_UDP)
sock_out.set_proxy(socks.SOCKS5, SERVER_IP, S... | apache-2.0 |
tobley/wns | travis_pypi_setup.py | 1 | 3730 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Update encrypted deploy password in Travis config file
"""
from __future__ import print_function
import base64
import json
import os
from getpass import getpass
import yaml
from cryptography.hazmat.primitives.serialization import load_pem_public_key
from cryptography.h... | isc |
undertherain/vsmlib | vsmlib/corpus/corpus.py | 1 | 2196 | import numpy as np
import fnmatch
import os
import re
from vsmlib.misc.data import detect_archive_format_and_open
import logging
logger = logging.getLogger(__name__)
_default_tokenizer_patter = r"[\w\-']+|[.,!?…]"
class LineTokenizer:
def __init__(self, re_pattern=_default_tokenizer_patter):
self.re_to... | apache-2.0 |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/mando/tests/test_utils.py | 3 | 3578 | import unittest
from paramunittest import parametrized
from mando.utils import action_by_type, ensure_dashes, find_param_docs, split_doc
@parametrized(
dict(obj=True, result={'action': 'store_false'}),
dict(obj=False, result={'action': 'store_true'}),
dict(obj=[], result={'action': 'append'}),
dict(ob... | agpl-3.0 |
ukanga/SickRage | lib/backports/ssl_match_hostname/__init__.py | 134 | 3650 | """The match_hostname() function from Python 3.3.3, essential when using SSL."""
import re
__version__ = '3.4.0.2'
class CertificateError(ValueError):
pass
def _dnsname_match(dn, hostname, max_wildcards=1):
"""Matching according to RFC 6125, section 6.4.3
http://tools.ietf.org/html/rfc6125#section-6.4... | gpl-3.0 |
Bashar/django | django/contrib/gis/db/models/fields.py | 28 | 12553 | from django.db.models.fields import Field
from django.db.models.sql.expressions import SQLEvaluator
from django.utils.translation import ugettext_lazy as _
from django.contrib.gis import forms
from django.contrib.gis.db.models.constants import GIS_LOOKUPS
from django.contrib.gis.db.models.lookups import GISLookup
from ... | bsd-3-clause |
stjj89/iop | idapython/reentrant_int_scanner.py | 1 | 4386 | # Copyright (c) <2013-2014>, <Samuel J. Tan (samueltan@gmail.com)>
# 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
# no... | bsd-3-clause |
tensorflow/models | research/lstm_object_detection/metrics/coco_evaluation_all_frames.py | 2 | 5494 | # Copyright 2018 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 |
nexdatas/tools | test/NXSCreatePyEvalH5Cpp_test.py | 1 | 85203 | #!/usr/bin/env python
# This file is part of nexdatas - Tango Server for NeXus data writer
#
# Copyright (C) 2012-2018 DESY, Jan Kotanski <jkotan@mail.desy.de>
#
# nexdatas is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the ... | gpl-3.0 |
jensengroup/propka-3.1 | tests/test_streamio.py | 1 | 3842 | """Tests for PROPKA stream io"""
import logging
from pathlib import Path
from io import StringIO
import pytest
from propka.parameters import Parameters
from propka.molecular_container import MolecularContainer
from propka.input import read_parameter_file, read_molecule_file
from propka.lib import loadOptions
from .tes... | lgpl-2.1 |
twilsonco/CPGobbler | kf.py | 1 | 12472 | #!/usr/bin/env python
# kf.py - Implementation of a Python interface to read and write KF files.
# This is an implementation that uses the KF utilities to do the actual work,
# so you need a working ADF installation.
#
# Copyright (C) 2006-2008 by Scientific Computing and Modelling NV.
# For support, c... | gpl-3.0 |
jarn0ld/gnuradio | grc/python/Generator.py | 5 | 17769 | """
Copyright 2008-2011 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion 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 l... | gpl-3.0 |
avastms/shadowsocks | tests/coverage_server.py | 1072 | 1655 | #!/usr/bin/env python
#
# Copyright 2015 clowwindy
#
# 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 |
luiscarlosgph/nas | env/lib/python2.7/site-packages/django/contrib/auth/management/commands/changepassword.py | 58 | 2060 | from __future__ import unicode_literals
import getpass
from optparse import make_option
from django.contrib.auth import get_user_model
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS
from django.utils.encoding import force_str
class Command(BaseCommand):
... | mit |
ammelto/Cappuccino | Cappuccino/src/cappuccino.py | 2 | 2288 | import sys
import subprocess
arg = sys.argv
if len(arg) != 3:
sys.exit('Usage: cappuccino <input> <output>')
inf = open(arg[1], 'r')
tempOut = "Espresso" + arg[1]
outf = open(tempOut, 'w')
i = 0
o = 0
ilb = []
ob = []
sop = []
dontCare = []
deSop = []
deDontCare = []
for l in inf:
line = l.partition(' ')
... | mit |
WojciechFocus/MMVD | tests/test_map_utilities.py | 1 | 1310 | # coding: utf-8
import pytest
from mmvdApp.utils import products, distances
from mmvdApp.shortest_path import a_star, neighbors
@pytest.mark.utils
@pytest.mark.map
def test_drop_zone(drop_zone1):
"""
Test if correct coordinates are returned for the drop zone in
warehouse_map1.
:param fixture drop_zo... | mit |
rayluo/boto | boto/fps/response.py | 153 | 7866 | # Copyright (c) 2012 Andy Davidoff http://www.disruptek.com/
# Copyright (c) 2010 Jason R. Coombs http://www.jaraco.com/
# Copyright (c) 2008 Chris Moyer http://coredumped.org/
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy ... | mit |
2014cdbg9/2014cdbg9 | wsgi/programs/cdbg1/__init__.py | 5 | 16251 | import cherrypy
# 這是 CDBG1 類別的定義
class CDBG1(object):
# 各組利用 index 引導隨後的程式執行
@cherrypy.expose
def index(self, *args, **kwargs):
outstring = '''
這是 2014CDB 協同專案下的 cdbg1 分組程式開發網頁, 以下為 W12 的任務執行內容.<br />
<!-- 這裡採用相對連結, 而非網址的絕對連結 (這一段為 html 註解) -->
<a href="cube1">cdbg1 正方體參數繪圖</a>(尺寸變數 a, b, c)<br /><... | gpl-2.0 |
tjyang/psp | 9.1addon/sbutils-1.3.1/src/sbutils-1.3.1/lib/classutil.py | 4 | 4026 | # Copyright (C) 2009 The Written Word, 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, or (at your option)
# any later version.
#
# This program is distributed in the ho... | gpl-2.0 |
xiaowenhuman/airflow | airflow/operators/mysql_to_hive.py | 31 | 4139 | from builtins import chr
from collections import OrderedDict
import unicodecsv as csv
import logging
from tempfile import NamedTemporaryFile
import MySQLdb
from airflow.hooks import HiveCliHook, MySqlHook
from airflow.models import BaseOperator
from airflow.utils import apply_defaults
class MySqlToHiveTransfer(BaseO... | apache-2.0 |
KohlsTechnology/ansible | lib/ansible/utils/module_docs_fragments/vultr.py | 38 | 1400 | # -*- coding: utf-8 -*-
# Copyright (c) 2017 René Moser <mail@renemoser.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
# Standard documentation fragment
DOCUMENTATION = '''
options:
api_key:
description:
- API key... | gpl-3.0 |
quentinsf/ansible | lib/ansible/plugins/lookup/sequence.py | 37 | 7347 | # (c) 2013, Jayson Vantuyl <jayson@aggressive.ly>
#
# 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 v... | gpl-3.0 |
ilc-opensource/io-js | utils/autogen/ply/lex.py | 482 | 40739 | # -----------------------------------------------------------------------------
# ply: lex.py
#
# Copyright (C) 2001-2011,
# David M. Beazley (Dabeaz LLC)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions ar... | bsd-3-clause |
ubc/edx-platform | scripts/hotfix.py | 154 | 1898 | #!/usr/bin/env python
"""
Script to generate alton and git commands for executing hotfixes
Commands for:
- cutting amis
- creating hotfix tag
The script should be run with the hotfix's git hash as a command-line argument.
i.e. `python scripts/hotfix.py <hotfix hash>`
"""
from __future__ import print_function
from ... | agpl-3.0 |
samedder/azure-cli | src/azure-cli-core/azure/cli/core/telemetry.py | 3 | 13612 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | mit |
hurricup/intellij-community | python/lib/Lib/site-packages/django/conf/locale/ml/formats.py | 341 | 1635 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'N j, Y'
TIME_FORMAT = 'P'
DATETIME_FORMAT = 'N j, Y, P'
YEAR_MONTH_FORMAT... | apache-2.0 |
ShineFan/odoo | addons/product/wizard/product_price.py | 380 | 2254 | # -*- 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 |
kawamon/hue | desktop/core/ext-py/Django-1.11.29/django/core/management/commands/diffsettings.py | 58 | 1956 | from django.core.management.base import BaseCommand
def module_to_dict(module, omittable=lambda k: k.startswith('_')):
"""Converts a module namespace to a Python dictionary."""
return {k: repr(v) for k, v in module.__dict__.items() if not omittable(k)}
class Command(BaseCommand):
help = """Displays diff... | apache-2.0 |
bjackman/lisa | libs/utils/perf_analysis.py | 3 | 6952 | # SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2015, ARM Limited and contributors.
#
# 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 |
benspaulding/django | django/contrib/gis/db/backends/postgis/operations.py | 13 | 25790 | import re
from decimal import Decimal
from django.conf import settings
from django.contrib.gis.db.backends.base import BaseSpatialOperations
from django.contrib.gis.db.backends.util import SpatialOperation, SpatialFunction
from django.contrib.gis.db.backends.postgis.adapter import PostGISAdapter
from django.contrib.gi... | bsd-3-clause |
joakim-hove/django | tests/model_options/models/tablespaces.py | 342 | 1853 | from django.db import models
# Since the test database doesn't have tablespaces, it's impossible for Django
# to create the tables for models where db_tablespace is set. To avoid this
# problem, we mark the models as unmanaged, and temporarily revert them to
# managed during each test. We also set them to use the sam... | bsd-3-clause |
Yubico/yubikey-manager | tests/device/conftest.py | 1 | 2960 | from ykman.device import connect_to_device, list_all_devices, read_info
from ykman.pcsc import list_devices
from yubikit.core import TRANSPORT
from yubikit.core.otp import OtpConnection
from yubikit.core.fido import FidoConnection
from yubikit.core.smartcard import SmartCardConnection
from yubikit.management import USB... | bsd-2-clause |
nyee/RMG-Java | databases/RMG_database/kinetics_libraries/Dooley/C1/remove_unused_species.py | 11 | 1403 | #!/usr/bin/env python
# encoding: utf-8
"""
remove_unused_species.py
Created by Richard West on 2011-03-10.
Copyright (c) 2011 MIT. All rights reserved.
"""
import sys
import os
import re
import fileinput
species = set()
for line in fileinput.input(('reactions.txt','pdepreactions.txt')):
if (line.find(' = ') == ... | mit |
jsilhan/rpg | rel-eng/travis/upload.py | 5 | 2772 | from copr.client import CoprClient
from operator import itemgetter
import sys
import time
import urllib2
import os
def build_project(project_name, copr_client):
found_project = False
result = copr_client.get_projects_list(sys.argv[2]).projects_list
for project in result:
if project.projectname == ... | gpl-2.0 |
Virako/authapi | authapi/captcha/tests.py | 1 | 8039 | import json
import os
from django.conf import settings
from django.contrib.auth.models import User
from django.test import TestCase
from django.test.utils import override_settings
from api import test_data
from api.models import ACL, AuthEvent
from api.tests import JClient
from authmethods.models import Code
from capt... | agpl-3.0 |
kakekfunky/ci-AdminLTE-HMVC | assets/ionicons/builder/generate.py | 357 | 9438 | from subprocess import call
import os
import json
BUILDER_PATH = os.path.dirname(os.path.abspath(__file__))
ROOT_PATH = os.path.join(BUILDER_PATH, '..')
FONTS_FOLDER_PATH = os.path.join(ROOT_PATH, 'fonts')
CSS_FOLDER_PATH = os.path.join(ROOT_PATH, 'css')
SCSS_FOLDER_PATH = os.path.join(ROOT_PATH, 'scss')
LESS_FOLDER_... | mit |
urandu/roboto | scripts/common_tests.py | 3 | 11855 | # coding=UTF-8
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | apache-2.0 |
Jaemu/haiku.py | lib/yaml/scanner.py | 434 | 52630 |
# Scanner produces tokens of the following types:
# STREAM-START
# STREAM-END
# DIRECTIVE(name, value)
# DOCUMENT-START
# DOCUMENT-END
# BLOCK-SEQUENCE-START
# BLOCK-MAPPING-START
# BLOCK-END
# FLOW-SEQUENCE-START
# FLOW-MAPPING-START
# FLOW-SEQUENCE-END
# FLOW-MAPPING-END
# BLOCK-ENTRY
# FLOW-ENTRY
# KEY
# VALUE
# AL... | apache-2.0 |
pilou-/ansible | lib/ansible/modules/files/template.py | 12 | 6773 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This is a virtual module that is entirely implemented as an action plugin and runs on the controller
from __future__ import absolute_import, ... | gpl-3.0 |
hjarmstrong/Odme-plusplus | 3rd/build/tools/build/v2/test/core_variables_in_actions.py | 45 | 1241 | #!/usr/bin/python
# Copyright 2012. Jurko Gospodnetic
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# Tests that variables in actions get expanded but double quote characters
# get treated as regular character... | mit |
johnshiver/meetme | meet-me/users/admin.py | 183 | 1048 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django import forms
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as AuthUserAdmin
from django.contrib.auth.forms import UserChangeForm, UserCreationForm
from .models import User
class MyUserChan... | bsd-3-clause |
cbclab/MDT | mdt/lib/components.py | 1 | 14160 | import logging
from importlib.machinery import SourceFileLoader
import inspect
import os
from collections import defaultdict
from contextlib import contextmanager
import mdt
import mot
from mdt.configuration import get_config_dir
from mdt.model_building.signal_noise_models import SignalNoiseModel
from mot.library_funct... | lgpl-3.0 |
vineodd/PIMSim | GEM5Simulation/gem5/src/arch/x86/isa/insts/x87/load_constants/load_logarithm.py | 70 | 2566 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# Copyright (c) 2013 Mark D. Hill and David A. Wood
# 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 int... | gpl-3.0 |
smallyear/linuxLearn | salt/salt/modules/bigip.py | 1 | 69568 | # -*- coding: utf-8 -*-
'''
An execution module which can manipulate an f5 bigip via iControl REST
:maturity: develop
:platform: f5_bigip_11.6
'''
# Import python libs
from __future__ import absolute_import
import json
import logging as logger
# Import third party libs
try:
import requests
i... | apache-2.0 |
hrashk/sympy | sympy/series/kauers.py | 5 | 1876 | from __future__ import print_function, division
from sympy import expand
from sympy import diff
from sympy import Sum
def finite_diff(expression, variable, increment=1):
"""
Takes as input a polynomial expression and the variable used to construct
it and returns the difference between function's value whe... | bsd-3-clause |
adamwg/volsched | sched/widgets.py | 1 | 3356 | from django.conf import settings
from django import newforms as forms
from datetime import datetime, time, date
from time import strptime
# DATETIMEWIDGET
calbtn = u"""
<script type="text/javascript">
Calendar.setup({
inputField : "%s",
ifFormat : "%s",
button ... | mit |
irkru/python-twitter | examples/shorten_url.py | 19 | 2060 | #!/usr/bin/env python
#
# Copyright 2007-2013 The Python-Twitter Developers
#
# 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 ... | apache-2.0 |
arrac/eluka | ext/libsvm/python/svm.py | 5 | 7768 | #!/usr/bin/env python
from ctypes import *
from ctypes.util import find_library
import sys
# For unix the prefix 'lib' is not considered.
if find_library('svm'):
libsvm = CDLL(find_library('svm'))
elif find_library('libsvm'):
libsvm = CDLL(find_library('libsvm'))
else:
if sys.platform == 'win32':
libsvm = CDLL('... | mit |
kclauw/Dueling_Network_Architectures | dqn/environment.py | 1 | 2430 | import gym
import random
import numpy as np
from .utils import rgb2gray, imresize
class Environment(object):
def __init__(self, config):
self.env = gym.make(config.env_name)
screen_width, screen_height, self.action_repeat, self.random_start = \
config.screen_width, config.screen_height, config.acti... | mit |
mmbtba/odoo | addons/lunch/wizard/lunch_validation.py | 440 | 1296 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2012 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | agpl-3.0 |
minhphung171093/GreenERP_V7 | openerp/addons/portal_project_issue/tests/__init__.py | 167 | 1124 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-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 |
clinton-hall/nzbToMedia | libs/common/bs4/diagnose.py | 2 | 7010 | """Diagnostic functions, mainly for use when doing tech support."""
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
__license__ = "MIT"
import cProfile
from io import StringIO
from html.parser import HTMLParser
import bs4
from bs4 import BeautifulSoup, __version__... | gpl-3.0 |
openai/baselines | baselines/common/mpi_running_mean_std.py | 1 | 3706 | try:
from mpi4py import MPI
except ImportError:
MPI = None
import tensorflow as tf, baselines.common.tf_util as U, numpy as np
class RunningMeanStd(object):
# https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Parallel_algorithm
def __init__(self, epsilon=1e-2, shape=()):
self.... | mit |
andy-c-jones/event-app-frontend | node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/node-gyp/gyp/tools/graphviz.py | 2679 | 2878 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Using the JSON dumped by the dump-dependency-json generator,
generate input suitable for graphviz to render a dependency graph of
targets... | mit |
hlin117/statsmodels | statsmodels/tsa/tests/results/savedrvs.py | 39 | 22934 | '''Generated Random Processes for tests
autogenerated by savervs.py
'''
import numpy as np
from numpy import array
class Holder(object):
pass
rvsdata = Holder()
rvsdata.comment = 'generated data, divide by 1000, see savervs'
rvsdata.xarma32 = array([-1271, -1222, -840, -169, -1016, -980, -1272, -926, ... | bsd-3-clause |
biswajitsahu/kuma | vendor/packages/translate/storage/html.py | 25 | 14600 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2004-2006,2008 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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 vers... | mpl-2.0 |
mwcraig/scipy_proceedings | publisher/tempita/_looper.py | 140 | 4161 | """
Helper for looping over sequences, particular in templates.
Often in a loop in a template it's handy to know what's next up,
previously up, if this is the first or last item in the sequence, etc.
These can be awkward to manage in a normal Python loop, but using the
looper you can get a better sense of the context.... | bsd-2-clause |
msurkovsky/kaira | gui/settingswindow.py | 10 | 25305 | #
# Copyright (C) 2013, 2014 Martin Surkovsky
#
# This file is part of Kaira.
#
# Kaira 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, version 3 of the License, or
# (at your option) any lat... | gpl-3.0 |
vadimtk/chrome4sdp | tools/telemetry/telemetry/value/list_of_string_values.py | 13 | 4199 | # Copyright 2014 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.
from telemetry import value as value_module
from telemetry.value import none_values
class ListOfStringValues(value_module.Value):
def __init__(self, page... | bsd-3-clause |
asidev/aybu-manager | aybu/manager/rest/__init__.py | 1 | 3955 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright 2010-2012 Asidev s.r.l.
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 b... | apache-2.0 |
edt-devel/rss2maildir | rss2maildir.py | 1 | 12421 | #!/usr/bin/env python3
"""This script downloads rss feeds and stores them in a maildir"""
# Copyright(C) 2015 Edgar Thier
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of t... | gpl-3.0 |
2014c2g14/2014c2 | w2/static/Brython2.0.0-20140209-164925/Lib/xml/dom/expatbuilder.py | 733 | 35733 | """Facility to use the Expat parser to load a minidom instance
from a string or file.
This avoids all the overhead of SAX and pulldom to gain performance.
"""
# Warning!
#
# This module is tightly bound to the implementation details of the
# minidom DOM and can't be used with other DOM implementations. This
# is due... | gpl-2.0 |
mrbox/django | tests/expressions_case/tests.py | 4 | 50271 | from __future__ import unicode_literals
import unittest
from datetime import date, datetime, time, timedelta
from decimal import Decimal
from operator import attrgetter, itemgetter
from uuid import UUID
from django.core.exceptions import FieldError
from django.db import connection, models
from django.db.models import... | bsd-3-clause |
hoogenm/compose | compose/config/sort_services.py | 7 | 2486 | from __future__ import absolute_import
from __future__ import unicode_literals
from compose.config.errors import DependencyError
def get_service_name_from_network_mode(network_mode):
return get_source_name_from_network_mode(network_mode, 'service')
def get_container_name_from_network_mode(network_mode):
re... | apache-2.0 |
lz1988/company-site | django/db/backends/mysql/introspection.py | 106 | 4528 | import re
from .base import FIELD_TYPE
from django.db.backends import BaseDatabaseIntrospection
foreign_key_re = re.compile(r"\sCONSTRAINT `[^`]*` FOREIGN KEY \(`([^`]*)`\) REFERENCES `([^`]*)` \(`([^`]*)`\)")
class DatabaseIntrospection(BaseDatabaseIntrospection):
data_types_reverse = {
FIELD_TYPE.BLOB... | bsd-3-clause |
justathoughtor2/atomicApe | cygwin/lib/python2.7/distutils/dir_util.py | 46 | 7868 | """distutils.dir_util
Utility functions for manipulating directories and directory trees."""
__revision__ = "$Id$"
import os
import errno
from distutils.errors import DistutilsFileError, DistutilsInternalError
from distutils import log
# cache for by mkpath() -- in addition to cheapening redundant calls,
# eliminat... | gpl-3.0 |
ucsd-ccbb/jupyter-genomics | src/microbiome/test/test_exec_bowtie.py | 1 | 19830 | """ Module to test exec_bowtie member methods.
This module contains unit tests for exec_bowtie.py.
"""
import os
import unittest
import shutil
from src import exec_bowtie
__author__ = "YiDing Fang"
__maintainer__ = "YiDing Fang"
__email__ = "yif017@eng.ucsd.edu"
__status__ = "prototype"
# input file contents. F... | mit |
markrawlingson/SickRage | tornado/test/concurrent_test.py | 122 | 13390 | #!/usr/bin/env python
#
# Copyright 2012 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | gpl-3.0 |
odubno/microblog | venv/lib/python2.7/site-packages/sqlalchemy/orm/relationships.py | 21 | 111121 | # orm/relationships.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Heuristics related to join conditions as used in
:func:`.relationship`.
Pro... | bsd-3-clause |
zhongdai/gensim | gensim/models/logentropy_model.py | 88 | 4239 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
import logging
import math
from gensim import interfaces, matutils, utils
logger = logging.getLogger('gensim.models.logentropy_model')
class LogEntropyModel(interfaces.TransformationABC):
... | gpl-3.0 |
willingc/oh-mainline | vendor/packages/docutils/docutils/utils/math/tex2unichar.py | 120 | 35109 | # -*- coding: utf-8 -*-
# LaTeX math to Unicode symbols translation dictionaries.
# Generated with ``write_tex2unichar.py`` from the data in
# http://milde.users.sourceforge.net/LUCR/Math/
# Includes commands from: wasysym, stmaryrd, mathdots, mathabx, esint, bbold, amsxtra, amsmath, amssymb, standard LaTeX
mathacce... | agpl-3.0 |
EmanueleCannizzaro/scons | test/scons-time/time/which.py | 1 | 2703 | #!/usr/bin/env python
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to us... | mit |
abrt/faf | src/pyfaf/actions/cleanup_unassigned.py | 1 | 3252 | # Copyright (C) 2016 ABRT Team
# Copyright (C) 2016 Red Hat, Inc.
#
# This file is part of faf.
#
# faf 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) ... | gpl-3.0 |
rfgil/MusicBooker | Music.py | 1 | 8811 | # coding=utf-8
import math
import i18n
_ = i18n.language.gettext
CHORUS_INDENTIFIER = '{CHORUS}'
ORDER_INDENTIFIER = '{ORDER}'
COMMENT_INDENTIFIER = '//'
class Music():
chorus = ''
chorus_chords = ''
verse = []
verse_chords = []
has_chorus = False
verses_before_chorus = 0
start_with_... | mit |
Azulinho/ansible | test/units/executor/module_common/test_module_common.py | 83 | 4593 | # (c) 2017, Toshio Kuratomi <tkuratomi@ansible.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 option) any later... | gpl-3.0 |
dgzurita/odoo | addons/website_mail/models/mail_thread.py | 338 | 1454 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
kogone/android_kernel_oneplus_msm8974 | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
aethaniel/project_generator | project_generator/settings.py | 1 | 2243 | # Copyright 2014 0xc0170
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | apache-2.0 |
apyrgio/synnefo | snf-astakos-app/astakos/api/urls.py | 9 | 2341 | # Copyright (C) 2010-2014 GRNET S.A.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed i... | gpl-3.0 |
GenericStudent/home-assistant | tests/components/fritzbox/test_binary_sensor.py | 13 | 2896 | """Tests for AVM Fritz!Box binary sensor component."""
from datetime import timedelta
from unittest import mock
from requests.exceptions import HTTPError
from homeassistant.components.binary_sensor import DOMAIN
from homeassistant.components.fritzbox.const import DOMAIN as FB_DOMAIN
from homeassistant.const import (
... | apache-2.0 |
jlegendary/servo | python/mozlog/mozlog/structured/commandline.py | 39 | 8909 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import sys
import os
import optparse
from collections import defaultdict
from structuredlog import StructuredLogger, se... | mpl-2.0 |
daavery/audacity | lib-src/lv2/lv2/plugins/eg-fifths.lv2/waflib/extras/autowaf.py | 176 | 22430 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import glob
import os
import subprocess
import sys
from waflib import Configure,Context,Logs,Node,Options,Task,Utils
from waflib.TaskGen import feature,before,after
global g_i... | gpl-2.0 |
apkbox/nano-rpc | third_party/protobuf/src/python/mox.py | 603 | 38237 | #!/usr/bin/python2.4
#
# Copyright 2008 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... | bsd-3-clause |
albertomurillo/ansible | test/units/modules/packaging/os/test_rhn_register.py | 31 | 9758 | import contextlib
import json
import os
from units.compat.mock import mock_open
from ansible.module_utils import basic
from ansible.module_utils._text import to_native
import ansible.module_utils.six
from ansible.module_utils.six.moves import xmlrpc_client
from ansible.modules.packaging.os import rhn_register
import ... | gpl-3.0 |
Impactstory/sherlockoa | put_repo_requests_in_db.py | 2 | 5955 | import csv
import os
import json
import gspread
import datetime
import re
import unicodecsv as csv
from app import db
from util import safe_commit
from emailer import send
from emailer import create_email
from endpoint import Endpoint
from repository import Repository
from repo_request import RepoRequest
def get_rep... | mit |
robk5uj/invenio | modules/webjournal/lib/widgets/bfe_webjournal_widget_latestPhoto.py | 8 | 3938 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2007, 2008, 2009, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## Licens... | gpl-2.0 |
farazaftab/sjhschool | node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py | 1534 | 3426 | # 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.
import collections
import os
import gyp
import gyp.common
import gyp.msvs_emulation
import json
import sys
generator_supports_multiple_toolsets = True
generator_... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.