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 |
|---|---|---|---|---|---|
ApptuitAI/xcollector | collectors/lib/hadoop_http.py | 1 | 3440 | #!/usr/bin/env python
# This file is part of tcollector.
# Copyright (C) 2011-2013 The tcollector Authors.
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the Licen... | lgpl-3.0 |
mzizzi/ansible | lib/ansible/modules/files/xattr.py | 41 | 6746 | #!/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 |
zerkh/GroundHog | groundhog/layers/basic.py | 19 | 22520 | """
Parent classes describing a layer, model or operator
"""
__docformat__ = 'restructedtext en'
__authors__ = ("Razvan Pascanu "
"KyungHyun Cho "
"Caglar Gulcehre ")
__contact__ = "Razvan Pascanu <r.pascanu@gmail>"
import numpy
import copy
import cPickle as pkl
import logging
import th... | bsd-3-clause |
spookylukey/django-autocomplete-light | autocomplete_light/autocomplete/model.py | 1 | 4383 | from django.db.models import Q
__all__ = ('AutocompleteModel', )
class AutocompleteModel(object):
"""
Autocomplete which considers choices as a queryset.
choices
A queryset.
limit_choices
Maximum number of choices to display.
search_fields
Fields to search in, configurabl... | mit |
jimcunderwood/MissionPlanner | Lib/unittest/case.py | 42 | 43140 | """Test case implementation"""
import collections
import sys
import functools
import difflib
import pprint
import re
import warnings
from . import result
from .util import (
strclass, safe_repr, unorderable_list_difference,
_count_diff_all_purpose, _count_diff_hashable
)
__unittest = True
... | gpl-3.0 |
cortedeltimo/SickRage | lib/tzlocal/win32.py | 11 | 3157 | try:
import _winreg as winreg
except ImportError:
import winreg
from tzlocal.windows_tz import win_tz
import pytz
_cache_tz = None
def valuestodict(key):
"""Convert a registry key's values to a dictionary."""
dict = {}
size = winreg.QueryInfoKey(key)[1]
for i in range(size):
data = wi... | gpl-3.0 |
pferreir/indico | indico/modules/attachments/__init__.py | 4 | 2521 | # 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.
from flask import session
from indico.core import signals
from indico.core.logger import Logger
from indi... | mit |
mozman/ezdxf | tests/test_06_math/test_606_convexhull.py | 1 | 5800 | # Author: mozman
# Purpose: test convex_hull_2d
# Created: 28.02.2010
# License: MIT License
import pytest
from ezdxf.math import convex_hull_2d
from io import StringIO
def import_asc_coords(file_obj):
""" Import allplan asc-format point file.
returns: a dictionary of Coordinates ('name': Coordinate)
""... | mit |
kaustubh-kabra/modified-xen | tools/python/xen/xm/setenforce.py | 43 | 2560 | #============================================================================
# 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 |
acfogarty/espressopp | src/tools/vmd.py | 7 | 5181 | # Copyright (C) 2012,2013
# Max Planck Institute for Polymer Research
# Copyright (C) 2008,2009,2010,2011
# Max-Planck-Institute for Polymer Research & Fraunhofer SCAI
#
# This file is part of ESPResSo++.
#
# ESPResSo++ is free software: you can redistribute it and/or modify
# it under the terms of the G... | gpl-3.0 |
gorgorom/p2pool-gor-alts | SOAPpy/Client.py | 289 | 19821 | from __future__ import nested_scopes
"""
################################################################################
#
# SOAPpy - Cayce Ullman (cayce@actzero.com)
# Brian Matthews (blm@actzero.com)
# Gregory Warnes (Gregory.R.Warnes@Pfizer.com)
# Christopher Blunck (blunck... | gpl-3.0 |
vipulroxx/sympy | sympy/physics/quantum/circuitplot.py | 58 | 12941 | """Matplotlib based plotting of quantum circuits.
Todo:
* Optimize printing of large circuits.
* Get this to work with single gates.
* Do a better job checking the form of circuits to make sure it is a Mul of
Gates.
* Get multi-target gates plotting.
* Get initial and final states to plot.
* Get measurements to plo... | bsd-3-clause |
ShassAro/ShassAro | Bl_project/blVirtualEnv/lib/python2.7/site-packages/rest_framework/validators.py | 8 | 9383 | """
We perform uniqueness checks explicitly on the serializer class, rather
the using Django's `.full_clean()`.
This gives us better separation of concerns, allows us to use single-step
object creation, and makes it possible to switch between using the implicit
`ModelSerializer` class and an equivalent explicit `Seria... | gpl-2.0 |
aleisalem/Aion | tools/visualizeFeatureVectors.py | 1 | 5900 | #!/usr/bin/python
from Aion.data_generation.reconstruction.Numerical import *
from Aion.data_inference.visualization.visualizeData import *
from Aion.utils.graphics import *
from Aion.utils.data import *
import pickledb
import glob, sys, time, os, argparse, hashlib
def defineArguments():
parser = argparse.Argum... | gpl-3.0 |
nostradamIQ/webapp | services/twitter/server.py | 6 | 1750 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# serves the twitter files in redis via REST API on URL:8088
from cgi import parse_qs
import requests
import datetime
import os
import os.path
import redis
import json
REDIS = redis.Redis()
# Format:
# HOUR = HH (str)
# DATE = DD-MM-YYYY (str)
# ARRAY = key for keywords... | gpl-3.0 |
chinmaygarde/mojo | tools/android/findbugs_plugin/test/run_findbugs_plugin_tests.py | 63 | 3602 | #!/usr/bin/env python
#
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This is used to test the findbugs plugin, it calls
# build/android/pylib/utils/findbugs.py to analyze the classes in
# org.chro... | bsd-3-clause |
BurtBiel/azure-cli | src/command_modules/azure-cli-network/azure/cli/command_modules/network/mgmt_nic/lib/models/template_link.py | 1 | 1664 | #---------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#---------------------------------------------------------------------... | mit |
memtoko/django | tests/auth_tests/urls.py | 37 | 4594 | from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth import views
from django.contrib.auth.decorators import login_required
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.auth.urls import urlpatterns
from django.contrib.messages.api import inf... | bsd-3-clause |
nrc/servo | tests/wpt/css-tests/tools/wptserve/tests/functional/base.py | 293 | 1831 | import base64
import logging
import os
import unittest
import urllib
import urllib2
import urlparse
import wptserve
logging.basicConfig()
here = os.path.split(__file__)[0]
doc_root = os.path.join(here, "docroot")
class Request(urllib2.Request):
def __init__(self, *args, **kwargs):
urllib2.Request.__init... | mpl-2.0 |
eranchetz/nupic | tests/unit/nupic/data/generators/anomalyzer_test.py | 35 | 14938 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | agpl-3.0 |
artmusic0/theano-learning.part02 | cPickle_test/cPickle_out-v3.py | 1 | 2430 | # -*- coding: utf-8 -*-
"""
Created on Mon Dec 07 11:30:17 2015
@author: AkishinoShiame
"""
import cPickle, gzip, theano.tensor
### file out put code below
try:
out1 = open("CR_data-train_set.pic.txt","w")
out2 = open("CR_data-train_set.lab.txt","w")
out3 = open("CR_data-valid_set.pic.txt","w")
out4 ... | gpl-3.0 |
michalliu/OpenWrt-Firefly-Libraries | staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/shutil.py | 15 | 39249 | """Utility functions for copying and archiving files and directory trees.
XXX The functions here don't copy the resource fork or other metadata on Mac.
"""
import os
import sys
import stat
from os.path import abspath
import fnmatch
import collections
import errno
import tarfile
try:
import bz2
del bz2
_... | gpl-2.0 |
Griffen8280/PandoraPi_Website | wificonfig.py | 1 | 1775 | #!/usr/bin/python
#import Libraries
import cgi
import cgitb
import time
import thread
import subprocess
# Create instance of FieldStorage
form = cgi.FieldStorage()
# Get data from fields
wifif = form.getvalue('wifi')
wifif = '"%s"'%wifif
passwordf = form.getvalue('password')
passwordf = '"%s"'%passwordf
sudo = '/us... | gpl-3.0 |
Vassy/odoo | addons/calendar/__openerp__.py | 33 | 2108 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | agpl-3.0 |
allanino/nupic | tests/unit/nupic/data/inference_shifter_test.py | 35 | 5836 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | agpl-3.0 |
edx/lettuce | tests/integration/lib/Django-1.2.5/tests/regressiontests/m2m_through_regress/tests.py | 38 | 5744 | try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from django.core import management
from django.contrib.auth.models import User
from django.test import TestCase
from models import (Person, Group, Membership, UserMembership,
Car, Driver, CarDriver)
cla... | gpl-3.0 |
ruffoa/Qhacks2016 | Sigma-Securities/src/sentiment/text_extract.py | 1 | 1390 |
# Load the AlchemyAPI module code.
import AlchemyAPI
# Create an AlchemyAPI object.
alchemyObj = AlchemyAPI.AlchemyAPI()
# Load the API key from disk.
alchemyObj.loadAPIKey("api_key.txt");
'''
# Extract a title from a web URL.
result = alchemyObj.URLGetTitle("http://www.techcrunch.com/");
print result
'''
# Ex... | mit |
minhphung171093/GreenERP | openerp/addons/hr_timesheet/report/hr_timesheet_report.py | 10 | 2157 |
from openerp import tools, models, fields
from openerp.addons.decimal_precision import decimal_precision as dp
class hr_timesheet_report(models.Model):
_name = "hr.timesheet.report"
_description = "Timesheet"
_auto = False
_rec_name = "date"
date = fields.Date('Date', readonly=True)
product_... | gpl-3.0 |
konklone/shaaaaaaaaaaaaa | fabfile.py | 3 | 1652 | import time
from fabric.api import run, execute, env
environment = "production"
env.use_ssh_config = True
env.hosts = ["shaaaaa"]
branch = "master"
repo = "git@github.com:konklone/shaaaaaaaaaaaaa.git"
username = "shaaaaa"
home = "/home/%s/%s" % (username, username)
shared_path = "%s/shared" % home
versions_path = "... | bsd-3-clause |
jkyeung/XlsxWriter | dev/docs/source/conf.py | 1 | 9926 | # -*- coding: utf-8 -*-
#
# XlsxWriter documentation build configuration file, created by
# sphinx-quickstart on Mon Jan 28 00:12:14 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# ... | bsd-2-clause |
chrisfranzen/django | django/contrib/flatpages/tests/forms.py | 113 | 4014 | from __future__ import unicode_literals
from django.conf import settings
from django.contrib.flatpages.forms import FlatpageForm
from django.contrib.flatpages.models import FlatPage
from django.test import TestCase
from django.test.utils import override_settings
from django.utils import translation
@override_settings... | bsd-3-clause |
jart/tensorflow | tensorflow/python/kernel_tests/distributions/kullback_leibler_test.py | 31 | 5251 | # 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 |
srvg/ansible | lib/ansible/plugins/become/runas.py | 29 | 2455 | # -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
name: runas
short_description: Run As user
... | gpl-3.0 |
stewartpark/django | django/utils/regex_helper.py | 432 | 12673 | """
Functions for reversing a regular expression (used in reverse URL resolving).
Used internally by Django and not intended for external use.
This is not, and is not intended to be, a complete reg-exp decompiler. It
should be good enough for a large class of URLS, however.
"""
from __future__ import unicode_literals
... | bsd-3-clause |
CruiseDevice/coala | coalib/bearlib/aspects/meta.py | 10 | 3296 | import re
from inspect import getmembers, signature
from coala_utils.decorators import generate_repr
from .base import aspectbase
from .docs import Documentation
from .exceptions import AspectTypeError
from .taste import Taste
class aspectclass(type):
"""
Metaclass for aspectclasses.
Root aspectclass ... | agpl-3.0 |
ArteliaTelemac/PostTelemac | PostTelemac/meshlayerlibs/pyqtgraph/parametertree/parameterTypes.py | 2 | 25391 | from ..Qt import QtCore, QtGui
from ..python2_3 import asUnicode
from .Parameter import Parameter, registerParameterType
from .ParameterItem import ParameterItem
from ..widgets.SpinBox import SpinBox
from ..widgets.ColorButton import ColorButton
from ..colormap import ColorMap
from .. import pixmaps as pixmaps
from .. ... | gpl-3.0 |
LiveZenLK/CeygateERP | addons/product/pricelist.py | 10 | 19402 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from itertools import chain
import time
from openerp import tools
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT
from openerp.osv import fields, osv
from openerp.tools.translate import _
import openerp.addons.dec... | gpl-3.0 |
radzhome/AWS-ElasticBeanstalk-CLI | eb/linux/python3/scli/cli_parse.py | 4 | 8680 | #!/usr/bin/env python
# ==============================================================================
# Copyright 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Amazon Software License (the "License"). You may not use
# this file except in compliance with the License. A copy of th... | apache-2.0 |
kubeflow/pipelines | samples/core/XGBoost/xgboost_sample.py | 1 | 3056 | import kfp
from kfp import components
chicago_taxi_dataset_op = components.load_component_from_url('https://raw.githubusercontent.com/kubeflow/pipelines/e3337b8bdcd63636934954e592d4b32c95b49129/components/datasets/Chicago%20Taxi/component.yaml')
convert_csv_to_apache_parquet_op = components.load_component_from_url('h... | apache-2.0 |
vaginessa/python-gsmmodem | gsmmodem/exceptions.py | 13 | 4484 | """ Module defines exceptions used by gsmmodem """
class GsmModemException(Exception):
""" Base exception raised for error conditions when interacting with the GSM modem """
class TimeoutException(GsmModemException):
""" Raised when a write command times out """
def __init__(self, data=None):
... | lgpl-3.0 |
Edraak/edx-platform | common/djangoapps/config_models/admin.py | 26 | 7283 | """
Admin site models for managing :class:`.ConfigurationModel` subclasses
"""
from django.forms import models
from django.contrib import admin
from django.contrib.admin import ListFilter
from django.core.cache import caches, InvalidCacheBackendError
from django.core.urlresolvers import reverse
from django.http import... | agpl-3.0 |
fjbatresv/odoo | addons/document/report/__init__.py | 444 | 1068 | # -*- 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 |
ARMmbed/yotta | yotta/lib/access_common.py | 3 | 12507 | # Copyright 2014 ARM Limited
#
# Licensed under the Apache License, Version 2.0
# See LICENSE file for details.
# standard library modules, , ,
import tarfile
import logging
import os
import hashlib
import tempfile
import shutil
import functools
import random
import errno
# version, , represent versions and specifica... | apache-2.0 |
joksnet/youtube-dl | youtube_dl/extractor/newgrounds.py | 5 | 1287 | import json
import re
from .common import InfoExtractor
from ..utils import determine_ext
class NewgroundsIE(InfoExtractor):
_VALID_URL = r'(?:https?://)?(?:www\.)?newgrounds\.com/audio/listen/(?P<id>\d+)'
_TEST = {
u'url': u'http://www.newgrounds.com/audio/listen/549479',
u'file': u'549479.m... | unlicense |
flavour/tldrmp | modules/geopy/geocoders/dot_us.py | 46 | 3194 | import getpass
from urllib import urlencode
from urllib2 import urlopen
from geopy.geocoders.base import Geocoder
from geopy import util
import csv
class GeocoderDotUS(Geocoder):
def __init__(self, username=None, password=None, format_string='%s'):
if username and (password is None):
password =... | mit |
j00bar/ansible | lib/ansible/modules/monitoring/stackdriver.py | 77 | 7327 | #!/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 |
gmarkall/numba | numba/tests/test_import.py | 1 | 2535 | import unittest
import subprocess
import sys
from numba.tests.support import TestCase
class TestNumbaImport(TestCase):
"""
Test behaviour of importing Numba.
"""
def run_in_subproc(self, code, flags=None):
if flags is None:
flags = []
cmd = [sys.executable,] + flags + ["-... | bsd-2-clause |
YannThorimbert/PyWorld2D | saveload/io.py | 1 | 3224 | import pickle, os
import thorpy
from PyWorld2D.mapobjects.objects import MapObject
def ask_save(me):
choice = thorpy.launch_binary_choice("Do you want to save this map ?")
default_fn = me.get_fn().replace(".map","")
if choice:
fn = thorpy.get_user_text("Filename", default_fn, size=(me.W//2,40))
... | mit |
hezuoguang/ZGVL | WLServer/site-packages/django/core/signing.py | 110 | 6660 | """
Functions for creating and restoring url-safe signed JSON objects.
The format used looks like this:
>>> signing.dumps("hello")
'ImhlbGxvIg:1QaUZC:YIye-ze3TTx7gtSv422nZA4sgmk'
There are two components here, separated by a ':'. The first component is a
URLsafe base64 encoded JSON of the object passed to dumps(). T... | apache-2.0 |
yanirs/servo | tests/wpt/css-tests/tools/pywebsocket/src/test/testdata/handlers/origin_check_wsh.py | 499 | 1916 | # 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 conditions and the f... | mpl-2.0 |
hefen1/chromium | third_party/tlslite/tlslite/utils/pem.py | 116 | 3587 | # Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
from .compat import *
import binascii
#This code is shared with tackpy (somewhat), so I'd rather make minimal
#changes, and preserve the use of a2b_base64 throughout.
def dePem(s, name):
"""Decode a PEM string into a... | bsd-3-clause |
SlimRoms/android_external_chromium_org | tools/telemetry/telemetry/timeline/thread.py | 8 | 9322 | # Copyright 2014 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 itertools
import telemetry.timeline.event_container as event_container
import telemetry.timeline.sample as tracing_sample
import telemetry.timeline.sl... | bsd-3-clause |
opendatagroup/cassius | trunk/cassius/utilities.py | 2 | 20034 | # Standard Python packages
import math
import numbers
import time
# Special dependencies
import numpy
# Cassius interdependencies
import mathtools
def unicode_number(x):
"""Convert a number to unicode, with appropriate substitutions."""
output = u"%g" % x
if output[0] == u"-":
output = u"\u2012" + output... | apache-2.0 |
ursine/Great68 | asm6502.py | 1 | 62272 | import re
class asm6502():
def __init__(self, debug=0):
# print "65C02 Assembler"
self.debuglevel = debug
self.text_of_lines = list() # of strings
self.lines = list() # parsed lines (symbol, opcode, addrmode, value
self.symbols = list() # of (name,line#) tuples
... | gpl-2.0 |
sbalde/edx-platform | common/lib/xmodule/xmodule/capa_module.py | 17 | 8819 | """Implements basics of Capa, including class CapaModule."""
import json
import logging
import sys
from lxml import etree
from pkg_resources import resource_string
import dogstats_wrapper as dog_stats_api
from .capa_base import CapaMixin, CapaFields, ComplexEncoder
from capa import responsetypes
from .progress import... | agpl-3.0 |
joeyoung658/A-Level_2016-18 | Challenges/Hangman/hangman.py | 1 | 2597 | """ Hangman Game (v1.0)
Name: Joe Young
Date: 24/09/2016
"""
#Joe Young
#06/09/2016
import sys
import platform
if "windows" == platform.system():
sys.path.append(sys.path[0]+'\\Extra')
else:
sys.path.append(sys.path[0]+'//Extra')
from random import *
from time import *
import hangmanp
def load_file... | gpl-3.0 |
gzzhanghao/mitmproxy | mitmproxy/builtins/dumper.py | 1 | 7768 | from __future__ import absolute_import, print_function, division
import itertools
import traceback
import click
from mitmproxy import contentviews
from mitmproxy import ctx
from mitmproxy import exceptions
from mitmproxy import filt
from netlib import human
from netlib import strutils
def indent(n, text):
l = ... | mit |
mwishoff/mattsWork | checkers/board.py | 1 | 5763 | # This class will represent the checkers board.
"""
~ 1 2 3 4 5 6 7 8
__________________
a | O O O O | a
b | O O O O | b
c | O O O O | c
d | - - - - | d
e | - - - - | e
f | x x x x | f
g | x x x x | g
h | x x x x | h
------------------
~ 1 2 3 4 5... | gpl-3.0 |
FuzzJunket/pelican-plugins | pelican_comment_system/comment.py | 11 | 1929 | # -*- coding: utf-8 -*-
"""
Author: Bernhard Scheirle
"""
from __future__ import unicode_literals
import os
from pelican.contents import Content
from pelican.utils import slugify
from . import avatars
class Comment(Content):
mandatory_properties = ('author', 'date')
default_template = 'None'
def __init... | agpl-3.0 |
core-bitcoin/bitcoin | qa/rpc-tests/sendheaders.py | 49 | 25728 | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.mininode import *
from test_framework.test_framework import BitcoinTestFramework
from... | mit |
ioos/system-test | Theme_3_Species_and_Habitat/Scenario_3A_SeaBirds/Scenario_3A_Important_Bird_Areas/Scenario_3A_SeaBirds.py | 3 | 8441 | # -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
from utilities import css_styles
css_styles()
# <markdowncell>
# # IOOS System Test - Theme 3 - Scenario A - [Description](https://github.com/ioos/system-test/wiki/Development-of-Test-Themes#scenario-3a-assessing-seabird-vulnerability-in-the-bering-sea... | unlicense |
hakatashi/youtube-dl | youtube_dl/extractor/raywenderlich.py | 21 | 6169 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from .vimeo import VimeoIE
from ..compat import compat_str
from ..utils import (
ExtractorError,
int_or_none,
merge_dicts,
try_get,
unescapeHTML,
unified_timestamp,
urljoin,
)
class RayWenderlichIE(InfoEx... | unlicense |
stacywsmith/ansible | lib/ansible/modules/network/bigswitch/bigmon_chain.py | 19 | 4937 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Ansible module to manage Big Monitoring Fabric service chains
# (c) 2016, Ted Elhourani <ted@bigswitch.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 publish... | gpl-3.0 |
asm666/sympy | sympy/physics/quantum/tests/test_dagger.py | 124 | 1512 | from sympy import I, Matrix, symbols, conjugate, Expr, Integer
from sympy.physics.quantum.dagger import adjoint, Dagger
from sympy.external import import_module
from sympy.utilities.pytest import skip
def test_scalars():
x = symbols('x', complex=True)
assert Dagger(x) == conjugate(x)
assert Dagger(I*x) =... | bsd-3-clause |
5GExchange/nffg | setup.py | 2 | 1754 | # Copyright 2017 Janos Czentye, Balazs Nemeth, Balazs Sonkoly
#
# 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... | apache-2.0 |
bigswitch/nova | nova/objects/instance.py | 1 | 54454 | # 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 by applicable law or agree... | apache-2.0 |
chrisfilda/edx_platform | common/lib/xmodule/xmodule/error_module.py | 17 | 6742 | """
Modules that get shown to the users when an error has occurred while
loading or rendering other modules
"""
import hashlib
import logging
import json
import sys
from lxml import etree
from xmodule.x_module import XModule, XModuleDescriptor
from xmodule.errortracker import exc_info_to_str
from xmodule.modulestore ... | agpl-3.0 |
gezb/osmc | package/mediacenter-addon-osmc/src/script.module.xmltodict/lib/xmltodict.py | 53 | 12257 | #!/usr/bin/env python
"Makes working with XML feel like you are working with JSON"
from xml.parsers import expat
from xml.sax.saxutils import XMLGenerator
from xml.sax.xmlreader import AttributesImpl
try: # pragma no cover
from cStringIO import StringIO
except ImportError: # pragma no cover
try:
from... | gpl-2.0 |
rdobson/transfervm | transfertests/manualnetwork_test.py | 2 | 1862 |
import httplib
import logging
import unittest
import urllib2
import testsetup
import transferclient
import moreasserts
M = 1024 * 1024
def assertVdiZero(self, ip, port, record, vdi_mb):
# Make a new record with the IP and port fields updated
r = dict(record, ip=ip, port=port)
moreasserts.assertVdiIsZero... | gpl-2.0 |
odoo-turkiye/odoo | addons/account_check_writing/report/__init__.py | 446 | 1066 | # -*- 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 |
RedhawkSDR/integration-gnuhawk | components/noise_source_f/tests/test_noise_source_f.py | 1 | 4535 | #!/usr/bin/env python
#
# This file is protected by Copyright. Please refer to the COPYRIGHT file
# distributed with this source distribution.
#
# This file is part of GNUHAWK.
#
# GNUHAWK is free software: you can redistribute it and/or modify is under the
# terms of the GNU General Public License as published by ... | gpl-3.0 |
thinkasoft/ProyectoRD-dev | l10n_ve_imex/model/customs_form.py | 1 | 15041 | # -*- encoding: utf-8 -*-
###############################################################################
# Module Writen to OpenERP, Open Source Management Solution
# Copyright (c) 2013 Vauxoo C.A. (http://openerp.com.ve/)
# All Rights Reserved
############# Credits ###########################################... | agpl-3.0 |
fzheng/codejam | lib/python2.7/site-packages/pip/cmdoptions.py | 136 | 15878 | """
shared options and groups
The principle here is to define options once, but *not* instantiate them
globally. One reason being that options with action='append' can carry state
between parses. pip parses general options twice internally, and shouldn't
pass on state. To be consistent, all options will follow this de... | mit |
collex100/odoo | addons/account_anglo_saxon/__openerp__.py | 264 | 2393 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... | agpl-3.0 |
prarthitm/edxplatform | lms/djangoapps/teams/migrations/0001_initial.py | 20 | 6186 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django_countries.fields
from django.conf import settings
import student.models
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
class Migration(migrations.Migration):
dependenc... | agpl-3.0 |
knowledgepoint-devs/askbot-devel | askbot/views/meta.py | 1 | 8905 | """
:synopsis: remaining "secondary" views for askbot
This module contains a collection of views displaying all sorts of secondary and mostly static content.
"""
from django.shortcuts import render_to_response, get_object_or_404
from django.core.urlresolvers import reverse
from django.core.paginator import Paginator, ... | gpl-3.0 |
wrigri/libcloud | docs/examples/storage/publish_static_website_on_cf.py | 58 | 1117 | from StringIO import StringIO
from libcloud.storage.types import Provider
from libcloud.storage.providers import get_driver
CloudFiles = get_driver(Provider.CLOUDFILES_US)
driver = CloudFiles('username', 'api key')
container = driver.create_container(container_name='my_website')
iterator1 = StringIO('<p>Hello Worl... | apache-2.0 |
pulinagrawal/nupic | tests/unit/nupic/data/generators/pattern_machine_test.py | 15 | 3539 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
c4fcm/MediaMeter-Dashboard | app/core/authentication.py | 1 | 2010 | import hashlib
import datetime
from flask_login import UserMixin, AnonymousUserMixin
import mediacloud as mcapi
import app
from app.core import db, mc
# User class
class User(UserMixin):
def __init__(self, username, key, active=True, profile=None):
self.name = username
self.id = key
self... | apache-2.0 |
ncteisen/grpc | tools/run_tests/performance/scenario_config.py | 7 | 44124 | # Copyright 2016 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | apache-2.0 |
freedesktop-unofficial-mirror/papyon | papyon/media/conference.py | 6 | 12851 | # -*- coding: utf-8 -*-
#
# papyon - a python client library for Msn
#
# Copyright (C) 2009 Collabora Ltd.
#
# 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 |
noodle-learns-programming/aiohttp | tests/test_client_functional.py | 2 | 55390 | """Http client functional tests."""
import binascii
import gc
import io
import os.path
import json
import http.cookies
import asyncio
import unittest
from unittest import mock
import aiohttp
from aiohttp import client, helpers
from aiohttp import test_utils
from aiohttp.multidict import MultiDict
from aiohttp.multipa... | apache-2.0 |
sorenk/ansible | lib/ansible/modules/storage/purestorage/purefa_pg.py | 50 | 5569 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Simon Dodsley (simon@purestorage.com)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',... | gpl-3.0 |
garbear/EventGhost | eg/Classes/DigitOnlyValidator.py | 1 | 2037 | # This file is part of EventGhost.
# Copyright (C) 2005 Lars-Peter Voss <bitmonster@eventghost.org>
#
# EventGhost 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
# (a... | gpl-2.0 |
NPRA/EmissionCalculatorLib | emission/planner.py | 2 | 13540 | import json
try:
from urllib.request import urlopen # Python 3
from urllib.parse import urlencode
except ImportError:
from urllib import urlopen # Python 2
from urllib import urlencode
import socket
import math
from . import vehicles, log
from . import EmissionsJsonParser
from .exceptions import Rout... | bsd-2-clause |
tafia/servo | python/mozlog/mozlog/structured/scripts/format.py | 46 | 1310 | import argparse
import sys
from .. import handlers, commandline, reader
def get_parser(add_help=True):
parser = argparse.ArgumentParser("format",
description="Format a structured log stream", add_help=add_help)
parser.add_argument("--input", action="store", default=None,
... | mpl-2.0 |
trunet/txXBee | setup.py | 2 | 1115 | #!/usr/bin/env python
"""
txXBee installation script
"""
from setuptools import setup
import os
import sys
import subprocess
import txXBee
setup(
name = "txXBee",
version = txXBee.__version__,
author = "Wagner Sartori Junior",
author_email = "wsartori@gmail.com",
url = "http://github.com/trunet/txx... | gpl-3.0 |
farhi-naz/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/style/checkers/xml.py | 187 | 2044 | # Copyright (C) 2010 Apple 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:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
wavemind/gcb17ml | modules/announcements/announcements.py | 5 | 14259 | # Copyright 2012 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 |
nvoron23/hue | desktop/core/ext-py/Paste-1.7.2/tests/test_httpheaders.py | 9 | 6173 | from paste.httpheaders import *
import time
def _test_generic(collection):
assert 'bing' == VIA(collection)
REFERER.update(collection,'internal:/some/path')
assert 'internal:/some/path' == REFERER(collection)
CACHE_CONTROL.update(collection,max_age=1234)
CONTENT_DISPOSITION.update(collection,filena... | apache-2.0 |
optima-ict/odoo | addons/report_webkit/convert.py | 47 | 1389 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com)
# Author : Nicolas Bessi (Camptocamp)
from openerp.tools import convert
original_xml_import = convert.xml_import
class WebkitXMLImport(original_xml_import... | agpl-3.0 |
Nick-Hall/gramps | gramps/gen/plug/docgen/paperstyle.py | 4 | 6305 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2002 Gary Shao
# Copyright (C) 2007 Brian G. Matherly
# Copyright (C) 2009 Benny Malengier
# Copyright (C) 2009 Gary Burton
#
# This program is free software; you can redistribute i... | gpl-2.0 |
kordano/samba-ldb-mdb | buildtools/wafadmin/3rdparty/batched_cc.py | 16 | 4654 | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006 (ita)
"""
Batched builds - compile faster
instead of compiling object files one by one, c/c++ compilers are often able to compile at once:
cc -c ../file1.c ../file2.c ../file3.c
Files are output on the directory where the compiler is called, and dependencies... | gpl-3.0 |
t4skforce/pyspider | pyspider/database/__init__.py | 3 | 3182 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2014-10-08 15:04:08
import urlparse
def connect_database(url):
"""
create database object by url
mysql:
mysql+type://user:passwd@hos... | apache-2.0 |
levigross/pyscanner | mytests/django/contrib/gis/db/backends/spatialite/base.py | 77 | 3463 | from ctypes.util import find_library
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.backends.sqlite3.base import (
_sqlite_extract, _sqlite_date_trunc, _sqlite_regexp, _sqlite_format_dtdelta,
connection_created, Database, DatabaseWrapper as SQLiteDatabas... | mit |
John-Hart/autorest | src/client/Python/msrestazure/test/unittest_exceptions.py | 10 | 7224 | #--------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""),... | mit |
jbarbuto/raven-python | raven/contrib/zope/__init__.py | 3 | 4165 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
raven.contrib.zope
~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2013 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from inspect import getouterframes, currentframe, getinnerframes
from ... | bsd-3-clause |
andrewyoung1991/abjad | abjad/tools/scoretools/test/test_scoretools_Note_grace.py | 2 | 2385 | # -*- encoding: utf-8 -*-
from abjad import *
def test_scoretools_Note_grace_01():
r'''Attach one grace note.
'''
note = Note("c'4")
grace_container = scoretools.GraceContainer([Note(2, (1, 16))])
attach(grace_container, note)
assert systemtools.TestManager.compare(
note,
r''... | gpl-3.0 |
sid-kap/pants | src/python/pants/scm/scm.py | 16 | 3749 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from abc import abst... | apache-2.0 |
klmitch/glance | glance/tests/functional/v2/test_metadef_resourcetypes.py | 2 | 10755 | # Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.