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 |
|---|---|---|---|---|---|
mmcbride1/python-coretemp | coretemp/sensor_reading.py | 1 | 4790 | import re
import os
import sys
import subprocess
import sensors as r
import coretemp_log as log
import coretemp_config as conf
from collections import OrderedDict
''' Get sensor constants '''
from coretemp_constants import SUB_MAX_TYPE, SUB_CRT_TYPE, CHIP, NORM, HIGH, CRTC
class SensorReading:
''' Store sensor t... | mit |
Inferno42/Lerum-Engine | Platformer/freetype-2.4.0/src/tools/chktrcmp.py | 381 | 3826 | #!/usr/bin/env python
#
# Check trace components in FreeType 2 source.
# Author: suzuki toshiya, 2009
#
# This code is explicitly into the public domain.
import sys
import os
import re
SRC_FILE_LIST = []
USED_COMPONENT = {}
KNOWN_COMPONENT = {}
SRC_FILE_DIRS = [ "src" ]
TRACE_DEF_FILES = [ "include/freetype/in... | gpl-2.0 |
stevelle/glance | glance/i18n.py | 16 | 1109 | # Copyright 2014 Red Hat, 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... | apache-2.0 |
cluck/dnspython | dns/rdtypes/ANY/SSHFP.py | 8 | 2829 | # Copyright (C) 2005-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | isc |
orymeyer/Flask-Python-GAE-Login-Registration | lib/werkzeug/contrib/securecookie.py | 294 | 12204 | # -*- coding: utf-8 -*-
r"""
werkzeug.contrib.securecookie
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module implements a cookie that is not alterable from the client
because it adds a checksum the server checks for. You can use it as
session replacement if all you have is a user id or something to mark
... | apache-2.0 |
minhphung171093/OpenERP_V8 | openerp/addons/email_template/wizard/mail_compose_message.py | 197 | 11797 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
inexactually/irisbot | utils.py | 1 | 2817 | import aiohttp
import inspect
import io
import discord
from discord.ext import commands
import settings
def setting(name, default):
return getattr(settings, name, default)
def pretty_list(names, bold=True, conjunction='and', empty=''):
names = list(names)
if not names:
return empty
if bold:... | mit |
censof/ansible-deployment | django_app_server_db_server/deployment/templates/common.py | 1 | 3942 | import os.path
# Configuration modules.
from ._installed_apps import *
from ._middleware import *
from ._context_processors import *
from ._email import *
from ._eclaim import *
_ = lambda s: s
# Debugging mode.
DEBUG = False
TEMPLATE_DEBUG = False
if DEMO_MODE:
SEND_NOTIF_EMAILS = False
else:
SEND_NOTIF_... | mit |
cdjones32/vertx-web | src/test/sockjs-protocol/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/langhebrewmodel.py | 2763 | 11318 | ######################## 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... | apache-2.0 |
M4sse/chromium.src | third_party/cython/src/Cython/Build/BuildExecutable.py | 98 | 4286 | """
Compile a Python script into an executable that embeds CPython and run it.
Requires CPython to be built as a shared library ('libpythonX.Y').
Basic usage:
python cythonrun somefile.py [ARGS]
"""
DEBUG = True
import sys
import os
from distutils import sysconfig
def get_config_var(name, default=''):
retu... | bsd-3-clause |
debsankha/networkx | networkx/readwrite/multiline_adjlist.py | 13 | 11887 | # -*- coding: utf-8 -*-
"""
*************************
Multi-line Adjacency List
*************************
Read and write NetworkX graphs as multi-line adjacency lists.
The multi-line adjacency list format is useful for graphs with
nodes that can be meaningfully represented as strings. With this format
simple edge dat... | bsd-3-clause |
catapult-project/catapult | dependency_manager/dependency_manager/exceptions.py | 14 | 1695 | # Copyright 2015 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.
from py_utils import cloud_storage
CloudStorageError = cloud_storage.CloudStorageError
class UnsupportedConfigFormatError(ValueError):
def __init__(sel... | bsd-3-clause |
quantumlib/Cirq | cirq-core/cirq/experiments/purity_estimation.py | 1 | 2467 | # Copyright 2020 The Cirq Developers
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | apache-2.0 |
ActiveState/code | recipes/Python/578414_Takuzu_solver/recipe-578414.py | 1 | 4263 | # Copyright 2013 Eviatar Bach, eviatarbach@gmail.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | mit |
quantumlib/OpenFermion | src/openfermion/testing/performance_benchmarks.py | 1 | 11534 | # 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
# distribu... | apache-2.0 |
jtopjian/st2 | st2common/tests/unit/test_reference.py | 2 | 3724 | # Licensed to the StackStorm, Inc ('StackStorm') 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 use th... | apache-2.0 |
vbraun/oxford-strings | app/calendar_view.py | 1 | 6003 | # -*- coding: utf-8 -*-
"""
Calendaring Page Views
"""
import sys
import os
import uuid
import logging
from datetime import date, datetime, timedelta
from webapp2 import uri_for
from google.appengine.api import users
import app.config as config
from app.base_view import RequestHandler
from app.decorators import cach... | gpl-2.0 |
jjmiranda/edx-platform | common/lib/xmodule/xmodule/tests/test_export.py | 35 | 6802 | """
Tests of XML export
"""
import ddt
import lxml.etree
import mock
import pytz
import shutil
import unittest
from datetime import datetime, timedelta, tzinfo
from fs.osfs import OSFS
from path import Path as path
from tempfile import mkdtemp
from textwrap import dedent
from xblock.core import XBlock
from xblock.fi... | agpl-3.0 |
jiangzhuo/kbengine | kbe/src/lib/python/Lib/test/test_mimetypes.py | 111 | 4279 | import io
import locale
import mimetypes
import sys
import unittest
from test import support
# Tell it we don't know about external files:
mimetypes.knownfiles = []
mimetypes.inited = False
mimetypes._default_mime_types()
class MimeTypesTestCase(unittest.TestCase):
def setUp(self):
self.db = mimetypes.M... | lgpl-3.0 |
mbrukman/flocker | vagrant/tutorial/post-reboot-bootstrap.py | 4 | 5139 | #!/usr/bin/python
# This script builds the base flocker-tutorial box.
import sys
import os
from subprocess import check_call, check_output
from textwrap import dedent
from urlparse import urljoin
if len(sys.argv) != 4:
print "Wrong number of arguments."
raise SystemExit(1)
rpm_version = sys.argv[1]
branch =... | apache-2.0 |
xiaojimao18/shadowsocks | shadowsocks/eventloop.py | 949 | 7288 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013-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 requi... | apache-2.0 |
fxia22/ASM_xf | PythonD/lib/python2.4/lib-tk/ScrolledText.py | 20 | 1638 | # A ScrolledText widget feels like a text widget but also has a
# vertical scroll bar on its right. (Later, options may be added to
# add a horizontal bar as well, to make the bars disappear
# automatically when not needed, to move them to the other side of the
# window, etc.)
#
# Configuration options are passed to t... | gpl-2.0 |
Havate/havate-openstack | proto-build/gui/horizon/Horizon_GUI/horizon/management/commands/startdash.py | 79 | 2888 | # 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 |
n-west/gnuradio-volk | gr-digital/python/digital/qa_constellation_receiver.py | 52 | 8241 | #!/usr/bin/env python
#
# Copyright 2011,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your opt... | gpl-3.0 |
watspidererik/testenv | flask/lib/python2.7/site-packages/setuptools/command/upload_docs.py | 71 | 6811 | # -*- coding: utf-8 -*-
"""upload_docs
Implements a Distutils 'upload_docs' subcommand (upload documentation to
PyPI's pythonhosted.org).
"""
from base64 import standard_b64encode
from distutils import log
from distutils.errors import DistutilsOptionError
from distutils.command.upload import upload
import os
import s... | mit |
Mchakravartula/rockstor-core | src/rockstor/storageadmin/models/iscsi_target.py | 6 | 1257 | """
Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com>
This file is part of RockStor.
RockStor 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 la... | gpl-3.0 |
KhronosGroup/COLLADA-CTS | StandardDataSets/xml/uri/external_references/geometry/geometry.py | 2 | 4559 |
# Copyright (c) 2012 The Khronos Group Inc.
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publ... | mit |
trtd/faker | faker/providers/date_time/__init__.py | 2 | 38341 | # coding=utf-8
from __future__ import unicode_literals
from datetime import timedelta
import re
from time import time, mktime
from dateutil import relativedelta
from dateutil.tz import tzlocal
from faker.generator import random
from faker.utils.datetime_safe import date, datetime, real_date, real_datetime
from fake... | mit |
takeshineshiro/django | tests/auth_tests/test_context_processors.py | 269 | 6773 | import datetime
from django.contrib.auth import authenticate
from django.contrib.auth.context_processors import PermLookupDict, PermWrapper
from django.contrib.auth.models import Permission, User
from django.contrib.contenttypes.models import ContentType
from django.db.models import Q
from django.test import SimpleTes... | bsd-3-clause |
sysadminmatmoz/ingadhoc | stock_picking_locations/stock.py | 8 | 1503 | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp import models, fields, api
class st... | agpl-3.0 |
funbaker/astropy | astropy/table/meta.py | 2 | 11013 | import textwrap
import copy
from collections import OrderedDict
__all__ = ['get_header_from_yaml', 'get_yaml_from_header', 'get_yaml_from_table']
class ColumnOrderList(list):
"""
List of tuples that sorts in a specific order that makes sense for
astropy table column attributes.
"""
def sort(sel... | bsd-3-clause |
hellobbn/android_kernel_htc_msm8974 | tools/perf/util/setup.py | 4998 | 1330 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... | gpl-2.0 |
gajim/python-nbxmpp | nbxmpp/modules/rsm.py | 1 | 1846 | # Copyright (C) 2020 Philipp Hörist <philipp AT hoerist.com>
#
# This file is part of nbxmpp.
#
# 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 opt... | gpl-3.0 |
sorenh/cc | vendor/tornado/website/markdown/blockprocessors.py | 20 | 17769 | """
CORE MARKDOWN BLOCKPARSER
=============================================================================
This parser handles basic parsing of Markdown blocks. It doesn't concern itself
with inline elements such as **bold** or *italics*, but rather just catches
blocks, lists, quotes, etc.
The BlockParser is made ... | apache-2.0 |
pigeonflight/strider-plone | docker/appengine/lib/django-1.4/django/conf/locale/hr/formats.py | 99 | 1758 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# 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 = 'H:i:s'
DATETIME_FORMAT = 'j. E Y. H:i'
YEAR_MONTH... | mit |
moondrop-entertainment/django-nonrel-drawp | django/test/testcases.py | 157 | 24882 | import re
import sys
from urlparse import urlsplit, urlunsplit
from xml.dom.minidom import parseString, Node
from django.conf import settings
from django.core import mail
from django.core.management import call_command
from django.core.signals import request_started
from django.core.urlresolvers import clear_url_cache... | bsd-3-clause |
fighterCui/L4ReFiascoOC | l4/pkg/python/contrib/Lib/test/test_uu.py | 61 | 5316 | """
Tests for uu module.
Nick Mathewson
"""
import unittest
from test import test_support
import sys, os, uu, cStringIO
import uu
plaintext = "The smooth-scaled python crept over the sleeping dog\n"
encodedtext = """\
M5&AE('-M;V]T:\"US8V%L960@<'ET:&]N(&-R97!T(&]V97(@=&AE('-L965P
(:6YG(&1O9PH """
encodedtextwrappe... | gpl-2.0 |
GreenCoinX/greencoin | qa/rpc-tests/util.py | 1 | 12392 | # Copyright (c) 2014 The GreenCoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Helpful routines for regression testing
#
# Add python-greencoinrpc to module search path:
import os
import sys
sys.path.append... | mit |
qizenguf/MLC-STT | ext/ply/doc/makedoc.py | 177 | 5862 | #!/usr/local/bin/python
###############################################################################
# Takes a chapter as input and adds internal links and numbering to all
# of the H1, H2, H3, H4 and H5 sections.
#
# Every heading HTML tag (H1, H2 etc) is given an autogenerated name to link
# to. However, if the n... | bsd-3-clause |
mitnk/letsencrypt | letsencrypt/display/util.py | 2 | 20691 | """Let's Encrypt display."""
import os
import textwrap
import dialog
import zope.interface
from letsencrypt import interfaces
from letsencrypt import errors
from letsencrypt.display import completer
WIDTH = 72
HEIGHT = 20
DSELECT_HELP = (
"Use the arrow keys or Tab to move between window elements. Space can be ... | apache-2.0 |
glennw/servo | tests/wpt/harness/wptrunner/executors/executorselenium.py | 58 | 9434 | # 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 os
import socket
import sys
import threading
import time
import traceback
import urlparse
import uuid
from .base... | mpl-2.0 |
rversteegen/commandergenius | project/jni/python/src/Lib/test/test_scriptpackages.py | 58 | 1329 | # Copyright (C) 2003 Python Software Foundation
import unittest
from test import test_support
import aetools
class TestScriptpackages(unittest.TestCase):
def _test_scriptpackage(self, package, testobject=1):
# Check that we can import the package
mod = __import__(package)
# Test that we c... | lgpl-2.1 |
runjmc/maraschino | lib/werkzeug/test.py | 77 | 32616 | # -*- coding: utf-8 -*-
"""
werkzeug.test
~~~~~~~~~~~~~
This module implements a client to WSGI applications for testing.
:copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import sys
import urlparse
import mimetypes
from time ... | mit |
noxora/flask-base | flask/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/mbcsgroupprober.py | 2769 | 1967 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | mit |
montanapr/Plugin.Video.Mercy | servers/netload.py | 44 | 1873 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para netload
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core impor... | gpl-2.0 |
danmichaelo/mwclient | tests/test_client.py | 5 | 15693 | # encoding=utf-8
from __future__ import print_function
from six import StringIO
import unittest
import pytest
import mwclient
import logging
import requests
import responses
import pkg_resources # part of setuptools
import mock
try:
import json
except ImportError:
import simplejson as json
if __name__ == "_... | mit |
Zouyiran/ryu | ryu/services/protocols/bgp/utils/internable.py | 1 | 3260 | # Copyright (C) 2014 Nippon Telegraph and Telephone Corporation.
#
# 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 appli... | apache-2.0 |
kmolab/kmolab.github.io | data/Brython-3.3.4/Lib/codeop.py | 187 | 5994 | r"""Utilities to compile possibly incomplete Python source code.
This module provides two interfaces, broadly similar to the builtin
function compile(), which take program text, a filename and a 'mode'
and:
- Return code object if the command is complete and valid
- Return None if the command is incomplete
- Raise Sy... | agpl-3.0 |
LeartS/odoo | addons/email_template/wizard/mail_compose_message.py | 38 | 11212 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
zeptonaut/catapult | dashboard/dashboard/update_bug_with_results_test.py | 4 | 37355 | # Copyright 2015 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 unittest
import mock
import webapp2
import webtest
from dashboard import rietveld_service
from dashboard import testing_common
from dash... | bsd-3-clause |
ParashRahman/Database-Project | Part1/record_violation.py | 1 | 15513 | from application import Application
from error_checker import ErrorChecker
from errors import InvalidDateException
import add_person
class RecordViolation(Application):
def start_application(self, c):
self.cursor = c
self.list_of_inputs = [ None for i in range(8) ]
self.get_violation_no(0... | apache-2.0 |
hybrideagle/django | tests/model_inheritance/tests.py | 283 | 17419 | from __future__ import unicode_literals
from operator import attrgetter
from django.core.exceptions import FieldError, ValidationError
from django.core.management import call_command
from django.db import connection
from django.test import TestCase, TransactionTestCase
from django.test.utils import CaptureQueriesCont... | bsd-3-clause |
Natim/sentry | src/sentry/migrations/0053_auto__del_projectmember__del_unique_projectmember_project_user.py | 36 | 19314 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'ProjectMember', fields ['project', 'user']
db.delete_unique('sentry_projectmember... | bsd-3-clause |
termie/nova-migration-demo | nova/tests/test_instance_types.py | 2 | 4177 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Ken Pepple
# 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
#
# U... | apache-2.0 |
zmalik/mesos | src/python/cli_new/lib/cli/plugins/base.py | 4 | 5418 | # 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 |
kinsamanka/machinekit | lib/python/rs274/interpret.py | 36 | 5499 | # This is a component of AXIS, a front-end for emc
# Copyright 2004, 2005, 2006 Jeff Epler <jepler@unpythonic.net>
#
# 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... | lgpl-2.1 |
mgedmin/ansible | test/units/parsing/yaml/test_objects.py | 14 | 4311 | # 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 |
Admin-backups/AR-B-P-B | www/cgi-bin/show_info.py | 7 | 3356 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import json
import cgi
import urllib2
#取得本机外网IP
myip = urllib2.urlopen('http://members.3322.org/dyndns/getip').read()
myip=myip.strip()
#加载SSR JSON文件
f = file("/usr/local/shadowsocksr/mudb.json");
json = json.load(f);
# 接受表达提交的数据
form = cgi.FieldStorage()
# 解析处理提交的数据
g... | gpl-3.0 |
MingdaZhou/gnuradio | gr-channels/python/channels/distortion_3_gen.py | 60 | 2399 | #!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: Third Order Distortion
# Author: mettus
# Generated: Thu Aug 1 12:37:59 2013
##################################################
from gnuradio import blocks
from gnuradio import gr
from gnuradio.filter import... | gpl-3.0 |
kou/arrow | docs/source/conf.py | 4 | 13167 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
EricCline/CEM_inc | env/lib/python2.7/site-packages/IPython/nbconvert/filters/tests/test_highlight.py | 8 | 2628 | """
Module with tests for Highlight
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, the IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----... | mit |
kingmotley/SickRage | lib/unidecode/x0ac.py | 253 | 4709 | data = (
'ga', # 0x00
'gag', # 0x01
'gagg', # 0x02
'gags', # 0x03
'gan', # 0x04
'ganj', # 0x05
'ganh', # 0x06
'gad', # 0x07
'gal', # 0x08
'galg', # 0x09
'galm', # 0x0a
'galb', # 0x0b
'gals', # 0x0c
'galt', # 0x0d
'galp', # 0x0e
'galh', # 0x0f
'gam', # 0x10
'gab', # ... | gpl-3.0 |
mateusz-blaszkowski/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/hbase_ycsb_benchmark.py | 2 | 8607 | # Copyright 2015 PerfKitBenchmarker 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 appli... | apache-2.0 |
zoidbergwill/Diamond | src/diamond/handler/tsdb.py | 53 | 5910 | # coding=utf-8
"""
Send metrics to a [OpenTSDB](http://opentsdb.net/) server.
[OpenTSDB](http://opentsdb.net/) is a distributed, scalable Time Series
Database (TSDB) written on top of [HBase](http://hbase.org/). OpenTSDB was
written to address a common need: store, index and serve metrics collected from
computer syst... | mit |
foodiesgit/dogepartyd | pycoin-0.26/pycoin/tx/script/microcode.py | 4 | 11968 | # -*- coding: utf-8 -*-
"""
Implement instructions of the Bitcoin VM.
The MIT License (MIT)
Copyright (c) 2013 by Richard Kiss
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 restrictio... | mit |
justin-ho/passwd-mng | pycrypto-2.6.1/pycrypto-2.6.1/lib/Crypto/Hash/SHA224.py | 124 | 2851 | # -*- coding: utf-8 -*-
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, perpetual, royalty-free,
# non-exclusive license to e... | gpl-3.0 |
fifengine/fifengine-demos | pychan_demo/colortester.py | 1 | 7852 | # -*- coding: utf-8 -*-
# ####################################################################
# Copyright (C) 2005-2013 by the FIFE team
# http://www.fifengine.net
# This file is part of FIFE.
#
# FIFE is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#... | lgpl-2.1 |
ceos-seo/data_cube_utilities | data_cube_utilities/trend.py | 1 | 2098 | from functools import partial
from itertools import islice, product
import numpy as np
import xarray as xr
def __where_not_nan(arr: np.ndarray):
"""Finds position of not nan values in an nd-array
Args:
arr (numpy.ndarray): nd-array with nan values
Returns:
data (xr.DataArray):... | apache-2.0 |
overtherain/scriptfile | software/googleAppEngine/lib/django_1_2/docs/_ext/djangodocs.py | 39 | 9475 | """
Sphinx plugins for Django documentation.
"""
import os
import re
from docutils import nodes, transforms
try:
import json
except ImportError:
try:
import simplejson as json
except ImportError:
try:
from django.utils import simplejson as json
except ImportError:
... | mit |
duncanhawthorne/robot-robot | libs/future/backports/email/header.py | 82 | 24448 | # Copyright (C) 2002-2007 Python Software Foundation
# Author: Ben Gertzfield, Barry Warsaw
# Contact: email-sig@python.org
"""Header encoding and decoding functionality."""
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from future.builtins import bytes,... | mit |
ville-k/tensorflow | tensorflow/python/framework/function_test.py | 16 | 43635 | # 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 |
qqzwc/XX-Net | code/default/python27/1.0/lib/encodings/iso2022_kr.py | 816 | 1053 | #
# iso2022_kr.py: Python Unicode Codec for ISO2022_KR
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_kr')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncod... | bsd-2-clause |
FireWRT/OpenWrt-Firefly-Libraries | staging_dir/host/lib/python3.4/test/test_largefile.py | 96 | 6554 | """Test largefile support on system where this makes sense.
"""
import os
import stat
import sys
import unittest
from test.support import TESTFN, requires, unlink
import io # C implementation of io
import _pyio as pyio # Python implementation of io
# size of file to create (>2GB; 2GB == 2147483648 bytes)
size = 2500... | gpl-2.0 |
GoSteven/Diary | djangoappengine/db/creation.py | 17 | 1691 | from .db_settings import get_indexes
from djangotoolbox.db.creation import NonrelDatabaseCreation
class StringType(object):
def __init__(self, internal_type):
self.internal_type = internal_type
def __mod__(self, field):
indexes = get_indexes().get(field['model'], {})
if field['name'] i... | bsd-3-clause |
hilaskis/UAV_MissionPlanner | Lib/site-packages/scipy/ndimage/__init__.py | 55 | 1880 | # Copyright (C) 2003-2005 Peter J. Verveer
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following d... | gpl-2.0 |
aldian/tensorflow | tensorflow/python/layers/maxout_test.py | 32 | 2225 | # 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 applicabl... | apache-2.0 |
xpavlus/parabaramba | venv/lib/python2.7/site-packages/cherrypy/lib/reprconf.py | 13 | 16171 | """Generic configuration system using unrepr.
Configuration data may be supplied as a Python dictionary, as a filename,
or as an open file object. When you supply a filename or file, Python's
builtin ConfigParser is used (with some extensions).
Namespaces
----------
Configuration keys are separated into namespaces b... | gpl-3.0 |
proxysh/Safejumper-for-Desktop | buildlinux/env64/lib/python2.7/sre_constants.py | 185 | 7197 | #
# Secret Labs' Regular Expression Engine
#
# various symbols used by the regular expression engine.
# run this script to update the _sre include files!
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support modul... | gpl-2.0 |
zmike/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/treewalkers/pulldom.py | 1729 | 2302 | from __future__ import absolute_import, division, unicode_literals
from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, \
COMMENT, IGNORABLE_WHITESPACE, CHARACTERS
from . import _base
from ..constants import voidElements
class TreeWalker(_base.TreeWalker):
def __iter__(self):
ignore_until = None... | mpl-2.0 |
apanju/odoo | addons/hr_attendance/report/__init__.py | 375 | 1071 | # -*- 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 |
tux-00/ansible | lib/ansible/plugins/test/core.py | 17 | 4661 | # (c) 2012, Jeroen Hoekx <jeroen@hoekx.be>
#
# 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 |
Tatsh-ansible/ansible | lib/ansible/modules/packaging/os/swdepot.py | 33 | 6615 | #!/usr/bin/python -tt
# -*- coding: utf-8 -*-
# (c) 2013, Raul Melo
# Written by Raul Melo <raulmelo@gmail.com>
# Based on yum module written by Seth Vidal <skvidal at fedoraproject.org>
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pu... | gpl-3.0 |
pony-revolution/helpothers | helpothers/views.py | 1 | 1239 | from django.contrib.auth import get_user_model
from django.views.generic.base import TemplateView
from django.views.generic.detail import DetailView
from django.views.generic.edit import UpdateView
from .views_mixins import HelpOthersMetaDataMixin
from listings.models import GatheringCenter, Resource
class HomeView(... | apache-2.0 |
scattering/ipeek | server/pull_push_expman.py | 1 | 6015 | import glob
import os
import sys
sys.path.append('/var/www/')
sys.path.append('/home/bbm/')
import paramiko
import urllib2, ftplib
import time
import StringIO
import json
DEBUG = False
RETRIEVE_METHOD = "ssh" # or "ftp" or "urllib"
MAX_FTP_RETRIES = 5
HOST_PORT = 22
DEFAULT_PATH = "/usr/local/nice/server_data/experime... | unlicense |
matuu/fades | fades/main.py | 2 | 7315 | # Copyright 2014-2015 Facundo Batista, Nicolás Demarchi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General
# Public License version 3, as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WIT... | gpl-3.0 |
imaculate/scikit-learn | sklearn/linear_model/randomized_l1.py | 11 | 24849 | """
Randomized Lasso/Logistic: feature selection based on Lasso and
sparse Logistic Regression
"""
# Author: Gael Varoquaux, Alexandre Gramfort
#
# License: BSD 3 clause
import itertools
from abc import ABCMeta, abstractmethod
import warnings
import numpy as np
from scipy.sparse import issparse
from scipy import spar... | bsd-3-clause |
totallybradical/temp_servo2 | tests/wpt/web-platform-tests/old-tests/webdriver/user_input/click_test.py | 141 | 10579 | import os
import sys
import unittest
sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
import base_test
repo_root = os.path.abspath(os.path.join(__file__, "../../.."))
sys.path.insert(1, os.path.join(repo_root, "tools", "webdriver"))
from webdriver import exceptions, wait
class ClickTest(base_tes... | mpl-2.0 |
luotao1/Paddle | python/paddle/fluid/tests/unittests/ir/inference/test_conv_bn_fuse_pass.py | 2 | 6097 | # Copyright (c) 2020 PaddlePaddle 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 appli... | apache-2.0 |
kennethreitz/pipenv | pipenv/vendor/dateutil/easter.py | 34 | 2684 | # -*- coding: utf-8 -*-
"""
This module offers a generic easter computing method for any given year, using
Western, Orthodox or Julian algorithms.
"""
import datetime
__all__ = ["easter", "EASTER_JULIAN", "EASTER_ORTHODOX", "EASTER_WESTERN"]
EASTER_JULIAN = 1
EASTER_ORTHODOX = 2
EASTER_WESTERN = 3
def easter(year,... | mit |
keflavich/scikit-image | skimage/io/_plugins/freeimage_plugin.py | 26 | 27618 | import ctypes
import numpy
import sys
import os
import os.path
from numpy.compat import asbytes, asstr
def _generate_candidate_libs():
# look for likely library files in the following dirs:
lib_dirs = [os.path.dirname(__file__),
'/lib',
'/usr/lib',
'/usr/local/l... | bsd-3-clause |
DivineHime/seishirou | lib/chardet/utf8prober.py | 290 | 2766 | ######################## 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... | gpl-3.0 |
xuxiao19910803/edx | lms/lib/courseware_search/lms_result_processor.py | 61 | 2677 | """
This file contains implementation override of SearchResultProcessor which will allow
* Blends in "location" property
* Confirms user access to object
"""
from django.core.urlresolvers import reverse
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from search.result_processor import SearchResu... | agpl-3.0 |
jrichte43/ProjectEuler | Problem-0121/solutions.py | 1 | 1722 |
__problem_title__ = "Disc game prize fund"
__problem_url___ = "https://projecteuler.net/problem=121"
__problem_description__ = "A bag contains one red disc and one blue disc. In a game of chance a " \
"player takes a disc at random and its colour is noted. After each " \
... | gpl-3.0 |
pleaseproject/python-for-android | python-build/python-libs/gdata/src/gdata/tlslite/utils/OpenSSL_AES.py | 359 | 1822 | """OpenSSL/M2Crypto AES implementation."""
from cryptomath import *
from AES import *
if m2cryptoLoaded:
def new(key, mode, IV):
return OpenSSL_AES(key, mode, IV)
class OpenSSL_AES(AES):
def __init__(self, key, mode, IV):
AES.__init__(self, key, mode, IV, "openssl")
... | apache-2.0 |
pleaseproject/python-for-android | python-build/python-libs/gdata/build/lib/atom/data.py | 136 | 8060 | #!/usr/bin/env python
#
# Copyright (C) 2009 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 ... | apache-2.0 |
qwefi/nova | nova/tests/api/openstack/compute/test_v3_extensions.py | 2 | 7785 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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
#
# ... | apache-2.0 |
nirmeshk/oh-mainline | mysite/profile/migrations/0047_remove_stale_from_dia.py | 17 | 10681 | # This file is part of OpenHatch.
# Copyright (C) 2009 OpenHatch, Inc.
#
# 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 v... | agpl-3.0 |
tgsd96/gargnotes | venv/lib/python2.7/site-packages/django/db/migrations/operations/models.py | 22 | 16872 | from __future__ import unicode_literals
from django.db import models
from django.db.models.options import normalize_together
from django.db.migrations.state import ModelState
from django.db.migrations.operations.base import Operation
from django.utils import six
class CreateModel(Operation):
"""
Create a mod... | mit |
nzavagli/UnrealPy | UnrealPyEmbed/Source/Python/Lib/python27/test/test_pyclbr.py | 36 | 7917 | '''
Test cases for pyclbr.py
Nick Mathewson
'''
from test.test_support import run_unittest, import_module
import sys
from types import ClassType, FunctionType, MethodType, BuiltinFunctionType
import pyclbr
from unittest import TestCase
StaticMethodType = type(staticmethod(lambda: None))
ClassMethodType = type(cl... | mit |
dcroc16/skunk_works | google_appengine/lib/django-1.5/tests/regressiontests/utils/dateformat.py | 51 | 6241 | from __future__ import unicode_literals
from datetime import datetime, date
import os
import time
from django.utils.dateformat import format
from django.utils import dateformat, translation, unittest
from django.utils.timezone import utc
from django.utils.tzinfo import FixedOffset, LocalTimezone
class DateFormatTes... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.