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 |
|---|---|---|---|---|---|
zaffra/Donate | django/contrib/localflavor/sk/sk_districts.py | 543 | 2453 | """
Slovak districts according to http://sk.wikipedia.org/wiki/Administrat%C3%ADvne_%C4%8Dlenenie_Slovenska
"""
from django.utils.translation import ugettext_lazy as _
DISTRICT_CHOICES = (
('BB', _('Banska Bystrica')),
('BS', _('Banska Stiavnica')),
('BJ', _('Bardejov')),
('BN', _('Banovce nad Bebravo... | bsd-3-clause |
xclxxl414/rqalpha | rqalpha/events.py | 1 | 4843 | # -*- coding: utf-8 -*-
#
# Copyright 2017 Ricequant, 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 |
alvarofierroclavero/scikit-learn | sklearn/datasets/rcv1.py | 113 | 8170 | """RCV1 dataset.
"""
# Author: Tom Dupre la Tour
# License: BSD 3 clause
import logging
from os.path import exists, join
from gzip import GzipFile
from io import BytesIO
from contextlib import closing
try:
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen
import numpy as np... | bsd-3-clause |
zenoss/Community-Zenpacks | ZenPacks.community.WBEMDataSource/ZenPacks/community/WBEMDataSource/lib/pywbem/cim_http.py | 7 | 11950 | #
# (C) Copyright 2003-2005 Hewlett-Packard Development Company, L.P.
# (C) Copyright 2006-2007 Novell, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2 of the
# L... | gpl-2.0 |
tjyang/fpm | lib/fpm/package/pyfpm/get_metadata.py | 23 | 3395 | from distutils.core import Command
import os
import sys
import pkg_resources
try:
import json
except ImportError:
import simplejson as json
PY3 = sys.version_info[0] == 3
if PY3:
def u(s):
return s
else:
def u(s):
if isinstance(u, unicode):
return u
return s.decode(... | mit |
penhoi/linux-3.14.56 | 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 |
JizhouZhang/SDR | gr-uhd/apps/hf_radio/output.py | 58 | 1387 | # Copyright 2011 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 option)
# any later version.
#
# G... | gpl-3.0 |
Boblepointu/FuCoin | contrib/devtools/fix-copyright-headers.py | 173 | 1484 | #!/usr/bin/env python
'''
Run this script inside of src/ and it will look for all the files
that were changed this year that still have the last year in the
copyright headers, and it will fix the headers on that file using
a perl regex one liner.
For example: if it finds something like this and we're in 2014
// Copyr... | mit |
candrews/portage | pym/portage/emaint/modules/config/config.py | 11 | 2021 | # Copyright 2005-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import portage
from portage import os
from portage.const import PRIVATE_PATH
from portage.util import grabdict, writedict
class CleanConfig(object):
short_desc = "Discard any no longer installed configs from e... | gpl-2.0 |
AladdinSonni/youtube-dl | devscripts/zsh-completion.py | 99 | 1380 | #!/usr/bin/env python
from __future__ import unicode_literals
import os
from os.path import dirname as dirn
import sys
sys.path.append(dirn(dirn((os.path.abspath(__file__)))))
import youtube_dl
ZSH_COMPLETION_FILE = "youtube-dl.zsh"
ZSH_COMPLETION_TEMPLATE = "devscripts/zsh-completion.in"
def build_completion(opt_... | unlicense |
iguzu/gae-django | tests/regressiontests/forms/fields.py | 1 | 42687 | # -*- coding: utf-8 -*-
tests = r"""
>>> from django.forms import *
>>> from django.forms.widgets import RadioFieldRenderer
>>> from django.core.files.uploadedfile import SimpleUploadedFile
>>> import datetime
>>> import time
>>> import re
>>> try:
... from decimal import Decimal
... except ImportError:
... fro... | bsd-3-clause |
yencarnacion/jaikuengine | .google_appengine/lib/django-1.4/tests/regressiontests/bug639/tests.py | 30 | 1365 | """
Tests for file field behavior, and specifically #639, in which Model.save()
gets called *again* for each FileField. This test will fail if calling a
ModelForm's save() method causes Model.save() to be called more than once.
"""
from __future__ import absolute_import
import os
import shutil
from django.core.files... | apache-2.0 |
supriyantomaftuh/termbox-go | collect_terminfo.py | 184 | 2041 | #!/usr/bin/env python
import sys, os, subprocess
def escaped(s):
return repr(s)[1:-1]
def tput(term, name):
try:
return subprocess.check_output(['tput', '-T%s' % term, name]).decode()
except subprocess.CalledProcessError as e:
return e.output.decode()
def w(s):
if s == None:
return
sys.stdout.write(s)
... | mit |
pjdelport/django | django/contrib/localflavor/at/forms.py | 109 | 2551 | """
AT-specific Form helpers
"""
from __future__ import unicode_literals
import re
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.translation import ugettext_lazy as _
re_ssn = re.compile(r'^\d{4} \d{... | bsd-3-clause |
Zhongqilong/kbengine | kbe/res/scripts/common/Lib/site-packages/pip/_vendor/html5lib/treewalkers/genshistream.py | 1730 | 2278 | from __future__ import absolute_import, division, unicode_literals
from genshi.core import QName
from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT
from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT
from . import _base
from ..constants import voidElements, namespaces
class ... | lgpl-3.0 |
mgugino-upstream-stage/ansible-modules-core | database/mysql/mysql_db.py | 50 | 15161 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Mark Theunissen <mark.theunissen@gmail.com>
# Sponsored by Four Kitchens http://fourkitchens.com.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publishe... | gpl-3.0 |
opticron/asterisk-testsuite-temporary | lib/python/asterisk/buildoptions.py | 2 | 3429 | #!/usr/bin/env python
"""Asterisk Build Options Handling
This module implements an Asterisk build options parser. It
tracks what build options Asterisk was compiled with, and returns
whether or not a particular build option was enabled.
Copyright (C) 2011-2012, Digium, Inc.
Matt Jordan <mjordan@digium.com>
This pro... | gpl-2.0 |
chromium/chromium | chrome/browser/resources/chromeos/accessibility/braille_ime/check_braille_ime.py | 8 | 1204 | #!/usr/bin/env python
# Copyright 2014 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.
'''Uses the closure compiler to check the braille ime.'''
import os
import sys
_SCRIPT_DIR = os.path.dirname(os.path.abspath(__file... | bsd-3-clause |
ehealthafrica-ci/formhub | main/models/user_profile.py | 2 | 2112 | from django.contrib.auth.models import User
from django.db import models
from django.utils.translation import ugettext_lazy
from utils.country_field import COUNTRIES
from utils.gravatar import get_gravatar_img_link, gravatar_exists
from django.db.models.signals import post_save
from rest_framework.authtoken.models impo... | bsd-2-clause |
robwebset/script.sonos | resources/lib/soco/music_services/music_service.py | 1 | 34829 | # -*- coding: utf-8 -*-
# pylint: disable=fixme
"""Sonos Music Services interface.
This module provides the MusicService class and related functionality.
"""
from __future__ import absolute_import, unicode_literals
import logging
import requests
from xmltodict import parse
from .. import discovery
from ..compat ... | gpl-2.0 |
alanjw/GreenOpenERP-Win-X86 | openerp/addons/web/__openerp__.py | 55 | 3404 | {
'name': 'Web',
'category': 'Hidden',
'version': '7.0.1.0',
'description':
"""
OpenERP Web core module.
========================
This module provides the core of the OpenERP Web Client.
""",
'depends': [],
'auto_install': True,
'post_load': 'wsgi_postload',
'js' : [
... | agpl-3.0 |
GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/factory/base.py | 1 | 23739 | # -*- coding: utf-8 -*-
# Copyright (c) 2010 Mark Sandstrom
# Copyright (c) 2011-2013 Raphaël Barrois
#
# 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 ... | agpl-3.0 |
Akasurde/ansible | test/lib/ansible_test/_internal/io.py | 21 | 3151 | """Functions for disk IO."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import errno
import io
import json
import os
from . import types as t
from .encoding import (
ENCODING,
to_bytes,
to_text,
)
def read_json_file(path): # type: (t.AnyStr) -> t.Any
""... | gpl-3.0 |
retomerz/intellij-community | python/lib/Lib/site-packages/django/utils/html.py | 116 | 7418 | """HTML utilities suitable for global use."""
import re
import string
from django.utils.safestring import SafeData, mark_safe
from django.utils.encoding import force_unicode
from django.utils.functional import allow_lazy
from django.utils.http import urlquote
# Configuration for urlize() function.
LEADING_PUNCTUATIO... | apache-2.0 |
aabbox/kbengine | kbe/res/scripts/common/Lib/posixpath.py | 92 | 13448 | """Common operations on Posix pathnames.
Instead of importing this module directly, import os and refer to
this module as os.path. The "os.path" name is an alias for this
module on Posix systems; on other systems (e.g. Mac, Windows),
os.path provides the same operations in a manner specific to that
platform, and is a... | lgpl-3.0 |
dkamotsky/program-y | src/test/parser/template/graph/test_graph_client.py | 3 | 2056 | import unittest
import xml.etree.ElementTree as ET
from programy.bot import Bot
from programy.brain import Brain
from programy.config.client.client import ClientConfiguration
from programy.config.brain import BrainConfiguration
from programy.dialog import Question, Sentence
from programy.parser.template.graph import T... | mit |
thumbimigwe/echorizr | lib/python2.7/site-packages/django/contrib/gis/gdal/raster/const.py | 253 | 1539 | """
GDAL - Constant definitions
"""
from ctypes import (
c_double, c_float, c_int16, c_int32, c_ubyte, c_uint16, c_uint32,
)
# See http://www.gdal.org/gdal_8h.html#a22e22ce0a55036a96f652765793fb7a4
GDAL_PIXEL_TYPES = {
0: 'GDT_Unknown', # Unknown or unspecified type
1: 'GDT_Byte', # Eight bit unsigned in... | mit |
40223247/2015_w11 | static/Brython3.1.0-20150301-090019/Lib/collections/abc.py | 739 | 16026 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) for collections, according to PEP 3119.
Unit tests are in test_collections.
"""
from abc import ABCMeta, abstractmethod
import sys
__all__ = ["Hashable", "Iterable", "Iterator",
... | gpl-3.0 |
trishnaguha/python-fedora | fedora/tg/templates/genshi/__init__.py | 4 | 3239 | '''
Genshi version of templates to make adding certain Fedora widgets easier.
--------------------------------------------
:mod:`fedora.tg.templates.genshi.login.html`
--------------------------------------------
.. module:: fedora.tg.templates.genshi.login.html
:synopsis: Templates related to logging in and out.
... | gpl-2.0 |
atmshop/litecoin | share/qt/extract_strings_qt.py | 2945 | 1844 | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
they can be picked up by Qt linguist.
'''
from subprocess import Popen, PIPE
import glob
import operator
OUT_CPP="src/qt/bitcoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' format produced by x... | mit |
HopeFOAM/HopeFOAM | ThirdParty-0.1/ParaView-5.0.1/VTK/Filters/Core/Testing/Python/multipleIso.py | 20 | 2127 | #!/usr/bin/env python
import math
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# Graphics stuff
# Create the RenderWindow, Renderer and both Actors
#
ren1 = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren1)
iren = vtk.vtkRende... | gpl-3.0 |
go2net/PythonBlocks | checkbox.py | 1 | 4174 | from PyQt4 import QtCore, QtGui
import sys
class Node(object):
def __init__(self, name, parent=None, checked=False):
self._name = name
self._children = []
self._parent = parent
self._checked = checked
if parent is not None:
parent.addChild(self)
def add... | mit |
analurandis/Tur | backend/venv/Lib/site-packages/sphinx/writers/websupport.py | 9 | 1664 | # -*- coding: utf-8 -*-
"""
sphinx.writers.websupport
~~~~~~~~~~~~~~~~~~~~~~~~~
sphinx.websupport writer that adds comment-related annotations.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from sphinx.writers.html import HTMLTranslat... | mit |
h2oai/h2o-3 | h2o-py/tests/testdir_algos/glm/pyunit_solvers_glm.py | 3 | 1357 | from __future__ import print_function
import sys
from h2o.exceptions import H2OResponseError
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
from h2o.estimators.glm import H2OGeneralizedLinearEstimator
def glm_solvers():
predictors = ["displacement","power","weight","acceleration","year"]... | apache-2.0 |
JCDJulian/groupme-markov-simulator | Markov_Chains.py | 1 | 2050 | import markovify
import random
import language_check
"""
Handles all aspects of the Markov chains. Training from data, generating new posts from chains.
"""
def generate_markov_models(user_names):
"""
Builds a dictionary of user_name :: Markov text models from the text corpus of each user.
:param user_nam... | apache-2.0 |
evansd/django | tests/template_tests/filter_tests/test_phone2numeric.py | 176 | 1500 | 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 |
tortib/nzbToMedia | libs/mutagen/oggvorbis.py | 16 | 4163 | # Ogg Vorbis support.
#
# Copyright 2006 Joe Wreschnig
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
"""Read and write Ogg Vorbis comments.
This module handles Vorbis files wrapp... | gpl-3.0 |
mrtc0/scoreserver | scoreserver/app/migrations/0003_submit.py | 1 | 1171 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-02-01 09:41
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('app', '0002_auto_20170201_... | mit |
ThinkingBridge/platform_external_chromium_org | chrome/test/functional/tracing/tracer.py | 69 | 2648 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import pyauto_tracing
import pyauto
import tab_tracker
from timeline_model import TimelineModel
import os
class Tracer(object):
"""Controlls chrome ... | bsd-3-clause |
bangi123/pexpect | tests/test_run.py | 17 | 6445 | #!/usr/bin/env python
# encoding: utf-8
'''
PEXPECT LICENSE
This license is approved by the OSI and FSF as GPL-compatible.
http://opensource.org/licenses/isc-license.txt
Copyright (c) 2012, Noah Spurrier <noah@noah.org>
PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY
P... | isc |
strykejern/TTreeReader | tutorials/histfactory/example.py | 62 | 2355 | #!/usr/bin/env python
#
# A pyROOT script demonstrating
# an example of writing a HistFactory
# model using python
#
# This example was written to match
# the example.xml analysis in
# $ROOTSYS/tutorials/histfactory/
#
# Written by George Lewis
#
def main():
try:
import ROOT
except:
print "I... | lgpl-2.1 |
whiteviel/bc-10-LibreIssueTracker | app/mod_auth/controllers.py | 1 | 3595 | from urlparse import urlparse, urljoin
from flask import render_template, request, flash, redirect, url_for, Blueprint
from flask import session
from flask_login import login_user, logout_user, LoginManager, current_user
from app import db, app
from app.mod_auth.views import LoginForm
from app.mod_auth.views import R... | gpl-3.0 |
popazerty/test | lib/python/Components/Converter/sdgExtraInfo.py | 4 | 11596 | # shamelessly copied from pliExpertInfo (Vali, Mirakels, Littlesat)
from enigma import iServiceInformation, iPlayableService
from Components.Converter.Converter import Converter
from Components.Element import cached
from Components.config import config
from Tools.Transponder import ConvertToHumanReadable
from Tools.Sd... | gpl-2.0 |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.2/Lib/SimpleXMLRPCServer.py | 1 | 8352 | """Simple XML-RPC Server.
This module can be used to create simple XML-RPC servers
by creating a server and either installing functions, a
class instance, or by extending the SimpleXMLRPCRequestHandler
class.
A list of possible usage patterns follows:
1. Install functions:
server = SimpleXMLRPCServer(("localhost", ... | mit |
sjohannes/exaile | plugins/previewdevice/previewprefs.py | 2 | 4153 | # Copyright (C) 2012 Dustin Spicuzza
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that... | gpl-2.0 |
coreos/dev-util | host/lib/cros_output.py | 3 | 4410 | # Copyright (c) 2011 The Chromium OS 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 os
import sys
from chromite.lib import terminal
# Output verbosity levels that we support
ERROR = 0
WARNING = 1
NOTICE = 2
INFO = 3
DEBUG = 4... | bsd-3-clause |
detiber/ansible | lib/ansible/modules/packaging/os/package.py | 56 | 2229 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Ansible, inc
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your o... | gpl-3.0 |
LUTAN/tensorflow | tensorflow/contrib/framework/python/framework/checkpoint_utils_test.py | 16 | 12312 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
lagopus/ryu-lagopus-ext | ryu/services/protocols/vrrp/monitor.py | 56 | 6586 | # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013 Isaku Yamahata <yamahata at private email ne jp>
#
# 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
#
# h... | apache-2.0 |
nagakawa/x801 | tools/samantha.py | 1 | 5505 | import argparse
import builtins as bi
import array
import io
import numpy as np
import pathlib
from PIL import Image
from typing import Optional, Tuple
def writeInt(f, n, b):
f.write((n % (1 << 8 * b)).to_bytes(b, byteorder='little'))
def writeIntSigned(f, n, b):
f.write((n).to_bytes(b, byteorder='little', signed... | agpl-3.0 |
icea-dev/atn-sim-ng | configs/core/home/myservices/gpsd.py | 2 | 3369 | #
# CORE
# Copyright (c)2010-2012 the Boeing Company.
# See the LICENSE file included in this distribution.
#
''' Sample user-defined service.
'''
import os
from core.service import CoreService, addservice
from core.misc.ipaddr import IPv4Prefix, IPv6Prefix
class Gpsd(CoreService):
''' This is a sample user-defi... | gpl-3.0 |
DinoCow/airflow | airflow/api_connexion/schemas/connection_schema.py | 7 | 2033 | #
# 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... | apache-2.0 |
madjam/mxnet | example/neural-style/end_to_end/model_vgg19.py | 43 | 6553 | # 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 |
gundalow/ansible-modules-core | cloud/azure/azure_rm_virtualnetwork_facts.py | 47 | 5853 | #!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Soft... | gpl-3.0 |
lauringlab/variant_pipeline | scripts/move_files_again.py | 1 | 3340 | import argparse
import shutil
import os
import errno
import re
parser = argparse.ArgumentParser(description='So you\'ve run your analysis and deleted the copied fastq files to save space and now you need to run it again. This script takes in the renaming log file in the form initialfile\ttext\tfinal file and recopies t... | apache-2.0 |
Oteng/youtube-dl | youtube_dl/extractor/tunein.py | 120 | 3453 | # coding: utf-8
from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
from ..utils import ExtractorError
class TuneInIE(InfoExtractor):
_VALID_URL = r'''(?x)https?://(?:www\.)?
(?:
tunein\.com/
(?:
radio/.*?-s|
station/.*?Stat... | unlicense |
cloudcache/namebench | libnamebench/mocks.py | 175 | 2503 | # Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
hickey/amforth | core/devices/atmega6490p/device.py | 5 | 6779 | # Partname: ATmega6490P
# generated automatically, do not edit
MCUREGS = {
'ADMUX': '&124',
'ADMUX_REFS': '$C0',
'ADMUX_ADLAR': '$20',
'ADMUX_MUX': '$1F',
'ADCSRA': '&122',
'ADCSRA_ADEN': '$80',
'ADCSRA_ADSC': '$40',
'ADCSRA_ADATE': '$20',
'ADCSRA_ADIF': '$10',
'ADCSRA_ADIE': '$08',
'ADCSR... | gpl-2.0 |
selfcommit/gaedav | pyxml/dom/NodeIterator.py | 4 | 4002 | ########################################################################
#
# File Name: NodeIterator.py
#
#
"""
Node Iterators from DOM Level 2. Allows "flat" iteration over nodes.
WWW: http://4suite.com/4DOM e-mail: support@4suite.com
Copyright (c) 2000 Fourthought Inc, USA. All Rights Reserved.... | lgpl-2.1 |
gocardless/gocardless-pro-python | tests/integration/payments_integration_test.py | 1 | 19284 | # WARNING: Do not edit by hand, this file was generated by Crank:
#
# https://github.com/gocardless/crank
#
import json
import requests
import responses
from nose.tools import (
assert_equal,
assert_is_instance,
assert_is_none,
assert_is_not_none,
assert_not_equal,
assert_raises
)
from gocardless_pro.e... | mit |
alxgu/ansible | lib/ansible/modules/net_tools/dnsmadeeasy.py | 18 | 23609 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
intermezzo-fr/onedrive-d | onedrive_d/common/netman.py | 2 | 2344 | """
Monitor thread for network connectivity. It internally holds a queue for
threads blocked because of network failure.
"""
import queue
import time
import threading
import requests
from onedrive_d.common import logger_factory
class NetworkMonitor(threading.Thread):
THREAD_NAME = "netmon"
... | gpl-3.0 |
clairetang6/bokeh | bokeh/sampledata/gapminder.py | 8 | 2810 | ''' Provide a pandas DataFrame instance of four of the datasets from gapminder.org.
These are read in from csv filess that have been downloaded from Bokeh's
sample data on S3. But the original code that generated the csvs from the
raw gapminder data is available at the bottom of this file.
'''
from __future__ import a... | bsd-3-clause |
chshu/openthread | tools/harness-automation/cases_R140/router_8_2_2.py | 18 | 1877 | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# 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
# notic... | bsd-3-clause |
ChristopheVuillot/qiskit-sdk-py | qiskit/unroll/_circuitbackend.py | 1 | 11723 | # -*- coding: utf-8 -*-
# Copyright 2017 IBM RESEARCH. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
osvalr/odoo | addons/payment_adyen/models/adyen.py | 165 | 7767 | # -*- coding: utf-'8' "-*-"
import base64
try:
import simplejson as json
except ImportError:
import json
from hashlib import sha1
import hmac
import logging
import urlparse
from openerp.addons.payment.models.payment_acquirer import ValidationError
from openerp.addons.payment_adyen.controllers.main import Adye... | agpl-3.0 |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/billiard/five.py | 3 | 5490 | # -*- coding: utf-8 -*-
"""
celery.five
~~~~~~~~~~~
Compatibility implementations of features
only available in newer Python versions.
"""
from __future__ import absolute_import
# ############# py3k #########################################################
import sys
PY3 = sys.version_info[0] == 3
... | agpl-3.0 |
zahodi/ansible | test/units/mock/yaml_helper.py | 28 | 5243 | import io
import yaml
from ansible.parsing.yaml.loader import AnsibleLoader
from ansible.parsing.yaml.dumper import AnsibleDumper
from ansible.compat.six import PY3
class YamlTestUtils(object):
"""Mixin class to combine with a unittest.TestCase subclass."""
def _loader(self, stream):
"""Vault related... | gpl-3.0 |
LearnEra/LearnEraPlaftform | cms/envs/acceptance.py | 13 | 3959 | """
This config file extends the test environment configuration
so that we can run the lettuce acceptance tests.
"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=W0401, W0614
from .test import *
from lms.envs.sauce import *... | agpl-3.0 |
seecr/meresco-html | meresco/html/login/__init__.py | 1 | 1874 | ## begin license ##
#
# "Meresco Html" is a template engine based on generators, and a sequel to Slowfoot.
# It is also known as "DynamicHtml" or "Seecr Html".
#
# Copyright (C) 2012 Meertens Instituut (KNAW) http://meertens.knaw.nl
# Copyright (C) 2012-2016, 2020-2021 Seecr (Seek You Too B.V.) https://seecr.nl
# Copyr... | gpl-2.0 |
cpimhoff/End-of-the-Line | character-lists/google-image-search.py | 1 | 1206 | import requests
import os
import json
from lxml import etree, html
import urllib
import sys
names = open(sys.argv[1])
while True:
name = names.readline().strip()
print(name)
if len(name) == 0:
break
if os.path.exists(name + ".jpg"):
print(" already exists")
continue
oldname... | mit |
adtidiane/Nouabook | votainteligente/urls.py | 1 | 1078 | from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
from django.conf.urls.i18n import i18n_patterns
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'votainteligente.views.home', name='home'),
# ur... | gpl-3.0 |
rickerc/nova_audit | nova/virt/libvirt/imagecache.py | 8 | 24356 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Michael Still and Canonical 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:... | apache-2.0 |
sungkim11/mhargadh | django/contrib/messages/storage/fallback.py | 627 | 2171 | from django.contrib.messages.storage.base import BaseStorage
from django.contrib.messages.storage.cookie import CookieStorage
from django.contrib.messages.storage.session import SessionStorage
class FallbackStorage(BaseStorage):
"""
Tries to store all messages in the first backend, storing any unstored
mes... | bsd-3-clause |
zhaishaomin/LDS-prefetcher-research | gem5_src/mem/cache/tags/Tags.py | 39 | 3359 | # Copyright (c) 2012-2013 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functiona... | apache-2.0 |
samdowd/drumm-farm | drumm_env/lib/python2.7/site-packages/django/contrib/staticfiles/handlers.py | 581 | 2328 | from django.conf import settings
from django.contrib.staticfiles import utils
from django.contrib.staticfiles.views import serve
from django.core.handlers.wsgi import WSGIHandler, get_path_info
from django.utils.six.moves.urllib.parse import urlparse
from django.utils.six.moves.urllib.request import url2pathname
clas... | mit |
joberreiter/pyload | module/remote/thriftbackend/ThriftClient.py | 42 | 3100 | # -*- coding: utf-8 -*-
import sys
from socket import error
from os.path import dirname, abspath, join
from traceback import print_exc
try:
import thrift
except ImportError:
sys.path.append(abspath(join(dirname(abspath(__file__)), "..", "..", "lib")))
from thrift.transport import TTransport
#from thrift.tran... | gpl-3.0 |
75651/kbengine_cloud | kbe/res/scripts/common/Lib/encodings/iso8859_7.py | 272 | 12844 | """ Python Character Mapping Codec iso8859_7 generated from 'MAPPINGS/ISO8859/8859-7.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_table)
def decode(self,input,errors='... | lgpl-3.0 |
leoc/home-assistant | tests/components/test_logbook.py | 1 | 15111 | """The tests for the logbook component."""
# pylint: disable=protected-access,too-many-public-methods
from datetime import timedelta
import unittest
from unittest.mock import patch
from homeassistant.components import sun
import homeassistant.core as ha
from homeassistant.const import (
EVENT_STATE_CHANGED, EVENT_... | mit |
dpassante/ansible | lib/ansible/playbook/task.py | 7 | 22110 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
geoffroygivry/CyclopsVFX-Polyphemus | scripts/connect_db.py | 1 | 1425 | # The MIT License (MIT)
#
# Copyright (c) 2015 Geoffroy Givry
#
# 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, mo... | mit |
ssxenon01/music-app | main/auth/auth.py | 1 | 13226 | # coding: utf-8
from __future__ import absolute_import
import functools
import re
from flask.ext import login
from flask.ext import wtf
from flask.ext.oauthlib import client as oauth
from google.appengine.ext import ndb
import flask
import unidecode
import wtforms
import cache
import config
import model
import task... | mit |
marcoantoniooliveira/labweb | oscar/lib/python2.7/site-packages/whoosh/query/positional.py | 37 | 9274 | # Copyright 2007 Matt Chaput. All rights reserved.
#
# 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... | bsd-3-clause |
user-none/calibre | src/cherrypy/lib/auth_basic.py | 88 | 3416 | # This file is part of CherryPy <http://www.cherrypy.org/>
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:expandtab:fileencoding=utf-8
__doc__ = """This module provides a CherryPy 3.x tool which implements
the server-side of HTTP Basic Access Authentication, as described in :rfc:`2617`.
Example usage, using the built-in che... | gpl-3.0 |
zhoujh30/folium | tests/test_plugins.py | 3 | 7372 | # -*- coding: utf-8 -*-
"""
Folium Plugins Tests
--------------------
"""
import folium
from folium import plugins
import numpy as np
import json
class TestPlugins(object):
"""Test class for Folium plugins."""
def test_scroll_zoom_toggler(self):
mapa = folium.Map([45., 3.], zoom_start=4)
m... | mit |
PeterWangIntel/chromium-crosswalk | tools/telemetry/telemetry/core/video_unittest.py | 8 | 1424 | # Copyright 2014 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 logging
import os
import unittest
from telemetry.core import platform
from telemetry.core import util
from telemetry.core import video
from telemetry... | bsd-3-clause |
wenderen/servo | tests/wpt/web-platform-tests/referrer-policy/generic/tools/generate.py | 88 | 7320 | #!/usr/bin/env python
import os, sys, json
from common_paths import *
import spec_validator
import argparse
def expand_test_expansion_pattern(spec_test_expansion, test_expansion_schema):
expansion = {}
for artifact in spec_test_expansion:
artifact_value = spec_test_expansion[artifact]
if arti... | mpl-2.0 |
UBERMALLOW/external_skia | PRESUBMIT.py | 22 | 19070 | # Copyright (c) 2013 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.
"""Top-level presubmit script for Skia.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmi... | bsd-3-clause |
brettdh/rbtools | rbtools/__init__.py | 2 | 2275 | #
# __init__.py -- Basic version and package information
#
# Copyright (c) 2007-2009 Christian Hammond
# Copyright (c) 2007-2009 David Trowbridge
#
# 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 So... | mit |
diffeo/Datawake | server/datawake/plugin/scraper.py | 1 | 2889 | """
Copyright 2014 Sotera Defense Solutions, 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 |
mozilla/mozillians | mozillians/users/tests/test_tasks.py | 3 | 13902 | from datetime import datetime
from django.conf import settings
from django.contrib.auth.models import User
from django.test.utils import override_settings
from basket.base import BasketException
from celery.exceptions import Retry
from mock import patch
from nose.tools import eq_, ok_
from mozillians.common.tests im... | bsd-3-clause |
achang97/YouTunes | lib/python2.7/site-packages/youtube_dl/extractor/blinkx.py | 199 | 3217 | from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import (
remove_start,
int_or_none,
)
class BlinkxIE(InfoExtractor):
_VALID_URL = r'(?:https?://(?:www\.)blinkx\.com/#?ce/|blinkx:)(?P<id>[^?]+)'
IE_NAME = 'blinkx'
_TEST = {
'url': 'http:... | mit |
san-mate/python-social-auth | examples/cherrypy_example/db/saplugin.py | 60 | 1258 | # -*- coding: utf-8 -*-
from cherrypy.process import plugins
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
class SAEnginePlugin(plugins.SimplePlugin):
def __init__(self, bus, connection_string=None):
self.sa_engine = None
self.connection_string = con... | bsd-3-clause |
nunogt/tempest | tempest/api/network/test_metering_extensions.py | 17 | 6784 | # Copyright (C) 2014 eNovance SAS <licensing@enovance.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 applicabl... | apache-2.0 |
luojiesi/balancer | transaction.py | 1 | 1193 | from models import *
import webapp2
class Transaction(webapp2.RequestHandler):
# get all transactions for one user
def get(self):
uid = self.request.get('uid', '')
if not uid:
# render error page
return
user = User.get_by_id(uid)
transactions = [Transac... | gpl-3.0 |
credativUK/OCB | addons/account/project/wizard/account_analytic_journal_report.py | 56 | 3115 | # -*- 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 |
caseyching/Impala | tests/common/failure_injector.py | 16 | 3806 | # Copyright (c) 2012 Cloudera, Inc. All rights reserved.
#
# Failure injection module for the Impala service. There are two main ways this module
# can be used - the first is to initialize the failure injector and then call start()
# which will kick off a timer that chooses a random impalad/state store process
# to fai... | apache-2.0 |
Pakketeretet2/lammps | tools/i-pi/ipi/inputs/thermostats.py | 33 | 9095 | """Deals with creating the thermostats class.
Copyright (C) 2013, Joshua More and Michele Ceriotti
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... | gpl-2.0 |
clinton-hall/nzbToMedia | libs/win/jaraco/windows/api/message.py | 1 | 1275 | #!/usr/bin/env python
"""
jaraco.windows.message
Windows Messaging support
"""
import ctypes
from ctypes.wintypes import HWND, UINT, WPARAM, LPARAM, DWORD, LPVOID
import six
LRESULT = LPARAM
class LPARAM_wstr(LPARAM):
"""
A special instance of LPARAM that can be constructed from a string
instance (for functio... | gpl-3.0 |
illicitonion/givabit | lib/sdks/google_appengine_1.7.1/google_appengine/lib/django_1_3/django/db/models/fields/files.py | 156 | 16228 | import datetime
import os
import django.utils.copycompat as copy
from django.conf import settings
from django.db.models.fields import Field
from django.core.files.base import File, ContentFile
from django.core.files.storage import default_storage
from django.core.files.images import ImageFile, get_image_dimensions
fr... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.