repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
laurentb/weboob
modules/parolesmania/test.py
2
1744
# -*- coding: utf-8 -*- # Copyright(C) 2013 Julien Veyssier # # This file is part of a weboob module. # # This weboob module 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...
lgpl-3.0
Ghalko/osf.io
website/search/views.py
17
10128
# -*- coding: utf-8 -*- import json import time import logging import functools import httplib as http from urllib2 import unquote import bleach from flask import request from modularodm import Q from framework.auth.decorators import collect_auth from framework.auth.decorators import must_be_logged_in from website ...
apache-2.0
liqin75/vse-vpnaas-plugin
quantum/openstack/common/policy.py
4
21570
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2012 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www....
apache-2.0
2014c2g6/c2g6
w2/static/Brython2.0.0-20140209-164925/Lib/xml/dom/expatbuilder.py
733
35733
"""Facility to use the Expat parser to load a minidom instance from a string or file. This avoids all the overhead of SAX and pulldom to gain performance. """ # Warning! # # This module is tightly bound to the implementation details of the # minidom DOM and can't be used with other DOM implementations. This # is due...
gpl-2.0
quarkslab/irma
frontend/extras/migration/versions/eb7141efd75a_version_1_3_0.py
1
6216
"""version 1.3.0 Revision ID: eb7141efd75a Revises: 430a70c8aa21 Create Date: 2016-01-06 13:38:46.918409 """ # revision identifiers, used by Alembic. revision = 'eb7141efd75a' down_revision = '430a70c8aa21' branch_labels = None depends_on = None from alembic import op import sqlalchemy as sa from irma.common.utils....
apache-2.0
barneygale/cedar
cedar/spiral.py
1
1117
square = 16 * 25 class Spiral: @classmethod def spiral(cls, radius, start=(0,0)): clip1 = (2*radius - 1)//square clip2 = max(0, radius - square//2) offset1 = (clip1 % 2) * square//2 for p in cls.spiral_inner(pow(clip1+1, 2)): yield tuple( v + ...
mit
YuMatsuzawa/HadoopEclipseProject
hadoop-0.20.2-cdh3u5/src/examples/python/pyAbacus/JythonAbacus.py
123
2767
# # 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
hakjimmy/cngame
module_sounds.py
1
23515
from header_sounds import * # Many of these sound entries are hard coded into the engine, and should not be removed; to disable them, empty the sound file list. # Add your own sounds just before the animation sounds group, or before sounds_end. sounds = [ ("click", sf_2d|sf_priority_9|sf_vol_3, ["drum_3.ogg"]), ("t...
bsd-3-clause
cbrewster/servo
tests/wpt/web-platform-tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/resource.py
133
6317
import os import re def main(request, response): type = request.GET['type'] encoding = request.GET['encoding'] # We want the raw input for 'q' q = re.search(r'q=([^&]+)', request.url_parts.query).groups()[0] if type == 'html': return [("Content-Type", "text/html; charset=utf-8")], q eli...
mpl-2.0
20tab/django-filer
filer/admin/forms.py
33
3604
from django import forms from django.db import models from django.contrib.admin import widgets from filer.utils.files import get_valid_filename from django.utils.translation import ugettext as _ from django.core.exceptions import ValidationError from django.conf import settings if 'cmsplugin_filer_image' in settings....
bsd-3-clause
rubyinhell/brython
www/tests/test_datetime.py
14
3694
from datetime import MINYEAR, MAXYEAR, timedelta, date, datetime #todo: issue when importing from a module, one object at a time. # for example, the next three lines #from datetime import tzinfo #from datetime import time #from datetime import date, datetime assert MINYEAR == 1 assert MAXYEAR == 9999 assert timedelta...
bsd-3-clause
edx/edx-platform
lms/djangoapps/program_enrollments/rest_api/v1/serializers.py
5
7513
""" API Serializers """ from rest_framework import serializers from lms.djangoapps.program_enrollments.api import is_course_staff_enrollment from lms.djangoapps.program_enrollments.models import ProgramCourseEnrollment, ProgramEnrollment from .constants import CourseRunProgressStatuses # pylint: disable=abstract-m...
agpl-3.0
beatrizjesus/my-first-blog
pasta/Lib/site-packages/django/contrib/auth/admin.py
83
8318
from django.conf import settings from django.conf.urls import url from django.contrib import admin, messages from django.contrib.admin.options import IS_POPUP_VAR from django.contrib.admin.utils import unquote from django.contrib.auth import update_session_auth_hash from django.contrib.auth.forms import ( AdminPass...
mit
schleichdi2/OPENNFR-6.1-CORE
opennfr-openembedded-core/scripts/lib/wic/utils/runner.py
1
1774
#!/usr/bin/env python -tt # # Copyright (c) 2011 Intel, 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 that it will b...
gpl-2.0
njwilson23/scipy
scipy/odr/setup.py
128
1311
#!/usr/bin/env python from __future__ import division, print_function, absolute_import from os.path import join def configuration(parent_package='', top_path=None): import warnings from numpy.distutils.misc_util import Configuration from numpy.distutils.system_info import get_info, BlasNotFoundError ...
bsd-3-clause
mluo613/osf.io
scripts/osfstorage/migrate_from_oldels.py
9
9202
from __future__ import division from __future__ import unicode_literals import logging import datetime as dt from pymongo.errors import DuplicateKeyError from modularodm import Q from modularodm.storage.base import KeyExistsException from framework.mongo import database from framework.analytics import clean_page fr...
apache-2.0
dorotan/pythontraining
env/Lib/site-packages/pip/_vendor/progress/helpers.py
521
2854
# Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com> # # Permission to use, copy, modify, and distribute this software 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 "AS IS" AND THE A...
apache-2.0
TalShafir/ansible
lib/ansible/modules/cloud/ovirt/ovirt_storage_connection.py
19
9202
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2017 Red Hat, Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMEN...
gpl-3.0
5y/kivy
examples/widgets/scrollview.py
17
1272
import kivy kivy.require('1.0.8') from kivy.app import App from kivy.uix.button import Button from kivy.uix.scrollview import ScrollView from kivy.uix.gridlayout import GridLayout class ScrollViewApp(App): def build(self): # create a default grid layout with custom width/height layout = GridLay...
mit
stefangri/s_s_productions
PHY341/V401_Interferometer/Messdaten/latex.py
2
2289
from pandas import Series, DataFrame import pandas as pd import collections import numpy import uncertainties import pint from uncertainties import ufloat from uncertainties import ufloat_fromstr from pint import UnitRegistry import string ureg = UnitRegistry() Q_ = ureg.Quantity class Latexdocument(object): def ...
mit
swatilodha/coala
tests/bears/BearTest.py
15
6133
import multiprocessing import unittest from coalib.bears.Bear import Bear from coalib.output.printers.LOG_LEVEL import LOG_LEVEL from coalib.processes.communication.LogMessage import LogMessage from coalib.settings.Section import Section from coalib.settings.Setting import Setting class TestBear(Bear): def __in...
agpl-3.0
infosec-216/alice
vk_filter.py
1
12539
import logging import time import cStringIO from PIL import Image from libmproxy.protocol.http import decoded import re import urllib # Russian messages support from sets import Set logging.basicConfig(filename="/root/mitm.log",level=logging.DEBUG) class VK_user: def __init__(self): self.id = "" ...
mit
michalliu/OpenWrt-Firefly-Libraries
staging_dir/host/lib/python2.7/warnings.py
14
14088
"""Python part of the warnings subsystem.""" # Note: function level imports should *not* be used # in this module as it may cause import lock deadlock. # See bug 683658. import linecache import sys import types __all__ = ["warn", "warn_explicit", "showwarning", "formatwarning", "filterwarnings", "simplefil...
gpl-2.0
cajal/pipeline
python/pipeline/utils/galvo_corrections.py
5
13668
""" Utilities for motion and raster correction of resonant scans. """ import numpy as np from scipy import interpolate as interp from scipy import signal from scipy import ndimage from ..exceptions import PipelineException from ..utils.signal import mirrconv def compute_raster_phase(image, temporal_fill_fraction): ...
lgpl-3.0
rajashreer7/autotest-client-tests
linux-tools/udisks2/udisks2.py
4
1218
#!/bin/python import os, subprocess import logging from autotest.client import test from autotest.client.shared import error class udisks2(test.test): """ Autotest module for testing basic functionality of udisks2 @author Gowri Shankar <gowrishankar.m@in.ibm.com> """ version = 1 nfail = ...
gpl-2.0
rossella/neutron
quantum/openstack/common/uuidutils.py
159
1106
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2012 Intel 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.apa...
apache-2.0
andrewpollock/grpc
src/python/grpcio_tests/tests/unit/_empty_message_test.py
14
4767
# Copyright 2016, 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...
bsd-3-clause
sjsucohort6/openstack
python/venv/lib/python2.7/site-packages/openstackclient/common/quota.py
1
7859
# Copyright 2012 OpenStack Foundation # # 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 ...
mit
devops2014/djangosite
django/contrib/gis/geos/prepared.py
137
2437
from .base import GEOSBase from .error import GEOSException from .geometry import GEOSGeometry from .libgeos import geos_version_info from .prototypes import prepared as capi class PreparedGeometry(GEOSBase): """ A geometry that is prepared for performing certain operations. At the moment this includes th...
bsd-3-clause
grumpyjames/buck
src/com/facebook/buck/json/buck_parser/module_whitelist.py
14
6191
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import with_statement from __builtin__ import __import__ as ORIGINAL_IMPORT from . import util import __builtin__ import contextlib import inspect import imp class ImportWhitelistManager(obje...
apache-2.0
KyleJamesWalker/ansible
lib/ansible/modules/messaging/rabbitmq_vhost.py
69
4384
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Chatham Financial <oss@chathamfinancial.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...
gpl-3.0
marcosxddh/aula_script
backend/appengine/routes/books/rest.py
1
1044
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from gaebusiness.business import CommandExecutionException from tekton.gae.middleware.json_middleware import JsonResponse from book_app import facade def index(): cmd = facade.list_books_cmd() book_list = cmd() short_form=fac...
mit
40223225/40223225-cdb-0622
static/Brython3.1.1-20150328-091302/Lib/tarfile.py
728
88474
#!/usr/bin/env python3 #------------------------------------------------------------------- # tarfile.py #------------------------------------------------------------------- # Copyright (C) 2002 Lars Gustaebel <lars@gustaebel.de> # All rights reserved. # # Permission is hereby granted, free of charge, to any pers...
gpl-3.0
abhishek-ram/pyas2
pyas2/management/commands/cleanas2server.py
1
3094
from django.core.management.base import BaseCommand from django.utils.translation import ugettext as _ from datetime import timedelta from django.utils import timezone from pyas2 import models from pyas2 import pyas2init import os import glob class Command(BaseCommand): help = _(u'Automatic maintenance for the AS...
gpl-2.0
crlang/sublime-text---front-end-config
Data/Packages/ESLint/ESLint.py
2
1716
import os import platform import sublime import sublime_plugin SETTINGS_KEY = 'ESLint.sublime-settings' DEFAULT_NODE_PATH = '' DEFAULT_NODE_MODULES_PATH = '' DEFAULT_CONFIGFILE = '' class Preferences: def load(self, settings): self.node_path = settings.get('node_path', DEFAULT_NODE_PATH) self.node_modules_p...
mit
liuliwork/django
django/core/paginator.py
347
5031
import collections from math import ceil from django.utils import six class InvalidPage(Exception): pass class PageNotAnInteger(InvalidPage): pass class EmptyPage(InvalidPage): pass class Paginator(object): def __init__(self, object_list, per_page, orphans=0, allow_empty_first...
bsd-3-clause
tuskar/tuskar-ui
openstack_dashboard/test/test_data/nova_data.py
1
22432
# Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
apache-2.0
vrenaville/hr
__unported__/hr_employee_firstname/hr.py
8
1951
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2010 - 2014 Savoir-faire Linux # (<http://www.savoirfairelinux.com>). # # This program is free software: you can redistribute it a...
agpl-3.0
2014c2g23/2015cda-w17
gear.py
204
19237
#@+leo-ver=5-thin #@+node:office.20150407074720.1: * @file gear.py #@@language python #@@tabwidth -4 #@+<<declarations>> #@+node:office.20150407074720.2: ** <<declarations>> (application) #@@language python import cherrypy import os import sys # 這個程式要計算正齒輪的齒面寬, 資料庫連結希望使用 pybean 與 SQLite # 導入 pybean 模組與所要使用的 Store 及 S...
gpl-3.0
Affix/CouchPotatoServer
couchpotato/core/plugins/score/main.py
81
2494
from couchpotato.core.event import addEvent from couchpotato.core.helpers.encoding import toUnicode from couchpotato.core.helpers.variable import getTitle, splitString, removeDuplicate from couchpotato.core.logger import CPLog from couchpotato.core.plugins.base import Plugin from couchpotato.core.plugins.score.scores i...
gpl-3.0
biodrone/plex-desk
desk/flask/lib/python3.4/site-packages/sqlparse/sql.py
3
20474
# -*- coding: utf-8 -*- """This module contains classes representing syntactical elements of SQL.""" import re import sys from sqlparse import tokens as T class Token(object): """Base class for all other classes in this module. It represents a single token and has two instance attributes: ``value`` is...
mit
jigarkb/Programming
LeetCode/108-E-ConvertSortedArrayToBinarySearchTree.py
2
1125
# Given an array where elements are sorted in ascending order, convert it to a height balanced BST. # # For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of # every node never differ by more than 1. # # # Example: # # Given the sorted array: [-10,-3,0,5,9...
mit
fxfitz/ansible
lib/ansible/modules/cloud/openstack/os_ironic.py
33
12365
#!/usr/bin/python # coding: utf-8 -*- # (c) 2014, Hewlett-Packard Development Company, L.P. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1'...
gpl-3.0
fgesora/odoo
addons/base_report_designer/__openerp__.py
260
1704
# -*- 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
WillYee/clearsilver
cdbi/log.py
9
1082
#!/neo/opt/bin/python # log.py import sys, time DEV = "development" DEV_UPDATE = "update queries" DEV_SELECT = "select queries" DEV_REPORT = "report log" LOGGING_STATUS = { DEV : 1, DEV_UPDATE : 0, DEV_SELECT : 0, DEV_REPORT : 0} tstart = 0 def dlog(when,astr): global LOGGING_STATUS try: ...
bsd-2-clause
LokiCoder/Sick-Beard
lib/guessit/transfo/guess_release_group.py
8
6537
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2013 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free ...
gpl-3.0
Zolertia/openthread
tools/harness-automation/cases/leader_5_5_3.py
16
2065
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread Authors. # 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 # notic...
bsd-3-clause
popazerty/openhdf-enigma2
lib/python/Screens/TaskView.py
55
5653
from Screens.Screen import Screen from Components.ConfigList import ConfigListScreen from Components.config import ConfigSubsection, ConfigSelection, getConfigListEntry from Components.SystemInfo import SystemInfo from Components.Task import job_manager from InfoBarGenerics import InfoBarNotifications import Screens.St...
gpl-2.0
weimingtom/python-for-android
python-build/python-libs/gdata/tests/gdata_tests/apps/service_test_using_mock.py
87
2144
#!/usr/bin/python # # Copyright (C) 2007 SIOS Technology, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
apache-2.0
kewitz/algebralinear
teste.py
1
2593
#!/usr/bin/python # -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2014 Leonardo Kewitz Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limit...
mit
bobphill/compose
tests/integration/testcases.py
24
1484
from __future__ import unicode_literals from __future__ import absolute_import from compose.service import Service from compose.config import ServiceLoader from compose.const import LABEL_PROJECT from compose.cli.docker_client import docker_client from compose.progress_stream import stream_output from .. import unittes...
apache-2.0
Khan/git-bigfile
vendor/boto/kms/__init__.py
113
1640
# Copyright (c) 2014 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
le9i0nx/ansible
lib/ansible/modules/system/svc.py
63
9262
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2015, Brian Coca <bcoca@ansible.com> # 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': '...
gpl-3.0
cclauss/heroku-buildpack-python
vendor/pip-pop/pip/wheel.py
187
30186
""" Support for installing and building the "wheel" binary package format. """ from __future__ import absolute_import import compileall import csv import errno import functools import hashlib import logging import os import os.path import re import shutil import stat import sys import tempfile import warnings from ba...
mit
zhangxq5012/sky_engine
build/android/pylib/utils/reraiser_thread.py
51
4650
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Thread and ThreadGroup that reraise exceptions on the main thread.""" # pylint: disable=W0212 import logging import sys import threading import traceback...
bsd-3-clause
sachintyagi22/spark
examples/src/main/python/mllib/power_iteration_clustering_example.py
128
1792
# # 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
n6151h/pyconau2016
zk/tests/model/test_role.py
5
1637
# pytest magic: from .conftest import app_config, db_session from .fixtures import PersonFactory, RoleFactory from zk.model.person import Person from zk.model.role import Role class TestRole(object): def test_map_person(self, db_session): """Test mapping persons to roles""" person = PersonFactory...
gpl-2.0
Purgator/slackotd
node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py
1366
120842
# 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. """Xcode project file generator. This module is both an Xcode project file generator and a documentation of the Xcode project file format. Knowledge of the proje...
mit
Belxjander/Kirito
Python-3.5.0-Amiga/Lib/distutils/tests/__init__.py
165
1060
"""Test suite for distutils. This test suite consists of a collection of test modules in the distutils.tests package. Each test module has a name starting with 'test' and contains a function test_suite(). The function is expected to return an initialized unittest.TestSuite instance. Tests for the command classes in...
gpl-3.0
ldhwin/pywinauto
examples/MiscExamples.py
19
2971
# GUI Application automation and testing library # Copyright (C) 2006 Mark Mc Mahon # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License # as published by the Free Software Foundation; either version 2.1 # of the License, or (at you...
lgpl-2.1
jayceyxc/hue
desktop/core/ext-py/boto-2.42.0/tests/integration/route53/domains/test_route53domains.py
113
1887
# Copyright (c) 2014 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 ...
apache-2.0
keto/askbot-devel
askbot/management/commands/apply_hinted_tags.py
13
2281
import datetime from django.conf import settings as django_settings from django.core.management.base import BaseCommand from django.core.management.base import CommandError from django.utils import translation from optparse import make_option from askbot.utils.console import ProgressBar from askbot.models import Thread...
gpl-3.0
masamichi/bite-project
deps/gdata-python-client/tests/gdata_tests/apps/multidomain/data_test.py
38
5417
#!/usr/bin/python2.4 # # Copyright 2011 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 require...
apache-2.0
mandeepdhami/neutron
neutron/db/migration/alembic_migrations/vpn_init_ops.py
61
6314
# Copyright 2014 OpenStack Foundation # # 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 ...
apache-2.0
cortext/crawtextV2
~/venvs/crawler/lib/python2.7/site-packages/whoosh/spelling.py
39
12750
# Copyright 2007 Matt Chaput. 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...
mit
bop/rango
lib/python2.7/site-packages/django/contrib/gis/geos/tests/test_mutable_list.py
102
15029
# Copyright (c) 2008-2009 Aryeh Leib Taurog, http://www.aryehleib.com # All rights reserved. # # Modified from original contribution by Aryeh Leib Taurog, which was # released under the New BSD license. from django.contrib.gis.geos.mutable_list import ListMixin from django.utils import six from django.utils import unit...
gpl-2.0
ryugoo/HBCW
plugins/ti.alloy/plugin.py
1729
5251
import os, sys, subprocess, hashlib import subprocess def check_output(*popenargs, **kwargs): r"""Run command with arguments and return its output as a byte string. Backported from Python 2.7 as it's implemented as pure python on stdlib. >>> check_output(['/usr/bin/python', '--version']) Python 2.6....
apache-2.0
DirtyUnicorns/android_kernel_lge_g3
scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
bcoca/ansible
test/integration/targets/collections/collection_root_user/ansible_collections/testns/testcoll/plugins/modules/uses_leaf_mu_module_import_from.py
35
1387
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json import sys from ansible_collections.testns.testcoll.plugins.module_utils import leaf, secondary # FIXME: this one needs pkginit synthesis to work # from ansible_collections.testns.testcoll.plugins.mod...
gpl-3.0
michigraber/scikit-learn
sklearn/ensemble/tests/test_forest.py
48
35412
""" Testing for the forest module (sklearn.ensemble.forest). """ # Authors: Gilles Louppe, # Brian Holt, # Andreas Mueller, # Arnaud Joly # License: BSD 3 clause import pickle from collections import defaultdict from itertools import product import numpy as np from scipy.sparse import csr_...
bsd-3-clause
YxomNPO/YxomCoin
contrib/devtools/test-security-check.py
131
2460
#!/usr/bin/python2 ''' Test script for security-check.py ''' from __future__ import division,print_function import subprocess import sys import unittest def write_testcode(filename): with open(filename, 'w') as f: f.write(''' #include <stdio.h> int main() { printf("the quick brown fox j...
mit
silentbob73/kitsune
kitsune/questions/tests/test_cron.py
13
5362
from datetime import datetime, timedelta from django.core import mail import mock from nose.tools import eq_ from kitsune.products.tests import product import kitsune.questions.tasks from kitsune.questions import config from kitsune.questions.cron import escalate_questions, report_employee_answers from kitsune.quest...
bsd-3-clause
andela-ggikera/photo-editing-app
editor/photo_effects.py
1
3217
"""Define imports.""" from PIL import ImageFilter, ImageOps, ImageEnhance def grayscale(image, name, temp_url): """Return an image with a contrast of grey.""" image.seek(0) photo = ImageOps.grayscale(image) photo.save(temp_url + "GRAYSCALE" + name) return temp_url + "GRAYSCALE" + name def smooth...
mit
40223101/w16b_test
static/Brython3.1.1-20150328-091302/Lib/posix.py
603
20904
"""This module provides access to operating system functionality that is standardized by the C Standard and the POSIX standard (a thinly disguised Unix interface). Refer to the library manual and corresponding Unix manual entries for more information on calls.""" import datetime from browser import window def _rand...
agpl-3.0
ramineni/myironic
ironic/common/image_service.py
1
2467
# Copyright 2010 OpenStack Foundation # Copyright 2013 Hewlett-Packard Development Company, L.P. # 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 # # ht...
apache-2.0
TiVoMaker/boto
boto/cloudfront/__init__.py
164
15176
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ # # 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, modi...
mit
pdebuyl/numpy
numpy/f2py/f2py_testing.py
17
1457
import sys import re from numpy.testing import jiffies, memusage def cmdline(): m = re.compile(r'\A\d+\Z') args = [] repeat = 1 for a in sys.argv[1:]: if m.match(a): repeat = eval(a) else: args.append(a) f2py_opts = ' '.join(args) return repeat, f2py_op...
bsd-3-clause
wangjun/cl-auto-reply
gae/lib/werkzeug/contrib/testtools.py
295
2449
# -*- coding: utf-8 -*- """ werkzeug.contrib.testtools ~~~~~~~~~~~~~~~~~~~~~~~~~~ This module implements extended wrappers for simplified testing. `TestResponse` A response wrapper which adds various cached attributes for simplified assertions on various content types. :copyright:...
mit
gic888/MIEN
optimizers/randsearch.py
1
1656
#!/usr/bin/env python # encoding: utf-8 #Created by Graham Cummins on 2007-08-23. # Copyright (C) 2007 Graham I Cummins # 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 L...
gpl-2.0
pz325/hornbook-django
utils/trie.py
2
2847
#!/usr/bin/env python # -*- coding: utf-8 -*- class Node( object ): def __init__( self, end_node = False ): self.end_node = end_node self.prefix_count = 0 self.children = {} class Trie( object ): def __init__( self ): self.root = Node() def insert( self, key ):...
bsd-3-clause
emon10005/scikit-image
skimage/io/_plugins/qt_plugin.py
15
5534
from .util import prepare_for_display, window_manager import numpy as np # We try to aquire the gui lock first or else the gui import might # trample another GUI's PyOS_InputHook. window_manager.acquire('qt') try: from PyQt4.QtGui import (QApplication, QImage, QLabel, QMainWindow, QPi...
bsd-3-clause
jkonecki/autorest
ClientRuntimes/Python/msrest/test/__init__.py
14
1599
# -------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All rights reserved. # # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the ""Software""),...
mit
vorburger/mcedit2
src/mceditlib/pocket.py
2
15639
""" pocket.py PocketWorld and PocketChunksFile for reading saved files from Minecraft Pocket Edition. Currently, only Block editing is supported. Little-endian NBT support is needed before Entity and Player editing is possible. """ from __future__ import absolute_import import logging import os im...
bsd-3-clause
sheafferusa/erpnext
erpnext/controllers/item_variant.py
6
6048
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import cstr, flt import json class ItemVariantExistsError(frappe.ValidationError): pass class Inva...
agpl-3.0
KonstantinShemyak/python-javatools
javatools/dirutils.py
2
5709
# This library is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This library is distributed in the hope that it will be usefu...
lgpl-3.0
nuanri/hiblog
src/app/blog/console_views.py
1
17946
# coding: utf-8 import json import requests from hanlder import RequestHandler as BaseRequestHandler import tornado.web from tornado.web import authenticated from ..utils import deal_errors, get_local_time, get_local_time_string from .forms import BlogWriterForm, BlogCatalogWriterForm class RequestHandler(BaseRequ...
mit
40223137/w1717
static/Brython3.1.3-20150514-095342/Lib/zipfile.py
620
66368
""" Read and write ZIP files. XXX references to utf-8 need further investigation. """ import io import os import re import imp import sys import time import stat import shutil import struct import binascii try: import zlib # We may need its compression method crc32 = zlib.crc32 except ImportError: zlib =...
gpl-3.0
openhatch/oh-mainline
vendor/packages/Django/django/contrib/localflavor/pl/pl_administrativeunits.py
110
12858
# -*- coding: utf-8 -*- """ Polish administrative units as in http://pl.wikipedia.org/wiki/Podzia%C5%82_administracyjny_Polski """ from __future__ import unicode_literals ADMINISTRATIVE_UNIT_CHOICES = ( ('wroclaw', 'Wrocław'), ('jeleniagora', 'Jelenia Góra'), ('legnica', 'Legnica'), ('boleslawiecki', ...
agpl-3.0
darkleons/odoo
openerp/addons/base/res/res_lang.py
81
11538
# -*- coding: utf-8 -*- ############################################################################## # # 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...
agpl-3.0
mcardillo55/django
tests/gis_tests/relatedapp/tests.py
199
15937
from __future__ import unicode_literals from django.contrib.gis.db.models import F, Collect, Count, Extent, Union from django.contrib.gis.geometry.backend import Geometry from django.contrib.gis.geos import GEOSGeometry, MultiPoint, Point from django.db import connection from django.test import TestCase, ignore_warnin...
bsd-3-clause
sarvex/tensorflow
tensorflow/python/data/experimental/kernel_tests/variant_test.py
14
2139
# Copyright 2019 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
saisankargochhayat/algo_quest
leetcode/430.FlatternADoubleLinkedList/soln.py
1
1710
""" # Definition for a Node. class Node: def __init__(self, val, prev, next, child): self.val = val self.prev = prev self.next = next self.child = child """ class Solution: def flatten(self, head: 'Node') -> 'Node': start = head head = head while head != ...
apache-2.0
msabramo/ansible
lib/ansible/executor/task_result.py
67
3075
# (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
etuna-SBF-kog/Stadsparken
env/lib/python2.7/site-packages/django/contrib/gis/db/models/fields.py
400
11157
from django.db.models.fields import Field from django.db.models.sql.expressions import SQLEvaluator from django.utils.translation import ugettext_lazy as _ from django.contrib.gis import forms from django.contrib.gis.db.models.proxy import GeometryProxy from django.contrib.gis.geometry.backend import Geometry, Geometry...
gpl-3.0
irwinlove/django
tests/admin_utils/tests.py
45
13439
from __future__ import unicode_literals from datetime import datetime from decimal import Decimal from django import forms from django.conf import settings from django.contrib import admin from django.contrib.admin import helpers from django.contrib.admin.utils import ( NestedObjects, display_for_field, flatten, ...
bsd-3-clause
openstack-packages/rdopkg
tests/test_actions.py
2
1091
import pytest from rdopkg.cli import rdopkg, rdopkg_runner from rdopkg import exception import actions def test_actions_availability(): r = rdopkg('actions') assert r == 0, "Some action functions are NOT AVAILABLE" def test_actions_continue_short(): r = rdopkg('-c') assert r == 1, "-c succeeded wi...
apache-2.0
AdiPersonalWorks/ATOS_GOM_SystemPrototyping
pico/auth.py
1
1890
import pico from pico import PicoError class NotAuthorizedError(PicoError): def __init__(self, message=''): PicoError.__init__(self, message) self.response.status = "401 Not Authorized" self.response.set_header("WWW-Authenticate", "Basic") class InvalidSessionError(PicoError): def _...
mit
georgid/sms-tools
lectures/7-Sinusoidal-plus-residual-model/plots-code/stochasticSynthesisFrame.py
2
2997
import numpy as np import matplotlib.pyplot as plt from scipy.signal import hamming, hanning, triang, blackmanharris, resample import math import sys, os, time from scipy.fftpack import fft, ifft sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) import utilFunction...
agpl-3.0
ecolitan/fatics
venv/lib/python2.7/site-packages/pytz/tzfile.py
480
4869
#!/usr/bin/env python ''' $Id: tzfile.py,v 1.8 2004/06/03 00:15:24 zenzen Exp $ ''' try: from cStringIO import StringIO except ImportError: from io import StringIO from datetime import datetime, timedelta from struct import unpack, calcsize from pytz.tzinfo import StaticTzInfo, DstTzInfo, memorized_ttinfo fro...
agpl-3.0
nlevitt/youtube-dl
youtube_dl/extractor/criterion.py
138
1359
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re from .common import InfoExtractor class CriterionIE(InfoExtractor): _VALID_URL = r'https?://www\.criterion\.com/films/(?P<id>[0-9]+)-.+' _TEST = { 'url': 'http://www.criterion.com/films/184-le-samourai', 'md5': 'bc51be...
unlicense