repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
BeenzSyed/tempest | tempest/scenario/test_aggregates_basic_ops.py | 1 | 5542 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 IBM Corp.
# 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/licen... | apache-2.0 |
hexxter/home-assistant | homeassistant/components/zeroconf.py | 10 | 1452 | """
This module exposes Home Assistant via Zeroconf.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/zeroconf/
"""
import logging
import socket
import voluptuous as vol
from homeassistant.const import (EVENT_HOMEASSISTANT_STOP, __version__)
_LOGGER = ... | mit |
sivel/ansible-modules-extras | system/known_hosts.py | 10 | 11796 | #!/usr/bin/python
"""
Ansible module to manage the ssh known_hosts file.
Copyright(c) 2014, Matthew Vernon <mcv21@cam.ac.uk>
This module 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 Li... | gpl-3.0 |
vbshah1992/microblog | flask/lib/python2.7/site-packages/whoosh/util/testing.py | 95 | 4517 | # Copyright 2007 Matt Chaput. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the... | bsd-3-clause |
MadsJensen/agency_connectivity | phase_analysis_wide.py | 1 | 5708 | # -*- coding: utf-8 -*-
"""
@author: mje
@emai: mads@cnru.dk
"""
import numpy as np
# import mne
import matplotlib.pyplot as plt
import pandas as pd
from my_settings import *
plt.style.use("ggplot")
b_df = pd.read_csv(
"/Users/au194693/projects/agency_connectivity/data/behavioural_results.csv")
def calc_ISPC_... | bsd-3-clause |
LFPy/LFPy | LFPy/cell.py | 1 | 106760 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (C) 2012 Computational Neuroscience Group, NMBU.
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 you... | gpl-3.0 |
citrix-openstack-build/nova | nova/tests/virt/hyperv/test_vmutils.py | 8 | 2546 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Cloudbase Solutions Srl
# 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.ap... | apache-2.0 |
diogobaeder/merendeira | tests/supplies/test_models.py | 1 | 1026 | from django.test import TestCase
from nose.tools import istest
from merendeira.supplies.models import Category, Product
class CategoryTest(TestCase):
@istest
def creates_a_basic_instance(self):
Category.objects.create(title='Comidas')
category = Category.objects.get(pk=1)
self.asser... | bsd-2-clause |
kalahbrown/HueBigSQL | desktop/core/ext-py/Django-1.6.10/django/contrib/gis/tests/test_geoforms.py | 97 | 13891 | from django.forms import ValidationError
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.tests.utils import HAS_SPATIALREFSYS
from django.test import SimpleTestCase
from django.utils import six
from django.utils.html import escape
from django.utils.unittest import skipUnless
if HAS_SPATIALREFSYS:
... | apache-2.0 |
jspan/Open-Knesset | auxiliary/migrations/0013_auto__add_tagkeyphrase.py | 14 | 7851 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'TagKeyphrase'
db.create_table(u'auxiliary_tagkeyphrase', ... | bsd-3-clause |
moonboots/tensorflow | tensorflow/python/kernel_tests/unpack_op_test.py | 15 | 2525 | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
chinmaygarde/mojo | sky/tools/webkitpy/common/system/systemhost.py | 13 | 2475 | # Copyright (c) 2011 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 ... | bsd-3-clause |
75651/kbengine_cloud | kbe/src/lib/python/Lib/unittest/test/testmock/testwith.py | 80 | 8873 | import unittest
from warnings import catch_warnings
from unittest.test.testmock.support import is_instance
from unittest.mock import MagicMock, Mock, patch, sentinel, mock_open, call
something = sentinel.Something
something_else = sentinel.SomethingElse
class WithTest(unittest.TestCase):
def test_with_sta... | lgpl-3.0 |
ikmaak/Printrun | printrun/utils.py | 19 | 8549 | # This file is part of the Printrun suite.
#
# Printrun 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.
#
# Printrun is distributed in ... | gpl-3.0 |
evernym/plenum | common/serializers/json_serializer.py | 2 | 2130 | # Consider using bson or ubjson for serializing json
import base64
from typing import Dict
from common.serializers.mapping_serializer import MappingSerializer
try:
import ujson as json
from ujson import encode as uencode
# Older versions of ujson's encode do not support `sort_keys`, if that
# is th... | apache-2.0 |
marksherman/appinventor-sources | appinventor/misc/i18n/i18n.py | 8 | 10775 | #!/usr/bin/env python
# -*- mode: python; coding: utf-8; -*-
# Copyright © 2019 MIT, All rights reserved.
# Released under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
"""
Internationalization helper tool for MIT App Inventor. This utility provides two commands, combine and split, to w... | apache-2.0 |
lnielsen/invenio | invenio/legacy/websubmit/engine.py | 2 | 82544 | ## This file is part of Invenio.
## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 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
## Lic... | gpl-2.0 |
mblondel/scikit-learn | sklearn/setup.py | 24 | 2991 | import os
from os.path import join
import warnings
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_info, BlasNotFoundError
import numpy
libraries = []
if os.name == 'posix':
libraries.appe... | bsd-3-clause |
vladikoff/fxa-mochitest | tests/venv/lib/python2.7/site-packages/mozlog/logger.py | 46 | 6610 | # 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 logging import getLogger as getSysLogger
from logging import *
# Some of the build slave environments don't see the... | mpl-2.0 |
gymnasium/edx-platform | openedx/core/djangoapps/user_api/accounts/tests/test_permissions.py | 9 | 2353 | """
Tests for User deactivation API permissions
"""
from django.test import TestCase, RequestFactory
from openedx.core.djangoapps.user_api.accounts.permissions import CanDeactivateUser, CanRetireUser
from student.tests.factories import ContentTypeFactory, PermissionFactory, SuperuserFactory, UserFactory
class CanDea... | agpl-3.0 |
sorgerlab/belpy | indra/sources/trips/client.py | 2 | 4754 | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
import re
import sys
import getopt
import xml.dom.minidom
import logging
import requests
logger = logging.getLogger(__name__)
base_url = 'http://trips.ihmc.us/parser/cgi/'
def send_query(text, service_endpoint='d... | mit |
nginxxx/ansible | test/integration/setup_gce.py | 163 | 1391 | '''
Create GCE resources for use in integration tests.
Takes a prefix as a command-line argument and creates two persistent disks named
${prefix}-base and ${prefix}-extra and a snapshot of the base disk named
${prefix}-snapshot. prefix will be forced to lowercase, to ensure the names are
legal GCE resource names.
'''
... | gpl-3.0 |
crypto101/merlyn | setup.py | 1 | 2478 | import sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
from setuptools.command import egg_info
packageName = "merlyn"
dependencies = [
# Public API
"clarent==0.1.0",
# Base requirements, Twisted, TLS, AMP etc
"twisted>=13.2.0",
"pyOpenSSL>=0... | isc |
ratoaq2/Flexget | tests/test_assume_quality.py | 12 | 5240 | from __future__ import unicode_literals, division, absolute_import
from tests import FlexGetBase, build_parser_function
from nose.tools import assert_raises
from flexget.task import TaskAbort
import flexget.utils.qualities as qualities
class BaseAssumeQuality(FlexGetBase):
__yaml__ = """
templates:
... | mit |
okffi/booktype | lib/booktype/utils/config.py | 1 | 4906 | # This file is part of Booktype.
# Copyright (c) 2012 Aleksandar Erkalovic <aleksandar.erkalovic@sourcefabric.org>
#
# Booktype is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | agpl-3.0 |
huangenyan/Lattish | project/validate_hand.py | 1 | 9670 | # -*- coding: utf-8 -*-
"""
Load tenhou replay and validate tenhou hand score with our own system score
Input attribute is file name with tenhou.net log content.
Validation working correctly only for phoenix replays, for kyu, first dan and second dan lobbys
you need to set ids for hirosima, no red fives and no open ta... | mit |
vishnu2kmohan/dcos | packages/dcos-integration-test/extra/util/delete_ec2_volume.py | 4 | 2682 | #!/usr/bin/env python3
import contextlib
import logging
import os
import sys
import boto3
import botocore
import requests
import retrying
from test_util.helpers import retry_boto_rate_limits
@contextlib.contextmanager
def _remove_env_vars(*env_vars):
environ = dict(os.environ)
for env_var in env_vars:
... | apache-2.0 |
doyousketch2/PixelDraw.py | pxl.py | 1 | 6074 | ##=========================================================
## pxl.py 11 Mar 2017
##
## turn pixels into polygons, from spritesheets to Blender
##
## Eli Leigh Innis
## Twitter : @ Doyousketch2
## Email : Doyousketch2 @ yahoo.com
##
## GNU GPLv3 gnu.org/licen... | gpl-3.0 |
NunoEdgarGub1/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/projections/__init__.py | 69 | 2179 | from geo import AitoffAxes, HammerAxes, LambertAxes
from polar import PolarAxes
from matplotlib import axes
class ProjectionRegistry(object):
"""
Manages the set of projections available to the system.
"""
def __init__(self):
self._all_projection_types = {}
def register(self, *projections)... | gpl-3.0 |
xfournet/intellij-community | python/lib/Lib/site-packages/django/contrib/localflavor/au/forms.py | 309 | 1629 | """
Australian-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
import re
PHONE_DIGITS_RE ... | apache-2.0 |
Julian/home-assistant | homeassistant/components/sensor/sabnzbd.py | 12 | 4178 | """
Support for monitoring an SABnzbd NZB client.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.sabnzbd/
"""
import logging
from datetime import timedelta
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle
R... | mit |
tinchoss/Python_Android | python-build/python-libs/xmpppy/xmpp/commands.py | 200 | 16116 | ## $Id: commands.py,v 1.17 2007/08/28 09:54:15 normanr Exp $
## Ad-Hoc Command manager
## Mike Albon (c) 5th January 2005
## 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 versio... | apache-2.0 |
alex/django-old | django/core/files/temp.py | 536 | 1819 | """
The temp module provides a NamedTemporaryFile that can be re-opened on any
platform. Most platforms use the standard Python tempfile.TemporaryFile class,
but MS Windows users are given a custom class.
This is needed because in Windows NT, the default implementation of
NamedTemporaryFile uses the O_TEMPORARY flag, ... | bsd-3-clause |
groschovskiy/personfinder | app/unidecode/x057.py | 252 | 4631 | data = (
'Guo ', # 0x00
'Yin ', # 0x01
'Hun ', # 0x02
'Pu ', # 0x03
'Yu ', # 0x04
'Han ', # 0x05
'Yuan ', # 0x06
'Lun ', # 0x07
'Quan ', # 0x08
'Yu ', # 0x09
'Qing ', # 0x0a
'Guo ', # 0x0b
'Chuan ', # 0x0c
'Wei ', # 0x0d
'Yuan ', # 0x0e
'Quan ', # 0x0f
'Ku ', # 0x10
'F... | apache-2.0 |
jarvys/django-1.7-jdb | django/core/management/sql.py | 49 | 11292 | from __future__ import unicode_literals
import codecs
import os
import re
import warnings
from django.apps import apps
from django.conf import settings
from django.core.management.base import CommandError
from django.db import models, router
from django.utils.deprecation import RemovedInDjango19Warning
def check_fo... | bsd-3-clause |
simonsfoundation/inferelator_ng | inferelator_ng/tests/test_mi_R.py | 3 | 4576 | import unittest, os
import pandas as pd
import numpy as np
from .. import mi_R
my_dir = os.path.dirname(__file__)
class TestMI(unittest.TestCase):
"""
Superclass for common methods
"""
cores = bins = 10
def calculate_mi(self):
driver = mi_R.MIDriver()
target = driver.target_direct... | bsd-2-clause |
lemonad/methodiki | methodiki/customcomments/__init__.py | 1 | 1498 | # -*- coding: utf-8 -*-
from django.contrib.comments.models import Comment
from forms import CustomCommentForm
from models import CustomComment
def get_model():
return CustomComment
def get_form():
return CustomCommentForm
# FIXME: Remove monkey patching after Django ticket 13411 has been resolved!
# ... | mit |
wbcustc/Vintageous | bin/builder.py | 8 | 1751 | from fnmatch import fnmatch
from itertools import chain
from zipfile import ZipFile
from zipfile import ZIP_DEFLATED
import argparse
import glob
import json
import os
THIS_DIR = os.path.abspath(os.path.dirname(__file__))
PROJECT_ROOT = os.path.dirname(THIS_DIR)
RESERVED = ['manifest.json', 'dist']
parser = argparse... | mit |
zbal/ansible | test/units/template/test_safe_eval.py | 205 | 1956 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
SaschaMester/delicium | third_party/pexpect/screen.py | 171 | 11281 | """This implements a virtual screen. This is used to support ANSI terminal
emulation. The screen representation and state is implemented in this class.
Most of the methods are inspired by ANSI screen control codes. The ANSI class
extends this class to add parsing of ANSI escape codes.
PEXPECT LICENSE
This license... | bsd-3-clause |
alhashash/odoomrp-wip | mrp_product_variants_types/models/mrp.py | 16 | 1382 | # -*- encoding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import models, fields, api, exceptions, _
... | agpl-3.0 |
yyjiang/scikit-learn | sklearn/preprocessing/data.py | 113 | 56747 | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Mathieu Blondel <mathieu@mblondel.org>
# Olivier Grisel <olivier.grisel@ensta.org>
# Andreas Mueller <amueller@ais.uni-bonn.de>
# Eric Martin <eric@ericmart.in>
# License: BSD 3 clause
from itertools import chain, combina... | bsd-3-clause |
uche40/appmaker | public/vendor/bootstrap/test-infra/s3_cache.py | 1700 | 3523 | #!/usr/bin/env python2.7
from __future__ import absolute_import, unicode_literals, print_function, division
from sys import argv
from os import environ, stat, remove as _delete_file
from os.path import isfile, dirname, basename, abspath
from hashlib import sha256
from subprocess import check_call as run
from boto.s3.... | mpl-2.0 |
yangdongsheng/autotest | scheduler/drone_manager.py | 3 | 25405 | import os, heapq, traceback
try:
import autotest.common as common
except ImportError:
import common
import logging
from autotest.client.shared import error
from autotest.client.shared.settings import settings
from autotest.scheduler import email_manager, drone_utility, drones
from autotest.scheduler import sche... | gpl-2.0 |
dagwieers/ansible | lib/ansible/modules/network/fortios/fortios_authentication_rule.py | 24 | 12053 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2018 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... | gpl-3.0 |
ryfeus/lambda-packs | pytorch/source/caffe2/python/cached_reader.py | 1 | 4306 | ## @package cached_reader
# Module caffe2.python.cached_reader
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
from caffe2.python import core
from caffe2.python.db_file_reader import DBFileReader
from caffe2... | mit |
kmoocdev2/edx-platform | openedx/core/djangoapps/ccxcon/api.py | 24 | 5194 | """
Module containing API functions for the CCXCon
"""
import logging
import urlparse
from django.core.exceptions import ValidationError
from django.core.validators import URLValidator
from django.http import Http404
from oauthlib.oauth2 import BackendApplicationClient
from requests_oauthlib import OAuth2Session
from... | agpl-3.0 |
mattvick/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/views/metered_stream_unittest.py | 124 | 6044 | # Copyright (C) 2010, 2012 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions an... | bsd-3-clause |
stevenmizuno/QGIS | python/plugins/processing/algs/gdal/hillshade.py | 6 | 7991 | # -*- coding: utf-8 -*-
"""
***************************************************************************
hillshade.py
---------------------
Date : October 2013
Copyright : (C) 2013 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
***************... | gpl-2.0 |
halberom/ansible | contrib/inventory/ec2.py | 12 | 66590 | #!/usr/bin/env python
'''
EC2 external inventory script
=================================
Generates inventory that Ansible can understand by making API request to
AWS EC2 using the Boto library.
NOTE: This script assumes Ansible is being executed where the environment
variables needed for Boto have already been set:... | gpl-3.0 |
blighj/django | django/db/models/base.py | 9 | 71133 | import copy
import inspect
import warnings
from itertools import chain
from django.apps import apps
from django.conf import settings
from django.core import checks
from django.core.exceptions import (
NON_FIELD_ERRORS, FieldDoesNotExist, FieldError, MultipleObjectsReturned,
ObjectDoesNotExist, ValidationError,... | bsd-3-clause |
kongseokhwan/kulcloud-iitp-neutron | neutron/tests/unit/plugins/cisco/n1kv/test_n1kv_plugin.py | 5 | 64874 | # Copyright 2013 Cisco Systems, 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 o... | apache-2.0 |
sunqb/oa_qian | flask/Lib/site-packages/sqlalchemy/orm/evaluator.py | 33 | 5032 | # orm/evaluator.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 operator
from ..sql import operators
from .. import util
class Unevaluatab... | apache-2.0 |
AndreaCrotti/ansible | lib/ansible/plugins/callback/timer.py | 141 | 1030 | import os
import datetime
from datetime import datetime, timedelta
from ansible.plugins.callback import CallbackBase
class CallbackModule(CallbackBase):
"""
This callback module tells you how long your plays ran for.
"""
CALLBACK_VERSION = 2.0
CALLBACK_TYPE = 'aggregate'
CALLBACK_NAME = 'timer... | gpl-3.0 |
neocogent/electrum | electrum/tests/test_mnemonic.py | 2 | 11878 | from typing import NamedTuple, Optional
from electrum import keystore
from electrum import mnemonic
from electrum import old_mnemonic
from electrum.util import bh2u, bfh
from electrum.mnemonic import is_new_seed, is_old_seed, seed_type
from electrum.version import SEED_PREFIX_SW, SEED_PREFIX
from . import SequentialT... | mit |
jason-weirather/IDP-fusion-release-1 | bin/generate_isoforms_fusion.py | 1 | 53109 | #!/usr/bin/python
import sys
import re
import string
#from constants import *
import re
valid_cigar = set("0123456789MNID")
read_len_margin = 0
###
##########
def compute_min_ljust(str_value):
return max(20, (len(str_value)/10 + 1) * 10)
### Due to redundancy, isoforms might not be generated for a fusion segm... | apache-2.0 |
PyMamba/mamba-storm | storm/variables.py | 1 | 27457 | #
# Copyright (c) 2006, 2007 Canonical
#
# Written by Gustavo Niemeyer <gustavo@niemeyer.net>
#
# This file is part of Storm Object Relational Mapper.
#
# Storm 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 Found... | lgpl-2.1 |
40223143/2015_0505 | static/Brython3.1.1-20150328-091302/Lib/external_import.py | 742 | 2985 | import os
from browser import doc
import urllib.request
## this module is able to download modules that are external to
## localhost/src
## so we could download from any URL
class ModuleFinder:
def __init__(self, path_entry):
print("external_import here..")
#print(path_entry)
self._module=... | agpl-3.0 |
facelessuser/sublime-markdown-popups | st3/mdpopups/markdown/extensions/admonition.py | 5 | 3124 | """
Admonition extension for Python-Markdown
========================================
Adds rST-style admonitions. Inspired by [rST][] feature with the same name.
[rST]: http://docutils.sourceforge.net/docs/ref/rst/directives.html#specific-admonitions # noqa
See <https://Python-Markdown.github.io/extensions/admoniti... | mit |
cmdunkers/DeeperMind | PythonEnv/lib/python2.7/site-packages/pip/commands/list.py | 269 | 7251 | from __future__ import absolute_import
import logging
from pip._vendor import pkg_resources
from pip.basecommand import Command
from pip.exceptions import DistributionNotFound
from pip.index import FormatControl, fmt_ctl_formats, PackageFinder, Search
from pip.req import InstallRequirement
from pip.utils import get_... | bsd-3-clause |
nya282828/nyagarage | node_modules/gulp-pleeease/node_modules/pleeease/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py | 1835 | 1748 | #!/usr/bin/env python
# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""These functions are executed via gyp-flock-tool when using the Makefile
generator. Used on systems that don't have a built-in flock."""
... | mit |
HyperBaton/ansible | packaging/release/changelogs/changelog.py | 28 | 28455 | #!/usr/bin/env python
# PYTHON_ARGCOMPLETE_OK
"""Changelog generator and linter."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import argparse
import collections
import datetime
import docutils.utils
import json
import logging
import os
import packaging.version
import re
i... | gpl-3.0 |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/pyscreenshot/plugins/imagemagick.py | 2 | 1081 | from easyprocess import EasyProcess
from easyprocess import extract_version
from PIL import Image
import tempfile
PROGRAM = 'import'
# http://www.imagemagick.org/
class ImagemagickWrapper(object):
name = 'imagemagick'
childprocess = True
def __init__(self):
EasyProcess([PROGRAM, '-version']).che... | gpl-3.0 |
Belgabor/django | django/middleware/cache.py | 35 | 6947 | """
Cache middleware. If enabled, each Django-powered page will be cached based on
URL. The canonical way to enable cache middleware is to set
``UpdateCacheMiddleware`` as your first piece of middleware, and
``FetchFromCacheMiddleware`` as the last::
MIDDLEWARE_CLASSES = [
'django.middleware.cache.UpdateCa... | bsd-3-clause |
kevin-coder/tensorflow-fork | tensorflow/python/util/decorator_utils.py | 32 | 4132 | # 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 |
pjquirk/pjquirk-dotnetnames | doc_src/build_autodoc_files.py | 16 | 2513 | "Build up the sphinx autodoc file for the python code"
import os
import sys
docs_folder = os.path.dirname(__file__)
pywin_folder = os.path.dirname(docs_folder)
sys.path.append(pywin_folder)
pywin_folder = os.path.join(pywin_folder, "pywinauto")
excluded_dirs = ["unittests"]
excluded_files = [
"_men... | lgpl-2.1 |
jzoldak/edx-platform | lms/djangoapps/mobile_api/video_outlines/views.py | 121 | 4888 | """
Video Outlines
We only provide the listing view for a video outline, and video outlines are
only displayed at the course level. This is because it makes it a lot easier to
optimize and reason about, and it avoids having to tackle the bigger problem of
general XBlock representation in this rather specialized format... | agpl-3.0 |
MalwareLu/malwasm | web/malwasm_web.py | 2 | 6829 | #!/usr/bin/env python2.7
# Copyright (C) 2012 Malwasm Developers.
# This file is part of Malwasm - https://code.google.com/p/malwasm/
# See the file LICENSE for copying permission.
# _
# _ __ ___ __ _| |_ ____ _ ___ _ __ ___
# | '_ ` _ \ / _` | \ \ /\ / / _` / __|... | gpl-2.0 |
ric2b/Vivaldi-browser | chromium/build/android/convert_dex_profile_tests.py | 7 | 9805 | # Copyright 2018 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.
"""Tests for convert_dex_profile.
Can be run from build/android/:
$ cd build/android
$ python convert_dex_profile_tests.py
"""
import os
import sys
imp... | bsd-3-clause |
WhySoGeeky/DroidPot | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/big5freq.py | 3133 | 82594 | ######################## 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... | mit |
pietergreyling/amphtml | validator/build.py | 17 | 19699 | #!/usr/bin/python2.7
#
# Copyright 2015 The AMP HTML 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
#
# Unle... | apache-2.0 |
ryfeus/lambda-packs | Tensorflow_Pandas_Numpy/source3.6/tensorflow/contrib/ffmpeg/__init__.py | 82 | 1251 | # 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... | mit |
jonyroda97/redbot-amigosprovaveis | lib/pip/_internal/vcs/git.py | 8 | 11275 | from __future__ import absolute_import
import logging
import os.path
import re
from pip._vendor.packaging.version import parse as parse_version
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.six.moves.urllib import request as urllib_request
from pip._internal.compat import samefile
f... | gpl-3.0 |
tianzhihen/python-mode | pymode/libs2/rope/refactor/importutils/module_imports.py | 27 | 16583 | import rope.base.pynames
from rope.base import ast, utils
from rope.refactor.importutils import importinfo
from rope.refactor.importutils import actions
class ModuleImports(object):
def __init__(self, pycore, pymodule, import_filter=None):
self.pycore = pycore
self.pymodule = pymodule
sel... | lgpl-3.0 |
agileblaze/OpenStackTwoFactorAuthentication | openstack_dashboard/dashboards/admin/networks/tests.py | 18 | 68798 | # Copyright 2012 NEC Corporation
#
# 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 ag... | apache-2.0 |
mailund/IMCoalHMM | scripts/initial-migration-model.py | 1 | 5060 | #!/usr/bin/env python
"""Script for estimating parameters in an initial migration model.
"""
from argparse import ArgumentParser
from IMCoalHMM.likelihood import Likelihood, maximum_likelihood_estimate
from IMCoalHMM.isolation_with_migration_model import IsolationMigrationModel
from IMCoalHMM.hmm import Forwarder
... | gpl-2.0 |
prasadvagdargi/med_image_analysis | Examples/Python/DicomModifyTags.py | 2 | 2876 | #=========================================================================
#
# Copyright Insight Software Consortium
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www... | apache-2.0 |
pexip/os-python-suds-jurko | suds/cache.py | 1 | 8166 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will b... | lgpl-3.0 |
10clouds/edx-platform | common/djangoapps/enrollment/management/tests/test_enroll_user_in_course.py | 62 | 2563 | """ Test the change_enrollment command line script."""
import ddt
import unittest
from uuid import uuid4
from django.conf import settings
from django.core.management import call_command
from django.core.management.base import CommandError
from enrollment.api import get_enrollment
from student.tests.factories import ... | agpl-3.0 |
brentp/bio-playground | mosaic/filter-functional.py | 1 | 1442 | from __future__ import print_function
import sys
from geneimpacts import VEP
def isfunctional(csq):
if csq['BIOTYPE'] != 'protein_coding': return False
if csq['Feature'] == '' or csq['EXON'] == '': return False
return ("splic" in csq['Consequence']) or any(c in ('stop_gained', 'stop_lost',
... | mit |
bkahlert/seqan-research | raw/pmbs12/pmsb13-data-20120615/trunk/misc/seqan_instrumentation/bin/classes/simplejson/__init__.py | 25 | 20581 | r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
:mod:`simplejson` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules. It is the externally maintained
version of ... | mit |
B-MOOC/edx-platform | openedx/core/djangoapps/content/course_structures/migrations/0001_initial.py | 102 | 1759 | # -*- coding: 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):
# Adding model 'CourseStructure'
db.create_table('course_structures_coursestructure', (
('id', s... | agpl-3.0 |
edx/edx-enterprise | integrated_channels/integrated_channel/transmitters/learner_data.py | 1 | 15549 | # -*- coding: utf-8 -*-
"""
Generic learner data transmitter for integrated channels.
"""
import logging
from django.apps import apps
from integrated_channels.exceptions import ClientError
from integrated_channels.integrated_channel.client import IntegratedChannelApiClient
from integrated_channels.integrated_channel... | agpl-3.0 |
arborh/tensorflow | tensorflow/python/kernel_tests/conv_ops_3d_test.py | 7 | 28590 | # 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 |
ivanlmj/Android-DNSSL | Flask/lib/python2.7/site-packages/flask/cli.py | 72 | 18328 | # -*- coding: utf-8 -*-
"""
flask.cli
~~~~~~~~~
A simple command line application to run flask apps.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
from threading import Lock, Thread
from functools import update_wrapper
import click
... | gpl-2.0 |
ryfeus/lambda-packs | Sklearn_scipy_numpy/source/scipy/special/_ellip_harm.py | 80 | 5743 | from __future__ import division, print_function, absolute_import
import threading
import numpy as np
from ._ufuncs import _ellip_harm
from ._ellip_harm_2 import _ellipsoid, _ellipsoid_norm
# the functions _ellipsoid, _ellipsoid_norm use global variables, the lock
# protects them if the function is called from multi... | mit |
vrtsystems/pyhaystack | pyhaystack/client/ops/his.py | 1 | 31373 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
High-level history functions. These wrap the basic his_read function to allow
some alternate representations of the historical data.
"""
import hszinc
import fysom
import pytz
from copy import deepcopy
from datetime import tzinfo
from six import string_types
from ..... | apache-2.0 |
shssoichiro/servo | tests/wpt/web-platform-tests/encrypted-media/polyfill/make-polyfill-tests.py | 74 | 1267 | #!/usr/bin/python
import os, re, os.path, glob
head = re.compile( r"^(\s*</head>)", re.MULTILINE )
runtest = re.compile( r"runTest\(\s*(\S.*?)\s*\)", re.DOTALL )
scripts = '''
<!-- Polyfill files (NOTE: These are added by auto-generation script) -->
<script src=/encrypted-media/polyfill/chrome-polyfill.js></s... | mpl-2.0 |
dwillmer/jedi | jedi/evaluate/dynamic.py | 33 | 4936 | """
One of the really important features of |jedi| is to have an option to
understand code like this::
def foo(bar):
bar. # completion here
foo(1)
There's no doubt wheter bar is an ``int`` or not, but if there's also a call
like ``foo('str')``, what would happen? Well, we'll just show both. Because
th... | mit |
ManoSeimas/manoseimas.lt | manoseimas/compatibility_test/tests/__init__.py | 1 | 9447 | # coding: utf-8
from __future__ import absolute_import
from __future__ import unicode_literals
import datetime
import itertools
from django_webtest import WebTest
import factory
from django.core.urlresolvers import reverse
from django.test import TestCase
from manoseimas.scrapy.models import PersonVote
from manos... | agpl-3.0 |
zergling-man/Rinbot | modules/tiny_games.py | 1 | 6976 | import random as ra
import asyncio
from discord.abc import User as duser
from objects import hge
import discord
excluded=False
commands={'rps101':['rps'], 'rpslist':['rpsl'], 'enqueue':['queue','q'], 'listqueue':['lq'], 'popqueue':['pop','pq','next'], 'rikka':[], 'hgopen':['hgo'], 'hgclose':['hgc'], 'hgjoin':['hgj','h... | mit |
jupierce/openshift-tools | openshift/installer/vendored/openshift-ansible-3.2.24/roles/os_firewall/library/os_firewall_manage_iptables.py | 28 | 10532 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# vim: expandtab:tabstop=4:shiftwidth=4
# pylint: disable=fixme, missing-docstring
from subprocess import call, check_output
DOCUMENTATION = '''
---
module: os_firewall_manage_iptables
short_description: This module manages iptables rules for a given chain
author: Jason DeTibe... | apache-2.0 |
andrewbird/wader | test/test_aes.py | 1 | 6946 | # -*- coding: utf-8 -*-
# Copyright (C) 2011 Vodafone España, S.A.
# Author: Andrew Bird
#
# 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... | gpl-2.0 |
dkamotsky/program-y | src/test/processors/post/test_formatnumbers.py | 3 | 1511 | import unittest
from programy.processors.post.formatnumbers import FormatNumbersPostProcessor
from programy.bot import Bot
from programy.brain import Brain
from programy.config.brain import BrainConfiguration
from programy.config.bot import BotConfiguration
class FormatNmbersTests(unittest.TestCase):
def setUp(se... | mit |
aakash-cr7/zulip | zerver/tornado/event_queue.py | 2 | 36822 | # See http://zulip.readthedocs.io/en/latest/events-system.html for
# high-level documentation on how this system works.
from __future__ import absolute_import
from typing import cast, AbstractSet, Any, Callable, Dict, List, \
Mapping, MutableMapping, Optional, Iterable, Sequence, Set, Text, Union
from django.utils... | apache-2.0 |
axbaretto/beam | sdks/python/.tox/docs/lib/python2.7/site-packages/tests/transport/compliance.py | 6 | 3326 | # Copyright 2016 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 agreed to in writing,... | apache-2.0 |
TeachAtTUM/edx-platform | openedx/core/djangoapps/zendesk_proxy/apps.py | 15 | 1254 | """
Zendesk Proxy Configuration
"""
from django.apps import AppConfig
from openedx.core.djangoapps.plugins.constants import ProjectType, SettingsType, PluginURLs, PluginSettings
class ZendeskProxyConfig(AppConfig):
"""
AppConfig for zendesk proxy app
"""
name = 'openedx.core.djangoapps.zendesk_prox... | agpl-3.0 |
damdam-s/OCB | addons/project_issue/project_issue.py | 217 | 29319 | #-*- 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 |
Neurita/pelican-plugins | photos/test_photos.py | 33 | 4885 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from pelican.generators import ArticlesGenerator
from pelican.tests.support import unittest, get_settings
from tempfile import mkdtemp
from shutil import rmtree
import photos
CUR_DIR = os.path.dirname(__file__)
class TestPhotos(unittest.TestC... | agpl-3.0 |
GoogleCloudPlatform/python-compat-runtime | appengine-compat/exported_appengine_sdk/google/appengine/_internal/django/utils/numberformat.py | 23 | 1676 | from google.appengine._internal.django.conf import settings
from google.appengine._internal.django.utils.safestring import mark_safe
def format(number, decimal_sep, decimal_pos, grouping=0, thousand_sep=''):
"""
Gets a number (as a number or string), and returns it as a string,
using formats definied as a... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.