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 |
|---|---|---|---|---|---|
genestack/task-library | genestack/bio/variation/variation_indexer.py | 1 | 16269 | # -*- coding: utf-8 -*-
import re
import sys
import vcf
from genestack.bio import bio_meta_keys
from genestack.genestack_indexer import Indexer
from genestack.genestack_exceptions import GenestackException
from genestack.bio.reference_genome.reference_genome_file import ReferenceGenome
from genestack.metainfo import... | mit |
jonyroda97/redbot-amigosprovaveis | lib/youtube_dl/extractor/kontrtube.py | 60 | 2732 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_duration,
)
class KontrTubeIE(InfoExtractor):
IE_NAME = 'kontrtube'
IE_DESC = 'KontrTube.ru - Труба зовёт'
_VALID_URL = r'https?://(?:www\.)?kontrtube\.ru/... | gpl-3.0 |
meredith-digops/ansible | lib/ansible/modules/cloud/rackspace/rax_dns_record.py | 70 | 11652 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | gpl-3.0 |
developerinlondon/ansible-modules-core | database/postgresql/postgresql_db.py | 112 | 11226 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.
#... | gpl-3.0 |
zaffra/Donate | django/core/servers/basehttp.py | 12 | 24677 | """
BaseHTTPServer that implements the Python WSGI protocol (PEP 333, rev 1.21).
Adapted from wsgiref.simple_server: http://svn.eby-sarna.com/wsgiref/
This is a simple server for use in testing or debugging Django apps. It hasn't
been reviewed for security issues. Don't use it for production use.
"""
from BaseHTTPSe... | bsd-3-clause |
edx/lettuce | tests/integration/lib/Django-1.3/django/contrib/gis/shortcuts.py | 317 | 1161 | import cStringIO, zipfile
from django.conf import settings
from django.http import HttpResponse
from django.template import loader
def compress_kml(kml):
"Returns compressed KMZ from the given KML string."
kmz = cStringIO.StringIO()
zf = zipfile.ZipFile(kmz, 'a', zipfile.ZIP_DEFLATED)
zf.writestr('doc.... | gpl-3.0 |
tealover/nova | nova/virt/vmwareapi/io_util.py | 14 | 6322 | # Copyright (c) 2012 VMware, Inc.
# Copyright (c) 2011 Citrix Systems, Inc.
# Copyright 2011 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://w... | apache-2.0 |
googleapis/googleapis-gen | google/ads/googleads/v6/googleads-py/google/ads/googleads/v6/services/types/campaign_label_service.py | 1 | 4908 | # -*- coding: utf-8 -*-
# Copyright 2020 Google 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... | apache-2.0 |
XiaodunServerGroup/medicalmooc | cms/djangoapps/contentstore/features/component.py | 7 | 6270 | #pylint: disable=C0111
#pylint: disable=W0621
# Lettuce formats proposed definitions for unimplemented steps with the
# argument name "step" instead of "_step" and pylint does not like that.
#pylint: disable=W0613
from lettuce import world, step
from nose.tools import assert_true, assert_in # pylint: disable=E0611
... | agpl-3.0 |
billy-inn/scikit-learn | examples/ensemble/plot_gradient_boosting_regression.py | 227 | 2520 | """
============================
Gradient Boosting regression
============================
Demonstrate Gradient Boosting on the Boston housing dataset.
This example fits a Gradient Boosting model with least squares loss and
500 regression trees of depth 4.
"""
print(__doc__)
# Author: Peter Prettenhofer <peter.prett... | bsd-3-clause |
etashjian/ECE757-final | src/arch/x86/isa/insts/simd128/integer/data_transfer/move_mask.py | 91 | 2266 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
DBrianKimmel/PyHouse | Project/src/_test/twisted/check-certificate.py | 1 | 1185 | #!/usr/bin/env python3
#
# call with a host url to see if we know the TLS certificate
# from __future__ import print_function
import sys
from twisted.internet import defer, endpoints, protocol, ssl, task, error
def main(reactor, host, port=443):
options = ssl.optionsForClientTLS(hostname=host)
port = int(por... | mit |
nicolasmiller/pyculiarity | setup.py | 1 | 1256 | """
Usage details and source available here: https://github.com/nicolasmiller/pyculiarity.
The original R source and examples are available here: https://github.com/twitter/AnomalyDetection.
Copyright and License
Python port Copyright 2015 Nicolas Steven Miller
Original R source Copyright 2015 Twitter, Inc and othe... | gpl-3.0 |
beckett1124/Paddle | demo/sentiment/trainer_config.py | 7 | 1453 | # 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 |
liuqr/edx-xiaodun | cms/djangoapps/contentstore/features/course-updates.py | 13 | 3799 | #pylint: disable=C0111
#pylint: disable=W0621
from lettuce import world, step
from selenium.webdriver.common.keys import Keys
from common import type_in_codemirror
from nose.tools import assert_in # pylint: disable=E0611
@step(u'I go to the course updates page')
def go_to_updates(_step):
menu_css = 'li.nav-cour... | agpl-3.0 |
jhayworth/config | .emacs.d/elpy/rpc-venv/local/lib/python2.7/site-packages/yapf/yapflib/blank_line_calculator.py | 4 | 6343 | # 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... | gpl-3.0 |
gunan/tensorflow | tensorflow/python/kernel_tests/nth_element_op_test.py | 22 | 6937 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
paulthulstrup/moose | framework/scripts/find_dep_apps.py | 23 | 4563 | #!/usr/bin/env python
# This script finds a file in the herd trunk containing all the possible applications
# thay may be built with an "up" target. If passed the value ROOT it will simply
# return the root directory
import os, sys, re, subprocess
def findDepApps(dep_names, use_current_only=False):
dep_name = dep... | lgpl-2.1 |
lummyare/lummyare-lummy | py/selenium/selenium.py | 7 | 80742 |
"""
Copyright 2011 Software Freedom Conservancy.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in w... | apache-2.0 |
JulienMcJay/eclock | windows/Python27/Lib/distutils/unixccompiler.py | 90 | 12314 | """distutils.unixccompiler
Contains the UnixCCompiler class, a subclass of CCompiler that handles
the "typical" Unix-style command-line C compiler:
* macros defined with -Dname[=value]
* macros undefined with -Uname
* include search directories specified with -Idir
* libraries specified with -lllib
* library... | gpl-2.0 |
MeteorAdminz/viper | viper/modules/pymacho/MachOMainCommand.py | 6 | 1744 | # encoding: utf-8
"""
Copyright 2013 Jérémie BOUTOILLE
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 distri... | bsd-3-clause |
cloudbase/nova-virtualbox | nova/tests/functional/v3/test_server_usage.py | 15 | 1463 | # Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# 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... | apache-2.0 |
dcroc16/skunk_works | google_appengine/lib/django-1.5/django/views/decorators/cache.py | 106 | 3973 | from functools import wraps
from django.utils.decorators import decorator_from_middleware_with_args, available_attrs
from django.utils.cache import patch_cache_control, add_never_cache_headers
from django.middleware.cache import CacheMiddleware
def cache_page(*args, **kwargs):
"""
Decorator for views that tri... | mit |
alvarolopez/nova | nova/tests/unit/test_metadata.py | 14 | 38133 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | apache-2.0 |
amallia/zulip | api/integrations/trac/zulip_trac.py | 114 | 5142 | # -*- coding: utf-8 -*-
# Copyright © 2012 Zulip, 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 limitation the rights
# to use, copy, modify, ... | apache-2.0 |
dougwig/a10-neutron-lbaas | a10_neutron_lbaas/tests/unit/v1/test_handler_pool.py | 1 | 4287 | # Copyright 2014, Doug Wiegley (dougwig), A10 Networks
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
xwv/shadowsocks | shadowsocks/asyncdns.py | 655 | 17416 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014-2015 clowwindy
#
# 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 r... | apache-2.0 |
lilida/teletraan | deploy-board/integ_test/auto_deploy_tests.py | 8 | 9393 | # Copyright 2016 Pinterest, 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... | apache-2.0 |
sdelements/fabric | tests/test_project.py | 38 | 5250 | import unittest
import os
import fudge
from fudge.inspector import arg
from fabric.contrib import project
class UploadProjectTestCase(unittest.TestCase):
"""Test case for :func: `fabric.contrib.project.upload_project`."""
fake_tmp = "testtempfolder"
def setUp(self):
fudge.clear_expectations()... | bsd-2-clause |
bmbouter/kombu | kombu/tests/test_log.py | 8 | 5035 | from __future__ import absolute_import
import logging
import sys
from kombu.log import (
NullHandler,
get_logger,
get_loglevel,
safeify_format,
Log,
LogMixin,
setup_logging,
)
from .case import Case, Mock, patch
class test_NullHandler(Case):
def test_emit(self):
h = NullHan... | bsd-3-clause |
jlowdermilk/test-infra | gubernator/pull_request_test.py | 16 | 2645 | #!/usr/bin/env python
# Copyright 2016 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 |
GunoH/intellij-community | python/helpers/pydev/pydev_tests_mainloop/gui-glut.py | 100 | 1564 | #!/usr/bin/env python
"""Simple GLUT example to manually test event loop integration.
To run this:
1) Enable the PyDev GUI event loop integration for glut
2) do an execfile on this script
3) ensure you have a working GUI simultaneously with an
interactive console
4) run: gl.glClearColor(1,1,1,1)
"""
if __name__ ==... | apache-2.0 |
bohdan-shramko/learning-python | source/sublime-packages/Packages/python-markdown/st3/markdown/__init__.py | 24 | 20784 | """
Python Markdown
===============
Python Markdown converts Markdown to HTML and can be used as a library or
called from the command line.
## Basic usage as a module:
import markdown
html = markdown.markdown(your_text_string)
See <https://pythonhosted.org/Markdown/> for more
information and instructions on... | mit |
wunderlins/learning | python/zodb/lib/osx/ZODB/tests/testblob.py | 2 | 25257 | ##############################################################################
#
# Copyright (c) 2004 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | gpl-2.0 |
wainersm/buildbot | master/buildbot/test/unit/test_scripts_upgrade_master.py | 10 | 8417 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
Dapid/GPy | GPy/core/mapping.py | 11 | 1166 | # Copyright (c) 2013,2014, GPy authors (see AUTHORS.txt).
# Copyright (c) 2015, James Hensman
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import sys
from .parameterization import Parameterized
import numpy as np
class Mapping(Parameterized):
"""
Base model for shared mapping behaviours
"""... | bsd-3-clause |
WriterOfAlicrow/servo | tests/wpt/update/github.py | 197 | 5152 | # 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/.
import json
from urlparse import urljoin
requests = None
class GitHubError(Exception):
def __init__(self, status, d... | mpl-2.0 |
gxx/lettuce | tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/fi.py | 51 | 16281 | from django.contrib.localflavor.fi.forms import (FIZipCodeField,
FISocialSecurityNumber, FIMunicipalitySelect)
from utils import LocalFlavorTestCase
class FILocalFlavorTests(LocalFlavorTestCase):
def test_FIMunicipalitySelect(self):
f = FIMunicipalitySelect()
out = u'''<select name="municipal... | gpl-3.0 |
ArcherCraftStore/ArcherVMPeridot | Python/Lib/hmac.py | 142 | 5063 | """HMAC (Keyed-Hashing for Message Authentication) Python module.
Implements the HMAC algorithm as described by RFC 2104.
"""
import warnings as _warnings
from _operator import _compare_digest as compare_digest
import hashlib as _hashlib
trans_5C = bytes((x ^ 0x5C) for x in range(256))
trans_36 = bytes((x ^ 0x36) fo... | apache-2.0 |
kaksmet/servo | tests/wpt/css-tests/tools/pywebsocket/src/mod_pywebsocket/msgutil.py | 658 | 7598 | # Copyright 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 f... | mpl-2.0 |
ningchi/scikit-learn | sklearn/metrics/cluster/tests/test_supervised.py | 44 | 7663 | import numpy as np
from sklearn.metrics.cluster import adjusted_rand_score
from sklearn.metrics.cluster import homogeneity_score
from sklearn.metrics.cluster import completeness_score
from sklearn.metrics.cluster import v_measure_score
from sklearn.metrics.cluster import homogeneity_completeness_v_measure
from sklearn... | bsd-3-clause |
uw-it-aca/uw-restclients | restclients/models/myplan.py | 1 | 2722 | from restclients_core import models
class MyPlan(models.Model):
def __init__(self):
self.terms = []
def json_data(self):
data = {
"terms": []
}
for term in self.terms:
data["terms"].append(term.json_data())
return data
class MyPlanTerm(mo... | apache-2.0 |
logicrime/google-diff-match-patch | python2/diff_match_patch_test.py | 319 | 41744 | #!/usr/bin/python2.4
"""Test harness for diff_match_patch.py
Copyright 2006 Google Inc.
http://code.google.com/p/google-diff-match-patch/
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://... | apache-2.0 |
Hurence/log-island | logisland-components/logisland-processors/logisland-processor-scripting/src/main/resources/nltk/tokenize/regexp.py | 7 | 7932 | # Natural Language Toolkit: Tokenizers
#
# Copyright (C) 2001-2016 NLTK Project
# Author: Edward Loper <edloper@gmail.com>
# Steven Bird <stevenbird1@gmail.com>
# Trevor Cohn <tacohn@csse.unimelb.edu.au>
# URL: <http://nltk.sourceforge.net>
# For license information, see LICENSE.TXT
r"""
Regular-Expres... | apache-2.0 |
ChrisAntaki/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/abstractsequencedcommand.py | 122 | 2323 | # 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... | bsd-3-clause |
tosanai/wbai_hackathon_2017 | agent/ml/vae.py | 1 | 5878 | import datetime
from threading import Thread, Lock
from keras import backend as K
from keras.models import clone_model, Model
from keras.layers import Input, Dense, Lambda
from keras.callbacks import TensorBoard
import tensorflow as tf
from config.model import TENSORBOARD_LOG_DIR
from config.model import VAE_MODEL
... | apache-2.0 |
quantum5/UnicodeBrowser | UnicodeBrowser/wsgi.py | 1 | 1443 | """
WSGI config for UnicodeBrowser project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICA... | agpl-3.0 |
luther07/dak | tools/logs.py | 9 | 4984 | #!/usr/bin/python
# (c) 2008 Thomas Viehmann
# Free software licensed under the GPL version 2 or later
import os,re,datetime, sys
import tempfile, time
ITEMS_TO_KEEP = 20
CACHE_FILE = '/srv/ftp-master.debian.org/misc/dinstall_time_cache'
GRAPH_DIR = '/srv/ftp.debian.org/web/stat'
LINE = re.compile(r'(?:|.*/)dinstal... | gpl-2.0 |
sudheesh001/oh-mainline | vendor/packages/twisted/twisted/protocols/ftp.py | 18 | 93459 | # -*- test-case-name: twisted.test.test_ftp -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
An FTP protocol implementation
@author: Itamar Shtull-Trauring
@author: Jp Calderone
@author: Andrew Bennetts
"""
# System Imports
import os
import time
import re
import operator
import stat
im... | agpl-3.0 |
mutanthost/plexhole | lib/python2.7/site-packages/pip/_vendor/html5lib/filters/optionaltags.py | 354 | 10534 | from __future__ import absolute_import, division, unicode_literals
from . import base
class Filter(base.Filter):
def slider(self):
previous1 = previous2 = None
for token in self.source:
if previous1 is not None:
yield previous2, previous1, token
previous2 =... | gpl-2.0 |
bretttegart/treadmill | tests/plugins/zookeeper_test.py | 3 | 2218 | """
Unit test for zookeeper plugin
"""
import unittest
import mock
from treadmill.plugins import zookeeper
class ZookeeperTest(unittest.TestCase):
@mock.patch('kazoo.client.KazooClient')
def test_connect_without_connargs(self, kazooClientMock):
zkurl = 'zookeeper://foo@123:21'
zookeeper.conne... | apache-2.0 |
oorestisime/debsources | debsources/app/sources/__init__.py | 6 | 1057 | # Copyright (C) 2015 The Debsources developers <info@sources.debian.net>.
# See the AUTHORS file at the top-level directory of this distribution and at
# https://anonscm.debian.org/gitweb/?p=qa/debsources.git;a=blob;f=AUTHORS;hb=HEAD
#
# This file is part of Debsources. Debsources is free software: you can
# redistrib... | agpl-3.0 |
lordblackfox/aircox | aircox/admin/page.py | 2 | 3870 | from copy import deepcopy
from django.contrib import admin
from django.http import QueryDict
from django.utils.safestring import mark_safe
from django.utils.translation import gettext_lazy as _
from adminsortable2.admin import SortableInlineAdminMixin
from ..models import Category, Comment, NavItem, Page, StaticPage... | gpl-3.0 |
JeyZeta/Dangerous | Dangerous/Golismero/tools/sqlmap/lib/core/subprocessng.py | 7 | 5632 | #!/usr/bin/env python
"""
Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import errno
import os
import subprocess
import sys
import time
from lib.core.settings import IS_WIN
if IS_WIN:
try:
from win32file import ReadFile, WriteFile
... | mit |
multispot-software/transfer_convert | nbrun.py | 1 | 8332 | # Copyright (c) 2015-2017 Antonino Ingargiola
# License: MIT
"""
nbrun - Run an Jupyter/IPython notebook, optionally passing arguments.
USAGE
-----
Copy this file in the folder containing the master notebook used to
execute the other notebooks. Then use `run_notebook()` to execute
notebooks.
"""
import time
from pat... | mit |
HiSPARC/station-software | user/hsmonitor/Uploader.py | 1 | 7589 | """Upload Events to the datastore
This module retrieves Events from the storage using the StorageManager
and uploads the events in batches to the datastore.
"""
import logging
from time import sleep, time
from cPickle import dumps
import requests
from threading import Thread, Semaphore, Event
try:
from hashlib i... | gpl-3.0 |
jk1/intellij-community | python/helpers/pydev/_pydev_imps/_pydev_inspect.py | 92 | 31489 | """Get useful information from live Python objects.
This module encapsulates the interface provided by the internal special
attributes (func_*, co_*, im_*, tb_*, etc.) in a friendlier fashion.
It also provides some help for examining source code and class layout.
Here are some of the useful functions provided by this... | apache-2.0 |
teslaji/homebase | venv/HomeBase/lib/python2.7/site-packages/wheel/bdist_wheel.py | 219 | 17006 | """
Create a wheel (.whl) distribution.
A wheel is a built archive format.
"""
import csv
import hashlib
import os
import subprocess
import warnings
import shutil
import json
import wheel
try:
import sysconfig
except ImportError: # pragma nocover
# Python < 2.7
import distutils.sysconfig as sysconfig
i... | gpl-3.0 |
JVillella/tensorflow | tensorflow/python/__init__.py | 7 | 8573 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
nfxosp/platform_external_skia | tools/compare_codereview.py | 163 | 13309 | #!/usr/bin/python2
# Copyright 2014 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Skia's Chromium Codereview Comparison Script.
This script takes two Codereview URLs, looks at the trybot results for
the two codereviews and compares the results.... | bsd-3-clause |
daleooo/barrelfish | tools/harness/harness.py | 9 | 4172 | #
# Copyright (c) 2009-2011, ETH Zurich.
# All rights reserved.
#
# This file is distributed under the terms in the attached LICENSE file.
# If you do not find this file, copies can be found by writing to:
# ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
#
import os
import types
import strin... | mit |
inspyration/odoo | openerp/addons/base/tests/test_res_config.py | 398 | 3532 | import unittest2
import openerp
import openerp.tests.common as common
class test_res_config(common.TransactionCase):
def setUp(self):
super(test_res_config, self).setUp()
self.res_config = self.registry('res.config.settings')
# Define the test values
self.menu_xml_id = 'base.menu... | agpl-3.0 |
n0trax/ansible | lib/ansible/modules/network/netscaler/netscaler_gslb_service.py | 27 | 24002 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Citrix Systems
# 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 |
haikuginger/urllib3 | urllib3/packages/ssl_match_hostname/_implementation.py | 2360 | 3778 | """The match_hostname() function from Python 3.3.3, essential when using SSL."""
# Note: This file is under the PSF license as the code comes from the python
# stdlib. http://docs.python.org/3/license.html
import re
__version__ = '3.4.0.2'
class CertificateError(ValueError):
pass
def _dnsname_match(dn, host... | mit |
abo-abo/edx-platform | common/lib/xmodule/xmodule/html_module.py | 7 | 10456 | import copy
from fs.errors import ResourceNotFoundError
import logging
import os
import sys
from lxml import etree
from path import path
from pkg_resources import resource_string
from xblock.fields import Scope, String
from xmodule.editing_module import EditingDescriptor
from xmodule.html_checker import check_html
fro... | agpl-3.0 |
Kkevsterrr/backdoorme | backdoors/shell/__pupy/rpyc/core/service.py | 16 | 5817 | """
Services are the heart of RPyC: each side of the connection exposes a *service*,
which define the capabilities available to the other side.
Note that the services by both parties need not be symmetric, e.g., one side may
exposed *service A*, while the other may expose *service B*. As long as the two
can interope... | mit |
adoosii/edx-platform | lms/djangoapps/lms_xblock/mixin.py | 37 | 7658 | """
Namespace that defines fields common to all blocks used in the LMS
"""
from lazy import lazy
from xblock.fields import Boolean, Scope, String, XBlockMixin, Dict
from xblock.validation import ValidationMessage
from xmodule.modulestore.inheritance import UserPartitionList
from xmodule.partitions.partitions import No... | agpl-3.0 |
andrewv587/pycharm-project | keras_module/data_draw/draw_pascal.py | 1 | 2998 | import matplotlib.pylab as plt
import numpy as np
from ..image_utils import deprocess_image
def test_img(pascal_iter, index, pasacl_train):
datum, label = pascal_iter.get_example(index)
img = pasacl_train.visualize_example(index)
print(img.shape)
plt.figure()
plt.imshow(pasacl_train.datum_to_img... | apache-2.0 |
Vignesh2208/Awlsim | awlsim/core/instructions/insn_x.py | 2 | 1431 | # -*- coding: utf-8 -*-
#
# AWL simulator - instructions
#
# Copyright 2012-2014 Michael Buesch <m@bues.ch>
#
# 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
... | gpl-2.0 |
srikantbmandal/ansible | test/units/mock/procenv.py | 141 | 2636 | # (c) 2016, Matt Davis <mdavis@ansible.com>
# (c) 2016, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of ... | gpl-3.0 |
gustavoanatoly/flink | flink-libraries/flink-python/src/main/python/org/apache/flink/python/api/flink/functions/FilterFunction.py | 22 | 1482 | # ###############################################################################
# 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... | apache-2.0 |
alex/tablib | tablib/packages/xlrd3/formatting.py | 54 | 45677 | # Module for formatting information.
#
# Copyright © 2005-2008 Stephen John Machin, Lingfo Pty Ltd
# Copyright © 2005-2009 Stephen John Machin, Lingfo Pty Ltd
# This module is part of the xlrd3 package, which is released under
# a BSD-style licence.
# No part of the content of this file was derived from the wor... | mit |
pengdai2/sudoku | strategy/wxyz_wing.py | 1 | 2314 | #
# WXYZ-Wing strategy module
#
import itertools
from logger import *
from playbook import *
from sudoku import *
from almost_locked_set import *
class WXYZWing(AlmostLockedSet):
__metaclass__ = StrategyMeta
"""
WXYZ-WING can be considered as a group of 4 nodes and 4 hints,
that has exactly one non-... | apache-2.0 |
zero-ui/miniblink49 | third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/results.py | 64 | 8758 | """Results of coverage measurement."""
import os
from coverage.backward import set, sorted # pylint: disable=W0622
from coverage.misc import format_lines, join_regex, NoSource
from coverage.parser import CodeParser
class Analysis(object):
"""The results of analyzing a code unit."""
def __init__(s... | gpl-3.0 |
DirkHoffmann/indico | indico/core/oauth/__init__.py | 4 | 1247 | # This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
import os
from indico.core import signals
from indico.core.db import db
from .logger import logger
from ... | gpl-3.0 |
psav/cfme_tests | cfme/services/service_catalogs/__init__.py | 3 | 4282 | import importscan
import sentaku
from widgetastic.widget import ParametrizedView, Select, Text, View
from widgetastic_patternfly import Button, Input, BootstrapSelect
from widgetastic.utils import deflatten_dict, Parameter, ParametrizedString, VersionPick
from cfme.common import Taggable
from cfme.exceptions import ... | gpl-2.0 |
UltronAI/Deep-Learning | Pattern-Recognition/hw1-Linear-Classifier/scripts/svm/svm-20-2.py | 1 | 1329 | import numpy as np
import random
from sklearn import svm
trainDir = "../../traindata.txt"
testDir = "../../testdata.txt"
feature = [3, 4]
Xtrain = np.loadtxt(trainDir)[:, feature]
Ytrain = np.loadtxt(trainDir)[:, 10]
Xtest = np.loadtxt(testDir)[:, feature]
Ytest = np.loadtxt(testDir)[:, 10]
MIndex... | mit |
2014c2g12/c2g12 | c2wp/exts/w2/static/Brython2.0.0-20140209-164925/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=... | gpl-2.0 |
freedomtan/tensorflow | tensorflow/python/tpu/tpu_system_metadata.py | 15 | 8880 | # Copyright 2018 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 |
hdznrrd/parseiq | piq.py | 1 | 2070 | """\
Usage: piq.py dump [-o OFFSET] [-f FRAMES] FILE
piq.py findreftick [-o OFFSET] [-f FRAMES] FILE
piq.py findpattern [-o OFFSET] [-f FRAMES] PATTERN FILE
Arguments:
FILE Input file in complex64 NPY format
PATTERN Pattern in complex64 NPY format to be searched in FILE
Op... | mit |
baylee-d/osf.io | osf/utils/notifications.py | 5 | 4713 | from django.utils import timezone
from website.mails import mails
from website.reviews import signals as reviews_signals
from website.settings import DOMAIN, OSF_SUPPORT_EMAIL, OSF_CONTACT_EMAIL
from osf.utils.workflows import RegistrationModerationTriggers
def get_email_template_context(resource):
is_preprint = r... | apache-2.0 |
openstack/tempest | tempest/scenario/test_minbw_allocation_placement.py | 1 | 21973 | # Copyright (c) 2019 Ericsson
#
# 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 agree... | apache-2.0 |
Plain-Andy-legacy/android_external_chromium_org | chrome/common/extensions/docs/server2/samples_data_source.py | 25 | 2735 | # 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 logging
import traceback
from data_source import DataSource
from extensions_paths import EXAMPLES
from future import All, Future
from platform_ut... | bsd-3-clause |
win0x86/Lab | mitm/jinja2/lexer.py | 635 | 28393 | # -*- coding: utf-8 -*-
"""
jinja2.lexer
~~~~~~~~~~~~
This module implements a Jinja / Python combination lexer. The
`Lexer` class provided by this module is used to do some preprocessing
for Jinja.
On the one hand it filters out invalid operators like the bitshift
operators we don't allow... | gpl-3.0 |
storm-computers/odoo | addons/website_forum/models/res_users.py | 15 | 4764 | # -*- coding: utf-8 -*-
from datetime import datetime
import hashlib
from urllib import urlencode
from openerp import models, fields, api
class Users(models.Model):
_inherit = 'res.users'
def __init__(self, pool, cr):
init_res = super(Users, self).__init__(pool, cr)
self.SELF_WRITEABLE_FIEL... | agpl-3.0 |
tkasp/osmose-backend | modules/OsmBin.py | 4 | 25328 | #! /usr/bin/env python
#-*- coding: utf-8 -*-
###########################################################################
## ##
## Copyrights Etienne Chové <chove@crans.org> 2010 ##
## ... | gpl-3.0 |
ldjebran/robottelo | tests/foreman/api/test_audit.py | 2 | 7868 | """Unit tests for the ``audit`` paths.
:Requirement: Audit
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: API
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from nailgun import entities
from robottelo.datafactory import gen_string
from robottelo.decorators import tier1
from robo... | gpl-3.0 |
vikatory/kbengine | kbe/src/lib/python/Lib/__future__.py | 134 | 4584 | """Record of phased-in incompatible language changes.
Each line is of the form:
FeatureName = "_Feature(" OptionalRelease "," MandatoryRelease ","
CompilerFlag ")"
where, normally, OptionalRelease < MandatoryRelease, and both are 5-tuples
of the same form as sys.version_info:
(... | lgpl-3.0 |
qvicksilver/ansible | lib/ansible/runner/action_plugins/async.py | 141 | 1915 | # (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 |
saisai/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/applywatchlist_unittest.py | 124 | 2302 | # 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 f... | bsd-3-clause |
adamcandy/qgis-plugins-meshing-initial | dev/plugins/rastercalc/rastercalcengine.py | 3 | 11709 | # -*- coding: utf-8 -*-
##########################################################################
#
# QGIS-meshing plugins.
#
# Copyright (C) 2012-2013 Imperial College London and others.
#
# Please see the AUTHORS file in the main source directory for a
# full list of copyright holders.
#
# Dr Adam S. C... | lgpl-2.1 |
miguelinux/vbox | src/VBox/ValidationKit/common/webutils.py | 1 | 6470 | # -*- coding: utf-8 -*-
# $Id: webutils.py $
"""
Common Web Utility Functions.
"""
__copyright__ = \
"""
Copyright (C) 2012-2015 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This file is free software;
you can redistribute it and/or modify... | gpl-2.0 |
lekum/ansible | v1/ansible/runner/action_plugins/async.py | 141 | 1915 | # (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 |
vlegoff/tsunami | src/primaires/scripting/editeurs/edt_evenement.py | 1 | 9075 | # -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# 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
# ... | bsd-3-clause |
davidharrigan/django | django/db/migrations/graph.py | 351 | 10956 | from __future__ import unicode_literals
import warnings
from collections import deque
from functools import total_ordering
from django.db.migrations.state import ProjectState
from django.utils.datastructures import OrderedSet
from django.utils.encoding import python_2_unicode_compatible
from .exceptions import Circu... | bsd-3-clause |
GdZ/scriptfile | software/googleAppEngine/lib/grizzled/grizzled/test/io/TestPushback.py | 19 | 1420 | #!/usr/bin/python2.4
# $Id: 58917b33b42080b79747e553e2685ff5e3e2f84b $
#
# Nose program for testing grizzled.io classes/functions
# ---------------------------------------------------------------------------
# Imports
# ---------------------------------------------------------------------------
import google3
from gr... | mit |
abhisg/scikit-learn | sklearn/cluster/mean_shift_.py | 96 | 15434 | """Mean shift clustering algorithm.
Mean shift clustering aims to discover *blobs* in a smooth density of
samples. It is a centroid based algorithm, which works by updating candidates
for centroids to be the mean of the points within a given region. These
candidates are then filtered in a post-processing stage to elim... | bsd-3-clause |
fitoria/askbot-devel | askbot/management/commands/get_tag_stats.py | 19 | 9243 | import sys
import optparse
from django.core.management.base import BaseCommand, CommandError
from askbot import models
from askbot import const
def get_tag_lines(tag_marks, width = 25):
output = list()
line = ''
for name in tag_marks:
if line == '':
line = name
elif len(line) + ... | gpl-3.0 |
robertmattmueller/sdac-compiler | sympy/core/singleton.py | 29 | 2251 | """Singleton mechanism"""
from __future__ import print_function, division
from .core import Registry
from .assumptions import ManagedProperties
from .sympify import sympify
class SingletonRegistry(Registry):
"""
A map between singleton classes and the corresponding instances.
E.g. S.Exp == C.Exp()
"... | gpl-3.0 |
mecury421/gmock | scripts/generator/cpp/gmock_class.py | 135 | 6565 | #!/usr/bin/env python
#
# Copyright 2008 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 requi... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.