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 |
|---|---|---|---|---|---|
nash-x/hws | cinder/openstack/common/local.py | 378 | 1677 | # Copyright 2011 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | apache-2.0 |
jordanemedlock/psychtruths | temboo/Library/Twilio/Conferences/GetParticipant.py | 5 | 4517 | # -*- coding: utf-8 -*-
###############################################################################
#
# GetParticipant
# Retrieves details for an individual participant of a conference.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "Licens... | apache-2.0 |
WhileLoop/ansible-modules-extras | cloud/vmware/vmware_target_canonical_facts.py | 75 | 2841 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Joseph Callen <jcallen () csc.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 Li... | gpl-3.0 |
FabriceLapeyrere/audiostories-python | db/__init__.py | 1 | 2201 | import os, sys, hashlib, sqlite3
from twisted.enterprise import adbapi
this = sys.modules[__name__]
this.connexion = None
def dict_factory(cursor, row):
d = {}
for idx, col in enumerate(cursor.description):
d[col[0]] = row[idx]
return d
def set_dict_factory(conn):
conn.row_factory = this.dict_factory
dbname='... | gpl-3.0 |
JioCloud/nova_test_latest | nova/tests/unit/pci/test_device.py | 7 | 4380 | # Copyright 2014 Intel Corporation
# 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 require... | apache-2.0 |
wileeam/airflow | tests/test_core_to_contrib.py | 2 | 69275 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
magnus-lycka/mail2alert | src/test/test_server.py | 1 | 5924 | import unittest
import json
import logging
import socketserver
from email.message import EmailMessage
from email.headerregistry import Address
from email import message_from_bytes
from multiprocessing import Process
from http.server import SimpleHTTPRequestHandler
from time import sleep
from mail2alert import server
... | mit |
indevgr/django | django/contrib/gis/db/backends/base/operations.py | 66 | 4887 | class BaseSpatialOperations(object):
"""
This module holds the base `BaseSpatialBackend` object, which is
instantiated by each spatial database backend with the features
it has.
"""
truncate_params = {}
# Quick booleans for the type of this spatial backend, and
# an attribute for the sp... | bsd-3-clause |
badp/ganeti | lib/network.py | 2 | 7912 | #
#
# Copyright (C) 2011, 2012 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distri... | gpl-2.0 |
littlednet/mojdesign | node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/generator/make.py | 372 | 89708 | # Copyright (c) 2013 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.
# Notes:
#
# This is all roughly based on the Makefile system used by the Linux
# kernel, but is a non-recursive make -- we put the entire dependency
# graph in fr... | mit |
emrecamasuvi/appengineTmp | lib/flask/testsuite/templating.py | 562 | 11237 | # -*- coding: utf-8 -*-
"""
flask.testsuite.templating
~~~~~~~~~~~~~~~~~~~~~~~~~~
Template functionality
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import flask
import unittest
from flask.testsuite import FlaskTestCase
class TemplatingTestCase(Flask... | apache-2.0 |
masika/heekscnc | nc/dynapath.py | 30 | 1067 | import nc
import iso
import math
import datetime
import time
from format import Format
now = datetime.datetime.now()
class Creator(iso.Creator):
def __init__(self):
iso.Creator.__init__(self)
self.output_tool_definitions = False
self.m_codes_on_their_own_line = True
s... | bsd-3-clause |
diegobanol/VentasPc | requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py | 285 | 5702 | """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
import sys
# ipaddress has been backported to 2.6+ in pypi. If it is installed on the
# system, us... | apache-2.0 |
funkring/fdoo | addons-funkring/at_project_sale/project.py | 1 | 3345 | # -*- coding: utf-8 -*-
#############################################################################
#
# Copyright (c) 2007 Martin Reisenhofer <martin.reisenhofer@funkring.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as p... | agpl-3.0 |
bewest/amforth | core/devices/atmega3290p/device.py | 5 | 6765 | # Partname: ATmega3290P
# generated automatically, do not edit
MCUREGS = {
'TCCR0A': '&68',
'TCCR0A_FOC0A': '$80',
'TCCR0A_WGM00': '$40',
'TCCR0A_COM0A': '$30',
'TCCR0A_WGM01': '$08',
'TCCR0A_CS0': '$07',
'TCNT0': '&70',
'OCR0A': '&71',
'TIMSK0': '&110',
'TIMSK0_OCIE0A': '$02',
'TIMSK0_TOIE0':... | gpl-2.0 |
puneetgkaur/backup_sugar_sugartoolkit | src/sugar3/graphics/xocolor.py | 7 | 8657 | # Copyright (C) 2006-2007 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 of the License, or (at your option) any later version.
#
# This library is dis... | lgpl-2.1 |
SU-ECE-17-7/hotspotter | _scripts/graveyard.py | 2 | 16059 |
print('warping img.shape=%r to a new shape=%r' % (img.shape, dsize))
# 1vM Agg info graveyard
#cx2_max_ax = np.cumsum(cx2_nFeats)
#_ax2_cid = [[cid_]*nFeats for (cid_, nFeats) in iter(zip(cx2_cid, cx2_nFeats))]
#ax2_cid = np.array(list(chain.from_iterable(_ax2_cid)))
# dont need no cid stuff here
#qfx2_cx = ... | apache-2.0 |
twz915/django-minicms | minicms/urls.py | 1 | 1447 | """minicms URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | mit |
QualiSystemsLab/cloudshell-orch-sandbox | sandbox_scripts/helpers/Networking/base_save_restore.py | 1 | 2769 |
from sandbox_scripts.QualiEnvironmentUtils.StorageManager import StorageManager
class BaseSaveRestore(object):
def __init__(self, sandbox):
"""
Get the root directory for the config files on the storage server
:param SandboxBase sandbox: The sandbox save & restore will be done in
... | apache-2.0 |
jplourenco/bokeh | examples/plotting/file/slider.py | 21 | 1428 |
from bokeh.io import vform
from bokeh.plotting import figure, hplot, output_file, show, ColumnDataSource
from bokeh.models import CustomJS, Slider
import numpy as np
x = np.linspace(0, 10, 500)
y = np.sin(x)
source = ColumnDataSource(data=dict(x=x, y=y))
plot = figure(y_range=(-10, 10), plot_width=400, plot_heigh... | bsd-3-clause |
avalentino/gsdview | tests/test_utils.py | 1 | 3765 | #!/usr/bin/env python
# GSDView - Geo-Spatial Data Viewer
# Copyright (C) 2008-2021 Antonio Valentino <antonio.valentino@tiscali.it>
#
# This module is free software you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation either versio... | gpl-2.0 |
google-code-export/photivo | scons-local-2.2.0/SCons/Tool/aixc++.py | 14 | 2765 | """SCons.Tool.aixc++
Tool-specific initialization for IBM xlC / Visual Age C++ compiler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009... | gpl-3.0 |
memtoko/django | tests/csrf_tests/tests.py | 17 | 18716 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
from django.conf import settings
from django.http import HttpRequest, HttpResponse
from django.middleware.csrf import CSRF_KEY_LENGTH, CsrfViewMiddleware
from django.template import RequestContext, Template
from django.template.context_pro... | bsd-3-clause |
matburt/ansible | lib/ansible/plugins/callback/profile_tasks.py | 21 | 3702 | # (C) 2015, Tom Paine, <github@aioue.net>
# (C) 2014, Jharrod LaFon, @JharrodLaFon
# (C) 2012-2013, Michael DeHaan, <michael.dehaan@gmail.com>
#
# This file 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, eith... | gpl-3.0 |
vincentleeuwen/followfrenzy | followbot/migrations/0005_auto__del_field_nolongerfriends_followed_on__add_field_nolongerfriends.py | 1 | 4330 | # -*- 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):
# Deleting field 'NoLongerFriends.followed_on'
db.delete_column(u'followb... | gpl-2.0 |
indrajitr/ansible | test/integration/targets/incidental_script_inventory_vmware_inventory/vmware_inventory.py | 19 | 30336 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C): 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Requirements
# - pyvmomi >= 6.0.0.2016.4
# TODO:
# * more jq examples
# * optional folder hierarchy
"""
$ jq '._meta.hostvars[].c... | gpl-3.0 |
fweik/espresso | testsuite/scripts/tutorials/test_constant_pH__interactions.py | 3 | 1390 | # Copyright (C) 2019 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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 versio... | gpl-3.0 |
matrixise/odoo | addons/l10n_be/__openerp__.py | 50 | 3750 | # -*- 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 |
chienlieu2017/it_management | odoo/addons/base_import_module/models/base_import_module.py | 53 | 1822 | # -*- coding: utf-8 -*-
import base64
from io import BytesIO
from odoo import api, fields, models
class BaseImportModule(models.TransientModel):
""" Import Module """
_name = "base.import.module"
_description = "Import Module"
module_file = fields.Binary(string='Module .ZIP file', required=True)
... | gpl-3.0 |
richardcs/ansible | lib/ansible/modules/system/facter.py | 125 | 1321 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_v... | gpl-3.0 |
envoyproxy/envoy-wasm | tools/protoxform/options.py | 6 | 1606 | # Manage internal options on messages/enums/fields/enum values.
from udpa.annotations import versioning_pb2
def AddHideOption(options):
"""Mark message/enum/field/enum value as hidden.
Hidden messages are ignored when generating output.
Args:
options: MessageOptions/EnumOptions/FieldOptions/EnumValueOpti... | apache-2.0 |
mariajosefrancolugo/osp | osp/visits/models.py | 1 | 1472 | from django.db import models
from django.contrib.auth.models import User
from django.conf import settings
BOOL_CHOICES = ((1, 'Private'), (0, 'Public'),(2, ''));
class Visit(models.Model):
student = models.ForeignKey(User, related_name='visits')
submitter = models.ForeignKey(User, related_name='submitted_visit... | lgpl-3.0 |
Vimos/scikit-learn | examples/linear_model/plot_sgd_comparison.py | 112 | 1819 | """
==================================
Comparing various online solvers
==================================
An example showing how different online solvers perform
on the hand-written digits dataset.
"""
# Author: Rob Zinkov <rob at zinkov dot com>
# License: BSD 3 clause
import numpy as np
import matplotlib.pyplot a... | bsd-3-clause |
mdsalman729/flexpret_project | emulator/concurrit-poplsyntax/concurrit-poplsyntax/python/test1.py | 1 | 2795 | __author__ = 'tayfun elmas'
from counit import coroutine
import unittest
class CoroutineTests(unittest.TestCase):
########################################################
def test_format(self):
self.assertEquals("%4d" % 12, " 12")
self.assertEquals(int("%4d" % 12), 12)
self.assertEqu... | bsd-3-clause |
bspink/django | docs/conf.py | 188 | 11919 | # -*- coding: utf-8 -*-
#
# Django documentation build configuration file, created by
# sphinx-quickstart on Thu Mar 27 09:06:53 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleab... | bsd-3-clause |
piotroxp/scibibscan | scib/lib/python3.6/site-packages/pip/_vendor/html5lib/_trie/py.py | 1323 | 1775 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from bisect import bisect_left
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
if not all(isinstance(x, text_type) for x in data.keys()):
raise TypeError... | mit |
mesnardo/snake | snake/solutions/roosWillmarth1971.py | 2 | 1415 | """
Implementation of the class `RoosWillmarth1971` to read the steady-state drag
coefficient from a file.
The drag coefficients have been reported in Roos and Willmarth (1971).
_References:_
* Roos, F. W., & Willmarth, W. W. (1971).
Some experimental results on sphere and disk drag.
AIAA Journal, 9(2), 285-291.
... | mit |
PIVX-Project/PIVX | test/functional/feature_dbcrash.py | 1 | 13932 | #!/usr/bin/env python3
# Copyright (c) 2017-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php.
"""Test recovery from a crash during chainstate writing.
- 4 nodes
* node0, node1, and node2 will have... | mit |
wimnat/ansible | test/units/module_utils/common/validation/test_check_type_jsonarg.py | 83 | 1033 | # -*- coding: utf-8 -*-
# Copyright (c) 2019 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
import pytest
from ansible.module_utils._text import to_native
from ansible.m... | gpl-3.0 |
louietsai/python-for-android | python3-alpha/python3-src/Tools/scripts/findnocoding.py | 46 | 2722 | #!/usr/bin/env python3
"""List all those Python files that require a coding directive
Usage: nocoding.py dir1 [dir2...]
"""
__author__ = "Oleg Broytmann, Georg Brandl"
import sys, os, re, getopt
# our pysource module finds Python source files
try:
import pysource
except ImportError:
# emulate the module wi... | apache-2.0 |
pyatil/jenkins-job-builder | jenkins_jobs/modules/triggers.py | 6 | 61871 | # Copyright 2012 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 applicable law... | apache-2.0 |
Jonekee/chromium.src | third_party/pycoverage/coverage/backward.py | 211 | 5187 | """Add things to old Pythons so I can pretend they are newer."""
# This file does lots of tricky stuff, so disable a bunch of lintisms.
# pylint: disable=F0401,W0611,W0622
# F0401: Unable to import blah
# W0611: Unused import blah
# W0622: Redefining built-in blah
import os, re, sys
# Python 2.3 doesn't have `set`
t... | bsd-3-clause |
usersource/tasks | tasks_phonegap/Tasks/cordova/plugins/io.usersource.anno/tools/copytool2/oauth2client/gce.py | 224 | 3038 | # Copyright (C) 2012 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | mpl-2.0 |
MoritzS/django | tests/auth_tests/test_validators.py | 23 | 9937 | import os
from django.contrib.auth import validators
from django.contrib.auth.models import User
from django.contrib.auth.password_validation import (
CommonPasswordValidator, MinimumLengthValidator, NumericPasswordValidator,
UserAttributeSimilarityValidator, get_default_password_validators,
get_password_v... | bsd-3-clause |
wubr2000/googleads-python-lib | examples/dfp/v201508/product_template_service/get_all_product_templates.py | 4 | 1747 | #!/usr/bin/python
#
# 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 b... | apache-2.0 |
domyam97/airlights | slack/venv/lib/python2.7/site-packages/setuptools/command/rotate.py | 461 | 2038 | from distutils.util import convert_path
from distutils import log
from distutils.errors import DistutilsOptionError
import os
from setuptools import Command
from setuptools.compat import basestring
class rotate(Command):
"""Delete older distributions"""
description = "delete older distributions, keeping N n... | mit |
unixweb-team/myweather | weather.py | 1 | 1123 | #!/usr/bin/python
# Can enable debug output by uncommenting:
#import logging
#logging.basicConfig(level=logging.DEBUG)
import Adafruit_BMP.BMP085 as BMP085
# Default constructor will pick a default I2C bus.
#
# For the Raspberry Pi this means you should hook up to the only exposed I2C bus
# from the main GPIO header... | gpl-3.0 |
refreshoxford/django-cbv-inspector | cbv/management/commands/cbv_dumpversion.py | 1 | 1262 | import json
from django.core.management.base import LabelCommand
from django.core import serializers
from cbv import models
class Command(LabelCommand):
"""Dump the django cbv app data for a specific version."""
def handle_label(self, label, **options):
filtered_models = (
(models.Project... | bsd-2-clause |
EterniusVGM/Renju | competition/agent.py | 1 | 1387 | import abc
import numpy
import subprocess
import util
class Agent(metaclass=abc.ABCMeta):
@abc.abstractmethod
def policy(game):
'''Return probabilty matrix of possible actions'''
@abc.abstractmethod
def name():
'''return name of agent'''
class HumanAgent(Agent):
def __init__(self,... | mit |
chouseknecht/ansible | lib/ansible/module_utils/univention_umc.py | 118 | 8767 | # -*- coding: UTF-8 -*-
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own lic... | gpl-3.0 |
cblop/tropic | instal/pysolve.py | 2 | 8522 | #!/usr/bin/python
#------------------------------------------------------------------------
# REVISION HISTORY:
# 20160203 JAP: started coding and log, imported code from pyinstal.py
# refactored instal_print_xxx code into instalparser method
# 20160204 JAP: call solver and process answer set (lots of as... | epl-1.0 |
ashhher3/cvxpy | cvxpy/expressions/variables/nonneg.py | 10 | 1408 | """
Copyright 2013 Steven Diamond, Eric Chu
This file is part of CVXPY.
CVXPY 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.
CVXPY is dis... | gpl-3.0 |
QijunPan/ansible | lib/ansible/plugins/callback/minimal.py | 10 | 3874 | # (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 |
cyanolive/testlink | third_party/fckeditor/editor/filemanager/connectors/py/zope.py | 48 | 5497 | #!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http://www.gnu.or... | gpl-2.0 |
swayf/pyLoad | module/plugins/hoster/MegasharesCom.py | 2 | 5031 | # -*- coding: utf-8 -*-
"""
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 distributed in ... | agpl-3.0 |
MichaelNedzelsky/intellij-community | python/helpers/py3only/docutils/languages/he.py | 52 | 2649 | # Author: Meir Kriheli
# Id: $Id: he.py 4837 2006-12-26 09:59:41Z sfcben $
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be
# translated for each language:... | apache-2.0 |
nvoron23/statsmodels | statsmodels/stats/tests/test_power.py | 28 | 25876 | # -*- coding: utf-8 -*-
# pylint: disable=W0231, W0142
"""Tests for statistical power calculations
Note:
tests for chisquare power are in test_gof.py
Created on Sat Mar 09 08:44:49 2013
Author: Josef Perktold
"""
import copy
import numpy as np
from numpy.testing import (assert_almost_equal, assert_allclose, as... | bsd-3-clause |
nigelb/gRefer | gRefer/conv/internal/bibtex/__init__.py | 1 | 1600 | #!/usr/bin/python
# gRefer is a Bibliographic Management System that uses Google Docs
# as shared storage.
#
# Copyright (C) 2011 NigelB
#
# 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... | gpl-3.0 |
rpp0/peapwn | mods/hostap/tests/hwsim/wpasupplicant.py | 1 | 22651 | #!/usr/bin/python
#
# Python class for controlling wpa_supplicant
# Copyright (c) 2013, Jouni Malinen <j@w1.fi>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import os
import time
import logging
import re
import subprocess
import wpaspy
logger = logging.getLog... | gpl-2.0 |
prabhu/invoicy | invoicy/guidy/admin.py | 1 | 2048 | from django.contrib import admin
from guidy.models import Task
from clienty.models import Client
def make_delivered(modeladmin, request, queryset):
rows_updated = queryset.update(status='delivered')
modeladmin.message_user(request, "%s tasks successfully marked as delivered."%rows_updated)
make_delivered.short... | bsd-3-clause |
abo-abo/edx-platform | lms/djangoapps/user_api/tests/test_models.py | 19 | 1088 | from django.db import IntegrityError
from django.test import TestCase
from student.tests.factories import UserFactory
from user_api.tests.factories import UserPreferenceFactory
class UserPreferenceModelTest(TestCase):
def test_duplicate_user_key(self):
user = UserFactory.create()
UserPreferenceFac... | agpl-3.0 |
j831/zulip | zerver/lib/queue.py | 4 | 12478 | from __future__ import absolute_import
from django.conf import settings
import pika
from pika.adapters.blocking_connection import BlockingChannel
from pika.spec import Basic
import logging
import ujson
import random
import time
import threading
import atexit
from collections import defaultdict
from zerver.lib.utils i... | apache-2.0 |
Teino1978-Corp/Teino1978-Corp-react | scripts/bench/analyze.py | 13 | 3357 | #!/usr/bin/env python
# Copyright 2015, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
import math
im... | bsd-3-clause |
MrSurly/micropython | ports/stm32/mboot/mboot.py | 15 | 5958 | # Driver for Mboot, the MicroPython boot loader
# MIT license; Copyright (c) 2018 Damien P. George
import struct, time, os, hashlib
I2C_CMD_ECHO = 1
I2C_CMD_GETID = 2
I2C_CMD_GETCAPS = 3
I2C_CMD_RESET = 4
I2C_CMD_CONFIG = 5
I2C_CMD_GETLAYOUT = 6
I2C_CMD_MASSERASE = 7
I2C_CMD_PAGEERASE = 8
I2C_CMD_SETRDADDR = 9
I2C_C... | mit |
valexandersaulys/prudential_insurance_kaggle | venv/lib/python2.7/site-packages/numpy/core/info.py | 165 | 4690 | """Defines a multi-dimensional array and useful procedures for Numerical computation.
Functions
- array - NumPy Array construction
- zeros - Return an array of all zeros
- empty - Return an unitialized array
- shape - Return s... | gpl-2.0 |
spandanb/horizon | horizon/utils/html.py | 11 | 2256 | # 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 |
ULHPC/easybuild-framework | easybuild/tools/multidiff.py | 3 | 10571 | # #
# Copyright 2014-2017 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 (... | gpl-2.0 |
igemsoftware/SYSU-Software2013 | project/Python27/Lib/test/test_symtable.py | 20 | 6284 | """
Test the API of the symtable module.
"""
import symtable
import unittest
from test import test_support
TEST_CODE = """
import sys
glob = 42
class Mine:
instance_var = 24
def a_method(p1, p2):
pass
def spam(a, b, *var, **kw):
global bar
bar = 47
x = 23
glob
def internal():
... | mit |
wakatime/wakatime-unity | Editor/WakaTime/client/wakatime/packages/pygments_py3/pygments/lexers/special.py | 72 | 3069 | # -*- coding: utf-8 -*-
"""
pygments.lexers.special
~~~~~~~~~~~~~~~~~~~~~~~
Special lexers.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer
from pygments.token import Token, Error, Text
from... | cc0-1.0 |
tastynoodle/django | django/contrib/formtools/tests/wizard/test_cookiestorage.py | 186 | 1813 | from django.test import TestCase
from django.core import signing
from django.core.exceptions import SuspiciousOperation
from django.http import HttpResponse
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.contrib.formtools.wizard.storage.cookie import CookieStorage
from django.contrib.formtool... | bsd-3-clause |
aviralchandra/Sandhi | build/PMC/tests/foo_bar.py | 1 | 3800 | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.4
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import ... | gpl-3.0 |
pexip/os-chardet | chardet/langhebrewmodel.py | 269 | 11345 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Simon Montagu
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved... | lgpl-2.1 |
sitsbeyou/Django-facebook | django_facebook/tests.py | 21 | 37938 | from __future__ import with_statement
from django.contrib.auth.models import AnonymousUser
from django.contrib.sessions.middleware import SessionMiddleware
from django.core.urlresolvers import reverse
from django.http import QueryDict
from django.test.client import Client, RequestFactory
from django_facebook import exc... | bsd-3-clause |
AutorestCI/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_url_path_map.py | 1 | 2820 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
tntnatbry/tensorflow | tensorflow/python/ops/array_grad.py | 7 | 22225 | # 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 |
Northrend/mxnet | example/rcnn/rcnn/cython/setup.py | 12 | 5571 | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
import os
from os.path import join as pjoin
from setuptools import setu... | apache-2.0 |
Mozta/pagina-diagnostijuego | venv/lib/python2.7/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 |
soap-DEIM/l4android | Documentation/target/tcm_mod_builder.py | 4981 | 41422 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
ulmon/hadoop1.2.1 | src/docs/relnotes.py | 36 | 2649 | #!/usr/bin/python
# Run this command as:
#
# jira.sh -s https://issues.apache.org/jira -u $user -p $pw \
# -a getIssueList --search \
# "project in (HADOOP,HDFS,MAPREDUCE) and fixVersion = '$vers' and resolution = Fixed" \
# | ./relnotes.py > $vers.html
import csv
import re
import subprocess
import sys
namePat... | apache-2.0 |
de2Zotjes/xpython | exercises/kindergarten-garden/kindergarten_garden_test.py | 15 | 1480 | import unittest
from garden import Garden
class KindergartenGardenTests(unittest.TestCase):
def test_alices_garden(self):
self.assertEqual("Radishes Clover Grass Grass".split(),
Garden("RC\nGG").plants("Alice"))
def test_bob_and_charlies_gardens(self):
garden = Gard... | mit |
blaxter/samba | third_party/waf/wafadmin/Tools/osx.py | 20 | 5833 | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy 2008
"""MacOSX related tools
To compile an executable into a Mac application bundle (a .app), set its 'mac_app' attribute
obj.mac_app = True
To make a bundled shared library (a .bundle), set the 'mac_bundle' attribute:
obj.mac_bundle = True
"""
import os, sh... | gpl-3.0 |
intip/django-cms | cms/tests/permmod.py | 10 | 51051 | # -*- coding: utf-8 -*-
from __future__ import with_statement
from djangocms_text_ckeditor.models import Text
from django.contrib.admin.sites import site
from django.contrib.admin.util import unquote
from django.contrib.auth import get_user_model
from django.contrib.auth.models import AnonymousUser, Group, Permission
... | bsd-3-clause |
clearzale/pyflag | src/plugins_old/MemoryForensics/Volatility-1.3_Linux_rc.1/forensics/linux/info.py | 7 | 2335 | # Volatility
# Copyright (C) 2007,2008 Volatile Systems
#
# Original Source:
# Copyright (C) 2004,2005,2006 4tphi Research
# Author: {npetroni,awalters}@4tphi.net (Nick Petroni and AAron Walters)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public Lice... | gpl-2.0 |
sridevikoushik31/openstack | nova/openstack/common/rpc/dispatcher.py | 9 | 5309 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Red Hat, 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
#
#... | apache-2.0 |
zhaochao/fuel-main | fuelweb_ui_test/tests/test_environment.py | 4 | 10279 | import time
from pageobjects.environments import Environments, Wizard
from pageobjects.networks import Networks, NeutronParameters
from pageobjects.nodes import Nodes
from pageobjects.settings import Settings
from pageobjects.tabs import Tabs
from settings import OPENSTACK_CENTOS, OPENSTACK_RELEASE_CENTOS
from tests.ba... | apache-2.0 |
wikimedia/operations-debs-python-diamond | src/collectors/nagiosperfdata/nagiosperfdata.py | 6 | 9394 | # coding=utf-8
"""
The NagiosPerfdataCollector parses Nagios performance data in the
PNP4Nagios/Graphios/Metricinga key-value format.
#### Dependencies
* Nagios configured to periodically dump performance data files in
PNP4Nagios format
Configuring Nagios/Icinga
-------------------------
If you're already using... | mit |
kjc88/sl4a | python/src/Lib/test/test_select.py | 56 | 1711 | from test import test_support
import unittest
import select
import os
import sys
class SelectTestCase(unittest.TestCase):
class Nope:
pass
class Almost:
def fileno(self):
return 'fileno'
def test_error_conditions(self):
self.assertRaises(TypeError, select.select, 1, 2... | apache-2.0 |
Rademade/taiga-back | taiga/base/apps.py | 3 | 1279 | # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or mo... | agpl-3.0 |
charithag/iot-server-appliances | Arduino Robot/PC_Clients/PythonTestClients/sendControl.py | 5 | 1181 | #! /usr/bin/python
import serial
import time
bluetoothSerial = serial.Serial( "/dev/tty.HC-06-DevB", baudrate=9600 )
import termios, fcntl, sys, os
class _Getch:
def __call__(self):
fd = sys.stdin.fileno()
oldterm = termios.tcgetattr(fd)
newattr = termios.tcgetattr(fd)
newattr[3] = newattr[3] & ~termios.I... | apache-2.0 |
JuliBakagianni/CEF-ELRC | lib/python2.7/site-packages/unidecode/x0c1.py | 253 | 4765 | data = (
'syae', # 0x00
'syaeg', # 0x01
'syaegg', # 0x02
'syaegs', # 0x03
'syaen', # 0x04
'syaenj', # 0x05
'syaenh', # 0x06
'syaed', # 0x07
'syael', # 0x08
'syaelg', # 0x09
'syaelm', # 0x0a
'syaelb', # 0x0b
'syaels', # 0x0c
'syaelt', # 0x0d
'syaelp', # 0x0e
'syaelh', # 0x... | bsd-3-clause |
krishna-pandey-git/django | tests/select_for_update/tests.py | 203 | 9626 | from __future__ import unicode_literals
import threading
import time
from multiple_database.routers import TestRouter
from django.conf import settings
from django.db import connection, router, transaction
from django.db.utils import DEFAULT_DB_ALIAS, ConnectionHandler, DatabaseError
from django.test import (
Tra... | bsd-3-clause |
wwj718/edx-video | cms/djangoapps/contentstore/features/advanced-settings.py | 3 | 3819 | #pylint: disable=C0111
#pylint: disable=W0621
from lettuce import world, step
from nose.tools import assert_false, assert_equal, assert_regexp_matches
from common import type_in_codemirror, press_the_notification_button
KEY_CSS = '.key input.policy-key'
VALUE_CSS = 'textarea.json'
DISPLAY_NAME_KEY = "display_name"
DI... | agpl-3.0 |
miguelparaiso/PracticaOdoo | addons/lunch/report/order.py | 377 | 2637 | # -*- encoding: utf-8 -*-
##############################################################################
#
# 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 G... | agpl-3.0 |
GroestlCoin/electrum-grs | setup.py | 1 | 3108 | #!/usr/bin/env python3
# python setup.py sdist --format=zip,gztar
import os
import sys
import platform
import importlib.util
import argparse
import subprocess
from setuptools import setup, find_packages
from setuptools.command.install import install
MIN_PYTHON_VERSION = "3.6.1"
_min_python_version_tuple = tuple(map... | gpl-3.0 |
petricm/DIRAC | DataManagementSystem/scripts/dirac-dms-remove-catalog-files.py | 4 | 1659 | #!/usr/bin/env python
########################################################################
# $Header: $
########################################################################
from __future__ import print_function
__RCSID__ = "$Id: $"
import DIRAC
from DIRAC.Core.Base import Script
from DIRAC import exit as dex... | gpl-3.0 |
lancezlin/pyjs | pyjswidgets/dynamic.py | 7 | 8560 | #
# Warning: this is an alpha module and might be removed/renamed in
# later pyjamas versions
#
from __pyjamas__ import wnd, doc, JS, setCompilerOptions
from __javascript__ import ActiveXObject, XMLHttpRequest
from pyjamas import DOM
from __pyjamas__ import debugger
import sys
setCompilerOptions("noSourceTracking", "n... | apache-2.0 |
harmy/kbengine | kbe/res/scripts/common/Lib/encodings/koi8_u.py | 37 | 14069 | """ Python Character Mapping Codec koi8_u generated from 'python-mappings/KOI8-U.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input... | lgpl-3.0 |
samvarankashyap/googlecloudutility2 | lib/rsa/cli.py | 79 | 12016 | # -*- coding: utf-8 -*-
#
# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
#
# 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
#
# Unl... | apache-2.0 |
imanmafi/pyNES | pynes/tests/and_test.py | 27 | 3473 | # -*- coding: utf-8 -*-
'''
AND, Logical AND with Accumulator Test
This is a test for the logical instruction AND of
the 6502. In the 6502 the logical AND could be
performed against the content of the accumulator or
a content at a specific location.
'''
import unittest
from pynes.tests import MetaInstructionCase
cla... | bsd-3-clause |
gpoesia/servo | tests/wpt/web-platform-tests/cors/resources/status.py | 220 | 1223 | def main(request, response):
response.headers.set("Access-Control-Allow-Origin", request.headers.get("origin") )
response.headers.set("Access-Control-Expose-Headers", "X-Request-Method")
if request.method == 'OPTIONS':
response.headers.set("Access-Control-Allow-Methods", "GET, CHICKEN, HEAD, POST,... | mpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.