repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
arnavd96/Cinemiezer | myvenv/lib/python3.4/site-packages/unidecode/x075.py | 253 | 4675 | data = (
'Zhui ', # 0x00
'Ping ', # 0x01
'Bian ', # 0x02
'Zhou ', # 0x03
'Zhen ', # 0x04
'Senchigura ', # 0x05
'Ci ', # 0x06
'Ying ', # 0x07
'Qi ', # 0x08
'Xian ', # 0x09
'Lou ', # 0x0a
'Di ', # 0x0b
'Ou ', # 0x0c
'Meng ', # 0x0d
'Zhuan ', # 0x0e
'Peng ', # 0x0f
'Lin ', ... | mit |
lbjay/cds-invenio | modules/webcomment/lib/webcomment_templates.py | 1 | 108170 | # -*- coding: utf-8 -*-
## Comments and reviews for records.
## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN.
##
## CDS Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free... | gpl-2.0 |
starpow971/Stanford-Humanities-Center-Updater | populater.py | 1 | 29081 | #!/usr/bin/env python
# Copyright 2011, The Board of Regents of Leland Stanford, Jr. University
# All rights reserved. See LICENSE.
# Author: Christine Williams <christine.bennett.williams@gmail.com>
# Description: Pulls events from database and writes them to disc.
from Cheetah.Template import Template
from lxml imp... | bsd-2-clause |
frankyrumple/ope | admin_app/gluon/packages/dal/pydal/adapters/google_adapters.py | 17 | 23207 | # -*- coding: utf-8 -*-
import os
import re
from .._compat import pjoin
from .._globals import IDENTITY, THREAD_LOCAL
from .._gae import classobj, gae, ndb, namespace_manager, NDBPolyModel, rdbms
from ..objects import Table, Field, Expression, Query
from ..helpers.classes import SQLCustomType, SQLALL, \
Reference,... | mit |
OpenNetworkingFoundation/ONFOpenTransport | RI/flask_server/tapi_server/models/tapi_topology_forwarding_rule.py | 4 | 1275 | # coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from tapi_server.models.base_model_ import Model
from tapi_server import util
class TapiTopologyForwardingRule(Model):
"""NOTE: This class is auto generated by Op... | apache-2.0 |
hefen1/chromium | tools/telemetry/telemetry/core/browser_credentials.py | 11 | 5581 | # Copyright 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import logging
import os
from telemetry.core import util
from telemetry.core.backends import codepen_credentials_backend
from telemetry.core.bac... | bsd-3-clause |
lz1988/flaskweb | Lib/site-packages/pip/_vendor/lockfile/mkdirlockfile.py | 478 | 3098 | from __future__ import absolute_import, division
import time
import os
import sys
import errno
from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout,
AlreadyLocked)
class MkdirLockFile(LockBase):
"""Lock file by creating a directory."""
def __init__(self, path, threaded=True, ... | bsd-2-clause |
Titulacion-Sistemas/PythonTitulacion-EV | Lib/site-packages/django/templatetags/future.py | 130 | 1640 | from django.template import Library
from django.template import defaulttags
register = Library()
@register.tag
def ssi(parser, token):
# Used for deprecation path during 1.3/1.4, will be removed in 2.0
return defaulttags.ssi(parser, token)
@register.tag
def url(parser, token):
# Used for deprecation pa... | mit |
JimLiu/shadowsocks | tests/nose_plugin.py | 1072 | 1164 | #!/usr/bin/env python
#
# Copyright 2015 clowwindy
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
lalithr95/competitive-programming | solution.py | 1 | 3398 | import urllib2
import os
import math
import json
endpoint = "curl --header 'token: oSgDmnvLL9GwKZwFoiKHJE' https://www.find.foo/api/challenge"
# data = os.system(endpoint)
# print data
import subprocess
result = os.popen(endpoint).read()
data = json.loads(result)
challenge = data['challenge']
if challenge[1] == 'b' ... | mit |
mspringett/namebench | libnamebench/base_ui.py | 172 | 10284 | # Copyright 2009 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 |
Bismarrck/tensorflow | tensorflow/examples/speech_commands/wav_to_features_test.py | 9 | 2601 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
avocado-framework/avocado-vt | virttest/libvirt_xml/nwfilter_protocols/udplite.py | 8 | 5857 | """
udplite protocl support class(es)
http://libvirt.org/formatnwfilter.html#nwfelemsRulesProtoMisc
"""
from virttest.libvirt_xml import accessors, xcepts
from virttest.libvirt_xml.nwfilter_protocols import base
class Udplite(base.TypedDeviceBase):
"""
Create new Udplite xml instances
Properties:
... | gpl-2.0 |
wfxiang08/django185 | django/conf/locale/cs/formats.py | 115 | 1702 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. E Y'
TIME_FORMAT = 'G:i'
DATET... | bsd-3-clause |
knightmare2600/zabbix_templates | acronis_advanced/acronis_info.py | 1 | 3770 | #!/usr/bin/python3
#------------------------------------------------------------------------------#
# found at https://forum.acronis.com/comment/422777 script also requires #
# sudo apt install python3-dateutil on ubuntu systems. #
# ... | gpl-3.0 |
sikmir/QGIS | tests/src/python/test_qgsserver_wfs.py | 4 | 27970 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsServer WFS.
From build dir, run: ctest -R PyQgsServerWFS -V
.. note:: 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 Licen... | gpl-2.0 |
awesomethomas/gemrb | gemrb/GUIScripts/bg1/GUICG12.py | 3 | 6821 | # GemRB - Infinity Engine Emulator
# Copyright (C) 2003 The GemRB Project
#
# 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 versi... | gpl-2.0 |
kevin8909/xjerp | openerp/addons/mail/__init__.py | 57 | 1336 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009-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 |
aslamplr/shorts | gdata/contentforshopping/client.py | 29 | 31884 | #!/usr/bin/python
#
# Copyright (C) 2010-2011 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... | mit |
fedorpatlin/ansible | test/units/parsing/vault/test_vault_editor.py | 33 | 18734 | # (c) 2014, James Tanner <tanner.jc@gmail.com>
# (c) 2014, James Cammarata, <jcammarata@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version ... | gpl-3.0 |
citrix-openstack-build/pbr | pbr/tests/__init__.py | 3 | 5160 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010-2011 OpenStack Foundation
# Copyright (c) 2013 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 Lic... | apache-2.0 |
Squishymedia/feedingdb | src/feeddb/feed/migrations/0012_generic_techniques.py | 1 | 38846 |
from south.db import db
from django.db import models
from feeddb.feed.models import *
class Migration:
def forwards(self, orm):
# Adding model 'StrainSetup'
db.create_table('feed_strainsetup', (
('setup_ptr', orm['feed.strainsetup:setup_ptr']),
))
db.send_... | gpl-3.0 |
drnextgis/QGIS | python/ext-libs/nose2/tests/functional/test_eggdiscovery_loader.py | 16 | 2933 | import sys
from nose2.tests._common import FunctionalTestCase, support_file
import nose2.plugins.loader.eggdiscovery #@UnusedImport This is not very elegant, but it allows eggdiscovery to be found in Travis (or when run with PYTHONPATH=.)
try:
import pkg_resources
except ImportError:
pkg_resources = None
els... | gpl-2.0 |
spaceone/pyjs | pygtkweb/demos/042-testtext.py | 6 | 43704 | #!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
import pygtk
pygtk.require('2.0')
import sys, os, errno
import gtk
import pango
RESPONSE_FORWARD = 0
RESPONSE_BACKWARD = 1
book_closed_xpm = [
"16 16 6 1",
" c None s None",
". c black",
"X c red",
"o c yellow",
"O c #808080",
"# c wh... | apache-2.0 |
arhik/nupic | src/nupic/research/spatial_pooler.py | 2 | 71175 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013-2016, 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 p... | agpl-3.0 |
kiwicopple/MyMDb | venv/Lib/site-packages/docutils/parsers/rst/tableparser.py | 112 | 21007 | # $Id: tableparser.py 7320 2012-01-19 22:33:02Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
This module defines table parser classes,which parse plaintext-graphic tables
and produce a well-formed data structure suitable for building a CALS tab... | mit |
navycrow/Sick-Beard | lib/requests/structures.py | 57 | 1763 | # -*- coding: utf-8 -*-
"""
requests.structures
~~~~~~~~~~~~~~~~~~~
Data structures that power Requests.
"""
class CaseInsensitiveDict(dict):
"""Case-insensitive Dictionary
For example, ``headers['content-encoding']`` will return the
value of a ``'Content-Encoding'`` response header."""
@property... | gpl-3.0 |
darongliu/Lstm_Turing_LM | lstm-neural-turing-machines-lm/experiment_version/lstm+attention+pretrain/controller.py | 29 | 1213 | import theano
import theano.tensor as T
import numpy as np
from theano_toolkit import utils as U
import controller
import model
import head
from collections import namedtuple
#from theano_toolkit.parameters import Parameters
def build(P, input_size, output_size, mem_width):
"""
Create controller function for... | mit |
kingvuplus/xrd-alliance | lib/python/Plugins/Extensions/DVDBurn/TitleCutter.py | 37 | 3306 | from enigma import iPlayableService, iServiceInformation
from Plugins.Extensions.CutListEditor.ui import CutListEditor
from Components.ServiceEventTracker import ServiceEventTracker
from Tools.Directories import fileExists
class TitleCutter(CutListEditor):
def __init__(self, session, t):
CutListEditor.__init__(se... | gpl-2.0 |
pilou-/ansible | lib/ansible/modules/cloud/amazon/s3_logging.py | 56 | 5320 | #!/usr/bin/python
# Copyright: 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterf... | gpl-3.0 |
gusaul/gigsblog | apps/blog/forms.py | 1 | 6550 | from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout,Div,Submit,HTML,Button,Row, Field
from crispy_forms.bootstrap import AppendedText, PrependedText, FormActions
from apps.blog.models import *
from django.core.urlresolvers import reverse
from django.utils.safestrin... | mit |
chinageology/GeoPython | geopytool/__init__.py | 1 | 71038 | #!/usr/bin/python3
# coding:utf-8
from geopytool.ImportDependence import *
from geopytool.CustomClass import *
LocationOfMySelf=os.path.dirname(__file__)
#print(LocationOfMySelf,' init')
sign = '''
created on Sat Dec 17 22:28:24 2016
@author: cycleuser
# Create Date: 2015-07-13
# Modify Date: 2018-02-09
a tool se... | gpl-3.0 |
gm-stack/mcproxy | src/nbt.py | 3 | 10384 | # http://github.com/twoolie/NBT/
from struct import pack, unpack
from gzip import GzipFile
TAG_END = 0
TAG_BYTE = 1
TAG_SHORT = 2
TAG_INT = 3
TAG_LONG = 4
TAG_FLOAT = 5
TAG_DOUBLE = 6
TAG_BYTE_ARRAY = 7
TAG_STRING = 8
TAG_LIST = 9
TAG_COMPOUND = 10
TAG_BYTEU = 11
TAG_UCS2_STRING = 12
TAG_BYTE_STRING = 13
class TAG(ob... | mit |
40223234/w16b_test | static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_break.py | 785 | 8138 | import gc
import io
import os
import sys
import signal
import weakref
import unittest
@unittest.skipUnless(hasattr(os, 'kill'), "Test requires os.kill")
@unittest.skipIf(sys.platform =="win32", "Test cannot run on Windows")
@unittest.skipIf(sys.platform == 'freebsd6', "Test kills regrtest on freebsd6 "
"if threa... | agpl-3.0 |
devincoughlin/swift | utils/cmpcodesize/tests/test_list_function_sizes.py | 60 | 1154 | # test_list_function_sizes.py - list_function_sizes unit tests -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt... | apache-2.0 |
panjia1983/hd_trajopt | src/sco/code_gen/gen_operations_code.py | 8 | 2136 | addition_overloads = """
inline AffExpr operator+(const Var& x, double y) {
return exprAdd(AffExpr(x), y);
}
inline AffExpr operator+(const AffExpr& x, double y) {
return exprAdd(x, y);
}
inline QuadExpr operator+(const QuadExpr& x, double y) {
return exprAdd(x, y);
}
inline AffExpr operator+(const Var& x, co... | bsd-2-clause |
indautgrp/erpnext | erpnext/patches/v5_4/stock_entry_additional_costs.py | 89 | 2010 | # Copyright (c) 2015, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import flt
def execute():
frappe.reload_doctype("Stock Entry")
frappe.reload_doctype("Stock Entry Detail")
frappe... | gpl-3.0 |
lebabouin/CouchPotatoServer-develop | libs/sqlalchemy/processors.py | 35 | 4220 | # sqlalchemy/processors.py
# Copyright (C) 2010-2011 the SQLAlchemy authors and contributors <see AUTHORS file>
# Copyright (C) 2010 Gaetan de Menten gdementen@gmail.com
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""defines generic ... | gpl-3.0 |
stevehof/location-ninja | lib/flask_admin/model/base.py | 2 | 41766 | import warnings
import re
from flask import request, url_for, redirect, flash, abort, json, Response
from jinja2 import contextfunction
from flask.ext.admin.babel import gettext
from flask.ext.admin.base import BaseView, expose
from flask.ext.admin.form import BaseForm, FormOpts, rules
from flask.ext.admin.model im... | gpl-3.0 |
yoghadj/or-tools | documentation/tutorials/python/chap2/cp_is_fun3.py | 37 | 3388 | # Copyright 2010-2011 Google
# 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, so... | apache-2.0 |
druuu/django | django/utils/cache.py | 220 | 15067 | """
This module contains helper functions for controlling caching. It does so by
managing the "Vary" header of responses. It includes functions to patch the
header of response objects directly and decorators that change functions to do
that header-patching themselves.
For information on the Vary header, see:
http... | bsd-3-clause |
barnone/EigenD | tools/packages/SCons/Tool/g77.py | 2 | 2478 | """engine.SCons.Tool.g77
Tool-specific initialization for g77.
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 The SCons Foundation
#
# ... | gpl-3.0 |
mozilla/captain | vendor/lib/python/pika/amqp_object.py | 3 | 1655 | """Base classes that are extended by low level AMQP frames and higher level
AMQP classes and methods.
"""
class AMQPObject(object):
"""Base object that is extended by AMQP low level frames and AMQP classes
and methods.
"""
NAME = 'AMQPObject'
INDEX = None
def __repr__(self):
items =... | mpl-2.0 |
benoitsteiner/tensorflow-opencl | tensorflow/contrib/cudnn_rnn/python/kernel_tests/cudnn_rnn_test.py | 5 | 38648 | # 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 |
skudriashev/incubator-airflow | tests/ti_deps/deps/test_not_in_retry_period_dep.py | 31 | 2298 | # -*- coding: utf-8 -*-
#
# 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
... | apache-2.0 |
kantai/passe-framework-prototype | passe-sample-apps/benchmarking/urls.py | 1 | 1388 | from django.conf.urls.defaults import patterns, include, url
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
# Examples:
url(r'^1', 'benchmarking.benchapp.views.i1'),
url(... | bsd-3-clause |
yongfuyang/vnpy | vn.archive/vn.lts_old/pyscript/generate_data_type.py | 70 | 2121 | # encoding: UTF-8
__author__ = 'CHENXY'
# C++和python类型的映射字典
type_dict = {
'int': 'int',
'char': 'string',
'double': 'float',
'short': 'int'
}
def process_line(line):
"""处理每行"""
if '///' in line: # 注释
py_line = process_comment(line)
elif 'typedef' in line: # 类型申明
... | mit |
BrandonY/gsutil | gslib/tests/util.py | 2 | 21616 | # -*- coding: utf-8 -*-
# Copyright 2013 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 require... | apache-2.0 |
NeostreamTechnology/Microservices | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/fields.py | 514 | 5931 | from __future__ import absolute_import
import email.utils
import mimetypes
from .packages import six
def guess_content_type(filename, default='application/octet-stream'):
"""
Guess the "Content-Type" of a file.
:param filename:
The filename to guess the "Content-Type" of using :mod:`mimetypes`.
... | mit |
angelapper/odoo | addons/mail/controllers/main.py | 7 | 11306 | import base64
from operator import itemgetter
import psycopg2
import werkzeug
from werkzeug import url_encode
import openerp
from openerp import SUPERUSER_ID
from openerp import http
from openerp.exceptions import AccessError
from openerp.http import request
from openerp.addons.web.controllers.main import binary_cont... | agpl-3.0 |
belmiromoreira/nova | nova/tests/unit/scheduler/filters/test_utils.py | 53 | 4207 | # Copyright 2015 IBM Corp.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | apache-2.0 |
funic/spitfire | spitfire/util.py | 9 | 2614 | import re
import string
import unicodedata
normal_characters = string.lowercase + string.uppercase
mangled_character_names = [
'LATIN SMALL LETTER A WITH RING ABOVE',
'LATIN SMALL LETTER THORN',
'LATIN SMALL LETTER C WITH CIRCUMFLEX',
'LATIN SMALL LETTER D WITH CARON',
'LATIN SMALL LETTER E WITH GRAVE',
'L... | bsd-3-clause |
sebi-hgdata/ansible | lib/ansible/utils/module_docs_fragments/files.py | 49 | 2491 | # (c) 2014, Matt Martz <matt@sivel.net>
#
# 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 |
sgiavasis/nipype | nipype/interfaces/nitime/tests/test_nitime.py | 10 | 2643 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import os
import tempfile
import numpy as np
from nipype.testing import (assert_equal, assert_raises, skipif)
from nipype.testing import example_data
import nipype.interfaces.nitime as nitime
no_nitime =... | bsd-3-clause |
gilgil1973/googletest | test/gtest_uninitialized_test.py | 2901 | 2480 | #!/usr/bin/env python
#
# Copyright 2008, 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 |
anryko/ansible | lib/ansible/module_utils/facts/system/cmdline.py | 88 | 2622 | # 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 in the hope that ... | gpl-3.0 |
endlessm/chromium-browser | third_party/grpc/src/examples/python/interceptors/default_value/default_value_client_interceptor.py | 18 | 2058 | # Copyright 2017 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... | bsd-3-clause |
mattnenterprise/servo | etc/ci/performance/test_submit_to_perfherder.py | 106 | 4677 | #!/usr/bin/env python3
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import submit_to_perfherder
def test_format_testcase_name():
assert('about:blank' == submi... | mpl-2.0 |
pdellaert/ansible | test/units/modules/source_control/test_bitbucket_pipeline_key_pair.py | 37 | 8552 | from ansible.module_utils.source_control.bitbucket import BitbucketHelper
from ansible.modules.source_control.bitbucket import bitbucket_pipeline_key_pair
from units.compat import unittest
from units.compat.mock import patch
from units.modules.utils import AnsibleFailJson, AnsibleExitJson, ModuleTestCase, set_module_ar... | gpl-3.0 |
CubicERP/odoo | addons/hw_scanner/__openerp__.py | 93 | 1686 | # -*- 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 |
jimi-c/ansible | test/units/module_utils/urls/test_Request.py | 9 | 13156 | # -*- coding: utf-8 -*-
# (c) 2018 Matt Martz <matt@sivel.net>
# 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 datetime
import os
from ansible.module_utils.urls import Request, op... | gpl-3.0 |
Yelp/sqlparse | sqlparse/formatter.py | 1 | 4605 | # Copyright (C) 2008 Andi Albrecht, albrecht.andi@gmail.com
#
# This module is part of python-sqlparse and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php.
"""SQL formatter"""
from sqlparse import filters
from sqlparse.exceptions import SQLParseError
def validate_options(opti... | bsd-3-clause |
broferek/ansible | lib/ansible/modules/cloud/amazon/ec2_tag.py | 3 | 5973 | #!/usr/bin/python
# Copyright: 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterf... | gpl-3.0 |
RickHutten/paparazzi | sw/misc/attitude_reference/c_att_refs/setup.py | 49 | 1703 | from distutils.core import setup, Extension
from Cython.Build import cythonize
from distutils.extension import Extension
import numpy
from os import path, getenv
# if PAPARAZZI_SRC not set, then assume the tree containing this
# file is a reasonable substitute
pprz_src = getenv("PAPARAZZI_SRC", path.normpath(path.joi... | gpl-2.0 |
welikecloud/bigtop | bigtop-packages/src/charm/mahout/layer-mahout/tests/01-mahout-test.py | 6 | 2393 | #!/usr/bin/env python3
# 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 "Lic... | apache-2.0 |
crazcalm/AngelHack_python34 | myenv/Lib/site-packages/pip/_vendor/colorama/ansitowin32.py | 287 | 6621 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
import re
import sys
from .ansi import AnsiFore, AnsiBack, AnsiStyle, Style
from .winterm import WinTerm, WinColor, WinStyle
from .win32 import windll
if windll is not None:
winterm = WinTerm()
def is_a_tty(stream):
return hasattr(s... | mit |
CCI-MOC/nova | nova/virt/libvirt/firewall.py | 56 | 15129 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in complianc... | apache-2.0 |
ckuethe/gnuradio | gr-analog/python/analog/qa_pll_refout.py | 40 | 8750 | #!/usr/bin/env python
#
# Copyright 2004,2010,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 ... | gpl-3.0 |
edenzik/SequelizeCraigslistCars | main.py | 1 | 2431 | import psycopg2 #Required libraries
import urllib2
import re
region = "boston"
domain = "craigslist.org"
site = 'http://' + region + '.' + domain
def parse(regex, text): #Parses line, splits using regex
line = re.findall(regex,text)
if len(line)==0:
line=""
else:
line = line[0]
return line... | unlicense |
voldi9/intervals | third_party/gtest/scripts/common.py | 1180 | 2919 | # Copyright 2013 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 foll... | gpl-3.0 |
zzicewind/nova | nova/tests/functional/v3/test_migrate_server.py | 3 | 3472 | # 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 |
jazztpt/edx-platform | cms/djangoapps/course_creators/tests/test_admin.py | 61 | 8188 | """
Tests course_creators.admin.py.
"""
from django.test import TestCase
from django.contrib.auth.models import User
from django.contrib.admin.sites import AdminSite
from django.http import HttpRequest
import mock
from course_creators.admin import CourseCreatorAdmin
from course_creators.models import CourseCreator
fr... | agpl-3.0 |
Jofemago/Computacion-Grafica | Librery/Colisiones/Plano.py | 2 | 4680 | #libreria
import pygame
from Algebralineal import *
BLANCO=(255,255,255)
NEGRO=(0,0,0)
ROJO=(255,0,0)
AZUL=(0,0,255)
VERDE=(0,255,0)
def triangulo(p, lsp):
pygame.draw.line(p,ROJO,lsp[0],lsp[1])
pygame.draw.line(p,ROJO,lsp[1],lsp[2])
pygame.draw.line(p,ROJO,lsp[2],lsp[0])
class Plano:
cx = 100
... | mit |
yubinbai/python_practice | radixSort.py | 2 | 1347 | from math import log
def getDigit(num, base, digit_num):
# pulls the selected digit
return (num // base ** digit_num) % base
def makeBlanks(size):
# create a list of empty lists to hold the split by digit
return [[] for i in range(size)]
def split(a_list, base, digit_num):
buckets = makeBlanks... | apache-2.0 |
tarzanjw/pyramid_backend | pyramid_backend/resources.py | 1 | 4553 | import six
__author__ = 'tarzan'
import urllib
from . import model as model_helper
import pyramid_backend as pb
def model_url(request, model, action=None, query=None):
"""
Get url for an model with its action
:type request: pyramid.request.Request
:type model: object
:type action: string
:ty... | mpl-2.0 |
Yaoshicn/decaptcha | decaptcha.py | 2 | 5364 | # __author__ = 'Yaoshi'
# -*- coding: utf-8 -*-
# This py file is to the split the captcha into single alphabet or number
from __future__ import division
import time
import urllib2
import socks
from sockshandler import SocksiPyHandler
from PIL import Image, ImageEnhance, ImageFilter, ImageGrab
class Decaptcha:
de... | mit |
BorisJeremic/Real-ESSI-Examples | analytic_solution/test_cases/8NodeBrick/square_plate_clamped/1layer/side_length_02/compare_HDF5_ALL.py | 424 | 3382 | #!/usr/bin/python
import h5py
import sys
import numpy as np
import os
import re
import random
# find the path to my own python function:
cur_dir=os.getcwd()
sep='test_cases'
test_DIR=cur_dir.split(sep,1)[0]
scriptDIR=test_DIR+'compare_function'
sys.path.append(scriptDIR)
# import my own function for color and comparat... | cc0-1.0 |
dichen001/Go4Jobs | JackChen/Google/140. Word Break II.py | 1 | 2337 | class Solution(object):
def wordBreak(self, s, wordDict):
"""
:type s: str
:type wordDict: List[str]
:rtype: bool
"""
# build Trie 50~70ms
root = {}
for w in wordDict:
node = root
for c in w:
if c not in no... | gpl-3.0 |
orgito/ansible | lib/ansible/utils/module_docs_fragments/onyx.py | 58 | 3458 | #
# 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 in the hope tha... | gpl-3.0 |
glwu/python-for-android | python-modules/twisted/twisted/test/test_roots.py | 81 | 1823 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.trial import unittest
from twisted.python import roots
import types
class RootsTest(unittest.TestCase):
def testExceptions(self):
request = roots.Request()
try:
request.write("blah")
... | apache-2.0 |
jomolinare/kobocat | onadata/apps/api/viewsets/organization_profile_viewset.py | 2 | 7442 | from django.contrib.auth.models import User
from django.utils.translation import ugettext as _
from rest_framework import status
from rest_framework.viewsets import ModelViewSet
from rest_framework.decorators import action
from rest_framework.response import Response
from onadata.apps.api.models.organization_profile ... | bsd-2-clause |
yoer/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/gis/geometry/test_data.py | 210 | 3013 | """
This module has the mock object definitions used to hold reference geometry
for the GEOS and GDAL tests.
"""
import json
import os
from django.contrib import gis
from django.utils import six
from django.utils._os import upath
# This global used to store reference geometry data.
GEOMETRIES = None
# Path where re... | apache-2.0 |
dkubiak789/odoo | openerp/addons/base/res/res_currency.py | 53 | 15562 | # -*- coding: 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 GNU... | agpl-3.0 |
bkendzior/scipy | scipy/sparse/dok.py | 16 | 17822 | """Dictionary Of Keys based matrix"""
from __future__ import division, print_function, absolute_import
__docformat__ = "restructuredtext en"
__all__ = ['dok_matrix', 'isspmatrix_dok']
import functools
import operator
import numpy as np
from scipy._lib.six import zip as izip, xrange, iteritems, itervalues
from .b... | bsd-3-clause |
umars/npyscreen | npyscreen/wgcheckbox.py | 14 | 5860 | #!/usr/bin/python
from .wgtextbox import Textfield
from .wgwidget import Widget
#from .wgmultiline import MultiLine
from . import wgwidget as widget
import curses
class _ToggleControl(Widget):
def set_up_handlers(self):
super(_ToggleControl, self).set_up_handlers()
self.handlers.upda... | bsd-2-clause |
rnelson/server | server.py | 1 | 3872 | #! env python
from __future__ import print_function, unicode_literals
from flask import Flask, Response, request, jsonify
from mimetypes import guess_type
from os.path import isfile
import sys
import sass
import lesscpy
app = Flask(__name__)
app.debug = True
INDEX_FILES = ['index.py', 'index.html', 'index.htm']
cla... | mit |
ashemedai/ansible | lib/ansible/plugins/action/debug.py | 97 | 3419 | # Copyright 2012, Dag Wieers <dag@wieers.com>
# Copyright 2016, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either versi... | gpl-3.0 |
MSOpenTech/edx-platform | lms/djangoapps/notes/views.py | 63 | 1158 | from django.contrib.auth.decorators import login_required
from django.http import Http404
from edxmako.shortcuts import render_to_response
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from courseware.courses import get_course_with_access
from notes.models import Note
from notes.utils import notes_enabl... | agpl-3.0 |
pwoolcoc/suds-py3k | suds/transport/__init__.py | 209 | 3895 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | lgpl-3.0 |
nemesisdesign/django | django/contrib/staticfiles/storage.py | 14 | 15222 | from __future__ import unicode_literals
import hashlib
import json
import os
import posixpath
import re
from collections import OrderedDict
from django.conf import settings
from django.contrib.staticfiles.utils import check_settings, matches_patterns
from django.core.cache import (
InvalidCacheBackendError, cache... | bsd-3-clause |
naokimiyasaka/sublime-text | Backup/20140314101742/BracketHighlighter/bh_modules/tags.py | 15 | 8695 | import re
from collections import namedtuple
import sublime
from os.path import basename
FLAGS = re.MULTILINE | re.IGNORECASE
HTML_START = re.compile(r'''<([\w\:\-]+)((?:\s+[\w\-:]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^>\s]+))?)*)\s*(\/?)>''', FLAGS)
CFML_START = re.compile(r'''<([\w\:\-]+)((?:\s+[\w\-\.:]+(?:\s*=\s*(?:"[^"]... | mit |
ahharu/plugin-manager | plugin_manager/core/mixins/views.py | 1 | 1465 |
from django.contrib import messages
from django.contrib.auth.views import redirect_to_login
from django.shortcuts import redirect
from django.contrib.auth.decorators import permission_required
from braces.views import GroupRequiredMixin, PermissionRequiredMixin
class MultipleGroupRequiredMixin(GroupRequiredMixin)... | mit |
ChristosChristofidis/bokeh | bokeh/server/models/user.py | 29 | 3604 | from __future__ import absolute_import
import uuid
from six import string_types
from werkzeug import generate_password_hash, check_password_hash
from bokeh.exceptions import DataIntegrityException
from .docs import Doc
from .. import models
def apiuser_from_request(app, request):
apikey = request.headers.get('... | bsd-3-clause |
INM-6/python-neo | neo/test/rawiotest/test_examplerawio.py | 3 | 1183 | """
Tests of neo.rawio.examplerawio
Note for dev:
if you write a new RawIO class your need to put some file
to be tested at g-node portal, Ask neuralensemble list for that.
The file need to be small.
Then you have to copy/paste/renamed the TestExampleRawIO
class and a full test will be done to test if the new coded I... | bsd-3-clause |
lpsinger/astropy | astropy/convolution/tests/test_discretize.py | 7 | 7064 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import itertools
import pytest
import numpy as np
from numpy.testing import assert_allclose
from astropy.convolution.utils import discretize_model
from astropy.modeling.functional_models import (
Gaussian1D, Box1D, RickerWavelet1D, Gaussian2D, Box2D... | bsd-3-clause |
EDUlib/edx-ora2 | openassessment/xblock/student_training_mixin.py | 1 | 9182 | """
Student training step in the OpenAssessment XBlock.
"""
import logging
from webob import Response
from xblock.core import XBlock
from openassessment.assessment.api import student_training
from openassessment.workflow.errors import AssessmentWorkflowError
from openassessment.xblock.data_conversion import convert_tra... | agpl-3.0 |
dednal/chromium.src | ppapi/native_client/tools/browser_tester/browsertester/server.py | 126 | 10676 | # Copyright (c) 2011 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 BaseHTTPServer
import cgi
import mimetypes
import os
import os.path
import posixpath
import SimpleHTTPServer
import SocketServer
import threading
... | bsd-3-clause |
eugene-eeo/prudent | prudent/sequence.py | 1 | 1162 | from itertools import chain
from collections import Sequence as _Seq
from .stream import Stream
class Sequence(Stream, _Seq):
"""
An indexable, mutable sequence atop a Stream.
"""
def __init__(self, *args, **kwargs):
Stream.__init__(self, *args, **kwargs)
self.cache = []
def iloa... | mit |
alisaifee/AutobahnPython | examples/twisted/websocket/echo_endpoints/client.py | 18 | 2936 | ###############################################################################
##
## Copyright (C) 2013 Tavendo GmbH
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http:/... | apache-2.0 |
scribblemaniac/AwakenDreamsClient | mcp/runtime/pylibs/jdfix.py | 5 | 1706 | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 18 11:19:07 2012
@author: Fesh0r
@version: v0.1
"""
import sys
import os
import fnmatch
import shutil
import re
from optparse import OptionParser
_REGEXP = {
# Remove trailing whitespace
'trailing': re.compile(r'[ \t]+$', re.MULTILINE),
# close up extends... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.