repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
marcelomiky/PythonCodes
Intro ML Semcomp/semcomp17_ml/venv/lib/python3.5/site-packages/pip/_vendor/requests/compat.py
327
1687
# -*- coding: utf-8 -*- """ requests.compat ~~~~~~~~~~~~~~~ This module handles import compatibility issues between Python 2 and Python 3. """ from .packages import chardet import sys # ------- # Pythons # ------- # Syntax sugar. _ver = sys.version_info #: Python 2.x? is_py2 = (_ver[0] == 2) #: Python 3.x? is_p...
mit
indera/titanium_mobile
support/module/iphone/templates/build.py
33
8783
#!/usr/bin/env python # # Appcelerator Titanium Module Packager # # import os, subprocess, sys, glob, string, optparse, subprocess import zipfile from datetime import date cwd = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename)) os.chdir(cwd) required_module_keys = ['name','version','moduleid','desc...
apache-2.0
sernst/cauldron
cauldron/test/cli/interaction/test_interaction_query.py
1
1337
from unittest import mock from cauldron.cli.interaction import query from cauldron.test.support import scaffolds class TestRenderTexts(scaffolds.ResultsTest): """...""" def test_choice(self): """ :return: """ with mock.patch('builtins.input', return_value=''): i...
mit
huiyiqun/check_mk
tests/pylint/test_pylint_web.py
1
2549
#!/usr/bin/python # encoding: utf-8 import os import sys import glob import tempfile from testlib import cmk_path, cmc_path, cme_path import testlib.pylint_cmk as pylint_cmk def get_web_plugin_dirs(): plugin_dirs = sorted(list(set(os.listdir(cmk_path() + "/web/plugins") + os.listd...
gpl-2.0
michaelpacer/pyhawkes
pyhawkes/models.py
2
65600
""" Top level classes for the Hawkes process model. """ import abc import copy import numpy as np from scipy.special import gammaln from scipy.optimize import minimize from pybasicbayes.models import ModelGibbsSampling, ModelMeanField from pybasicbayes.util.text import progprint_xrange from pyhawkes.internals.bias i...
mit
paypal/support
support/connection_mgr.py
1
24065
''' This module provides the capability to from an abstract Paypal name, such as "paymentserv", or "occ-conf" to an open connection. The main entry point is the ConnectionManager.get_connection(). This function will promptly either: 1. Raise an Exception which is a subclass of socket.error 2. Return a socket Connect...
bsd-3-clause
neharejanjeva/techstitution
venv/lib/python2.7/site-packages/setuptools/dist.py
16
37459
__all__ = ['Distribution'] import re import os import warnings import numbers import distutils.log import distutils.core import distutils.cmd import distutils.dist from distutils.errors import (DistutilsOptionError, DistutilsPlatformError, DistutilsSetupError) from distutils.util import rfc822_escape from setupto...
cc0-1.0
steveb/heat
heat/engine/resources/openstack/nova/flavor.py
2
6488
# # 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
Milt0n/CRISPR-Exposed
pipelines/multi-fasta-crt.py
2
2021
import os import re from utils.fastas import * crt = "../configuration/tools/CRT1.2-CLI.jar" data = "../data/" error_file = open("crt_error.txt", 'w') fasta_re = re.compile('.*\_genomic.fna$') dir_list = os.listdir(data) # tracking progress number_of_folders = len([name for name in os.listdir(data)]) count = 1 ## l...
lgpl-3.0
nirenzang/Serpent-Pyethereum-Tutorial
pyethereum/ethereum/todo_tests/test_solidity.py
1
8489
# -*- coding: utf-8 -*- from os import path import pytest from ethereum.utils import encode_hex from ethereum import tester from ethereum import utils from ethereum import _solidity from ethereum._solidity import get_solidity SOLIDITY_AVAILABLE = get_solidity() is not None CONTRACTS_DIR = path.join(path.dirname(__f...
gpl-3.0
proevo/pythondotorg
users/tests/test_templatetags.py
4
1826
from pydotorg.tests.test_classes import TemplateTestCase from ..factories import UserFactory class UsersTagsTest(TemplateTestCase): def test_parse_location(self): user = UserFactory() template = "{% load users_tags %}{{ user|user_location }}" rendered = self.render_string(template, {'use...
apache-2.0
Wuguanping/Server_Manage_Plugin
Openstack_Plugin/ironic-plugin-pike/ironic/common/profiler.py
4
2455
# 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
Jimmy-Morzaria/scikit-learn
sklearn/manifold/tests/test_spectral_embedding.py
216
8091
from nose.tools import assert_true from nose.tools import assert_equal from scipy.sparse import csr_matrix from scipy.sparse import csc_matrix import numpy as np from numpy.testing import assert_array_almost_equal, assert_array_equal from nose.tools import assert_raises from nose.plugins.skip import SkipTest from sk...
bsd-3-clause
oz123/bottle
test/test_importhook.py
11
1284
# -*- coding: utf-8 -*- import unittest import sys, os import imp class TestImportHooks(unittest.TestCase): def make_module(self, name, **args): mod = sys.modules.setdefault(name, imp.new_module(name)) mod.__file__ = '<virtual %s>' % name mod.__dict__.update(**args) return mod ...
mit
vlaufer/sc2reader
sc2reader/data/__init__.py
2
14436
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals, division import json import pkgutil try: from collections import OrderedDict except ImportError as e: from ordereddict import OrderedDict from sc2reader.log_utils import loggable ABIL_LOOKUP = dict() for entry ...
mit
kaedroho/django
tests/forms_tests/tests/tests.py
54
15816
import datetime from django.core.files.uploadedfile import SimpleUploadedFile from django.db import models from django.forms import CharField, FileField, Form, ModelForm from django.forms.models import ModelFormMetaclass from django.test import SimpleTestCase, TestCase from ..models import ( BoundaryModel, Choice...
bsd-3-clause
farr/emcee
emcee/moves/mh.py
1
2442
# -*- coding: utf-8 -*- from __future__ import division, print_function import numpy as np from .move import Move from ..state import State __all__ = ["MHMove"] class MHMove(Move): r"""A general Metropolis-Hastings proposal Concrete implementations can be made by providing a ``proposal_function`` arg...
mit
ruslanloman/nova
nova/tests/unit/scheduler/test_filters.py
31
8517
# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
apache-2.0
JosmanPS/django-wiki
wiki/plugins/notifications/views.py
13
2193
from __future__ import unicode_literals from __future__ import absolute_import from django.contrib import messages from django.contrib.auth.decorators import login_required from django.shortcuts import redirect from django.utils.decorators import method_decorator from django.utils.translation import ugettext as _ from ...
gpl-3.0
mgedmin/ansible
lib/ansible/modules/source_control/hg.py
25
10473
#!/usr/bin/python #-*- coding: utf-8 -*- # (c) 2013, Yeukhon Wong <yeukhon@acm.org> # (c) 2014, Nate Coraor <nate@bx.psu.edu> # # This module was originally inspired by Brad Olson's ansible-module-mercurial # <https://github.com/bradobro/ansible-module-mercurial>. This module tends # to follow the git module implement...
gpl-3.0
povils/git-wipe
git_wipe/cli.py
1
2773
import click import crayons import blindspin import sys import os from git_wipe.__version__ import __version__ from git_wipe.env import GIT_WIPE_TOKEN from git_wipe.github_client import GithubClient from github.GithubException import BadCredentialsException @click.group(invoke_without_command=True) @click.option('-...
mit
tensor-tang/Paddle
python/paddle/dataset/tests/cifar_test.py
6
1898
# Copyright (c) 2016 PaddlePaddle 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 applic...
apache-2.0
kchodorow/tensorflow
tensorflow/python/training/server_lib_test.py
7
16137
# Copyright 2017 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
moniqx4/bite-project
deps/gdata-python-client/tests/run_service_tests.py
38
4259
#!/usr/bin/python import sys import unittest import module_test_runner import getopt import getpass # Modules whose tests we will run. import atom_tests.service_test import gdata_tests.service_test import gdata_tests.apps.service_test import gdata_tests.books.service_test import gdata_tests.calendar.service_test impo...
apache-2.0
shuggiefisher/potato
django/contrib/gis/geos/point.py
403
4253
from ctypes import c_uint from django.contrib.gis.geos.error import GEOSException from django.contrib.gis.geos.geometry import GEOSGeometry from django.contrib.gis.geos import prototypes as capi class Point(GEOSGeometry): _minlength = 2 _maxlength = 3 def __init__(self, x, y=None, z=None, srid=None): ...
bsd-3-clause
qrkourier/ansible
lib/ansible/modules/cloud/amazon/ec2_vpc_nat_gateway.py
12
32654
#!/usr/bin/python # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
aabbox/kbengine
kbe/src/lib/python/Lib/turtledemo/tree.py
85
1425
#!/usr/bin/env python3 """ turtle-example-suite: tdemo_tree.py Displays a 'breadth-first-tree' - in contrast to the classical Logo tree drawing programs, which use a depth-first-algorithm. Uses: (1) a tree-generator, where the drawing is quasi the side-effect, whereas the generator always yields No...
lgpl-3.0
vveerava/Openstack
neutron/agent/linux/external_process.py
5
10207
# 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
sapfo/medeas
processing/visualstack.py
1
1770
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jun 21 18:35:25 2017 @author: ivan """ import numpy as np import sys import matplotlib.pyplot as plt with open('haplotype_labels.txt') as f: labels0 = f.readlines() labels = np.array([l.split()[1] for l in labels0]) groups = np.array([l.split()[0]...
gpl-3.0
pquentin/libcloud
libcloud/test/compute/test_indosat.py
12
1311
# 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
Jobava/bedrock
bedrock/mozorg/tests/test_views.py
11
46992
# -*- coding: utf-8 -*- # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from datetime import date import json import basket from django.conf import settings from django...
mpl-2.0
40223235/2015cd_midterm2
static/Brython3.1.1-20150328-091302/Lib/getopt.py
845
7488
"""Parser for command line options. This module helps scripts to parse the command line arguments in sys.argv. It supports the same conventions as the Unix getopt() function (including the special meanings of arguments of the form `-' and `--'). Long options similar to those supported by GNU software may be used as ...
gpl-3.0
shsingh/ansible
lib/ansible/modules/notification/jabber.py
37
4452
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, Brian Coca <bcoca@ansible.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
drybjed/debops
ansible/roles/btrfs/library/btrfs_subvolume.py
2
6480
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2014, Ilya Barsukov <barsukov@selectel.ru>, Selectel LLC # SPDX-License-Identifier: GPL-3.0-or-later # # 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 ...
gpl-3.0
asm0dey/Flexget
flexget/plugins/filter/movie_queue.py
1
12329
from __future__ import unicode_literals, division, absolute_import import logging from sqlalchemy import Column, Integer, String, ForeignKey, or_, and_, select, update from sqlalchemy.orm.exc import NoResultFound from flexget import db_schema, plugin from flexget.entry import Entry from flexget.event import event fro...
mit
indevgr/django
django/contrib/admin/sites.py
3
19794
from functools import update_wrapper from django.apps import apps from django.conf import settings from django.contrib.admin import ModelAdmin, actions from django.contrib.auth import REDIRECT_FIELD_NAME from django.core.exceptions import ImproperlyConfigured, PermissionDenied from django.db.models.base import ModelBa...
bsd-3-clause
pplatek/odoo
addons/base_report_designer/plugin/openerp_report_designer/test/test_fields.py
391
1308
# # Use this module to retrive the fields you need according to the type # of the OpenOffice operation: # * Insert a Field # * Insert a RepeatIn # import xmlrpclib import time sock = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/object') def get(object, level=3, ending=None, ending_excl=None, recur=None, roo...
agpl-3.0
vivekkodu/robotframework-selenium2library
doc/buildhtml.py
72
9935
#!/usr/bin/env python # $Id: buildhtml.py 7037 2011-05-19 08:56:27Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Generates .html from all the .txt files in a directory. Ordinary .txt files are understood to be standalone reStructuredText. Fil...
apache-2.0
JoshWu/linux-at91
tools/perf/scripts/python/netdev-times.py
1544
15191
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
gpl-2.0
gtko/CouchPotatoServer
libs/xmpp/simplexml.py
198
22791
## simplexml.py based on Mattew Allum's xmlstream.py ## ## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2, or (...
gpl-3.0
fbarreir/panda-server
pandaserver/test/deleteJobs.py
2
5897
import os import re import sys import time import fcntl import types import shelve import random import datetime import commands import threading import userinterface.Client as Client from dataservice.DDM import ddm from dataservice.DDM import dashBorad from taskbuffer.OraDBProxy import DBProxy from taskbuffer.TaskBuff...
apache-2.0
TheMutley/openpilot
pyextra/gunicorn/six.py
320
27344
"""Utilities for writing code that runs on Python 2 and 3""" # Copyright (c) 2010-2014 Benjamin Peterson # # 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 with...
mit
savoirfairelinux/OpenUpgrade
addons/website/models/ir_http.py
20
10228
# -*- coding: utf-8 -*- import datetime import hashlib import logging import re import traceback import werkzeug import werkzeug.routing import openerp from openerp.addons.base import ir from openerp.addons.base.ir import ir_qweb from openerp.addons.website.models.website import slug, url_for from openerp.http import ...
agpl-3.0
XiaosongWei/crosswalk-test-suite
webapi/tct-vibration-w3c-tests/inst.xpk.py
456
6809
#!/usr/bin/env python import os import shutil import glob import time import sys import subprocess import string from optparse import OptionParser, make_option SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PKG_NAME = os.path.basename(SCRIPT_DIR) PARAMETERS = None #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=...
bsd-3-clause
bsipocz/statsmodels
statsmodels/tools/tests/test_web.py
27
1524
from statsmodels.tools.web import _generate_url, webdoc from statsmodels.regression.linear_model import OLS from unittest import TestCase from nose.tools import assert_equal, assert_raises from numpy import array class TestWeb(TestCase): def test_string(self): url = _generate_url('arch',True) asser...
bsd-3-clause
jamestwebber/scipy
scipy/sparse/csgraph/tests/test_reordering.py
1
2686
from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import assert_equal from scipy.sparse.csgraph import reverse_cuthill_mckee, structural_rank from scipy.sparse import diags, csc_matrix, csr_matrix, coo_matrix def test_graph_reverse_cuthill_mckee(): A = np.arra...
bsd-3-clause
Lemma1/MAC-POSTS
doc_builder/sphinx-contrib/httpdomain/test/bottle_test.py
4
1934
import unittest from sphinxcontrib.autohttp.bottle import get_routes from bottle import Bottle, Route def create_app(): app = Bottle() @app.route("/bottle") def bottle_bottle(): return 12 @app.post("/bottle/post/") def bottle_bottle_post(): return 23 return app def crea...
mit
ratoaq2/knowit
knowit/core.py
1
7027
import typing from logging import NullHandler, getLogger logger = getLogger(__name__) logger.addHandler(NullHandler()) T = typing.TypeVar('T') _visible_chars_table = dict.fromkeys(range(32)) def _is_unknown(value: typing.Any) -> bool: return isinstance(value, str) and (not value or value.lower() == 'unknown') ...
mit
mclumd/swarm-simulator
tests/vectors_tests.py
1
6590
# tests.vectors_tests.py # Tests for the vectors package # # Author: Benjamin Bengfort <benjamin@bengfort.com> # Created: Thu Apr 24 09:57:20 2014 -0400 # # Copyright (C) 2014 Bengfort.com # For license information, see LICENSE.txt # # ID: vectors_tests.py [] benjamin@bengfort.com $ """ Tests for the vectors packag...
mit
vmlaker/mpipe
src/OrderedWorker.py
1
7319
"""Implements OrderedWorker class.""" import multiprocessing from .TubeP import TubeP class OrderedWorker(multiprocessing.Process): """An OrderedWorker object operates in a stage where the order of output results always matches that of corresponding input tasks. A worker is linked to its two nearest nei...
mit
zuowang/voltdb
tests/scripts/examples/sql_coverage/partial-covering-schema.py
7
1943
#!/usr/bin/env python # This file is part of VoltDB. # Copyright (C) 2008-2015 VoltDB 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 # without limitati...
agpl-3.0
gangadharkadam/v6_erp
erpnext/patches/v5_0/rename_total_fields.py
101
2313
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.model.utils.rename_field import rename_field from frappe.modules import scrub, get_doctype_module selling_doctypes = ("Quotat...
agpl-3.0
davenpcj5542009/eucalyptus
tools/imaging/eucatoolkit/stages/downloadimage.py
1
20080
#!/usr/bin/python -tt # Copyright 2011-2012 Eucalyptus Systems, Inc. # # Redistribution and use of this software 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, # t...
gpl-3.0
andreif/django
tests/migrations/test_executor.py
80
26645
from django.apps.registry import apps as global_apps from django.db import connection from django.db.migrations.exceptions import InvalidMigrationPlan from django.db.migrations.executor import MigrationExecutor from django.db.migrations.graph import MigrationGraph from django.db.migrations.recorder import MigrationReco...
bsd-3-clause
ammaradil/fibonacci
Lib/site-packages/django/conf/locale/fi/formats.py
504
1390
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. E Y' TIME_FORMAT = 'G.i' DATET...
mit
zoni/errbot
errbot/backend_plugin_manager.py
2
1705
import logging import sys from pathlib import Path from typing import Any, Type from errbot.plugin_info import PluginInfo from .utils import collect_roots log = logging.getLogger(__name__) class PluginNotFoundException(Exception): pass class BackendPluginManager: """ This is a one shot plugin manager...
gpl-3.0
gangadharkadam/smrtfrappe
frappe/templates/pages/contact.py
32
1561
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import now def get_context(context): doc = frappe.get_doc("Contact Us Settings", "Contact Us Settings") if doc.query_options: query_optio...
mit
DelazJ/QGIS
tests/src/python/test_qgsproject.py
23
57311
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsProject. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. """ from b...
gpl-2.0
parksjin01/ctf
2013/Pico/Trivial.py
1
1130
#!/usr/bin/env python import sys import binascii alphaL = "abcdefghijklnmopqrstuvqxyz" alphaU = "ABCDEFGHIJKLMNOPQRSTUVQXYZ" num = "0123456789" keychars = num+alphaL+alphaU ciphertext = "Bot kmws mikferuigmzf rmfrxrwqe abs perudsf! Nvm kda ut ab8bv_w4ue0_ab8v_DDU" res = '' key = [55, 0, 25, 54, 3, 12, 27, 14, 7, 2...
mit
n3storm/seantis-questionnaire
questionnaire/qprocessors/simple.py
1
3543
from questionnaire import * from django.utils.translation import ugettext as _ from django.utils.simplejson import dumps @question_proc('choice-yesno','choice-yesnocomment','choice-yesnodontknow') def question_yesno(request, question): key = "question_%s" % question.number key2 = "question_%s_comment" % questi...
bsd-3-clause
vn09/ns-3-dev-git
src/virtual-net-device/bindings/modulegen__gcc_LP64.py
28
221169
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
habedi/Emacs-theme-creator
venv/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/setuptools/tests/test_resources.py
62
24677
#!/usr/bin/python # -*- coding: utf-8 -*- # NOTE: the shebang and encoding lines are for ScriptHeaderTests; do not remove from unittest import TestCase, makeSuite; from pkg_resources import * from setuptools.command.easy_install import get_script_header, is_sh import os, pkg_resources, sys, StringIO, tempfile, shutil t...
gpl-3.0
anixe/anixe-gitosis
gitosis/init.py
19
4219
""" Initialize a user account for use with gitosis. """ import errno import logging import os import sys from pkg_resources import resource_filename from cStringIO import StringIO from ConfigParser import RawConfigParser from gitosis import repository from gitosis import run_hook from gitosis import ssh from gitosis...
gpl-2.0
jfmartinez64/test
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/wat.py
35
5369
# coding: utf-8 from __future__ import unicode_literals import re import hashlib from .common import InfoExtractor from ..utils import ( ExtractorError, unified_strdate, ) class WatIE(InfoExtractor): _VALID_URL = r'http://www\.wat\.tv/video/(?P<display_id>.*)-(?P<short_id>.*?)_.*?\.html' IE_NAME = '...
gpl-3.0
FrankBian/kuma
kuma/users/backends.py
5
1131
import hashlib from django.contrib.auth.hashers import BasePasswordHasher, mask_hash from django.utils.crypto import constant_time_compare from django.utils.datastructures import SortedDict from tower import ugettext as _ class Sha256Hasher(BasePasswordHasher): """ SHA-256 password hasher. """ algor...
mpl-2.0
saquiba2/numpy2
numpy/polynomial/polynomial.py
126
48268
""" Objects for dealing with polynomials. This module provides a number of objects (mostly functions) useful for dealing with polynomials, including a `Polynomial` class that encapsulates the usual arithmetic operations. (General information on how this module represents and works with polynomial objects is in the do...
bsd-3-clause
mtp401/airflow
airflow/www/forms.py
51
1466
# -*- coding: utf-8 -*- # # 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
mne-tools/mne-tools.github.io
0.11/_downloads/plot_estimate_covariance_matrix_baseline.py
22
1854
""" =============================================== Estimate covariance matrix from Epochs baseline =============================================== We first define a set of Epochs from events and a raw file. Then we estimate the noise covariance of prestimulus data, a.k.a. baseline. """ # Author: Alexandre Gramfort <...
bsd-3-clause
kingvuplus/PB-gui
lib/actions/parseactions.py
106
1900
# takes a header file, outputs action ids import tokenize, sys, string def filter(g): while 1: t = g.next() if t[1] == "/*": while g.next()[1] != "*/": pass continue if t[1] == "//": while g.next()[1] != "\n": pass continue if t[1] != "\n": # print t yield t[1] def do_file(f, mode)...
gpl-2.0
aajanki/youtube-dl
youtube_dl/extractor/twitch.py
9
13996
# coding: utf-8 from __future__ import unicode_literals import itertools import re import random from .common import InfoExtractor from ..compat import ( compat_str, compat_urllib_parse, compat_urllib_request, ) from ..utils import ( ExtractorError, parse_iso8601, ) class TwitchBaseIE(InfoExtrac...
unlicense
callofdutyops/YXH2016724098982
eye_input.py
1
9130
"""Routine for decoding the eye files.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import tensorflow as tf # Process images of this size. Note that this differs from the original eye # image size of 512 x 512. This smaller size can reduce...
mit
LukeCarrier/py3k-pexpect
tests/platform_tests/test_handler.py
1
1606
#!/usr/bin/env python import signal, os, time, errno, pty, sys, fcntl, tty GLOBAL_SIGCHLD_RECEIVED = 0 def nonblock (fd): # if O_NDELAY is set read() returns 0 (ambiguous with EO...
mit
Gui13/CouchPotatoServer
libs/xmpp/dispatcher.py
200
17974
## transports.py ## ## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2, or (at your option) ## any later versi...
gpl-3.0
Livefyre/django-cms
cms/utils/django_load.py
1
3693
# -*- coding: utf-8 -*- """ This is revision from 3058ab9d9d4875589638cc45e84b59e7e1d7c9c3 of https://github.com/ojii/django-load. ANY changes to this file, be it upstream fixes or changes for the cms *must* be documented clearly within this file with comments. For documentation on how to use the functions described ...
bsd-3-clause
tdsmith/numpy
numpy/distutils/from_template.py
164
7822
#!/usr/bin/python """ process_file(filename) takes templated file .xxx.src and produces .xxx file where .xxx is .pyf .f90 or .f using the following template rules: '<..>' denotes a template. All function and subroutine blocks in a source file with names that contain '<..>' will be replicated according to ...
bsd-3-clause
Nashenas88/servo
tests/wpt/css-tests/css-text-decor-3_dev/xhtml1print/reference/support/generate-text-emphasis-position-property-tests.py
841
3343
#!/usr/bin/env python # - * - coding: UTF-8 - * - """ This script generates tests text-emphasis-position-property-001 ~ 006 which cover all possible values of text-emphasis-position property with all combination of three main writing modes and two orientations. Only test files are generated by this script. It also out...
mpl-2.0
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python2.7/encodings/iso8859_5.py
593
13271
""" Python Character Mapping Codec iso8859_5 generated from 'MAPPINGS/ISO8859/8859-5.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,errors='...
gpl-2.0
robintw/scikit-image
skimage/viewer/qt.py
48
1281
_qt_version = None has_qt = True try: from matplotlib.backends.qt_compat import QtGui, QtCore, QtWidgets, QT_RC_MAJOR_VERSION as _qt_version except ImportError: try: from matplotlib.backends.qt4_compat import QtGui, QtCore QtWidgets = QtGui _qt_version = 4 except ImportError: ...
bsd-3-clause
mitghi/pyopenssl
src/OpenSSL/SSL.py
13
65522
import socket from sys import platform from functools import wraps, partial from itertools import count, chain from weakref import WeakValueDictionary from errno import errorcode from six import binary_type as _binary_type from six import integer_types as integer_types from six import int2byte, indexbytes from OpenSS...
apache-2.0
simontakite/sysadmin
pythonscripts/pythonnetworkingcoookbook/chapter1/1_10_reuse_socket_address.py
2
1277
#!/usr/bin/env python # Python Network Programming Cookbook -- Chapter - 1 # This program is optimized for Python 2.7. # It may run on any other version with/without modifications. import socket import sys def reuse_socket_addr(): sock = socket.socket( socket.AF_INET, socket.SOCK_STREAM ) # Get ...
gpl-2.0
thaim/ansible
lib/ansible/modules/storage/infinidat/infini_export_client.py
21
5608
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2016, Gregory Shulov (gregory.shulov@gmail.com) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_...
mit
michalliu/OpenWrt-Firefly-Libraries
staging_dir/host/lib/python2.7/distutils/dep_util.py
177
3509
"""distutils.dep_util Utility functions for simple, timestamp-based dependency of files and groups of files; also, function based entirely on such timestamp dependency analysis.""" __revision__ = "$Id$" import os from stat import ST_MTIME from distutils.errors import DistutilsFileError def newer(source, target): ...
gpl-2.0
akirk/youtube-dl
youtube_dl/extractor/khanacademy.py
128
2740
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( unified_strdate, ) class KhanAcademyIE(InfoExtractor): _VALID_URL = r'^https?://(?:(?:www|api)\.)?khanacademy\.org/(?P<key>[^/]+)/(?:[^/]+/){,2}(?P<id>[^?#/]+)(?:$|[?#])' IE_NAME = 'KhanAcademy' ...
unlicense
bboalimoe/ndn-cache-policy
docs/sphinx-contrib/tikz/setup.py
3
1632
# -*- coding: utf-8 -*- LONG_DESCRIPTION = \ ''' This package contains the tikz Sphinx extension, which enables the use of the PGF/TikZ LaTeX package to draw nice pictures. ''' NAME = 'sphinxcontrib-tikz' DESCRIPTION = 'TikZ extension for Sphinx' VERSION = '0.4.1' AUTHOR = 'Christoph Reller' AUTHO...
gpl-3.0
d33tah/npyscreen
TEST-SAFE-DISPLAY.py
8
1765
# coding=utf-8 import npyscreen npyscreen.npysGlobalOptions.ASCII_ONLY = False class TestApp(npyscreen.NPSAppManaged): #__TEXT_WIDGET = npyscreen.TitleText __TEXT_WIDGET = npyscreen.TextfieldUnicode def main(self): # These lines create the form and populate it with widgets. # A fa...
bsd-2-clause
roadmapper/ansible
lib/ansible/module_utils/facts/system/env.py
232
1170
# This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed in the hope that ...
gpl-3.0
FeliciaLim/oss-fuzz
infra/base-images/base-msan-builder/packages/package.py
4
2413
#!/usr/bin/env python # Copyright 2017 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 applicable law or...
apache-2.0
ieguinoa/tools-iuc
tools/gff3_rebase/gff3_rebase.py
23
7830
#!/usr/bin/env python import argparse import copy import logging import sys from BCBio import GFF from Bio.SeqFeature import FeatureLocation logging.basicConfig(level=logging.INFO) log = logging.getLogger(__name__) __author__ = "Eric Rasche" __version__ = "0.4.0" __maintainer__ = "Eric Rasche" __email__ = "esr@tamu....
mit
molotof/infernal-twin
build/reportlab/src/reportlab/lib/yaml.py
32
5735
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/lib/yaml.py # parses "Yet Another Markup Language" into a list of tuples. # Each tuple says what the data is e.g. # ('Paragraph', 'Heading1', 'Why Repo...
gpl-3.0
ksachs/invenio
modules/bibsword/lib/bibsword_config.py
19
4478
## This file is part of Invenio. ## Copyright (C) 2010, 2011, 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 versio...
gpl-2.0
tboyce1/home-assistant
homeassistant/components/sensor/ihc.py
2
2909
"""IHC sensor platform. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.ihc/ """ from xml.etree.ElementTree import Element import voluptuous as vol from homeassistant.components.ihc import ( validate_name, IHC_DATA, IHC_CONTROLLER, IHC_INFO) ...
apache-2.0
porduna/flask-admin
flask_admin/contrib/pymongo/view.py
6
9257
import logging import pymongo from bson import ObjectId from bson.errors import InvalidId from flask import flash from flask.ext.admin._compat import string_types from flask.ext.admin.babel import gettext, ngettext, lazy_gettext from flask.ext.admin.model import BaseModelView from flask.ext.admin.actions import acti...
bsd-3-clause
Vizerai/grpc
examples/python/route_guide/route_guide_server.py
8
4271
# Copyright 2015 gRPC 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 applicable law or agreed to in writing...
apache-2.0
arnavd96/Cinemiezer
myvenv/lib/python3.4/site-packages/rest_framework/utils/humanize_datetime.py
144
1285
""" Helper functions that convert strftime formats into more readable representations. """ from rest_framework import ISO_8601 def datetime_formats(formats): format = ', '.join(formats).replace( ISO_8601, 'YYYY-MM-DDThh:mm[:ss[.uuuuuu]][+HH:MM|-HH:MM|Z]' ) return humanize_strptime(format) ...
mit
dpiers/coderang-meteor
public/jsrepl/extern/python/unclosured/lib/python2.7/lib2to3/fixes/fix_isinstance.py
326
1609
# Copyright 2008 Armin Ronacher. # Licensed to PSF under a Contributor Agreement. """Fixer that cleans up a tuple argument to isinstance after the tokens in it were fixed. This is mainly used to remove double occurrences of tokens as a leftover of the long -> int / unicode -> str conversion. eg. isinstance(x, (int,...
mit
dpyro/servo
tests/wpt/web-platform-tests/tools/html5lib/html5lib/tokenizer.py
1710
76929
from __future__ import absolute_import, division, unicode_literals try: chr = unichr # flake8: noqa except NameError: pass from collections import deque from .constants import spaceCharacters from .constants import entities from .constants import asciiLetters, asciiUpper2Lower from .constants import digits, ...
mpl-2.0
wylee/runcommands
docs/conf.py
1
2972
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import sys from datetime import date sys.path.insert(0, os.path.abspath("..")) from runcommands import __version__ # noqa: E402 # -- General configuration ------------------------------------------------ project = "RunCommands" author = "Wyatt Baldwin" copyr...
mit
jonathandreyer/iuam-backend
app/notification/notifications.py
1
1160
# -*- coding: utf-8 -*- import json from notification.notifications_mysql import NotificationsMysql class Notifications: def __init__(self, db): self.notifications_mysql = NotificationsMysql(db) self.notifications_mysql.check_table(False) def add(self, notification): self.notificatio...
gpl-3.0
pierreg/tensorflow
tensorflow/contrib/learn/python/learn/trainable.py
10
2980
# 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
Cynerd/linux-conf-perf
scripts/evaluate.py
1
3991
#!/usr/bin/env python3 import os import sys import numpy.linalg as nplag from conf import conf from conf import sf import utils def reduce_matrix_search_for_base_recurse(wset, columns, contains, ignore): bases = [] for x in range(0, len(columns)): if x in contains or x in ignore: continue colide = False f...
gpl-2.0