repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
yandexdataschool/Practical_RL
week03_model_free/crawler_and_pacman/seminar_py3/layout.py
1
5690
# layout.py # --------- # Licensing Information: Please do not distribute or publish solutions to this # project. You are free to use and extend these projects for educational # purposes. The Pacman AI projects were developed at UC Berkeley, primarily by # John DeNero (denero@cs.berkeley.edu) and Dan Klein (klein@cs.be...
unlicense
nathanaevitas/odoo
openerp/addons/sale/edi/__init__.py
454
1065
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
agpl-3.0
arjunbm13/youtube-dl
youtube_dl/extractor/nba.py
101
2338
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( remove_end, parse_duration, ) class NBAIE(InfoExtractor): _VALID_URL = r'https?://(?:watch\.|www\.)?nba\.com/(?:nba/)?video(?P<id>/[^?]*?)/?(?:/index\.html)?(?:\?.*)?$' _TESTS = [{ 'url': 'http://w...
unlicense
donspaulding/adspygoogle
examples/adspygoogle/dfp/v201211/get_user.py
4
1504
#!/usr/bin/python # # Copyright 2012 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
seadsystem/website
web2py/scripts/tickets2slack.py
10
2321
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Post error tickets to slack on a 5 minute schedule. # # Proper use depends on having created a web-hook through Slack, and having set # that value in your app's model as the value of global_settings.slack_hook. # Details on creating web-hooks can be found at https://sla...
mit
SlateScience/MozillaJS
js/src/gdb/taskpool.py
9
8808
import fcntl, os, select, time from subprocess import Popen, PIPE # Run a series of subprocesses. Try to keep up to a certain number going in # parallel at any given time. Enforce time limits. # # This is implemented using non-blocking I/O, and so is Unix-specific. # # We assume that, if a task closes its standard err...
mpl-2.0
turbomanage/training-data-analyst
courses/machine_learning/deepdive2/structured/solutions/serving/application/lib/jinja2/parser.py
89
35875
# -*- coding: utf-8 -*- """ jinja2.parser ~~~~~~~~~~~~~ Implements the template parser. :copyright: (c) 2017 by the Jinja Team. :license: BSD, see LICENSE for more details. """ from jinja2 import nodes from jinja2.exceptions import TemplateSyntaxError, TemplateAssertionError from jinja2.lexer impo...
apache-2.0
renyi533/tensorflow
tensorflow/python/kernel_tests/as_string_op_test.py
30
9324
# 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
javelinanddart/Canuck
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
romain-li/edx-platform
lms/djangoapps/verify_student/tests/test_signals.py
47
1999
""" Unit tests for the VerificationDeadline signals """ from datetime import datetime, timedelta from pytz import UTC from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory from lms.djangoapps.verify_student.models import VerificationDeadl...
agpl-3.0
cogeorg/black_rhino
examples/degroot/networkx/tests/benchmark.py
37
10636
from timeit import Timer # This is gratefully modeled after the benchmarks found in # the numpy svn repository. http://svn.scipy.org/svn/numpy/trunk class Benchmark(object): """ Benchmark a method or simple bit of code using different Graph classes. If the test code is the same for each graph class, the...
gpl-3.0
allthroughthenight/aces
web2py/scripts/extract_sqlite_models.py
11
3960
# -*- coding: utf-8 -*- ''' Create the web2py model code needed to access your sqlite legacy db. Usage: python extract_sqlite_models.py Access your tables with: legacy_db(legacy_db.mytable.id>0).select() extract_sqlite_models.py -- Copyright (C) Michele Comitini This code is distributed with web2py. The regexp co...
gpl-3.0
TathagataChakraborti/resource-conflicts
PLANROB-2015/py2.5/lib/python2.5/email/mime/image.py
573
1764
# Copyright (C) 2001-2006 Python Software Foundation # Author: Barry Warsaw # Contact: email-sig@python.org """Class representing image/* type MIME documents.""" __all__ = ['MIMEImage'] import imghdr from email import encoders from email.mime.nonmultipart import MIMENonMultipart class MIMEImage(MIMENonMultipart...
mit
MihaiMoldovanu/ansible
lib/ansible/modules/network/f5/bigip_gtm_datacenter.py
26
11100
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2016 F5 Networks 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 # ...
gpl-3.0
endlessm/chromium-browser
third_party/catapult/dashboard/dashboard/bug_details_test.py
1
3154
# Copyright 2017 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 __future__ import print_function from __future__ import division from __future__ import absolute_import import sys import unittest import mock import ...
bsd-3-clause
michaelpacer/networkx
networkx/algorithms/connectivity/kcutsets.py
12
7220
# -*- coding: utf-8 -*- """ Kanevsky all minimum node k cutsets algorithm. """ from operator import itemgetter import networkx as nx from .utils import build_auxiliary_node_connectivity from networkx.algorithms.flow import ( build_residual_network, edmonds_karp, shortest_augmenting_path, ) default_flow_fun...
bsd-3-clause
naousse/odoo
addons/sale/wizard/sale_make_invoice.py
344
3410
############################################################################## # # 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 Affero General Public L...
agpl-3.0
ckprice/bedrock
vendor-local/lib/python/pyquery/pyquery.py
10
38409
#-*- coding:utf-8 -*- # # Copyright (C) 2008 - Olivier Lauzanne <olauzanne@gmail.com> # # Distributed under the BSD license, see LICENSE.txt from .cssselectpatch import selector_to_xpath from copy import deepcopy from lxml import etree import lxml.html import sys PY3k = sys.version_info >= (3,) if PY3k: from urll...
mpl-2.0
yongshengwang/hue
build/env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/filepost.py
1009
2281
import codecs from uuid import uuid4 from io import BytesIO from .packages import six from .packages.six import b from .fields import RequestField writer = codecs.lookup('utf-8')[3] def choose_boundary(): """ Our embarassingly-simple replacement for mimetools.choose_boundary. """ return uuid4().hex...
apache-2.0
waynechu/PythonProject
dns/rdtypes/IN/AAAA.py
2
2015
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and ...
mit
shakhat/os-failures
os_failures/api/cloud_management.py
1
1457
# 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 # distributed under the ...
apache-2.0
Endika/edx-platform
openedx/tests/xblock_integration/test_done.py
60
3745
''' Tests for the DoneXBlock. This is nice as a simple example of the edX XBlock test framework. ''' from openedx.tests.xblock_integration.xblock_testcase import XBlockTestCase # pylint: disable=abstract-method class TestDone(XBlockTestCase): """ Simple tests for the completion XBlock. We set up a page with...
agpl-3.0
lnawrot/traffic-simulator
site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/sconstest-CPPPATH.py
2
1765
#!/usr/bin/env python # # Copyright (c) 2001-2010,2011,2012 The SCons Foundation # # 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 righ...
bsd-3-clause
jAlpedrinha/DeclRY
declry/templatetags/view_tag.py
2
3969
# _*_ encoding: utf-8 _*_ from copy import copy from django.template import Library, loader, Context from django.contrib.admin.templatetags.admin_static import static from django.utils.html import format_html from django.utils.text import capfirst from django.utils.encoding import force_text from django.utils.transla...
bsd-3-clause
timokoola/finnkinotxt
botocore/vendored/requests/packages/chardet/escsm.py
2930
7839
######################## 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...
apache-2.0
Alberto-Beralix/Beralix
i386-squashfs-root/usr/share/pyshared/xdg/Menu.py
2
36309
""" Implementation of the XDG Menu Specification Version 1.0.draft-1 http://standards.freedesktop.org/menu-spec/ """ from __future__ import generators import locale, os, xml.dom.minidom from xdg.BaseDirectory import * from xdg.DesktopEntry import * from xdg.Exceptions import * import xdg.Locale import xdg.Config EL...
gpl-3.0
nvbn/python-social-auth
social/tests/backends/test_bitbucket.py
5
1630
import json from httpretty import HTTPretty from social.p3 import urlencode from social.tests.backends.oauth import OAuth1Test class BitbucketOAuth1Test(OAuth1Test): backend_path = 'social.backends.bitbucket.BitbucketOAuth' user_data_url = 'https://bitbucket.org/api/1.0/users/foo@bar.com' expected_userna...
bsd-3-clause
thaumos/ansible
lib/ansible/modules/web_infrastructure/deploy_helper.py
149
19571
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Jasper N. Brouwer <jasper@nerdsweide.nl> # (c) 2014, Ramon de la Fuente <ramon@delafuente.nl> # # 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 __metaclas...
gpl-3.0
immesys/smap
python/smap/drivers/htp.py
6
2294
""" Copyright (c) 2011, 2012, Regents of the University of California 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 l...
bsd-2-clause
nathaniel-mahieu/bitcoin
qa/rpc-tests/abandonconflict.py
13
7700
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * import ...
mit
kwinkunks/lasio
tests/test_enhancements.py
1
1908
import os, sys; sys.path.insert(0, os.path.dirname(os.path.dirname(__file__))) import fnmatch import numpy import pytest import math from lasio import las, read, exceptions test_dir = os.path.dirname(__file__) egfn = lambda fn: os.path.join(os.path.dirname(__file__), "examples", fn) stegfn = lambda vers, fn: os.p...
mit
nkalodimas/invenio
modules/websubmit/lib/functions/Move_Revised_Files_to_Storage.py
24
17765
## $Id: Move_Revised_Files_to_Storage.py,v 1.20 2009/03/26 13:48:42 jerome Exp $ ## This file is part of Invenio. ## Copyright (C) 2009, 2010, 2011 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 Fo...
gpl-2.0
ec-geolink/d1lod
d1lod/d1lod/people/processing.py
1
3993
""" file: processing.py author: Bryce Mecum (mecum@nceas.ucsb.edu) Processes the scientific metadata documents in ./documents for person and organization information. For each document, the script tries to find the person in an existing list. Matches are currently made off of all information av...
apache-2.0
lenarother/moderna
moderna/analyze/HBondCalculator.py
1
6621
#!/usr/bin/env python # # HBondCalculator.py # # Calculates hydrogen bonds between residues. # # http://iimcb.genesilico.pl/moderna/ # __author__ = "Kristian Rother" __copyright__ = "Copyright 2008, The Moderna Project" __credits__ = ["Janusz Bujnicki"] __license__ = "GPL" __maintainer__ = "Kristian Rother" __email__ =...
gpl-3.0
fritsvanveen/QGIS
python/ext-libs/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py
2360
3778
"""The match_hostname() function from Python 3.3.3, essential when using SSL.""" # Note: This file is under the PSF license as the code comes from the python # stdlib. http://docs.python.org/3/license.html import re __version__ = '3.4.0.2' class CertificateError(ValueError): pass def _dnsname_match(dn, host...
gpl-2.0
nvoron23/statsmodels
statsmodels/stats/tests/test_corrpsd.py
31
16765
# -*- coding: utf-8 -*- """Tests for finding a positive semi-definite correlation or covariance matrix Created on Mon May 27 12:07:02 2013 Author: Josef Perktold """ import numpy as np import scipy.sparse as sparse from numpy.testing import (assert_almost_equal, assert_allclose, assert_equ...
bsd-3-clause
PhonologicalCorpusTools/CorpusTools
tests/test_gui_views.py
1
1683
from corpustools.gui.views import * from corpustools.gui.models import CorpusModel def test_discourse_view(qtbot): widget = DiscourseView() qtbot.addWidget(widget) def test_lexicon_view(qtbot, unspecified_test_corpus, settings): widget = LexiconView() model = CorpusModel(unspecified_test_corpus, sett...
bsd-3-clause
barbuza/django
django/conf/locale/sv/formats.py
504
1569
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # 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' DATETI...
bsd-3-clause
jonathonwalz/ansible
lib/ansible/modules/network/junos/junos_vlan.py
2
5010
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # # This file is part of Ansible by Red Hat # # 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 Li...
gpl-3.0
mgedmin/ansible
lib/ansible/playbook/task_include.py
92
2704
# (c) 2012-2014, Michael DeHaan <michael.dehaan@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) an...
gpl-3.0
keeeener/nicki
platform/external/webkit/Tools/Scripts/webkitpy/tool/bot/sheriff_unittest.py
15
3786
# Copyright (C) 2010 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 of conditions and the f...
gpl-2.0
asnorkin/sentiment_analysis
site/lib/python2.7/site-packages/sklearn/manifold/mds.py
18
15138
""" Multi-dimensional Scaling (MDS) """ # author: Nelle Varoquaux <nelle.varoquaux@gmail.com> # License: BSD import numpy as np import warnings from ..base import BaseEstimator from ..metrics import euclidean_distances from ..utils import check_random_state, check_array, check_symmetric from ..externals.joblib impo...
mit
glastopf/conpot
conpot/core/virtual_fs.py
1
7135
# Copyright (C) 2018 Abhinav Saxena <xandfury@gmail.com> # # 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 pro...
gpl-2.0
Spiderlover/Toontown
toontown/town/TownBattleSOSPetSearchPanel.py
5
1541
from pandac.PandaModules import * from direct.fsm import StateData from direct.gui.DirectGui import * from pandac.PandaModules import * from toontown.toonbase import TTLocalizer class TownBattleSOSPetSearchPanel(StateData.StateData): def __init__(self, doneEvent): StateData.StateData.__init__(self, doneEv...
mit
skg-net/ansible
lib/ansible/modules/network/nxos/nxos_vrf_interface.py
68
7978
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
Khan/python-phabricator
phabricator/tests/test_phabricator.py
1
4151
try: import unittest2 as unittest except ImportError: import unittest try: from StringIO import StringIO except ImportError: from io import StringIO try: import unittest.mock as mock except ImportError: import mock from pkg_resources import resource_string import json import phabricator RE...
apache-2.0
konstruktoid/ansible-upstream
lib/ansible/modules/system/mount.py
16
20727
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2012, Red Hat, inc # Written by Seth Vidal # based on the mount modules from salt and puppet # 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 __metacl...
gpl-3.0
binhqnguyen/lena
plotting/timeout/second_retran_sequence.py
1
1935
#!/usr/bin/python import os import sys import FileHandle import re if __name__ == "__main__": if (len (sys.argv) < 2): print ("Usage retrans_count.py <number of Ues>") exit(1) UE = int (str(sys.argv[1])) for i in range(0,UE): ##filter retrans from send sequence. grep_cmd = 'grep "TCP Retransmission" se...
gpl-2.0
2013Commons/HUE-SHARK
build/env/lib/python2.7/site-packages/pam-0.1.3-py2.7.egg/pam.py
55
3769
# (c) 2007 Chris AtLee <chris@atlee.ca> # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license.php """ PAM module for python Provides an authenticate function that will allow the caller to authenticate a user against the Pluggable Authentication Modules (PAM) on the system. Implemented usi...
apache-2.0
intfrr/shaka-player
third_party/gjslint/closure_linter-2.3.13/closure_linter/closurizednamespacesinfo.py
107
19655
#!/usr/bin/env python # # Copyright 2008 The Closure Linter 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 #...
apache-2.0
elaird/supy-tflat
look.py
1
7705
import supy import configuration import displayer import steps import calculables import calculables.sv import ROOT as r ss = supy.steps sshv = ss.histos.value class look(supy.analysis): def listOfSteps(self, pars): mMax = 500.0 return [ss.printer.progressPrinter(), # sshv("t1ByCo...
gpl-3.0
xavierwu/scikit-learn
sklearn/manifold/setup.py
99
1243
import os from os.path import join import numpy from numpy.distutils.misc_util import Configuration from sklearn._build_utils import get_blas_info def configuration(parent_package="", top_path=None): config = Configuration("manifold", parent_package, top_path) libraries = [] if os.name == 'posix': ...
bsd-3-clause
pilou-/ansible
lib/ansible/modules/cloud/rackspace/rax_dns_record.py
57
11401
#!/usr/bin/python # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
keli/furion
furion/socks5.py
1
14581
import struct import select import socket import ssl try: import socketserver except ImportError: import SocketServer as socketserver import logging from .helpers import make_connection, my_inet_aton, hexstring, trigger_upstream_check # https://github.com/gevent/gevent/issues/477 # Re-add sslwrap to Python 2...
bsd-2-clause
Jack301/toolkit
handleExcel/exportor/scripts/xlrd-1.0.0/xlrd/formula.py
77
94301
# -*- coding: cp1252 -*- ## # Module for parsing/evaluating Microsoft Excel formulas. # # <p>Copyright © 2005-2012 Stephen John Machin, Lingfo Pty Ltd</p> # <p>This module is part of the xlrd package, which is released under # a BSD-style licence.</p> ## # No part of the content of this file was derived from the work...
mit
cliqz/socorro
socorro/unittest/external/filesystem/create_json_dump_store.py
20
5435
# 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 datetime import errno import json import os import time import socorro.external.filesystem.json_dump_storage as...
mpl-2.0
adrian-ionescu/apache-spark
python/pyspark/mllib/tree.py
46
24110
# # 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
adamend/django-oscar
src/oscar/apps/shipping/methods.py
40
5061
from decimal import Decimal as D from django.utils.translation import ugettext_lazy as _ from oscar.core import prices class Base(object): """ Shipping method interface class This is the superclass to the classes in methods.py, and a de-facto superclass to the classes in models.py. This allows usin...
bsd-3-clause
ericdill/PyXRF
pyxrf/model/fileio.py
1
9404
# ###################################################################### # Copyright (c) 2014, Brookhaven Science Associates, Brookhaven # # National Laboratory. All rights reserved. # # # # Redistribution and use in ...
bsd-3-clause
jakesyl/pychess
lib/pychess/Utils/lutils/attack.py
20
11103
from __future__ import absolute_import from .bitboard import * from .ldata import * from pychess.Utils.const import * # # Caveat: Many functions in this module has very similar code. If you fix a # bug, or write a perforance enchace, please update all functions. Apologies # for the inconvenience # def isAttacked (boa...
gpl-3.0
JosephLutz/serialCommTest
tests/packetGenerator_test.py
1
4467
# packetGenerator_test import traceback import threading import unittest import Queue import time import sys import os if __name__ == '__main__': importDirectory = os.getcwd() if os.path.basename(importDirectory) in ['tests']: importDirectory = os.path.dirname(importDirectory) sys.path = [importDir...
mit
pztrn/spicecm-prototype
src/lib/edit_server.py
1
1953
# -*- coding: utf-8 -*- # Edit server dialog module import os from PyQt4.QtGui import QDialog from PyQt4 import uic class Edit_Server_Dialog(QDialog): def __init__(self, servers_list_instance, core_instance, server_name, item_index): QDialog.__init__(self) self.servers_list = servers_list_instanc...
gpl-3.0
FUNSEPA/fsp-paypal
pagos/migrations/0003_auto_20161014_1550.py
1
1150
# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2016-10-14 15:50 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('pagos', '0002_auto_20161014_1514'), ] operations = [ migrations.RemoveField...
mit
yoelk/kivy
kivy/tests/visual_test_label.py
37
8999
from kivy.app import runTouchApp from kivy.uix.gridlayout import GridLayout from kivy.properties import StringProperty from kivy.lang import Builder from kivy.utils import get_hex_from_color, get_random_color import timeit import re import random from functools import partial def layout_perf(label, repeat): if re...
mit
Weihonghao/ECM
Vpy34/lib/python3.5/site-packages/scipy/linalg/flinalg.py
138
1727
# # Author: Pearu Peterson, March 2002 # from __future__ import division, print_function, absolute_import __all__ = ['get_flinalg_funcs'] # The following ensures that possibly missing flavor (C or Fortran) is # replaced with the available one. If none is available, exception # is raised at the first attempt to use t...
agpl-3.0
BigBrother-International/gst-cerbero
setup.py
19
2428
import os import sys import shutil from setuptools import setup, find_packages from cerbero.utils import shell sys.path.insert(0, './cerbero') # Utility function to read the README file. def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() # Utility function to parse directories ...
lgpl-2.1
sikmir/QGIS
python/plugins/processing/algs/gdal/GridNearestNeighbor.py
15
8685
# -*- coding: utf-8 -*- """ *************************************************************************** GridNearestNeighbor.py --------------------- Date : October 2013 Copyright : (C) 2013 by Alexander Bruy Email : alexander dot bruy at gmail dot com *****...
gpl-2.0
baslr/ArangoDB
3rdParty/V8/V8-5.0.71.39/tools/swarming_client/third_party/requests/__init__.py
28
1855
# -*- 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('http://python.org') >>> r.sta...
apache-2.0
danieljaouen/ansible
lib/ansible/modules/network/ios/ios_facts.py
10
17003
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
Changaco/oh-mainline
vendor/packages/twisted/twisted/internet/test/test_inotify.py
18
16501
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for the inotify wrapper in L{twisted.internet.inotify}. """ from twisted.internet import defer, reactor from twisted.python import filepath, runtime from twisted.trial import unittest try: from twisted.python import _inotify except...
agpl-3.0
chrisidefix/devide.johannes
extra/soappy-cvp/SOAPpy/wstools/XMLSchema.py
10
101410
# Copyright (c) 2003, The Regents of the University of California, # through Lawrence Berkeley National Laboratory (subject to receipt of # any required approvals from the U.S. Dept. of Energy). All rights # reserved. # # Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved. # # This software is ...
bsd-3-clause
mwmuni/LIGGGHTS_GUI
OpenGL/GL/SGIS/texture_filter4.py
9
1413
'''OpenGL extension SGIS.texture_filter4 This module customises the behaviour of the OpenGL.raw.GL.SGIS.texture_filter4 to provide a more Python-friendly API Overview (from the spec) This extension allows 1D and 2D textures to be filtered using an application-defined, four sample per dimension filter. (In addi...
gpl-3.0
vFense/vFenseAgent-nix
agent/deps/rpm/Python-2.7.5/lib/python2.7/ctypes/test/test_numbers.py
35
9202
from ctypes import * import unittest import struct def valid_ranges(*types): # given a sequence of numeric types, collect their _type_ # attribute, which is a single format character compatible with # the struct module, use the struct module to calculate the # minimum and maximum value allowed for this...
lgpl-3.0
gkbrk/WatchPeopleCode
wpc/utils.py
2
2026
from urlparse import urlparse, parse_qs import requests import re # this functions is originally FROM: http://stackoverflow.com/questions/4356538/how-can-i-extract-video-id-from-youtubes-link-in-python def youtube_video_id(url): """ Examples: - http://youtu.be/SA2iWivDJiE - http://www.youtube.com/watc...
mit
galactics/space-api
beyond/utils/ltan.py
2
2659
"""Utilities to compute the Local Time at Ascending Node (LTAN) Both True and Mean LTAN are available, the difference between them being the `equation of time <https://en.wikipedia.org/wiki/Equation_of_time>`__ """ import numpy as np from ..env.solarsystem import get_body from ..frames.iau1980 import _sideral def ...
gpl-3.0
tebriel/dd-agent
checks.d/rabbitmq.py
2
14759
# (C) Datadog, Inc. 2013-2016 # (C) Brett Langdon <brett@blangdon.com> 2013 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) # stdlib import re import time import urllib import urlparse # 3p import requests # project from checks import AgentCheck from config import _is_affirmative EVENT_T...
bsd-3-clause
eadgarchen/tensorflow
tensorflow/contrib/distributions/python/ops/negative_binomial.py
23
7419
# 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
xuxiao19910803/edx-platform
common/test/acceptance/pages/studio/auto_auth.py
155
2446
""" Auto-auth page (used to automatically log in during testing). """ import re import urllib from bok_choy.page_object import PageObject from . import BASE_URL class AutoAuthPage(PageObject): """ The automatic authorization page. When allowed via the django settings file, visiting this url will crea...
agpl-3.0
ZHYfeng/malicious-code-conceal
3-2-multi-programmes-big/Multiverso-master/binding/python/examples/theano/cnn.py
6
5128
#!/usr/bin/env python # coding:utf8 """ This code is adapted from https://github.com/benanne/theano-tutorial/blob/master/6_convnet.py The MIT License (MIT) Copyright (c) 2015 Sander Dieleman Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation fi...
apache-2.0
Drooids/odoo
addons/purchase_requisition/purchase_requisition.py
200
23548
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
BT-ojossen/odoo
addons/pad/pad.py
179
4311
# -*- coding: utf-8 -*- from openerp.osv import fields, osv import random import re import string import urllib2 import logging from openerp import SUPERUSER_ID from openerp.tools.translate import _ from openerp.tools import html2plaintext from py_etherpad import EtherpadLiteClient _logger = logging.getLogger(__name__...
agpl-3.0
yashu-seth/networkx
networkx/algorithms/vitality.py
5
2517
""" Vitality measures. """ # Copyright (C) 2012 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. import networkx as nx __author__ = "\n".join(['Aric Hagberg (hagberg@lanl.gov)', 'Renato...
bsd-3-clause
SurrealTiggi/mess
python/exercises/character.py
1
1472
import random class Combat: dodge_limit = 6 attack_limit = 6 def dodge(self): roll = random.randint(1, self.dodge_limit) return roll > 4 def attack(self): roll = random.randint(1, self.attack_limit) return roll > 4 class Character(Combat): attack_limit = 10 ...
mit
ff94315/hiwifi-openwrt-HC5661-HC5761
staging_dir/host/lib64/scons-2.1.0/SCons/Tool/dvipdf.py
21
4142
"""SCons.Tool.dvipdf Tool-specific initialization for dvipdf. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foun...
gpl-2.0
matrix-org/sydent
tests/test_register.py
1
1427
# Copyright 2021 The Matrix.org Foundation C.I.C. # # 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 a...
apache-2.0
fyfcauc/android_external_chromium-org
third_party/pexpect/ANSI.py
171
12646
"""This implements an ANSI (VT100) terminal emulator as a subclass of screen. PEXPECT LICENSE This license is approved by the OSI and FSF as GPL-compatible. http://opensource.org/licenses/isc-license.txt Copyright (c) 2012, Noah Spurrier <noah@noah.org> PERMISSION TO USE, COPY, MODIFY, AND/OR DIS...
bsd-3-clause
Etwigg/Examples
Group Project Website/venv/Lib/site-packages/pip/_vendor/requests/packages/chardet/constants.py
3008
1335
######################## 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...
mit
googleapis/artman
artman/tasks/protoc_tasks.py
1
15154
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
apache-2.0
andrew-pa/limbo-android
jni/qemu/QMP/qmp.py
78
4958
# QEMU Monitor Protocol Python class # # Copyright (C) 2009, 2010 Red Hat Inc. # # Authors: # Luiz Capitulino <lcapitulino@redhat.com> # # This work is licensed under the terms of the GNU GPL, version 2. See # the COPYING file in the top-level directory. import json import errno import socket class QMPError(Except...
gpl-2.0
4dsolutions/Python5
model_property.py
1
1640
# -*- coding: utf-8 -*- """ Created on Wed Dec 7, 2016 @author: Kirby Urner This class comes directly from the Python documentation. Property emulates, in pure Python, what the __builtin__ property type does. Note use of Descriptor special names __set__, __get__, plus __delete__, which will in turn trigger the...
mit
listamilton/supermilton.repository
script.areswizard/requests/packages/chardet/euctwfreq.py
3133
34872
######################## 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...
gpl-2.0
mattvick/phantomjs
src/qt/qtwebkit/Tools/BuildSlaveSupport/build.webkit.org-config/htdigestparser.py
123
2341
# Copyright (C) 2011 Apple 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: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
facebookexperimental/eden
eden/fs/cli/daemon.py
1
10314
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. # pyre-strict import os import stat import subprocess import sys from typing import Dict, List, Optional, Tuple from . import d...
gpl-2.0
Infixz/BlogCatke
virtualenv.bundle/requests/packages/chardet2/sbcharsetprober.py
25
4689
######################## 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....
apache-2.0
Arctan-Open-Source/arclaunch
test/gtest/test/gtest_help_test.py
2968
5856
#!/usr/bin/env python # # Copyright 2009, 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...
gpl-2.0
thnee/ansible
test/units/modules/network/f5/test_bigip_file_copy.py
22
3619
# -*- 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 if sys.version_info < (2...
gpl-3.0
dac284/ud032
Lesson_5_Analyzing_Data/14-Using_push/push.py
9
2042
#!/usr/bin/env python """ $push is similar to $addToSet. The difference is that rather than accumulating only unique values it aggregates all values into an array. Using an aggregation query, count the number of tweets for each user. In the same $group stage, use $push to accumulate all the tweet texts for each user...
agpl-3.0
DarthStrom/python_koans
python2/runner/sensei.py
43
9863
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest import re import sys import os import glob import helper from mockable_test_result import MockableTestResult from runner import path_to_enlightenment from libs.colorama import init, Fore, Style init() # init colorama class Sensei(MockableTestResult): ...
mit
HyperloopTeam/FullOpenMDAO
lib/python2.7/site-packages/Sphinx-1.2.2-py2.7.egg/sphinx/transforms.py
3
19071
# -*- coding: utf-8 -*- """ sphinx.transforms ~~~~~~~~~~~~~~~~~ Docutils transforms used by Sphinx when reading documents. :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ from os import path from docutils import nodes from docutils.uti...
gpl-2.0
pleaseproject/python-for-android
python3-alpha/python3-src/Lib/lib2to3/tests/test_pytree.py
131
17346
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Unit tests for pytree.py. NOTE: Please *don't* add doc strings to individual test methods! In verbose mode, printing of the module, class and method name is much more helpful than printing of (the first line of) the...
apache-2.0