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 |
|---|---|---|---|---|---|
BaladiDogGames/baladidoggames.github.io | mingw/bin/lib/string.py | 124 | 20756 | """A collection of string operations (most are no longer used).
Warning: most of the code you see here isn't normally used nowadays.
Beginning with Python 1.6, many of these functions are implemented as
methods on the standard string object. They used to be implemented by
a built-in module called strop, but strop is n... | mit |
Integral-Technology-Solutions/ConfigNOW-4.3 | Lib/bdb.py | 4 | 18155 | """Debugger basics"""
import sys
import os
import types
__all__ = ["BdbQuit","Bdb","Breakpoint"]
BdbQuit = 'bdb.BdbQuit' # Exception to give up completely
class Bdb:
"""Generic Python debugger base class.
This class takes care of details of the trace facility;
a derived class should implement user in... | mit |
Pynitus-Universe/Pynitus-Backend | Pynitus/io/config.py | 2 | 1510 | """
Pynitus - A free and democratic music playlist
Copyright (C) 2017 Noah Hummel
This file is part of the Pynitus program, see <https://github.com/strangedev/Pynitus>.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License... | agpl-3.0 |
axelkennedal/dissen | dissenEnv/lib/python3.5/site-packages/pip/_vendor/__init__.py | 128 | 4647 | """
pip._vendor is for vendoring dependencies of pip to prevent needing pip to
depend on something external.
Files inside of pip._vendor should be considered immutable and should only be
updated to versions from upstream.
"""
from __future__ import absolute_import
import glob
import os.path
import sys
# Downstream r... | mit |
mindriot101/bokeh | bokeh/sampledata/tests/test_us_holidays.py | 3 | 1990 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | bsd-3-clause |
edubrunaldi/kivy | examples/canvas/rounded_rectangle.py | 31 | 4596 | # -*- coding: utf-8 -*-
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.graphics import Color, Ellipse, Rectangle, RoundedRectangle
from kivy.uix.label import Label
from kivy.lang import Builder
from kivy.factory import Factory
TEXTURE = 'kiwi.jpg'
YELLOW = (1, .7, 0)
ORANGE = (1, .45, 0)
RED = (... | mit |
mzizzi/ansible | lib/ansible/modules/network/vyos/vyos_system.py | 40 | 6296 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# 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.
... | gpl-3.0 |
lordB8r/polls | ENV/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/version.py | 331 | 1502 | """
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 8.3.6
# EnterpriseDB 8.3
# PostgreSQL 8.3 beta4
# PostgreSQL 8.4beta1
VERSION_RE = re.compile(r'\S+ (\d+)\.(\d+)\.?(\d+)?')
def _parse_... | mit |
barseghyanartur/django-debug-toolbar | docs/conf.py | 1 | 8991 | # -*- coding: utf-8 -*-
#
# Django Debug Toolbar documentation build configuration file, created by
# sphinx-quickstart on Sun Oct 27 13:18:25 2013.
#
# 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... | bsd-3-clause |
fourks/moveonpc | contrib/create_move.py | 7 | 2645 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# PS Move API - An interface for the PS Move Motion Controller
# Copyright (c) 2012 Thomas Perl <m@thp.io>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are me... | bsd-2-clause |
andreaso/ansible | lib/ansible/plugins/terminal/sros.py | 43 | 1387 | #
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | gpl-3.0 |
hayderimran7/zulip | zilencer/management/commands/profile_request.py | 117 | 1632 | from __future__ import absolute_import
from optparse import make_option
from django.core.management.base import BaseCommand
from zerver.models import get_user_profile_by_email, UserMessage
from zerver.views.old_messages import get_old_messages_backend
import cProfile
import logging
from zerver.middleware import LogReq... | apache-2.0 |
santisiri/popego | envs/ALPHA-POPEGO/lib/python2.5/site-packages/Mako-0.1.8-py2.5.egg/mako/filters.py | 5 | 5324 | # filters.py
# Copyright (C) 2006, 2007 Geoffrey T. Dairiki <dairiki@dairiki.org> and Michael Bayer <mike_mp@zzzcomputing.com>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import re, cgi, urllib, htmlentitydefs, codecs
from StringIO import... | bsd-3-clause |
opoplawski/ansible | lib/ansible/compat/tests/mock.py | 258 | 1241 | # (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 |
anushreejangid/condoor | tests/system/test_connection_nx9k.py | 1 | 2862 | from tests.system.common import CondoorTestCase, StopTelnetSrv, StartTelnetSrv
from tests.dmock.dmock import NX9KHandler
from tests.utils import remove_cache_file
import condoor
class TestNX9KConnection(CondoorTestCase):
@StartTelnetSrv(NX9KHandler, 10024)
def setUp(self):
CondoorTestCase.setUp(self)... | apache-2.0 |
batxes/4Cin | Six_mouse_models/Six_mouse_models_final_output_0.2_-0.1_11000/Six_mouse_models11017.py | 2 | 18199 | import _surface
import chimera
try:
import chimera.runCommand
except:
pass
from VolumePath import markerset as ms
try:
from VolumePath import Marker_Set, Link
new_marker_set=Marker_Set
except:
from VolumePath import volume_path_dialog
d= volume_path_dialog(True)
new_marker_set= d.new_marker_set
marker_set... | gpl-3.0 |
kaolalotree/shadowsocks | shadowsocks/encrypt.py | 990 | 5180 | #!/usr/bin/env python
#
# Copyright 2012-2015 clowwindy
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | apache-2.0 |
ppapadeas/wprevents | vendor-local/lib/python/dateutil/tzwin.py | 227 | 5737 | # This code was originally contributed by Jeffrey Harris.
import datetime
import struct
import winreg
__all__ = ["tzwin", "tzwinlocal"]
ONEWEEK = datetime.timedelta(7)
TZKEYNAMENT = r"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones"
TZKEYNAME9X = r"SOFTWARE\Microsoft\Windows\CurrentVersion\Time Zones"
TZLOC... | bsd-3-clause |
ricardogsilva/QGIS | python/plugins/processing/gui/RenderingStyles.py | 30 | 2638 | # -*- coding: utf-8 -*-
"""
***************************************************************************
RenderingStyles.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***********************... | gpl-2.0 |
B-MOOC/edx-platform | cms/djangoapps/contentstore/features/transcripts.py | 46 | 8895 | # disable missing docstring
# pylint: disable=missing-docstring
import os
from lettuce import world, step
from django.conf import settings
from xmodule.contentstore.content import StaticContent
from xmodule.contentstore.django import contentstore
from xmodule.exceptions import NotFoundError
from splinter.request_han... | agpl-3.0 |
dhuang/incubator-airflow | airflow/contrib/hooks/qubole_hook.py | 11 | 8457 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | apache-2.0 |
valiantljk/graph-partition | linalg/tests/test_laplacian.py | 40 | 5461 | from nose import SkipTest
import networkx as nx
from networkx.generators.degree_seq import havel_hakimi_graph
class TestLaplacian(object):
numpy=1 # nosetests attribute, use nosetests -a 'not numpy' to skip test
@classmethod
def setupClass(cls):
global numpy
global scipy
global ass... | gpl-2.0 |
chubbymaggie/pwndbg | pwndbg/commands/ropper.py | 5 | 1298 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import subprocess
import tempfile
import gdb
import pwndbg.commands
import pwndbg.vmmap
parser = argparse... | mit |
nishad-jobsglobal/odoo-marriot | addons/l10n_br/__init__.py | 430 | 1403 | # -*- encoding: utf-8 -*-
###############################################################################
# #
# Copyright (C) 2009 Renato Lima - Akretion #
# ... | agpl-3.0 |
ofir123/CouchPotatoServer | libs/suds/xsd/sxbuiltin.py | 193 | 7297 | # 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 ... | gpl-3.0 |
mdrumond/tensorflow | tensorflow/python/kernel_tests/reader_dataset_ops_test.py | 4 | 27094 | # 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 |
Hammer2900/clamor | sessions.py | 1 | 2569 | #############################################################
# The unofficial Sessions addon for Bottle (bottlepy.org) #
# Made by Magnie (magnie.tk) and Ohaider (fallingduck.tk) #
# License: MIT #
#############################################################
#########... | mit |
mpeuster/son-emu | src/emuvim/api/osm/lcm.py | 1 | 1660 | #!/usr/bin/env python2
# Copyright (c) 2019 Erik Schilling
# 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 ... | apache-2.0 |
jantman/kvmdash | kvmdash/tests/test_util.py | 1 | 2671 | """
Tests for the util module
"""
import pytest
from kvmdash.util import calculate_host_resources
def test_calculate_host_resources():
hosts = {}
hosts['foo'] = {"data": {"maxvcpus": 16, "df_bytes": 12345678, "hostname": "foo", "memory_bytes": 1000}, "type": "host", "name": "foo"}
hosts['bar'] = {"data":... | agpl-3.0 |
Brett55/moto | tests/test_polly/test_polly.py | 8 | 7820 | from __future__ import unicode_literals
from botocore.exceptions import ClientError
import boto3
import sure # noqa
from nose.tools import assert_raises
from moto import mock_polly
# Polly only available in a few regions
DEFAULT_REGION = 'eu-west-1'
LEXICON_XML = """<?xml version="1.0" encoding="UTF-8"?>
<lexicon v... | apache-2.0 |
2013Commons/hue | desktop/core/ext-py/guppy-0.1.10/guppy/heapy/Monitor.py | 37 | 12734 | #._cv_part guppy.heapy.Monitor
import os, pprint, signal, socket, SocketServer, sys, threading, time, traceback
import cPickle as pickle
try:
import readline # Imported to _enable_ command line editing
except ImportError:
pass
import select, Queue
from guppy.heapy.RemoteConstants import *
from guppy.heapy.Co... | apache-2.0 |
hayderimran7/tempest | tempest/api/image/v1/test_images.py | 8 | 12353 | # Copyright 2012 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 |
xifle/home-assistant | homeassistant/components/notify/instapush.py | 11 | 2966 | """
Instapush notification service.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/notify.instapush/
"""
import json
import logging
import requests
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.compone... | mit |
rafalkowalski/open-event-orga-server | tests/unittests/test_db_performance.py | 5 | 3907 | import time
import unittest
from flask import url_for
from flask.ext.sqlalchemy import get_debug_queries
from werkzeug.contrib.profiler import ProfilerMiddleware
from app import current_app as app
from app.models import db
from config import ProductionConfig
from populate_db import populate
from tests.unittests.objec... | gpl-3.0 |
ecosoft-odoo/odoo | addons/pos_restaurant/restaurant.py | 325 | 2246 | # -*- 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/verify_student/tests/fake_software_secure.py | 73 | 1697 | """
Fake Software Secure page for use in acceptance tests.
"""
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.utils.decorators import method_decorator
from django.views.generic.base import View
from edxmako.shortcuts ... | agpl-3.0 |
xadahiya/django | django/db/models/query.py | 25 | 67826 | """
The main QuerySet implementation. This provides the public API for the ORM.
"""
import copy
import sys
import warnings
from collections import OrderedDict, deque
from django.conf import settings
from django.core import exceptions
from django.db import (
DJANGO_VERSION_PICKLE_KEY, IntegrityError, connections, ... | bsd-3-clause |
zhukaixy/kbengine | kbe/res/scripts/common/Lib/quopri.py | 69 | 7250 | #! /usr/bin/env python3
"""Conversions to/from quoted-printable transport encoding as per RFC 1521."""
# (Dec 1991 version).
__all__ = ["encode", "decode", "encodestring", "decodestring"]
ESCAPE = b'='
MAXLINESIZE = 76
HEX = b'0123456789ABCDEF'
EMPTYSTRING = b''
try:
from binascii import a2b_qp, b2a_qp
except ... | lgpl-3.0 |
CyanogenMod/android_kernel_motorola_msm8960-common | tools/perf/python/twatch.py | 3213 | 1338 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
stephenmcd/drawnby | core/migrations/0004_auto__chg_field_drawing_data.py | 2 | 4403 | # encoding: 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):
# Changing field 'Drawing.data'
db.alter_column('core_drawing', 'data', self.gf('django.db.models.fields.T... | bsd-2-clause |
Srisai85/scipy | scipy/optimize/tests/test_cobyla.py | 100 | 3562 | from __future__ import division, print_function, absolute_import
import math
import numpy as np
from numpy.testing import assert_allclose, TestCase, run_module_suite, \
assert_
from scipy.optimize import fmin_cobyla, minimize
class TestCobyla(TestCase):
def setUp(self):
self.x0 = [4.95, 0.66]
... | bsd-3-clause |
a-parhom/edx-platform | openedx/features/course_experience/utils.py | 2 | 6659 | """
Common utilities for the course experience, including course outline.
"""
from completion.models import BlockCompletion
from lms.djangoapps.course_api.blocks.api import get_blocks
from lms.djangoapps.course_blocks.utils import get_student_module_as_dict
from opaque_keys.edx.keys import CourseKey
from openedx.core.... | agpl-3.0 |
tacaswell/bokeh | bokeh/io.py | 39 | 14856 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2015, Continuum Analytics, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#----------------------------------------... | bsd-3-clause |
grongor/school_rfid | lib/nmap-6.40/zenmap/radialnet/gui/RadialNet.py | 1 | 67333 | # vim: set encoding=utf-8 :
# ***********************IMPORTANT NMAP LICENSE TERMS************************
# * *
# * The Nmap Security Scanner is (C) 1996-2013 Insecure.Com LLC. Nmap is *
# * also a registered trademark of Insecure.Com LLC. Thi... | gpl-2.0 |
bbc/kamaelia | Sketches/MPS/pprocess/ProcessPipelineNotComponent.py | 3 | 3481 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#...x....1....x....2....x....3....x....4....x....5....x.
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# no... | apache-2.0 |
souravsingh/sympy | sympy/simplify/ratsimp.py | 13 | 7527 | from __future__ import print_function, division
from itertools import combinations_with_replacement
from sympy.core import symbols, Add, Dummy
from sympy.core.numbers import Rational
from sympy.polys import cancel, ComputationFailed, parallel_poly_from_expr, reduced, Poly
from sympy.polys.monomials import Monomial, mo... | bsd-3-clause |
zephyrplugins/zephyr | zephyr.plugin.jython/jython2.5.2rc3/Lib/sre_constants.py | 349 | 7137 | #
# Secret Labs' Regular Expression Engine
#
# various symbols used by the regular expression engine.
# run this script to update the _sre include files!
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support modul... | epl-1.0 |
hbrunn/OCB | addons/l10n_fr/l10n_fr.py | 336 | 2089 | # -*- 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 |
keedio/hue | desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/SelfTest/Cipher/test_DES.py | 119 | 15009 | # -*- coding: utf-8 -*-
#
# SelfTest/Cipher/DES.py: Self-test for the (Single) DES cipher
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedicat... | apache-2.0 |
yaii/yai | share/extensions/motion.py | 6 | 4713 | #!/usr/bin/env python
'''
Copyright (C) 2005 Aaron Spike, aaron@ekips.org
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.
Thi... | gpl-2.0 |
b0ttl3z/SickRage | lib/requests/sessions.py | 17 | 27144 | # -*- coding: utf-8 -*-
"""
requests.session
~~~~~~~~~~~~~~~~
This module provides a Session object to manage and persist settings across
requests (cookies, auth, proxies).
"""
import os
import platform
import time
from collections import Mapping
from datetime import timedelta
from .auth import _basic_auth_str
from ... | gpl-3.0 |
40423152/2017springcd_hw | plugin/liquid_tags/mdx_liquid_tags.py | 281 | 3447 | """
Markdown Extension for Liquid-style Tags
----------------------------------------
A markdown extension to allow user-defined tags of the form::
{% tag arg1 arg2 ... argn %}
Where "tag" is associated with some user-defined extension.
These result in a preprocess step within markdown that produces
either markdo... | agpl-3.0 |
dquartul/BLonD | blond/monitors/monitors.py | 2 | 20935 |
# Copyright 2016 CERN. This software is distributed under the
# terms of the GNU General Public Licence version 3 (GPL Version 3),
# copied verbatim in the file LICENCE.md.
# In applying this licence, CERN does not waive the privileges and immunities
# granted to it by virtue of its status as an Intergovernmental Orga... | gpl-3.0 |
alex-pardo/ANLP-PROJECT | parseCities.py | 1 | 3827 |
import re
from string import *
import sys
from nltk import *
import locale
from wikitools import wiki
from wikitools import api
from wikitools import page
from wikitools import category
wikiAPI = {
'en': "http://en.wikipedia.org/w/api.php"}
site = wiki.Wiki(wikiAPI['en'])
##An object of the class Page ass... | apache-2.0 |
mohsenmalmir/DeepLearningStack | DeepLearningStack/ConvNet/LRN.py | 1 | 1984 | import os
import sys
import time
import numpy as np
import theano
import theano.tensor as T
from pylearn2.sandbox.cuda_convnet.filter_acts import FilterActs
from theano.sandbox.cuda.basic_ops import gpu_contiguous
from pylearn2.sandbox.cuda_convnet.pool import MaxPool
from pylearn2.sandbox.c... | mit |
ccubed/Earl | unit_tests.py | 1 | 1812 | # -*- coding: utf-8; -*-
import unittest
import earl
class TestEarlPacking(unittest.TestCase):
def test_smallint(self):
self.assertEqual(earl.pack(10), bytes([131,97,10]))
def test_bigint(self):
self.assertEqual(earl.pack(1200), bytes([131,98,0,0,4,176]))
def test_floats(self):
se... | mit |
pombredanne/django-inplaceedit | testing/urls.py | 3 | 1057 | # -*- coding: utf-8 -*-
from django.conf import settings
from django.conf.urls.defaults import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
js_info_dict = {
'packages': ('django.conf',),
}
urlpatterns = patterns('',
# Exampl... | lgpl-3.0 |
suncycheng/intellij-community | python/lib/Lib/site-packages/django/contrib/gis/tests/relatedapp/tests.py | 123 | 13948 | from django.test import TestCase
from django.contrib.gis.geos import GEOSGeometry, Point, MultiPoint
from django.contrib.gis.db.models import Collect, Count, Extent, F, Union
from django.contrib.gis.geometry.backend import Geometry
from django.contrib.gis.tests.utils import mysql, oracle, no_mysql, no_oracle, no_spati... | apache-2.0 |
voxmedia/thumbor | thumbor/filters/blur.py | 3 | 1703 | # -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com thumbor@googlegroups.com
import math
from thumbor.filters import BaseFilter, filter_method
from thumbor.ext.fi... | mit |
Versatilus/dragonfly | dragonfly/actions/keyboard/_pynput.py | 2 | 8733 | #
# This file is part of Dragonfly.
# (c) Copyright 2007, 2008 by Christo Butcher
# Licensed under the LGPL.
#
# Dragonfly is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the L... | lgpl-3.0 |
michaelni/audacity | lib-src/lv2/sord/waflib/Build.py | 58 | 21119 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,sys,errno,re,shutil
try:
import cPickle
except ImportError:
import pickle as cPickle
from waflib import Runner,TaskGen,Utils,ConfigSet,Task,Logs,Options,Context,Er... | gpl-2.0 |
reneklacan/kivybomber | map.py | 1 | 12240 |
import random
from threading import Lock, Timer
from kivy.logger import Logger
from kivy.uix.gridlayout import GridLayout
from kivy.uix.relativelayout import RelativeLayout
from ai import AIMap
from components import game_objects
from constants import *
from effects import *
flame_lock = Lock()
class GameGrid(GridL... | bsd-3-clause |
hopeall/odoo | addons/crm_helpdesk/crm_helpdesk.py | 182 | 7480 | # -*- 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 |
joone/chromium-crosswalk | build/detect_host_arch.py | 111 | 1179 | #!/usr/bin/env 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.
"""Outputs host CPU architecture in format recognized by gyp."""
import platform
import re
import sys
def HostArch():
"""Returns t... | bsd-3-clause |
Ballz0fSteel/Umeko | lib/youtube_dl/downloader/common.py | 10 | 14495 | from __future__ import division, unicode_literals
import os
import re
import sys
import time
import random
from ..compat import compat_os_name
from ..utils import (
decodeArgument,
encodeFilename,
error_to_compat_str,
format_bytes,
shell_quote,
timeconvert,
)
class FileDownloader(object):
... | gpl-3.0 |
piffey/ansible | contrib/inventory/softlayer.py | 41 | 7172 | #!/usr/bin/env python
"""
SoftLayer external inventory script.
The SoftLayer Python API client is required. Use `pip install softlayer` to install it.
You have a few different options for configuring your username and api_key. You can pass
environment variables (SL_USERNAME and SL_API_KEY). You can also write INI file... | gpl-3.0 |
mrquim/mrquimrepo | script.module.exodus/lib/resources/lib/sources/de/streamdream.py | 5 | 4468 | # -*- coding: utf-8 -*-
"""
Exodus Add-on
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 progra... | gpl-2.0 |
Tufin/pytos | pytos/securechange/xml_objects/restapi/step/access_request/analysisresult.py | 1 | 1035 |
from pytos.securechange.xml_objects.restapi.step.initialize import *
class Analysis_Result(XML_Object_Base):
IMPLEMENTED = "implemented"
NOT_AVAILABLE = "not available"
NOT_IMPLEMENTED = "not implemented"
NOT_RUN = "not run"
VERIFIED = "verified"
def __init__(self, xml_tag, status):
... | apache-2.0 |
QijunPan/ansible | lib/ansible/utils/module_docs_fragments/aws.py | 14 | 3154 | # (c) 2014, Will Thames <will@thames.id.au>
#
# 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... | gpl-3.0 |
ehomeshasha/easydata | pdf/forms.py | 1 | 1391 | from __future__ import unicode_literals
from easydata.constant import CONTENT_TYPE
from django import forms
from django.utils.translation import ugettext_lazy as _
class PDFUploadForm(forms.Form):
title = forms.CharField(
label=_("Title"),
min_length=2,
max_length=100,
widget... | mit |
mancoast/CPythonPyc_test | cpython/240_test_itertools.py | 10 | 32935 | import unittest
from test import test_support
from itertools import *
from weakref import proxy
import sys
import operator
import random
def onearg(x):
'Test function of one argument'
return 2*x
def errfunc(*args):
'Test function that raises an error'
raise ValueError
def gen3():
'Non-restartable... | gpl-3.0 |
abhikumar22/MYBLOG | blg/Lib/site-packages/django-1.11.7-py3.6.egg/django/core/files/storage.py | 51 | 18802 | import errno
import os
import warnings
from datetime import datetime
from django.conf import settings
from django.core.exceptions import SuspiciousFileOperation
from django.core.files import File, locks
from django.core.files.move import file_move_safe
from django.core.signals import setting_changed
from django.utils ... | gpl-3.0 |
Hybrid-Cloud/cinder | cinder/volume/drivers/emc/emc_vmax_masking.py | 1 | 124507 | # Copyright (c) 2012 - 2015 EMC 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
#
# Unle... | apache-2.0 |
kaze/paasmaker | paasmaker/common/stats/base.py | 2 | 1797 | #
# Paasmaker - Platform as a Service
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
import paasmaker
import tornado.testing
import colander
class BaseStatsConfi... | mpl-2.0 |
ms-iot/python | cpython/Lib/test/test_normalization.py | 7 | 3162 | from test.support import open_urlresource
import unittest
from http.client import HTTPException
import sys
import os
from unicodedata import normalize, unidata_version
TESTDATAFILE = "NormalizationTest.txt"
TESTDATAURL = "http://www.pythontest.net/unicode/" + unidata_version + "/" + TESTDATAFILE
def check_version(te... | bsd-3-clause |
marratj/ansible | lib/ansible/modules/network/f5/bigip_snmp.py | 10 | 7491 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUM... | gpl-3.0 |
harshita-gupta/Harvard-FRSEM-Catalog-2016-17 | flask/lib/python2.7/site-packages/flask/globals.py | 322 | 1645 | # -*- coding: utf-8 -*-
"""
flask.globals
~~~~~~~~~~~~~
Defines all the global objects that are proxies to the current
active context.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from functools import partial
from werkzeug.local import LocalStack, ... | mit |
mxtthias/mcomix | mcomix/file_chooser_base_dialog.py | 2 | 11047 | """filechooser_chooser_base_dialog.py - Custom FileChooserDialog implementations."""
import os
import mimetypes
import fnmatch
import gtk
import pango
from mcomix.preferences import prefs
from mcomix import image_tools
from mcomix import labels
from mcomix import constants
from mcomix import log
from mcomix import th... | gpl-2.0 |
n1ck3/dzentinel | lib/python3.3/site-packages/setuptools/tests/test_markerlib.py | 449 | 2506 | import os
import unittest
from setuptools.tests.py26compat import skipIf
try:
import ast
except ImportError:
pass
class TestMarkerlib(unittest.TestCase):
@skipIf('ast' not in globals(),
"ast not available (Python < 2.6?)")
def test_markers(self):
from _markerlib import interpret, defa... | gpl-2.0 |
hugochan/KATE | run_doc_word2vec.py | 1 | 1505 | '''
Created on Jan, 2017
@author: hugo
'''
from __future__ import absolute_import
import argparse
from os import path
import numpy as np
from autoencoder.preprocessing.preprocessing import load_corpus
from autoencoder.baseline.doc_word2vec import load_w2v, doc_word2vec, get_similar_words
from autoencoder.utils.io_ut... | bsd-3-clause |
arunjitsingh/playlist | storage/models.py | 1 | 1433 | # Copyright 2012 Arunjit Singh. All Rights Reserved.
"""Application models.
There are 3 basic models:
Song: duh.
Playlist: Stores a list of references to Song (a la "collection")
User: Stores a list of references to playlist (a la "collection")
Each model has an ancestor, which is its immediate parent collection:
S... | mit |
jlmadurga/microbot | permabots/test/factories/handler.py | 2 | 1121 | # coding=utf-8
from factory import DjangoModelFactory, SubFactory, Sequence
from permabots.models import Handler, Request, UrlParam, HeaderParam
from permabots.test.factories import BotFactory, ResponseFactory
class RequestFactory(DjangoModelFactory):
class Meta:
model = Request
url_template = "https:... | bsd-3-clause |
abhishek-ch/hue | desktop/core/ext-py/South-1.0.2/south/db/oracle.py | 91 | 14581 | from __future__ import print_function
import os.path
import sys
import re
import warnings
import cx_Oracle
from django.db import connection, models
from django.db.backends.util import truncate_name
from django.core.management.color import no_style
from django.db.models.fields import NOT_PROVIDED
from dj... | apache-2.0 |
dbreen/games | games/utils/decorators.py | 1 | 1299 | from functools import wraps
from django.http import HttpResponse
from django.template.context import RequestContext
from django.shortcuts import render_to_response
from django.utils import simplejson
def render_to(template=None, mimetype=None):
def renderer(function):
@wraps(function)
... | mit |
amatyja/AliPhysics | PWGMM/MC/aligenqa/aligenqa/settings.py | 41 | 1127 | # A list of the estimators which will be included in the plots (if available in the input file)
considered_ests = [
'EtaLt05',
'EtaLt08',
'EtaLt15',
'Eta08_15',
'V0M',
# 'V0A',
'V0C',
'ZDC',
'nMPI',
'Q2',
'spherocity',
'sphericity'
]
# Considered triggers
considered_trig... | bsd-3-clause |
jonparrott/gcloud-python | storage/noxfile.py | 2 | 3569 | # Copyright 2016 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 agreed to in writing, s... | apache-2.0 |
timothycrosley/connectable | connectable/base.py | 1 | 5518 | """connectable/Connectable.py
Connectable enables child object to create dynamic connections
(via signals/slots) at run-time. Inspired by QT's signal / slot mechanism
"""
class CombineSignals(type):
'''A meta class to automatically combine signals from base classes'''
def __new__(metaclass, name, pare... | mit |
tchernomax/ansible | test/units/modules/network/f5/test_bigip_cli_alias.py | 10 | 3822 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
import sys
from nose.plugins.skip i... | gpl-3.0 |
dmnfarrell/peat | PEATDB/plugins/Summary.py | 1 | 3157 | #!/usr/bin/env python
#
# Protein Engineering Analysis Tool DataBase (PEATDB)
# Copyright (C) 2010 Damien Farrell & Jens Erik Nielsen
#
# 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 ver... | mit |
dtamayo/rebound | rebound/tests/test_mercurius.py | 1 | 7209 | import rebound
import unittest
import os
import rebound.data as data
from datetime import datetime
class TestMercurius(unittest.TestCase):
def test_outer_solar(self):
sim = rebound.Simulation()
rebound.data.add_outer_solar_system(sim)
sim.integrator = "mercurius"
P = s... | gpl-3.0 |
rsmitty/docker | vendor/src/github.com/hashicorp/go-msgpack/codec/msgpack_test.py | 1232 | 3478 | #!/usr/bin/env python
# This will create golden files in a directory passed to it.
# A Test calls this internally to create the golden files
# So it can process them (so we don't have to checkin the files).
import msgpack, msgpackrpc, sys, os, threading
def get_test_data_list():
# get list with all primitive typ... | apache-2.0 |
s05427226/linux | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
theheros/kbengine | kbe/res/scripts/common/Lib/test/test_pep277.py | 3 | 7857 | # Test the Unicode versions of normal file functions
# open, os.open, os.stat. os.listdir, os.rename, os.remove, os.mkdir, os.chdir, os.rmdir
import sys, os, unittest
from unicodedata import normalize
from test import support
filenames = [
'1_abc',
'2_ascii',
'3_Gr\xfc\xdf-Gott',
'4_\u0393\u0... | lgpl-3.0 |
scavarda/mysql-dbcompare | mysql-utilities-1.6.0/scripts/mysqlmetagrep.py | 3 | 5356 | #!/usr/bin/python
#
# Copyright (c) 2010, 2014, Oracle and/or its affiliates. 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; version 2 of the License.
#
# This program is... | apache-2.0 |
yunhaowang/IDP-APA | utilities/py_idpapa_stat.py | 1 | 3544 | #!/usr/bin/env python
import sys,re,time,argparse
def main(args):
# print >>sys.stdout, "Start analysis: " + time.strftime("%a,%d %b %Y %H:%M:%S")
stat_list,known_sgt_na,known_sgt_pa,known_sgt_apa,known_mlt_na,known_mlt_pa,known_mlt_apa,novel_sgt_na,novel_sgt_pa,novel_sgt_apa,novel_mlt_na,novel_mlt_pa ,novel_mlt_apa ... | apache-2.0 |
runekaagaard/django-poeditor-com-field | poeditor_com_field/core.py | 1 | 6308 | from collections import namedtuple
from copy import deepcopy
import json
from celery.task.base import task
from celery.task.base import periodic_task
from celery.schedules import crontab
import requests
from django.conf import settings
from django.db.transaction import atomic
from django.core.validators import EMPTY_... | mit |
jstammers/EDMSuite | NavPython/IronPython/Lib/sunau.py | 156 | 16537 | """Stuff to parse Sun and NeXT audio files.
An audio file consists of a header followed by the data. The structure
of the header is as follows.
+---------------+
| magic word |
+---------------+
| header size |
+---------------+
| data size |
+--------... | mit |
dednal/chromium.src | tools/telemetry/telemetry/core/platform/profiler/vtune_profiler.py | 26 | 5288 | # 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.
import logging
import os
import subprocess
import sys
import tempfile
from telemetry.core import exceptions
from telemetry.core.platform import profiler
fro... | bsd-3-clause |
wyc/django | tests/flatpages_tests/test_csrf.py | 290 | 4819 | from django.contrib.auth.models import User
from django.contrib.flatpages.models import FlatPage
from django.contrib.sites.models import Site
from django.test import Client, TestCase, modify_settings, override_settings
from .settings import FLATPAGES_TEMPLATES
@modify_settings(INSTALLED_APPS={'append': 'django.contr... | bsd-3-clause |
sravel/scripts | local/renameFile.py | 1 | 3902 | #!/usr/bin/python3.5
# -*- coding: utf-8 -*-
# @package renameFile.py
# @author Sebastien Ravel
"""
The renameFile script
=====================
:author: Sebastien Ravel
:contact: sebastien.ravel@cirad.fr
:date: 08/07/2016
:version: 0.1
Script description
------------------
This Programme rename files into a... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.