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 |
|---|---|---|---|---|---|
fajoy/nova | nova/tests/api/openstack/compute/contrib/test_certificates.py | 12 | 2796 | # Copyright (c) 2012 OpenStack, LLC
# 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 requir... | apache-2.0 |
bioinfo-center-pasteur-fr/ReGaTE | regate/regate.py | 2 | 31151 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Oct. 23, 2014
@author: Olivia Doppelt-Azeroual, CIB-C3BI, Institut Pasteur, Paris
@author: Fabien Mareuil, CIB-C3BI, Institut Pasteur, Paris
@author: Hervé Ménager, CIB-C3BI, Institut Pasteur, Paris
@contact: olivia.doppelt@pasteur.fr
@project: ReGaTE
@githu... | gpl-2.0 |
n3wb13/OpenNfrGui-5.0-1 | lib/python/Plugins/Extensions/MediaPortal/additions/fun/geo_de.py | 1 | 4389 | # -*- coding: utf-8 -*-
from Plugins.Extensions.MediaPortal.plugin import _
from Plugins.Extensions.MediaPortal.resources.imports import *
from Plugins.Extensions.MediaPortal.resources.simpleplayer import SimplePlayer, SimplePlaylist
from Plugins.Extensions.MediaPortal.resources.twagenthelper import twAgentGetPage
ST... | gpl-2.0 |
TingOOOgniT/sine_controller | tests/__init__.py | 45 | 1172 | # Copyright 2011-2012 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 |
vladmm/intellij-community | python/helpers/pydev/pydevd_attach_to_process/winappdbg/win32/ntdll.py | 102 | 22847 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2014, Mario Vilas
# 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... | apache-2.0 |
ofermend/medicare-demo | socialite/jython/Lib/encodings/cp855.py | 593 | 34106 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP855.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors='strict'):
... | apache-2.0 |
bgris/ODL_bgris | lib/python3.5/tkinter/constants.py | 375 | 1493 | # Symbolic constants for Tk
# Booleans
NO=FALSE=OFF=0
YES=TRUE=ON=1
# -anchor and -sticky
N='n'
S='s'
W='w'
E='e'
NW='nw'
SW='sw'
NE='ne'
SE='se'
NS='ns'
EW='ew'
NSEW='nsew'
CENTER='center'
# -fill
NONE='none'
X='x'
Y='y'
BOTH='both'
# -side
LEFT='left'
TOP='top'
RIGHT='right'
BOTTOM='bottom'
# -relief
RAISED='rai... | gpl-3.0 |
osuripple/lets | helpers/aeshelper.py | 1 | 10866 | """
A pure python (slow) implementation of rijndael with a decent interface
To include -
from rijndael import rijndael
To do a key setup -
r = rijndael(key, block_size = 16)
key must be a string of length 16, 24, or 32
blocksize must be 16, 24, or 32. Default is 16
To use -
ciphertext = r.encrypt(plaintext)
plai... | agpl-3.0 |
prutseltje/ansible | lib/ansible/modules/storage/netapp/netapp_e_storage_system.py | 29 | 10956 | #!/usr/bin/python
# (c) 2016, NetApp, 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
purisc-group/purisc-python-compiler | binoperations.py | 2 | 5387 | import syntax
import re
#Compiler operations
#given the target and operands, output a list of subleq instructions
#def binOperation(target, operands):
def add(expressionString, code):
target, a, b = syntax.parseExpression(expressionString);
if not target in code.dataMem:
... | gpl-2.0 |
googleapis/googleapis-gen | google/cloud/bigquery/datatransfer/v1/bigquery-datatransfer-v1-py/google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/transports/__init__.py | 1 | 1239 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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 |
Jumpscale/go-raml | docs/tutorial/python/sanic/types/User.py | 4 | 1192 | # DO NOT EDIT THIS FILE. This file will be overwritten when re-running go-raml.
"""
Auto-generated class for User
"""
from six import string_types
from . import client_support
class User(object):
"""
auto-generated. don't touch.
"""
@staticmethod
def create(**kwargs):
"""
:type ... | bsd-2-clause |
0jpq0/kbengine | kbe/src/lib/python/Lib/encodings/bz2_codec.py | 209 | 2249 | """Python 'bz2_codec' Codec - bz2 compression encoding.
This codec de/encodes from bytes to bytes and is therefore usable with
bytes.transform() and bytes.untransform().
Adapted by Raymond Hettinger from zlib_codec.py which was written
by Marc-Andre Lemburg (mal@lemburg.com).
"""
import codecs
import bz2 # this code... | lgpl-3.0 |
samabhi/pstHealth | venv/lib/python2.7/site-packages/PIL/PalmImagePlugin.py | 32 | 9267 | #
# The Python Imaging Library.
# $Id$
#
##
# Image plugin for Palm pixmap images (output only).
##
from PIL import Image, ImageFile, _binary
__version__ = "1.0"
_Palm8BitColormapValues = (
(255, 255, 255), (255, 204, 255), (255, 153, 255), (255, 102, 255),
(255, 51, 255), (255, 0, 255), (255, 255, 204),... | mit |
knowsWhereHisTowelIs/pi-pyth-serv-socketio | lib/python3.5/site-packages/click/termui.py | 202 | 21008 | import os
import sys
import struct
from ._compat import raw_input, text_type, string_types, \
isatty, strip_ansi, get_winterm_size, DEFAULT_COLUMNS, WIN
from .utils import echo
from .exceptions import Abort, UsageError
from .types import convert_type
from .globals import resolve_color_default
# The prompt funct... | mit |
xxd3vin/spp-sdk | opt/Python27/Lib/lib2to3/fixes/fix_tuple_params.py | 324 | 5577 | """Fixer for function definitions with tuple parameters.
def func(((a, b), c), d):
...
->
def func(x, d):
((a, b), c) = x
...
It will also support lambdas:
lambda (x, y): x + y -> lambda t: t[0] + t[1]
# The parens are a syntax error in Python 3
lambda (x): x + y -> lambda x: x + y
"""... | mit |
TalShafir/ansible | lib/ansible/module_utils/facts/system/platform.py | 93 | 3974 | # 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 |
nonsensews/mango | mango/tools/__init__.py | 2 | 4945 | # -*- coding: utf-8 -*-
# This file is part of mango.
# Distributed under the terms of the last AGPL License.
# The full license is in the file LICENCE, distributed as part of this software.
__author__ = 'Team Machine'
import time
import arrow
import csv
import ujson as json
import logging
import uuid
from tornad... | agpl-3.0 |
wilvk/ansible | test/units/module_utils/basic/test_safe_eval.py | 134 | 2333 | # -*- coding: utf-8 -*-
# (c) 2015-2017, Toshio Kuratomi <tkuratomi@ansible.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division)
__metaclass__ = type
from itertools import chain
import pytest... | gpl-3.0 |
martinjrobins/hobo | pints/tests/test_nested_ellipsoid_sampler.py | 1 | 7162 | #!/usr/bin/env python
#
# Tests ellipsoidal nested sampler.
#
# This file is part of PINTS.
# Copyright (c) 2017-2019, University of Oxford.
# For licensing information, see the LICENSE file distributed with the PINTS
# software package.
#
import unittest
import numpy as np
import pints
import pints.toy
# Unit tes... | bsd-3-clause |
sander76/home-assistant | homeassistant/components/alarm_control_panel/device_action.py | 3 | 4612 | """Provides device automations for Alarm control panel."""
from __future__ import annotations
import voluptuous as vol
from homeassistant.const import (
ATTR_CODE,
ATTR_ENTITY_ID,
ATTR_SUPPORTED_FEATURES,
CONF_CODE,
CONF_DEVICE_ID,
CONF_DOMAIN,
CONF_ENTITY_ID,
CONF_TYPE,
SERVICE_AL... | apache-2.0 |
kelvinhammond/wtforms-alchemy | tests/test_model_form_factory.py | 4 | 3776 | from distutils.version import LooseVersion
import wtforms
from pytest import raises
from wtforms import Form
from tests import ModelFormTestCase
from wtforms_alchemy import (
FormGenerator,
model_form_factory,
UnknownConfigurationOption
)
class TestModelFormFactory(ModelFormTestCase):
def test_suppo... | bsd-3-clause |
terbolous/CouchPotatoServer | couchpotato/core/media/_base/providers/torrent/sceneaccess.py | 14 | 5699 | import traceback
from bs4 import BeautifulSoup
from couchpotato.core.helpers.encoding import toUnicode
from couchpotato.core.helpers.variable import tryInt
from couchpotato.core.logger import CPLog
from couchpotato.core.media._base.providers.torrent.base import TorrentProvider
log = CPLog(__name__)
class Base(Torr... | gpl-3.0 |
sprite728/simple-crf | packages/crf++/python/CRFPP.py | 9 | 5659 | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.4
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import ... | mit |
MartynShaw/audacity | lib-src/lv2/sord/waflib/Tools/qt4.py | 177 | 14666 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
try:
from xml.sax import make_parser
from xml.sax.handler import ContentHandler
except ImportError:
has_xml=False
ContentHandler=object
else:
has_xml=True
import os,sys
f... | gpl-2.0 |
abdoosh00/edx-platform | common/lib/xmodule/xmodule/modulestore/tests/test_xml_importer.py | 11 | 7698 | """
Tests for XML importer.
"""
import mock
from xblock.core import XBlock
from xblock.fields import String, Scope, ScopeIds
from xblock.runtime import Runtime, KvsFieldData, DictKeyValueStore
from xmodule.x_module import XModuleMixin
from opaque_keys.edx.locations import Location
from xmodule.modulestore import Module... | agpl-3.0 |
danstoner/python_experiments | playing_with_kivy/kivi-examples/widgets/textalign.py | 3 | 1629 | from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.gridlayout import GridLayout
from kivy.uix.floatlayout import FloatLayout
from kivy.properties import ObjectProperty
class BoundedLabel(Label):
pass
class Selector(FloatLayout):
app = ObjectProperty(None)
class TextAlignApp(App):
... | gpl-2.0 |
nkrinner/nova | nova/console/fake.py | 114 | 1615 | # Copyright (c) 2010 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 ... | apache-2.0 |
silkyar/570_Big_Little | ext/ply/example/BASIC/basiclex.py | 166 | 1177 | # An implementation of Dartmouth BASIC (1964)
from ply import *
keywords = (
'LET','READ','DATA','PRINT','GOTO','IF','THEN','FOR','NEXT','TO','STEP',
'END','STOP','DEF','GOSUB','DIM','REM','RETURN','RUN','LIST','NEW',
)
tokens = keywords + (
'EQUALS','PLUS','MINUS','TIMES','DIVIDE','POWER',
'LPAREN... | bsd-3-clause |
jayceyxc/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/gis/tests/layermap/tests.py | 47 | 14379 | # coding: utf-8
from __future__ import absolute_import, unicode_literals
import os
from copy import copy
from decimal import Decimal
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.tests.utils import HAS_SPATIAL_DB, mysql
from django.db import router
from django.conf import settings
from django.t... | apache-2.0 |
lpramuk/robottelo | tests/foreman/cli/test_role.py | 1 | 45035 | # -*- encoding: utf-8 -*-
"""Test for Roles CLI
:Requirement: Role
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: UsersRoles
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from math import ceil
from random import choice
from fauxfactory import gen_string
from robottelo.cli.bas... | gpl-3.0 |
VielSoft/odoo | addons/stock/report/stock_graph.py | 326 | 4514 | # -*- 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 |
Habstinat/py-race-results | rr/test/test_crrr.py | 2 | 14889 | import datetime
import os
import pkg_resources
import re
import shutil
import sys
import tempfile
import unittest
from xml.etree import cElementTree as ET
import rr
class TestCoolRunning(unittest.TestCase):
"""
Test parsing results from CoolRunning.
"""
def setUp(self):
# This test file is a... | mit |
centralniak/cmsplugin-filer | cmsplugin_filer_image/integrations/ckeditor.py | 28 | 1163 | # -*- coding: utf-8 -*-
from cms.models.pluginmodel import CMSPlugin
from django.core.files.uploadedfile import SimpleUploadedFile
def create_image_plugin(filename, image, parent_plugin, **kwargs):
"""
Used for drag-n-drop image insertion with djangocms-text-ckeditor.
Set TEXT_SAVE_IMAGE_FUNCTION='cmsplug... | bsd-3-clause |
kmike/scikit-learn | sklearn/utils/tests/test_validation.py | 5 | 5499 | """Tests for input validation functions"""
from tempfile import NamedTemporaryFile
import numpy as np
from numpy.testing import assert_array_equal
import scipy.sparse as sp
from nose.tools import assert_raises, assert_true, assert_false, assert_equal
from sklearn.utils import (array2d, as_float_array, atleast2d_or_cs... | bsd-3-clause |
mlalic/servo | tests/wpt/css-tests/tools/webdriver/webdriver/driver.py | 158 | 6732 | """Entry point for WebDriver."""
import alert
import command
import searchcontext
import webelement
import base64
class WebDriver(searchcontext.SearchContext):
"""Controls a web browser."""
def __init__(self, host, required, desired, mode='strict'):
args = { 'desiredCapabilities': desired }
... | mpl-2.0 |
kronat/ns-3-dev-git | bindings/python/ns3modulegen.py | 199 | 6413 |
LOCAL_MODULES = [
#'my_extra_api_definitions',
]
import sys
import os
sys.path.insert(0, sys.argv[2])
from pybindgen import FileCodeSink, write_preamble
from pybindgen.module import MultiSectionFactory
import pybindgen.settings
pybindgen.settings.deprecated_virtuals = False
from ns3modulegen_generated i... | gpl-2.0 |
gavinp/chromium | third_party/mesa/MesaLib/src/gallium/auxiliary/indices/u_indices_gen.py | 49 | 10249 | #!/usr/bin/env python
copyright = '''
/*
* Copyright 2009 VMware, Inc.
* All Rights Reserved.
*
* 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, including without li... | bsd-3-clause |
zhanghenry/stocks | django/contrib/postgres/operations.py | 111 | 1298 | from django.contrib.postgres.signals import register_hstore_handler
from django.db.migrations.operations.base import Operation
class CreateExtension(Operation):
reversible = True
def __init__(self, name):
self.name = name
def state_forwards(self, app_label, state):
pass
def database... | bsd-3-clause |
thinkWhere/Roadnet | street_browser/add.py | 1 | 15108 | # -*- coding: utf-8 -*-
import datetime
from PyQt4.QtSql import QSqlQuery, QSqlQueryModel
from PyQt4.QtGui import QMessageBox, QLineEdit, QComboBox
from PyQt4.QtCore import Qt, QDate
from qgis.core import QgsMapLayerRegistry
from ..generic_functions import SwitchStreetBrowserMode, ZoomSelectCanvas, ipdb_breakpoint
f... | gpl-2.0 |
josephyli/py-db-cluster | runDDL.py | 1 | 9526 | import argparse
import os
import pymysql.cursors
import re
import sys
from ConfigParser import SafeConfigParser
from StringIO import StringIO
from pymysql import OperationalError
# returns a list of sql commands as strings
def read_DDL(ddlfilename):
f = open(ddlfilename, 'r')
ddlfile = f.read()
f.close()
temp = f... | gpl-3.0 |
nycholas/ask-undrgz | src/ask-undrgz/django/core/management/commands/dbshell.py | 313 | 1261 | from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from django.db import connections, DEFAULT_DB_ALIAS
class Command(BaseCommand):
help = ("Runs the command-line client for specified database, or the "
"default database if none is provided.")
option_lis... | bsd-3-clause |
Celedhrim/persomov | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/abc.py | 89 | 1593 | from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
class ABCIE(InfoExtractor):
IE_NAME = 'abc.net.au'
_VALID_URL = r'http://www\.abc\.net\.au/news/[^/]+/[^/]+/(?P<id>\d+)'
_TEST = {
'url': 'http://www.abc.net.au/news/2014-11-05/australia-to-staff-ebo... | gpl-3.0 |
RydrDojo/Ridr | pylotVenv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/pg8000.py | 58 | 8375 | # postgresql/pg8000.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors <see AUTHORS
# file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: postgresql+pg8000
:name: pg8000
:dbapi: pg8000
:co... | mit |
ds0nt/or-tools | examples/python/crypta.py | 34 | 3413 | # Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.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 ... | apache-2.0 |
cgstudiomap/cgstudiomap | main/eggs/psycopg2-2.6.1-py2.7-linux-x86_64.egg/psycopg2/tests/testconfig.py | 72 | 1157 | # Configure the test suite from the env variables.
import os
dbname = os.environ.get('PSYCOPG2_TESTDB', 'psycopg2_test')
dbhost = os.environ.get('PSYCOPG2_TESTDB_HOST', None)
dbport = os.environ.get('PSYCOPG2_TESTDB_PORT', None)
dbuser = os.environ.get('PSYCOPG2_TESTDB_USER', None)
dbpass = os.environ.get('PSYCOPG2_T... | agpl-3.0 |
alibozorgkhan/django-boilerplate | django_boilerplate/settings/base.py | 1 | 4882 | """
Django settings for django_boilerplate project.
Generated by 'django-admin startproject' using Django 1.10.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""... | mit |
OsirisSPS/osiris-sps | client/share/plugins/AF9A4C281070FDB0F34CF417CDB168AB38C8A388/lib/lib2to3/fixes/fix_imports.py | 326 | 5693 | """Fix incompatible imports and module references."""
# Authors: Collin Winter, Nick Edds
# Local imports
from .. import fixer_base
from ..fixer_util import Name, attr_chain
MAPPING = {'StringIO': 'io',
'cStringIO': 'io',
'cPickle': 'pickle',
'__builtin__' : 'builtins',
'c... | gpl-3.0 |
s0enke/boto | boto/auth_handler.py | 150 | 2064 | # Copyright 2010 Google Inc.
#
# 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, including
# without limitation the rights to use, copy, modify, merge, publish, dis-
# trib... | mit |
ireuben/pep8 | testsuite/test_api.py | 3 | 13467 | # -*- coding: utf-8 -*-
import os.path
import shlex
import sys
import unittest
import pep8
from testsuite.support import ROOT_DIR, PseudoFile
E11 = os.path.join(ROOT_DIR, 'testsuite', 'E11.py')
class DummyChecker(object):
def __init__(self, tree, filename):
pass
def run(self):
if False:
... | mit |
diverted247/signer | libs/pdfminer/build/lib/pdfminer/pdfdevice.py | 2 | 5325 | #!/usr/bin/env python
from utils import mult_matrix, translate_matrix
from utils import enc, bbox2str
from pdffont import PDFUnicodeNotDefined
## PDFDevice
##
class PDFDevice(object):
debug = 0
def __init__(self, rsrcmgr):
self.rsrcmgr = rsrcmgr
self.ctm = None
return
def __rep... | mit |
aaltinisik/OCBAltinkaya | addons/l10n_es/migrations/8.0.5.1/pre-migration.py | 52 | 2209 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2015 Serv. Tecnol. Avanz. (<http://www.serviciosbaeza.com>)
# Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
#
# This progra... | agpl-3.0 |
444thLiao/VarappX | varapp/views/auth_views.py | 2 | 4213 | """
Views that concern authentication, protecting access to other views or actions
"""
from django.http import JsonResponse, HttpResponseForbidden
from django.conf import settings
from varapp.data_models.users import VariantsDb, user_factory
from varapp.common.manage_dbs import deactivate_if_not_found_on_disk, update... | gpl-3.0 |
kyvinh/home-assistant | homeassistant/components/media_player/webostv.py | 5 | 10477 | """
Support for interface with an LG webOS Smart TV.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.webostv/
"""
import logging
from datetime import timedelta
from urllib.parse import urlparse
import voluptuous as vol
import homeassistant.... | apache-2.0 |
sserrot/champion_relationships | venv/Lib/site-packages/jupyter_client/win_interrupt.py | 13 | 1401 | """Use a Windows event to interrupt a child process like SIGINT.
The child needs to explicitly listen for this - see
ipykernel.parentpoller.ParentPollerWindows for a Python implementation.
"""
import ctypes
def create_interrupt_event():
"""Create an interrupt event handle.
The parent process should call thi... | mit |
40223235/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/io.py | 623 | 9405 | import builtins
open = builtins.open
# for seek()
SEEK_SET = 0
SEEK_CUR = 1
SEEK_END = 2
r"""File-like objects that read from or write to a string buffer.
This implements (nearly) all stdio methods.
f = StringIO() # ready for writing
f = StringIO(buf) # ready for reading
f.close() # explicitly rel... | gpl-3.0 |
tinchoss/Python_Android | python/src/Lib/pipes.py | 59 | 9638 | """Conversion pipeline templates.
The problem:
------------
Suppose you have some data that you want to convert to another format,
such as from GIF image format to PPM image format. Maybe the
conversion involves several steps (e.g. piping it through compress or
uuencode). Some of the conversion steps may require th... | apache-2.0 |
djangraw/PsychoPyParadigms | Reading/DistractionTask_eyelink_d6.py | 1 | 30141 | #!/usr/bin/env python2
"""Display multi-page text with simultaneous auditory distractions, recording eye position data using the EyeLink eye tracker."""
# DistractionTask_eyelink_d6.py
# Created 3/16/15 by DJ based on VidLecTask.py
# Updated 3/31/15 by DJ - renamed from ReadingTask_dict_d2.py.
# Updated 4/1-16/15 by D... | mit |
stanford-gfx/Horus | Code/HorusApp/app/views.py | 1 | 19731 | from app import server, db, trajectoryAPI
from pylab import *
import flask
from flask import jsonify, request, url_for, redirect, render_template, abort
from flask.ext import restful
import requests
import math, time
import urllib2
import json
import os
from os import path
starting_lat = 0
starting_lng = 0
vehicle_mi... | bsd-3-clause |
DOV-Vlaanderen/pydov | tests/test_types_grondwatervergunning.py | 1 | 1531 | """Module grouping tests for the pydov.types.boring module."""
from pydov.types.grondwatervergunning import GrondwaterVergunning
from tests.abstract import AbstractTestTypes
location_wfs_getfeature = \
'tests/data/types/grondwatervergunning/wfsgetfeature.xml'
location_wfs_feature = 'tests/data/types/grondwaterver... | mit |
TEAM-Gummy/platform_external_chromium_org | third_party/closure_linter/closure_linter/errorrules.py | 156 | 1379 | #!/usr/bin/env python
#
# Copyright 2010 The Closure Linter 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
#... | bsd-3-clause |
jasonmccampbell/scipy-refactor | scipy/special/utils/makenpz.py | 57 | 2159 | #!/bin/bash
"""
makenpz.py DIRECTORY
Build a npz containing all data files in the directory.
"""
import os
import numpy as np
from optparse import OptionParser
def main():
p = OptionParser()
options, args = p.parse_args()
if len(args) != 1:
p.error("no valid directory given")
inp = args[0]
... | bsd-3-clause |
nwjs/chromium.src | tools/clang/pylib/clang/compile_db_test.py | 3 | 2047 | #!/usr/bin/env vpython
# Copyright 2019 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.
"""Tests for compile_db."""
import sys
import unittest
import compile_db
# Input compile DB.
_TEST_COMPILE_DB = [
# Verifies ... | bsd-3-clause |
magic0704/neutron | neutron/db/migration/alembic_migrations/versions/51c54792158e_subnetpools.py | 47 | 2382 | # Copyright 2015 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 law ... | apache-2.0 |
KellyChan/Python | javascript/backbone/backbone-templates/backbone-fileupload/venvs/lib/python2.7/site-packages/django/contrib/gis/geos/point.py | 403 | 4253 | from ctypes import c_uint
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.contrib.gis.geos import prototypes as capi
class Point(GEOSGeometry):
_minlength = 2
_maxlength = 3
def __init__(self, x, y=None, z=None, srid=None):
... | mit |
Senseg/Py4A | python-build/python-libs/python-twitter/twitter.py | 89 | 70251 | #!/usr/bin/python2.4
#
# Copyright 2007 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... | apache-2.0 |
fake-name/ReadableWebProxy | amqpstorm/channel0.py | 1 | 6351 | """AMQPStorm Connection.Channel0."""
import logging
import platform
from pamqp import specification
from pamqp.heartbeat import Heartbeat
from amqpstorm import __version__
from amqpstorm.base import AUTH_MECHANISM
from amqpstorm.base import FRAME_MAX
from amqpstorm.base import LOCALE
from amqpstorm.base import MAX_C... | bsd-3-clause |
sysalexis/kbengine | kbe/res/scripts/common/Lib/tracemalloc.py | 83 | 15651 | from collections import Sequence, Iterable
from functools import total_ordering
import fnmatch
import linecache
import os.path
import pickle
# Import types and functions implemented in C
from _tracemalloc import *
from _tracemalloc import _get_object_traceback, _get_traces
def _format_size(size, sign):
for unit ... | lgpl-3.0 |
japeto/TMotive | application/controllers/webservicecontroller.py | 3 | 2232 | import os
import datetime
import sys
import json
from flask import Flask, jsonify
from flask import request, session, redirect, url_for, render_template, flash
from flask import Response
from flask.ext.cors import CORS
from application import webservice
from application.models.vehiclemodel import Vehicle
from applicati... | gpl-3.0 |
stewartpark/django | tests/utils_tests/test_encoding.py | 288 | 5732 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import unittest
from django.utils import six
from django.utils.encoding import (
escape_uri_path, filepath_to_uri, force_bytes, force_text, iri_to_uri,
smart_text, uri_to_iri,
)
from django.utils.functional import SimpleLazyObje... | bsd-3-clause |
yongtang/tensorflow | tensorflow/python/keras/layers/normalization/layer_normalization.py | 6 | 13322 | # 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 |
shootstar/ctest | ceilometer/openstack/common/rpc/matchmaker_redis.py | 2 | 4892 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Cloudscaling Group, 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/LI... | apache-2.0 |
sbalde/edxplatform | common/test/acceptance/pages/lms/certificate_page.py | 110 | 1582 | # -*- coding: utf-8 -*-
"""
Module for Certificates pages.
"""
from bok_choy.page_object import PageObject
from . import BASE_URL
class CertificatePage(PageObject):
"""
Certificate web view page.
"""
url_path = "certificates"
def __init__(self, browser, user_id, course_id):
"""Initializ... | agpl-3.0 |
simonwydooghe/ansible | test/units/module_utils/basic/test_log.py | 120 | 7027 | # -*- coding: utf-8 -*-
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import syslog
from itertools... | gpl-3.0 |
ubirch/aws-tools | virtual-env/lib/python2.7/site-packages/boto/iam/__init__.py | 145 | 3046 | # Copyright (c) 2010-2011 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010-2011, Eucalyptus Systems, Inc.
#
# 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... | apache-2.0 |
mlaidouni/Artistfunds | venv/lib/python2.7/site-packages/setuptools/command/sdist.py | 111 | 7050 | from glob import glob
from distutils import log
import distutils.command.sdist as orig
import os
import sys
import io
from setuptools.extern import six
from setuptools.utils import cs_path_exists
import pkg_resources
READMES = 'README', 'README.rst', 'README.txt'
_default_revctrl = list
def walk_revctrl(dirname='... | mit |
zordsdavini/qtile | libqtile/pangocffi.py | 5 | 6635 | # Copyright (c) 2014-2015 Sean Vig
# Copyright (c) 2014 roger
# Copyright (c) 2014 Tycho Andersen
# Copyright (c) 2015 Craig Barnes
#
# 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 r... | mit |
Buckmarble/elite_shamu | tools/perf/python/twatch.py | 7370 | 1334 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
benjolitz/trollius-redis | trollius_redis/encoders.py | 1 | 2145 | """
The redis protocol only knows about bytes, but we like to have strings inside
Python. This file contains some helper classes for decoding the bytes to
strings and encoding the other way around. We also have a `BytesEncoder`, which
provides raw access to the redis server.
"""
__all__ = (
'BaseEncoder',
'Byt... | bsd-2-clause |
kHarshit/DAT210x_Microsoft | Module2/assignment3.py | 1 | 1178 | import pandas as pd
# TODO: Load up the dataset Ensuring you set the appropriate header column names
df = pd.read_csv('Datasets/servo.data')
df.columns = ['motor', 'screw', 'pgain', 'vgain', 'class']
print(df.describe())
# TODO: Create a slice that contains all entries having a vgain equal to 5. Then print the lengt... | mit |
jk1/intellij-community | python/lib/Lib/email/Encoders.py | 152 | 2302 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Encodings and related functions."""
__all__ = [
'encode_7or8bit',
'encode_base64',
'encode_noop',
'encode_quopri',
]
import base64
from quopri import encodestring as _encodestring
d... | apache-2.0 |
wnt-zhp/hufce | django/conf/locale/__init__.py | 86 | 9971 | LANG_INFO = {
'ar': {
'bidi': True,
'code': 'ar',
'name': 'Arabic',
'name_local': u'\u0627\u0644\u0639\u0631\u0628\u064a\u0651\u0629',
},
'az': {
'bidi': True,
'code': 'az',
'name': 'Azerbaijani',
'name_local': u'az\u0259rbaycan dili',
},
... | gpl-3.0 |
Universal-Model-Converter/UMC3.0a | data/Python/x86/Lib/test/test_gc.py | 70 | 22708 | import unittest
from test.test_support import verbose, run_unittest
import sys
import time
import gc
import weakref
try:
import threading
except ImportError:
threading = None
### Support code
###############################################################################
# Bug 1055820 has several tests of lo... | mit |
TileHalo/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/treebuilders/dom.py | 920 | 8469 | from __future__ import absolute_import, division, unicode_literals
from xml.dom import minidom, Node
import weakref
from . import _base
from .. import constants
from ..constants import namespaces
from ..utils import moduleFactoryFactory
def getDomBuilder(DomImplementation):
Dom = DomImplementation
class A... | mpl-2.0 |
kenorb-contrib/BitTorrent | twisted/persisted/marmalade.py | 5 | 16157 | # -*- test-case-name: twisted.test.test_persisted -*-
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""Marmalade: jelly, with just a hint of bitterness.
I can serialize a Python object to an XML DOM tree (twisted.web.microdom), and
therefore to XML data, similarly to twisted.spre... | gpl-3.0 |
z3ntu/android_kernel_fairphone_fp2 | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
moedje/xbmc-adult | plugin.video.livestreamerkodi/service.py | 2 | 1996 | #!/usr/bin/env python2
import SocketServer
import re
import shutil
import threading
import requests
import xbmc
from SimpleHTTPServer import SimpleHTTPRequestHandler
from urlparse import urljoin
from addon import get_proxy_cache, plugin
from livestreamer.stream import HLSStream
class ProxyHandler(SimpleHTTPRequestH... | gpl-3.0 |
kerneler/better-gtest | test/gtest_xml_test_utils.py | 1815 | 8876 | #!/usr/bin/env python
#
# Copyright 2006, 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 |
houzhenggang/hiwifi-openwrt-HC5661-HC5761 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/root-ralink/usr/lib/python2.7/fractions.py | 252 | 22390 | # Originally contributed by Sjoerd Mullender.
# Significantly modified by Jeffrey Yasskin <jyasskin at gmail.com>.
"""Rational, infinite-precision, real numbers."""
from __future__ import division
from decimal import Decimal
import math
import numbers
import operator
import re
__all__ = ['Fraction', 'gcd']
Rational... | gpl-2.0 |
hastexo/edx-platform | openedx/core/lib/plugins.py | 13 | 1598 | """
Adds support for first class plugins that can be added to the edX platform.
"""
from collections import OrderedDict
from stevedore.extension import ExtensionManager
from openedx.core.lib.cache_utils import memoized
class PluginError(Exception):
"""
Base Exception for when an error was found regarding plu... | agpl-3.0 |
stvstnfrd/edx-platform | common/djangoapps/util/memcache.py | 5 | 1457 | """
This module provides a KEY_FUNCTION suitable for use with a memcache backend
so that we can cache any keys, not just ones that memcache would ordinarily accept
"""
import hashlib
import six.moves.urllib.error
import six.moves.urllib.parse
import six.moves.urllib.request
from django.utils.encoding import smart_st... | agpl-3.0 |
Deepakkothandan/ansible | lib/ansible/module_utils/dellos9.py | 16 | 5864 | #
# (c) 2015 Peter Sprygada, <psprygada@ansible.com>
# (c) 2017 Red Hat, Inc
#
# Copyright (c) 2016 Dell Inc.
#
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamica... | gpl-3.0 |
nichung/wwwflaskBlogrevA | env/lib/python2.7/site-packages/idna/idnadata.py | 32 | 39285 | # This file is automatically generated by tools/idna-data
__version__ = "10.0.0"
scripts = {
'Greek': (
0x37000000374,
0x37500000378,
0x37a0000037e,
0x37f00000380,
0x38400000385,
0x38600000387,
0x3880000038b,
0x38c0000038d,
0x38e000003a2,
... | mit |
bruderstein/PythonScript | PythonLib/tcl/tkinter/test/test_tkinter/test_geometry_managers.py | 19 | 41015 | import unittest
import re
import tkinter
from tkinter import TclError
from test.support import requires
from tkinter.test.support import pixels_conv, tcl_version, requires_tcl
from tkinter.test.widget_tests import AbstractWidgetTest
requires('gui')
class PackTest(AbstractWidgetTest, unittest.TestCase):
test_ke... | gpl-2.0 |
atsolakid/edx-platform | lms/djangoapps/instructor/views/api_urls.py | 14 | 6236 | """
Instructor API endpoint urls.
"""
from django.conf.urls import patterns, url
urlpatterns = patterns(
'',
url(r'^students_update_enrollment$',
'instructor.views.api.students_update_enrollment', name="students_update_enrollment"),
url(r'^register_and_enroll_students$',
'instructor.views... | agpl-3.0 |
martenson/tools-iuc | tools/gff3_rebase/gff3_rebase.py | 23 | 7830 | #!/usr/bin/env python
import argparse
import copy
import logging
import sys
from BCBio import GFF
from Bio.SeqFeature import FeatureLocation
logging.basicConfig(level=logging.INFO)
log = logging.getLogger(__name__)
__author__ = "Eric Rasche"
__version__ = "0.4.0"
__maintainer__ = "Eric Rasche"
__email__ = "esr@tamu.... | mit |
analyseuc3m/ANALYSE-v1 | openedx/core/djangoapps/credit/tasks.py | 60 | 7836 | """
This file contains celery tasks for credit course views.
"""
from celery import task
from celery.utils.log import get_task_logger
from django.conf import settings
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey, UsageKey
from openedx.core.djangoapps.credit.api import set_credit_... | agpl-3.0 |
upptalk/uppsell | uppsell/migrations/0002_auto__add_unique_store_code__add_field_listing_price__chg_field_listin.py | 1 | 19453 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding unique constraint on 'Store', fields ['code']
db.create_unique('... | mit |
rmaz/buck | scripts/verify-test-files.py | 4 | 6024 | #!/usr/bin/env python
# Copyright 2018-present Facebook, 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 applica... | apache-2.0 |
roijo/C-PAC_complexitytools | CPAC/alff/utils.py | 4 | 4280 | import os
import sys
import re
import commands
import nipype.pipeline.engine as pe
import nipype.interfaces.utility as util
def get_img_nvols(in_files):
"""
Calculates the number of volumes in the given nifti image
Parameters
----------
in_files : string (nifti file)
Returns
-------
... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.