repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
tmatsuya/milkymist-ml401 | cores/softusb/navre_regress/test_opcodes/test_ST_Z_decr.py | 5 | 2894 | #! /usr/bin/env python
###############################################################################
#
# simulavr - A simulator for the Atmel AVR family of microcontrollers.
# Copyright (C) 2001, 2002 Theodore A. Roth
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of th... | lgpl-3.0 |
vinodbonala/mm | test/functional/unit_test/coverage_tests.py | 3 | 1067 | import os
import unittest
import shutil
import test.lib.test_helper as test_helper
from test.lib.test_helper import MavensMateTest
class ApexUnitTestCoverageTest(MavensMateTest):
def test_01_should_get_coverage(self):
test_helper.create_project(self, "unit test project", package={ "ApexClass" : "... | gpl-2.0 |
krafczyk/spack | var/spack/repos/builtin/packages/r-irlba/package.py | 5 | 1840 | ##############################################################################
# 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 |
HuimingCheng/AutoGrading | learning/web_Haotian/venv/Lib/site-packages/wheel/bdist_wheel.py | 62 | 18852 | """
Create a wheel (.whl) distribution.
A wheel is a built archive format.
"""
import csv
import hashlib
import os
import subprocess
import warnings
import shutil
import json
import sys
import re
from email.generator import Generator
from distutils.core import Command
from distutils.sysconfig import get_python_versio... | mit |
jhaydel/051616PoC | 2Leaf_PoC/topology_converter.py | 3 | 22004 | #!/usr/bin/env python
#
# Topology Converter
# converts a given topology.dot file to a Vagrantfile
# can use the virtualbox or libvirt Vagrant providers
# Initially written by Eric Pulvino 2015-10-19
#
# hosted @ https://github.com/cumulusnetworks/topology_converter
#
#
version = "4.0.5"
import o... | mit |
figarocms/thumbor | tests/detectors/test_queued_detector.py | 6 | 3598 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
from unittest import TestCase
import mock
from json import loads
fro... | mit |
Sumith1896/sympy | sympy/conftest.py | 20 | 2267 | from __future__ import print_function, division
import sys
sys._running_pytest = True
import pytest
from sympy.core.cache import clear_cache
import re
sp = re.compile(r'([0-9]+)/([1-9][0-9]*)')
def process_split(session, config, items):
split = config.getoption("--split")
if not split:
return
m ... | bsd-3-clause |
aldariz/Sick-Beard | lib/hachoir_parser/template.py | 90 | 1939 | """
====================== 8< ============================
This file is an Hachoir parser template. Make a copy
of it, and adapt it to your needs.
You have to replace all "TODO" with you code.
====================== 8< ============================
TODO parser.
Author: TODO TODO
Creation date: YYYY-mm-DD
"""
# TODO:... | gpl-3.0 |
xavfernandez/pip | src/pip/_internal/network/auth.py | 10 | 11119 | """Network Authentication Helpers
Contains interface (MultiDomainBasicAuth) and associated glue code for
providing credentials in the context of network requests.
"""
# The following comment should be removed at some point in the future.
# mypy: disallow-untyped-defs=False
import logging
from pip._vendor.requests.a... | mit |
caisq/tensorflow | tensorflow/contrib/kfac/examples/mlp.py | 14 | 12945 | # Copyright 2017 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 |
wlanslovenija/nodewatcher-warehouse | nodewatcherwarehouse/warehouse/templatetags/ware_tags.py | 1 | 1229 | from django import template
register = template.Library()
from django.core.urlresolvers import reverse
from django.utils.safestring import mark_safe
def qr_code(obj, size=2):
return reverse("wh:qr", kwargs={"string": abs_view(obj), "size":size})
def abs_view(obj):
from django.contrib.sites.models import Site
... | agpl-3.0 |
wildchildyn/autism-website | yanni_env/lib/python3.6/site-packages/sqlalchemy/sql/type_api.py | 23 | 46998 | # sql/types_api.py
# Copyright (C) 2005-2017 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
"""Base types API.
"""
from .. import exc, util
from . import operators
from .vi... | gpl-3.0 |
jbalogh/zamboni | apps/amo/urlresolvers.py | 1 | 6504 | # -*- coding: utf-8 -*-
import hashlib
import urllib
from threading import local
from urlparse import urlparse, urlsplit, urlunsplit
from django.conf import settings
from django.core import urlresolvers
from django.utils import encoding
from django.utils.translation.trans_real import parse_accept_lang_header
import j... | bsd-3-clause |
Geosyntec/dockside | setup.py | 1 | 1419 | # Setup script for the wqio package
#
# Usage: python setup.py install
#
import os
from setuptools import setup, find_packages
DESCRIPTION = (
"dockside: A python utility to download United States "
"Geological Survey (USGS) National Water Information System (NWIS) data"
)
LONG_DESCRIPTION = DESCRIPTION
NAME =... | bsd-3-clause |
hexlism/xx_net | launcher/web_control.py | 1 | 19797 | #!/usr/bin/env python
# coding:utf-8
import os, sys
current_path = os.path.dirname(os.path.abspath(__file__))
if __name__ == "__main__":
python_path = os.path.abspath( os.path.join(current_path, os.pardir, 'python27', '1.0'))
noarch_lib = os.path.abspath( os.path.join(python_path, 'lib', 'noarch'))
sys.pa... | bsd-2-clause |
slashk/goldstone-server | goldstone/drfes/filters.py | 2 | 4350 | """DRFES Filters."""
# Copyright 2015 Solinea, 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... | apache-2.0 |
vitmod/dvbapp | skin.py | 1 | 32930 | from Tools.Profile import profile
profile("LOAD:ElementTree")
import xml.etree.cElementTree
import os
profile("LOAD:enigma_skin")
from enigma import eSize, ePoint, eRect, gFont, eWindow, eLabel, ePixmap, eWindowStyleManager, \
addFont, gRGB, eWindowStyleSkinned, getDesktop
from Components.config import ConfigSubsecti... | gpl-2.0 |
Jusedawg/SickRage | lib/feedparser/mixin.py | 22 | 32271 | # Shared code that is common to the strict and loose feed parsers
# Copyright 2010-2015 Kurt McKee <contactme@kurtmckee.org>
# Copyright 2002-2008 Mark Pilgrim
# All rights reserved.
#
# This file is a part of feedparser.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitt... | gpl-3.0 |
Allow2CEO/browser-ios | brave/node_modules/ad-block/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/projects.py | 51 | 4876 | # Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | mpl-2.0 |
PostCenter/botlang | botlang/environment/primitives/strings.py | 1 | 1298 | import re
from urllib.parse import quote
from unidecode import unidecode
def simplify_text(text):
return unidecode(text)\
.lower()\
.replace("'", '')\
.replace('&', '')
def email_censor(value):
if '@' not in value:
return value
start, end = value.split('@')
return "... | mit |
linktlh/Toontown-journey | toontown/coghq/LawOfficeManagerAI.py | 4 | 2131 | import random
import DistributedLawOfficeAI
import DistributedStageAI
from direct.directnotify import DirectNotifyGlobal
from direct.showbase import DirectObject
from toontown.coghq import StageLayout
from toontown.toonbase import ToontownGlobals
StageId2Layouts = {
ToontownGlobals.LawbotStageIntA: (0, 1, 2),
... | apache-2.0 |
davidharrigan/django | tests/utils_tests/test_datastructures.py | 262 | 4154 | """
Tests for stuff in django.utils.datastructures.
"""
import copy
from django.test import SimpleTestCase
from django.utils import six
from django.utils.datastructures import (
DictWrapper, ImmutableList, MultiValueDict, MultiValueDictKeyError,
OrderedSet,
)
class OrderedSetTests(SimpleTestCase):
def ... | bsd-3-clause |
xinwu/bosi-1 | etc/t6/python_template/dpid.py | 4 | 2232 | #!/usr/bin/python
# Print the MAC address of the first non-loopback NIC.
# Based on http://programmaticallyspeaking.com/getting-network-interfaces-in-python.html.
# Based on getifaddrs.py from pydlnadms [http://code.google.com/p/pydlnadms/].
from socket import AF_INET, AF_INET6, AF_PACKET, inet_ntop
from ctypes import... | apache-2.0 |
saurabh6790/OFF-RISLIB | webnotes/install_lib/setup_public_folder.py | 34 | 1160 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# make public folders
from __future__ import unicode_literals
import os
import webnotes
def make(site=None):
"""make public folder symlinks if missing"""
from webnotes.utils import get_site_base_path, get_base_pa... | mit |
KeepSafe/aiohttp | examples/background_tasks.py | 3 | 1813 | #!/usr/bin/env python3
"""Example of aiohttp.web.Application.on_startup signal handler"""
import asyncio
import aioredis
from aiohttp import web
async def websocket_handler(request):
ws = web.WebSocketResponse()
await ws.prepare(request)
request.app['websockets'].append(ws)
try:
async for msg... | apache-2.0 |
wersoo/omim | 3party/freetype/src/tools/docmaker/docbeauty.py | 877 | 2642 | #!/usr/bin/env python
#
# DocBeauty (c) 2003, 2004, 2008 David Turner <david@freetype.org>
#
# This program is used to beautify the documentation comments used
# in the FreeType 2 public headers.
#
from sources import *
from content import *
from utils import *
import utils
import sys, os, time, string, getopt
... | apache-2.0 |
southpawtech/TACTIC-DEV | src/pyasm/prod/prod_test.py | 6 | 1795 | #!/usr/bin/python
###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way wi... | epl-1.0 |
YACOWS/opps | opps/articles/admin.py | 3 | 3965 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from .models import Post, PostRelated, Album, Link
from .forms import PostAdminForm, AlbumAdminForm, LinkAdminForm
from opps.containers.admin import (
ContainerAdmin, ContainerIma... | mit |
jacquerie/inspire-next | inspirehep/modules/arxiv/utils.py | 6 | 1264 | # -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014-2017 CERN.
#
# INSPIRE 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 ... | gpl-3.0 |
danbob123/profitpy | profit/lib/widgets/plotitemdialog.py | 18 | 27336 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2007 Troy Melhase <troy@gci.net>
# Distributed under the terms of the GNU General Public License v2
##
#
# This module defines the PlotItemDialog class for edit and display
# of plot item pens and plot curves.
#
##
from PyQt4.QtCore import QVariant, Qt, pyqtS... | gpl-2.0 |
cselis86/edx-platform | lms/djangoapps/courseware/migrations/0005_auto__add_offlinecomputedgrade__add_unique_offlinecomputedgrade_user_c.py | 194 | 8410 | # -*- coding: 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):
# Adding model 'OfflineComputedGrade'
db.create_table('courseware_offlinecomputedgrade', (
('id'... | agpl-3.0 |
maxsands1503/e3chal | node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py | 1835 | 1748 | #!/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.
"""These functions are executed via gyp-flock-tool when using the Makefile
generator. Used on systems that don't have a built-in flock."""
... | gpl-2.0 |
BinPy/BinPy | BinPy/examples/source/ic/Series_4000/IC4025.py | 5 | 1254 | # -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <headingcell level=2>
# Usage of IC 4025
# <codecell>
from __future__ import print_function
from BinPy import *
# <codecell>
# Usage of IC 4025:
ic = IC_4025()
print(ic.__doc__)
# <codecell>
# The Pin configuration is:
inp = {1: 1, 2: 1, 3: 0, 4: 0, 5: 0, ... | bsd-3-clause |
PriceChild/ansible | lib/ansible/modules/network/f5/bigip_irule.py | 51 | 11120 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016 F5 Networks 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
# ... | gpl-3.0 |
bop/bauhaus | lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/setuptools/command/setopt.py | 167 | 5053 | import distutils, os
from setuptools import Command
from distutils.util import convert_path
from distutils import log
from distutils.errors import *
__all__ = ['config_file', 'edit_config', 'option_base', 'setopt']
def config_file(kind="local"):
"""Get the filename of the distutils, local, global, or per-user co... | mit |
jolyonb/edx-platform | lms/djangoapps/edxnotes/helpers.py | 1 | 15847 | """
Helper methods related to EdxNotes.
"""
from __future__ import absolute_import
import json
import logging
from datetime import datetime
from json import JSONEncoder
from uuid import uuid4
import requests
import six
from six.moves.urllib.parse import urlencode, urlparse, parse_qs # pylint: disable=import-error
fr... | agpl-3.0 |
salaria/odoo | addons/payment_ogone/data/ogone.py | 395 | 30321 | # -*- coding: utf-8 -*-
OGONE_ERROR_MAP = {
'0020001001': "Authorization failed, please retry",
'0020001002': "Authorization failed, please retry",
'0020001003': "Authorization failed, please retry",
'0020001004': "Authorization failed, please retry",
'0020001005': "Authorization failed, please ret... | agpl-3.0 |
one-2-z/a830s_kernel | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
britcey/ansible | lib/ansible/modules/network/lenovo/cnos_bgp.py | 59 | 19250 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# 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 License as published by
# the Free Software Foundation, either version 3 of the License, or
# ... | gpl-3.0 |
pjimmybrcd/bwctest | sensors/syslog_sensor.py | 3 | 1790 | import os,re
from logshipper.tail import Tail
from st2reactor.sensor.base import Sensor
class Syslog_Sensor(Sensor):
def __init__(self, sensor_service, config=None):
super(Syslog_Sensor, self).__init__(sensor_service=sensor_service,
config=config)
se... | apache-2.0 |
bluevoda/BloggyBlog | lib/python3.4/site-packages/pip/operations/freeze.py | 127 | 4048 | from __future__ import absolute_import
import logging
import re
import pip
from pip.req import InstallRequirement
from pip.utils import get_installed_distributions
from pip._vendor import pkg_resources
from pip._vendor.packaging.utils import canonicalize_name
logger = logging.getLogger(__name__)
def freeze(
... | gpl-3.0 |
tsgit/invenio | modules/miscutil/lib/gc_workaround.py | 2 | 1297 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2017 CERN, Stanford.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option)... | gpl-2.0 |
open-power-ref-design/opsmgr | plugins/provisioning/swift-proxy/nagios/plugins/check-swift-space.py | 4 | 2117 | #!/usr/bin/python
#
# Copyright 2012 iomart Cloud Services Ltd
#
# 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 |
pombredanne/sortinghat | tests/test_cmd_move.py | 1 | 5882 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014-2015 Bitergia
#
# 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 la... | gpl-3.0 |
b0ri5/nishe-googlecode | scons/scons-local-1.3.0/SCons/Tool/gs.py | 5 | 2556 | """SCons.Tool.gs
Tool-specific initialization for Ghostscript.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundatio... | lgpl-3.0 |
sderrick57/adaTRHsensor | PyMata/pymata_serial.py | 1 | 3837 | __author__ = 'Copyright (c) 2013 Alan Yorinks All rights reserved.'
"""
@author: Alan Yorinks
Copyright (c) 2013-17 Alan Yorinks All rights reserved.
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;... | gpl-3.0 |
LukeM12/samba | buildtools/wafadmin/Tools/osx.py | 14 | 5819 | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy 2008
"""MacOSX related tools
To compile an executable into a Mac application bundle (a .app), set its 'mac_app' attribute
obj.mac_app = True
To make a bundled shared library (a .bundle), set the 'mac_bundle' attribute:
obj.mac_bundle = True
"""
import os, sh... | gpl-3.0 |
AppRevelations/Utsav | utsav/migrations/0001_initial.py | 1 | 2263 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Event',
fields=[
('id', models.AutoField(verbos... | apache-2.0 |
zaafar/bcc | src/cc/frontends/p4/compiler/programSerializer.py | 10 | 1508 | #!/usr/bin/env python
# helper for building C program source text
from compilationException import *
class ProgramSerializer(object):
def __init__(self):
self.program = ""
self.eol = "\n"
self.currentIndent = 0
self.INDENT_AMOUNT = 4 # default indent amount
def __str__(self... | apache-2.0 |
coreboot-gs45/coreboot | util/dtd_parser/dtd_parser.py | 18 | 7171 | #!/usr/bin/python
# dtd_parser.py - DTD structure parser
#
# Copyright (C) 2012 The ChromiumOS Authors. All rights reserved.
#
# 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; version 2 of the L... | gpl-2.0 |
mindbender-studio/setup | bin/windows/python36/Lib/curses/__init__.py | 116 | 3366 | """curses
The main package for curses support for Python. Normally used by importing
the package, and perhaps a particular module inside it.
import curses
from curses import textpad
curses.initscr()
...
"""
from _curses import *
import os as _os
import sys as _sys
# Some constants, most notably the AC... | mit |
Crandy/robobrowser | robobrowser/helpers.py | 5 | 2534 | """
Miscellaneous helper functions
"""
import re
from bs4 import BeautifulSoup
from bs4.element import Tag
from robobrowser.compat import string_types, iteritems
def match_text(text, tag):
if isinstance(text, string_types):
return text in tag.text
if isinstance(text, re._pattern_type):
retu... | bsd-3-clause |
VaybhavSharma/commons | pants-plugins/src/python/twitter/common/pants/python/commons/read_contents.py | 13 | 1279 | # ==================================================================================================
# Copyright 2014 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | apache-2.0 |
hyowon/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/handshake/__init__.py | 658 | 4406 | # Copyright 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 of conditions and the f... | mpl-2.0 |
sss/calibre-at-bzr | src/calibre/ebooks/pdf/render/engine.py | 3 | 14275 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
... | gpl-3.0 |
sbalde/edxplatform | common/djangoapps/course_modes/migrations/0007_auto__add_coursemodesarchive__chg_field_coursemode_course_id.py | 102 | 4360 | # -*- coding: 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):
# Adding model 'CourseModesArchive'
db.create_table('course_modes_coursemodesarchive', (
('id', ... | agpl-3.0 |
danmergens/mi-instrument | mi/dataset/driver/spkir_abj/dcl/spkir_abj_dcl_telemetered_driver.py | 7 | 1684 | # #
# OOIPLACEHOLDER
#
# Copyright 2014 Raytheon Co.
##
import os
from mi.core.log import get_logger
from mi.logging import config
from mi.dataset.parser.spkir_abj_dcl import SpkirAbjDclTelemeteredParser
from mi.dataset.dataset_driver import DataSetDriver
from mi.dataset.dataset_parser import DataSetDriverConfigKeys... | bsd-2-clause |
nagyistoce/edx-platform | lms/djangoapps/certificates/migrations/0005_auto__add_field_generatedcertificate_name.py | 188 | 7270 | # 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):
# Adding field 'GeneratedCertificate.name'
db.add_column('certificates_generatedcertificate', 'name', self.gf('dj... | agpl-3.0 |
flavour/RedHat | modules/s3migration.py | 12 | 43959 | # -*- coding: utf-8 -*-
""" Database Migration Toolkit
@requires: U{B{I{gluon}} <http://web2py.com>}
@copyright: 2012-2015 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
f... | mit |
micahmumper/naev | utils/mission.py | 20 | 2897 | import os
import xml.etree.ElementTree as ET
import tempfile
from xml.sax.saxutils import escape
version=0.1
def indent(elem, level=0):
i = "\n" + level*" "
if len(elem):
if not elem.text or not elem.text.strip():
elem.text = i + " "
if not elem.tail or not elem.tail.strip():
... | gpl-3.0 |
tcwicklund/django | tests/template_tests/filter_tests/test_phone2numeric.py | 345 | 1508 | from django.template.defaultfilters import phone2numeric_filter
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class Phone2numericTests(SimpleTestCase):
@setup({'phone2numeric01': '{{ a|phone2numeric }} {{ b|phone2numeric }}'})
def test_phone2n... | bsd-3-clause |
armleo/limbo-android | jni/qemu/QMP/qmp.py | 78 | 4958 | # QEMU Monitor Protocol Python class
#
# Copyright (C) 2009, 2010 Red Hat Inc.
#
# Authors:
# Luiz Capitulino <lcapitulino@redhat.com>
#
# This work is licensed under the terms of the GNU GPL, version 2. See
# the COPYING file in the top-level directory.
import json
import errno
import socket
class QMPError(Except... | gpl-2.0 |
hypha/zoopla | zoopla/map.py | 1 | 2154 | import logging
logger = logging.getLogger( 'oofy' )
class Map(object):
def __init__(self):
self._points = []
def add_point(self, coordinates):
self._points.append(coordinates)
def marker_js(self, latitude=0,longtitude=0, target_url="http://www.planewalk.net", description="unknown propert... | bsd-2-clause |
kri5/pghoard | pghoard/rohmu/object_storage/azure.py | 1 | 4175 | """
rohmu - azure object store interface
Copyright (c) 2016 Ohmu Ltd
See LICENSE for details
"""
import dateutil.parser
import time
from azure.storage import BlobService # pylint: disable=no-name-in-module, import-error
from .base import BaseTransfer
class AzureTransfer(BaseTransfer):
def __init__(self, account... | apache-2.0 |
duanhong169/google-diff-match-patch | python3/diff_match_patch.py | 297 | 67320 | #!/usr/bin/python3
"""Diff Match and Patch
Copyright 2006 Google Inc.
http://code.google.com/p/google-diff-match-patch/
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/lic... | apache-2.0 |
ovnicraft/suds | suds/mx/core.py | 16 | 4746 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will b... | lgpl-3.0 |
UstadMobile/exelearning-ustadmobile-work | twisted/test/test_ftp_options.py | 41 | 2685 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.tap.ftp}.
"""
from twisted.trial.unittest import TestCase
from twisted.cred import credentials, error
from twisted.tap.ftp import Options
from twisted.python import versions
from twisted.python.filepath import FilePath
... | gpl-2.0 |
akuseru/zulip | zerver/forms.py | 97 | 3911 | from __future__ import absolute_import
from django import forms
from django.core.exceptions import ValidationError
from django.utils.safestring import mark_safe
from django.contrib.auth.forms import SetPasswordForm, AuthenticationForm
from django.conf import settings
from zerver.models import Realm, get_user_profile_... | apache-2.0 |
rynomster/django | tests/annotations/tests.py | 6 | 19583 | from __future__ import unicode_literals
import datetime
from decimal import Decimal
from django.core.exceptions import FieldDoesNotExist, FieldError
from django.db.models import (
F, BooleanField, CharField, Count, DateTimeField, ExpressionWrapper, Func,
IntegerField, Sum, Value,
)
from django.db.models.funct... | bsd-3-clause |
mancoast/CPythonPyc_test | cpython/273_test_complex_args.py | 136 | 3507 |
import unittest
from test import test_support
import textwrap
class ComplexArgsTestCase(unittest.TestCase):
def check(self, func, expected, *args):
self.assertEqual(func(*args), expected)
# These functions are tested below as lambdas too. If you add a
# function test, also add a similar lambda ... | gpl-3.0 |
russellfeeed/exmp-eet | .demeteorized/programs/ctl/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py | 81 | 21295 | #!/usr/bin/env python
# Copyright (c) 2012 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.
import copy
import gyp.input
import optparse
import os.path
import re
import shlex
import sys
import traceback
from gyp.common import GypErr... | mit |
Shaky156/TFP-Kernel-2.6.39 | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
JimCircadian/ansible | test/units/modules/network/f5/test_bigip_device_connectivity.py | 22 | 12724 | # -*- 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
from nose.plugins.skip imp... | gpl-3.0 |
codemac/servo | tests/wpt/css-tests/tools/wptserve/tests/functional/test_request.py | 299 | 2987 | import os
import unittest
import urllib2
import json
import time
import wptserve
from base import TestUsingServer, doc_root
class TestInputFile(TestUsingServer):
def test_seek(self):
@wptserve.handlers.handler
def handler(request, response):
rv = []
f = request.raw_input
... | mpl-2.0 |
nuuuboo/odoo | addons/base_import/models.py | 222 | 14243 | import csv
import itertools
import logging
import operator
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
import psycopg2
from openerp.osv import orm, fields
from openerp.tools.translate import _
FIELDS_RECURSION_LIMIT = 2
ERROR_PREVIEW_BYTES = 200
_logger = logging.ge... | agpl-3.0 |
twiest/openshift-tools | openshift/installer/vendored/openshift-ansible-3.6.173.0.59/roles/openshift_health_checker/openshift_checks/disk_availability.py | 5 | 5957 | """Check that there is enough disk space in predefined paths."""
import tempfile
from openshift_checks import OpenShiftCheck, OpenShiftCheckException
class DiskAvailability(OpenShiftCheck):
"""Check that recommended disk space is available before a first-time install."""
name = "disk_availability"
tags... | apache-2.0 |
turbomanage/training-data-analyst | courses/developingapps/python/kubernetesengine/end/backend/start/frontend/quiz/gcp/spanner.py | 33 | 2582 | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
2014cdbg13/cdbg13 | wsgi/static/Brython2.1.0-20140419-113919/Lib/colorsys.py | 1066 | 3691 | """Conversion functions between RGB and other color systems.
This modules provides two functions for each color system ABC:
rgb_to_abc(r, g, b) --> a, b, c
abc_to_rgb(a, b, c) --> r, g, b
All inputs and outputs are triples of floats in the range [0.0...1.0]
(with the exception of I and Q, which covers a slightly... | gpl-2.0 |
wiso/dask | dask/base.py | 1 | 3934 | import warnings
from operator import attrgetter
from hashlib import md5
from functools import partial
from toolz import merge, groupby, curry
from toolz.functoolz import Compose
from .context import _globals
from .utils import Dispatch, ignoring
__all__ = ("Base", "compute", "normalize_token", "tokenize", "visualize... | bsd-3-clause |
trietptm/volatility | volatility/win32/hashdump.py | 44 | 10456 | # Volatility
# Copyright (c) 2008-2013 Volatility Foundation
# Copyright (c) 2008 Brendan Dolan-Gavitt <bdolangavitt@wesleyan.edu>
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free... | gpl-2.0 |
alcides/rdflib | rdflib/journal.py | 1 | 2342 | import logging
_logger = logging.getLogger(__name__)
from rdflib.graph import QuotedGraph
from rdflib.events import Event, Dispatcher
from rdflib.store import TripleAddedEvent, TripleRemovedEvent, StoreCreatedEvent
class JournalWriter(object):
"""
Writes a journal of the store events.
"""
def __ini... | bsd-3-clause |
jasalt/spotify-ripper | spotify_ripper/main.py | 2 | 15457 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from colorama import init, Fore, AnsiToWin32
from spotify_ripper.ripper import Ripper
from spotify_ripper.utils import *
import os
import sys
import codecs
import time
import argparse
import pkg_resources
if sys.version_info >= (3,... | mit |
chokribr/invenioold | modules/bibexport/lib/bibexport_method_fieldexporter_dblayer.py | 35 | 41803 | # -*- coding: utf-8 -*-
##
## $Id: webmessage_dblayer.py,v 1.28 2008/08/08 13:28:15 cparker Exp $
##
## This file is part of Invenio.
## Copyright (C) 2009, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by t... | gpl-2.0 |
vacancy/TensorArtist | docs/conf.py | 1 | 9615 | # -*- coding: utf-8 -*-
#
# TensorArtist documentation build configuration file, created by
# sphinx-quickstart on Sat Mar 25 17:18:31 2017.
#
# 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
# autogenerated file.
... | mit |
tlksio/tlksio | env/lib/python3.4/site-packages/django/contrib/auth/handlers/modwsgi.py | 54 | 1303 | from django import db
from django.contrib import auth
from django.utils.encoding import force_bytes
UserModel = auth.get_user_model()
def check_password(environ, username, password):
"""
Authenticates against Django's auth database
mod_wsgi docs specify None, True, False as return value depending
on... | mit |
chhans/tor-automation | capture.py | 1 | 3679 | from selenium import webdriver
from torProfile import TorProfile
from pyvirtualdisplay import Display
import selenium
from random import randint
import subprocess
import os
import signal
import sys
import time
training_data = "Dumps/training/"
experiment_data = "Dumps/experiment/"
iface = "eth1"
sleep_time = 2.0
load... | mit |
MSOpenTech/edx-platform | common/djangoapps/student/management/commands/create_user.py | 167 | 4361 | from optparse import make_option
from django.conf import settings
from django.contrib.auth.models import User
from django.core.management.base import BaseCommand
from django.utils import translation
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from opaque_keys.edx.locations impor... | agpl-3.0 |
adammaikai/OmicsPipe2.0 | build/lib.linux-x86_64-2.7/omics_pipe/modules/htseq.py | 2 | 1361 | #!/usr/bin/env python
from omics_pipe.parameters.default_parameters import default_parameters
from omics_pipe.utils import *
p = Bunch(default_parameters)
def htseq(sample, htseq_flag):
'''Runs htseq-count to get raw count data from alignments.
input:
Aligned.out.sort.bam
output:
c... | mit |
sam-tsai/django-old | django/core/validators.py | 158 | 6583 | import re
import urlparse
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
# These values, if given to validate(), will trigger the self.required check.
EMPTY_VALUES = (None, '', [], (), {})
try:
from django... | bsd-3-clause |
rhndg/openedx | cms/djangoapps/contentstore/tests/test_orphan.py | 77 | 4598 | """
Test finding orphans via the view and django config
"""
import json
from contentstore.tests.utils import CourseTestCase
from student.models import CourseEnrollment
from contentstore.utils import reverse_course_url
class TestOrphanBase(CourseTestCase):
"""
Base class for Studio tests that require orphaned ... | agpl-3.0 |
toontownfunserver/Panda3D-1.9.0 | python/Tools/Scripts/h2py.py | 21 | 5962 | #! /usr/bin/env python
# Read #define's and translate to Python code.
# Handle #include statements.
# Handle #define macros with one argument.
# Anything that isn't recognized or doesn't translate into valid
# Python is ignored.
# Without filename arguments, acts as a filter.
# If one or more filenames are given, out... | bsd-3-clause |
fritzstauff/trigger | trigger/contrib/xmlrpc/server.py | 13 | 7760 | """
Trigger Twisted XMLRPC server with an SSH manhole. Supports SSL.
This provides a daemonized Twisted reactor loop, Trigger and client
applications do not have to co-habitate. Using the XMLRPC server model, all
Trigger compatibility tasks can be executed using simple XMLRPC clients that
call the appropriate method w... | bsd-3-clause |
ya7lelkom/googleads-python-lib | examples/dfp/v201411/proposal_line_item_service/get_all_proposal_line_items.py | 4 | 1989 | #!/usr/bin/python
#
# Copyright 2014 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 |
hbtech-ai/ARPS | report_spider/report_spider/spiders/THU004.py | 3 | 2439 | # -*- coding:utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import time
import scrapy
from Global_function import get_localtime, print_new_number, save_messages
now_time = get_localtime(time.strftime("%Y-%m-%d", time.localtime()))
# now_time = 20170401
class THU004_Spider(scrapy.Spider):
name = '... | mit |
dfang/odoo | addons/point_of_sale/wizard/pos_payment.py | 20 | 2299 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
class PosMakePayment(models.TransientModel):
_name = 'pos.make.payment'
_description = 'Point of Sale Payment'
def _default_journal(self):
active_id = self.e... | agpl-3.0 |
befelix/scipy | scipy/optimize/tests/test__spectral.py | 135 | 6585 | from __future__ import division, absolute_import, print_function
import itertools
import numpy as np
from numpy import exp
from numpy.testing import assert_, assert_equal
from scipy.optimize import root
def test_performance():
# Compare performance results to those listed in
# [Cheng & Li, IMA J. Num. An. ... | bsd-3-clause |
poffuomo/spark | python/pyspark/mllib/feature.py | 52 | 25634 | #
# 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 us... | apache-2.0 |
firebitsbr/infernal-twin | build/reportlab/build/lib.linux-i686-2.7/reportlab/graphics/renderPS.py | 29 | 36097 | #Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/renderPS.py
__version__=''' $Id$ '''
__doc__="""Render drawing objects in Postscript"""
from reportlab.pdfbase.pdfmetrics import getFont, str... | gpl-3.0 |
achang97/YouTunes | lib/python2.7/site-packages/markupsafe/_native.py | 1243 | 1187 | # -*- coding: utf-8 -*-
"""
markupsafe._native
~~~~~~~~~~~~~~~~~~
Native Python implementation the C module is not compiled.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from markupsafe import Markup
from markupsafe._compat import text_type
def escape(... | mit |
thundernet8/WRGameVideos-Server | venv/lib/python2.7/site-packages/jinja2/exceptions.py | 977 | 4428 | # -*- coding: utf-8 -*-
"""
jinja2.exceptions
~~~~~~~~~~~~~~~~~
Jinja exceptions.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from jinja2._compat import imap, text_type, PY2, implements_to_string
class TemplateError(Exception):
"""Baseclass for al... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.