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
perrygeo/Fiona
fiona/transform.py
4
3374
"""Coordinate and geometry warping and reprojection""" from fiona._transform import _transform, _transform_geom def transform(src_crs, dst_crs, xs, ys): """Transform coordinates from one reference system to another. Parameters ---------- src_crs: str or dict A string like 'EPSG:4326' or a di...
bsd-3-clause
thopiekar/Uranium
UM/View/RenderBatch.py
1
14238
# Copyright (c) 2015 Ultimaker B.V. # Uranium is released under the terms of the LGPLv3 or higher. import copy from UM.Logger import Logger from UM.Math.Vector import Vector from UM.View.GL.OpenGL import OpenGL from UM.View.GL.OpenGLContext import OpenGLContext from PyQt5.QtGui import QOpenGLVertexArrayObject ver...
lgpl-3.0
nate1001/chess_jay
gui.py
1
5079
''' Copyright Nate Carson 2012 ''' from PyQt4 import QtCore, QtGui, QtSvg import db import data def setAttackSum(self, forces): for force in forces: self._squares[force.tid].setAttackSum(force.c_white, force.c_black) def setAttackSum(self, c_white, c_black): c_white, c_black = c_white or 0, c_black o...
gpl-3.0
jimsrc/seatos
mixed/figs/sheaths.paper/src/together4.py
1
11024
#!/usr/bin/env ipython from pylab import * import numpy as np import console_colors as ccl from scipy.io.netcdf import netcdf_file import os, sys import matplotlib.patches as patches import matplotlib.transforms as transforms from numpy import array from matplotlib.gridspec import GridSpec import matplotlib.pyplot as p...
mit
okfn/datatable-py
tabulator/parsers/xls.py
3
3974
# -*- coding: utf-8 -*- from __future__ import division from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals import six import sys import xlrd from ..parser import Parser from .. import exceptions from .. import helpers # Module API class XLSParser(Par...
mit
wevoice/wesub
apps/videos/templatetags/recent_activity.py
1
1465
# Amara, universalsubtitles.org # # Copyright (C) 2013 Participatory Culture Foundation # # 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 Foundation, either version 3 of the # License, or (at your op...
agpl-3.0
jenca-cloud/jenca-authentication
storage/storage.py
1
6752
""" A storage service for use by a Jenca Cloud authentication service. """ import os from flask import Flask, json, jsonify, request, make_response from flask.ext.sqlalchemy import SQLAlchemy from flask_jsonschema import JsonSchema, ValidationError from flask_negotiate import consumes from requests import codes db...
mit
ryanbackman/zulip
zerver/lib/sessions.py
6
2375
from __future__ import absolute_import import logging from django.conf import settings from django.contrib.auth import SESSION_KEY, get_user_model from django.contrib.sessions.models import Session from django.utils.timezone import now as timezone_now from importlib import import_module from typing import List, Mappi...
apache-2.0
daenamkim/ansible
lib/ansible/modules/cloud/google/gce_img.py
49
6275
#!/usr/bin/python # Copyright 2015 Google Inc. All Rights Reserved. # 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 """An Ansible module to utilize GCE image resources.""" ANSIBLE_METAD...
gpl-3.0
evernym/plenum
storage/kv_store_leveldb.py
2
2887
import os import shutil from typing import Iterable, Tuple from state.util.utils import removeLockFiles from storage.kv_store import KeyValueStorage try: import leveldb except ImportError: print('Cannot import leveldb, please install') class KeyValueStorageLeveldb(KeyValueStorage): def __init__(self, db...
apache-2.0
tstanaka/bantorra.old
bin/service.py
2
2511
import os import sys import imp import time import ConfigParser import multiprocessing from bantorra.util import define from bantorra.util.log import LOG as L class ServiceControl(object): service = {} service_conf = {} def __init__(self): self.get_config() self.register() @classmeth...
mit
crazyi/ef39s_kernel_3.4.0
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
katsikas/gnuradio
gr-digital/examples/narrowband/tunnel.py
20
10285
#!/usr/bin/env python # # Copyright 2005,2006,2009,2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (a...
gpl-3.0
wxwilcke/MINOS
directives/optima_D1.MP.py
1
8757
#!/usr/bin/python3 import logging from operator import itemgetter from multiprocessing import Process, Manager, Pool, cpu_count from functools import partial from math import floor from timeit import default_timer as timer import rdflib from .abstract_instruction_set import AbstractInstructionSet from readers import r...
gpl-3.0
robotichead/NearBeach
tests/settings.py
1
3530
""" Django Settings for TESTING PURPOSES Do not utilise this settings.py file for your own project. Even if it is not a production environment. This file is only for the automatic testing and is not build for server use. """ import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR ...
mit
CleverChuk/ices
Python/multijob_module.py
1
3479
""" Author: Chukwubuikem Ume-Ugwa Email: chubiyke@gmail.com MIT License Copyright (c) 2017 CleverChuk 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 limit...
mit
laayis/yowsup
yowsup/layers/protocol_groups/protocolentities/iq_groups_leave_success.py
39
1424
from yowsup.structs import ProtocolTreeNode from yowsup.layers.protocol_iq.protocolentities import ResultIqProtocolEntity class SuccessLeaveGroupsIqProtocolEntity(ResultIqProtocolEntity): ''' <iq type="result" from="g.us" id="{{ID}}"> <leave> <group id="{{GROUP_JID}}"></group> </le...
gpl-3.0
Parlin-Galanodel/scrapy
scrapy/spidermiddlewares/httperror.py
18
1921
""" HttpError Spider Middleware See documentation in docs/topics/spider-middleware.rst """ import logging from scrapy.exceptions import IgnoreRequest logger = logging.getLogger(__name__) class HttpError(IgnoreRequest): """A non-200 response was filtered""" def __init__(self, response, *args, **kwargs): ...
bsd-3-clause
CyanogenMod/android_external_chromium_org
tools/telemetry/telemetry/unittest/simple_mock.py
17
3280
# Copyright 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. """A very very simple mock object harness.""" DONT_CARE = '' class MockFunctionCall(object): def __init__(self, name): self.name = name self.args ...
bsd-3-clause
rudisherry666/paigow
mainsite/settings.py
1
6720
# Django settings for paigow project. import os import sys # The project starts at mainsite/ rather than top-level at the application, # but we use a lot of things from the paigow/ folder. Create a global for # the paigow folder as well. PROJECT_PATH = os.path.realpath(os.path.dirname(__file__)) # mainsite/ (PAIGO...
apache-2.0
Sohamlad7/kernel-msm
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
2058
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
gpl-2.0
nkgilley/home-assistant
homeassistant/components/hunterdouglas_powerview/cover.py
6
9380
"""Support for hunter douglas shades.""" import asyncio import logging from aiopvapi.helpers.constants import ATTR_POSITION1, ATTR_POSITION_DATA from aiopvapi.resources.shade import ( ATTR_POSKIND1, MAX_POSITION, MIN_POSITION, factory as PvShade, ) import async_timeout from homeassistant.components.co...
apache-2.0
ethanfrey/aiocouchdb
aiocouchdb/v1/tests/test_server.py
2
9931
# -*- coding: utf-8 -*- # # Copyright (C) 2014-2015 Alexander Shorin # All rights reserved. # # This software is licensed as described in the file LICENSE, which # you should have received as part of this distribution. # import asyncio import aiocouchdb.client import aiocouchdb.feeds import aiocouchdb.v1.config impor...
bsd-2-clause
gameduell/duell
bin/win/python2.7.9/Lib/site-packages/pip/_vendor/requests/packages/chardet/sbcsgroupprober.py
2936
3291
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
bsd-2-clause
edx/lettuce
tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/ch.py
89
2604
from django.contrib.localflavor.ch.forms import (CHZipCodeField, CHPhoneNumberField, CHIdentityCardNumberField, CHStateSelect) from utils import LocalFlavorTestCase class CHLocalFlavorTests(LocalFlavorTestCase): def test_CHStateSelect(self): f = CHStateSelect() out = u'''<select name="state">...
gpl-3.0
wzhongyuan/BigDL
pyspark/test/dev/pep8-1.7.0.py
15
82481
#!/usr/bin/env python # pep8.py - Check Python source code formatting, according to PEP 8 # Copyright (C) 2006-2009 Johann C. Rocholl <johann@rocholl.net> # Copyright (C) 2009-2014 Florent Xicluna <florent.xicluna@gmail.com> # Copyright (C) 2014-2016 Ian Lee <ianlee1521@gmail.com> # # Permission is hereby granted, free...
apache-2.0
KhalidGit/flask
Work/Trivia - Module 5/env/Lib/site-packages/_markerlib/markers.py
1769
3979
# -*- coding: utf-8 -*- """Interpret PEP 345 environment markers. EXPR [in|==|!=|not in] EXPR [or|and] ... where EXPR belongs to any of those: python_version = '%s.%s' % (sys.version_info[0], sys.version_info[1]) python_full_version = sys.version.split()[0] os.name = os.name sys.platform = sys.platfo...
apache-2.0
js0701/chromium-crosswalk
tools/perf/measurements/draw_properties.py
7
1912
# Copyright 2015 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.page import page_test from telemetry.timeline import model from telemetry.timeline import tracing_config from telemetry.value import scalar ...
bsd-3-clause
puiterwijk/HttpCA
Signer/httpca_signer/database.py
1
1817
# Copyright (c) 2013, Patrick Uiterwijk <puiterwijk@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 # notice...
bsd-3-clause
40223222/-2015cd_midterm2
static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/color.py
603
4330
## pygame - Python Game Library ## Copyright (C) 2000-2003 Pete Shinners ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Library General Public ## License as published by the Free Software Foundation; either ## version 2 of the License, or (...
agpl-3.0
flgiordano/netcash
+/google-cloud-sdk/lib/third_party/requests/__init__.py
151
1861
# -*- coding: utf-8 -*- # __ # /__) _ _ _ _ _/ _ # / ( (- (/ (/ (- _) / _) # / """ requests HTTP library ~~~~~~~~~~~~~~~~~~~~~ Requests is an HTTP library, written in Python, for human beings. Basic GET usage: >>> import requests >>> r = requests.get('https://www.python.org') >>> ...
bsd-3-clause
martingkelly/feserial
scripts/gdb/linux/lists.py
630
2897
# # gdb helper commands and functions for Linux kernel debugging # # list tools # # Copyright (c) Thiebaud Weksteen, 2015 # # Authors: # Thiebaud Weksteen <thiebaud@weksteen.fr> # # This work is licensed under the terms of the GNU GPL version 2. # import gdb from linux import utils list_head = utils.CachedType("st...
gpl-2.0
mola/qgis
python/plugins/GdalTools/tools/widgetPluginBase.py
1
5107
# -*- coding: utf-8 -*- from PyQt4.QtCore import * from PyQt4.QtGui import * from qgis.core import * from qgis.gui import * from dialogBase import GdalToolsBaseDialog as BaseDialog import GdalTools_utils as Utils class GdalToolsBasePluginWidget: def __init__(self, iface, commandName, helpFileBaseName = None, paren...
gpl-2.0
ImpregnableProgrammer/Advent-of-Code
2016/Day_10.py
1
2375
import re # First Part def First_Part(s): Bot_Dict = {} g=0 s=s.split('\n') while 1: p=re.sub('(?<=output )\d+',lambda k:str(-int(k.group(0))-1),s[g%len(s)]) G=re.findall('-?\d+',p) if p[:3]=='bot' and G[0] in Bot_Dict.keys() and len(Bot_Dict[G[0]])>1: if sorted(Bot_Dict[G[0]]...
gpl-3.0
yantrabuddhi/nativeclient
tools/scons_to_gn/merge_data_test.py
7
2792
# Copyright (c) 2014 The Native Client 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 collections import defaultdict import pprint import sys from merge_data import CreateIndexedLookup, MergeRawTree from print_data import PrintD...
bsd-3-clause
endlessm/chromium-browser
third_party/catapult/third_party/gsutil/gslib/vendored/boto/tests/unit/vpc/test_customergateway.py
114
4610
from tests.compat import OrderedDict from tests.unit import unittest from tests.unit import AWSMockServiceTestCase from boto.vpc import VPCConnection, CustomerGateway class TestDescribeCustomerGateways(AWSMockServiceTestCase): connection_class = VPCConnection def default_body(self): return b""" ...
bsd-3-clause
garnertb/python-mapnik
test/python_tests/topojson_plugin_test.py
3
3747
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, print_function import os from nose.tools import assert_almost_equal, eq_ import mapnik from .utilities import execution_path, run_all def setup(): # All of the paths used are relative, if we run the tests # from another ...
lgpl-2.1
ubear/interactive-tutorials
suds/xsd/schema.py
192
14328
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser 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 in the hope that it will ...
apache-2.0
Bam4d/neon
neon/util/batch_writer.py
2
12809
# ---------------------------------------------------------------------------- # Copyright 2015 Nervana Systems 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.o...
apache-2.0
lyft/incubator-airflow
tests/providers/microsoft/azure/hooks/test_azure_data_lake.py
4
5669
# # 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...
apache-2.0
clld/clldfabric
clldfabric/varnish.py
1
2713
""" deploy with varnish: - apt-get install varnish - create /etc/default/varnish - create /etc/varnish/main.vcl - create /etc/varnish/sites.vcl - create /etc/varnish/sites/ (and require it to contain the correct include!) - create /etc/varnish/sites/{app.name}.vcl - /etc/init.d/varnish restart - adapt nginx site con...
apache-2.0
KiChjang/servo
tests/wpt/web-platform-tests/tools/wave/network/api/api_handler.py
6
1850
from __future__ import absolute_import from __future__ import unicode_literals import json import sys import traceback import logging try: from urllib.parse import parse_qsl except ImportError: from urlparse import parse_qsl global logger logger = logging.getLogger("wave-api-handler") class ApiHandler(object...
mpl-2.0
mcanthony/ace
static.py
71
8436
#!/usr/bin/env python """static - A stupidly simple WSGI way to serve static (or mixed) content. (See the docstrings of the various functions and classes.) Copyright (C) 2006-2009 Luke Arno - http://lukearno.com/ This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesse...
bsd-3-clause
ledtvavs/repository.ledtv
script.module.urlresolver/lib/urlresolver/plugins/anyfiles.py
7
2665
""" Copyright (C) 2014 smokdpi 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 distri...
gpl-3.0
so0k/zulip
zproject/wsgi.py
125
1178
""" WSGI config for zulip project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` se...
apache-2.0
daviddao/luminosity
sklearn-server/flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/langhebrewmodel.py
2763
11318
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Simon Montagu # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved...
bsd-3-clause
LUTAN/tensorflow
tensorflow/python/training/moving_averages_test.py
73
15366
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
mach0/QGIS
python/gui/auto_additions/qgsadvanceddigitizingdockwidget.py
10
1581
# The following has been generated automatically from src/gui/qgsadvanceddigitizingdockwidget.h QgsAdvancedDigitizingDockWidget.CadCapacities.baseClass = QgsAdvancedDigitizingDockWidget CadCapacities = QgsAdvancedDigitizingDockWidget # dirty hack since SIP seems to introduce the flags in module # monkey patching scope...
gpl-2.0
mupi/tecsaladeaula
core/migrations/0013_auto__chg_field_course_publication.py
3
10297
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Course.publication' db.alter_column(u'core_course', 'p...
agpl-3.0
KyleAMoore/KanjiNani
Android/.buildozer/android/platform/build/build/python-installs/KanjiNani/kivy/core/audio/audio_gstplayer.py
17
2653
''' Audio Gstplayer =============== .. versionadded:: 1.8.0 Implementation of a VideoBase with Kivy :class:`~kivy.lib.gstplayer.GstPlayer` This player is the preferred player, using Gstreamer 1.0, working on both Python 2 and 3. ''' from kivy.lib.gstplayer import GstPlayer, get_gst_version from kivy.core.audio impor...
gpl-3.0
shoheietzel/proj5-maps
env/lib/python3.6/site-packages/pip/_vendor/requests/packages/chardet/mbcssm.py
1783
19590
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
mit
fpadoan/metasyntactic
protobuf-2.1.0/python/stubout.py
671
4940
#!/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...
apache-2.0
bspink/django
tests/auth_tests/urls.py
189
4614
from django.conf.urls import url from django.contrib import admin from django.contrib.auth import views from django.contrib.auth.decorators import login_required from django.contrib.auth.forms import AuthenticationForm from django.contrib.auth.urls import urlpatterns as auth_urlpatterns from django.contrib.messages.api...
bsd-3-clause
mikewiebe-ansible/ansible
lib/ansible/plugins/lookup/avi.py
23
4760
# python 3 headers, required if submitting to Ansible from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ lookup: avi author: Sandeep Bandi <sandeepb@avinetworks.com> version_added: 2.9 short_description: Look up ``Avi`` objects. description: - Given an objec...
gpl-3.0
rockyzhang/zhangyanhit-python-for-android-mips
python3-alpha/python3-src/Lib/xmlrpc/server.py
45
35818
"""XML-RPC Servers. This module can be used to create simple XML-RPC servers by creating a server and either installing functions, a class instance, or by extending the SimpleXMLRPCServer class. It can also be used to handle XML-RPC requests in a CGI environment using CGIXMLRPCRequestHandler. The Doc* classes can be...
apache-2.0
Chilledheart/chromium
tools/telemetry/third_party/pyserial/serial/urlhandler/protocol_hwgrep.py
159
1526
#! python # # Python Serial Port Extension for Win32, Linux, BSD, Jython # see __init__.py # # This module implements a special URL handler that uses the port listing to # find ports by searching the string descriptions. # # (C) 2011 Chris Liechti <cliechti@gmx.net> # this is distributed under a free software license, ...
bsd-3-clause
dkarakats/edx-platform
lms/djangoapps/licenses/models.py
150
2538
import logging from django.db import models, transaction from student.models import User from xmodule_django.models import CourseKeyField log = logging.getLogger("edx.licenses") class CourseSoftware(models.Model): name = models.CharField(max_length=255) full_name = models.CharField(max_length=255) url...
agpl-3.0
caveman-dick/ansible
lib/ansible/module_utils/cloudstack.py
7
24378
# -*- coding: utf-8 -*- # # (c) 2015, René Moser <mail@renemoser.net> # # This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the aut...
gpl-3.0
AltSchool/django
tests/migrations/test_base.py
292
4620
import os import shutil import tempfile from contextlib import contextmanager from importlib import import_module from django.apps import apps from django.db import connection from django.db.migrations.recorder import MigrationRecorder from django.test import TransactionTestCase from django.test.utils import extend_sy...
bsd-3-clause
Transtech/omim
3party/protobuf/python/google/protobuf/service.py
243
9144
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redi...
apache-2.0
gauribhoite/personfinder
env/site-packages/django/template/backends/jinja2.py
91
2118
# Since this package contains a "django" module, this is required on Python 2. from __future__ import absolute_import import sys import jinja2 from django.conf import settings from django.template import TemplateDoesNotExist, TemplateSyntaxError from django.utils import six from django.utils.module_loading import im...
apache-2.0
udrg/kalibr
aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccCalibrator.py
4
9778
import aslam_backend as aopt import aslam_splines as asp import IccUtil as util import incremental_calibration as inc import kalibr_common as kc import sm import gc import numpy as np import multiprocessing import sys # make numpy print prettier np.set_printoptions(suppress=True) CALIBRATION_GROUP_ID = 0 HELPER_GROU...
bsd-3-clause
bruckhaus/challenges
python_challenges/project_euler/p003_largest_prime_factor.py
1
1769
__author__ = 'tilmannbruckhaus' # Largest prime factor # Problem 3 # The prime factors of 13195 are 5, 7, 13 and 29. # What is the largest prime factor of the number 600851475143 ? class LargestPrimeFactor: def __init__(self): pass @staticmethod def is_divisible(number, divisor): return ...
mit
jnns/wagtail
wagtail/wagtailsnippets/views/snippets.py
4
10439
from django.http import Http404 from django.shortcuts import get_object_or_404, render, redirect from django.utils.encoding import force_text from django.utils.text import capfirst from django.contrib.contenttypes.models import ContentType from django.utils.translation import ugettext as _ from django.core.urlresolvers...
bsd-3-clause
ingadhoc/surveyor
surveyor_payments/__openerp__.py
5
1696
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar) # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Pu...
agpl-3.0
javier3407/Plugin.Video.JAV.BRAR
resources/tools/update.py
17
6005
# -*- coding: utf-8 -*- #------------------------------------------------------------ # PalcoTV - XBMC Add-on by Juarrox (juarrox@gmail.com) # Version 0.2.9 (18.07.2014) #------------------------------------------------------------ # License: GPL (http://www.gnu.org/licenses/gpl-3.0.html) # Gracias a la librería plugin...
gpl-3.0
mfriesen/tentacle
src/tentacle/dht/dht_bucket_routing_table.py
1
4577
from tentacle.dht.routing_table import DHTRoutingTable, distance from math import pow MAX_BUCKET_SIZE = 8 class DHTBucket(object): def __init__(self): self._nodes = dict() def add_node(self, dhtNode): self._nodes[dhtNode._id] = dhtNode def is_bucket_full(self): return len(self._...
apache-2.0
Alwnikrotikz/androguard
androguard/decompiler/decompiler.py
38
16547
# This file is part of Androguard. # # Copyright (C) 2013, Anthony Desnos <desnos at t0t0.fr> # 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...
apache-2.0
Alwnikrotikz/cortex-vfx
test/IECore/MemoryUsage.py
9
2757
########################################################################## # # Copyright (c) 2007, Image Engine Design 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: # # * Redistribu...
bsd-3-clause
vipullakhani/mi-instrument
mi/dataset/parser/test/test_velpt_ab.py
7
29210
#!/usr/bin/env python """ @package mi.dataset.parser.test.test_velpt_ab @file mi-dataset/mi/dataset/parser/test/test_velpt_ab_dcl.py @author Chris Goodrich @brief Test code for the velpt_ab parser """ __author__ = 'Chris Goodrich' import os import re from nose.plugins.attrib import attr from mi.core.exceptions imp...
bsd-2-clause
ylatuya/Flumotion
flumotion/test/test_component_providers.py
1
11789
# vi:si:et:sw=4:sts=4:ts=4 # # Flumotion - a streaming media server # Copyright (C) 2004,2005,2006,2007 Fluendo, S.L. (www.fluendo.com). # All rights reserved. # This file may be distributed and/or modified under the terms of # the GNU General Public License version 2 as published by # the Free Software Foundation. # ...
gpl-2.0
GTHubT/GTSever
src/cpp/GTServer/third_party/JSONParser/jsoncpp-1.8.1/devtools/licenseupdater.py
3
3941
"""Updates the license text in source file. """ from __future__ import print_function # An existing license is found if the file starts with the string below, # and ends with the first blank line. LICENSE_BEGIN = "// Copyright " BRIEF_LICENSE = LICENSE_BEGIN + """2007-2010 The JsonCpp Authors // Distributed under MIT...
gpl-3.0
kadaradam/ScavengeSurvive
misc/coordheatmap.py
2
1715
import timeit import os import copy import io import re import itertools as IT from PIL import Image, ImageDraw, ImageColor, ImageFont import heatmap o = re.compile(r'CreateObject\(([0-9]+),\s*([\-\+]?[0-9]*\.[0-9]+),\s*([\-\+]?[0-9]*\.[0-9]+),\s*([\-\+]?[0-9]*\.[0-9]+),\s*([\-\+]?[0-9]*\.[0-9]+),\s*([\-\+]?[0-9]*\.[...
gpl-3.0
dims/neutron
neutron/plugins/ml2/drivers/mech_sriov/agent/common/exceptions.py
4
1249
# Copyright 2014 Mellanox Technologies, Ltd # # 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
lonnon/passphrase
passphrase.py
1
1042
#!/usr/bin/env python # passphrase # # Generates a passphrase from random words (four by default, number may # be specified as first argument on command line). By default, words are # between 6 and 10 characters in length. Different minimum and maximum # word lengths may be specified in the seconda and third command l...
mit
wolfskaempf/ga_statistics
lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/base.py
102
1620
from django.conf import settings from django.db.backends.base.base import NO_DB_ALIAS from django.db.backends.postgresql_psycopg2.base import \ DatabaseWrapper as Psycopg2DatabaseWrapper from django.utils.functional import cached_property from .creation import PostGISCreation from .features import DatabaseFeatures...
mit
ZenDevelopmentSystems/scikit-learn
examples/applications/plot_tomography_l1_reconstruction.py
204
5442
""" ====================================================================== Compressive sensing: tomography reconstruction with L1 prior (Lasso) ====================================================================== This example shows the reconstruction of an image from a set of parallel projections, acquired along dif...
bsd-3-clause
MSusik/invenio
invenio/legacy/bibcatalog/task.py
3
16234
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2013 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 ## License, or (at your option) a...
gpl-2.0
nkrim/passwordgen
src/worddict.py
1
4612
# Copyright 2017 Noah Krim # 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, softw...
apache-2.0
wireservice/agate
agate/aggregations/mad.py
4
1347
#!/usr/bin/env python from agate.aggregations.base import Aggregation from agate.aggregations.has_nulls import HasNulls from agate.aggregations.median import Median from agate.data_types import Number from agate.exceptions import DataTypeError from agate.utils import median from agate.warns import warn_null_calculatio...
mit
robkinyon/python-oauth2
oauth2/clients/smtp.py
884
1680
""" The MIT License Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel 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 ...
mit
benspaulding/django
django/contrib/humanize/templatetags/humanize.py
6
8164
from __future__ import unicode_literals import re from datetime import date, datetime, timedelta from django import template from django.conf import settings from django.template import defaultfilters from django.utils.encoding import force_unicode from django.utils.formats import number_format from django.utils.trans...
bsd-3-clause
wavefrontHQ/python-client
wavefront_api_client/api/access_policy_api.py
1
11678
# coding: utf-8 """ Wavefront REST API <p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the Wavefront REST ...
apache-2.0
ustramooner/CouchPotato
library/mako/pyparser.py
21
16885
# ast.py # Copyright (C) Mako developers # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Handles parsing of Python code. Parsing to AST is done via _ast on Python > 2.5, otherwise the compiler module is used. """ from StringIO import Stri...
gpl-3.0
bac/horizon
openstack_dashboard/enabled/_1070_project_ng_details_panel.py
7
1183
# (c) Copyright 2015 Hewlett-Packard Development Company, L.P. # # 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 appli...
apache-2.0
777jon/g3_kernel
Documentation/networking/cxacru-cf.py
14668
1626
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # # This program i...
gpl-2.0
Lujeni/ansible
lib/ansible/modules/network/files/net_get.py
47
2165
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2018, 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
RaoUmer/django
tests/modeltests/get_or_create/tests.py
68
2499
from __future__ import absolute_import from datetime import date import traceback from django.db import IntegrityError from django.test import TestCase from .models import Person, ManualPrimaryKeyTest class GetOrCreateTests(TestCase): def test_get_or_create(self): p = Person.objects.create( ...
bsd-3-clause
back-to/streamlink
src/streamlink/plugins/crunchyroll.py
1
13696
import argparse import datetime import re import logging from uuid import uuid4 from streamlink.plugin import Plugin, PluginError, PluginArguments, PluginArgument from streamlink.plugin.api import validate from streamlink.stream import HLSStream log = logging.getLogger(__name__) STREAM_WEIGHTS = { "low": 240, ...
bsd-2-clause
chjost/clebsch_gordan
group/quat.py
1
6929
"""Class for the quaternions with inversion.""" import numpy as np import utils # quaternion parameters for the group O from Table 71.1 in: # Simon L. Altmann, Peter Herzig, "Point-Group Theory Tables", # Second Edition (corrected), Wien (2011) V12 = np.sqrt(0.5) # sqrt(1/2) # [[ lambda, Lambda_1, Lambda_2, Lambd...
gpl-3.0
mozilla/captain
vendor/lib/python/django_browserid/tests/test_auth.py
10
7619
# 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/. from django.conf import settings from django.contrib.auth.models import User from django.db import IntegrityError from dj...
mpl-2.0
kmee/odoo-brazil-banking
l10n_br_account_banking_payment_cnab/model/payment_mode.py
1
2946
# -*- coding: utf-8 -*- # ############################################################################# # # # Copyright (C) 2012 KMEE (http://www.kmee.com.br) # @author Fernando Marcato Rodrigues # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero ...
agpl-3.0
cortesi/qtile
libqtile/widget/prompt.py
1
27051
# -*- coding: utf-8 -*- # Copyright (c) 2010-2011 Aldo Cortesi # Copyright (c) 2010 Philip Kranz # Copyright (c) 2011 Mounier Florian # Copyright (c) 2011 Paul Colomiets # Copyright (c) 2011-2012 roger # Copyright (c) 2011-2012, 2014 Tycho Andersen # Copyright (c) 2012 Dustin Lacewell # Copyright (c) 2012 Laurie Clark-...
mit
paterson/servo
tests/wpt/harness/wptrunner/browsers/__init__.py
134
1535
# 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/. """Subpackage where each product is defined. Each product is created by adding a a .py file containing a __wptrunner__ v...
mpl-2.0
3nd0y/esp8266-dht22
lib/ArduinoJson-master/third-party/gtest-1.7.0/test/gtest_output_test.py
1733
12005
#!/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...
unlicense
TheGhostHuCodes/spy_dir
spy_dir.py
1
2182
#!/usr/bin/env python import os import os.path as pt import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl import argparse #TODO: take decimal places as parameter for printing. def sizeof_pp(num): for unit in ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB']: if abs(num) < 1024....
apache-2.0
MichaelDoyle/Diamond
src/collectors/diskusage/diskusage.py
15
10481
# coding=utf-8 """ Collect IO Stats Note: You may need to artificially generate some IO load on a disk/partition before graphite will generate the metrics. * http://www.kernel.org/doc/Documentation/iostats.txt #### Dependencies * /proc/diskstats """ import diamond.collector import diamond.convertor import time...
mit
hdinsight/hue
desktop/core/ext-py/boto-2.38.0/boto/ec2/instancestatus.py
181
6854
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. # All Rights Reserved # # 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...
apache-2.0
tadebayo/myedge
myvenv/Lib/site-packages/setuptools/monkey.py
80
5255
""" Monkey patching of distutils. """ import sys import distutils.filelist import platform import types import functools import inspect from .py26compat import import_module import six import setuptools __all__ = [] """ Everything is private. Contact the project team if you think you need this functionality. """ ...
mit
Thanu/stratos
components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/thrift/thrift/protocol/TProtocol.py
19
10843
# # 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