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
digwanderlust/pants
tests/python/pants_test/tasks/test_cache_manager.py
1
4690
# 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) import shutil import...
apache-2.0
amanzi/ats-dev
tools/utils/transect_data.py
2
7741
"""Loads and/or plots 2D, topologlically structured data on quadrilaterals using matplotlib. """ import sys,os import numpy as np import h5py import mesh import colors def fullname(varname): fullname = varname if not '.cell.' in fullname: fullname = fullname+'.cell.0' return fullname def transec...
bsd-3-clause
ltilve/chromium
chrome/test/data/search/tools/instant_extended_manual_tests.py
70
1952
#!/usr/bin/env python # 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. """Records or runs web-page-replay data for InstantExtendedManualTests.*. Typical usage is: $ cd src/chrome/test/data/search/tools/ ...
bsd-3-clause
gunan/tensorflow
tensorflow/python/keras/layers/preprocessing/benchmarks/categorical_encoding_benchmark.py
1
3177
# Copyright 2020 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
nattee/cafe-grader-web
lib/assets/Lib/pprint.py
9
13127
# Author: Fred L. Drake, Jr. # fdrake@acm.org # # This is a simple little module I wrote to make life easier. I didn't # see anything quite like it in the library, though I may have overlooked # something. I wrote this when I was trying to read some heavily nested # tuples with fairly no...
mit
mommermi/callhorizons
callhorizons/callhorizons.py
1
60381
"""CALLHORIZONS - a Python interface to access JPL HORIZONS ephemerides and orbital elements. This module provides a convenient python interface to the JPL HORIZONS system by directly accessing and parsing the HORIZONS website. Ephemerides can be obtained through get_ephemerides, orbital elements through get_elements....
mit
mahak/spark
examples/src/main/python/sort.py
27
1519
# # 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 us...
apache-2.0
ducthien1490/youtube-dl
youtube_dl/extractor/niconico.py
59
11056
# encoding: utf-8 from __future__ import unicode_literals import re import json import datetime from .common import InfoExtractor from ..compat import ( compat_urllib_parse, compat_urllib_request, compat_urlparse, ) from ..utils import ( ExtractorError, int_or_none, parse_duration, parse_i...
unlicense
poljeff/odoo
addons/account/wizard/account_invoice_state.py
340
2875
# -*- 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
ioanpocol/superdesk-core
apps/keywords/service.py
6
1080
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license from superde...
agpl-3.0
googleapis/googleapis-gen
google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/services/services/ad_group_label_service/transports/__init__.py
3
1049
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
MiltosD/CEFELRC
lib/python2.7/site-packages/django/utils/daemonize.py
452
1907
import os import sys if os.name == 'posix': def become_daemon(our_home_dir='.', out_log='/dev/null', err_log='/dev/null', umask=022): "Robustly turn into a UNIX daemon, running in our_home_dir." # First fork try: if os.fork() > 0: sys.exit(0...
bsd-3-clause
JulyKikuAkita/PythonPrac
cs15211/SoupServings.py
1
5860
__source__ = 'https://leetcode.com/problems/soup-servings/' # Time: O(N^2) # Space: O(N^2) # # Description: Leetcode # 808. Soup Servings # # There are two types of soup: type A and type B. # Initially we have N ml of each type of soup. There are four kinds of operations: # # Serve 100 ml of soup A and 0 ml of sou...
apache-2.0
torkelsson/meta-package-manager
meta_package_manager/managers/mas.py
1
5319
# -*- coding: utf-8 -*- # # Copyright (c) 2016-2018 Kevin Deldycke <kevin@deldycke.com> # and contributors. # 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 F...
gpl-2.0
tedelhourani/ansible
test/legacy/cleanup_ec2.py
149
6962
''' Find and delete AWS resources matching the provided --match string. Unless --yes|-y is provided, the prompt for confirmation prior to deleting resources. Please use caution, you can easily delete you're *ENTIRE* EC2 infrastructure. ''' import boto import boto.ec2.elb import optparse import os import os.path impor...
gpl-3.0
appsembler/edx-platform
lms/djangoapps/staticbook/tests.py
13
11107
""" Test the lms/staticbook views. """ import textwrap import mock import requests from django.urls import NoReverseMatch, reverse from six import text_type from student.tests.factories import CourseEnrollmentFactory, UserFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.mod...
agpl-3.0
apuigsech/CryptoAPI
CryptoAPI/CryptoAPI.py
1
8197
#!/usr/bin/env python # CryptoAPI: Python Crypto API implementation # # Copyright (c) 2014 - Albert Puigsech Galicia (albert@puigsech.com) # # 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 w...
gpl-3.0
maniteja123/sympy
sympy/physics/quantum/tests/test_cg.py
64
8623
from __future__ import division from sympy import S, sqrt, Sum, symbols from sympy.physics.quantum.cg import Wigner3j, Wigner6j, Wigner9j, CG, cg_simp from sympy.functions.special.tensor_functions import KroneckerDelta from sympy.utilities.pytest import slow @slow def test_cg_simp_add(): j, m1, m1p, m2, m2p = sym...
bsd-3-clause
ashyx/Samsung-Galaxy-Tab-S2-Kernel
tools/perf/scripts/python/check-perf-trace.py
11214
2503
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
gpl-2.0
jbq/ufw
src/backend.py
1
24402
'''backend.py: interface for ufw backends''' # # Copyright 2008-2011 Canonical Ltd. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3, # as published by the Free Software Foundation. # # This program is distributed in th...
gpl-3.0
dkodnik/arp
addons/point_of_sale/wizard/__init__.py
382
1200
# -*- 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...
agpl-3.0
jamielennox/deluge
ez_setup.py
8
10077
#!python """Bootstrap setuptools installation If you want to use setuptools in your package's setup.py, just include this file in the same directory with it, and add this to the top of your setup.py:: from ez_setup import use_setuptools use_setuptools() If you want to require a specific version of setuptools...
gpl-3.0
bluetib/netaddr
docs/source/conf.py
2
7898
# -*- coding: utf-8 -*- # # netaddr documentation build configuration file, created by # sphinx-quickstart on Sun May 27 22:23:51 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All...
bsd-3-clause
hef/samba
buildtools/wafadmin/Tools/ruby.py
16
3775
#!/usr/bin/env python # encoding: utf-8 # daniel.svensson at purplescout.se 2008 import os import Task, Options, Utils from TaskGen import before, feature, after from Configure import conf @feature('rubyext') @before('apply_incpaths', 'apply_type_vars', 'apply_lib_vars', 'apply_bundle') @after('default_cc', 'vars_tar...
gpl-3.0
smikes/depot_tools
third_party/pylint/lint.py
18
39136
# Copyright (c) 2003-2010 Sylvain Thenault (thenault@gmail.com). # Copyright (c) 2003-2010 LOGILAB S.A. (Paris, FRANCE). # http://www.logilab.fr/ -- mailto:contact@logilab.fr # # 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 t...
bsd-3-clause
manics/ansible-modules-core
network/nxos/nxos_snmp_location.py
20
12471
#!/usr/bin/python # # 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 distribut...
gpl-3.0
lbishal/scikit-learn
examples/gaussian_process/plot_gpc_isoprobability.py
45
3025
#!/usr/bin/python # -*- coding: utf-8 -*- """ ================================================================= Iso-probability lines for Gaussian Processes classification (GPC) ================================================================= A two-dimensional classification example showing iso-probability lines for...
bsd-3-clause
Thermi/ocfs2-tools
ocfs2console/ocfs2interface/classlabel.py
8
1201
# OCFS2Console - GUI frontend for OCFS2 management and debugging # Copyright (C) 2005 Oracle. 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 Foundation; either version 2 of the Lice...
gpl-2.0
TUB-Control/PaPI
papi/plugin/io/UDP_Plugin/UDP_Plugin.py
1
26844
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ Copyright (C) 2014 Technische Universität Berlin, Fakultät IV - Elektrotechnik und Informatik, Fachgebiet Regelungssysteme, Einsteinufer 17, D-10587 Berlin, Germany This file is part of PaPI. PaPI is free software: you can redistribute it and/or modify it under the term...
gpl-3.0
craigderington/studentloan5
tests/engine.py
1
5088
from subprocess import call from os import path import hitchpostgres import hitchselenium import hitchpython import hitchserve import hitchredis import hitchtest import hitchsmtp # Get directory above this file PROJECT_DIRECTORY = path.abspath(path.join(path.dirname(__file__), '..')) class ExecutionEngine(hitchtest...
bsd-3-clause
imammedo/virt-test
virttest/utils_cgroup.py
2
13909
#!/usr/bin/python # -*- coding: utf-8 -*- """ Helpers for cgroup testing. @copyright: 2011 Red Hat Inc. @author: Lukas Doktor <ldoktor@redhat.com> """ import logging, os, shutil, subprocess, time, re from tempfile import mkdtemp from autotest.client import utils from autotest.client.shared import error class Cgroup(o...
gpl-2.0
otherness-space/myProject003
my_project_003/lib/python2.7/site-packages/django/contrib/auth/tests/test_models.py
104
6290
import warnings from django.conf import settings from django.contrib.auth import get_user_model from django.contrib.auth.models import (Group, User, SiteProfileNotAvailable, UserManager) from django.contrib.auth.tests.custom_user import IsActiveTestUser1 from django.contrib.auth.tests.utils import skipIfCustomUser...
mit
horance-liu/tensorflow
tensorflow/python/ops/distributions/uniform.py
73
6818
# 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
equitania/myodoo-addons-v10
eq_project/models/__init__.py
1
1068
# -*- coding: utf-8 -*- ############################################################################## # # Odoo Addon, Open Source Management Solution # Copyright (C) 2014-now Equitania Software GmbH(<http://www.equitania.de>). # # This program is free software: you can redistribute it and/or modify # it un...
agpl-3.0
mavit/ansible
lib/ansible/modules/storage/netapp/netapp_e_syslog.py
25
10538
#!/usr/bin/python # (c) 2018, NetApp, 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', 'status': ['preview'], ...
gpl-3.0
borevitzlab/Gigavision
libs/SysUtil.py
2
24107
import subprocess import random, string, os, socket, json, time from glob import glob from urllib import request import threading import configparser import yaml import logging import logging.config import fcntl import datetime USBDEVFS_RESET = 21780 try: logging.config.fileConfig("logging.ini") except: pass ...
mit
wsmith323/django
django/http/multipartparser.py
332
24331
""" Multi-part parsing for file uploads. Exposes one class, ``MultiPartParser``, which feeds chunks of uploaded data to file upload handlers for processing. """ from __future__ import unicode_literals import base64 import binascii import cgi import sys from django.conf import settings from django.core.exceptions imp...
bsd-3-clause
mdietrichc2c/OCB
addons/stock/wizard/stock_move.py
111
3844
# -*- 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
IndonesiaX/edx-platform
lms/djangoapps/student_account/test/test_views.py
20
20748
# -*- coding: utf-8 -*- """ Tests for student account views. """ import re from unittest import skipUnless from urllib import urlencode import json import mock import ddt from django.conf import settings from django.core.urlresolvers import reverse from django.core import mail from django.contrib import messages from...
agpl-3.0
eddiep1101/django-oscar
tests/integration/offer/condition_tests.py
40
9458
from decimal import Decimal as D from django.test import TestCase import mock from oscar.apps.offer import models from oscar.test import factories from oscar.test.basket import add_product class TestCountCondition(TestCase): def setUp(self): self.range = models.Range.objects.create( name="A...
bsd-3-clause
a115027a/Openkore
src/scons-local-2.0.1/SCons/Tool/ilink.py
61
2134
"""SCons.Tool.ilink Tool-specific initialization for the OS/2 ilink linker. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SC...
gpl-2.0
bussiere/pypyjs
website/demo/home/rfk/repos/pypy/lib-python/2.7/lib2to3/tests/test_fixers.py
33
118371
""" Test suite for the fixer modules """ # Python imports import os import unittest from itertools import chain from operator import itemgetter # Local imports from lib2to3 import pygram, pytree, refactor, fixer_util from lib2to3.tests import support class FixerTestCase(support.TestCase): # Other test cases ca...
mit
40223247/2015test2
static/Brython3.1.1-20150328-091302/Lib/urllib/parse.py
735
35170
"""Parse (absolute and relative) URLs. urlparse module is based upon the following RFC specifications. RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding and L. Masinter, January 2005. RFC 2732 : "Format for Literal IPv6 Addresses in URL's by R.Hinden, B.Carpenter and L.Masinter, Decemb...
gpl-3.0
InAnimaTe/CouchPotatoServer
libs/xmpp/transports.py
89
15453
## transports.py ## ## Copyright (C) 2003-2004 Alexey "Snake" Nezhdanov ## ## 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 versi...
gpl-3.0
lambday/shogun
examples/undocumented/python/kernel_top.py
4
2523
#!/usr/bin/env python from tools.load import LoadMatrix import numpy as np lm=LoadMatrix() traindat = lm.load_dna('../data/fm_train_dna.dat') testdat = lm.load_dna('../data/fm_test_dna.dat') label_traindat = lm.load_labels('../data/label_train_dna.dat') fm_hmm_pos=[traindat[i] for i in np.where([label_traindat==1])[1...
bsd-3-clause
alaski/nova
nova/volume/encryptors/cryptsetup.py
4
6382
# Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory # 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/...
apache-2.0
opnsense/core
src/opnsense/scripts/netflow/lib/flowparser.py
1
8475
""" Copyright (c) 2019 Ad Schellevis <ad@opnsense.org> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, ...
bsd-2-clause
ArcherSys/ArcherSys
Lib/site-packages/past/types/oldstr.py
62
4300
""" Pure-Python implementation of a Python 2-like str object for Python 3. """ from collections import Iterable from numbers import Integral from past.utils import PY2, with_metaclass _builtin_bytes = bytes class BaseOldStr(type): def __instancecheck__(cls, instance): return isinstance(instance, _buil...
mit
JTarball/tetherbox
docker/app/app/backend/apps/_archive/blog_codewheel/views.py
4
11119
import logging from itertools import chain from django.shortcuts import HttpResponse from django.shortcuts import render_to_response as render_to_resp from django.template import RequestContext from django.views.generic import ListView, DetailView, TemplateView, View from django.contrib.auth.views import redirect_to_l...
isc
pechatny/basic-flask-app
src/app/flask/lib/python2.7/site-packages/pip/util.py
343
24172
import sys import shutil import os import stat import re import posixpath import zipfile import tarfile import subprocess import textwrap from pip.exceptions import InstallationError, BadCommand, PipError from pip.backwardcompat import(WindowsError, string_types, raw_input, console_to_s...
mit
kimjaejoong/nova
nova/tests/unit/api/openstack/compute/contrib/test_extended_volumes.py
33
6496
# Copyright 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.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
wkritzinger/asuswrt-merlin
release/src/router/samba36/lib/dnspython/dns/rdtypes/IN/NAPTR.py
248
4889
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
gpl-2.0
moijes12/oh-mainline
vendor/packages/gdata/tests/gdata_tests/photos/service_test.py
128
2928
#!/usr/bin/python # # Copyright (C) 2007 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 ...
agpl-3.0
martynovp/edx-platform
common/test/acceptance/fixtures/certificates.py
80
1221
""" Tools for creating certificates config fixture data. """ import json from . import STUDIO_BASE_URL from .base import StudioApiFixture class CertificateConfigFixtureError(Exception): """ Error occurred while installing certificate config fixture. """ pass class CertificateConfigFixture(StudioAp...
agpl-3.0
paulbersch/django-locus
locus/utils/location.py
1
1360
import math # add back later # import GeoIP nauticalMilePerLat = 60.00721 nauticalMilePerLongitude = 60.10793 rad = math.pi / 180.0 milesPerNauticalMile = 1.15078 def calcDistance(lat1, lon1, lat2, lon2): """ Caclulate distance between two lat lons in NM """ lat1 = float(lat1) lat2 = float(...
mit
etashjian/ECE757-final
configs/topologies/Cluster.py
41
4886
# Copyright (c) 2012 Advanced Micro Devices, 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...
bsd-3-clause
KaranToor/MA450
google-cloud-sdk/platform/bq/ez_setup.py
38
8357
#!/usr/bin/env python """Bootstrap setuptools installation If you want to use setuptools in your package's setup.py, just include this file in the same directory with it, and add this to the top of your setup.py:: from ez_setup import use_setuptools use_setuptools() If you want to require a specific version ...
apache-2.0
svn2github/django
tests/modeltests/custom_pk/fields.py
93
1493
import random import string from django.db import models class MyWrapper(object): def __init__(self, value): self.value = value def __repr__(self): return "<%s: %s>" % (self.__class__.__name__, self.value) def __unicode__(self): return self.value def __eq__(self, other): ...
bsd-3-clause
dstrockis/outlook-autocategories
lib/google/auth/compute_engine/credentials.py
14
4516
# Copyright 2016 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 or agreed to in writing,...
apache-2.0
jcpowermac/ansible
lib/ansible/modules/network/cloudengine/ce_snmp_location.py
22
6794
#!/usr/bin/python # # 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 distribut...
gpl-3.0
wylieswanson/agilepyfs
fs/tests/__init__.py
3
43565
#!/usr/bin/env python """ fs.tests: testcases for the fs module """ from __future__ import with_statement # Send any output from the logging module to stdout, so it will # be captured by nose and reported appropriately import sys import logging #logging.basicConfig(level=logging.ERROR, stream=sys.stdout) from...
bsd-3-clause
mancoast/CPythonPyc_test
fail/332_test_getargs2.py
28
21610
import unittest from test import support from _testcapi import getargs_keywords, getargs_keyword_only """ > How about the following counterproposal. This also changes some of > the other format codes to be a little more regular. > > Code C type Range check > > b unsigned char 0..UCHAR_MAX > h signed short SHRT_MIN..SH...
gpl-3.0
kantlove/flask-simple-page
Lib/site-packages/jinja2/constants.py
1169
1626
# -*- coding: utf-8 -*- """ jinja.constants ~~~~~~~~~~~~~~~ Various constants. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ #: list of lorem ipsum words used by the lipsum() helper function LOREM_IPSUM_WORDS = u'''\ a ac accumsan ad adipiscing aenean a...
mit
MinoMino/minqlx
python/minqlx/_handlers.py
1
18535
# minqlx - Extends Quake Live's dedicated server with extra functionality and scripting. # Copyright (C) 2015 Mino <mino@minomino.org> # This file is part of minqlx. # minqlx 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 Softw...
gpl-3.0
bhargav2408/python-for-android
python-modules/twisted/twisted/trial/test/test_warning.py
60
14755
# Copyright (c) 2008-2009 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for Trial's interaction with the Python warning system. """ import sys, warnings from StringIO import StringIO from twisted.python.filepath import FilePath from twisted.trial.unittest import TestCase, _collectWarnings from tw...
apache-2.0
lundjordan/services
src/codecoverage/bot/code_coverage_bot/codecov.py
1
7319
# -*- coding: utf-8 -*- import json import os import tempfile from datetime import datetime from datetime import timedelta import hglib import requests from cli_common.log import get_logger from cli_common.taskcluster import get_service from cli_common.utils import ThreadPoolExecutorResult from code_coverage_bot imp...
mpl-2.0
mediatum/mediatum
utils/hash.py
1
1599
""" mediatum - a multimedia content repository Copyright (C) 2007 Arne Seifert <seiferta@in.tum.de> Copyright (C) 2007 Matthias Kramm <kramm@in.tum.de> 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 Foun...
gpl-3.0
antepsis/anteplahmacun
sympy/functions/special/tests/test_zeta_functions.py
29
6569
from sympy import (Symbol, zeta, nan, Rational, Float, pi, dirichlet_eta, log, zoo, expand_func, polylog, lerchphi, S, exp, sqrt, I, exp_polar, polar_lift, O, stieltjes) from sympy.utilities.randtest import (test_derivative_numerically as td, random_complex_nu...
bsd-3-clause
doismellburning/tox
tests/test_z_cmdline.py
1
20318
import tox import py import pytest from tox._pytestplugin import ReportExpectMock try: import json except ImportError: import simplejson as json pytest_plugins = "pytester" from tox._cmdline import Session from tox._config import parseconfig def test_report_protocol(newconfig): config = newconfig([], """...
mit
baseclue/django-rest-test
tests/test_compare.py
1
15578
import unittest from rest_test import compare class DictTestCase(unittest.TestCase): def test_basic(self): data = dict( a=1, b='2' ) expected_data = dict( b='2', a=1 ) assert compare(data, expected_data) def test_basic_...
apache-2.0
brainwane/zulip
zerver/tests/test_subdomains.py
5
2460
from typing import Any, Mapping, Sequence from unittest import mock from zerver.lib.subdomains import get_subdomain from zerver.lib.test_classes import ZulipTestCase from zerver.models import Realm class SubdomainsTest(ZulipTestCase): def test_get_subdomain(self) -> None: def request_mock(host: str) -> ...
apache-2.0
stromnet/agocontrol
devices/squeezebox/pylmslibrary.py
5
17886
#!/usr/bin/python # -*- coding: utf-8 -*- """ PyLMS: Python Wrapper for Logitech Media Server CLI (Telnet) Interface Copyright (C) 2013 Tang <tanguy [dot] bonneau [at] gmail [dot] com> LMSServer class is based on JingleManSweep <jinglemansweep [at] gmail [dot] com> This program is free software; you can...
gpl-3.0
apeyrard/sjtu-work
DIP/exercises/ex3/ex3.py
1
3652
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- import sys from PIL import Image import numpy as np import math import argparse def getMatrix(image): data = list(image.getdata()) width, height = image.size matrix = np.array(data).reshape(height,width) return matrix def getData(matrix): data = lis...
mit
luk156/minimo
minimo/documento/migrations/0004_auto__add_unitamisura__add_field_riga_unita.py
1
10331
# -*- 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 model 'UnitaMisura' db.create_table(u'documento_unitamisura', ( (u'id', self.gf('django...
gpl-2.0
PeerM/async-rl-fork
run_a3c.py
2
6145
import argparse import copy import multiprocessing as mp import os import sys import statistics import time import chainer from chainer import links as L from chainer import functions as F import cv2 import numpy as np import a3c import random_seed import async from prepare_output_dir import prepare_output_dir def ...
mit
darthbhyrava/pywikibot-local
tests/timestamp_tests.py
4
3470
# -*- coding: utf-8 -*- """Tests for the Timestamp class.""" # # (C) Pywikibot team, 2014 # # Distributed under the terms of the MIT license. # from __future__ import absolute_import, unicode_literals __version__ = '$Id$' import calendar import datetime from pywikibot import Timestamp as T from tests.aspects impor...
mit
waytai/networkx
networkx/algorithms/link_prediction.py
40
16527
""" Link prediction algorithms. """ from __future__ import division import math import networkx as nx from networkx.utils.decorators import * __all__ = ['resource_allocation_index', 'jaccard_coefficient', 'adamic_adar_index', 'preferential_attachment', 'cn_soundarajan_hop...
bsd-3-clause
zouzou73/Lazarus
src/lazarus/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py
2485
5536
# This file comes from # https://github.com/martine/ninja/blob/master/misc/ninja_syntax.py # Do not edit! Edit the upstream one instead. """Python module for generating .ninja files. Note that this is emphatically not a required piece of Ninja; it's just a helpful utility for build-file-generation systems that alr...
mit
msunardi/PTVS
Python/Tests/TestData/VirtualEnv/env/Lib/encodings/mac_cyrillic.py
93
14017
""" Python Character Mapping Codec mac_cyrillic generated from 'MAPPINGS/VENDORS/APPLE/CYRILLIC.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def de...
apache-2.0
imankulov/sentry
tests/sentry/interfaces/test_user.py
11
1423
# -*- coding: utf-8 -*- from __future__ import absolute_import import mock from exam import fixture from sentry.testutils import TestCase from sentry.interfaces.user import User from sentry.models import Event class UserTest(TestCase): @fixture def event(self): return mock.Mock(spec=Event()) @...
bsd-3-clause
belokop/indico_bare
migrations/versions/201510221159_1d741fc6586c_backup_old_transaction_table.py
2
2600
"""Backup old transaction table Revision ID: 1d741fc6586c Revises: f9bb2a03ceb Create Date: 2015-10-22 11:59:18.116917 """ import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql from indico.core.db.sqlalchemy import PyIntEnum from indico.core.db.sqlalchemy import UTCDateTime from i...
gpl-3.0
fzimmermann89/pyload
module/plugins/hoster/FastixRu.py
1
1366
# -*- coding: utf-8 -*- import re import urllib from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo from module.plugins.internal.utils import json class FastixRu(MultiHoster): __name__ = "FastixRu" __type__ = "hoster" __version__ = "0.17" __status__ = "testing" __...
gpl-3.0
Purg/kwiver
vital/bindings/python/vital/types/landmark_map.py
1
4829
""" ckwg +31 Copyright 2016 by Kitware, 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 ...
bsd-3-clause
Slack06/yadg
descgen/management/__init__.py
14
1136
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2011-2015 Slack # # 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 ...
mit
Linusp/shadowsocks
shadowsocks/shell.py
652
12736
#!/usr/bin/python # -*- coding: utf-8 -*- # # 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 b...
apache-2.0
hatwar/Das_erpnext
erpnext/setup/doctype/backup_manager/backup_dropbox.py
33
4924
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt # SETUP: # install pip install --upgrade dropbox # # Create new Dropbox App # # in conf.py, set oauth2 settings # dropbox_access_key # dropbox_access_secret from __future__ import unicode_lit...
agpl-3.0
zhumingliang1209/Ardupilot
ardupilot/modules/waf/waflib/extras/pep8.py
5
3477
#! /usr/bin/env python # encoding: utf-8 # # written by Sylvain Rouquette, 2011 ''' Install pep8 module: $ easy_install pep8 or $ pip install pep8 To add the boost tool to the waf file: $ ./waf-light --tools=compat15,pep8 or, if you have waf >= 1.6.2 $ ./waf update --files=pep8 Then add this to your wscript: [at...
gpl-3.0
qmarlats/pyquizz
env-3/lib/python3.5/site-packages/pip/wheel.py
78
32216
""" Support for installing and building the "wheel" binary package format. """ from __future__ import absolute_import import compileall import csv import errno import functools import hashlib import logging import os import os.path import re import shutil import stat import sys import tempfile import warnings from ba...
gpl-3.0
tectronics/openmalaria-git
util/compareOutput.py
1
7178
#!/usr/bin/python # -*- coding: utf-8 -*- # This file is part of OpenMalaria. # # Copyright (C) 2005-2010 Swiss Tropical Institute and Liverpool School Of Tropical Medicine # # OpenMalaria is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by #...
gpl-2.0
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/scipy/signal/tests/test_savitzky_golay.py
18
9463
from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import (run_module_suite, assert_allclose, assert_equal, assert_almost_equal, assert_array_equal) from scipy.ndimage import convolve1d from scipy.signal import savgol_coeffs, savgol_filte...
agpl-3.0
tomasdubec/openstack-cinder
cinder/scheduler/chance.py
2
2660
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2010 OpenStack, LLC. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # ...
apache-2.0
HesselTjeerdsma/Cyber-Physical-Pacman-Game
Algor/flask/lib/python2.7/site-packages/scipy/optimize/optimize.py
9
100323
#__docformat__ = "restructuredtext en" # ******NOTICE*************** # optimize.py module by Travis E. Oliphant # # You may copy and use this module as you see fit with no # guarantee implied provided you keep this notice in all copies. # *****END NOTICE************ # A collection of optimization algorithms. Version ...
apache-2.0
chienlieu2017/it_management
odoo/addons/purchase/models/stock.py
2
6247
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models, _ from odoo.exceptions import UserError class StockPicking(models.Model): _inherit = 'stock.picking' purchase_id = fields.Many2one('purchase.order', related='move_lines.pu...
gpl-3.0
nara-l/foursquared
util/oget.py
262
3416
#!/usr/bin/python """ Pull a oAuth protected page from foursquare. Expects ~/.oget to contain (one on each line): CONSUMER_KEY CONSUMER_KEY_SECRET USERNAME PASSWORD Don't forget to chmod 600 the file! """ import httplib import os import re import sys import urllib import urllib2 import urlparse import user from xml....
apache-2.0
analurandis/Tur
backend/venv/Lib/site-packages/unidecode/x093.py
252
4666
data = ( 'Lun ', # 0x00 'Kua ', # 0x01 'Ling ', # 0x02 'Bei ', # 0x03 'Lu ', # 0x04 'Li ', # 0x05 'Qiang ', # 0x06 'Pou ', # 0x07 'Juan ', # 0x08 'Min ', # 0x09 'Zui ', # 0x0a 'Peng ', # 0x0b 'An ', # 0x0c 'Pi ', # 0x0d 'Xian ', # 0x0e 'Ya ', # 0x0f 'Zhui ', # 0x10 'Le...
mit
ludia/moto
moto/sts/models.py
19
1400
from __future__ import unicode_literals import datetime from moto.core import BaseBackend from moto.core.utils import iso_8601_datetime_with_milliseconds class Token(object): def __init__(self, duration, name=None, policy=None): now = datetime.datetime.now() self.expiration = now + datetime.timede...
apache-2.0
robhudson/django
tests/generic_relations/tests.py
45
28522
from __future__ import unicode_literals from django import forms from django.contrib.contenttypes.forms import generic_inlineformset_factory from django.contrib.contenttypes.models import ContentType from django.core.exceptions import FieldError from django.db import IntegrityError from django.db.models import Q from ...
bsd-3-clause
linyc74/CaMNIST
view.py
1
12377
import numpy as np import cv2, time, sys, threading, json, os from PyQt4 import QtCore, QtGui from controller import * class CamnistGUI(QtGui.QMainWindow): def __init__(self, controller_obj): super(CamnistGUI, self).__init__() self.controller = controller_obj pkg_dir = os.path.dirname(__...
mit
fkolacek/FIT-VUT
bp-revok/python/lib/python2.7/lib2to3/fixes/fix_filter.py
7
2082
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer that changes filter(F, X) into list(filter(F, X)). We avoid the transformation if the filter() call is directly contained in iter(<>), list(<>), tuple(<>), sorted(<>), ...join(<>), or for V in <>:. NOTE: This...
apache-2.0
JamesMGreene/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/thirdparty/ordered_dict.py
131
2984
# Copyright (c) 2009 Raymond Hettinger. # # 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 use, copy, modify, merge, publish, ...
bsd-3-clause