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 |
|---|---|---|---|---|---|
dougmolineux/APE_Server | deps/js/src/config/nsinstall.py | 13 | 5468 | # ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (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.mozilla.org/MPL/
#
# Softwa... | gpl-2.0 |
apechimp/servo | python/mach/mach/test/test_logger.py | 128 | 1244 | # 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 __future__ import absolute_import, unicode_literals
import logging
import time
import unittest
from mach.logging ... | mpl-2.0 |
sameetb-cuelogic/edx-platform-test | lms/envs/test.py | 7 | 15566 | # -*- coding: utf-8 -*-
"""
This config file runs the simplest dev environment using sqlite, and db-based
sessions. Assumes structure:
/envroot/
/db # This is where it'll write the database file
/edx-platform # The location of this repo
/log # Where we're going to write log files
"""
# We ... | agpl-3.0 |
tadamic/sokoenginepy | src/sokoenginepy/graph/board_graph.py | 1 | 16009 | from collections import deque
from enum import IntEnum
import networkx as nx
class GraphType(IntEnum):
DIRECTED = 0
DIRECTED_MULTI = 1
class BoardGraph:
"""
Board graph implementation using NetworkX.
NetworkX is pure Python graph library, doesn't depend on external binaries and is
easily i... | gpl-3.0 |
aronparsons/spacewalk | client/tools/rhncfg/config_client/rhncfgcli_channels.py | 7 | 1244 | #
# Copyright (c) 2008--2013 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... | gpl-2.0 |
PurpleBooth/python-vm | venv/lib/python2.7/site-packages/pip/vcs/__init__.py | 87 | 10798 | """Handles all VCS (version control) support"""
from __future__ import absolute_import
import logging
import os
import shutil
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip.exceptions import BadCommand
from pip.utils import (display_path, backup_dir, find_command,
rmtr... | mit |
jarn0ld/gnuradio | gr-digital/python/digital/qam_constellations.py | 25 | 11908 | #!/usr/bin/env python
#
# Copyright 2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# ... | gpl-3.0 |
dmitry-sobolev/ansible | test/runner/lib/classification.py | 23 | 14297 | """Classify changes in Ansible code."""
from __future__ import absolute_import, print_function
import os
import time
from lib.target import (
walk_module_targets,
walk_integration_targets,
walk_units_targets,
walk_compile_targets,
walk_sanity_targets,
load_integration_prefixes,
)
from lib.ut... | gpl-3.0 |
dorotan/pythontraining | env/Lib/site-packages/pkg_resources/_vendor/packaging/specifiers.py | 1107 | 28025 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import abc
import functools
import itertools
import re
from ._compat impo... | apache-2.0 |
MycChiu/tensorflow | tensorflow/contrib/distributions/python/ops/logistic.py | 10 | 7833 | # 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 |
mmccoy37/pypractice | gmLibrary.py | 2 | 1547 | #!/usr/bin/env pyhton
from csv import DictWriter
from gmusicapi import Mobileclient
from operator import itemgetter
def login():
logged_in = api.login('account@gmail.com', 'password')
# IMPORTANT: If you use secondary authentication for gogle music
# you need to generate an app specific password!
... | gpl-2.0 |
TechBK/horizon-dev | openstack_dashboard/dashboards/project/volumes/utils.py | 72 | 1093 | # 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
# distributed under t... | apache-2.0 |
stcorp/muninn | muninn/visitor.py | 1 | 1206 | #
# Copyright (C) 2014-2021 S[&]T, The Netherlands.
#
from __future__ import absolute_import, division, print_function
import inspect
class TypeVisitor(object):
def visit(self, visitable, *args, **kwargs):
for type in inspect.getmro(visitable):
try:
visit_func = getattr(self,... | bsd-3-clause |
stynr/diaphora | pygments/lexers/_cocoa_builtins.py | 23 | 39723 | # -*- coding: utf-8 -*-
"""
pygments.lexers._cocoa_builtins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This file defines a set of types used across Cocoa frameworks from Apple.
There is a list of @interfaces, @protocols and some other (structs, unions)
File may be also used as standalone generator for aboves... | gpl-2.0 |
arunkgupta/gramps | gramps/gui/filters/sidebar/_sourcesidebarfilter.py | 1 | 5586 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
#
# 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 you... | gpl-2.0 |
thehyve/variant | eggs/django-1.3.1-py2.7.egg/django/contrib/gis/admin/widgets.py | 321 | 4430 | from django.conf import settings
from django.contrib.gis.gdal import OGRException
from django.contrib.gis.geos import GEOSGeometry, GEOSException
from django.forms.widgets import Textarea
from django.template import loader, Context
from django.utils import translation
# Creating a template context that contains Django... | apache-2.0 |
miso-belica/sumy | sumy/summarizers/_summarizer.py | 1 | 1693 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division, print_function, unicode_literals
from collections import namedtuple
from operator import attrgetter
from ..utils import ItemsCount
from .._compat import to_unicode
from ..nlp.stemmers import null_stemmer
SentenceInfo = ... | apache-2.0 |
stutivarshney/Bal-Aveksha | WebServer/BalAvekshaEnv/lib/python3.5/site-packages/psycopg2/tests/test_fast_executemany.py | 16 | 9359 | #!/usr/bin/env python
#
# test_fast_executemany.py - tests for fast executemany implementations
#
# Copyright (C) 2017 Daniele Varrazzo <daniele.varrazzo@gmail.com>
#
# psycopg2 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 F... | gpl-3.0 |
projectcalico/calico-nova | nova/openstack/common/policy.py | 4 | 31058 | # -*- coding: utf-8 -*-
#
# Copyright (c) 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... | apache-2.0 |
Mdround/fastai-deeplearning1 | deeplearning1/nbs/vgg16bn.py | 5 | 4509 | from __future__ import division, print_function
import os, json
from glob import glob
import numpy as np
from scipy import misc, ndimage
from scipy.ndimage.interpolation import zoom
from keras import backend as K
from keras.layers.normalization import BatchNormalization
from keras.utils.data_utils import get_file
fro... | apache-2.0 |
matthewghgriffiths/nestedbasinsampling | examples/Gaussian/gaussian_system.py | 1 | 3374 |
import logging
import numpy as np
from pele.potentials import BasePotential
from nestedbasinsampling import (
NBS_system, vector_random_uniform_hypersphere, LOG_CONFIG)
class MyPot(BasePotential):
def __init__(self, M):
self.M = M
def getEnergy(self, coords):
return 0.5*np.d... | gpl-3.0 |
Laimiux/mydeatree | django/db/backends/__init__.py | 20 | 31623 | import decimal
try:
import thread
except ImportError:
import dummy_thread as thread
from threading import local
from django.conf import settings
from django.db import DEFAULT_DB_ALIAS
from django.db.backends import util
from django.db.transaction import TransactionManagementError
from django.utils import datet... | bsd-3-clause |
adtraub/isthatawordadam | main.py | 1 | 1545 | #!/usr/bin/env python
#
# Copyright 2007 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 o... | mit |
Dapid/scipy | scipy/cluster/tests/test_vq.py | 10 | 7737 | #! /usr/bin/env python
# David Cournapeau
# Last Change: Wed Nov 05 07:00 PM 2008 J
from __future__ import division, print_function, absolute_import
import os.path
import warnings
import numpy as np
from numpy.testing import (assert_array_equal, assert_array_almost_equal,
TestCase, run_module_suite, assert_raise... | bsd-3-clause |
cxcxcxcx/pyci | corpus/api.py | 2 | 5355 | # -*- coding: utf-8 -*-
# PyCi
#
# Copyright (c) 2009, The PyCi Project
# Authors: Wu Ke <ngu.kho@gmail.com>
# Chen Xing <cxcxcxcx@gmail.com>
# URL: <http://code.google.com/p/pyci>
# For license information, see COPYING
"""Gneral interface for a corpus reader
"""
__all__ = ["BaseCorpusReader"]
class BaseCo... | bsd-3-clause |
njncalub/hiddencloudserver | supersyncer/migrations/0001_initial.py | 1 | 16665 | # -*- 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 'UserProfile'
db.create_table('supersyncer_userprofile', (... | gpl-3.0 |
hbrunn/OpenUpgrade | addons/hr_timesheet_sheet/res_config.py | 389 | 2324 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
jwilk/pdf2djvu | tests/test-subsample.py | 1 | 1279 | # encoding=UTF-8
# Copyright © 2009-2017 Jakub Wilk <jwilk@jwilk.net>
#
# This file is part of pdf2djvu.
#
# pdf2djvu is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# pdf2djvu is distributed in t... | gpl-2.0 |
katiecheng/Bombolone | env/lib/python2.7/site-packages/pip/__init__.py | 7 | 9450 | #!/usr/bin/env python
import os
import optparse
import sys
import re
from pip.exceptions import InstallationError, CommandError, PipError
from pip.log import logger
from pip.util import get_installed_distributions, get_prog
from pip.vcs import git, mercurial, subversion, bazaar # noqa
from pip.baseparser import Conf... | bsd-3-clause |
alcobar/asuswrt-merlin | release/src/router/samba36/script/bisect-test.py | 66 | 3422 | #!/usr/bin/env python
# use git bisect to work out what commit caused a test failure
# Copyright Andrew Tridgell 2010
# released under GNU GPL v3 or later
from subprocess import call, check_call, Popen, PIPE
import os, tempfile, sys
from optparse import OptionParser
parser = OptionParser()
parser.add_option("", "--g... | gpl-2.0 |
zerolab/wagtail | wagtail/utils/setup.py | 24 | 2620 | import io
import json
import os
import subprocess
from setuptools import Command
from setuptools.command.bdist_egg import bdist_egg
from setuptools.command.sdist import sdist as base_sdist
from wagtail import __semver__
class assets_mixin:
def compile_assets(self):
try:
subprocess.check_cal... | bsd-3-clause |
andreaso/ansible | lib/ansible/modules/notification/mqtt.py | 70 | 6870 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, 2014, Jan-Piet Mens <jpmens () 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... | gpl-3.0 |
dskoda1/hpds | hpds/heaps/min_heap.py | 1 | 2674 | from math import floor
class MinHeap(object):
def __init__(self):
self._values = [None]
def insert(self, value):
self._values.append(value)
self._heapify(len(self._values) - 1)
def pop(self):
self._swap(len(self._values) - 1, 1)
ret = self._values.pop()
#... | bsd-2-clause |
jean/sentry | tests/sentry/tasks/test_deletion.py | 1 | 14808 | from __future__ import absolute_import
from datetime import datetime, timedelta
from uuid import uuid4
import pytest
from sentry.constants import ObjectStatus
from sentry.exceptions import DeleteAborted
from sentry.models import (
ApiApplication, ApiApplicationStatus, ApiGrant, ApiToken, Commit, CommitAuthor, En... | bsd-3-clause |
alphagov/service-domain-checker | webapp_tests.py | 1 | 1105 | #!/usr/bin/env python
import webapp
import unittest
class WebappTestExtractingServiceDomainsFromLinks(unittest.TestCase):
#def setUp(self):
# self.app = webapp.app.test_client()
def test_extract_service_domain_from_link(self):
status, domain = webapp.extract_service_domain_from_link('https://f... | mit |
neilhan/tensorflow | tensorflow/contrib/metrics/python/kernel_tests/confusion_matrix_ops_test.py | 21 | 6610 | # 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 |
xiaojunwu/crosswalk-test-suite | webapi/tct-download-tizen-tests/inst.xpk.py | 187 | 5919 | #!/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=u... | bsd-3-clause |
cesargtz/YecoraOdoo | addons/l10n_us/__openerp__.py | 341 | 1763 | # -*- 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 |
jtpereyda/boofuzz | boofuzz/primitives/dword.py | 1 | 1723 | import struct
import six
from boofuzz.primitives.bit_field import BitField
class DWord(BitField):
"""The 4 byte sized bit field primitive.
:type name: str, optional
:param name: Name, for referencing later. Names should always be provided, but if not, a default name will be given,
defaults to ... | gpl-2.0 |
cvegaj/ElectriCERT | venv3/lib/python3.6/site-packages/pip/commands/hash.py | 514 | 1597 | from __future__ import absolute_import
import hashlib
import logging
import sys
from pip.basecommand import Command
from pip.status_codes import ERROR
from pip.utils import read_chunks
from pip.utils.hashes import FAVORITE_HASH, STRONG_HASHES
logger = logging.getLogger(__name__)
class HashCommand(Command):
""... | gpl-3.0 |
Qwertycal/19520-Eye-Tracker | Filtering/eyeTrackingDemoGUI.py | 1 | 5553 | #author: Rachel Hutchinson
#date created: 28th March
#description: shows 4 stages in the eye tracking
#process, and includes the code from the original main
#calls other mehtods from their seperate scripts
#Import necessary modules
import matplotlib
matplotlib.use("TkAgg")
from matplotlib import pyplot as plt
from Tki... | gpl-2.0 |
knehez/edx-platform | common/lib/calc/calc/tests/test_preview.py | 257 | 8723 | # -*- coding: utf-8 -*-
"""
Unit tests for preview.py
"""
import unittest
from calc import preview
import pyparsing
class LatexRenderedTest(unittest.TestCase):
"""
Test the initializing code for LatexRendered.
Specifically that it stores the correct data and handles parens well.
"""
def test_sim... | agpl-3.0 |
40123112/w17exam | static/Brython3.1.3-20150514-095342/Lib/site-packages/header.py | 91 | 2444 | from browser import document as doc
from browser.html import *
trans_menu = {
'menu_console':{'en':'Console','es':'Consola','fr':'Console', 'pt':'Console'},
'menu_editor':{'en':'Editor','es':'Editor','fr':'Editeur', 'pt':'Editor'},
'menu_gallery':{'en':'Gallery','es':'Galería','fr':'Galerie', 'pt':'Galeri... | agpl-3.0 |
nicky-ji/edx-nicky | common/djangoapps/course_action_state/models.py | 10 | 4293 | """
Models for course action state
If you make changes to this model, be sure to create an appropriate migration
file and check it in at the same time as your model changes. To do that,
1. Go to the edx-platform dir
2. ./manage.py cms schemamigration course_action_state --auto description_of_your_change
3. It adds th... | agpl-3.0 |
shams169/pythonProject | ContactsDir/env/lib/python3.6/site-packages/jinja2/_stringdefs.py | 121 | 589381 | # -*- coding: utf-8 -*-
"""
jinja2._stringdefs
~~~~~~~~~~~~~~~~~~
Strings of all Unicode characters of a certain category.
Used for matching in Unicode-aware languages. Run to regenerate.
Inspired by chartypes_create.py from the MoinMoin project, original
implementation from Pygments.
:co... | mit |
jmhsi/justin_tinker | data_science/courses/learning_dl_packages/models/research/pcl_rl/env_spec.py | 7 | 5969 | # 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 applicab... | apache-2.0 |
broferek/ansible | lib/ansible/module_utils/network/ios/facts/lldp_global/lldp_global.py | 19 | 3032 | #
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The ios lldp_global fact class
It is in this file the configuration is collected from the device
for a given resource, parsed, and the facts tree is populated
based on th... | gpl-3.0 |
vicnet/weboob | modules/vicsec/test.py | 2 | 1171 | # -*- coding: utf-8 -*-
# Copyright(C) 2015 Oleg Plakhotniuk
#
# This file is part of a weboob module.
#
# This weboob module 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 th... | lgpl-3.0 |
makhdumi/robomongo | src/third-party/mongodb/src/third_party/v8/tools/gdb-v8-support.py | 116 | 4265 | # Copyright 2011 the V8 project authors. 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 conditi... | gpl-3.0 |
feroda/gasistafelice | gasistafelice/rest/views/blocks/curtail.py | 3 | 9094 | from django.utils.translation import ugettext as _, ugettext_lazy as _lazy
from django.core import urlresolvers
from django.db import transaction
from gasistafelice.rest.views.blocks.base import BlockSSDataTables, ResourceBlockAction, CREATE_PDF
from gasistafelice.lib.shortcuts import render_to_xml_response, render_t... | agpl-3.0 |
spurin/xmldataset | examples/example4.py | 1 | 2442 | import xmldataset
import pprint
# Setup Pretty Printing
ppsetup = pprint.PrettyPrinter(indent=4)
pp = ppsetup.pprint
xml = """<?xml version="1.0"?>
<catalog>
<shop number="1">
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<... | bsd-3-clause |
greyhill/pygrouse | grouse/__init__.py | 1 | 1071 | import numpy as np
import numpy.linalg as la
class GROUSE(object):
def __init__(self, n, d, U = None, eta = None):
self.n = n
self.d = d
if U is not None:
self.U = U
else:
self.U = np.eye(N=self.n, M=self.d)
if eta is not None:
self.eta0... | mit |
jni/networkx | networkx/generators/random_graphs.py | 3 | 29650 | # -*- coding: utf-8 -*-
"""
Generators for random graphs.
"""
# Copyright (C) 2004-2011 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
__author__ = "\n".join(['Aric Hagberg (hagberg@lanl.gov)',
... | bsd-3-clause |
qedsoftware/commcare-hq | corehq/apps/locations/urls.py | 1 | 2056 | from django.conf.urls import url
from .views import (
LocationsListView,
NewLocationView,
EditLocationView,
LocationImportView,
LocationImportStatusView,
LocationTypesView,
LocationFieldsView,
DowngradeLocationsView,
default, child_locations_for_select2, location_importer_job_poll,
... | bsd-3-clause |
emorozov/django-basic-apps | basic/groups/views/pages.py | 10 | 2903 | from django.shortcuts import get_object_or_404
from basic.groups.decorators import *
from basic.groups.models import *
from basic.groups.forms import *
from basic.tools.shortcuts import render, redirect
def page_list(request, slug, template_name='groups/pages/page_list.html'):
"""
Returns a list of pages for... | bsd-3-clause |
bpradipt/rethinkdb | test/common/http_support/flask/app.py | 427 | 76782 | # -*- coding: utf-8 -*-
"""
flask.app
~~~~~~~~~
This module implements the central WSGI application object.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
from threading import Lock
from datetime import timedelta
from itertools import... | agpl-3.0 |
mhdaimi/paramiko | paramiko/pipe.py | 44 | 4005 | # Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (a... | lgpl-2.1 |
alonbl/ovirt-host-deploy | src/plugins/ovirt-host-common/hosted-engine/configureha.py | 1 | 3975 | #
# ovirt-host-deploy -- ovirt host deployer
# Copyright (C) 2015 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) ... | lgpl-2.1 |
aeijdenberg/certificate-transparency | python/ct/client/async_log_client_test.py | 5 | 15724 | #!/usr/bin/env trial
import gflags
import json
import mock
import sys
import urlparse
from ct.client import log_client
from ct.client import log_client_test_util as test_util
from ct.client.db import database
from twisted.internet import defer
from twisted.internet import task
from twisted.internet import reactor
from... | apache-2.0 |
icdishb/scikit-learn | examples/applications/plot_tomography_l1_reconstruction.py | 45 | 5463 | """
======================================================================
Compressive sensing: tomography reconstruction with L1 prior (Lasso)
======================================================================
This example shows the reconstruction of an image from a set of parallel
projections, acquired along dif... | bsd-3-clause |
boegel/easybuild-framework | test/framework/sandbox/easybuild/easyblocks/f/foofoo.py | 2 | 1747 | ##
# Copyright 2009-2020 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... | gpl-2.0 |
GustavoHennig/ansible | lib/ansible/modules/cloud/amazon/lambda_alias.py | 77 | 12327 | #!/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 |
anant-dev/django | tests/prefetch_related/test_uuid.py | 291 | 4347 | from __future__ import unicode_literals
from django.test import TestCase
from .models import Flea, House, Person, Pet, Room
class UUIDPrefetchRelated(TestCase):
def test_prefetch_related_from_uuid_model(self):
Pet.objects.create(name='Fifi').people.add(
Person.objects.create(name='Ellen'),
... | bsd-3-clause |
nupic-community/nostradamIQ | NLP/TwitterSearch/TwitterSearch/TwitterSearchException.py | 8 | 1457 | # -*- coding: utf-8 -*-
class TwitterSearchException(Exception):
"""
This class is all about exceptions (surprise, surprise!).
All exception based directly on TwitterSearch will consist of
a **code** and a **message** describing the reason of the
exception shortly.
"""
# HTTP status codes... | gpl-3.0 |
jmcorgan/gnuradio | gr-filter/python/filter/qa_pfb_arb_resampler.py | 40 | 8409 | #!/usr/bin/env python
#
# Copyright 2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your optio... | gpl-3.0 |
ElementsProject/elements | test/functional/test_framework/test_node.py | 1 | 32998 | #!/usr/bin/env python3
# Copyright (c) 2017-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Class for bitcoind node under test"""
import contextlib
import decimal
import errno
from enum import E... | mit |
madj4ck/ansible | lib/ansible/cli/pull.py | 8 | 8894 | # (c) 2012, 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) any lat... | gpl-3.0 |
johren/RackHD | test/modules/auth2_0.py | 10 | 1608 | from config.api2_0_config import config
from config.auth import *
from config.settings import *
from logger import Log
from json import loads, dumps
import pexpect
import pxssh
import subprocess
LOG = Log(__name__)
class Auth(object):
"""
Class to abstract python authentication functionality
"""
@stat... | apache-2.0 |
lberruti/ansible-modules-extras | messaging/rabbitmq_vhost.py | 57 | 4185 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Chatham Financial <oss@chathamfinancial.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3... | gpl-3.0 |
namccart/pybombs | pybombs/commands/autoconfig.py | 3 | 4228 | #
# Copyright 2016 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later version.
#
#... | gpl-3.0 |
roisagiv/webrtc-ios | tools/gyp/test/sibling/gyptest-all.py | 151 | 1061 | #!/usr/bin/env python
# Copyright (c) 2009 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.
"""
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('build/all.gyp', chdir='src')
test.build('build/all.gyp', test.ALL, chdir='... | bsd-3-clause |
LingxiaoJIA/gem5 | util/streamline/m5stats2streamline.py | 37 | 42084 | #!/usr/bin/env python
# Copyright (c) 2012, 2014 ARM Limited
# 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 |
SteveDiamond/cvxpy | cvxpy/cvxcore/tests/python/364A_scripts/perm_matrix.py | 4 | 6411 | # Data file for graph isomorphism problem. A and B are adjacency matrices
# of two isomorphic graphs
import numpy as np
from cvxpy import *
import time
np.random.seed(0)
ANSWERS = []
TIME = 0
A = np.array(np.mat(
'0 1 0 0 0 0 1 0 0 0 1 1 1 0 0 1 0 1 1 0 1 1 0 1 0 1 1 1 0 1;\
1 0 0 0 ... | gpl-3.0 |
wintermind/pypedal | PyPedal/adodb_odbc_mssql.py | 2 | 1233 | ########################################################################
# Vers 2.02 21 May 2007, (c)2004-2007 John Lim (jlim#natsoft.com.my) All Rights Reserved
# Released under a BSD-style license. See LICENSE.txt.
# Download: http://adodb.sourceforge.net/#pydownload
##################################################... | gpl-2.0 |
mustafat/odoo-1 | addons/website_event/controllers/main.py | 209 | 11805 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
mikkylok/mikky.lu | venv/lib/python2.7/site-packages/markupsafe/_native.py | 1243 | 1187 | # -*- coding: utf-8 -*-
"""
markupsafe._native
~~~~~~~~~~~~~~~~~~
Native Python implementation the C module is not compiled.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from markupsafe import Markup
from markupsafe._compat import text_type
def escape(... | mit |
pemami4911/Sub8 | command/sub8_alarm/sub8_alarm/alarms/thruster_out.py | 1 | 1157 | import rospy
from sub8_ros_tools import wait_for_param
from sub8_msgs.srv import UpdateThrusterLayout
class ThrusterOut(object):
alarm_name = 'thruster_out'
def __init__(self):
# Keep some knowledge of which thrusters we have working
self.thruster_layout = wait_for_param('busses')
self... | mit |
todaychi/hue | desktop/core/ext-py/kazoo-2.0/kazoo/client.py | 35 | 49594 | """Kazoo Zookeeper Client"""
import inspect
import logging
import os
import re
import warnings
from collections import defaultdict, deque
from functools import partial
from os.path import split
from kazoo.exceptions import (
AuthFailedError,
ConfigurationError,
ConnectionClosedError,
ConnectionLoss,
... | apache-2.0 |
HybridF5/jacket | jacket/tests/compute/functional/api_sample_tests/test_virtual_interfaces.py | 1 | 2321 | # 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 |
our-city-app/oca-backend | src-test/rogerthat_tests/mobicage/bizz/test_update_friends.py | 1 | 6348 | # -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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 appl... | apache-2.0 |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/end_to_end_ml/labs/serving/application/lib/oauth2client/contrib/django_util/decorators.py | 59 | 5564 | # 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 ... | apache-2.0 |
Adnn/django | tests/backends/tests.py | 59 | 47291 | # -*- coding: utf-8 -*-
# Unit and doctests for specific database backends.
from __future__ import unicode_literals
import copy
import datetime
import re
import threading
import unittest
import warnings
from decimal import Decimal, Rounded
from django.conf import settings
from django.core.exceptions import Improperly... | bsd-3-clause |
scraperwiki/spreadsheet-download-tool | pyexcelerate/Style.py | 1 | 2500 | from . import six
from . import Font, Fill, Format
from .Utility import Utility
class Style(object):
_DEFAULT_FORMAT = Format.Format()
_DEFAULT_FILL = Fill.Fill()
_DEFAULT_FONT = Font.Font()
def __init__(self, font=None, fill=None, format=None):
self._font = font
self._fill = fill
self._format = format
@pr... | bsd-2-clause |
svanschalkwyk/datafari | debian7/elk/kibana/node/lib/node_modules/npm/node_modules/node-gyp/gyp/tools/pretty_gyp.py | 2618 | 4756 | #!/usr/bin/env python
# Copyright (c) 2012 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.
"""Pretty-prints the contents of a GYP file."""
import sys
import re
# Regex to remove comments when we're counting braces.
COMMENT_RE = ... | apache-2.0 |
koushikcgit/xen | tools/python/xen/web/unix.py | 44 | 2251 | #============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope th... | gpl-2.0 |
shepdelacreme/ansible | lib/ansible/modules/network/nxos/nxos_acl_interface.py | 103 | 5736 | #!/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 distribut... | gpl-3.0 |
tri2sing/LinearAlgebraPython | tester_classes.py | 4 | 1460 | from vec import Vec
from mat import Mat
class DummyItem(object):
def __init__(self):
self.multiplications = []
def __getattr__(self, _): return self
def __getitem__(self, _): return self
def __mul__(self, v):
self.multiplications.append(v)
return v
def __rmul__(self, v):
... | apache-2.0 |
avatarnewyork/daily_harvest | packages/requests/packages/chardet/langbulgarianmodel.py | 2965 | 12784 | ######################## 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 |
vsajip/django | django/contrib/sessions/backends/signed_cookies.py | 7 | 3047 | try:
from django.utils.six.moves import cPickle as pickle
except ImportError:
import pickle
from django.conf import settings
from django.core import signing
from django.contrib.sessions.backends.base import SessionBase
class PickleSerializer(object):
"""
Simple wrapper around pickle to be used in si... | bsd-3-clause |
mfherbst/spack | var/spack/repos/builtin/packages/texinfo/package.py | 2 | 2031 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
esakellari/my_root_for_test | interpreter/llvm/src/utils/lit/lit/ShUtil.py | 83 | 12179 | from __future__ import absolute_import
import itertools
import lit.util
from lit.ShCommands import Command, Pipeline, Seq
class ShLexer:
def __init__(self, data, win32Escapes = False):
self.data = data
self.pos = 0
self.end = len(data)
self.win32Escapes = win32Escapes
def eat(... | lgpl-2.1 |
nickhdamico/py | lib/yaml/reader.py | 424 | 6746 | # This module contains abstractions for the input stream. You don't have to
# looks further, there are no pretty code.
#
# We define two classes here.
#
# Mark(source, line, column)
# It's just a record and its only use is producing nice error messages.
# Parser does not use it for any other purposes.
#
# Reader(so... | gpl-3.0 |
pllim/astropy | astropy/coordinates/tests/test_skyoffset_transformations.py | 4 | 14857 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from astropy import units as u
from astropy.coordinates.distances import Distance
from astropy.coordinates.builtin_frames import ICRS, FK5, Galactic, AltAz, SkyOffsetFrame
from astropy.coordinates ... | bsd-3-clause |
canturkisci/agentless-system-crawler | crawler/iemit_plugin.py | 3 | 2024 | import cStringIO
from yapsy.IPlugin import IPlugin
from formatters import (write_in_csv_format,
write_in_json_format,
write_in_graphite_format,
write_in_logstash_format)
from utils.crawler_exceptions import (EmitterUnsupportedFormat)
class IEmitt... | apache-2.0 |
linjoahow/W16_test1 | static/Brython3.1.1-20150328-091302/Lib/threading.py | 730 | 45641 | """Thread module emulating a subset of Java's threading model."""
import sys as _sys
import _thread
from time import sleep as _sleep
try:
from time import monotonic as _time
except ImportError:
from time import time as _time
from traceback import format_exc as _format_exc
from _weakrefset import WeakSet
# No... | gpl-3.0 |
horatii/googletest | test/gtest_shuffle_test.py | 3023 | 12549 | #!/usr/bin/env python
#
# Copyright 2009 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... | bsd-3-clause |
BehavioralInsightsTeam/edx-platform | openedx/core/djangoapps/user_api/management/commands/create_user_gdpr_testing.py | 14 | 6558 | """
Create a user with GDPR P1 PII for manual testing.
Enrolls the user in the DemoX course.
Optionally takes in username, email, and course UUID arguments.
"""
from __future__ import unicode_literals
from datetime import datetime
from uuid import uuid4
from pytz import UTC
from django.core.management.base import Ba... | agpl-3.0 |
javilonas/NCam | cross/android-toolchain/lib/python2.7/encodings/raw_unicode_escape.py | 852 | 1208 | """ Python 'raw-unicode-escape' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
class Codec(codecs.Codec):
# Note: Binding these as C functions will result in the class not
# converting them to methods. This is ... | gpl-3.0 |
Irrational-Encoding-Wizardry/yuuno | yuuno_ipython/ipy_vs/vs_feature.py | 2 | 1102 | # -*- encoding: utf-8 -*-
# Yuuno - IPython + VapourSynth
# Copyright (C) 2017 StuxCrystal (Roland Netzsch <stuxcrystal@encode.moe>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, ei... | lgpl-3.0 |
jillesme/phantomjs | src/qt/qtwebkit/Tools/TestResultServer/generate_builders_json_unittest.py | 119 | 5404 | #!/usr/bin/env python
# Copyright (C) 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 ... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.