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 |
|---|---|---|---|---|---|
vijaylbais/boto | boto/ec2/image.py | 57 | 16344 | # Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
#
# 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
# w... | mit |
dr-robertk/opm-common | python/opm/tools/time_vector.py | 5 | 11656 | import datetime
from operator import attrgetter
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from opm.io.parser import Parser
# This is from the TimeMap.cpp implementation in opm
ecl_month = {"JAN" : 1,
"FEB" : 2,
"MAR" : 3,
"APR" : 4,
... | gpl-3.0 |
powerlim2/project_free_insight | data_api/venv/lib/python2.7/site-packages/psycopg2/tests/test_transaction.py | 62 | 9214 | #!/usr/bin/env python
# test_transaction - unit test on transaction behaviour
#
# Copyright (C) 2007-2011 Federico Di Gregorio <fog@debian.org>
#
# psycopg2 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 Foundat... | bsd-3-clause |
herlo/d-note | dnote/__init__.py | 3 | 2650 | """This module sets up the paths for the Flask web application."""
import os
import utils
from flask import Flask, render_template, request, redirect, url_for
from note import Note
DNOTE = Flask(__name__)
HERE = DNOTE.root_path
@DNOTE.route('/', methods=['GET'])
def index():
"""Return the index.html for the main ... | agpl-3.0 |
BradleyCai/ucr-schedule-visualizer | scripts/target_sample.py | 2 | 1189 | __all__ = [
'depends',
'config_fields',
'run',
]
import random
depends = [
# Specify dependencies here. Each of these is a target
# as specified in a target_* file.
]
config_fields = {
# Settings can be passed to a target as a JSON file
# Specify the types of each field here
# If thi... | mit |
elkingtonmcb/scikit-learn | sklearn/setup.py | 225 | 2856 | import os
from os.path import join
import warnings
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_info, BlasNotFoundError
import numpy
libraries = []
if os.name == 'posix':
libraries.appe... | bsd-3-clause |
TzarIvan/profitpy | profit/lib/widgets/historicaldatadialog.py | 18 | 2612 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2007 Troy Melhase, Yichun Wei
# Distributed under the terms of the GNU General Public License v2
# Author: Troy Melhase <troy@gci.net>
from time import localtime, strftime
from PyQt4.QtGui import QDialog
from ib.ext.Contract import Contract
from profit.lib.w... | gpl-2.0 |
javierwilson/err | errbot/bundled/rocket.py | 8 | 65165 | # -*- coding: utf-8 -*-
# This file is part of the Rocket Web Server
# Copyright (c) 2011 Timothy Farrell
# Import System Modules
import sys
import errno
import socket
import logging
import platform
# Define Constants
VERSION = '1.2.4'
SERVER_NAME = socket.gethostname()
SERVER_SOFTWARE = 'Rocket %s' % VERSION
HTTP_S... | gpl-3.0 |
openilabs/falconlab | env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/connection.py | 187 | 5659 | # urllib3/connection.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import socket
from socket import timeout as SocketTimeout
try: # Python 3
from http.cli... | mit |
kichkasch/pisi | pisiconstants.py | 1 | 4235 | """
Module for definition of shared constants between the modules.
This file is part of Pisi.
Pisi is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later ... | gpl-3.0 |
yugui/grpc | src/python/grpcio_tests/tests/unit/_credentials_test.py | 23 | 3384 | # 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 |
HyperloopTeam/FullOpenMDAO | lib/python2.7/site-packages/openmdao.main-0.13.0-py2.7.egg/openmdao/main/test/test_scaler_adder_example.py | 1 | 5419 | """ Tests the scaler/adder example in our docs. This test was inconvenient to test
in its place in the docs. """
# pylint: disable-msg=C0111,C0103
import unittest
from openmdao.lib.datatypes.api import Float
from openmdao.lib.drivers.api import SLSQPdriver
from openmdao.main.api import Assembly,Component
from openmda... | gpl-2.0 |
j00bar/ansible | lib/ansible/plugins/lookup/sequence.py | 29 | 7200 | # (c) 2013, Jayson Vantuyl <jayson@aggressive.ly>
#
# 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 v... | gpl-3.0 |
SoftwareKing/zstack-utility | kvmagent/kvmagent/test/test_vr_create_iso.py | 3 | 1551 | '''
@author: Frank
'''
import unittest
import time
from kvmagent import kvmagent
from kvmagent.plugins import virtualrouter_plugin
from zstacklib.utils import http
from zstacklib.utils import jsonobject
from zstacklib.utils import log
from zstacklib.utils import uuidhelper
class Test(unittest.TestCase):
... | apache-2.0 |
ruuk/service.xbmc.tts | enabler.py | 1 | 3477 | # -*- coding: utf-8 -*-
import os, sys, xbmc, xbmcaddon
DISABLE_PATH = os.path.join(xbmc.translatePath('special://profile').decode('utf-8'), 'addon_data', 'service.xbmc.tts', 'DISABLED')
ENABLE_PATH = os.path.join(xbmc.translatePath('special://profile').decode('utf-8'), 'addon_data', 'service.xbmc.tts', 'ENABLED')
de... | gpl-2.0 |
npiganeau/odoo | addons/l10n_multilang/__openerp__.py | 339 | 1670 | # -*- 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 |
franzjesus/GTab-10.1-AOKP | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
GaZ3ll3/numba | condatestall.py | 7 | 1112 | """
Uses conda to run and test all supported python + numpy versions.
"""
from __future__ import print_function
import itertools
import subprocess
import os
import sys
if '-q' in sys.argv[1:]:
NPY = '18',
else:
NPY = '16', '17', '18'
PY = '26', '27', '33'
RECIPE_DIR = "./buildscripts/condarecipe.local"
def ... | bsd-2-clause |
dims/glance | glance/db/sqlalchemy/migrate_repo/versions/042_add_changes_to_reinstall_unique_metadef_constraints.py | 6 | 24462 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | apache-2.0 |
BeegorMif/HTPC-Manager | lib/unidecode/x06d.py | 252 | 4651 | data = (
'Zhou ', # 0x00
'Ji ', # 0x01
'Yi ', # 0x02
'Hui ', # 0x03
'Hui ', # 0x04
'Zui ', # 0x05
'Cheng ', # 0x06
'Yin ', # 0x07
'Wei ', # 0x08
'Hou ', # 0x09
'Jian ', # 0x0a
'Yang ', # 0x0b
'Lie ', # 0x0c
'Si ', # 0x0d
'Ji ', # 0x0e
'Er ', # 0x0f
'Xing ', # 0x10
'Fu ... | gpl-3.0 |
linjoahow/w17test_1 | static/Brython3.1.0-20150301-090019/Lib/test/re_tests.py | 879 | 31796 | #!/usr/bin/env python3
# -*- mode: python -*-
# Re test suite and benchmark suite v1.5
# The 3 possible outcomes for each pattern
[SUCCEED, FAIL, SYNTAX_ERROR] = range(3)
# Benchmark suite (needs expansion)
#
# The benchmark suite does not test correctness, just speed. The
# first element of each tuple is the regex... | gpl-3.0 |
tzaffi/git-in-practice-repo | book/lib/python2.7/site-packages/django/core/handlers/wsgi.py | 58 | 7670 | from __future__ import unicode_literals
import codecs
import logging
import sys
from io import BytesIO
from threading import Lock
from django import http
from django.core import signals
from django.core.handlers import base
from django.core.urlresolvers import set_script_prefix
from django.utils import datastructures... | mit |
tequa/ammisoft | ammimain/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64/Lib/site-packages/pygments/lexers/whiley.py | 31 | 4012 | # -*- coding: utf-8 -*-
"""
pygments.lexers.whiley
~~~~~~~~~~~~~~~~~~~~~~
Lexers for the Whiley language.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, bygroups, words
from pygments.token impor... | bsd-3-clause |
pozdnyakov/chromium-crosswalk | tools/heapcheck/chrome_tests.py | 7 | 17636 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
''' Runs various chrome tests through heapcheck_test.py.
Most of this code is copied from ../valgrind/chrome_tests.py.
TODO(glider... | bsd-3-clause |
pplatek/odoo | openerp/modules/graph.py | 260 | 7763 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | agpl-3.0 |
mKeRix/home-assistant | tests/components/auth/test_init_link_user.py | 21 | 3674 | """Tests for the link user flow."""
from . import async_setup_auth
from tests.common import CLIENT_ID, CLIENT_REDIRECT_URI
async def async_get_code(hass, aiohttp_client):
"""Return authorization code for link user tests."""
config = [
{
"name": "Example",
"type": "insecure_exa... | mit |
SBillion/aegroupware | registration/forms.py | 12 | 4862 | """
Forms and validation code for user registration.
"""
from django.contrib.auth.models import User
from django import forms
from django.utils.translation import ugettext_lazy as _
# I put this on all required fields, because it's easier to pick up
# on them with CSS or JavaScript if they have a class of "require... | mit |
AutorestCI/azure-sdk-for-python | azure-mgmt-sql/azure/mgmt/sql/models/resource_identity.py | 2 | 1661 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
sebalix/OpenUpgrade | addons/report_webkit/__init__.py | 382 | 1593 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com)
# All Right Reserved
#
# Author : Nicolas Bessi (Camptocamp)
#
# WARNING: This program as such is intended to be used by professional
# programmers who... | agpl-3.0 |
krisys/django | tests/generic_inline_admin/models.py | 281 | 1708 | from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
class Episode(models.Model):
name = models.CharField(max_length=100)
... | bsd-3-clause |
alazaro/tennis_tournament | django/contrib/gis/db/models/query.py | 290 | 35968 | from django.db import connections
from django.db.models.query import QuerySet, Q, ValuesQuerySet, ValuesListQuerySet
from django.contrib.gis.db.models import aggregates
from django.contrib.gis.db.models.fields import get_srid_info, GeometryField, PointField, LineStringField
from django.contrib.gis.db.models.sql import... | gpl-3.0 |
glorizen/nupic | nupic/regions/ImageSensorExplorers/RandomJump.py | 17 | 7511 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
mdblv2/joatu-django | application/site-packages/django/utils/timesince.py | 79 | 2510 | from __future__ import unicode_literals
import datetime
from django.utils.timezone import is_aware, utc
from django.utils.translation import ungettext, ugettext
def timesince(d, now=None, reversed=False):
"""
Takes two datetime objects and returns the time between d and now
as a nicely formatted string, ... | apache-2.0 |
simplyguru-dot/ansible-modules-extras | packaging/os/slackpkg.py | 131 | 6382 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Kim Nørgaard
# Written by Kim Nørgaard <jasen@jasen.dk>
# Based on pkgng module written by bleader <bleader@ratonland.org>
# that was based on pkgin module written by Shaun Zinck <shaun.zinck at gmail.com>
# that was based on pacman module written by Afterburn <htt... | gpl-3.0 |
waheedahmed/edx-platform | lms/djangoapps/lms_migration/migrate.py | 47 | 8929 | #
# migration tools for content team to go from stable-edx4edx to LMS+CMS
#
import json
import logging
import os
import xmodule.modulestore.django as xmodule_django
from xmodule.modulestore.django import modulestore
from django.http import HttpResponse
from django.conf import settings
import track.views
try:
fro... | agpl-3.0 |
x303597316/hue | desktop/core/ext-py/Django-1.6.10/tests/generic_views/test_edit.py | 50 | 17194 | from __future__ import absolute_import
import warnings
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import reverse
from django import forms
from django.test import TestCase
from django.utils.unittest import expectedFailure
from django.test.client import RequestFactory
from dja... | apache-2.0 |
harshilasu/GraphicMelon | y/google-cloud-sdk/lib/requests/setup.py | 11 | 1641 | #!/usr/bin/env python
import os
import sys
import requests
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
packages = [
'requests',
'requests.packages',
'requests.pa... | gpl-3.0 |
podemos-info/odoo | addons/product/report/pricelist.py | 9 | 4809 | # -*- 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... | agpl-3.0 |
silly-wacky-3-town-toon/SOURCE-COD | toontown/minigame/MinigameGlobals.py | 5 | 2001 | from direct.showbase import PythonUtil
from toontown.toonbase import ToontownGlobals
from toontown.hood import ZoneUtil
from random import choice
latencyTolerance = 10.0
MaxLoadTime = 40.0
rulesDuration = 16
JellybeanTrolleyHolidayScoreMultiplier = 2
DifficultyOverrideMult = int(1 << 16)
def QuantizeDifficultyOverride... | apache-2.0 |
GauriGNaik/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/handshake/_base.py | 652 | 6143 | # Copyright 2012, 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... | mpl-2.0 |
c0d3z3r0/linux-rockchip | tools/testing/selftests/tc-testing/TdcResults.py | 557 | 4359 | #!/usr/bin/env python3
from enum import Enum
class ResultState(Enum):
noresult = -1
skip = 0
success = 1
fail = 2
class TestResult:
def __init__(self, test_id="", test_name=""):
self.test_id = test_id
self.test_name = test_name
self.result = ResultState.noresult
self.f... | gpl-2.0 |
rgeleta/odoo | openerp/addons/base/res/res_country.py | 283 | 4728 | # -*- 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... | agpl-3.0 |
seaotterman/tensorflow | tensorflow/contrib/linear_optimizer/python/sdca_optimizer.py | 75 | 11131 | """Linear Estimators."""
# 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
#
#... | apache-2.0 |
slisson/intellij-community | python/lib/Lib/encodings/undefined.py | 860 | 1299 | """ Python 'undefined' Codec
This codec will always raise a ValueError exception when being
used. It is intended for use by the site.py file to switch off
automatic string to Unicode coercion.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
impo... | apache-2.0 |
kongseokhwan/kulcloud-iitp-neutron | neutron/db/migration/alembic_migrations/env.py | 15 | 2997 | # Copyright 2012 New Dream Network, LLC (DreamHost)
#
# 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 a... | apache-2.0 |
rbaindourov/v8-inspector | Source/chrome/tools/diagnose-me.py | 128 | 3534 | #!/usr/bin/python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Diagnose some common system configuration problems on Linux, and
suggest fixes."""
import os
import subprocess
import sys
all_chec... | bsd-3-clause |
dmpiergiacomo/scion | python/test/lib/sibra/ext/offer_test.py | 3 | 3519 | # Copyright 2016 ETH Zurich
#
# 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, sof... | apache-2.0 |
beni55/edx-platform | lms/djangoapps/courseware/features/courseware_common.py | 160 | 1067 | # pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
# pylint: disable=unused-argument
from lettuce import world, step
@step('I click on View Courseware')
def i_click_on_view_courseware(step):
world.css_click('a.enter-course')
@step('I click on the "([^"]*)" tab$')
def i_click_on_the_tab(... | agpl-3.0 |
Vimos/scikit-learn | sklearn/utils/testing.py | 29 | 25405 | """Testing utilities."""
# Copyright (c) 2011, 2012
# Authors: Pietro Berkes,
# Andreas Muller
# Mathieu Blondel
# Olivier Grisel
# Arnaud Joly
# Denis Engemann
# Giorgio Patrini
# Thierry Guillemot
# License: BSD 3 clause
import os
import inspect
import p... | bsd-3-clause |
hkernbach/arangodb | 3rdParty/V8/v5.7.492.77/tools/testrunner/network/endpoint.py | 23 | 4536 | # Copyright 2012 the V8 project 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditi... | apache-2.0 |
sebadiaz/kafka | tests/kafkatest/services/kafka_log4j_appender.py | 14 | 4046 | # 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 use ... | apache-2.0 |
HybridF5/tempest | tempest/lib/services/network/security_group_rules_client.py | 8 | 1378 | # 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
# d... | apache-2.0 |
ShinyROM/android_external_chromium_org | build/android/pylib/forwarder.py | 26 | 12720 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import fcntl
import logging
import os
import psutil
import re
import sys
import time
import android_commands
import cmd_helper
import constants
from py... | bsd-3-clause |
raycarnes/stock-logistics-warehouse | stock_reserve/model/product.py | 12 | 2881 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pu... | agpl-3.0 |
Allow2CEO/browser-ios | brave/node_modules/ad-block/node_modules/bloom-filter-cpp/vendor/depot_tools/testing_support/super_mox.py | 25 | 5140 | # Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Simplify unit tests based on pymox."""
import os
import random
import shutil
import string
import StringIO
import subprocess
import sys
sys.path.app... | mpl-2.0 |
uclouvain/osis | base/models/session_exam_deadline.py | 1 | 4136 | ##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | agpl-3.0 |
drmrd/ansible | lib/ansible/modules/windows/win_domain_user.py | 24 | 10493 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# this is a windows documentation stub. actual code lives in the .ps1
# file of the same name
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'... | gpl-3.0 |
neale/CS-program | 434-MachineLearning/final_project/linearClassifier/sklearn/datasets/mlcomp.py | 289 | 3855 | # Copyright (c) 2010 Olivier Grisel <olivier.grisel@ensta.org>
# License: BSD 3 clause
"""Glue code to load http://mlcomp.org data as a scikit.learn dataset"""
import os
import numbers
from sklearn.datasets.base import load_files
def _load_document_classification(dataset_path, metadata, set_=None, **kwargs):
if ... | unlicense |
wroersma/volatility | volatility/protos.py | 58 | 6418 | protos = {
0:"HOPOPT",
1:"ICMP",
2:"IGMP",
3:"GGP",
4:"IPv4",
5:"ST",
6:"TCP",
7:"CBT",
8:"EGP",
9:"IGP",
10:"BBN-RCC-MON",
11:"NVP-II",
12:"PUP",
13:"ARGUS",
14:"EMCON",... | gpl-2.0 |
rhurkes/chasegame | venv/lib/python2.7/site-packages/werkzeug/testsuite/utils.py | 146 | 11435 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.utils
~~~~~~~~~~~~~~~~~~~~~~~~
General utilities.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement
import unittest
from datetime import datetime
from functools import part... | mit |
eharney/cinder | cinder/tests/unit/volume/drivers/dell_emc/sc/test_fc.py | 1 | 43968 | # Copyright (c) 2014 Dell 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 a... | apache-2.0 |
saeki-masaki/cinder | cinder/zonemanager/fc_san_lookup_service.py | 23 | 3551 | # (c) Copyright 2014 Brocade Communications Systems Inc.
# All Rights Reserved.
#
# 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
#
# ... | apache-2.0 |
klusark/android_external_chromium_org | chrome/common/extensions/docs/server2/object_store_creator.py | 52 | 3304 | # 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.
from appengine_wrappers import GetAppVersion
from cache_chain_object_store import CacheChainObjectStore
from memcache_object_store import MemcacheObjectStore... | bsd-3-clause |
moble/sympy | sympy/matrices/immutable.py | 60 | 4889 | from __future__ import print_function, division
from sympy.core import Basic, Integer, Tuple, Dict, S, sympify
from sympy.core.sympify import converter as sympify_converter
from sympy.matrices.matrices import MatrixBase
from sympy.matrices.dense import DenseMatrix
from sympy.matrices.sparse import SparseMatrix, Mutab... | bsd-3-clause |
mbalasso/mynumpy | numpy/ma/tests/test_old_ma.py | 12 | 34497 | import numpy
import types
from numpy.ma import *
from numpy.core.numerictypes import float32
from numpy.ma.core import umath
from numpy.testing import *
import sys
if sys.version_info[0] >= 3:
from functools import reduce
pi = numpy.pi
def eq(v, w, msg=''):
result = allclose(v, w)
if not result:
p... | bsd-3-clause |
mabhub/Geotrek | geotrek/settings/base.py | 1 | 17906 | import os
import sys
from django.contrib.messages import constants as messages
from geotrek import __version__
from . import PROJECT_ROOT_PATH
def gettext_noop(s):
return s
DEBUG = False
TEMPLATE_DEBUG = DEBUG
TEST = 'test' in sys.argv
VERSION = __version__
ADMINS = (
('Makina Corpus', 'geobi@makina-corp... | bsd-2-clause |
britcey/ansible | lib/ansible/utils/ssh_functions.py | 87 | 1482 | # (c) 2016, James Tanner
# (c) 2016, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (... | gpl-3.0 |
amith01994/intellij-community | python/lib/Lib/site-packages/django/contrib/localflavor/jp/jp_prefectures.py | 543 | 2089 | from django.utils.translation import ugettext_lazy
JP_PREFECTURES = (
('hokkaido', ugettext_lazy('Hokkaido'),),
('aomori', ugettext_lazy('Aomori'),),
('iwate', ugettext_lazy('Iwate'),),
('miyagi', ugettext_lazy('Miyagi'),),
('akita', ugettext_lazy('Akita'),),
('yamagata', ugettext_lazy('Yamagat... | apache-2.0 |
shsingh/ansible | lib/ansible/galaxy/__init__.py | 51 | 2495 | ########################################################################
#
# (C) 2015, Brian Coca <bcoca@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation... | gpl-3.0 |
40223117cda/w16cdaa | static/Brython3.1.0-20150301-090019/Lib/site-packages/pygame/sprite.py | 603 | 55779 | ## pygame - Python Game Library
## Copyright (C) 2000-2003, 2007 Pete Shinners
## (C) 2004 Joe Wreschnig
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; e... | gpl-3.0 |
inspyration/odoo | addons/l10n_be/wizard/l10n_be_vat_intra.py | 4 | 14737 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# Adapted by Noviat to
# - make the 'mand_id' field optional
# - support Noviat tax code scheme
#... | agpl-3.0 |
edesiocs/namebench | nb_third_party/jinja2/__init__.py | 175 | 2270 | # -*- coding: utf-8 -*-
"""
jinja2
~~~~~~
Jinja2 is a template engine written in pure Python. It provides a
Django inspired non-XML syntax but supports inline expressions and
an optional sandboxed environment.
Nutshell
--------
Here a small example of a Jinja2 template::
{% ... | apache-2.0 |
eBay/restcommander | play-1.2.4/python/Lib/encodings/euc_jisx0213.py | 816 | 1051 | #
# euc_jisx0213.py: Python Unicode Codec for EUC_JISX0213
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_jp, codecs
import _multibytecodec as mbc
codec = _codecs_jp.getcodec('euc_jisx0213')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(m... | apache-2.0 |
schlueter/ansible | lib/ansible/modules/packaging/os/pkgutil.py | 52 | 6757 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Alexander Winkler <mail () winkler-alexander.de>
# based on svr4pkg by
# Boyd Adamson <boyd () boydadamson.com> (2012)
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division,... | gpl-3.0 |
Orochimarufan/youtube-dl | devscripts/gh-pages/add-version.py | 174 | 1170 | #!/usr/bin/env python3
from __future__ import unicode_literals
import json
import sys
import hashlib
import os.path
if len(sys.argv) <= 1:
print('Specify the version number as parameter')
sys.exit()
version = sys.argv[1]
with open('update/LATEST_VERSION', 'w') as f:
f.write(version)
versions_info = jso... | unlicense |
fiji-flo/servo | tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/environment.py | 1 | 8310 | import json
import os
import multiprocessing
import signal
import socket
import sys
import time
from mozlog import get_default_logger, handlers, proxy
from wptlogging import LogLevelRewriter
from wptserve.handlers import StringHandler
here = os.path.split(__file__)[0]
repo_root = os.path.abspath(os.path.join(here, o... | mpl-2.0 |
CamelBackNotation/CarnotKE | jyhton/Lib/test/test_zlib_jy.py | 23 | 1039 | """Misc zlib tests
Made for Jython.
"""
import unittest
import zlib
from array import array
from test import test_support
class ArrayTestCase(unittest.TestCase):
def test_array(self):
self._test_array(zlib.compress, zlib.decompress)
def test_array_compressobj(self):
def compress(value):
... | apache-2.0 |
IllusionRom-deprecated/android_platform_tools_idea | python/helpers/pydev/pydevd_vars.py | 3 | 9451 | """ pydevd_vars deals with variables:
resolution/conversion to XML.
"""
import pickle
from django_frame import DjangoTemplateFrame
from pydevd_constants import * #@UnusedWildImport
from types import * #@UnusedWildImport
from pydevd_xml import *
try:
from StringIO import StringIO
except ImportError:
from i... | apache-2.0 |
EricCline/CEM_inc | env/lib/python2.7/site-packages/django/contrib/localflavor/pl/forms.py | 110 | 7602 | """
Polish-specific form helpers
"""
from __future__ import absolute_import, unicode_literals
import re
from django.contrib.localflavor.pl.pl_administrativeunits import ADMINISTRATIVE_UNIT_CHOICES
from django.contrib.localflavor.pl.pl_voivodeships import VOIVODESHIP_CHOICES
from django.core.validators import EMPTY_V... | mit |
Endika/OpenUpgrade | addons/crm/tests/test_new_lead_notification.py | 70 | 1354 | # -*- coding: utf-8 -*-
from openerp.tests.common import TransactionCase
class NewLeadNotificationTest(TransactionCase):
def test_new_lead_notification(self):
# Create a new user
user = self.env["res.users"].create({
"name": __file__,
"login": __file__,
})
... | agpl-3.0 |
nugget/home-assistant | homeassistant/components/alarmdecoder/alarm_control_panel.py | 2 | 4611 | """Support for AlarmDecoder-based alarm control panels (Honeywell/DSC)."""
import logging
import voluptuous as vol
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.components.alarmdecoder import DATA_AD, SIGNAL_PANEL_MESSAGE
from homeassistant.const import (
ATTR_CODE, STATE_ALARM_A... | apache-2.0 |
haoqili/MozSecWorld | vendor-local/lib/python2.7/Crypto/Protocol/Chaffing.py | 226 | 9467 | """This file implements the chaffing algorithm.
Winnowing and chaffing is a technique for enhancing privacy without requiring
strong encryption. In short, the technique takes a set of authenticated
message blocks (the wheat) and adds a number of chaff blocks which have
randomly chosen data and MAC fields. This means... | bsd-3-clause |
brijeshkesariya/odoo | openerp/addons/base/tests/test_views.py | 176 | 39717 | # -*- encoding: utf-8 -*-
from functools import partial
import itertools
import unittest2
from lxml import etree as ET
from lxml.builder import E
from psycopg2 import IntegrityError
from openerp.tests import common
import openerp.tools
Field = E.field
class ViewCase(common.TransactionCase):
def setUp(self):
... | agpl-3.0 |
Francis-Liu/animated-broccoli | nova/objects/dns_domain.py | 29 | 2606 | # Copyright (C) 2014, Red Hat, 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... | apache-2.0 |
boooka/GeoPowerOff | venv/lib/python2.7/site-packages/pip/_vendor/distlib/database.py | 360 | 49138 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2013 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""PEP 376 implementation."""
from __future__ import unicode_literals
import base64
import codecs
import contextlib
import hashlib
import logging
import os
import posixpath
import sys
import z... | apache-2.0 |
itmanagerro/tresting | qa/rpc-tests/getchaintips.py | 101 | 2205 | #!/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.
# Exercise the getchaintips API. We introduce a network split, work
# on chains of different lengths, an... | mit |
jelly/calibre | manual/conf.py | 2 | 7503 | # -*- coding: utf-8 -*-
#
# calibre documentation build configuration file, created by
# sphinx-quickstart.py on Sun Mar 23 01:23:55 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pick... | gpl-3.0 |
aforalee/rally | tests/functional/test_cli_plugin.py | 15 | 3018 | # Copyright 2015: Mirantis 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 |
adamgf/zxing_iphone_pdf_417 | cpp/scons/scons-local-2.0.0.final.0/SCons/Tool/dvipdf.py | 34 | 4094 | """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 The SCons Foundation... | apache-2.0 |
aboutsajjad/Bridge | app_packages/youtube_dl/extractor/litv.py | 64 | 6254 | # coding: utf-8
from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
smuggle_url,
unsmuggle_url,
)
class LiTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?litv\.tv/(?:vod|promo)/[^/]+/(?:content\.do)?\?.*?... | mit |
resmo/ansible | test/units/modules/cloud/misc/virt_net/test_virt_net.py | 38 | 1081 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2019, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from units.compat import mock
def test_virt_net_create_already_active(virt_net_obj, dummy_libvirt):
virt_net_obj.conn.create = mock.Mock()
assert virt_n... | gpl-3.0 |
laszlocsomor/tensorflow | tensorflow/python/keras/_impl/keras/applications/inception_v3_test.py | 34 | 2148 | # 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 |
BMJHayward/django | django/db/backends/mysql/introspection.py | 363 | 9023 | from collections import namedtuple
from MySQLdb.constants import FIELD_TYPE
from django.db.backends.base.introspection import (
BaseDatabaseIntrospection, FieldInfo, TableInfo,
)
from django.utils.datastructures import OrderedSet
from django.utils.encoding import force_text
FieldInfo = namedtuple('FieldInfo', Fi... | bsd-3-clause |
gallifrey17/eden | static/scripts/tools/apps_db_comparison.py | 46 | 4490 | # This script compares the db schema of 2 eden apps to tell the differences
#
# Just run the script with 3 necessary arguments in this order
# 1. WEB2PY_PATH
# 2. OLD_APP
# 3. NEW_APP
# python applications/eden/static/scripts/tools/apps_db_comparison.py /home/web2py eden_old eden_new
#
# This script also has a Test scr... | mit |
nmarcetic/weblines.io | weblines/apps/cms/tests/test_models.py | 1 | 2950 | """
Domain objects test suites
"""
from django.db import IntegrityError
from django.test import TestCase
from weblines.apps.cms import models
class PageTestCase(TestCase):
"""
Contains page-related test scenarios
"""
def test_creation(self):
"""
Tests various creation scenarios
... | gpl-2.0 |
sojournexx/python | Assignments/TanAndrew_assign6.py | 1 | 5318 | #Andrew Tan, 3/25, Section 010
import myfunctions
import random
#Ask user for inputs and check validity
while True:
qns = int(input("How many problems would you like to attempt? "))
if qns <= 0:
print("Invalid number, try again\n")
continue
else:
break
while True:
... | mit |
jmehnle/ansible | lib/ansible/modules/cloud/rackspace/rax_cbs.py | 70 | 7282 | #!/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 distributed... | gpl-3.0 |
DBHeise/fileid | runtests.py | 1 | 2380 | import requests, json, argparse, os, subprocess, xmltodict
envDict = {}
ignoreFiles = [".gitignore",".gitattributes","LICENSE"]
ignoreExt = [".md",".txt",".json",".ps1",".py"]
def findBinaries(basefolder):
testBinaries = []
fileidBinaries = []
for root, dirs, files in os.walk(basefolder):
for file in files:
i... | mit |
andfoy/margffoy-tuay-server | env/lib/python2.7/site-packages/tornado/iostream.py | 38 | 64263 | #!/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-2.0 |
abagh0703/RetailTrail | flask/lib/python2.7/site-packages/whoosh/compat.py | 22 | 5357 | import array, sys
# Run time aliasing of Python2/3 differences
def htmlescape(s, quote=True):
# this is html.escape reimplemented with cgi.escape,
# so it works for python 2.x, 3.0 and 3.1
import cgi
s = cgi.escape(s, quote)
if quote:
# python 3.2 also replaces the single quotes:
... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.