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 |
|---|---|---|---|---|---|
armando-migliaccio/neutron | neutron/tests/unit/test_extension_extended_attribute.py | 6 | 5652 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 VMware, 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/lic... | apache-2.0 |
gcanasherrera/Weak-Lensing | WL_Script.py | 1 | 23947 | # Name: WL_Script.py
#
# Weak-Lensing "Study of Systematics and Classification of Compact Objects" Program I
#
# Type: python script
#
# Description: Central script that develops the whole process of reading images, filtering into galaxies and stars, correcting sizes and shapes, correcting PSF annisotropies, and re-cla... | gpl-3.0 |
endlessm/chromium-browser | third_party/chromite/api/controller/artifacts_unittest.py | 1 | 49816 | # -*- coding: utf-8 -*-
# Copyright 2019 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unittests for Artifacts operations."""
from __future__ import print_function
import collections
import os
import sys
import ... | bsd-3-clause |
Yukarumya/Yukarum-Redfoxes | media/webrtc/trunk/tools/gyp/pylib/gyp/MSVSProject.py | 2736 | 6387 | # 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.
"""Visual Studio project reader/writer."""
import gyp.common
import gyp.easy_xml as easy_xml
#-------------------------------------------------------------------... | mpl-2.0 |
Kyvalda/mosaic_random_generator | tile.py | 1 | 2893 | from PIL import Image
from random import randrange
class PileMosaic:
def __init__(self):
self.width, self.height = 2380, 2800
self.filename = "pile_mosaic.png"
self.crema = (240, 233, 227)
self.choco = (89, 62, 53)
self.luna = (43, 97, 123)
self.latte = (195, 175, 14... | mit |
ryokoyunoki/google-blog-converters-appengine | src/blogger2movabletype/movabletype.py | 30 | 2783 | #!/usr/bin/env python
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0.txt
#
# Unless required by applicable law or... | apache-2.0 |
mthous72/a13_kernel_3.0.8 | Documentation/target/tcm_mod_builder.py | 3119 | 42754 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
joelwilson/caniflymykite | weather.py | 1 | 5614 | from datetime import datetime
import noaa
import geonames as gn
import wunderground
from utils import heading, tomph, ctof, iszip
def weather_memo(f):
'''Memoization decorator for caching the results of initiating
Weather objects.'''
cache = {}
def memoized(x, sec):
if x not in cache or (x in... | gpl-3.0 |
ruiting/opencog | opencog/python/learning/incremental_learner/util.py | 34 | 3138 | __author__ = 'Brian Beck'
## {{{ http://code.activestate.com/recipes/410692/ (r8)
# This class provides the functionality we want. You only need to look at
# this if you want to know how this works. It only needs to be defined
# once, no need to muck around with its internals.
class switch(object):
def __init__(se... | agpl-3.0 |
MackZxh/OCA-Choice | hr/hr_employee_data_from_work_address/__init__.py | 23 | 1073 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2015 Therp BV <http://therp.nl>.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... | lgpl-3.0 |
alexmogavero/home-assistant | homeassistant/components/sensor/knx.py | 4 | 5351 | """
Sensors of a KNX Device.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/knx/
"""
from enum import Enum
import logging
import voluptuous as vol
from homeassistant.const import (
CONF_NAME, CONF_MAXIMUM, CONF_MINIMUM,
CONF_TYPE, TEMP_CELSIUS
... | apache-2.0 |
johankaito/fufuka | microblog/old-flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/_collections.py | 484 | 10454 | from collections import Mapping, MutableMapping
try:
from threading import RLock
except ImportError: # Platform-specific: No threads available
class RLock:
def __enter__(self):
pass
def __exit__(self, exc_type, exc_value, traceback):
pass
try: # Python 2.7+
from ... | apache-2.0 |
willprice/arduino-sphere-project | scripts/example_direction_finder/temboo/Library/LittleSis/Entity/GetEntityByOutsideID.py | 5 | 4096 | # -*- coding: utf-8 -*-
###############################################################################
#
# GetEntityByOutsideID
# Retrieves the record for an Entity in LittleSis using the ID of a number of third-party organizations such as the SEC or GovTrack.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Tem... | gpl-2.0 |
slank/ansible | lib/ansible/modules/system/zfs.py | 37 | 8373 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Johan Wiren <johan.wiren.se@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 th... | gpl-3.0 |
sorenk/ansible | lib/ansible/module_utils/facts/network/aix.py | 143 | 5982 | # 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 distributed in the hope that ... | gpl-3.0 |
billhsu/Unblock-Youku | test/run-all-tests.py | 43 | 3290 | #!/usr/bin/env python
"""
Allow you smoothly surf on many websites blocking non-mainland visitors.
Copyright (C) 2012, 2013 Bo Zhu http://zhuzhu.org
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the ... | agpl-3.0 |
sekikn/incubator-airflow | airflow/providers/google/cloud/example_dags/example_datacatalog.py | 2 | 18081 | #
# 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 |
waynechu/PythonProject | dns/rdataset.py | 2 | 11463 | # Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
# Copyright (C) 2001-2017 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permis... | mit |
shubhamdhama/zulip | zerver/data_import/slack_message_conversion.py | 3 | 7800 | import re
from typing import Any, Dict, List, Optional, Tuple
# stubs
ZerverFieldsT = Dict[str, Any]
SlackToZulipUserIDT = Dict[str, int]
AddedChannelsT = Dict[str, Tuple[str, int]]
# Slack link can be in the format <http://www.foo.com|www.foo.com> and <http://foo.com/>
LINK_REGEX = r"""
(<) ... | apache-2.0 |
jarshwah/django | django/contrib/postgres/utils.py | 60 | 1230 | from __future__ import unicode_literals
from django.core.exceptions import ValidationError
from django.utils.functional import SimpleLazyObject
from django.utils.text import format_lazy
def prefix_validation_error(error, prefix, code, params):
"""
Prefix a validation error message while maintaining the exist... | bsd-3-clause |
jalanb/jab | src/python/vimserver.py | 2 | 3216 | #!/usr/bin/python
#
# Server that will accept connections from a Vim channel.
# Run this server and then in Vim you can open the channel:
# :let handle = ch_open('localhost:8765')
#
# Then Vim can send requests to the server:
# :let response = ch_sendexpr(handle, 'hello!')
#
# And you can control Vim by typing a JSON... | mit |
airodactyl/qutebrowser | qutebrowser/mainwindow/statusbar/tabindex.py | 5 | 1226 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free S... | gpl-3.0 |
camptocamp/c2c-rd-addons | chricar_top/location_income_tax.py | 4 | 4512 | # -*- coding: utf-8 -*-
##############################################
#
# ChriCar Beteiligungs- und Beratungs- GmbH
# Copyright (C) ChriCar Beteiligungs- und Beratungs- GmbH
# all rights reserved
# created 2009-07-09 16:17:22+02
#
# WARNING: This program as such is intended to be used by professional
# programmers who... | agpl-3.0 |
dcroc16/skunk_works | google_appengine/lib/cherrypy/cherrypy/lib/jsontools.py | 83 | 3694 | import sys
import cherrypy
from cherrypy._cpcompat import basestring, ntou, json, json_encode, json_decode
def json_processor(entity):
"""Read application/json data into request.json."""
if not entity.headers.get(ntou("Content-Length"), ntou("")):
raise cherrypy.HTTPError(411)
body = entity.fp... | mit |
benjiec/curious | tests/curious_tests/test_query_filters.py | 2 | 4099 | from django.test import TestCase
from curious import model_registry
from curious.query import Query
from curious_tests.models import Blog, Entry, Author
from curious_tests import assertQueryResultsEqual
import curious_tests.models
class TestQueryFilters(TestCase):
def setUp(self):
blog = Blog(name='Databases')
... | mit |
jaredhasenklein/the-blue-alliance | tests/suggestions/test_suggest_apiwrite_controller.py | 5 | 4921 | import unittest2
import webapp2
import webtest
from datetime import datetime
from google.appengine.ext import testbed
from google.appengine.ext import ndb
from webapp2_extras.routes import RedirectRoute
from consts.auth_type import AuthType
from consts.district_type import DistrictType
from consts.event_type import E... | mit |
NP-Omix/BioCompass | BioCompass/table_1_extender.py | 2 | 4650 | from sys import argv
from Bio import SeqIO
import pandas as pd
import re
import itertools
import os.path
script, strain_name, cluster_number = argv
table1_df = pd.read_csv('../outputs/tables/%s_%s_table1.csv'%(strain_name,cluster_number), sep='\t')
def find_boarders(file_name):
with open(file_name).xreadlines() ... | bsd-3-clause |
TOCyna/tabelinha | flask/lib/python2.7/site-packages/sqlalchemy/dialects/mssql/base.py | 21 | 58663 | # mssql/base.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: mssql
:name: Microsoft SQL Server
Auto Increment Behavior
-----... | gpl-2.0 |
linglaiyao1314/SFrame | oss_src/unity/python/sframe/util/config.py | 8 | 3841 | '''
Copyright (C) 2015 Dato, Inc.
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
'''
import os
import time
import logging
import platform
import sys as _sys
class GraphLabConfig:
__slots__ = ['graphlab_server', 'server_addr... | bsd-3-clause |
brianwoo/django-tutorial | ENV/lib/python2.7/site-packages/django/core/cache/backends/db.py | 104 | 8808 | "Database cache backend."
import base64
from datetime import datetime
from django.conf import settings
from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache
from django.db import DatabaseError, connections, router, transaction
from django.db.backends.utils import typecast_timestamp
from django.utils i... | gpl-3.0 |
quasiben/bokeh | bokeh/charts/builders/step_builder.py | 9 | 4531 | """This is the Bokeh charts interface. It gives you a high level API to build
complex plot is a simple way.
This is the Step class which lets you build your Step charts just
passing the arguments to the Chart class and calling the proper functions.
"""
# ----------------------------------------------------------------... | bsd-3-clause |
huzq/scikit-learn | examples/applications/plot_species_distribution_modeling.py | 17 | 7971 | """
=============================
Species distribution modeling
=============================
Modeling species' geographic distributions is an important
problem in conservation biology. In this example we
model the geographic distribution of two south american
mammals given past observations and 14 environmental
varia... | bsd-3-clause |
2014cdag10/2014cdag10 | wsgi/static/Brython2.1.0-20140419-113919/Lib/multiprocessing/dummy/connection.py | 707 | 3049 | #
# Analogue of `multiprocessing.connection` which uses queues instead of sockets
#
# multiprocessing/dummy/connection.py
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditi... | gpl-2.0 |
serrodcal/cv_manager | node_modules/jasmine-core/setup.py | 191 | 1983 | from setuptools import setup, find_packages, os
import json
with open('package.json') as packageFile:
version = json.load(packageFile)['version']
setup(
name="jasmine-core",
version=version,
url="http://pivotal.github.io/jasmine/",
author="Pivotal Labs",
author_email="jasmine-js@googlegroups.com... | mit |
fitzgen/servo | tests/wpt/css-tests/tools/py/testing/code/test_code.py | 216 | 4212 | import py
import sys
def test_ne():
code1 = py.code.Code(compile('foo = "bar"', '', 'exec'))
assert code1 == code1
code2 = py.code.Code(compile('foo = "baz"', '', 'exec'))
assert code2 != code1
def test_code_gives_back_name_for_not_existing_file():
name = 'abc-123'
co_code = compile("pass\n", ... | mpl-2.0 |
benrudolph/commcare-hq | custom/care_pathways/reports/table_card_report.py | 2 | 4305 | from corehq.apps.reports.graph_models import MultiBarChart, Axis
from custom.care_pathways.reports import CareBaseReport
from custom.care_pathways.filters import GeographyFilter, GenderFilter, GroupLeadershipFilter, CBTNameFilter, PPTYearFilter, ScheduleFilter, TableCardGroupByFilter, TableCardTypeFilter
from dimagi.ut... | bsd-3-clause |
QijunPan/ansible | lib/ansible/inventory/group.py | 22 | 5020 | # (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 |
simongoffin/website_version | addons/product_extended/__init__.py | 374 | 1068 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Publ... | agpl-3.0 |
jhrozek/samba-ldb-mdb | third_party/dnspython/dns/query.py | 47 | 17780 | # 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 this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | gpl-3.0 |
jeandudey/tetris | extlibs/gtest-1.7.0/test/gtest_output_test.py | 1733 | 12005 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | gpl-3.0 |
aluetjen/libtorrent-rasterbar | parse_disk_access.py | 57 | 2523 | #! /usr/bin/env python
import os, sys, time
lines = open(sys.argv[1], 'rb').readlines()
# logfile format:
# <time(us)> <key>: <value>
# example:
# 16434 read cache: 17
keys = ['read', 'write', 'head movement', 'seek per read byte', 'seek per written byte',
'read operations per second', 'write operations per second... | bsd-3-clause |
crseanpaul/staging | tools/perf/tests/attr.py | 3174 | 9441 | #! /usr/bin/python
import os
import sys
import glob
import optparse
import tempfile
import logging
import shutil
import ConfigParser
class Fail(Exception):
def __init__(self, test, msg):
self.msg = msg
self.test = test
def getMsg(self):
return '\'%s\' - %s' % (self.test.path, self.msg)... | gpl-2.0 |
Pretio/boto | tests/unit/cloudsearch/test_exceptions.py | 114 | 1466 | from boto.compat import json
from tests.compat import mock, unittest
from tests.unit.cloudsearch.test_search import HOSTNAME, \
CloudSearchSearchBaseTest
from boto.cloudsearch.search import SearchConnection, SearchServiceException
def fake_loads_value_error(content, *ar... | mit |
alexston/calibre-webserver | src/calibre/gui2/catalog/catalog_epub_mobi.py | 3 | 60464 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import re, sys
from functools import partial
from calibre.ebooks.conversion.config ... | gpl-3.0 |
aroche/django | django/utils/baseconv.py | 650 | 2982 | # Copyright (c) 2010 Guilherme Gondim. All rights reserved.
# Copyright (c) 2009 Simon Willison. All rights reserved.
# Copyright (c) 2002 Drew Perttula. All rights reserved.
#
# License:
# Python Software Foundation License version 2
#
# See the file "LICENSE" for terms & conditions for usage, and a DISCLAIMER OF
# ... | bsd-3-clause |
leandrogs/pysockfiletransfer | server.py | 1 | 4960 | from socket import *
from threading import Thread
import sys
import glob
class Server(object):
def __init__(self):
""" Função que prepara o socket """
try:
self.serverSocket = socket(AF_INET, SOCK_STREAM)
except (error):
print("Failed to create a Socket.")
... | gpl-2.0 |
Jason-Choi/EastSea-Kernel | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
WhireCrow/openwrt-mt7620 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/root-ralink/usr/lib/python2.7/_strptime.py | 174 | 19754 | """Strptime-related classes and functions.
CLASSES:
LocaleTime -- Discovers and stores locale-specific time information
TimeRE -- Creates regexes for pattern matching a string of text containing
time information
FUNCTIONS:
_getlang -- Figure out what language is being used for the locale
... | gpl-2.0 |
fedora-infra/fedhubsync | fedhubsync/__init__.py | 1 | 7491 | # -*- coding: utf-8 -*-
#
# Copyright © 2014 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
# of the GNU General Public License v.3, or (at your option) any later
# version. This program is distributed in t... | gpl-3.0 |
cosurgi/trunk | doc/sphinx/tutorial/03-oedometric-test.py | 4 | 4561 | # gravity deposition, continuing with oedometric test after stabilization
# shows also how to run parametric studies with yade-batch
# The components of the batch are:
# 1. table with parameters, one set of parameters per line (ccc.table)
# 2. readParamsFromTable which reads respective line from the parameter file
# 3... | gpl-2.0 |
xkollar/spacewalk | client/debian/packages-already-in-debian/rhn-client-tools/src/up2date_client/rhnserver.py | 17 | 8188 |
# rhn-client-tools
#
# Copyright (c) 2006--2013 Red Hat, 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; version 2 of the License.
#
# This program is distributed in the hope t... | gpl-2.0 |
jlucangelio/adventofcode | day9p2.py | 1 | 1454 | import sys
def decompress_line(line):
if "(" not in line:
# print "not in", line
return len(line), 1
# There's at least one (marker).
length = 0
in_marker = False
collecting_rep = False
marker = ""
rep = ""
nchars = 0
nreps = 0
for char in line:
if coll... | mit |
bitemyapp/ganeti | lib/client/gnt_instance.py | 2 | 62817 | #
#
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2014 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:
#
# 1. Redistributions of source code must retain the above copyri... | bsd-2-clause |
mushorg/conpot | conpot/tests/test_docs.py | 1 | 1310 | # Copyright (C) 2013 Lukas Rist <glaslos@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 program ... | gpl-2.0 |
a10networks/a10-openstack-lib | a10_openstack_lib/resources/a10_scaling_group.py | 1 | 12530 | # Copyright (C) 2016 A10 Networks 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 requi... | apache-2.0 |
puzan/ansible | lib/ansible/module_utils/netcli.py | 50 | 9709 | # 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 license
# to the complete wo... | gpl-3.0 |
mkret2/root | interpreter/llvm/src/tools/clang/www/builtins.py | 99 | 6633 | #!/usr/bin/env python
import sys, fileinput
err=0
# Giant associative set of builtin->intrinsic mappings where clang doesn't
# implement the builtin since the vector operation works by default.
repl_map = {
'__builtin_ia32_addps': '_mm_add_ps',
'__builtin_ia32_addsd': '_mm_add_sd',
'__builtin_ia32_addpd': '_mm_add_... | lgpl-2.1 |
ujjvala-addsol/addsol_hr | openerp/addons/website/models/ir_http.py | 41 | 13868 | # -*- coding: utf-8 -*-
import datetime
import hashlib
import logging
import os
import re
import traceback
import werkzeug
import werkzeug.routing
import werkzeug.utils
import openerp
from openerp.addons.base import ir
from openerp.addons.base.ir import ir_qweb
from openerp.addons.website.models.website import slug, ... | agpl-3.0 |
enriquesanchezb/practica_utad_2016 | venv/lib/python2.7/site-packages/nltk/tag/brill_trainer.py | 4 | 27783 | # -*- coding: utf-8 -*-
# Natural Language Toolkit: Transformation-based learning
#
# Copyright (C) 2001-2013 NLTK Project
# Author: Marcus Uneson <marcus.uneson@gmail.com>
# based on previous (nltk2) version by
# Christopher Maloof, Edward Loper, Steven Bird
# URL: <http://nltk.org/>
# For license informat... | apache-2.0 |
Tetcoin/python-tetcoinlib | examples/bip-0070-payment-protocol.py | 19 | 2745 | #!/usr/bin/env python3
# Copyright (C) 2013-2014 The python-bitcoinlib developers
#
# This file is part of python-bitcoinlib.
#
# It is subject to the license terms in the LICENSE file found in the top-level
# directory of this distribution.
#
# No part of python-bitcoinlib, including this file, may be copied, modifie... | lgpl-3.0 |
hayd/python-oauth2 | setup.py | 5 | 1213 | #!/usr/bin/env python
from setuptools import setup
import os, re
PKG='oauth2'
VERSIONFILE = os.path.join('oauth2', '_version.py')
verstr = "unknown"
try:
verstrline = open(VERSIONFILE, "rt").read()
except EnvironmentError:
pass # Okay, there is no version file.
else:
MVSRE = r"^manual_verstr *= *['\"]([^'\... | mit |
smarthall/MetricsAtHome | metricsathome/Data/BOM.py | 1 | 4797 | import urllib2
from PIL import Image
from xml.dom.minidom import parse
import dateutil.parser
from datetime import timedelta
from cStringIO import StringIO
import Cache
from ftplib import FTP
class BOM:
deflayers = ['background', 'topography', 'range',
'locations', 'copyright', 'legend.0']
backlaye... | gpl-2.0 |
vaygr/ansible | lib/ansible/plugins/lookup/sequence.py | 57 | 8759 | # (c) 2013, Jayson Vantuyl <jayson@aggressive.ly>
# (c) 2012-17 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
DOCUMENTATION = """
lookup: sequence
author: Jayso... | gpl-3.0 |
plumgrid/plumgrid-nova | nova/db/sqlalchemy/models.py | 1 | 52253 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Piston Cloud Computing, Inc.
# All Rights Reserved.
#
# Lic... | apache-2.0 |
pyroscope/pyrobase | src/pyrobase/paver/quality.py | 1 | 3643 | # -*- coding: utf-8 -*-
# pylint: disable=
""" Paver Code Quality Tasks.
Copyright (c) 2011 The PyroScope Project <pyroscope.project@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 Found... | gpl-2.0 |
haobtc/bitcoin | qa/rpc-tests/test_framework/socks5.py | 122 | 5662 | #!/usr/bin/env python3
# Copyright (c) 2015-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.
'''
Dummy Socks5 server for testing.
'''
import socket, threading, queue
import traceback, sys
### Proto... | mit |
endolith/numpy | numpy/distutils/tests/test_shell_utils.py | 17 | 1954 | import pytest
import subprocess
import json
import sys
from numpy.distutils import _shell_utils
argv_cases = [
[r'exe'],
[r'path/exe'],
[r'path\exe'],
[r'\\server\path\exe'],
[r'path to/exe'],
[r'path to\exe'],
[r'exe', '--flag'],
[r'path/exe', '--flag'],
[r'path\exe', '--flag'],
... | bsd-3-clause |
GraemeFulton/job-search | docutils-0.12/test/test_parsers/test_rst/test_directives/test_contents.py | 19 | 6242 | #! /usr/bin/env python
# $Id: test_contents.py 5889 2009-04-01 20:00:21Z gbrandl $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Tests for parts.py contents directive.
"""
from __init__ import DocutilsTestSupport
def suite():
s = DocutilsTestSupp... | gpl-2.0 |
IndraVikas/scikit-learn | sklearn/mixture/gmm.py | 128 | 31069 | """
Gaussian Mixture Models.
This implementation corresponds to frequentist (non-Bayesian) formulation
of Gaussian Mixture Models.
"""
# Author: Ron Weiss <ronweiss@gmail.com>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Bertrand Thirion <bertrand.thirion@inria.fr>
import warnings
import numpy as... | bsd-3-clause |
kindersung/servo | tests/wpt/css-tests/tools/manifest/manifest.py | 144 | 12349 | import json
import os
from collections import defaultdict
from item import item_types, ManualTest, WebdriverSpecTest, Stub, RefTest, TestharnessTest
from log import get_logger
from sourcefile import SourceFile
CURRENT_VERSION = 2
class ManifestError(Exception):
pass
class ManifestVersionMismatch(ManifestErro... | mpl-2.0 |
pypyr/pypyr-cli | pypyr/steps/fileformatyaml.py | 1 | 1853 | """pypyr step that parses yaml for string substitutions, writes output."""
import logging
from pypyr.steps.dsl.fileinoutrewriter import ObjectRewriterStep
from pypyr.utils.filesystem import YamlRepresenter
# logger means the log level will be set correctly
logger = logging.getLogger(__name__)
def run_step(context):
... | apache-2.0 |
jymannob/CouchPotatoServer | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/naver.py | 9 | 2801 | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
compat_urllib_parse,
ExtractorError,
)
class NaverIE(InfoExtractor):
_VALID_URL = r'https?://(?:m\.)?tvcast\.naver\.com/v/(?P<id>\d+)'
_TEST = {
'url': 'http://tvcast.... | gpl-3.0 |
wesolutki/securionpay-python | securionpay/customer_records.py | 2 | 1139 | from securionpay.resource import Resource
class CustomerRecords(Resource):
def buy(self, params):
return self._post('/customer-records', params)
def refresh(self, customer_record_id, params=None):
return self._post('/customer-records/%s' % customer_record_id, params)
def get(self, custom... | mit |
Jichao/skia | platform_tools/android/gyp_gen/android_framework_gyp.py | 50 | 3409 | #!/usr/bin/python
# Copyright 2014 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Modified version of gyp_skia, used by gyp_to_android.py to generate Android.mk
"""
import os
import sys
SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__))
... | bsd-3-clause |
marscher/PyEMMA | pyemma/coordinates/tests/test_numpyfilereader.py | 1 | 7352 |
# This file is part of PyEMMA.
#
# Copyright (c) 2015, 2014 Computational Molecular Biology Group, Freie Universitaet Berlin (GER)
#
# PyEMMA 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 vers... | lgpl-3.0 |
fentas/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/w3c/test_importer_unittest.py | 115 | 3011 | #!/usr/bin/env python
# Copyright (C) 2013 Adobe Systems Incorporated. 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 n... | bsd-3-clause |
openelections/openelections-core | openelex/us/wa/load.py | 1 | 33410 | from builtins import map
from builtins import str
from builtins import range
from builtins import object
import logging
import os
import re
import unicodecsv
import xlrd
from pymongo import errors
"""
Importing errors from pymongo allows us to except the specific pymongo
error which is raised when we try to perform a... | mit |
sndnvaps/xunlei-lixian | lixian_url.py | 13 | 1956 |
import base64
import urllib
def xunlei_url_encode(url):
return 'thunder://'+base64.encodestring('AA'+url+'ZZ').replace('\n', '')
def xunlei_url_decode(url):
assert url.startswith('thunder://')
url = base64.decodestring(url[10:])
assert url.startswith('AA') and url.endswith('ZZ')
return url[2:-2]
def flashget_u... | mit |
indevgr/django | django/contrib/contenttypes/models.py | 10 | 7397 | from __future__ import unicode_literals
from django.apps import apps
from django.db import models
from django.db.utils import IntegrityError, OperationalError, ProgrammingError
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
class Cont... | bsd-3-clause |
mustafat/odoo-1 | addons/pos_discount/discount.py | 315 | 1468 | # -*- 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 |
tsileo/blobstash-python-docstore | blobstash/base/blobstore.py | 1 | 2657 | from hashlib import blake2b
from requests import HTTPError
from blobstash.base.client import Client
from blobstash.base.error import BlobStashError
from blobstash.base.iterator import BasePaginationIterator
class BlobStoreError(BlobStashError):
"""Base error for the blobstore module."""
class BlobNotFoundErro... | mit |
carolFrohlich/nipype | nipype/interfaces/minc/tests/test_auto_Gennlxfm.py | 2 | 1307 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ....testing import assert_equal
from ..minc import Gennlxfm
def test_Gennlxfm_inputs():
input_map = dict(args=dict(argstr='%s',
),
clobber=dict(argstr='-clobber',
usedefault=True,
),
environ=dict(nohash=True,
usedefault=True,
)... | bsd-3-clause |
QuinnSong/JPG-Tools | src/swirl.py | 1 | 1356 | #-*- coding: cp936 -*-
import math
from PIL import Image
def swirl(image, degree = 50):
'''
@Ч¹û£ºäöÎУ¬¶ÔͼÏñ½øÐÐäöÎÐÌØÐ§´¦Àí
@param image: instance of Image
@param degree: ±íʾäöÎеĴóС[0, 100]
@return: instance of Image
'''
degree = min(max(0, degree), 100) / 1000.0
if image... | gpl-3.0 |
AgostonSzepessy/servo | tests/wpt/web-platform-tests/tools/pytest/doc/en/_themes/flask_theme_support.py | 2228 | 4875 | # flasky extensions. flasky pygments style based on tango style
from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic, Whitespace, Punctuation, Other, Literal
class FlaskyStyle(Style):
background_color = "#f8f8f8"
default_style = "... | mpl-2.0 |
manazhao/tf_recsys | tensorflow/contrib/layers/__init__.py | 11 | 3141 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
adieu/django-nonrel | django/contrib/auth/tests/auth_backends.py | 104 | 14245 | import warnings
from django.conf import settings
from django.contrib.auth.models import User, Group, Permission, AnonymousUser
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ImproperlyConfigured
from django.db import connection
from django.test import TestCase
from django... | bsd-3-clause |
aleksandra-tarkowska/openmicroscopy | components/tools/OmeroPy/src/omero/plugins/ldap.py | 5 | 8911 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
User administration plugin (LDAP extension)
Copyright 2011 - 2016 Glencoe Software, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
"""
import sys
from omero.cli import CLI, ExceptionHandler, admin_only, UserGroupControl
fr... | gpl-2.0 |
nansencenter/nansat | nansat/mappers/mapper_netcdf_cf.py | 1 | 19069 | ''' Nansat NetCDF-CF mapper
Check CF-compliance of your files here:
http://cfconventions.org/compliance-checker.html
'''
import warnings, os, datetime
import numpy as np
import collections
from nansat.utils import gdal
from dateutil.parser import parse
from netCDF4 import Dataset
from nansat.vrt import VRT
... | gpl-3.0 |
aaltinisik/OCBAltinkaya | addons/purchase_requisition/wizard/purchase_requisition_partner.py | 373 | 2320 | # -*- 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 |
mandeepdhami/nova | nova/api/validation/__init__.py | 42 | 2280 | # Copyright 2013 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | apache-2.0 |
coderb0t/CouchPotatoServer | libs/tornado/platform/twisted.py | 65 | 21419 | # Author: Ovidiu Predescu
# Date: July 2011
#
# 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 ... | gpl-3.0 |
Allianzcortex/scrapy | scrapy/dupefilters.py | 116 | 2209 | from __future__ import print_function
import os
import logging
from scrapy.utils.job import job_dir
from scrapy.utils.request import request_fingerprint
class BaseDupeFilter(object):
@classmethod
def from_settings(cls, settings):
return cls()
def request_seen(self, request):
return Fals... | bsd-3-clause |
kenshay/ImageScript | ProgramData/Android/ADB/platform-tools/systrace/catapult/telemetry/third_party/tsproxy/tsproxy.py | 7 | 29768 | #!/usr/bin/python
"""
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 l... | gpl-3.0 |
htdevices/linux-2.6-imx | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
jansohn/pyload | module/plugins/hoster/DepositfilesCom.py | 2 | 3415 | # -*- coding: utf-8 -*-
import re
import urllib
from module.plugins.captcha.ReCaptcha import ReCaptcha
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class DepositfilesCom(SimpleHoster):
__name__ = "DepositfilesCom"
__type__ = "hoster"
__version__ = "0.58"
__stat... | gpl-3.0 |
c-o-m-m-a-n-d-e-r/CouchPotatoServer | libs/tornado/auth.py | 102 | 61853 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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... | gpl-3.0 |
gymnasium/edx-platform | openedx/core/djangoapps/api_admin/api/v1/tests/test_views.py | 18 | 3610 | """
Tests for the `api_admin` api module.
"""
import json
from rest_framework.reverse import reverse
from django.contrib.auth.models import User
from django.test import TestCase
from openedx.core.djangoapps.api_admin.tests import factories
from openedx.core.djangolib.testing.utils import skip_unless_lms
from student... | agpl-3.0 |
goozbach/ansible | lib/ansible/plugins/connection/chroot.py | 13 | 7103 | # Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2013, Maykel Moya <mmoya@speedyrails.com>
# (c) 2015, 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 ... | gpl-3.0 |
ar7z1/ansible | lib/ansible/modules/network/cloudengine/ce_aaa_server_host.py | 43 | 105166 | #!/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 |
tmenjo/cinder-2015.1.0 | cinder/volume/throttling.py | 4 | 4300 | # Copyright (c) 2015 Hitachi Data Systems, 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
#
# U... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.