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 |
|---|---|---|---|---|---|
wgwoods/anaconda | tests/lib/iconcheck.py | 17 | 1490 | #
# iconcheck.py: Gtk icon testing
#
# Copyright (C) 2014 Red Hat, Inc.
#
# This program 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 your option) any lat... | gpl-2.0 |
patrickmn/haveabit | console/app/pygments/filters/__init__.py | 20 | 9503 | # -*- coding: utf-8 -*-
"""
pygments.filters
~~~~~~~~~~~~~~~~
Module containing filter lookup functions and default
filters.
:copyright: 2006-2007 by Armin Ronacher, Georg Brandl.
:license: BSD, see LICENSE for more details.
"""
try:
set
except NameError:
from sets import Set as set
i... | mit |
peterstace/project-euler | OLD_PY_CODE/project_euler_old_old/102/102.py | 1 | 1554 | """
Three distinct points are plotted at random on a Cartesian plane, for which -1000 <= x, y <= 1000, such that a triangle is formed.
Consider the following two triangles:
A(-340,495), B(-153,-910), C(835,-947)
X(-175,41), Y(-421,-714), Z(574,-645)
It can be verified that triangle ABC contains the origin, whereas ... | unlicense |
Zhongqilong/mykbengineer | kbe/res/scripts/common/Lib/test/test_cgi.py | 83 | 17754 | from test.support import run_unittest, check_warnings
import cgi
import os
import sys
import tempfile
import unittest
import warnings
from collections import namedtuple
from io import StringIO, BytesIO
class HackedSysModule:
# The regression test will have real values in sys.argv, which
# will completely confu... | lgpl-3.0 |
CiscoSystems/networking-cisco | networking_cisco/plugins/cisco/l3/schedulers/l3_routertype_aware_agent_scheduler.py | 1 | 4496 | # Copyright 2014 Cisco Systems, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | apache-2.0 |
icdishb/scikit-learn | sklearn/tests/test_naive_bayes.py | 142 | 17496 | import pickle
from io import BytesIO
import numpy as np
import scipy.sparse
from sklearn.datasets import load_digits, load_iris
from sklearn.cross_validation import cross_val_score, train_test_split
from sklearn.externals.six.moves import zip
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.te... | bsd-3-clause |
jcchoiling/learningPython | aws/swf/register.py | 1 | 1618 | #!/usr/bin/env python3
"""
Registers domains, workflows and activities
"""
from botocore.exceptions import ClientError
from aws.swf.creds import init_aws_session, DOMAIN, WORKFLOW
import boto3
def register_domain(session):
try:
response = session.register_domain(
name=DOMAIN,
descri... | gpl-3.0 |
kennedyshead/home-assistant | homeassistant/components/advantage_air/sensor.py | 1 | 4827 | """Sensor platform for Advantage Air integration."""
import voluptuous as vol
from homeassistant.components.sensor import SensorEntity
from homeassistant.const import PERCENTAGE
from homeassistant.helpers import config_validation as cv, entity_platform
from .const import ADVANTAGE_AIR_STATE_OPEN, DOMAIN as ADVANTAGE_... | apache-2.0 |
embeddedarm/android_external_chromium_org | third_party/closure_linter/closure_linter/ecmametadatapass.py | 155 | 18062 | #!/usr/bin/env python
#
# Copyright 2010 The Closure Linter Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#... | bsd-3-clause |
greyside/django-mesh | django_mesh/tests/test_managers.py | 1 | 8604 | # -*- coding: utf-8 -*-
#Copyright (C) 2011 Seán Hayes
#
#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 3 of the License, or
#(at your option) any later version.
#
#This program is ... | gpl-3.0 |
ngageoint/scale | scale/storage/management/commands/scale_delete_files.py | 1 | 4317 | """Defines the command line method for running a delete files task"""
from __future__ import unicode_literals
import json
import logging
import os
import signal
import sys
from collections import namedtuple
from django.core.management.base import BaseCommand
from messaging.manager import CommandMessageManager
from s... | apache-2.0 |
hckiang/DBLite | boost_1_54_0/tools/build/v2/tools/midl.py | 18 | 5657 | # Copyright (c) 2005 Alexey Pakhunov.
# Copyright (c) 2011 Juraj Ivancic
#
# Use, modification and distribution is subject to the Boost Software
# License Version 1.0. (See accompanying file LICENSE_1_0.txt or
# http://www.boost.org/LICENSE_1_0.txt)
# Microsoft Interface Definition Language (MIDL) related routines
fro... | gpl-3.0 |
ironcladlou/origin | vendor/go.mongodb.org/mongo-driver/data/transactions/mongos-pin-auto-tests.py | 12 | 10215 | import itertools
import sys
# Require Python 3.7+ for ordered dictionaries so that the order of the
# generated tests remain the same.
# Usage:
# python3.7 mongos-pin-auto-tests.py > mongos-pin-auto.yml
if sys.version_info[:2] < (3, 7):
print('ERROR: This script requires Python >= 3.7, not:')
print(sys.version... | apache-2.0 |
parrainc/jobs-portal-iso700 | jobs_portal/settings.py | 1 | 3615 | """
Django settings for jobs_portal project.
Generated by 'django-admin startproject' using Django 1.11.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import ... | unlicense |
TheWardoctor/Wardoctors-repo | script.module.exodus/lib/resources/lib/sources/en/xwatchseries.py | 11 | 5237 | # -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 Exodus
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 3 of the License, or
(at your option) any l... | apache-2.0 |
brachiel/rotcbot | jabberbot.py | 1 | 22562 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# JabberBot: A simple jabber/xmpp bot framework
# Copyright (c) 2007-2011 Thomas Perl <thp.io/about>
#
# 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; ... | gpl-3.0 |
night-ghost/ardupilot | Tools/scripts/generate_manifest.py | 14 | 12720 | #!/usr/bin/python
from __future__ import print_function
import sys
import json
import os
import re
class Firmware():
def __init__(self, date=None, platform=None, vehicletype=None, filepath=None, git_sha=None, frame=None):
self.atts = dict()
self.atts["date"] = date
self.atts["platform"] =... | gpl-3.0 |
r0e/servo | tests/wpt/web-platform-tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/resource.py | 113 | 6305 | 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 |
wackywendell/numpy | numpy/tests/test_ctypeslib.py | 54 | 4452 | from __future__ import division, absolute_import, print_function
import sys
import numpy as np
from numpy.ctypeslib import ndpointer, load_library
from numpy.distutils.misc_util import get_shared_lib_extension
from numpy.testing import TestCase, run_module_suite, dec
try:
cdll = None
if hasattr(sys, 'gettota... | bsd-3-clause |
blueyed/pip | pip/_vendor/requests/packages/charade/sbcsgroupprober.py | 2936 | 3291 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | mit |
wang1352083/pythontool | python-2.7.12-lib/idlelib/CallTipWindow.py | 3 | 6034 | """A CallTip window class for Tkinter/IDLE.
After ToolTip.py, which uses ideas gleaned from PySol
Used by the CallTips IDLE extension.
"""
from Tkinter import Toplevel, Label, LEFT, SOLID, TclError
HIDE_VIRTUAL_EVENT_NAME = "<<calltipwindow-hide>>"
HIDE_SEQUENCES = ("<Key-Escape>", "<FocusOut>")
CHECKHIDE_VIRTUAL_EVE... | mit |
pepetreshere/odoo | addons/survey/tests/test_survey_randomize.py | 6 | 2522 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests.common import TransactionCase
class TestSurveyRandomize(TransactionCase):
def test_01_generate_randomized_questions(self):
""" Use random generate for a survey and verify that questions with... | agpl-3.0 |
DivineHime/seishirou | lib/nacl/bindings/crypto_box.py | 17 | 5603 | # Copyright 2013 Donald Stufft and individual contributors
#
# 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... | gpl-3.0 |
bx5974/desktop-mirror | lib/streamreceiver.py | 2 | 1854 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import BaseHTTPServer
import simplejson
from threading import Thread
from common import DEFAULT_PORT
class HttpHandler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
logging.debug('{}'.format(self.path... | apache-2.0 |
simmetria/sentry | tests/sentry/web/frontend/teams/tests.py | 1 | 7297 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import mock
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from sentry.constants import MEMBER_OWNER, MEMBER_USER
from sentry.models import Team
from sentry.testutils import fixture
from sentry.testutils import ... | bsd-3-clause |
loco-odoo/localizacion_co | openerp/addons/account/__init__.py | 418 | 1423 | # -*- 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 |
tmalsburg/EyeScript | EyeScript/interest_area.py | 1 | 2120 | # -*- coding: utf-8 -*-
class InterestArea:
"""
Represents a region of the screen, for eye data reporting purposes.
The EyeLink Data Viewer can associate fixations with regions on the screen, for instance the regions around each word in a sentence.
An InterestArea object stores the information for ... | gpl-2.0 |
hugoloza/googlepersonfinder | tests/test_utils.py | 7 | 11009 | #!/usr/bin/python2.7
# encoding: utf-8
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | apache-2.0 |
sznekol/django-cms | cms/utils/helpers.py | 36 | 5826 | # -*- coding: utf-8 -*-
import re
from django.contrib.sites.models import SITE_CACHE, Site
from .compat.dj import is_installed
SITE_VAR = "site__exact"
# modify reversions to match our needs if required...
def reversion_register(model_class, fields=None, follow=(), format="json", exclude_fields=None):
"""CMS in... | bsd-3-clause |
Alwnikrotikz/pysal | pysal/spatial_dynamics/rank.py | 5 | 14679 | """
Rank and spatial rank mobility measures
"""
__author__ = "Sergio J. Rey <srey@asu.edu> "
#from pysal.common import *
from scipy.stats.mstats import rankdata
from scipy.special import erfc
import pysal
import numpy as np
import scipy as sp
from numpy.random import permutation as NRP
__all__ = ['SpatialTau', 'Tau',... | bsd-3-clause |
yongtang/tensorflow | tensorflow/lite/experimental/mlir/testing/op_tests/broadcast_gradient_args.py | 6 | 2681 | # Copyright 2021 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 |
ewbankkit/cloud-custodian | tests/test_registry.py | 4 | 1992 | # Copyright 2018 Capital One Services, LLC
#
# 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... | apache-2.0 |
sunlianqiang/kbengine | kbe/src/lib/python/Lib/ctypes/test/test_macholib.py | 100 | 1830 | import os
import sys
import unittest
# Bob Ippolito:
#
# Ok.. the code to find the filename for __getattr__ should look
# something like:
#
# import os
# from macholib.dyld import dyld_find
#
# def find_lib(name):
# possible = ['lib'+name+'.dylib', name+'.dylib',
# name+'.framework/'+name]
# for dylib i... | lgpl-3.0 |
openstack/zaqar | zaqar/storage/redis/subscriptions.py | 1 | 11355 | # Copyright (c) 2015 Catalyst IT Ltd.
#
# 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 ... | apache-2.0 |
sivel/ansible-modules-core | system/cron.py | 25 | 25598 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2012, Dane Summers <dsummers@pinedesk.biz>
# (c) 2013, Mike Grozak <mike.grozak@gmail.com>
# (c) 2013, Patrick Callahan <pmc@patrickcallahan.com>
# (c) 2015, Evan Kaufman <evan@digitalflophouse.com>
# (c) 2015, Luca Berruti <nadirio@gmail.com>
#
# This file is part of ... | gpl-3.0 |
acgx/ooi-hack | oh_discussion/models.py | 1 | 4592 | from django.core.urlresolvers import reverse_lazy
from django.conf import settings
from django.db import models
from django.db.models.signals import post_save, post_delete
from django.dispatch import receiver
from django.utils import timezone
from mptt.models import MPTTModel, TreeForeignKey
class ONode(MPTTModel):
... | gpl-2.0 |
jcsp/manila | manila/tests/scheduler/test_host_manager.py | 1 | 31419 | # Copyright (c) 2011 OpenStack, LLC
# Copyright (c) 2015 Rushil Chugh
# Copyright (c) 2015 Clinton Knight
# 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
#
# ... | apache-2.0 |
chinmaygarde/mojo | sky/tools/webkitpy/layout_tests/port/port_testcase.py | 11 | 21819 | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
Perferom/android_external_chromium_org | tools/json_schema_compiler/cpp_type_generator_test.py | 71 | 7614 | #!/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.
from cpp_type_generator import CppTypeGenerator
from json_schema import CachedLoad
import model
import unittest
from collections i... | bsd-3-clause |
esc/pip | pip/req/req_file.py | 27 | 11764 | """
Requirements file parsing
"""
from __future__ import absolute_import
import os
import re
import shlex
import optparse
import warnings
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.six.moves import filterfalse
import pip
from pip.download import get_file_content
from pip.req.req... | mit |
perezg/infoxchange | BASE/lib/python2.7/site-packages/pip/commands/__init__.py | 476 | 2236 | """
Package containing all pip commands
"""
from pip.commands.bundle import BundleCommand
from pip.commands.completion import CompletionCommand
from pip.commands.freeze import FreezeCommand
from pip.commands.help import HelpCommand
from pip.commands.list import ListCommand
from pip.commands.search import SearchComman... | apache-2.0 |
vvv1559/intellij-community | python/helpers/profiler/run_profiler.py | 14 | 4957 | import os
import sys
import time
import traceback
from socket import AF_INET
from socket import SOCK_STREAM
from socket import socket
from _prof_imports import ProfilerResponse
from prof_io import ProfWriter, ProfReader
from prof_util import generate_snapshot_filepath, stats_to_response, get_snapshot_basepath, save_ma... | apache-2.0 |
Jai-Chaudhary/termite-data-server | server_src/modules/readers/GensimReader.py | 5 | 3213 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from gensim import corpora, models
from LDAReader import LDAReader
class GensimReader(LDAReader):
"""
lda_db = a SQLite3 database
modelPath = a model folder containing files dictionary.gensim, corpus.gensim, and lda.gensim
"""
DICTIONARY_FILENAME = 'dictionary.gens... | bsd-3-clause |
DemocracyClub/yournextrepresentative | ynr/apps/moderation_queue/management/commands/moderation_queue_detect_faces_in_queued_images.py | 1 | 2409 | import json
import boto3
from django.core.management.base import BaseCommand, CommandError
from moderation_queue.models import QueuedImage
# These magic values are because the AWS API crops faces quite tightly by
# default, meaning we literally just get the face. These values are about
# right or, they are more righ... | agpl-3.0 |
stevemontana1980/coala | tests/output/ConfWriterTest.py | 26 | 2819 | import os
import tempfile
import unittest
from coalib.output.ConfWriter import ConfWriter
from coalib.parsing.ConfParser import ConfParser
class ConfWriterTest(unittest.TestCase):
example_file = ("to be ignored \n"
" save=true\n"
" a_default, another = val \n"
... | agpl-3.0 |
proxysh/Safejumper-for-Mac | buildmac/Resources/env/lib/python2.7/site-packages/twisted/words/test/test_jabberxmppstringprep.py | 13 | 5549 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.trial import unittest
from twisted.words.protocols.jabber.xmpp_stringprep import (
nodeprep, resourceprep, nameprep)
class DeprecationTests(unittest.TestCase):
"""
Deprecations in L{twisted.words.protocols.jabber.xmpp_... | gpl-2.0 |
TaburisSAMA/shadowsocks | utils/autoban.py | 1033 | 2156 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 clowwindy
#
# 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 u... | apache-2.0 |
ddurst/zamboni | mkt/webpay/tasks.py | 4 | 3520 | import logging
import os
import tempfile
from datetime import datetime, timedelta
from django.conf import settings
from django.db import transaction
import requests
from post_request_task.task import task
from mkt.site.utils import ImageCheck, resize_image
from mkt.site.storage_utils import (copy_stored_file, public... | bsd-3-clause |
passiweinberger/NuMozart | data/midi/RawOutstreamFile.py | 18 | 1710 | # -*- coding: ISO-8859-1 -*-
# standard library imports
import sys
from types import StringType
from struct import unpack
from cStringIO import StringIO
# custom import
from DataTypeConverters import writeBew, writeVar, fromBytes
class RawOutstreamFile:
"""
Writes a midi file to disk... | gpl-2.0 |
aclisp/kubernetes | vendor/github.com/ugorji/go/codec/test.py | 1138 | 3876 | #!/usr/bin/env python
# This will create golden files in a directory passed to it.
# A Test calls this internally to create the golden files
# So it can process them (so we don't have to checkin the files).
# Ensure msgpack-python and cbor are installed first, using:
# sudo apt-get install python-dev
# sudo apt-g... | apache-2.0 |
nathania/networkx | networkx/algorithms/centrality/current_flow_betweenness_subset.py | 97 | 9545 | """
Current-flow betweenness centrality measures for subsets of nodes.
"""
# Copyright (C) 2010-2011 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
__author__ = """Aric Hagberg (hagberg@lanl.gov)"""
__all_... | bsd-3-clause |
ArcherSys/ArcherSys | archersys/Lib/site-packages/pip/_vendor/requests/models.py | 161 | 28111 | # -*- coding: utf-8 -*-
"""
requests.models
~~~~~~~~~~~~~~~
This module contains the primary objects that power Requests.
"""
import collections
import datetime
from io import BytesIO, UnsupportedOperation
from .hooks import default_hooks
from .structures import CaseInsensitiveDict
from .auth import HTTPBasicAuth
... | mit |
kenshay/ImageScript | Script_Runner/PYTHON/Lib/site-packages/chardet/euckrprober.py | 290 | 1748 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | gpl-3.0 |
dhanunjaya/neutron | neutron/agent/linux/polling.py | 30 | 2108 | # Copyright 2013 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 agre... | apache-2.0 |
ROMFactory/android_external_chromium_org | build/android/pylib/forwarder.py | 23 | 12519 | # 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 |
sysalexis/kbengine | kbe/res/scripts/common/Lib/test/test_selectors.py | 60 | 13865 | import errno
import os
import random
import selectors
import signal
import socket
from test import support
from time import sleep
import unittest
import unittest.mock
try:
from time import monotonic as time
except ImportError:
from time import time as time
try:
import resource
except ImportError:
resour... | lgpl-3.0 |
yinsu/grpc | src/python/grpcio/grpc/early_adopter/implementations.py | 22 | 10462 | # Copyright 2015, 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 |
hynnet/openwrt-mt7620 | staging_dir/host/lib/python2.7/distutils/command/install_scripts.py | 241 | 2068 | """distutils.command.install_scripts
Implements the Distutils 'install_scripts' command, for installing
Python scripts."""
# contributed by Bastian Kleineidam
__revision__ = "$Id$"
import os
from distutils.core import Command
from distutils import log
from stat import ST_MODE
class install_scripts (Command):
... | gpl-2.0 |
Omegaphora/external_chromium_org | third_party/cython/src/Cython/Compiler/ParseTreeTransforms.py | 86 | 115877 | import cython
cython.declare(PyrexTypes=object, Naming=object, ExprNodes=object, Nodes=object,
Options=object, UtilNodes=object, LetNode=object,
LetRefNode=object, TreeFragment=object, EncodedString=object,
error=object, warning=object, copy=object)
import PyrexTypes
import... | bsd-3-clause |
Lilykos/invenio | invenio/modules/formatter/format_elements/bfe_dataset_appears.py | 13 | 1609 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2013 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 |
Abdoctor/behave | behave/formatter/_builtins.py | 1 | 1799 | # -*- coding: utf-8 -*-
"""
Knowledge base of all built-on formatters.
"""
from __future__ import absolute_import
from behave.formatter import _registry
# -----------------------------------------------------------------------------
# DATA:
# -------------------------------------------------------------------------... | bsd-2-clause |
agustinhenze/natsort.debian | test_natsort/stress_natsort.py | 1 | 1942 | # -*- coding: utf-8 -*-
"""\
This file contains functions to stress-test natsort, looking
for cases that raise an unknown exception.
"""
from random import randint, sample, choice
from string import printable
from copy import copy
from pytest import fail
from natsort import natsorted
from natsort.compat.py23 import py2... | mit |
dropbox/bazel | third_party/protobuf/3.6.0/python/compatibility_tests/v2.5.0/tests/google/protobuf/internal/descriptor_test.py | 261 | 24195 | #! /usr/bin/python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# ... | apache-2.0 |
jaej-dev/Kernel_Unico | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
ManjiriBirajdar/coala | tests/coalaCITest.py | 6 | 3184 | import os
import re
import sys
import unittest
from coalib import coala_ci
from coalib.misc.ContextManagers import prepare_file
from tests.TestUtilities import bear_test_module, execute_coala
class coalaCITest(unittest.TestCase):
def setUp(self):
self.old_argv = sys.argv
self.unescaped_coafile =... | agpl-3.0 |
prune998/ansible | lib/ansible/modules/web_infrastructure/apache2_mod_proxy.py | 22 | 17605 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Olivier Boukili <boukili.olivier@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... | gpl-3.0 |
tersmitten/ansible | lib/ansible/modules/clustering/k8s/k8s_facts.py | 5 | 4807 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2018, Will Thames <@willthames>
# 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 |
jolyonb/edx-platform | lms/djangoapps/course_goals/models.py | 1 | 1260 | """
Course Goals Models
"""
from __future__ import absolute_import
from django.contrib.auth.models import User
from django.db import models
from django.utils.translation import ugettext_lazy as _
from model_utils import Choices
from opaque_keys.edx.django.models import CourseKeyField
# Each goal is represented by a g... | agpl-3.0 |
bspavel/ccvpn | alembic/versions/33f748cdc2f_add_gateways_table.py | 2 | 1179 | """add gateways table
Revision ID: 33f748cdc2f
Revises: 956b1aac1
Create Date: 2014-03-22 23:28:27.605724
"""
# revision identifiers, used by Alembic.
revision = '33f748cdc2f'
down_revision = '956b1aac1'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - ple... | mit |
bmaluenda/switch | switch_mod/hawaii/psip.py | 2 | 12666 | import os
from pyomo.environ import *
def define_arguments(argparser):
argparser.add_argument('--psip-force', action='store_true', default=True,
help="Force following of PSIP plans (retiring AES and building certain technologies).")
argparser.add_argument('--psip-relax', dest='psip_force', action='sto... | apache-2.0 |
ets-labs/python-domain-models | tests/test_context_view.py | 3 | 8894 | """ContextViews tests."""
import datetime
import unittest2 as unittest
from domain_models import models
from domain_models import fields
from domain_models import views
class Photo(models.DomainModel):
"""Photo model to be attached to profile."""
id = fields.Int()
title = fields.String()
path = fie... | bsd-3-clause |
ybellavance/python-for-android | python3-alpha/python3-src/Lib/lib2to3/fixes/fix_sys_exc.py | 203 | 1034 | """Fixer for sys.exc_{type, value, traceback}
sys.exc_type -> sys.exc_info()[0]
sys.exc_value -> sys.exc_info()[1]
sys.exc_traceback -> sys.exc_info()[2]
"""
# By Jeff Balogh and Benjamin Peterson
# Local imports
from .. import fixer_base
from ..fixer_util import Attr, Call, Name, Number, Subscript, Node, syms
clas... | apache-2.0 |
radicalbit/ambari | ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py | 1 | 149649 | '''
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 this ... | apache-2.0 |
Kapim/artable | art_brain/src/art_brain/art_brain_robot_interface.py | 6 | 14367 | from art_gripper import ArtGripper
from brain_utils import ArtBrainErrors, ArtBrainErrorSeverities
import abc
import rospy
from art_msgs.msg import PickPlaceGoal
from std_srvs.srv import TriggerResponse, Trigger
from art_msgs.srv import ReinitArms, ReinitArmsResponse, ReinitArmsRequest
from actionlib.simple_action_clie... | lgpl-2.1 |
TriumphLLC/FashionProject | modules/draw/points/__init__.py | 2 | 2363 | '''
Утилиты для работы со всеми типами точек.
'''
import bpy
from math import atan
def is_one_of_points(obj):
return obj.fp_type.startswith('fp.draw.points.')
def get_all_points():
return tuple(
obj for obj in bpy.data.objects
if is_one_of_points(obj)
)
def get_root_point(obj):
if obj.parent:
r... | gpl-3.0 |
AccelAI/accel.ai | flask-aws/lib/python2.7/site-packages/boto/beanstalk/response.py | 32 | 28020 | """Classify responses from layer1 and strict type values."""
from datetime import datetime
class BaseObject(object):
def __repr__(self):
result = self.__class__.__name__ + '{ '
counter = 0
for key, value in self.__dict__.iteritems():
# first iteration no comma
coun... | mit |
linuxm0nk3ys/conkyPress | py/mod_comments.py | 1 | 1689 | #! /usr/bin/env python2.7
from bs4 import BeautifulSoup
def printStats(gl, soup, adminPageEx):
if adminPageEx == 'true':
print('${font Arial:bold:size=10}'+ gl.topicCol +'COMMENTS '+gl.topicLineCol+'${hr 2}')
print('${color red}Error getting comment stats')
print(gl.secOffset)
else:
#Private variables
pend... | gpl-3.0 |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.7/Lib/unittest/test/test_loader.py | 2 | 49203 | import sys
import types
import unittest
class Test_TestLoader(unittest.TestCase):
### Tests for TestLoader.loadTestsFromTestCase
################################################################
# "Return a suite of all tests cases contained in the TestCase-derived
# class testCaseClass"
def te... | mit |
kawamon/hue | desktop/core/ext-py/Pygments-1.3.1/scripts/vim2pygments.py | 44 | 26281 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Vim Colorscheme Converter
~~~~~~~~~~~~~~~~~~~~~~~~~
This script converts vim colorscheme files to valid pygments
style classes meant for putting into modules.
:copyright 2006 by Armin Ronacher.
:license: BSD, see LICENSE for details.
"""
impor... | apache-2.0 |
kannon92/psi4 | psi4/driver/qcdb/textables.py | 1 | 18801 | #
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2016 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of ... | gpl-2.0 |
mchristopher/PokemonGo-DesktopMap | app/pylibs/win32/Cryptodome/SelfTest/Cipher/test_pkcs1_oaep.py | 2 | 17584 | # -*- coding: utf-8 -*-
#
# SelfTest/Cipher/test_pkcs1_oaep.py: Self-test for PKCS#1 OAEP encryption
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# e... | mit |
BondAnthony/ansible | test/lib/ansible_test/_internal/coverage/xml.py | 38 | 5490 | """Generate XML code coverage reports."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import time
from xml.etree.ElementTree import (
Comment,
Element,
SubElement,
tostring,
)
from xml.dom import (
minidom,
)
from ..io import (
make_dirs,... | gpl-3.0 |
christianurich/VIBe2UrbanSim | 3rdparty/opus/src/opus_upgrade/changes_2006_11_16_interaction_set_changes/do_interaction_set_changes.py | 2 | 4867 | # Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
import os
import re
import sys
from optparse import OptionParser
from classes.db_sub_pattern import DBSubPattern
from opus_core.database_management.database_server import DatabaseServer
f... | gpl-2.0 |
KyleAMoore/KanjiNani | Android/.buildozer/android/platform/build/dists/KanjiNani/crystax_python/crystax_python/site-packages/kivy/core/clipboard/clipboard_pygame.py | 12 | 1423 | '''
Clipboard Pygame: an implementation of the Clipboard using pygame.scrap.
'''
__all__ = ('ClipboardPygame', )
from kivy.utils import platform
from kivy.core.clipboard import ClipboardBase
if platform not in ('win', 'linux', 'macosx'):
raise SystemError('unsupported platform for pygame clipboard')
try:
im... | gpl-3.0 |
Cloudzero/cloudzero-reactor-aws | reactor/utils/decorators.py | 1 | 5537 | # -*- coding: utf-8 -*-
# Copyright (c) 2016-present, CloudZero, Inc. All rights reserved.
# Licensed under the BSD-style license. See LICENSE file in the project root for full license information.
import multiprocessing
import signal
import sys
import time
from functools import wraps
###############################... | bsd-3-clause |
jelugbo/hebs_repo | lms/djangoapps/instructor/offline_gradecalc.py | 29 | 3278 | """
======== Offline calculation of grades =============================================================
Computing grades of a large number of students can take a long time. These routines allow grades to
be computed offline, by a batch process (eg cronjob).
The grades are stored in the OfflineComputedGrade table of... | agpl-3.0 |
andrei-karalionak/ggrc-core | src/ggrc/rbac/user_permissions.py | 7 | 5789 | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
class UserPermissions(object):
"""Interface required for extensions providing user rights information for
role-based access control.
"""
def is_allowed_create(self, resource_type, resource_id, contex... | apache-2.0 |
pixelgremlins/ztruck | dj/lib/python2.7/site-packages/django/middleware/security.py | 510 | 1753 | import re
from django.conf import settings
from django.http import HttpResponsePermanentRedirect
class SecurityMiddleware(object):
def __init__(self):
self.sts_seconds = settings.SECURE_HSTS_SECONDS
self.sts_include_subdomains = settings.SECURE_HSTS_INCLUDE_SUBDOMAINS
self.content_type_no... | apache-2.0 |
mamewotoko/stacklr | oauth2/oauth2client/calendar_test.py | 1 | 1868 | from oauth2client.client import flow_from_clientsecrets, credentials_from_clientsecrets_and_code
from apiclient.discovery import build
import json, httplib2, sys
from oauth2client.file import Storage
import setting, os
target_calendar_name = "debug"
credentials = None
storage = Storage(setting.STORAGE_FILE)
if os.pa... | apache-2.0 |
coberger/DIRAC | WorkloadManagementSystem/Agent/StatesAccountingAgent.py | 9 | 4392 | ########################################################################
# $HeadURL$
# File : StatesAccountingAgent.py
# Author : A.T.
########################################################################
""" StatesAccountingAgent sends periodically numbers of jobs in various states for various
sites to t... | gpl-3.0 |
MD2Korg/CerebralCortex | jupyter_demo/demo_algorithm/gps_clustering.py | 1 | 4106 | # Copyright (c) 2019, MD2K Center of Excellence
# - Nasir Ali <nasir.ali08@gmail.com>
# 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 cop... | bsd-2-clause |
bobisme/odoo | addons/project_issue/report/project_issue_report.py | 303 | 4652 |
# -*- 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 GN... | agpl-3.0 |
CopeX/odoo | openerp/report/render/rml2txt/__init__.py | 381 | 1351 | # -*- 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 |
ahu-odoo/odoo | addons/crm_project_issue/project_issue.py | 380 | 2373 |
from openerp.osv import osv, fields
class crm_lead_to_project_issue_wizard(osv.TransientModel):
""" wizard to convert a Lead into a Project Issue and move the Mail Thread """
_name = "crm.lead2projectissue.wizard"
_inherit = 'crm.partner.binding'
_columns = {
"lead_id": fields.many2one("crm.... | agpl-3.0 |
maxwward/SCOPEBak | askbot/migrations/0043_add_temporal_extra_column_for_datamigration.py | 2 | 26952 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
try:
db.add_column(u'auth_user', 'avatar_type', self.gf('django.db.models.fields.CharField')(max_length=1, defa... | gpl-3.0 |
ChinaQuants/zipline | zipline/finance/blotter.py | 29 | 14087 | #
# Copyright 2014 Quantopian, 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 wr... | apache-2.0 |
Wang-Sen/nqzx-backend | bootcamp/auth/views.py | 1 | 1142 | from django.shortcuts import render, redirect
from django.contrib.auth import authenticate, login
from bootcamp.auth.forms import SignUpForm
from django.contrib.auth.models import User
from bootcamp.feeds.models import Feed
from django.utils.translation import ugettext_lazy as _
def signup(request):
if request.met... | gpl-3.0 |
cheld/kubernetes | examples/cluster-dns/images/frontend/client.py | 504 | 1207 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes Authors.
#
# 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 |
hackday-profilers/flocker | flocker/node/agents/test/blockdevicefactory.py | 4 | 10344 | # Copyright ClusterHQ Inc. See LICENSE file for details.
"""
Functionality for creating ``IBlockDeviceAPI`` providers suitable for use in
the current execution environment.
This depends on a ``FLOCKER_FUNCTIONAL_TEST_CLOUD_CONFIG_FILE`` environment
variable being set.
See `acceptance testing <acceptance-testing>`_ ... | apache-2.0 |
taoyunxing/trafficserver | tests/gold_tests/h2/h2bigclient.py | 10 | 2854 | '''
'''
# 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");... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.