repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
markeTIC/OCB | addons/account/edi/invoice.py | 342 | 13984 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011-2012 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
charbeljc/hr | hr_contract_reference/__openerp__.py | 9 | 1484 | # -*- coding:utf-8 -*-
##############################################################################
#
# Copyright (C) 2011,2013 Michael Telahun Makonnen <mmakonnen@gmail.com>.
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Af... | agpl-3.0 |
MQQiang/kbengine | kbe/src/lib/python/Lib/curses/textpad.py | 155 | 7339 | """Simple textbox editing widget with Emacs-like keybindings."""
import curses
import curses.ascii
def rectangle(win, uly, ulx, lry, lrx):
"""Draw a rectangle with corners at the provided upper-left
and lower-right coordinates.
"""
win.vline(uly+1, ulx, curses.ACS_VLINE, lry - uly - 1)
win.hline(u... | lgpl-3.0 |
aldanor/blox | blox/utils.py | 1 | 1944 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import six
import struct
import functools
import numpy as np
try:
import ujson as json
json_dumps = json.dumps
except ImportError:
import json
json_dumps = functools.partial(json.dumps, separators=',:')
def flatten_dtype(dtype):
dty... | mit |
PythonCharmers/bokeh | bokeh/palettes.py | 52 | 24061 | YlGn3 = ["#31a354", "#addd8e", "#f7fcb9"]
YlGn4 = ["#238443", "#78c679", "#c2e699", "#ffffcc"]
YlGn5 = ["#006837", "#31a354", "#78c679", "#c2e699", "#ffffcc"]
YlGn6 = ["#006837", "#31a354", "#78c679", "#addd8e", "#d9f0a3", "#ffffcc"]
YlGn7 = ["#005a32", "#238443", "#41ab5d", "#78c679", "#a... | bsd-3-clause |
basimr/snoop-dogg-number | filter_graph_by_sdn.py | 1 | 1253 | #!/usr/bin/python2
# TODO: Add description.
import psycopg2
import networkx as nx
# TODO: Create a class for storing artists' SDN and path to avoid doing this.
SDN = 0
PATH = 1
# Load graph from disk
graph = nx.read_gexf("graph/sdn-unweighted.gexf")
# Initialize dictionary with the Snoop Dogg as the base case
arti... | mit |
kurokid/connme | connme/connme.py | 1 | 2726 | #!/usr/bin/env python2
import sip
sip.setapi('QString', 2)
from PyQt4 import QtGui, QtCore, QtNetwork
from connmeMain import connme
import sys,os
class SingleApplicationWithMessaging(QtGui.QApplication):
messageAvailable = QtCore.pyqtSignal(object)
def __init__(self, argv, key):
QtGui.QApplication._... | gpl-3.0 |
gooddata/openstack-nova | nova/tests/functional/notification_sample_tests/test_exception_notification.py | 4 | 1803 | # 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
# d... | apache-2.0 |
BaseBot/Triangula | src/python/triangula/navigation.py | 1 | 1101 | class TaskWaypoint:
"""
Consists of a target Pose defining a location and orientation, and a Task which should be run when the robot reaches
the target position. The task can be None, in which case the robot won't attempt to do anything at the target point.
"""
def __init__(self, pose, task=None, s... | apache-2.0 |
ehashman/oh-mainline | vendor/packages/python-social-auth/social/tests/backends/test_strava.py | 87 | 1882 | import json
from social.tests.backends.oauth import OAuth2Test
class StravaOAuthTest(OAuth2Test):
backend_path = 'social.backends.strava.StravaOAuth'
user_data_url = 'https://www.strava.com/api/v3/athlete'
expected_username = '227615'
access_token_body = json.dumps({
"access_token": "83ebeabdec... | agpl-3.0 |
nathanaevitas/odoo | openerp/addons/account_analytic_analysis/__init__.py | 425 | 1107 | # -*- 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... | agpl-3.0 |
EmreAtes/spack | var/spack/repos/builtin/packages/gnupg/package.py | 5 | 2213 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
cliqz/socorro | socorro/unittest/collector/test_collector_app.py | 10 | 1977 | # 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 mock
from nose.tools import eq_
from socorro.collector.collector_app import CollectorApp
from socorro.collector.... | mpl-2.0 |
mcollins12321/anita | venv/lib/python2.7/site-packages/flask/exthook.py | 783 | 5087 | # -*- coding: utf-8 -*-
"""
flask.exthook
~~~~~~~~~~~~~
Redirect imports for extensions. This module basically makes it possible
for us to transition from flaskext.foo to flask_foo without having to
force all extensions to upgrade at the same time.
When a user does ``from flask.ext.foo import... | mit |
TNT-Samuel/Coding-Projects | DNS Server/Source/Lib/site-packages/pip/_vendor/chardet/euckrfreq.py | 342 | 13546 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | gpl-3.0 |
osstech-jp/samba | python/samba/__init__.py | 17 | 12439 | # Unix SMB/CIFS implementation.
# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007-2008
#
# Based on the original in EJS:
# Copyright (C) Andrew Tridgell <tridge@samba.org> 2005
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publis... | gpl-3.0 |
hoatle/odoo | addons/website_mail/controllers/main.py | 149 | 4279 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
ArcherSys/ArcherSys | Lib/site-packages/pip/_vendor/requests/packages/chardet/euctwprober.py | 2994 | 1676 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mit |
lupyuen/RaspberryPiImage | home/pi/GrovePi/Software/Python/others/temboo/Library/Zoho/Sheet/DownloadSpreadsheet.py | 5 | 4174 | # -*- coding: utf-8 -*-
###############################################################################
#
# DownloadSpreadsheet
# Downloads a specified spreadsheet in a user's Zoho Sheet Account.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "... | apache-2.0 |
ivanlai/Kaggle-Planet-Amazon | PyTorch_models.py | 1 | 5862 | # Reference and ideas from http://pytorch.org/tutorials/beginner/transfer_learning_tutorial.html
from __future__ import print_function
import torch.nn as nn
import torchvision.models as models
import warnings
warnings.filterwarnings("ignore")
##################################################################
## ... | mit |
Dhivyap/ansible | lib/ansible/plugins/action/vyos.py | 7 | 4086 | #
# (c) 2016 Red Hat Inc.
#
# 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 d... | gpl-3.0 |
hi-ogawa/hiogawa-blog-ghost | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/lexers/text.py | 197 | 68779 | # -*- coding: utf-8 -*-
"""
pygments.lexers.text
~~~~~~~~~~~~~~~~~~~~
Lexers for non-source code file types.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from bisect import bisect
from pygments.lexer import Lexer, LexerC... | mit |
jfillmore/hoops | tests/models_tests/test_model_basekit_site.py | 1 | 4446 | from sqlalchemy.exc import IntegrityError
from tests.api_tests import APITestBase
from tests.models_tests import ModelsTestBase
from test_models.basekit import BaseKitBrand, BaseKitSite
from test_models.core import User
from hoops.common import BaseModel
import time
class TestBaseKitUserModel(ModelsTestBase):
de... | mit |
trozet/python-tackerclient | tackerclient/shell.py | 1 | 32048 | # Copyright 2012 OpenStack Foundation.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
supergis/QGIS | python/ext-libs/pygments/styles/autumn.py | 364 | 2144 | # -*- coding: utf-8 -*-
"""
pygments.styles.autumn
~~~~~~~~~~~~~~~~~~~~~~
A colorful style, inspired by the terminal highlighting style.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.to... | gpl-2.0 |
valtech-mooc/edx-platform | cms/djangoapps/contentstore/features/course-export.py | 62 | 2771 | # pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
# pylint: disable=unused-argument
from lettuce import world, step
from component_settings_editor_helpers import enter_xml_in_advanced_problem
from nose.tools import assert_true, assert_equal
from contentstore.utils import reverse_usage_url
@s... | agpl-3.0 |
skirsdeda/django | django/contrib/admindocs/urls.py | 574 | 1183 | from django.conf.urls import url
from django.contrib.admindocs import views
urlpatterns = [
url('^$',
views.BaseAdminDocsView.as_view(template_name='admin_doc/index.html'),
name='django-admindocs-docroot'),
url('^bookmarklets/$',
views.BookmarkletsView.as_view(),
name='django-ad... | bsd-3-clause |
peterlauri/django | django/contrib/gis/sitemaps/views.py | 144 | 2365 | from __future__ import unicode_literals
from django.apps import apps
from django.contrib.gis.db.models.fields import GeometryField
from django.contrib.gis.db.models.functions import AsKML, Transform
from django.contrib.gis.shortcuts import render_to_kml, render_to_kmz
from django.core.exceptions import FieldDoesNotExi... | bsd-3-clause |
40423248/2017springcd_hw | data/w2/cd_w2a.py | 17 | 1084 | #import os
adata = open("w2a_cadlab.txt", encoding="utf-8").read()
rdata = open("w2a_registered.txt", encoding="utf-8").read().splitlines()
#print(adata)
alist = adata.splitlines()
#print(alist[2])
n = 0
row = 0
final_list = []
w2_list = []
for stud_num in alist[2:]:
row = row + 1
blist = stud_num.split("\t")
... | agpl-3.0 |
jhsenjaliya/incubator-airflow | airflow/hooks/http_hook.py | 15 | 4307 | # -*- 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 |
paolodedios/tensorflow | tensorflow/python/keras/distribute/keras_dnn_correctness_test.py | 6 | 13341 | # Copyright 2019 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 |
damianmoore/django-cms | cms/migrations/0041_auto__add_usersettings.py | 15 | 16370 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
try:
from django.contrib.auth import get_user_model
except ImportError: # django < 1.5
from django.contrib.auth.models import User
else:
User = get_user_model()
user_orm_label... | bsd-3-clause |
demisto/content | Packs/DNSDB/Integrations/DNSDB_v2/DNSDB_v2.py | 1 | 30136 | # Copyright (c) 2020 by Farsight Security, 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 agre... | mit |
ZazieTheBeast/oscar | oscar/lib/python2.7/site-packages/pip/vcs/mercurial.py | 514 | 3472 | from __future__ import absolute_import
import logging
import os
import tempfile
from pip.utils import display_path, rmtree
from pip.vcs import vcs, VersionControl
from pip.download import path_to_url
from pip._vendor.six.moves import configparser
logger = logging.getLogger(__name__)
class Mercurial(VersionControl... | bsd-3-clause |
beacloudgenius/edx-platform | common/djangoapps/external_auth/tests/test_shib.py | 20 | 30727 | # -*- coding: utf-8 -*-
"""
Tests for Shibboleth Authentication
@jbau
"""
import unittest
from ddt import ddt, data
from django.conf import settings
from django.http import HttpResponseRedirect
from django.test import TestCase
from django.test.client import RequestFactory, Client as DjangoTestClient
from django.test.u... | agpl-3.0 |
xujun10110/golismero | thirdparty_libs/geopy/geocoders/yahoo.py | 46 | 3135 | """
Wrapper to the Yahoo's new PlaceFinder API. (doc says that the API RELEASE 1.0 (22 JUNE 2010))
"""
import xml.dom.minidom
from geopy import util
from geopy import Point
from urllib import urlencode
from urllib2 import urlopen
from geopy.geocoders.base import Geocoder
try:
import json
except ImportError:
try... | gpl-2.0 |
haveal/googleads-python-lib | examples/dfp/v201505/report_service/run_report_with_custom_fields.py | 4 | 3264 | #!/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 |
risent/unidecode | unidecode/x0b2.py | 253 | 4680 | data = (
'nyok', # 0x00
'nyot', # 0x01
'nyop', # 0x02
'nyoh', # 0x03
'nu', # 0x04
'nug', # 0x05
'nugg', # 0x06
'nugs', # 0x07
'nun', # 0x08
'nunj', # 0x09
'nunh', # 0x0a
'nud', # 0x0b
'nul', # 0x0c
'nulg', # 0x0d
'nulm', # 0x0e
'nulb', # 0x0f
'nuls', # 0x10
'nult', ... | gpl-2.0 |
asadziach/tensorflow | tensorflow/python/saved_model/builder_impl.py | 14 | 18751 | # 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 |
ran5515/DeepDecision | tensorflow/examples/tutorials/input_fn/boston.py | 76 | 2920 | # 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 appl... | apache-2.0 |
Erebot/Module_GoF | docs/src/conf.py | 31 | 1241 | # -*- coding: utf-8 -*-
import os
import stat
from os.path import join, abspath
from subprocess import call
def prepare(globs, locs):
# RTD defaults the current working directory to where conf.py resides.
# In our case, that means <root>/docs/src/.
cwd = os.getcwd()
root = abspath(join(cwd, '..', '..'... | gpl-3.0 |
pywirrarika/smtwixes | wixnlp/seg.py | 2 | 2752 | #!/usr/bin/env python3
# Copyright (C) 2016.
# Author: Jesús Manuel Mager Hois
# e-mail: <fongog@gmail.com>
# Project website: http://turing.iimas.unam.mx/wix/
# 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 Softw... | gpl-3.0 |
codeforsanjose/calischools | schools/serializers.py | 1 | 1123 | from rest_framework import serializers
from .models import County, District, School
class CountySerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = County
class CountyMixin(serializers.Serializer):
county = CountySerializer(read_only=True)
class DistrictCompactSerializer(seria... | mit |
mdaniel/intellij-community | python/helpers/py2only/docutils/parsers/rst/directives/tables.py | 86 | 20344 | # $Id: tables.py 7747 2014-03-20 10:51:10Z milde $
# Authors: David Goodger <goodger@python.org>; David Priest
# Copyright: This module has been placed in the public domain.
"""
Directives for table elements.
"""
__docformat__ = 'reStructuredText'
import sys
import os.path
import csv
from docutils import io, nodes... | apache-2.0 |
0k/OpenUpgrade | addons/hr_expense/__openerp__.py | 52 | 2896 | # -*- 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 |
ddzialak/boto | boto/sqs/bigmessage.py | 170 | 4729 | # Copyright (c) 2013 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2013 Amazon.com, Inc. or its affiliates.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, includin... | mit |
stiartsly/pjsip | pjsip-apps/src/swig/importsym.py | 20 | 5108 | # $Id: importsym.py 4704 2014-01-16 05:30:46Z ming $
#
# importsym.py: Import C symbol decls (structs, enums, etc) and write them
# to another file
#
# Copyright (C)2013 Teluu Inc. (http://www.teluu.com)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the ... | gpl-2.0 |
marcoantoniooliveira/labweb | tests/integration/core/validator_tests.py | 62 | 2408 | from django.test import TestCase
from django.core.exceptions import ValidationError
from django.contrib.flatpages.models import FlatPage
from oscar.core.validators import ExtendedURLValidator
from oscar.core.validators import URLDoesNotExistValidator
class TestExtendedURLValidatorWithVerifications(TestCase):
"""... | bsd-3-clause |
MungoRae/home-assistant | homeassistant/components/device_tracker/luci.py | 12 | 5084 | """
Support for OpenWRT (luci) routers.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.luci/
"""
import json
import logging
import re
import requests
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from home... | apache-2.0 |
RIOT-OS/RIOT | dist/tools/kconfiglib/genconfig.py | 7 | 15262 | #!/usr/bin/env python3
# Copyright (c) 2018-2019, Ulf Magnusson
# 2020 HAW Hamburg
# SPDX-License-Identifier: ISC
"""
This script is used to merge multiple configuration sources and generate
different outputs related to Kconfig:
- Generate a header file with #defines from the configuration, matching th... | lgpl-2.1 |
mdavoodi/konkourse-python | conversation/views.py | 1 | 4095 | from django.http import HttpResponse
from django.utils import simplejson
from account.models import UserProfile
from conversation.models import ConversationPost, ConvoWall, ConversationComment
from notification.views import notifyComment, notifyPost
def post(request):
results = {'success': False}
if request.u... | mit |
p4datasystems/CarnotKEdist | dist/Lib/xml/dom/pulldom.py | 109 | 11972 | import xml.sax
import xml.sax.handler
import types
try:
_StringTypes = [types.StringType, types.UnicodeType]
except AttributeError:
_StringTypes = [types.StringType]
START_ELEMENT = "START_ELEMENT"
END_ELEMENT = "END_ELEMENT"
COMMENT = "COMMENT"
START_DOCUMENT = "START_DOCUMENT"
END_DOCUMENT = "END_DOCUMENT"
... | apache-2.0 |
tadebayo/myedge | edge/src/edge/settings/production.py | 2 | 1789 | # In production set the environment variable like this:
# DJANGO_SETTINGS_MODULE=edge.settings.production
from .base import * # NOQA
import logging.config
# For security and performance reasons, DEBUG is turned off
DEBUG = False
TEMPLATE_DEBUG = False
# Must mention ALLOWED_HOSTS in production!
# ALLOW... | mit |
XENON1T/processing | montecarlo/fax_waveform/CreateFakeCSV.py | 1 | 4806 | #################################
## Sub-code used in WF simulation
## It creates a csv file for the input of fax
## by Qing Lin
## @ 2016-09-12
##
## HARDCODE WARNING: The FV dimensions below need to be modified
## according to the detector you wish to simulate
##
## Ref: http://xenon1t.github.io/pax... | apache-2.0 |
gdooper/scipy | scipy/sparse/compressed.py | 14 | 43146 | """Base class for sparse matrix formats using compressed storage."""
from __future__ import division, print_function, absolute_import
__all__ = []
from warnings import warn
import operator
import numpy as np
from scipy._lib.six import zip as izip
from .base import spmatrix, isspmatrix, SparseEfficiencyWarning
from ... | bsd-3-clause |
SporkCoin/spork | spork/users/tests/test_views.py | 367 | 1840 | from django.test import RequestFactory
from test_plus.test import TestCase
from ..views import (
UserRedirectView,
UserUpdateView
)
class BaseUserTestCase(TestCase):
def setUp(self):
self.user = self.make_user()
self.factory = RequestFactory()
class TestUserRedirectView(BaseUserTestCa... | mit |
harshhemani/keras | tests/auto/keras/test_constraints.py | 78 | 2446 | import unittest
import numpy as np
from numpy.testing import assert_allclose
from theano import tensor as T
class TestConstraints(unittest.TestCase):
def setUp(self):
self.some_values = [0.1, 0.5, 3, 8, 1e-7]
np.random.seed(3537)
self.example_array = np.random.random((100, 100)) * 100. - 5... | mit |
akhan7/servo | tests/wpt/web-platform-tests/tools/py/py/_io/terminalwriter.py | 175 | 12542 | """
Helper functions for writing to terminals and files.
"""
import sys, os
import py
py3k = sys.version_info[0] >= 3
from py.builtin import text, bytes
win32_and_ctypes = False
colorama = None
if sys.platform == "win32":
try:
import colorama
except ImportError:
try:
import ctyp... | mpl-2.0 |
teheavy/AMA3D | Nh3D/3_CathTopo_uploader.py | 1 | 1726 | # Script Version: 1.0
# Author: Te Chen
# Project: AMA3D
# Task Step: 1
# This script is specially for loading CATH Node Name file and record all the topology level into database.
# CathDomainList File format: Cath Names File (CNF) Format 2.0, to find more info, please visit www.cathdb.info
import MySQLdb
import os
i... | gpl-2.0 |
mustafat/odoo-1 | addons/pos_restaurant/restaurant.py | 325 | 2246 | # -*- 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 |
juliengdt/juliengdt-resources | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexers/hdl.py | 363 | 16209 | # -*- coding: utf-8 -*-
"""
pygments.lexers.hdl
~~~~~~~~~~~~~~~~~~~
Lexers for hardware descriptor languages.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, bygroups, include, using, t... | mit |
jwlawson/tensorflow | tensorflow/python/framework/graph_io.py | 46 | 2434 | # 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 |
fangxingli/hue | desktop/core/ext-py/openpyxl-2.3.0-b2/openpyxl/chart/_3d.py | 10 | 3063 | from __future__ import absolute_import
# Copyright (c) 2010-2015 openpyxl
from openpyxl.descriptors import Typed, Alias
from openpyxl.descriptors.serialisable import Serialisable
from openpyxl.descriptors.nested import (
NestedBool,
NestedInteger,
NestedMinMax,
)
from openpyxl.descriptors.excel import Exte... | apache-2.0 |
grevutiu-gabriel/phantomjs | src/qt/qtwebkit/Source/WebCore/inspector/generate_protocol_externs.py | 117 | 9058 | #!/usr/bin/env python
# Copyright (c) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list ... | bsd-3-clause |
TwinkleChawla/nova | nova/api/auth.py | 13 | 5832 | # Copyright (c) 2011 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | apache-2.0 |
patrickwind/My_Blog | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py | 2360 | 3778 | """The match_hostname() function from Python 3.3.3, essential when using SSL."""
# Note: This file is under the PSF license as the code comes from the python
# stdlib. http://docs.python.org/3/license.html
import re
__version__ = '3.4.0.2'
class CertificateError(ValueError):
pass
def _dnsname_match(dn, host... | gpl-2.0 |
andris210296/andris-projeto | backend/venv/test/lib/python2.7/site-packages/unidecode/x05b.py | 252 | 4668 | data = (
'Gui ', # 0x00
'Deng ', # 0x01
'Zhi ', # 0x02
'Xu ', # 0x03
'Yi ', # 0x04
'Hua ', # 0x05
'Xi ', # 0x06
'Hui ', # 0x07
'Rao ', # 0x08
'Xi ', # 0x09
'Yan ', # 0x0a
'Chan ', # 0x0b
'Jiao ', # 0x0c
'Mei ', # 0x0d
'Fan ', # 0x0e
'Fan ', # 0x0f
'Xian ', # 0x10
'Yi '... | mit |
avihad/ARP-Storm | src/arp_open_flow/pox/samples/pretty_log.py | 47 | 1166 | # Copyright 2012-2013 James McCauley
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | apache-2.0 |
Intel-Corporation/tensorflow | tensorflow/contrib/slim/python/slim/data/dataset_data_provider.py | 56 | 4253 | # 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 |
brandond/ansible | test/units/modules/network/f5/test_bigip_asm_policy.py | 17 | 20611 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# 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 os
import json
import pytest
import sys
if sys.version_info < (2, ... | gpl-3.0 |
Copenbacon/code-katas | katas/baker.py | 1 | 1095 | """Pete likes to bake some cakes. He has some recipes and ingredients. Unfortunately he is not good in maths. Can you help him to find out, how many cakes he could bake considering his recipes?
Write a function cakes(), which takes the recipe (object) and the available ingredients (also an object) and returns the maxi... | mit |
holmes/intellij-community | python/testData/codeInsight/classMRO/TangledInheritance.py | 79 | 6841 |
class Class001(object):
unique_attr = 1
class Class002(Class001):
unique_attr = 2
class Class003(Class002, Class001):
unique_attr = 3
class Class004(Class003, Class002, Class001):
unique_attr = 4
class Class005(Class004, Class003, Class002):
unique_attr = 5
class Class006(Class005, Class... | apache-2.0 |
openshift/openshift-tools | openshift/installer/vendored/openshift-ansible-3.11.28-1/roles/lib_openshift/src/test/unit/test_oc_secret.py | 62 | 6303 | '''
Unit tests for oc secret
'''
import os
import six
import sys
import unittest
import mock
# Removing invalid variable names for tests so that I can
# keep them brief
# pylint: disable=invalid-name,no-name-in-module
# Disable import-error b/c our libraries aren't loaded in jenkins
# pylint: disable=import-error,wr... | apache-2.0 |
andela-earinde/bellatrix-py | app/js/lib/lib/modules/test/test_sys.py | 2 | 29154 | # -*- coding: utf-8 -*-
import unittest, test.test_support
from test.script_helper import assert_python_ok, assert_python_failure
import sys, os, cStringIO
import struct
import operator
class SysModuleTest(unittest.TestCase):
def tearDown(self):
test.test_support.reap_children()
def test_original_dis... | mit |
HiSPARC/station-software | user/python/Lib/ctypes/test/test_find.py | 9 | 2116 | import unittest
import os.path
import sys
from test import test_support
from ctypes import *
from ctypes.util import find_library
from ctypes.test import is_resource_enabled
if sys.platform == "win32":
lib_gl = find_library("OpenGL32")
lib_glu = find_library("Glu32")
lib_gle = None
elif sys.platform == "da... | gpl-3.0 |
pmghalvorsen/gramps_branch | gramps/plugins/view/view.gpr.py | 1 | 8180 | # encoding:utf-8
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2009 Benny Malengier
# Copyright (C) 2009 Douglas S. Blank
# Copyright (C) 2009 Nick Hall
# Copyright (C) 2011 Tim G L Lyons
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Gener... | gpl-2.0 |
ackalker/ocrfeeder | src/ocrfeeder/odf/presentation.py | 96 | 2714 | # -*- coding: utf-8 -*-
# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at you... | gpl-3.0 |
phassoa/openelisglobal-core | liquibase/OE5.1/testCatalogKenya/Scripts/resultLimits.py | 15 | 4081 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def get_split_names( name ):
split_name_list = name.split("/")
for i in range(0, len(split_name_list)):
split_name_list[i] = split_name_list[i].strip()
return split_name_list
def esc_char(name):
if "'" in name:
return "... | mpl-2.0 |
joeythesaint/yocto-autobuilder | lib/python2.7/site-packages/buildbot_slave-0.8.8-py2.7.egg/buildslave/monkeypatches/bug5079.py | 16 | 1886 | # This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
jruiperezv/ANALYSE | common/djangoapps/terrain/stubs/tests/test_youtube_stub.py | 51 | 2492 | """
Unit test for stub YouTube implementation.
"""
import unittest
import requests
from ..youtube import StubYouTubeService
class StubYouTubeServiceTest(unittest.TestCase):
def setUp(self):
self.server = StubYouTubeService()
self.url = "http://127.0.0.1:{0}/".format(self.server.port)
sel... | agpl-3.0 |
minghuascode/pyj | library/pyjamas/ui/BuilderPanel.py | 1 | 3810 | """ Pyjamas UI BuilderPanel: takes a PyJsGlade builder spec and adds widgets
requested using the methods just like in any other Panel class.
Copyright (C) 2010 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
The purpose of this class is to be able to set up a Panel of any type
that can be dynamically created using B... | apache-2.0 |
erikdejonge/newsrivr | daemons/python2/hn.py | 1 | 17227 | """
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 the hope that it will be useful,
but WITHOUT... | gpl-2.0 |
lmazuel/azure-sdk-for-python | azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_create_parameters.py | 2 | 2739 | # 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 |
havard024/prego | venv/lib/python2.7/site-packages/unidecode/x0b7.py | 253 | 4833 | data = (
'ddwim', # 0x00
'ddwib', # 0x01
'ddwibs', # 0x02
'ddwis', # 0x03
'ddwiss', # 0x04
'ddwing', # 0x05
'ddwij', # 0x06
'ddwic', # 0x07
'ddwik', # 0x08
'ddwit', # 0x09
'ddwip', # 0x0a
'ddwih', # 0x0b
'ddyu', # 0x0c
'ddyug', # 0x0d
'ddyugg', # 0x0e
'ddyugs', # 0x0f
'dd... | mit |
jaywreddy/django | tests/defer_regress/models.py | 282 | 2692 | """
Regression tests for defer() / only() behavior.
"""
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Item(models.Model):
name = models.CharField(max_length=15)
text = models.TextField(default="xyzzy")
value = models.IntegerF... | bsd-3-clause |
Russell-IO/ansible | lib/ansible/modules/network/cnos/cnos_factory.py | 35 | 5267 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
#
# Copyright (C) 2017 Lenovo, Inc.
#
# 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 Licens... | gpl-3.0 |
ChristinaZografou/sympy | sympy/core/exprtools.py | 9 | 49175 | """Tools for manipulating of large commutative expressions. """
from __future__ import print_function, division
from sympy.core.add import Add
from sympy.core.compatibility import iterable, is_sequence, SYMPY_INTS, range
from sympy.core.mul import Mul, _keep_coeff
from sympy.core.power import Pow
from sympy.core.basi... | bsd-3-clause |
regispl/cassandra | pylib/cqlshlib/sslhandling.py | 85 | 3725 | # 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 u... | apache-2.0 |
looker/sentry | src/sentry/plugins/bases/issue2.py | 1 | 15435 | from __future__ import absolute_import
import six
from rest_framework.response import Response
from social_auth.models import UserSocialAuth
from django.conf import settings
from django.conf.urls import url
from django.core.urlresolvers import reverse
from django.utils.html import format_html
from sentry.api.serial... | bsd-3-clause |
olgabot/poshsplice | docs/conf.py | 1 | 8434 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# poshsplice documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 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
# ... | bsd-3-clause |
Freso/listenbrainz-server | listenbrainz/tests/utils.py | 2 | 1125 | # coding=utf-8
from datetime import datetime
import time
import sys
import os
from listenbrainz.listen import Listen
import uuid
import listenbrainz.db.user as db_user
def generate_data(from_date, num_records, user_name):
test_data = []
current_date = to_epoch(from_date)
artist_msid = str(uuid.uuid4())
... | gpl-2.0 |
mbayon/TFG-MachineLearning | vbig/lib/python2.7/site-packages/pandas/util/testing.py | 3 | 92623 | from __future__ import division
# pylint: disable-msg=W0402
import re
import string
import sys
import tempfile
import warnings
import inspect
import os
import subprocess
import locale
import traceback
from datetime import datetime
from functools import wraps, partial
from contextlib import contextmanager
from distuti... | mit |
harry-7/Plinth | plinth/modules/upgrades/forms.py | 9 | 1246 | #
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | agpl-3.0 |
pixelmatix/fadecandy | firmware/benchmark.py | 16 | 2605 | #!/usr/bin/env python
#
# Read the device's performance counters, calculate benchmark values.
#
# Micah Elizabeth Scott
# This example code is released into the public domain.
#
import usb.core
import usb.util
import time, struct, sys
dev = usb.core.find(idVendor=0x1d50, idProduct=0x607a)
if not dev:
raise IOErro... | mit |
DIRACGrid/DIRAC | integration_tests.py | 1 | 25030 | #!/usr/bin/env python
import fnmatch
import os
from pathlib import Path
import re
import shlex
import subprocess
import sys
import tempfile
import time
from concurrent.futures import ThreadPoolExecutor
from contextlib import contextmanager
from typing import Optional
import click
import git
import typer
import yaml
fr... | gpl-3.0 |
mostaphaRoudsari/Honeybee | src/Honeybee_EnergyPlus Window Air Gap.py | 1 | 3032 | #
# Honeybee: A Plugin for Environmental Analysis (GPL) started by Mostapha Sadeghipour Roudsari
#
# This file is part of Honeybee.
#
# Copyright (c) 2013-2020, Mostapha Sadeghipour Roudsari <mostapha@ladybug.tools>
# Honeybee is free software; you can redistribute it and/or modify
# it under the terms of the GNU G... | gpl-3.0 |
orlov-vo/mtasa | vendor/google-breakpad/src/tools/gyp/test/copies/gyptest-slash.py | 249 | 1433 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""
Verifies file copies with a trailing slash in the destination directory.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('cop... | gpl-3.0 |
huchoi/edx-platform | common/lib/xmodule/xmodule/modulestore/split_mongo/caching_descriptor_system.py | 3 | 7547 | import sys
import logging
from xblock.runtime import KvsFieldData
from xblock.fields import ScopeIds
from opaque_keys.edx.locator import BlockUsageLocator, LocalId, CourseLocator
from xmodule.mako_module import MakoDescriptorSystem
from xmodule.error_module import ErrorDescriptor
from xmodule.errortracker import exc_in... | agpl-3.0 |
justajeffy/anim-studio-tools | probe/sources/probe/fixtures/mock_tank.py | 5 | 6419 | #
# Copyright 2009 Dr D Studios Pty Limited (ACN 127 184 954) (Dr. D Studios), its
# affiliates and/or its licensors.
#
class MockLabels(object):
"""
Mock labels object, to aid in unit testing.
Emulates Tank behavior where labels are also properties!
.. versionadded:: 0.2.0
"""
def ... | gpl-3.0 |
klmitch/neutron | neutron/plugins/ml2/drivers/openvswitch/agent/openflow/native/ovs_bridge.py | 4 | 3317 | # Copyright (C) 2014,2015 VA Linux Systems Japan K.K.
# Copyright (C) 2014,2015 YAMAMOTO Takashi <yamamoto at valinux co jp>
# 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 t... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.