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
KendyllD/boukenda-project
makahiki/apps/widgets/status/analysis.py
3
13080
"""analysis module.""" import datetime from django.contrib.auth.models import User from django.core.exceptions import ObjectDoesNotExist from django.db.models import Sum, Q from apps.managers.log_mgr.models import MakahikiLog from apps.managers.player_mgr import player_mgr from apps.managers.player_mgr.models import P...
mit
vvuk/servo
tests/wpt/web-platform-tests/tools/py/testing/path/common.py
162
15649
import py import sys class CommonFSTests(object): def test_constructor_equality(self, path1): p = path1.__class__(path1) assert p == path1 def test_eq_nonstring(self, path1): p1 = path1.join('sampledir') p2 = path1.join('sampledir') assert p1 == p2 def test_new_ide...
mpl-2.0
akrizhevsky/cuda-convnet2
convdata.py
174
14675
# Copyright 2014 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 applicable law or...
apache-2.0
christiansacchi/code-forest
storyline2_3_project_composer-Sara_Script-python/oldBgod_2_newGold.py
1
4151
# -*- coding: utf-8 -*- from WbtEvo import WbtEVO from WbtEvo import WbtPaper from WbtEvo import WbtOLDbutGOLD from WbtEvo import WbtOLDbutUBI from storyLineObj_plus import Sl_text, Sl_State from tool import Tool import simplejson as json import codecs t = Tool() wp = None if __name__ == "__main__": ...
mit
mjirik/lisa
tests/support_structure_segmentation_test.py
1
5710
#! /usr/bin/python # -*- coding: utf-8 -*- # import funkcí z jiného adresáře import os.path path_to_script = os.path.dirname(os.path.abspath(__file__)) import unittest import numpy as np # import imcut.dcmreaddata as dcmr import lisa.support_structure_segmentation class SupportStructureSegmentationTest(unittest....
bsd-3-clause
keerts/home-assistant
homeassistant/components/sensor/torque.py
15
4091
""" Support for the Torque OBD application. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.torque/ """ import logging import re import voluptuous as vol from homeassistant.core import callback from homeassistant.components.http import HomeAssist...
apache-2.0
mrshelly/openerp71313
openerp/addons/base_calendar/__init__.py
59
1095
# -*- 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
linuxsoftware/dominoes
davezdominoes/gamecoordinator/__init__.py
1
4374
# ------------------------------------------------------------------------------ # Davez Dominoes! # ------------------------------------------------------------------------------ from pyramid.config import Configurator from pyramid.paster import setup_logging from pyramid.events import ApplicationCreated, subscriber...
agpl-3.0
perimosocordiae/scipy
scipy/fft/tests/test_real_transforms.py
16
5186
import numpy as np from numpy.testing import assert_allclose, assert_array_equal import pytest from scipy.fft import dct, idct, dctn, idctn, dst, idst, dstn, idstn import scipy.fft as fft from scipy import fftpack # scipy.fft wraps the fftpack versions but with normalized inverse transforms. # So, the forward transf...
bsd-3-clause
lemon-pi/linux-3.x
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # import os import sys import getopt import sh...
gpl-2.0
pombreda/raft
core/web/CustomWebView.py
11
2245
# # Implements a custom web view widget # # Author: Gregory Fleischer (gfleischer@gmail.com) # # Copyright (c) 2011 RAFT Team # # This file is part of RAFT. # # RAFT 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 Foundat...
gpl-3.0
mspringett/namebench
nb_third_party/dns/reversename.py
248
2931
# Copyright (C) 2006, 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...
apache-2.0
ojengwa/sympy
sympy/assumptions/handlers/ntheory.py
28
6853
""" Handlers for keys related to number theory: prime, even, odd, etc. """ from __future__ import print_function, division from sympy.assumptions import Q, ask from sympy.assumptions.handlers import CommonHandler from sympy.ntheory import isprime from sympy.core import S class AskPrimeHandler(CommonHandler): """...
bsd-3-clause
saisaizhang/Food
flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/_collections.py
172
6278
from collections import Mapping, MutableMapping try: from threading import RLock except ImportError: # Platform-specific: No threads available class RLock: def __enter__(self): pass def __exit__(self, exc_type, exc_value, traceback): pass try: # Python 2.7+ from co...
bsd-3-clause
astocko/statsmodels
statsmodels/examples/ex_feasible_gls_het_0.py
34
6454
# -*- coding: utf-8 -*- """Examples for linear model with heteroscedasticity estimated by feasible GLS These are examples to check the results during developement. The assumptions: We have a linear model y = X*beta where the variance of an observation depends on some explanatory variable Z (`exog_var`). linear_model...
bsd-3-clause
nash-x/hws
nova/api/openstack/compute/schemas/v3/agents.py
104
2845
# Copyright 2013 NEC Corporation. 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 ...
apache-2.0
zhaodelong/django
tests/template_tests/test_callables.py
347
4265
from __future__ import unicode_literals from unittest import TestCase from django.template import Context, Engine class CallableVariablesTests(TestCase): @classmethod def setUpClass(cls): cls.engine = Engine() super(CallableVariablesTests, cls).setUpClass() def test_callable(self): ...
bsd-3-clause
hoangt/PARD-gem5
src/arch/x86/PARDX86LocalApic.py
3
1908
# Copyright (c) 2014 Institute of Computing Technology, CAS # 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 ...
gpl-2.0
rx2130/Leetcode
python/236 Lowest Common Ancestor of a Binary Tree.py
1
1565
# Definition for a binary tree node. class TreeNode(object): def __init__(self, x): self.val = x self.left = None self.right = None class Solution(object): def lowestCommonAncestor(self, root, p, q): """ :type root: TreeNode :type p: TreeNode :type q: Tr...
apache-2.0
amarzavery/AutoRest
src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/Head/fixtures/acceptancetestshead/auto_rest_head_test_service.py
6
2705
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
sorenk/ansible
lib/ansible/modules/cloud/amazon/elb_target_group.py
2
30723
#!/usr/bin/python # Copyright: Ansible Project # 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
v-iam/azure-sdk-for-python
azure-mgmt-documentdb/azure/mgmt/documentdb/models/resource.py
8
1691
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
airodactyl/qutebrowser
qutebrowser/browser/webengine/webenginequtescheme.py
1
3644
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2016-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
gpl-3.0
Airphrame/mapnik
plugins/input/occi/build.py
2
2471
# # This file is part of Mapnik (c++ mapping toolkit) # # Copyright (C) 2013 Artem Pavlenko # # Mapnik 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 2.1 of the License, or (at your op...
lgpl-2.1
was4444/chromium.src
ui/events/ozone/evdev/capture_device_capabilities.py
44
4395
#!/usr/bin/python # 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. """Code generator DeviceCapabilities literal.""" import argparse import ctypes import evdev import os import sys TEST_DATA_GROUP_SIZE = ...
bsd-3-clause
pylanglois/uwsa
uwsas/commands/site_create.py
1
7230
#!/usr/bin/env python # coding=UTF-8 __author__ = "Pierre-Yves Langlois" __copyright__ = "https://github.com/pylanglois/uwsa/blob/master/LICENCE" __credits__ = ["Pierre-Yves Langlois"] __license__ = "BSD" __maintainer__ = "Pierre-Yves Langlois" from uwsas.common import * from uwsas.core import L from uwsas.core impor...
bsd-3-clause
patrick-nicholson/spark
python/pyspark/broadcast.py
24
4706
# # 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
silenceli/nova
nova/api/openstack/compute/plugins/v3/security_group_default_rules.py
10
5680
# Copyright 2013 Metacloud 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
map222/spark
python/pyspark/ml/param/_shared_params_code_gen.py
36
10025
# # 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
bak1an/django
tests/sitemaps_tests/test_http.py
5
10856
import os from datetime import date from unittest import skipUnless from django.apps import apps from django.conf import settings from django.contrib.sitemaps import GenericSitemap, Sitemap from django.contrib.sites.models import Site from django.core.exceptions import ImproperlyConfigured from django.test import modi...
bsd-3-clause
qsnake/numpy
numpy/core/setupscons.py
43
4516
import os import sys import glob from os.path import join, basename from numpy.distutils import log from numscons import get_scons_build_dir def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration,dot_join from numpy.distutils.command.scons import get_scons_pkg...
bsd-3-clause
riking/youtube-dl
youtube_dl/extractor/sapo.py
178
4498
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( parse_duration, unified_strdate, ) class SapoIE(InfoExtractor): IE_DESC = 'SAPO Vídeos' _VALID_URL = r'https?://(?:(?:v2|www)\.)?videos\.sapo\.(?:pt|cv|ao|mz|tl)/(?P<id>[\da-zA...
unlicense
g-vidal/upm
examples/python/hmtrp.py
6
5652
#!/usr/bin/env python # Author: Zion Orent <zorent@ics.com> # Copyright (c) 2015 Intel Corporation. # # 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 ...
mit
sharhar/USB-Thing
UpdaterFiles/Lib/python-3.5.1.amd64/Lib/html/parser.py
3
17726
"""A parser for HTML and XHTML.""" # This file is based on sgmllib.py, but the API is slightly different. # XXX There should be a way to distinguish between PCDATA (parsed # character data -- the normal case), RCDATA (replaceable character # data -- only char and entity references and end tags are special) # and CDAT...
apache-2.0
PsychoTV/PsychoTeam.repository
plugin.video.specto/resources/lib/resolvers/googleplus.py
23
2433
# -*- coding: utf-8 -*- ''' Specto Add-on Copyright (C) 2015 lambda 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 l...
gpl-2.0
yavalvas/yav_com
build/matplotlib/lib/matplotlib/tests/test_colors.py
1
8558
from __future__ import (absolute_import, division, print_function, unicode_literals) import six from nose.tools import assert_raises import numpy as np from numpy.testing.utils import assert_array_equal, assert_array_almost_equal import matplotlib.colors as mcolors import matplotlib.cm as cm...
mit
rjschwei/azure-sdk-for-python
azure-batch/azure/batch/models/cloud_job.py
3
9513
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
ThiefMaster/indico
docs/source/conf.py
3
7559
# indico documentation build configuration file, created by # sphinx-quickstart on Sun Nov 29 13:19:24 2009. # # 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 configuration values have ...
mit
Jimdo/thrift
lib/py/src/transport/TSocket.py
31
6930
# # 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 u...
apache-2.0
iw3hxn/server
openerp/addons/base/ir/__init__.py
13
1388
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 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
illicitonion/givabit
lib/sdks/google_appengine_1.7.1/google_appengine/lib/django_1_3/tests/regressiontests/forms/localflavor/ca.py
49
3636
import warnings from django.contrib.localflavor.ca.forms import (CAPostalCodeField, CAPhoneNumberField, CAProvinceField, CAProvinceSelect, CASocialInsuranceNumberField) from utils import LocalFlavorTestCase class CALocalFlavorTests(LocalFlavorTestCase): def setUp(self): self.save_warning...
apache-2.0
akarki15/mozillians
mozillians/common/tests/__init__.py
1
2575
from __future__ import absolute_import from contextlib import contextmanager, nested from django.contrib.auth.decorators import login_required from django.shortcuts import redirect from django.test import TestCase as BaseTestCase from django.test.client import Client from django.test.utils import override_settings f...
bsd-3-clause
akashsinghal/Speech-Memorization-App
speech/Swift/Speech-gRPC-Streaming/env/lib/python3.6/site-packages/pip/_vendor/webencodings/mklabels.py
512
1305
""" webencodings.mklabels ~~~~~~~~~~~~~~~~~~~~~ Regenarate the webencodings.labels module. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details. """ import json try: from urllib import urlopen except ImportError: from urllib.request import urlopen def asser...
apache-2.0
onecloud/neutron
neutron/openstack/common/sslutils.py
26
2842
# Copyright 2013 IBM Corp. # # 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 t...
apache-2.0
haripradhan/MissionPlanner
Lib/ctypes/macholib/dyld.py
57
5510
###################################################################### # This file should be kept compatible with Python 2.3, see PEP 291. # ###################################################################### """ dyld emulation """ import os from framework import framework_info from dylib import dylib_inf...
gpl-3.0
bmya/odoo-addons
partner_school/partner.py
8
1816
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp import fields, models, api class pa...
agpl-3.0
Grirrane/odoo
addons/l10n_fr/report/bilan_report.py
8
6129
# -*- 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 # consequences resulting from its eventual inadequacies and bugs # End users w...
agpl-3.0
turbulenz/turbulenz_local
turbulenz_local/controllers/apiv1/gameprofile.py
1
4056
# Copyright (c) 2012-2013 Turbulenz Limited from logging import getLogger from simplejson import loads # pylint: disable=F0401 from pylons import response, request, config # pylint: enable=F0401 from turbulenz_local.decorators import secure_post, jsonify from turbulenz_local.lib.servicestatus import ServiceStatus f...
mit
xubinzheng/Gelatin
src/Gelatin/generator/Json.py
2
4156
# Copyright (C) 2010 Samuel Abels. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2, as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; wi...
gpl-2.0
bookieio/Bookie
bookie/tests/test_api/test_admin.py
6
7463
"""Test that we're meeting delicious API specifications""" import logging import json import transaction import unittest from pyramid import testing from bookie.models import Bmark from bookie.models import DBSession from bookie.models.auth import Activation from bookie.models.queue import ImportQueue from bookie.test...
agpl-3.0
codemac/servo
tests/wpt/css-tests/css21_dev/xhtml1print/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
cpenv/autocpenv
packages/cpenv/api.py
2
17023
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function # Standard library imports import os from collections import OrderedDict import warnings # Local imports from . import hooks, paths, compat, repos from .module import Module, ModuleSpec, module_header, sort_modules from .resolver import ( ...
mit
splotz90/urh
src/urh/controller/ReceiveDialogController.py
1
4168
import numpy as np from PyQt5.QtCore import pyqtSignal, pyqtSlot from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import QMessageBox from urh.controller.SendRecvDialogController import SendRecvDialogController from urh.dev.VirtualDevice import Mode, VirtualDevice from urh.ui.painting.LiveSceneManager import LiveScen...
gpl-3.0
Sh4kE/ofm_helper
core/views/account_views.py
2
3569
from django.contrib import messages from django.contrib.auth import authenticate, login, logout from django.http import HttpResponseRedirect from django.shortcuts import render, redirect from django.urls import reverse_lazy from django.views.generic import CreateView from core.forms.registration_form import Registrati...
agpl-3.0
justajeffy/arsenalsuite
python/blur/examples/simple.py
11
8119
#!/usr/bin/python from PyQt4.QtCore import * from PyQt4.QtGui import * from blur.Stone import * from blur.Classes import * import sys import re # First Create a Qt Application app = QApplication(sys.argv) # Load database config if sys.platform=='win32': initConfig("c:\\blur\\resin\\resin.ini") else: initConfig("/e...
gpl-2.0
aninternetof/bremen
bremenenv/lib/python3.5/site-packages/django/template/backends/django.py
25
5972
# Since this package contains a "django" module, this is required on Python 2. from __future__ import absolute_import import sys import warnings from importlib import import_module from pkgutil import walk_packages from django.apps import apps from django.conf import settings from django.template import TemplateDoesN...
mit
pdellaert/ansible
test/units/compat/mock.py
156
4556
# (c) 2014, 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
ciandcd/ciandcd-web
plugins/tipue_search/tipue_search.py
5
3218
# -*- coding: utf-8 -*- """ Tipue Search ============ A Pelican plugin to serialize generated HTML to JSON that can be used by jQuery plugin - Tipue Search. Copyright (c) Talha Mansoor """ from __future__ import unicode_literals import os.path import json from bs4 import BeautifulSoup from codecs import open try: ...
mit
laanwj/bitcoin
test/functional/example_test.py
24
9070
#!/usr/bin/env python3 # Copyright (c) 2017-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """An example functional test The module-level docstring should include a high-level description of what ...
mit
javacruft/networking-hyperv-debian
hyperv/tests/unit/neutron/test_utilsfactory.py
1
1743
# Copyright 2013 Cloudbase Solutions SRL # 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 r...
apache-2.0
anntzer/scikit-learn
benchmarks/bench_multilabel_metrics.py
19
7069
#!/usr/bin/env python """ A comparison of multilabel target formats and metrics over them """ from timeit import timeit from functools import partial import itertools import argparse import sys import matplotlib.pyplot as plt import scipy.sparse as sp import numpy as np from sklearn.datasets import make_multilabel_c...
bsd-3-clause
gx1997/chrome-loongson
native_client_sdk/src/build_tools/nacl-mono-archive.py
14
2279
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import optparse import os import sys import tarfile import buildbot_common def main(args): parser = optparse.OptionParser() ...
bsd-3-clause
ppwwyyxx/tensorpack
examples/GAN/GAN.py
1
8266
# -*- coding: utf-8 -*- # File: GAN.py # Author: Yuxin Wu import numpy as np import tensorflow as tf from tensorpack import BatchNorm, DataFlow, ModelDescBase, StagingInput, TowerTrainer, argscope from tensorpack.graph_builder import DataParallelBuilder, LeastLoadedDeviceSetter from tensorpack.tfutils.summary import ...
apache-2.0
abhishek-ch/hue
desktop/core/ext-py/Django-1.6.10/django/contrib/gis/maps/google/zoom.py
224
6622
from django.contrib.gis.geos import GEOSGeometry, LinearRing, Polygon, Point from django.contrib.gis.maps.google.gmap import GoogleMapException from django.utils.six.moves import xrange from math import pi, sin, log, exp, atan # Constants used for degree to radian conversion, and vice-versa. DTOR = pi / 180. RTOD = 18...
apache-2.0
martyngigg/pyqt-msvc
pyuic/uic/port_v2/proxy_base.py
1
1227
############################################################################# ## ## Copyright (c) 2015 Riverbank Computing Limited <info@riverbankcomputing.com> ## ## This file is part of PyQt4. ## ## This file may be used under the terms of the GNU General Public License ## version 3.0 as published by the Free Softw...
gpl-3.0
egetzel/wecrow
truehand2014/temboo/Library/Twilio/Applications/UpdateApplication.py
1
8037
# -*- coding: utf-8 -*- ############################################################################### # # UpdateApplication # Updates an existing application within your account. # # Python version 2.6 # ############################################################################### from temboo.core.choreography im...
apache-2.0
profxj/old_xastropy
xastropy/spec/analysis.py
6
4784
""" #;+ #; NAME: #; analysis #; Version 1.0 #; #; PURPOSE: #; Module for Analysis of Spectra #; 07-Sep-2014 by JXP #;- #;------------------------------------------------------------------------------ """ from __future__ import print_function, absolute_import, division, unicode_literals import xa...
bsd-3-clause
drnextgis/QGIS
python/ext-libs/future/libpasteurize/fixes/fix_raise.py
71
1099
u"""Fixer for 'raise E(V).with_traceback(T)' -> 'raise E, V, T'""" from lib2to3 import fixer_base from lib2to3.fixer_util import Comma, Node, Leaf, token, syms class FixRaise(fixer_base.BaseFix): PATTERN = u""" raise_stmt< 'raise' (power< name=any [trailer< '(' val=any* ')' >] [trailer< '.' 'with_tra...
gpl-2.0
martinwicke/tensorflow
tensorflow/contrib/framework/python/framework/experimental_test.py
16
2140
# 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
codegrafix/iRCSoccerB0t
ircbot.py
2
3879
import socket import logging def findcommand(message, command): if message.find(command) != -1: return True class IrcBot: """ A simple irc bot which handles basic irc server connection """ irc_socket = None bot_name_ = '' server_ = '' port_ = 0 channel_ = '' # List of own...
gpl-2.0
bleib1dj/django-oauth2-provider
docs/conf.py
20
7348
# -*- coding: utf-8 -*- # # django-oauth2-provider documentation build configuration file, created by # sphinx-quickstart on Tue Jan 24 15:40:05 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 # autogenerate...
mit
SchulerControl/linux
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py
4653
3596
# EventClass.py # # This is a library defining some events types classes, which could # be used by other scripts to analyzing the perf samples. # # Currently there are just a few classes defined for examples, # PerfEvent is the base class for all perf event sample, PebsEvent # is a HW base Intel x86 PEBS event, and use...
gpl-2.0
kvar/ansible
lib/ansible/modules/net_tools/netbox/netbox_interface.py
34
10342
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Mikhail Yohman (@FragmentedPacket) <mikhail.yohman@gmail.com> # 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_MET...
gpl-3.0
hansey/youtube-dl
youtube_dl/extractor/myspace.py
147
6761
# encoding: utf-8 from __future__ import unicode_literals import re import json from .common import InfoExtractor from ..compat import ( compat_str, ) from ..utils import ExtractorError class MySpaceIE(InfoExtractor): _VALID_URL = r'https?://myspace\.com/([^/]+)/(?P<mediatype>video/[^/]+/|music/song/.*?)(?P...
unlicense
ojengwa/oh-mainline
vendor/packages/html5lib/html5lib/tests/test_stream.py
74
3931
import support import unittest, codecs from html5lib.inputstream import HTMLInputStream class HTMLInputStreamShortChunk(HTMLInputStream): _defaultChunkSize = 2 class HTMLInputStreamTest(unittest.TestCase): def test_char_ascii(self): stream = HTMLInputStream("'", encoding='ascii') self.assert...
agpl-3.0
HolgerPeters/scikit-learn
examples/svm/plot_svm_margin.py
12
2492
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= SVM Margins Example ========================================================= The plots below illustrate the effect the parameter `C` has on the separation line. A large value of `C` basically tells our model that w...
bsd-3-clause
preo/pylpsolve
pylpsolve/optionlookup.py
1
4650
# PyLPSolve is an object oriented wrapper for the open source LP # solver lp_solve. Copyright (C) 2010 Hoyt Koepke. # # This library 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 2.1 of...
lgpl-2.1
svanschalkwyk/datafari
windows/python/Lib/distutils/tests/test_build_py.py
46
5064
"""Tests for distutils.command.build_py.""" import os import sys import StringIO import unittest from distutils.command.build_py import build_py from distutils.core import Distribution from distutils.errors import DistutilsFileError from distutils.tests import support from test.test_support import run_unittest cla...
apache-2.0
drawks/ansible
lib/ansible/modules/network/junos/junos_l2_interface.py
26
8852
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, 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
erikvolz/idepi-ev0
examples/DRAM/helpers/tabtofasta.py
3
5940
import re, sys, csv, argparse import Bio.Seq import Bio.SeqRecord import Bio.Alphabet from Bio import SeqIO nuc_ambigs = {"A" : "A", "C" : "C", "G" : "G", "T" : "T", "R" : "AG", "Y" : "CT", "S" : "CG", "W" : "AT", ...
gpl-3.0
reinhrst/panda
usr/lib/python2.7/compiler/misc.py
278
1794
def flatten(tup): elts = [] for elt in tup: if isinstance(elt, tuple): elts = elts + flatten(elt) else: elts.append(elt) return elts class Set: def __init__(self): self.elts = {} def __len__(self): return len(self.elts) def __contains__(s...
gpl-3.0
Permutatrix/servo
tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/browsers/edge.py
8
2784
from .base import Browser, ExecutorBrowser, require_arg from ..webdriver_server import EdgeDriverServer from ..executors import executor_kwargs as base_executor_kwargs from ..executors.executorselenium import (SeleniumTestharnessExecutor, SeleniumRefTestExecutor) from ..executo...
mpl-2.0
Zubair-Marediya/project-zeta
code/tsa_s4.py
3
11180
from __future__ import print_function, division import numpy as np import numpy.linalg as npl import matplotlib import matplotlib.pyplot as plt from matplotlib import colors from matplotlib import gridspec import os import re import json import nibabel as nib from utils import subject_class as sc from utils import outl...
bsd-3-clause
silentfuzzle/calibre
src/calibre/ebooks/oeb/display/webview.py
13
2192
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' import re fr...
gpl-3.0
RootTeam/pytaskscollect
func/Stepic_1_3_Cnk.py
1
1472
""" Пример: Пусть n = 3, т. е. есть три элемента (1, 2, 3). Пусть k = 2. Все различные сочетания из 3 элементов по 2: (1, 2), (1, 3), (2, 3). Различных сочетаний три, поэтому C(3, 2) = 3. Несложно понять, что C(n, 0) = 1, так как из n элементов выбрать 0 можно единственным образом, а именно, ничего не выбрать. Также н...
mit
xcyan/models
video_prediction/prediction_input.py
22
4238
# 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 applicab...
apache-2.0
4022321818/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/html/entities.py
814
75240
"""HTML character entity references.""" # maps the HTML entity name to the Unicode codepoint name2codepoint = { 'AElig': 0x00c6, # latin capital letter AE = latin capital ligature AE, U+00C6 ISOlat1 'Aacute': 0x00c1, # latin capital letter A with acute, U+00C1 ISOlat1 'Acirc': 0x00c2, # latin capit...
gpl-3.0
Oslandia/vizitown_plugin
twisted/python/threadable.py
35
3199
# -*- test-case-name: twisted.python.test_threadable -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ A module to provide some very basic threading primitives, such as synchronization. """ from __future__ import division, absolute_import from functools import wraps class DummyLock(obj...
gpl-2.0
dmazzella/micropython
tools/mpy_cross_all.py
28
1293
#!/usr/bin/env python3 import argparse import os import os.path argparser = argparse.ArgumentParser(description="Compile all .py files to .mpy recursively") argparser.add_argument("-o", "--out", help="output directory (default: input dir)") argparser.add_argument("--target", help="select MicroPython target config") ar...
mit
Intel-tensorflow/tensorflow
tensorflow/python/ops/custom_gradient.py
6
25287
# 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
eeshangarg/oh-mainline
vendor/packages/Django/tests/regressiontests/inspectdb/tests.py
44
3828
from __future__ import unicode_literals from django.core.management import call_command from django.db import connection from django.test import TestCase, skipUnlessDBFeature from django.utils.six import StringIO class InspectDBTestCase(TestCase): def test_stealth_table_name_filter_option(self): out = S...
agpl-3.0
ajoaoff/django
django/db/backends/postgresql/version.py
632
1517
""" Extracts the version of the PostgreSQL server. """ import re # This reg-exp is intentionally fairly flexible here. # Needs to be able to handle stuff like: # PostgreSQL #.#.# # EnterpriseDB #.# # PostgreSQL #.# beta# # PostgreSQL #.#beta# VERSION_RE = re.compile(r'\S+ (\d+)\.(\d+)\.?(\d+)?') def _parse_...
bsd-3-clause
etherkit/OpenBeacon2
client/linux-x86/venv/lib/python3.8/site-packages/pip/_internal/utils/subprocess.py
7
9922
# The following comment should be removed at some point in the future. # mypy: strict-optional=False from __future__ import absolute_import import logging import os import subprocess from pip._vendor.six.moves import shlex_quote from pip._internal.exceptions import InstallationError from pip._internal.utils.compat ...
gpl-3.0
mbox/django
tests/admin_registration/tests.py
34
4118
from __future__ import unicode_literals from django.contrib import admin from django.contrib.admin.decorators import register from django.contrib.admin.sites import site from django.core.exceptions import ImproperlyConfigured from django.test import TestCase from .models import Person, Place, Location, Traveler cla...
bsd-3-clause
karesansui/karesansui
karesansui/gadget/hostby1firewallruleby1.py
1
6194
# -*- coding: utf-8 -*- # # This file is part of Karesansui. # # Copyright (C) 2009-2012 HDE, Inc. # # 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 lim...
mit
chiragjogi/odoo
addons/product/__init__.py
443
1120
# -*- 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
svirt/virt-test
samples/ls_disk.py
35
1224
""" Shows all existing disk partitions. This test requires test-provider to be qemu. Try this test without config, than put ls_disk.cfg into $tests/cfg/ directory and see the difference. Additionally you might put ls_disk_v2.cfg into $tests/cfg/ directory and execute ls_disk_v2 test (which also uses this script!) and...
gpl-2.0
MoKee/android_kernel_lge_g3
tools/perf/scripts/python/syscall-counts-by-pid.py
11180
1927
# system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os, sys sys.path.append(os.env...
gpl-2.0
StephenWeber/ansible
test/units/playbook/test_attribute.py
219
1824
# (c) 2015, Marius Gedminas <marius@gedmin.as> # # 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 vers...
gpl-3.0
steedos/odoo7
openerp/addons/project_timesheet/report/task_report.py
52
4065
# -*- 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