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
chokribr/invenio
invenio/modules/previewer/previewerext/pdfjs.py
19
1164
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later...
gpl-2.0
raajitr/django_hangman
env/lib/python2.7/site-packages/django/http/cookie.py
119
2895
from __future__ import unicode_literals import sys from django.utils import six from django.utils.encoding import force_str from django.utils.six.moves import http_cookies # http://bugs.python.org/issue2193 is fixed in Python 3.3+. _cookie_allows_colon_in_names = six.PY3 # Cookie pickling bug is fixed in Python 2.7...
mit
abhinavmoudgil95/root
interpreter/llvm/src/utils/lit/lit/TestingConfig.py
20
6505
import os import sys OldPy = sys.version_info[0] == 2 and sys.version_info[1] < 7 class TestingConfig: """" TestingConfig - Information on the tests inside a suite. """ @staticmethod def fromdefaults(litConfig): """ fromdefaults(litConfig) -> TestingConfig Create a Testin...
lgpl-2.1
nsmoooose/csp
csp/data/ui/tutorials/mission.py
1
2231
#!/usr/bin/python # Combat Simulator Project # Copyright (C) 2002-2009 The Combat Simulator Project # http://csp.sourceforge.net # # 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...
gpl-2.0
mitchrule/Miscellaneous
Django_Project/django/Lib/site-packages/pip/_vendor/progress/helpers.py
404
2894
# 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...
mit
xmission/d-note
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/jisfreq.py
3131
47315
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
agpl-3.0
cdeil/gammalib
inst/cta/test/test_irf_offset.py
1
5601
#! /usr/bin/env python # ===========================================================================================# # This script tests the offset angle dependence of the instrumental response function. # # ===========================================================================================# from gammalib impo...
gpl-3.0
aferr/TimingCompartments
src/arch/x86/isa/insts/simd128/integer/data_transfer/move_mask.py
91
2266
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bsd-3-clause
Mozhuowen/brython
www/src/Lib/encodings/cp273.py
34
14439
""" Python Character Mapping Codec cp273 generated from 'python-mappings/CP273.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,e...
bsd-3-clause
denim2x/urllib3
test/test_retry.py
16
7746
import unittest from urllib3.response import HTTPResponse from urllib3.packages.six.moves import xrange from urllib3.util.retry import Retry from urllib3.exceptions import ( ConnectTimeoutError, MaxRetryError, ReadTimeoutError, ResponseError, ) class RetryTest(unittest.TestCase): def test_string...
mit
ROAND/dota2herovoices
.buildozer/venv/lib/python2.7/site-packages/setuptools/tests/test_develop.py
286
3605
"""develop tests """ import sys import os, shutil, tempfile, unittest import tempfile import site from distutils.errors import DistutilsError from setuptools.command.develop import develop from setuptools.command import easy_install as easy_install_pkg from setuptools.compat import StringIO from setuptools.dist import...
gpl-2.0
apple/swift
utils/swift_build_support/swift_build_support/products/indexstoredb.py
5
3518
# swift_build_support/products/indexstoredb.py -------------------*- python -*- # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https://swift.org/LICENSE.t...
apache-2.0
TeamTwisted/external_chromium_org
native_client_sdk/src/tools/tests/fix_deps_test.py
104
2807
#!/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. import os import sys import tempfile import unittest SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PARENT_DIR = os.path.d...
bsd-3-clause
nikesh-mahalka/nova
nova/db/sqlalchemy/migrate_repo/versions/249_remove_duplicate_index.py
81
1049
# Copyright 2014 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.org/licenses/LICENSE-2.0 # # Unless requi...
apache-2.0
ABaldwinHunter/django-clone-classic
tests/m2m_through/tests.py
13
15754
from __future__ import unicode_literals from datetime import datetime from operator import attrgetter from django.test import TestCase from .models import ( CustomMembership, Employee, Event, Friendship, Group, Ingredient, Invitation, Membership, Person, PersonSelfRefM2M, Recipe, RecipeIngredient, Relati...
bsd-3-clause
pratikmallya/hue
desktop/core/ext-py/Django-1.6.10/tests/defaultfilters/tests.py
48
31837
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime import decimal from django.template.defaultfilters import * from django.test import TestCase from django.test.utils import TransRealMixin from django.utils import six from django.utils import unittest, translation from django.utils.safest...
apache-2.0
Ehnonymoose/delver
server/delver.py
1
2586
from flask import Flask, request, jsonify, send_from_directory, make_response from functools import wraps, update_wrapper from datetime import datetime from sqlalchemy import and_, or_ from sqlalchemy.sql import select app = Flask(__name__) from database import db_session import query import models import json NUM...
mit
hale36/SRTV
lib/sqlalchemy/testing/config.py
76
2116
# testing/config.py # Copyright (C) 2005-2014 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 import collections requirements = None db = None db_url = None db_opts = None file_...
gpl-3.0
maxamillion/ansible
lib/ansible/modules/tempfile.py
13
3375
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2016, Krzysztof Magosa <krzysztof@magosa.pl> # Copyright: (c) 2017, 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__ = t...
gpl-3.0
molobrakos/home-assistant
tests/helpers/test_restore_state.py
10
8454
"""The tests for the Restore component.""" from datetime import datetime from homeassistant.const import EVENT_HOMEASSISTANT_START from homeassistant.core import CoreState, State from homeassistant.exceptions import HomeAssistantError from homeassistant.helpers.entity import Entity from homeassistant.helpers.restore_s...
apache-2.0
hlt-bme-hu/eval-embed
translate.py
1
5706
import sys import numpy from collections import defaultdict from itertools import chain import argparse def renormalize(M): M /= numpy.linalg.norm(M, axis=1)[:, None] return def renormalize_vector(v): return v / numpy.linalg.norm(v) def outer(l1, l2): return list(chain(*[[(x,y) for x in l1] for y in ...
lgpl-3.0
dzimine/mistral
mistral/context.py
3
3749
# -*- coding: utf-8 -*- # # Copyright 2013 - Mirantis, 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 requir...
apache-2.0
listamilton/supermilton.repository
script.module.youtube.dl/lib/youtube_dl/extractor/anysex.py
224
2085
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( parse_duration, int_or_none, ) class AnySexIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?anysex\.com/(?P<id>\d+)' _TEST = { 'url': 'http://anysex.com/156592/', 'md5': '023...
gpl-2.0
chrsrds/scikit-learn
examples/manifold/plot_swissroll.py
72
1295
""" =================================== Swiss Roll reduction with LLE =================================== An illustration of Swiss Roll reduction with locally linear embedding """ # Author: Fabian Pedregosa -- <fabian.pedregosa@inria.fr> # License: BSD 3 clause (C) INRIA 2011 print(__doc__) import matplotlib.pyplot...
bsd-3-clause
devopservices/ansible
plugins/inventory/jail.py
132
1288
#!/usr/bin/env python # (c) 2013, Michael Scherer <misc@zarb.org> # # 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 o...
gpl-3.0
n0m4dz/odoo
addons/hr_payroll_account/__init__.py
433
1116
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
wilg64/MarkovTweet
markovtweet.py
1
5870
import tweepy import json import re import time import random def create_api(config_filename): """ Creates an authorized tweepy API object given a config file containing appropriate twitter application keys :param config_filename: string containing the config filename :return: the tweepy API obje...
mit
fitermay/intellij-community
python/lib/Lib/encodings/iso2022_jp_1.py
816
1061
# # iso2022_jp_1.py: Python Unicode Codec for ISO2022_JP_1 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_iso2022, codecs import _multibytecodec as mbc codec = _codecs_iso2022.getcodec('iso2022_jp_1') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class Incrementa...
apache-2.0
henryiii/rootpy
rootpy/plotting/utils.py
1
14257
# Copyright 2012 the rootpy developers # distributed under the terms of the GNU General Public License from __future__ import absolute_import from math import log import operator import ROOT from .canvas import _PadBase from .hist import _Hist, Hist, HistStack from .graph import _Graph1DBase, Graph from ..context im...
gpl-3.0
ahmadio/edx-platform
lms/djangoapps/certificates/views/badges.py
85
1112
""" Certificate views for open badges. """ from django.shortcuts import redirect, get_object_or_404 from opaque_keys.edx.locator import CourseLocator from util.views import ensure_valid_course_key from eventtracking import tracker from certificates.models import BadgeAssertion @ensure_valid_course_key def track_shar...
agpl-3.0
ktan2020/legacy-automation
win/Lib/test/test_minidom.py
7
62194
# test for xml.dom.minidom import pickle from StringIO import StringIO from test.test_support import verbose, run_unittest, findfile import unittest import xml.dom import xml.dom.minidom import xml.parsers.expat from xml.dom.minidom import parse, Node, Document, parseString from xml.dom.minidom import ge...
mit
q3k/kasownik
webapp/models.py
1
13156
#!/usr/bin/env python2 # - * - coding=utf-8 - * - # Copyright (c) 2015, Sergiusz Bazanski <q3k@q3k.org> # Copyright (c) 2015, Remigiusz Marcinkiewicz <enleth@enleth.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the followi...
bsd-2-clause
perrette/pyglacier
pyglacier/plotting.py
1
1106
import matplotlib.pyplot as plt # # plotting # def plot_elevation(ds, ax=None): if ax is None: ax = plt.gca() ds['hs'].plot(ax=ax,label="surface") ds['hb'].plot(ax=ax,label="bottom") # add horizontal line to indicate sea level ax.hlines(0, ds.x[0], ds.x[-1], linestyle='dashed', color='blac...
mit
samzhang111/wikipedia-jargon
all-subjects/make_tf_differences.py
1
2815
from __future__ import print_function import msgpack import sys import os from collections import defaultdict from helpers import text_dict_to_term_dict from WikiExtractor import clean, compact import pandas as pd def remove_wikipedia_markup(text): return compact(clean(text.decode('utf8'))) def print_help_and_exi...
gpl-3.0
wfxiang08/changes
changes/api/jobstep_artifacts.py
3
2193
from __future__ import absolute_import, division, unicode_literals from flask_restful.reqparse import RequestParser from sqlalchemy.exc import IntegrityError from werkzeug.datastructures import FileStorage from changes.api.base import APIView from changes.config import db from changes.constants import Result from cha...
apache-2.0
moto-timo/robotframework
atest/testresources/listeners/ListenImports.py
17
1159
import os class ListenImports(object): ROBOT_LISTENER_API_VERSION = 2 def __init__(self, imports): self.imports = open(imports, 'w') def library_import(self, name, attrs): self._imported("Library", name, attrs) def resource_import(self, name, attrs): self._imported("Resource...
apache-2.0
ofgulban/scikit-image
doc/examples/filters/plot_rank_mean.py
7
1525
""" ============ Mean filters ============ This example compares the following mean filters of the rank filter package: * **local mean**: all pixels belonging to the structuring element to compute average gray level. * **percentile mean**: only use values between percentiles p0 and p1 (here 10% and 90%). * **bila...
bsd-3-clause
vadimtk/chrome4sdp
third_party/markdown/__main__.py
109
5106
# markdown is released under the BSD license # Copyright 2007, 2008 The Python Markdown Project (v. 1.7 and later) # Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) # Copyright 2004 Manfred Stienstra (the original version) # # All rights reserved. # # Redistribution and use in source and binary forms, with or...
bsd-3-clause
fkie-cad/iva
local_repositories/tasks/datetime_utils.py
1
1476
from datetime import datetime, timedelta TIME_FORMAT = '%H:%M:%S' def calculate_task_execution_timeout(task_time): current_datetime = datetime.now() current_time = get_time_from_datetime(current_datetime) return calculate_delta_time(task_time, current_time) def calculate_task_next_execution_datetime(ta...
lgpl-3.0
vialette/binreconfiguration
simple.py
2
6079
# a non-reconfigurable simulation that always goes to overflow from binreconfiguration.simulator.nonreconfigurable import Overflow from binreconfiguration.simulator.repeater import Repeater # the strategy we are going to use (FirstFit consider the bins always in the same # order and select the first with enough room t...
mit
michellab/Sire
corelib/docs/tutorial/water_dimer.py
2
1931
# Import the Sire Molecule library. This library contains # everything needed to represent and manipulate atoms # and molecules from Sire.Mol import * # Import the Sire Input/Output library. This library contains # everything needed to load and save things to and from files from Sire.IO import * # Import the Sire Ma...
gpl-2.0
rustyrobot/bareon-dynamic-allocator
bareon_dynamic_allocator/utils.py
2
2074
# Copyright 2015 Mirantis, 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
manu-silicon/coreclr
src/pal/automation/util.py
154
2814
import sys import getopt import os import subprocess import shutil import logging as log def Initialize(platform): print "Initializing Workspace" global workspace workspace = os.environ['WORKSPACE'] if platform == "windows": # Jenkins puts quotes in the path, which is wrong. Remove quotes. ...
mit
lmazuel/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_network_security_group_py3.py
1
2060
# 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
t3dev/odoo
addons/website_mail_channel/models/mail_channel.py
9
2476
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import hmac from werkzeug import urls from odoo import api, models from odoo.tools.safe_eval import safe_eval from odoo.addons.http_routing.models.ir_http import slug class MailGroup(models.Model): _inherit = 'ma...
gpl-3.0
raymondanthony/youtube-dl
youtube_dl/extractor/pornotube.py
1
1760
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( compat_urllib_parse, unified_strdate, ) class PornotubeIE(InfoExtractor): _VALID_URL = r'https?://(?:\w+\.)?pornotube\.com(/c/(?P<channel>[0-9]+))?(/m/(?P<videoid>[0-9]+))(/(?P<title>.+))$' _TE...
unlicense
bhanu9999/furryb
scripts/build-all.py
1474
10189
#! /usr/bin/env python # Copyright (c) 2009-2013, The Linux Foundation. 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 # ...
gpl-2.0
szepeviktor/courier-pythonfilter-custom
email-correct.py
1
9398
#!/usr/bin/python # file: email-correct.py # -*- coding: utf-8 -*- import os import sys import email import email.charset import email.encoders from email.header import Header from email.utils import getaddresses from email.utils import formataddr from email.utils import parseaddr from email.utils import make_msgid fr...
mit
dario61081/koalixcrm
koalixcrm/crm/factories/factory_product_price.py
2
1799
# -*- coding: utf-8 -*- import factory import datetime from koalixcrm.crm.models import ProductPrice from koalixcrm.crm.factories.factory_product import StandardProductFactory from koalixcrm.crm.factories.factory_unit import StandardUnitFactory from koalixcrm.crm.factories.factory_currency import StandardCurrencyFacto...
bsd-3-clause
gift-surg/GIFT-Grab
src/tests/files/conftest.py
1
2581
from pytest import fixture from pygiftgrab import Codec, ColourSpace def pytest_addoption(parser): parser.addoption('--colour-space', action='store', type=str, required=True, help='Colour space specification (BGRA or I420)') parser.addoption('--filepath', action='store', type=str, require...
bsd-3-clause
julen/django-allauth
allauth/socialaccount/providers/persona/views.py
59
1687
import requests from django.core.exceptions import ImproperlyConfigured from allauth.socialaccount.helpers import complete_social_login from allauth.socialaccount.helpers import render_authentication_error from allauth.socialaccount.models import SocialLogin from allauth.socialaccount import app_settings, providers f...
mit
martynbm/linguist
samples/Python/protocol_buffer_pb2.py
87
1475
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: protocol-buffer.proto from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import descriptor_pb2 # @@protoc_insertion_point(im...
mit
tinloaf/home-assistant
tests/components/test_google_domains.py
25
2054
"""Test the Google Domains component.""" import asyncio from datetime import timedelta import pytest from homeassistant.setup import async_setup_component from homeassistant.components import google_domains from homeassistant.util.dt import utcnow from tests.common import async_fire_time_changed DOMAIN = 'test.exam...
apache-2.0
reposte/android_kernel_xiaomi_msm8992
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
kzys/buildbot
buildbot/test/unit/test_util.py
1
1861
# -*- test-case-name: buildbot.test.test_util -*- from twisted.trial import unittest from buildbot import util class Foo(util.ComparableMixin): compare_attrs = ["a", "b"] def __init__(self, a, b, c): self.a, self.b, self.c = a,b,c class Bar(Foo, util.ComparableMixin): compare_attrs = ["b", "c...
gpl-2.0
Bladefidz/wfuzz
plugins/scripts/svn_extractor.py
11
3435
from urlparse import urlparse, urljoin from framework.plugins.api import DiscoveryPlugin from framework.core.myexception import FuzzException from externals.moduleman.plugin import moduleman_plugin import tempfile import sqlite3 @moduleman_plugin class svn_extractor(DiscoveryPlugin): name = "svn_extractor" d...
gpl-2.0
JazzeYoung/VeryDeepAutoEncoder
pylearn2/utils/tests/test_insert_along_axis.py
49
2327
"""Tests for the InsertAlongAxis op.""" import numpy as np import theano from theano import config from theano import tensor from pylearn2.utils.insert_along_axis import ( insert_columns, insert_rows, InsertAlongAxis ) def test_insert_along_axis(): x = tensor.matrix() y = insert_columns(x, 10, range(0, 1...
bsd-3-clause
arju88nair/projectCulminate
venv/lib/python3.5/site-packages/setuptools/__init__.py
100
5037
"""Extensions to the 'distutils' for large or complex distributions""" import os import functools import distutils.core import distutils.filelist from distutils.util import convert_path from fnmatch import fnmatchcase from setuptools.extern.six.moves import filter, map import setuptools.version from setuptools.exten...
apache-2.0
meteorcloudy/tensorflow
tensorflow/python/framework/common_shapes.py
14
25392
# 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
Jgarcia-IAS/localizacion
openerp/addons/sale_margin/__openerp__.py
261
1592
############################################################################## # # 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 Public L...
agpl-3.0
doismellburning/edx-platform
common/test/acceptance/pages/lms/login_and_register.py
57
12289
"""Login and Registration pages """ from urllib import urlencode from bok_choy.page_object import PageObject, unguarded from bok_choy.promise import Promise, EmptyPromise from . import BASE_URL from .dashboard import DashboardPage class RegisterPage(PageObject): """ Registration page (create a new account) ...
agpl-3.0
brandonium21/snowflake
snowflakeEnv/lib/python2.7/site-packages/_pytest/core.py
3
13873
""" pytest PluginManager, basic initialization and tracing. """ import os import sys import inspect import py # don't import pytest to avoid circular imports assert py.__version__.split(".")[:2] >= ['1', '4'], ("installation problem: " "%s is too old, remove or upgrade 'py'" % (py.__version__)) class TagTracer: ...
bsd-2-clause
lcameron05/PCWG
test-gui/gui/dataset_tab.py
2
49004
import Tkinter as tk import ttk class DatasetTab(ClosableTab): def __init__(self, notebook, fileName, console): ClosableTab.__init__(self, notebook, fileName, console) self.config = configuration.DatasetConfiguration(fileName) self.addFormElements() self.main_tab.validate(False...
mit
bcj/AttrDict
tests/test_common.py
1
29231
# encoding: UTF-8 """ Common tests that apply to multiple Attr-derived classes. """ import copy from collections import namedtuple, Mapping, ItemsView, KeysView, ValuesView from itertools import chain import pickle from sys import version_info from nose.tools import (assert_equals, assert_not_equals, ...
mit
cericoda/rua
rua/apps/agencies/links.py
2
2697
from __future__ import absolute_import from django.utils.translation import ugettext_lazy as _ from navigation.classes import Link from .icons import (icon_agency, icon_agency_add, icon_agency_edit, icon_agency_delete, icon_position, icon_position_add, icon_position_edit, icon_position_delete, icon_departmen...
gpl-3.0
sogelink/ansible
contrib/inventory/foreman.py
29
16408
#!/usr/bin/env python # vim: set fileencoding=utf-8 : # # Copyright (C) 2016 Guido Günther <agx@sigxcpu.org>, # Daniel Lobato Garcia <dlobatog@redhat.com> # # This script is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # t...
gpl-3.0
joachimmetz/python-gflags
gflags/flags_modules_for_testing/module_bar.py
1
4958
#!/usr/bin/env python # Copyright 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: # # * Redistributions of source code must retain the above copyright # notice, this list of c...
bsd-3-clause
cloudbase/maas
src/provisioningserver/testing/fakeapi.py
1
6224
# Copyright 2012, 2013 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Fake Provisioning API. :class:`FakeSynchronousProvisioningAPI` is intended to be useful in a Django environment, or similar, where the Provisioning API is being used via ...
agpl-3.0
sassoftware/catalog-service
catalogService/rest/drivers/openstack/openstackclient.py
1
23160
# # Copyright (c) SAS Institute 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 agreed to in w...
apache-2.0
Chilledheart/chromium
chrome/common/extensions/docs/server2/whats_new_data_source.py
37
3493
# 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 itertools import groupby from operator import itemgetter import posixpath from data_source import DataSource from extensions_paths import JSON_TEMPLATE...
bsd-3-clause
gpotter2/scapy
scapy/tools/automotive/obdscanner.py
2
8342
#! /usr/bin/env python # This file is part of Scapy # See http://www.secdev.org/projects/scapy for more information # Copyright (C) Andreas Korb <andreas.korb@e-mundo.de> # Copyright (C) Friedrich Feigel <friedrich.feigel@e-mundo.de> # Copyright (C) Nils Weiss <nils@we155.de> # This program is published under a GPLv2 ...
gpl-2.0
jnewland/home-assistant
tests/components/monoprice/test_media_player.py
8
17182
"""The tests for Monoprice Media player platform.""" import unittest from unittest import mock import voluptuous as vol from collections import defaultdict from homeassistant.components.media_player.const import ( DOMAIN, SUPPORT_TURN_ON, SUPPORT_TURN_OFF, SUPPORT_VOLUME_MUTE, SUPPORT_VOLUME_SET, SUPPORT_VOLUM...
apache-2.0
madhurrajn/samashthi
lib/django/db/backends/oracle/introspection.py
517
11463
import cx_Oracle from django.db.backends.base.introspection import ( BaseDatabaseIntrospection, FieldInfo, TableInfo, ) from django.utils.encoding import force_text class DatabaseIntrospection(BaseDatabaseIntrospection): # Maps type objects to Django Field types. data_types_reverse = { cx_Oracle....
bsd-3-clause
teamfx/openjfx-10-dev-rt
modules/javafx.web/src/main/native/Source/JavaScriptCore/Scripts/jsmin.py
11
8261
# This code is original from jsmin by Douglas Crockford, it was translated to # Python by Baruch Even. It was rewritten by Dave St.Germain for speed. # # The MIT License (MIT) # # Copyright (c) 2013 Dave St.Germain # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and a...
gpl-2.0
openjck/apod-scraper
scraper.py
1
6524
#!/usr/bin/env python import bleach from bs4 import BeautifulSoup from collections import OrderedDict from dateutil import parser import regex import requests import scraperwiki import urlparse class Page: def __init__(self, path, basename, encoding): self.path = path self.basename = basename ...
gpl-3.0
jh23453/privacyidea
privacyidea/lib/security/pkcs11.py
2
6565
# -*- coding: utf-8 -*- # # 2016-04-15 Cornelius Kölbel <cornelius@privacyidea.org> # PKCS11 Security Module # # This code is free software; you can redistribute it and/or # modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE # License as published by the Free Software Foundation; either # v...
agpl-3.0
kyxw007/MovieRename
kyxw007/FileTool.py
1
1084
# coding=utf-8 import os import Utils, Rename root_dir = "/Volumes/XiaoMi-usb0/下载" tool = Rename.RenameTool() def get_suffix(file_name): index = file_name.rfind('.') return file_name[index:len(file_name)] def folder_rename(root_dir): file_list = os.listdir(root_dir) for file_name in filter(Utils....
apache-2.0
doganaltunbay/odoo
addons/hr_payroll/res_config.py
441
1294
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
lalanpalacios/screamface
resources/tools/new_regex.py
6
1242
# -*- coding: utf-8 -*- #------------------------------------------------------------ # PalcoTV Regex de 9straem # Version 0.1 (17.10.2014) #------------------------------------------------------------ # License: GPL (http://www.gnu.org/licenses/gpl-3.0.html) # Gracias a la librería plugintools de Jesús (www.mimediacen...
gpl-2.0
chamikaramj/incubator-beam
sdks/python/apache_beam/examples/cookbook/bigquery_tornadoes_test.py
9
1683
# # 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
funkshelper/woodcore
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
pombredanne/bokeh
sphinx/source/docs/user_guide/source_examples/plotting_label.py
2
1171
from bokeh.plotting import figure, show, output_file from bokeh.models import ColumnDataSource, Range1d, Label output_file("label.html", title="label.py example") source = ColumnDataSource(data=dict(height=[66, 71, 72, 68, 58, 62], weight=[165, 189, 220, 141, 260, 174], ...
bsd-3-clause
srmnitc/tis-tools
runscripts/make_q4q6_dist/make_q4q6_dist.py
1
13555
import os import sys import subprocess as sub import numpy as np import time import logging import tistools_helpers.tistools_helpers as tistools_helpers #SRM:set up logger for the general error messages logger = logging.getLogger(__name__) handler = logging.FileHandler("analysis.log") formatter = logging.Formatter('%(...
gpl-3.0
Varriount/Colliberation
libs/twisted/internet/test/inlinecb_tests.py
7
3338
# -*- test-case-name: twisted.internet.test.test_inlinecb -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.internet.defer.inlineCallbacks}. These tests are defined in a non-C{test_*} module because they are syntactically invalid on python < 2.5. test_inlinecb will c...
mit
alex/paramiko
paramiko/win_pageant.py
7
4101
# Copyright (C) 2005 John Arbash-Meinel <john@arbash-meinel.com> # Modified up by: Todd Whiteman <ToddW@ActiveState.com> # # This file is part of paramiko. # # Paramiko 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 # Softwa...
lgpl-2.1
EricMuller/mywebmarks-backend
requirements/twisted/Twisted-17.1.0/src/twisted/test/test_lockfile.py
16
15506
# Copyright (c) 2005 Divmod, Inc. # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.python.lockfile}. """ from __future__ import absolute_import, division import errno import os from twisted.trial import unittest from twisted.python import lockfile from twisted.python.r...
mit
adamgreen/mbed
features/FEATURE_LWIP/TESTS/mbedmicro-net/host_tests/tcp_echo.py
48
6221
# Copyright 2015 ARM Limited, All rights reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
cmlasu/smm_gem5
src/arch/x86/isa/insts/simd128/integer/data_reordering/unpack_and_interleave.py
91
5843
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bsd-3-clause
indevgr/django
tests/postgres_tests/test_unaccent.py
328
1884
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.test import modify_settings from . import PostgreSQLTestCase from .models import CharFieldModel, TextFieldModel @modify_settings(INSTALLED_APPS={'append': 'django.contrib.postgres'}) class UnaccentTest(PostgreSQLTestCase): Model = Char...
bsd-3-clause
catapult-project/catapult-csm
telemetry/telemetry/decorators_unittest.py
7
17293
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest import mock from telemetry.core import platform from telemetry import decorators from telemetry.internal.browser import possible_browser ...
bsd-3-clause
nishad/namebench
nb_third_party/jinja2/environment.py
199
43213
# -*- coding: utf-8 -*- """ jinja2.environment ~~~~~~~~~~~~~~~~~~ Provides a class that holds runtime and parsing time options. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import os import sys from jinja2 import nodes from jinja2.defaults import * from ...
apache-2.0
galbiati/video-representations
models/ATWModel.py
1
3142
import tensorflow as tf from tensorflow.python.framework import ops from model import Model class ATWModel(Model): """ ATWModel implements a variant on the E-T-D model from model.Model() Instead of doing next frame prediction, ATW attempts to encode the entire sequence, then reproduce the video from o...
mit
submergerock/avatar-hadoop
src/contrib/hod/hodlib/Common/nodepoolutil.py
182
1113
#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 thi...
apache-2.0
weblabdeusto/weblabdeusto
server/launch/sample_balanced2_concurrent_experiments/main_machine/lab_and_experiment/experiment42/server_config.py
968
1526
#!/usr/bin/env python #-*-*- encoding: utf-8 -*-*- weblab_xilinx_experiment_xilinx_device = 'FPGA' weblab_xilinx_experiment_port_number = 1 # This should be something like this: # import os as _os # xilinx_home = _os.getenv('XILINX_HOME') # if xilinx_home == None: # if _os.name == 'nt': # xilinx_home = r'C:...
bsd-2-clause
jjingrong/PONUS-1.2
venv/build/django/django/forms/forms.py
90
23725
""" Form classes """ from __future__ import absolute_import, unicode_literals import copy import warnings from django.core.exceptions import ValidationError from django.forms.fields import Field, FileField from django.forms.util import flatatt, ErrorDict, ErrorList from django.forms.widgets import Media, media_prope...
mit
praekelt/seed-staged-based-messaging
subscriptions/tests/test_views.py
2
7082
from unittest.mock import patch from django.contrib.auth.models import Permission, User from django.urls import reverse from rest_framework import status from rest_framework.test import APITestCase from contentstore.models import MessageSet, Schedule from seed_stage_based_messaging import test_utils as utils from sub...
bsd-3-clause
toontownfunserver/Panda3D-1.9.0
python/Lib/lib2to3/fixes/fix_imports.py
326
5693
"""Fix incompatible imports and module references.""" # Authors: Collin Winter, Nick Edds # Local imports from .. import fixer_base from ..fixer_util import Name, attr_chain MAPPING = {'StringIO': 'io', 'cStringIO': 'io', 'cPickle': 'pickle', '__builtin__' : 'builtins', 'c...
bsd-3-clause
aabbox/kbengine
kbe/src/lib/python/Lib/tkinter/test/support.py
59
3128
import sys import tkinter import unittest from test.support import requires class AbstractTkTest: @classmethod def setUpClass(cls): cls._old_support_default_root = tkinter._support_default_root destroy_default_root() tkinter.NoDefaultRoot() cls.root = tkinter.Tk() cls.w...
lgpl-3.0
streampref/wcimport
tool/query/endseq.py
1
5096
# -*- coding: utf-8 -*- ''' Queries for experiments with ENDSEQ operator ''' import os from tool.attributes import get_move_attribute_list, get_place_attribute_list from tool.experiment import SLI, RAN, ALGORITHM, \ CQL_ALG, QUERY, Q_MOVE, Q_PLACE from tool.io import get_query_dir, write_to_txt, get_out_file, get...
gpl-3.0
neilpelow/wmap-django
venv/lib/python3.5/site-packages/django/contrib/sessions/backends/db.py
118
3794
import logging from django.contrib.sessions.backends.base import ( CreateError, SessionBase, UpdateError, ) from django.core.exceptions import SuspiciousOperation from django.db import DatabaseError, IntegrityError, router, transaction from django.utils import timezone from django.utils.encoding import force_text ...
gpl-3.0