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
meh/servo
tests/wpt/web-platform-tests/dom/nodes/Document-createElement-namespace-tests/generate.py
226
2091
#!/usr/bin/python import os import sys THIS_NAME = "generate.py" # Note: these lists must be kept in sync with the lists in # Document-createElement-namespace.html, and this script must be run whenever # the lists are updated. (We could keep the lists in a shared JSON file, but # seems like too much effort.) FILES =...
mpl-2.0
sbellem/django
django/contrib/contenttypes/models.py
273
7798
from __future__ import unicode_literals import warnings from django.apps import apps from django.db import models from django.db.utils import IntegrityError, OperationalError, ProgrammingError from django.utils.deprecation import RemovedInDjango110Warning from django.utils.encoding import force_text, python_2_unicode...
bsd-3-clause
popazerty/dvbapp-gui2
lib/python/Components/config.py
6
54005
from enigma import getPrevAsciiCode from Tools.NumericalTextInput import NumericalTextInput from Tools.Directories import resolveFilename, SCOPE_CONFIG, fileExists from Components.Harddisk import harddiskmanager from copy import copy as copy_copy from os import path as os_path from time import localtime, strftime # Co...
gpl-2.0
jianjunz/online-judge-solutions
leetcode/1223-graph-connectivity-with-threshold.py
2
1095
class Solution: def areConnected(self, n: int, threshold: int, queries: List[List[int]]) -> List[bool]: cities=[0]*(n+1) group={} nextGroupId=1 def union(source, to): if source==to: return for c in group[source]: ...
mit
nagnath006/Soccer-Analytics
Soccer-Analytics/Lib/encodings/utf_16_be.py
860
1037
""" Python 'utf-16-be' Codec Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ import codecs ### Codec APIs encode = codecs.utf_16_be_encode def decode(input, errors='strict'): return codecs.utf_16_be_decode(input, errors, True) class IncrementalEncod...
mpl-2.0
fucxy/ESPython
SDK/ESP8266_NONOS_SDK/tools/make_cert.py
6
1411
import os class Cert(object): def __init__(self, name, buff): self.name = name self.len = len(buff) self.buff = buff pass def __str__(self): out_str = ['\0']*32 for i in range(len(self.name)): out_str[i] = self.name[i] out_str = "".join(...
mit
mskrzypkows/servo
tests/wpt/web-platform-tests/webdriver/user_input/sendkeys_test.py
141
3188
import os import sys import random import unittest sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../.."))) import base_test repo_root = os.path.abspath(os.path.join(__file__, "../../..")) sys.path.insert(1, os.path.join(repo_root, "tools", "webdriver")) from webdriver import exceptions class SendKeysTe...
mpl-2.0
ktosiek/spacewalk
proxy/proxy/rhnConstants.py
3
1463
#!/usr/bin/python # # Copyright (c) 2008--2013 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should...
gpl-2.0
makermade/arm_android-21_arm-linux-androideabi-4.8
lib/python2.7/nntplib.py
157
21135
"""An NNTP client class based on RFC 977: Network News Transfer Protocol. Example: >>> from nntplib import NNTP >>> s = NNTP('news') >>> resp, count, first, last, name = s.group('comp.lang.python') >>> print 'Group', name, 'has', count, 'articles, range', first, 'to', last Group comp.lang.python has 51 articles, rang...
gpl-2.0
datalogics/scons
bin/memoicmp.py
2
2183
#!/usr/bin/env python # # A script to compare the --debug=memoizer output found int # two different files. import sys,string def memoize_output(fname): mout = {} lines=filter(lambda words: len(words) == 5 and words[1] == 'hits' and words[3] == 'misses', ...
mit
louietsai/python-for-android
python3-alpha/extra_modules/gdata/apps/emailsettings/client.py
48
23375
#!/usr/bin/python2.4 # # Copyright 2010 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 ...
apache-2.0
diegoguimaraes/django
django/core/mail/backends/filebased.py
35
2765
"""Email backend that writes messages to a file.""" import datetime import os from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.mail.backends.console import EmailBackend as ConsoleEmailBackend from django.utils import six class EmailBackend(ConsoleEmailBackend...
bsd-3-clause
repotvsupertuga/tvsupertuga.repository
script.module.universalscrapers/lib/universalscrapers/common.py
2
16257
import HTMLParser import json import random import re import urllib2 import urlparse import requests,os,time import xbmc,xbmcaddon USERDATA_PATH = xbmc.translatePath('special://home/userdata/addon_data') ADDON_DATA = os.path.join(USERDATA_PATH,'script.module.universalscrapers') full_file = ADDON_DATA + '/Log.txt' def ...
gpl-2.0
Benrflanders/Pytris
pyglet/gl/lib_wgl.py
41
5761
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # 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...
mit
HarmJ0y/sparta
app/settings.py
1
25730
#!/usr/bin/env python ''' SPARTA - Network Infrastructure Penetration Testing Tool (http://sparta.secforce.com) Copyright (c) 2014 SECFORCE (Antonio Quina and Leonidas Stavliotis) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published...
gpl-3.0
svn2github/chromium-depot-tools
third_party/gsutil/gslib/bucket_listing_ref.py
51
6349
# Copyright 2012 Google Inc. 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 restriction, including # without limitation the rights to use, copy, modify, merge,...
bsd-3-clause
alheinecke/tensorflow-xsmm
tensorflow/contrib/session_bundle/exporter.py
49
12341
# 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
F0rth/seafile-obsd-wip
web/main.py
1
35100
#!/usr/bin/env python2 # encoding: utf-8 import gettext import locale import os import simplejson as json import sys import platform import urllib import web from web.contrib.template import render_mako import settings from seaserv import CCNET_CONF_PATH from seaserv import ccnet_rpc, seafile_rpc, applet_rpc from se...
gpl-3.0
dmort27/panphon
panphon/bin/align_wordlists.py
1
2458
#!/usr/bin/env python from __future__ import print_function import unicodecsv as csv import argparse import panphon import Levenshtein import munkres import panphon.distance from functools import partial def levenshtein_dist(_, a, b): return Levenshtein.distance(a, b) def dogol_leven_dist(_, a, b): return ...
mit
jounex/hue
desktop/core/ext-py/Django-1.6.10/django/contrib/humanize/templatetags/humanize.py
98
9276
# -*- encoding: utf-8 -*- from __future__ import unicode_literals import re from datetime import date, datetime from decimal import Decimal from django import template from django.conf import settings from django.template import defaultfilters from django.utils.encoding import force_text from django.utils.formats imp...
apache-2.0
nvoron23/hue
apps/oozie/src/oozie/migrations/0009_auto__add_decision.py
39
20608
# 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): # Adding model 'Decision' db.create_table('oozie_decision', ( ('node_ptr', self.gf('django.db.models.f...
apache-2.0
yausern/stlab
TimeDomain_v2/AWG_station.py
2
13357
# author: Wolfgang Pfaff # modified by: Sarwan Peiter """ So I have already written the driver for the AWG. Now the next step is to write an interface to communicates with driver. An also usefull interface is to write a library to generate pulses. """ import time import logging import numpy as np import struct import ...
gpl-3.0
stewartpark/django
django/contrib/gis/geos/base.py
437
1280
from ctypes import c_void_p from django.contrib.gis.geos.error import GEOSException class GEOSBase(object): """ Base object for GEOS objects that has a pointer access property that controls access to the underlying C pointer. """ # Initially the pointer is NULL. _ptr = None # Default all...
bsd-3-clause
rossgoodwin/musapaedia
musapaedia/muse/lib/python2.7/site-packages/setuptools/tests/test_dist_info.py
148
2261
"""Test .dist-info style distributions. """ import os import shutil import tempfile import pytest import pkg_resources from .textwrap import DALS class TestDistInfo: def test_distinfo(self): dists = dict( (d.project_name, d) for d in pkg_resources.find_distributions(self.tmpdir)...
mit
victorzhao/miniblink49
third_party/skia/tools/reformat-json.py
208
1741
#!/usr/bin/python ''' Copyright 2013 Google Inc. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. ''' ''' Rewrites a JSON file to use Python's standard JSON pretty-print format, so that subsequent runs of rebaseline.py will generate useful diffs (only the actual check...
gpl-3.0
cherez/youtube-dl
youtube_dl/extractor/screencast.py
147
4200
# -*- coding: utf-8 -*- from __future__ import unicode_literals from .common import InfoExtractor from ..compat import ( compat_parse_qs, compat_urllib_request, ) from ..utils import ( ExtractorError, ) class ScreencastIE(InfoExtractor): _VALID_URL = r'https?://www\.screencast\.com/t/(?P<id>[a-zA-Z0-...
unlicense
jesramirez/odoo
addons/hr_timesheet_sheet/report/__init__.py
342
1074
# -*- 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
AmandaMoen/AmandaMoen
notes/resources/UW_IntroClass/class8.5/code/basic_app_4.py
1
7168
#!/usr/bin/env python """ Example of the very basic, minimal framework for a wxPython application This version adds a single button """ import wx import os #-------------------------------------------------------------- # This is how you pre-establish a file filter so that the dialog # only shows the extension(s) ...
gpl-2.0
jaggu303619/asylum-v2.0
openerp/addons/resource/faces/pcalendar.py
433
28436
#@+leo-ver=4 #@+node:@file pcalendar.py #@@language python #@<< Copyright >> #@+node:<< Copyright >> ############################################################################ # Copyright (C) 2005, 2006, 2007, 2008 by Reithinger GmbH # mreithinger@web.de # # This file is part of faces. # # faces is free softw...
agpl-3.0
heihachi/PokemonGo-Bot
pokemongo_bot/cell_workers/pokemon_optimizer.py
1
49784
from __future__ import unicode_literals # import datetime import difflib import itertools import json import math import os import time import datetime from pokemongo_bot import inventory from pokemongo_bot.base_dir import _base_dir from pokemongo_bot.base_task import BaseTask from pokemongo_bot.human_behaviour impor...
mit
Titulacion-Sistemas/PythonTitulacion-EV
Lib/site-packages/django/contrib/gis/geos/prototypes/__init__.py
314
1305
""" This module contains all of the GEOS ctypes function prototypes. Each prototype handles the interaction between the GEOS library and Python via ctypes. """ # Coordinate sequence routines. from django.contrib.gis.geos.prototypes.coordseq import (create_cs, get_cs, cs_clone, cs_getordinate, cs_setordinate, cs...
mit
IronLanguages/ironpython2
Src/StdLib/Lib/site-packages/win32/Demos/security/localized_names.py
34
2030
# A Python port of the MS knowledge base article Q157234 # "How to deal with localized and renamed user and group names" # http://support.microsoft.com/default.aspx?kbid=157234 import sys from win32net import NetUserModalsGet from win32security import LookupAccountSid import pywintypes from ntsecuritycon import * def...
apache-2.0
mhct/ardupilot
Tools/autotest/param_metadata/xmlemit.py
238
2717
#!/usr/bin/env python from xml.sax.saxutils import escape, quoteattr from param import * from emit import Emit # Emit APM documentation in an machine readable XML format class XmlEmit(Emit): def __init__(self): wiki_fname = 'apm.pdef.xml' self.f = open(wiki_fname, mode='w') preamble ...
gpl-3.0
apache/airflow
tests/providers/amazon/aws/hooks/test_batch_client.py
2
13457
# # 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
guorendong/iridium-browser-ubuntu
tools/telemetry/telemetry/page/page_test.py
3
7843
# 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. from telemetry.page import action_runner as action_runner_module from telemetry.page import test_expectations class TestNotSupportedOnPlatformError(Excepti...
bsd-3-clause
sunny94/temp
sympy/integrals/integrals.py
7
49446
from __future__ import print_function, division from sympy.concrete.expr_with_limits import AddWithLimits from sympy.core.add import Add from sympy.core.basic import Basic, C from sympy.core.compatibility import is_sequence, xrange from sympy.core.containers import Tuple from sympy.core.expr import Expr from sympy.cor...
bsd-3-clause
rishiloyola/bedrock
bedrock/press/forms.py
19
6883
# coding: utf-8 # 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 import forms from lib.l10n_utils.dotlang import _, _lazy from bedrock.mozorg.forms import...
mpl-2.0
xiandiancloud/edxplaltfom-xusong
lms/djangoapps/shoppingcart/migrations/0005_auto__add_paidcourseregistrationannotation__add_field_orderitem_report.py
58
9807
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'PaidCourseRegistrationAnnotation' db.create_table('shoppingcart_paidcourseregistrationannota...
agpl-3.0
intgr/django
django/conf/locale/nb/formats.py
65
1699
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i' DATETIME_FORMAT = 'j. F Y H:i' YEAR_MONTH_FORMAT = 'F Y' MONTH_DAY_FORMA...
bsd-3-clause
SickRage/SickRage
sickrage/libs/trakt/core/emitter.py
7
6294
from __future__ import absolute_import, division, print_function import logging # concurrent.futures is optional try: from concurrent.futures import ThreadPoolExecutor except ImportError: ThreadPoolExecutor = None log = logging.getLogger(__name__) class Emitter(object): threading = False threading...
gpl-3.0
chaluemwut/fbserver
venv/lib/python2.7/site-packages/sklearn/neighbors/base.py
1
24541
"""Base and mixin classes for nearest neighbors""" # Authors: Jake Vanderplas <vanderplas@astro.washington.edu> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Sparseness support by Lars Buitinck <L.J.Buitinck@uva.nl> # Multi-output...
apache-2.0
tedelhourani/ansible
test/units/module_utils/facts/test_collector.py
13
16812
# This file is part of Ansible # -*- coding: utf-8 -*- # # # 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 dis...
gpl-3.0
Thraxis/SickRage
lib/github/ContentFile.py
74
6775
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
gpl-3.0
RubenKelevra/rethinkdb
external/v8_3.30.33.16/build/gyp/tools/pretty_vcproj.py
2637
9586
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Make the format of a vcproj really pretty. This script normalize and sort an xml. It also fetches all the properties inside linked...
agpl-3.0
sebdelsol/pyload
module/plugins/hoster/RapidshareCom.py
1
7801
# -*- coding: utf-8 -*- import re from module.network.RequestFactory import getURL from module.plugins.Hoster import Hoster def getInfo(urls): ids = "" names = "" p = re.compile(RapidshareCom.__pattern__) for url in urls: r = p.search(url) if r.group("name"): ids += ","...
gpl-3.0
PyMNtos/stacks
stacks/library/migrations/0003_auto__add_field_author_uuid.py
1
2747
# -*- 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): # Adding M2M table for field authors on 'Book' m2m_table_name = db.shorte...
gpl-2.0
Jordonbc/GlassOS
Glass_OS/build/lib/GlassOS/libaries/requests/packages/urllib3/connection.py
196
10286
from __future__ import absolute_import import datetime import os import sys import socket from socket import error as SocketError, timeout as SocketTimeout import warnings from .packages import six try: # Python 3 from http.client import HTTPConnection as _HTTPConnection from http.client import HTTPException ...
mit
lamby/redis-py
benchmarks/command_packer_benchmark.py
49
3338
import socket import sys from redis.connection import (Connection, SYM_STAR, SYM_DOLLAR, SYM_EMPTY, SYM_CRLF, b) from redis._compat import imap from base import Benchmark class StringJoiningConnection(Connection): def send_packed_command(self, command): "Send an already packe...
mit
sindhus/hasjob
hasjob/views/login.py
4
1781
# -*- coding: utf-8 -*- from sqlalchemy.exc import IntegrityError from flask import g, Response, redirect, flash from flask.ext.lastuser import signal_user_session_refreshed from coaster.views import get_next_url from baseframe import csrf from .. import app, lastuser from ..signals import signal_login, signal_logout...
agpl-3.0
RockySteveJobs/python-for-android
python-modules/twisted/twisted/test/test_hook.py
81
4290
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """ Test cases for twisted.hook module. """ from twisted.python import hook from twisted.trial import unittest class BaseClass: """ dummy class to help in testing. """ def __init__(self): """ dummy ini...
apache-2.0
devGregA/code
build/lib.linux-x86_64-2.7/scrapy/tests/test_http_request.py
33
30578
import cgi import unittest from six.moves import xmlrpc_client as xmlrpclib from six.moves.urllib.parse import urlparse from scrapy.http import Request, FormRequest, XmlRpcRequest, Headers, HtmlResponse class RequestTest(unittest.TestCase): request_class = Request default_method = 'GET' default_headers ...
bsd-3-clause
scottpurdy/nupic
examples/opf/simple_server/model_params.py
10
9318
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2015, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
mrjaydee82/SinLessKernel-4.4.4
toolchains/linaro-arm-eabi-4.10-master/share/gdb/system-gdbinit/elinos.py
134
3080
# Copyright (C) 2011-2014 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This progr...
gpl-2.0
amnona/heatsequer
heatsequer/experiment/expclass.py
1
28528
#!/usr/bin/env python """ heatsequer experiment class """ # amnonscript __version__ = "0.9" import heatsequer as hs import os import copy import numpy as np from pdb import set_trace as XXX import time import collections class Experiment: ''' experiment class holds the read data and metadata about the experim...
bsd-3-clause
j-carl/boto
boto/directconnect/exceptions.py
148
1239
# Copyright (c) 2013 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 restriction, including # without limitation the rights ...
mit
maartenq/ansible
test/units/modules/source_control/test_gitlab_deploy_key.py
12
8009
# -*- coding: utf-8 -*- # Copyright (c) 2018 Marcus Watkins <marwatk@marcuswatkins.net> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from ansible.compat.tests.mock import patch from ansible.modules.source_control import gitlab_deploy_key from ansible.module_utils._text i...
gpl-3.0
chainer/chainer
chainer/testing/helper.py
6
3610
import contextlib import sys import unittest import warnings import pkg_resources try: import mock _mock_error = None except ImportError as e: _mock_error = e def _check_mock_available(): if _mock_error is not None: raise RuntimeError( 'mock is not available: Reason: {}'.format(_m...
mit
liavkoren/djangoDev
django/contrib/gis/geoip/tests.py
48
4728
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os import unittest from unittest import skipUnless from django.conf import settings from django.contrib.gis.geos import HAS_GEOS from django.contrib.gis.geoip import HAS_GEOIP from django.utils import six if HAS_GEOIP: from . import GeoIP, G...
bsd-3-clause
kumanna/Simple-OFDM-Modem
usrp/transmit.py
1
1973
#!/usr/bin/env python """ test """ INTERP = 128 TXGAIN = 30 CONSTANT = 0.10 from gnuradio import gr, gr_unittest import usrp_options from optparse import OptionParser from gnuradio.eng_option import eng_option from pick_bitrate import pick_tx_bitrate def main(): gr.enable_realtime_scheduling() tb = gr.top_b...
gpl-3.0
Vimos/scikit-learn
sklearn/ensemble/tests/test_partial_dependence.py
365
6996
""" Testing for the partial dependence module. """ import numpy as np from numpy.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.utils.testing import if_matplotlib from sklearn.ensemble.partial_dependence import partial_dependence from sklearn.ensemble.partial_dependence...
bsd-3-clause
Neamar/django
tests/deprecation/tests.py
199
7253
from __future__ import unicode_literals import os import unittest import warnings from django.test import SimpleTestCase from django.test.utils import reset_warning_registry from django.utils import six from django.utils.deprecation import RenameMethodsBase from django.utils.encoding import force_text class RenameM...
bsd-3-clause
twz915/django
django/db/backends/sqlite3/base.py
4
17967
""" SQLite3 backend for the sqlite3 module in the standard library. """ import decimal import re import warnings from sqlite3 import dbapi2 as Database import pytz from django.core.exceptions import ImproperlyConfigured from django.db import utils from django.db.backends import utils as backend_utils from django.db.b...
bsd-3-clause
laborautonomo/bitmask_client
src/leap/bitmask/util/credentials.py
6
2785
# -*- coding: utf-8 -*- # credentials.py # Copyright (C) 2013 LEAP # # 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. # #...
gpl-3.0
JamisHoo/Cloud-Image-Migration-Tool
usr/lib/requests/packages/chardet/langhungarianmodel.py
2763
12536
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client 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 R...
mit
pico12/trading-with-python
sandbox/spreadCalculations.py
78
1496
''' Created on 28 okt 2011 @author: jev ''' from tradingWithPython import estimateBeta, Spread, returns, Portfolio, readBiggerScreener from tradingWithPython.lib import yahooFinance from pandas import DataFrame, Series import numpy as np import matplotlib.pyplot as plt import os symbols = ['SPY','...
bsd-3-clause
chenjun0210/tensorflow
tensorflow/python/tools/strip_unused_lib.py
37
4314
# pylint: disable=g-bad-file-header # 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/LICENS...
apache-2.0
monikasulik/django-oscar
sites/demo/apps/checkout/views.py
35
5404
from django.contrib import messages from django import http from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from datacash.facade import Facade from oscar.apps.checkout import views, exceptions from oscar.apps.payment.forms import BankcardForm from oscar.apps.payment...
bsd-3-clause
maxamillion/ansible
lib/ansible/executor/discovery/python_target.py
84
1234
# Copyright: (c) 2018 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # FUTURE: this could be swapped out for our bundled version of distro to move more complete platform # logic to the targets, so long as we maintain Py2.6 compat and don't need to do any ki...
gpl-3.0
wyc/django
tests/forms_tests/widget_tests/test_selectdatewidget.py
144
20641
from datetime import date from django.forms import DateField, Form, SelectDateWidget from django.test import override_settings from django.utils import translation from django.utils.dates import MONTHS_AP from .base import WidgetTest class SelectDateWidgetTest(WidgetTest): maxDiff = None widget = SelectDate...
bsd-3-clause
mhnatiuk/phd_sociology_of_religion
scrapper/lib/python2.7/site-packages/scrapy/spider.py
15
2307
""" Base class for Scrapy spiders See documentation in docs/topics/spiders.rst """ from scrapy import log from scrapy.http import Request from scrapy.utils.trackref import object_ref from scrapy.utils.url import url_is_from_spider from scrapy.utils.deprecate import create_deprecated_class class Spider(object_ref): ...
gpl-2.0
DavidIngraham/ardupilot
libraries/AP_HAL_ChibiOS/hwdef/scripts/STM32F103xB.py
10
2607
#!/usr/bin/env python ''' these tables are generated from the STM32 datasheets for the STM32F103x8 ''' # additional build information for ChibiOS build = { "CHIBIOS_STARTUP_MK" : "os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f1xx.mk", "CHIBIOS_PLATFORM_MK" : "os/hal/ports/STM32/STM32F1xx/platform.mk...
gpl-3.0
pshen/ansible
lib/ansible/module_utils/pure.py
71
3161
# -*- coding: utf-8 -*- # 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 author of the module, and may assign their own lic...
gpl-3.0
CompassionCH/bank-payment
account_payment_partner/models/account_invoice.py
1
5160
# -*- coding: utf-8 -*- # Copyright 2014-16 Akretion - Alexis de Lattre <alexis.delattre@akretion.com> # Copyright 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import models, fields, api class AccountInvoice(models.Model): _inherit =...
agpl-3.0
dharmabumstead/ansible
test/units/plugins/action/test_raw.py
44
3774
# (c) 2016, Saran Ahluwalia <ahlusar.ahluwalia@gmail.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...
gpl-3.0
stevec7/ratking
ratking/engine.py
2
3052
import ast import ConfigParser import glob import grp import importlib import multiprocessing import os import sys from drop_privileges import drop_privileges from jobhandler import JobCtl from pwd import getpwnam class SchedCtl(object): def __init__(self, sched, config, logging): self.sched = sched ...
mit
franek/weboob
modules/ing/pages/transfer.py
1
9640
# -*- coding: utf-8 -*- # Copyright(C) 2009-2011 Romain Bignon, Florent Fourcot # # This file is part of weboob. # # weboob 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 Lice...
agpl-3.0
FlintHill/SUAS-Competition
env/lib/python2.7/site-packages/setuptools/ssl_support.py
64
8492
import os import socket import atexit import re import functools from setuptools.extern.six.moves import urllib, http_client, map, filter from pkg_resources import ResolutionError, ExtractionError try: import ssl except ImportError: ssl = None __all__ = [ 'VerifyingHTTPSHandler', 'find_ca_bundle', 'is_a...
mit
daonb/Open-Knesset
auxiliary/migrations/0013_auto__add_tagkeyphrase.py
14
7851
# -*- 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): # Adding model 'TagKeyphrase' db.create_table(u'auxiliary_tagkeyphrase', ...
bsd-3-clause
larsbutler/coveragepy
coverage/test_helpers.py
1
9946
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """Mixin classes to help make good tests.""" import atexit import collections import os import random import shutil import sys import tempfile import textwrap fro...
apache-2.0
jiaphuan/models
research/object_detection/models/faster_rcnn_inception_resnet_v2_feature_extractor.py
1
9271
# 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
pfi/maf
maf_template.py
1
4169
#!/usr/bin/env python # coding: ISO8859-1 # # Copyright (c) 2013, Preferred Infrastructure, 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 retai...
bsd-2-clause
roninek/python101
games_str/pong_str/pong_str4.py
4
3983
#! /usr/bin/env python # -*- coding: utf-8 -*- import pygame, sys from pygame.locals import * # Przygotowanie zmiennych opisujących okno gry oraz obiekty gry i ich właściwości (paletki, piłeczka) # Inicjacja modułu i obiektów Pygame'a # inicjacja modułu pygame pygame.init() # liczba klatek na sekundę FPS = 30 # obi...
mit
Inspq/ansible
test/units/executor/test_task_result.py
104
5583
# (c) 2016, James Cammarata <jimi@sngx.net> # # 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
olsaki/ansible-modules-core
system/authorized_key.py
55
15877
#!/usr/bin/python # -*- coding: utf-8 -*- """ Ansible module to add authorized_keys for ssh logins. (c) 2012, Brad Olson <brado@movedbylight.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 ...
gpl-3.0
DuCorey/bokeh
tests/integration/annotations/test_title.py
6
1584
from __future__ import absolute_import from bokeh.io import save from bokeh.models import Plot, Range1d, LinearAxis, Circle, Column, ColumnDataSource import pytest pytestmark = pytest.mark.integration HEIGHT = 600 WIDTH = 600 @pytest.mark.screenshot def test_the_default_titles_settings_and_ensure_outside_any_axes(...
bsd-3-clause
mzdaniel/oh-mainline
vendor/packages/twisted/twisted/test/test_modules.py
18
15268
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for twisted.python.modules, abstract access to imported or importable objects. """ import sys import itertools import zipfile import compileall import twisted from twisted.trial.unittest import TestCase from twisted.python import modu...
agpl-3.0
sjotterman/python_koans
python2/koans/about_tuples.py
73
2259
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * class AboutTuples(Koan): def test_creating_a_tuple(self): count_of_three = (1, 2, 5) self.assertEqual(__, count_of_three[2]) def test_tuples_are_immutable_so_item_assignment_is_not_possible(self): count_of_three ...
mit
paolinux79/FTCryPTUploader
FTCryPTUploader/FtpCoord.py
1
1473
import threading class FtpCoord: shutdown = None lock = None stats = {} def __init__(self): self.shutdown = False self.lock = threading.Lock() def kill(self): print("raising shutdown") self.shutdown = True def need_to_stop(self): return self.shutdown ...
bsd-2-clause
fgesora/odoo
openerp/addons/base/tests/test_mail_examples.py
302
57129
#!/usr/bin/env python # -*- coding: utf-8 -*- MISC_HTML_SOURCE = """ <font size="2" style="color: rgb(31, 31, 31); font-family: monospace; font-variant: normal; line-height: normal; ">test1</font> <div style="color: rgb(31, 31, 31); font-family: monospace; font-variant: normal; line-height: normal; font-size: 12px; fo...
agpl-3.0
jmighion/ansible
lib/ansible/modules/cloud/univention/udm_user.py
29
21233
#!/usr/bin/python # -*- coding: UTF-8 -*- # Copyright (c) 2016, Adfinis SyGroup AG # Tobias Rueetschi <tobias.ruetschi@adfinis-sygroup.ch> # 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 ...
gpl-3.0
XiaoxiaoLiu/morphology_analysis
bigneuron/reestimate_radius.py
1
1506
__author__ = 'xiaoxiaol' __author__ = 'xiaoxiaol' # run standardize swc to make sure swc files have one single root, and sorted, and has the valide type id ( 1~4) import matplotlib.pyplot as plt import seaborn as sb import os import os.path as path import numpy as np import pandas as pd import platform import sys imp...
gpl-3.0
siutanwong/scikit-learn
examples/text/document_clustering.py
230
8356
""" ======================================= Clustering text documents using k-means ======================================= This is an example showing how the scikit-learn can be used to cluster documents by topics using a bag-of-words approach. This example uses a scipy.sparse matrix to store the features instead of ...
bsd-3-clause
COL-IU/XLSearch
xlsearch_train.py
1
5042
import sys import pickle import os import getopt from time import ctime import numpy as np usage = ''' USAGE: python xlsearch_train.py -l [path to xlsearch library] -p [parameter file] -o [output file]''' (pairs, args) = getopt.getopt(sys.argv[1:], 'l:p:...
mit
xin3liang/platform_external_chromium_org
tools/perf/page_sets/tough_texture_upload_cases.py
34
1457
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module class ToughTextureUploadCasesPage(page_module.Page): ...
bsd-3-clause
darvelo/chime
fabfile/fabconf.py
2
2774
# -*- coding: utf-8 -*- ''' -------------------------------------------------------------------------------------- project_conf.py -------------------------------------------------------------------------------------- Configuration settings that detail EC2 instances. Note that we are not using the built-in env from fa...
bsd-3-clause
heia-fr/sirano
sirano/plugins/actions/raw_payload.py
1
1377
# -*- coding: utf-8 -*- # # This file is a part of Sirano. # # Copyright (C) 2015 HES-SO // HEIA-FR # Copyright (C) 2015 Loic Gremaud <loic.gremaud@grelinfo.ch> # # 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 So...
gpl-2.0
jdilallo/jdilallo-test
examples/dfp/v201311/custom_targeting_service/get_custom_targeting_values_by_statement.py
1
2247
#!/usr/bin/python # # 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 b...
apache-2.0
KousikaGanesh/purchaseandInventory
openerp/addons/crm/wizard/crm_phonecall_to_meeting.py
56
2730
# -*- 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
gengliangwang/spark
python/pyspark/serializers.py
10
20586
# # 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
hujiajie/pa-chromium
chrome/test/functional/search_engines.py
79
3858
#!/usr/bin/env python # Copyright (c) 2011 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 re import pyauto_functional # Must be imported before pyauto import pyauto import test_utils class SearchEnginesTest(pya...
bsd-3-clause