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 |
|---|---|---|---|---|---|
phlizik/xbmc | lib/libUPnP/Platinum/Build/Tools/Scripts/GenSvnVersionHeader.py | 263 | 1526 | #! /usr/bin/python
#############################################################
# This tool is used to generate the version info file #
#############################################################
import sys
import os
# ensure that PLATINUM_HOME has been set and exists
if not os.environ.has_key('PLATINUM_KIT_... | gpl-2.0 |
joshfriend/sqlalchemy-utils | tests/types/test_json.py | 2 | 1521 | # -*- coding: utf-8 -*-
from pytest import mark
import sqlalchemy as sa
from sqlalchemy_utils.types import json
from tests import TestCase
class JSONTestCase(TestCase):
def create_models(self):
class Document(self.Base):
__tablename__ = 'document'
id = sa.Column(sa.Integer, primary... | bsd-3-clause |
837468220/python-for-android | python3-alpha/python3-src/Lib/test/testcodec.py | 203 | 1046 | """ Test Codecs (used by test_charmapcodec)
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright 2000 Guido van Rossum.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def deco... | apache-2.0 |
openprocurement/openprocurement.search | openprocurement/search/source/plan.py | 2 | 9860 | # -*- coding: utf-8 -*-
from time import time, mktime
from datetime import datetime, timedelta
from iso8601 import parse_date
from socket import setdefaulttimeout
from retrying import retry
from openprocurement.search.source import BaseSource, TendersClient
from openprocurement.search.source.orgs import OrgsDecoder
fr... | apache-2.0 |
AndrewBMartin/pygurobi | pygurobi/pygurobi.py | 1 | 31972 | """
Functions to support rapid interactive modification of Gurobi models.
For reference on Gurobi objects such as Models, Variables, and Constraints, see
http://www.gurobi.com/documentation/7.0/refman/py_python_api_overview.html.
"""
import csv
import json
try:
import gurobipy as gp
except ImportError:
raise ... | mit |
MIPS/external-chromium_org-third_party-skia | gm/rebaseline_server/column.py | 21 | 2846 | #!/usr/bin/python
"""
Copyright 2014 Google Inc.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
ColumnHeaderFactory class (see class docstring for details)
"""
# Keys used within dictionary representation of each column header.
# NOTE: Keep these in sync with stati... | bsd-3-clause |
timonwong/OmniMarkupPreviewer | OmniMarkupLib/Renderers/libs/pygments/formatters/svg.py | 76 | 5840 | # -*- coding: utf-8 -*-
"""
pygments.formatters.svg
~~~~~~~~~~~~~~~~~~~~~~~
Formatter for SVG output.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.formatter import Formatter
from pygments.util import get_bool_opt, get... | mit |
maciekcc/tensorflow | tensorflow/contrib/layers/python/layers/embedding_ops_test.py | 86 | 31950 | # 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 |
ltilve/chromium | third_party/pymock/mock.py | 424 | 75527 | # mock.py
# Test tools for mocking and patching.
# Copyright (C) 2007-2012 Michael Foord & the mock team
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# mock 1.0
# http://www.voidspace.org.uk/python/mock/
# Released subject to the BSD License
# Please see http://www.voidspace.org.uk/python/license.shtml
# Scripts m... | bsd-3-clause |
tonybaloney/st2contrib | packs/cubesensors/sensors/measurements_sensor.py | 7 | 5820 | import time
from rauth import OAuth1Session
from st2common.util import isotime
from st2reactor.sensor.base import PollingSensor
__all__ = [
'CubeSensorsMeasurementsSensor'
]
BASE_URL = 'https://api.cubesensors.com/v1'
FIELD_CONVERT_FUNCS = {
'temp': lambda value: (float(value) / 100)
}
class CubeSensorsMe... | apache-2.0 |
wengole/channels | channels/backends/__init__.py | 2 | 1129 | from django.utils.module_loading import import_string
class InvalidChannelBackendError(ValueError):
pass
class BackendManager(object):
"""
Takes a settings dictionary of backends and initialises them.
"""
def __init__(self, backend_configs):
self.configs = backend_configs
self.b... | bsd-3-clause |
JeffRoy/mi-dataset | mi/dataset/driver/pco2w_abc/imodem/pco2w_abc_imodem_telemetered_driver.py | 1 | 2797 | #!/usr/bin/env python
"""
@package mi.dataset.driver.pco2w_abc.imodem
@file mi-dataset/mi/dataset/driver/pco2w_abc/imodem/pco2w_abc_imodem_recovered_driver.py
@author Mark Worden
@brief Driver for the pco2w_abc_imodem instrument
Release notes:
Initial Release
"""
from mi.dataset.dataset_parser import DataSetDriverC... | bsd-2-clause |
imcom/pyleus | docs/source/conf.py | 9 | 6716 | # -*- coding: utf-8 -*-
#
# Pyleus documentation build configuration file, created by
# sphinx-quickstart on Tue Sep 30 08:01:12 2014.
#
# 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.
#
# All ... | apache-2.0 |
alrifqi/django | tests/postgres_tests/test_json.py | 284 | 7890 | import datetime
import unittest
from django.core import exceptions, serializers
from django.db import connection
from django.test import TestCase
from . import PostgreSQLTestCase
from .models import JSONModel
try:
from django.contrib.postgres import forms
from django.contrib.postgres.fields import JSONField
... | bsd-3-clause |
igoralmeida/tahoe-lafs | src/allmydata/storage/immutable.py | 7 | 13810 | import os, stat, struct, time
from foolscap.api import Referenceable
from zope.interface import implements
from allmydata.interfaces import RIBucketWriter, RIBucketReader
from allmydata.util import base32, fileutil, log
from allmydata.util.assertutil import precondition
from allmydata.util.hashutil import timing_safe... | gpl-2.0 |
BubuLK/sfepy | tests/test_units.py | 5 | 4763 | from __future__ import absolute_import
from sfepy.base.base import assert_
from sfepy.base.testing import TestCommon
import six
def _cmp(s1, s2):
s1 = s1.split()
s2 = s2.split()
v1, t1 = float(s1[0]), s1[1:]
v2, t2 = float(s2[0]), s2[1:]
return (abs(v1 - v2) < (1e-15 * abs(v1))) and (t1 == t2)
cla... | bsd-3-clause |
BrigDan/pykcd | xkcdb.py | 1 | 3602 | #!/usr/bin/env python3
import gi
import xkcd
from random import SystemRandom
gi.require_version("Gtk","3.0")
from gi.repository import Gtk
rand = SystemRandom()
class myWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="XKCD Browser")
#self.cur_comic stores the number of th... | gpl-3.0 |
gtoonstra/airflow | airflow/hooks/base_hook.py | 14 | 3184 | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | apache-2.0 |
TREND50/GRANDproto_DAQ | cmd_tektro.py | 1 | 6783 | #30/06/2017
#VELLEYEN Stephane
#############################
import os,sys
import vxi11
instr = vxi11.Instrument("192.168.1.10")
print(instr.ask("*IDN?"))
choix=sys.argv[1]
if choix =="1": #Choix des parametres
ch=sys.argv[2]
func=sys.argv[3]
freq=sys.argv[4]
vcc=sys.argv[5]
vcc=int(vcc)
vmax=vpp/2
vm... | gpl-3.0 |
benspaulding/django | tests/regressiontests/pagination_regress/tests.py | 9 | 8453 | from __future__ import unicode_literals
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.utils.unittest import TestCase
class PaginatorTests(TestCase):
"""
Tests for the Paginator and Page classes.
"""
def check_paginator(self, params, output):
"""
... | bsd-3-clause |
onceuponatimeforever/oh-mainline | vendor/packages/html5lib/html5lib/tests/test_parser.py | 66 | 5037 | import os
import sys
import traceback
import StringIO
import warnings
import re
warnings.simplefilter("error")
from support import html5lib_test_files as data_files
from support import TestData, convert, convertExpected
import html5lib
from html5lib import html5parser, treebuilders, constants
treeTypes = {"simpletre... | agpl-3.0 |
tgbugs/pyontutils | neurondm/test/test_integration.py | 1 | 2300 | import unittest
from pathlib import Path
import pytest
from pyontutils.utils import get_working_dir
from pyontutils.config import auth
from pyontutils.integration_test_helper import _TestScriptsBase, Folders, Repo
import neurondm
class TestScripts(Folders, _TestScriptsBase):
""" woo! """
only = tuple()
lasts =... | mit |
vipul-sharma20/oh-mainline | vendor/packages/sqlparse/tests/test_filters.py | 45 | 2523 | '''
Created on 24/03/2012
@author: piranna
'''
import unittest
from sqlparse.filters import StripWhitespace, Tokens2Unicode
from sqlparse.lexer import tokenize
class Test__StripWhitespace(unittest.TestCase):
sql = """INSERT INTO dir_entries(type)VALUES(:type);
INSERT INTO directories(inode)
... | agpl-3.0 |
jkstrick/samba | buildtools/wafsamba/samba_autoconf.py | 15 | 28264 | # a waf tool to add autoconf-like macros to the configure section
import Build, os, sys, Options, preproc, Logs
import string
from Configure import conf
from samba_utils import *
import samba_cross
missing_headers = set()
####################################################
# some autoconf like helpers, to make the ... | gpl-3.0 |
thinkopensolutions/geraldo | geraldo/charts.py | 10 | 17669 | import re, random, decimal
from reportlab.graphics.shapes import Drawing, String
from reportlab.graphics.charts.barcharts import HorizontalBarChart as OriginalHorizBarChart
from reportlab.graphics.charts.barcharts import VerticalBarChart as OriginalVertBarChart
from reportlab.graphics.charts.barcharts import Horizonta... | lgpl-3.0 |
jbzdak/edx-platform | common/lib/xmodule/xmodule/textannotation_module.py | 23 | 6794 | """Text annotation module"""
from lxml import etree
from pkg_resources import resource_string
from xmodule.x_module import XModule
from xmodule.raw_module import RawDescriptor
from xblock.core import Scope, String
from xmodule.annotator_mixin import get_instructions
from xmodule.annotator_token import retrieve_token
f... | agpl-3.0 |
auready/django | django/contrib/gis/db/backends/postgis/pgraster.py | 491 | 5071 | import binascii
import struct
from django.forms import ValidationError
from .const import (
GDAL_TO_POSTGIS, GDAL_TO_STRUCT, POSTGIS_HEADER_STRUCTURE, POSTGIS_TO_GDAL,
STRUCT_SIZE,
)
def pack(structure, data):
"""
Pack data into hex string with little endian format.
"""
return binascii.hexli... | bsd-3-clause |
xgin/letsencrypt | letsencrypt-apache/letsencrypt_apache/tests/tls_sni_01_test.py | 9 | 4782 | """Test for letsencrypt_apache.tls_sni_01."""
import unittest
import shutil
import mock
from letsencrypt.plugins import common_test
from letsencrypt_apache import obj
from letsencrypt_apache.tests import util
class TlsSniPerformTest(util.ApacheTest):
"""Test the ApacheTlsSni01 challenge."""
auth_key = com... | apache-2.0 |
akx/shoop | shoop/core/models/_units.py | 1 | 1973 | # -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import with_statement
from decimal import Decimal
from dja... | agpl-3.0 |
Work4Labs/lettuce | tests/integration/lib/Django-1.3/django/contrib/gis/geometry/test_data.py | 364 | 2994 | """
This module has the mock object definitions used to hold reference geometry
for the GEOS and GDAL tests.
"""
import gzip
import os
from django.contrib import gis
from django.utils import simplejson
# This global used to store reference geometry data.
GEOMETRIES = None
# Path where reference test data is located... | gpl-3.0 |
lissarae/sumatrapdf | ext/freetype2/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
... | gpl-3.0 |
godfather1103/WeiboRobot | python27/1.0/lib/site-packages/pip/vcs/mercurial.py | 280 | 4974 | from __future__ import absolute_import
import logging
import os
import tempfile
import re
from pip.utils import display_path, rmtree
from pip.vcs import vcs, VersionControl
from pip.download import path_to_url
from pip._vendor.six.moves import configparser
logger = logging.getLogger(__name__)
class Mercurial(Vers... | gpl-3.0 |
piotrek-golda/CivilHubCopy | guides/models.py | 3 | 3546 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from locations.mod... | gpl-3.0 |
mgit-at/ansible | packaging/sdist/check-link-behavior.py | 114 | 1290 | #!/usr/bin/env python
"""Checks for link behavior required for sdist to retain symlinks."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import platform
import shutil
import sys
import tempfile
def main():
"""Main program entry point."""
temp_dir = tempf... | gpl-3.0 |
AMOboxTV/AMOBox.LegoBuild | script.module.youtube.dl/lib/youtube_dl/extractor/drtuber.py | 122 | 2521 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import str_to_int
class DrTuberIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?drtuber\.com/video/(?P<id>\d+)/(?P<display_id>[\w-]+)'
_TEST = {
'url': 'http://www.drtuber.com/video/1740434/hot-perky... | gpl-2.0 |
Frostman/eho-horizon | openstack_dashboard/dashboards/project/loadbalancers/tabs.py | 9 | 5153 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013, Big Switch Networks, 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... | apache-2.0 |
rizumu/django | tests/view_tests/tests/test_debug.py | 6 | 40531 | # -*- coding: utf-8 -*-
# This coding header is significant for tests, as the debug view is parsing
# files to search for such a header to decode the source file content
from __future__ import unicode_literals
import importlib
import inspect
import os
import re
import sys
import tempfile
from unittest import skipIf
f... | bsd-3-clause |
xiangke/pycopia | process/pycopia/rsynclib.py | 1 | 2736 | #!/usr/bin/python2.4
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
#
# $Id$
#
# Copyright (C) 1999-2006 Keith Dart <keith@kdart.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software... | lgpl-2.1 |
lmazuel/azure-sdk-for-python | azure-mgmt-datalake-store/azure/mgmt/datalake/store/models/operation_list_result.py | 1 | 1314 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
mbauskar/erpnext | erpnext/commands/__init__.py | 41 | 1431 | # Copyright (c) 2015, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals, absolute_import, print_function
import click
import frappe
from frappe.commands import pass_context, get_site
def call_command(cmd, context):
return click.Context(cmd, obj=c... | gpl-3.0 |
liuliwork/django | tests/template_tests/filter_tests/test_add.py | 503 | 1688 | from datetime import date, timedelta
from django.template.defaultfilters import add
from django.test import SimpleTestCase
from ..utils import setup
class AddTests(SimpleTestCase):
"""
Tests for #11687 and #16676
"""
@setup({'add01': '{{ i|add:"5" }}'})
def test_add01(self):
output = se... | bsd-3-clause |
rubencabrera/odoo | addons/crm/__init__.py | 329 | 1265 | # -*- 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 |
andela-angene/coursebuilder-core | coursebuilder/modules/assessments/assessments_tests.py | 3 | 8401 | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
benagricola/exabgp | lib/exabgp/configuration/environment.py | 1 | 9259 | # encoding: utf-8
"""
environment.py
Created by Thomas Mangin on 2011-11-29.
Copyright (c) 2011-2015 Exa Networks. All rights reserved.
"""
# XXX: raised exception not caught
# XXX: reloading mid-program not possible
# XXX: validation for path, file, etc not correctly test (ie surely buggy)
import os
import sys
imp... | bsd-3-clause |
rdipietro/tensorflow | tensorflow/contrib/distributions/python/ops/inverse_gamma.py | 6 | 8883 | # 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 |
undoware/neutron-drive | google_appengine/lib/django_1_2/django/db/models/sql/query.py | 43 | 81062 | """
Create SQL statements for QuerySets.
The code in here encapsulates all of the SQL construction so that QuerySets
themselves do not have to (and could be backed by things other than SQL
databases). The abstraction barrier only works one way: this module has to know
all about the internals of models in order to get ... | bsd-3-clause |
reflash/zosftp-sublime | third_party/appdirs.py | 335 | 22374 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2005-2010 ActiveState Software Inc.
# Copyright (c) 2013 Eddy Petrișor
"""Utilities for determining application-specific dirs.
See <http://github.com/ActiveState/appdirs> for details and usage.
"""
# Dev Notes:
# - MSDN on where to store app data files:
# ... | gpl-3.0 |
markslwong/tensorflow | tensorflow/tensorboard/backend/event_processing/event_accumulator.py | 28 | 31775 | # 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 |
kizniche/Mycodo | mycodo/inputs/rpi_signal_revolutions.py | 1 | 4596 | # coding=utf-8
import time
import copy
from mycodo.inputs.base_input import AbstractInput
# Measurements
measurements_dict = {
0: {
'measurement': 'revolutions',
'unit': 'rpm'
}
}
# Input information
INPUT_INFORMATION = {
'input_name_unique': 'SIGNAL_RPM',
'input_manufacturer': 'Rasp... | gpl-3.0 |
ekaputra07/gempa-monitor | lib/oauth2client/multistore_file.py | 144 | 13935 | # Copyright 2011 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,... | mit |
sinraf96/electrum | src/test/bctest.py | 57 | 1536 | # Copyright 2014 BitPay, Inc.
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from __future__ import division,print_function,unicode_literals
import subprocess
import os
import json
import sys
def bctest(testDir, testObj, exeext)... | mit |
lokeshjindal15/gem5_transform | src/dev/Terminal.py | 66 | 1972 | # Copyright (c) 2005-2007 The Regents of The University of Michigan
# 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 ... | bsd-3-clause |
aronbierbaum/txsuds | suds/xsd/__init__.py | 205 | 3007 | # 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 ... | lgpl-3.0 |
Dark-Hacker/horizon | openstack_dashboard/dashboards/project/access_and_security/floating_ips/views.py | 65 | 2958 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
# Copyright (c) 2012 X.commerce, a business unit of eBay Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")... | apache-2.0 |
jideobs/twilioAngular | venv/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.py | 224 | 39043 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2014 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from __future__ import unicode_literals
import base64
import codecs
import datetime
import distutils.util
from email import message_from... | mit |
bootphon/crossitlearn | simple_dnn.py | 1 | 32993 | """
A deep neural network with or w/o dropout in one file.
"""
import numpy
import theano
import sys
import math
from theano import tensor as T
from theano import shared
from theano.tensor.shared_randomstreams import RandomStreams
from collections import OrderedDict
BATCH_SIZE = 100
STACKSIZE = 69
def relu_f(vec):
... | mit |
utkarsh-goswami/erpnext | erpnext/config/selling.py | 22 | 7241 | from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"label": _("Sales"),
"icon": "fa fa-star",
"items": [
{
"type": "doctype",
"name": "Quotation",
"description": _("Quotes to Leads or Customers."),
},
{
"type": "doctype",
"name": "Sa... | gpl-3.0 |
freieslabor/info-display | info_display/screens/event_schedule/management/commands/updateevents.py | 1 | 1290 | from django.core.management.base import BaseCommand
from django.conf import settings
from datetime import datetime
from pytz import timezone
from dateutil.tz import tzlocal
from icalendar import Calendar
import urllib.request
from ...models import Event, CalendarFeed
class Command(BaseCommand):
help = 'Updates... | mpl-2.0 |
desihub/desispec | py/desispec/pipeline/control.py | 1 | 46258 | #
# See top-level LICENSE.rst file for Copyright information
#
# -*- coding: utf-8 -*-
"""
desispec.pipeline.control
===========================
Tools for controling pipeline production.
"""
from __future__ import absolute_import, division, print_function
import os
import sys
import re
import time
from collections ... | bsd-3-clause |
sogelink/ansible | lib/ansible/module_utils/facts/virtual/freebsd.py | 135 | 1525 | # 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 |
Javiercerna/MissionPlanner | Lib/encodings/zlib_codec.py | 88 | 3117 | """ Python 'zlib_codec' Codec - zlib compression encoding
Unlike most of the other codecs which target Unicode, this codec
will return Python string objects for both encode and decode.
Written by Marc-Andre Lemburg (mal@lemburg.com).
"""
import codecs
import zlib # this codec needs the optional ... | gpl-3.0 |
rwstauner/python-photo-shrinker | shrinkphotos.py | 1 | 2783 | #!/usr/bin/env python
"shrink photos so that it doesn't take 8 days to transfer them"
# Copyright (c) 2012 Randy Stauner
# Licensed under the MIT License: http://opensource.org/licenses/MIT
from PIL import Image
import os
from os.path import join, isfile, isdir, dirname, basename
import re
import sys
# configur... | mit |
scalable-networks/gnuradio-3.7.0.1 | gr-blocks/python/blocks/qa_max.py | 11 | 1954 | #!/usr/bin/env python
#
# Copyright 2007,2010,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your ... | gpl-3.0 |
gistic/PublicSpatialImpala | thirdparty/thrift-0.9.0/test/py.twisted/test_suite.py | 42 | 5364 | #
# 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 |
50wu/gpdb | contrib/unaccent/generate_unaccent_rules.py | 7 | 12976 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This script builds unaccent.rules on standard output when given the
# contents of UnicodeData.txt [1] and Latin-ASCII.xml [2] given as
# arguments. Optionally includes ligature expansion and Unicode CLDR
# Latin-ASCII transliterator, enabled by default, this can be disabled... | apache-2.0 |
kartikshah1/Test | venv/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.py | 341 | 1877 | # -*- coding: utf-8 -*-
"""
requests.exceptions
~~~~~~~~~~~~~~~~~~~
This module contains the set of Requests' exceptions.
"""
from .packages.urllib3.exceptions import HTTPError as BaseHTTPError
class RequestException(IOError):
"""There was an ambiguous exception that occurred while handling your
request.""... | mit |
pkdevbox/trac | trac/ticket/tests/admin.py | 1 | 13172 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#
# This software consists o... | bsd-3-clause |
rackerlabs/heat-pyrax | pyrax/image.py | 12 | 24535 | # -*- coding: utf-8 -*-
# Copyright (c)2014 Rackspace US, 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/LIC... | apache-2.0 |
clarkerubber/irwin | modules/irwin/training/Evaluation.py | 1 | 3292 | from default_imports import *
from conf.ConfigWrapper import ConfigWrapper
from modules.game.Player import Player
from modules.game.GameStore import GameStore
from modules.game.AnalysedGame import GameAnalysedGame
from modules.irwin.PlayerReport import PlayerReport
class Evaluation(NamedTuple('Evaluation', [
... | agpl-3.0 |
PanYuntao/node-gyp | gyp/pylib/gyp/easy_xml_test.py | 2698 | 3270 | #!/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.
""" Unit tests for the easy_xml.py file. """
import gyp.easy_xml as easy_xml
import unittest
import StringIO
class TestSequenceFunctions(... | mit |
kvar/ansible | lib/ansible/modules/network/ftd/ftd_install.py | 27 | 11868 | #!/usr/bin/python
# Copyright (c) 2019 Cisco and/or its affiliates.
#
# 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 ... | gpl-3.0 |
songhan/neon | neon/transforms/tests/test_leaky.py | 9 | 4642 | # ----------------------------------------------------------------------------
# Copyright 2014 Nervana Systems 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.o... | apache-2.0 |
HybridF5/jacket | jacket/api/compute/openstack/compute/legacy_v2/contrib/server_diagnostics.py | 1 | 2408 | # Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
anisyonk/pilot | saga/constants.py | 10 | 1290 |
__author__ = "Andre Merzky"
__copyright__ = "Copyright 2012-2013, The SAGA Project"
__license__ = "MIT"
""" Global constants """
import radical.utils as ru
######################################################################
#
# task constansts
#
SYNC = 1 # 'Sync'
ASYNC = 2 # 'Async'
... | apache-2.0 |
lgarren/spack | var/spack/repos/builtin/packages/googletest/package.py | 3 | 2706 | ##############################################################################
# Copyright (c) 2013-2017, 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 |
mirror/wget | testenv/misc/metalinkv3_xml.py | 12 | 10236 | from test.http_test import HTTPTest
from misc.wget_file import WgetFile
import hashlib
class Metalinkv3_XML:
""" Metalink/XML v3 object """
# Initialize the Metalink object
def __init__ (self):
self.reset ()
# Reset the Metalink object
def reset (self):
self.LocalFiles = [] ... | gpl-3.0 |
uclouvain/osis | program_management/forms/prerequisite.py | 1 | 3264 | ##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | agpl-3.0 |
fedspendingtransparency/data-act-core | dataactcore/scripts/databaseSetup.py | 1 | 1596 | import sqlalchemy_utils
from dataactcore.config import CONFIG_DB, ALEMBIC_PATH, MIGRATION_PATH
from alembic.config import Config
from alembic import command
from sqlalchemy.exc import ProgrammingError
def createDatabase(dbName):
"""Create specified database if it doesn't exist."""
config = CONFIG_DB
conne... | cc0-1.0 |
alexissmirnov/donomo | donomo_archive/deps/paypal.jonboxall/standard/pdt/tests/pdt.py | 1 | 5162 | """
run this with ./manage.py test website
see http://www.djangoproject.com/documentation/testing/ for details
"""
from django.conf import settings
from django.core.urlresolvers import reverse
from django.shortcuts import render_to_response
from django.template import Context
from django.template.loader import get_temp... | bsd-3-clause |
PIK4/pyspider | pyspider/result/result_worker.py | 74 | 2536 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2014-10-19 15:37:46
import time
import json
import logging
from six.moves import queue as Queue
logger = logging.getLogger("result")
class ResultWorker(o... | apache-2.0 |
parthea/pydatalab | datalab/data/_csv.py | 6 | 7063 | # Copyright 2016 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 agreed ... | apache-2.0 |
BaichuanWu/Blog_on_django | site-packages/django/views/debug.py | 49 | 44795 | from __future__ import unicode_literals
import datetime
import os
import re
import sys
import types
from django.conf import settings
from django.http import (HttpResponse, HttpResponseServerError,
HttpResponseNotFound, HttpRequest, build_request_repr)
from django.template import Template, Context, TemplateDoesNot... | mit |
sebadiaz/rethinkdb | external/v8_3.30.33.16/build/gyp/pylib/gyp/MSVSSettings_test.py | 778 | 65880 | #!/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.
"""Unit tests for the MSVSSettings.py file."""
import StringIO
import unittest
import gyp.MSVSSettings as MSVSSettings
class TestSequence... | agpl-3.0 |
NoUsername/PrivateNotesExperimental | lib/django_openid_auth/forms.py | 23 | 3582 | # django-openid-auth - OpenID integration for django.contrib.auth
#
# Copyright (C) 2007 Simon Willison
# Copyright (C) 2008-2010 Canonical Ltd.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions o... | agpl-3.0 |
Dinnerbone/mcstatus | mcstatus/tests/protocol/test_connection.py | 1 | 9117 | import pytest
from mock import Mock, patch
from mcstatus.protocol.connection import (
Connection,
TCPSocketConnection,
UDPSocketConnection,
)
class TestConnection:
connection: Connection
def setup_method(self):
self.connection = Connection()
def test_flush(self):
self.conne... | apache-2.0 |
wayblink/Naive | spark/spark-sql-perf/dev/merge_pr.py | 9 | 18840 | #!/usr/bin/env python
#
# 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 "Li... | mit |
imnutz/support-tools | googlecode-issues-exporter/bitbucket_issue_converter_test.py | 51 | 6257 | # Copyright 2013 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... | apache-2.0 |
auto-mat/klub | apps/aklub/migrations/0040_auto_20170117_1325.py | 1 | 1245 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-01-17 13:25
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('aklub', '0039_auto_20161221_1256'),
]
operations =... | gpl-3.0 |
tejal29/pants | src/python/pants/goal/aggregated_timings.py | 1 | 1733 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from colle... | apache-2.0 |
wutitoudi/p2pool | p2pool/bitcoin/script.py | 282 | 2589 | from p2pool.util import math, pack
def reads_nothing(f):
return None, f
def protoPUSH(length):
return lambda f: pack.read(f, length)
def protoPUSHDATA(size_len):
def _(f):
length_str, f = pack.read(f, size_len)
length = math.string_to_natural(length_str[::-1].lstrip(chr(0)))
data, f... | gpl-3.0 |
sthalik/git-cola | extras/qtpy/qtpy/QtWebEngineWidgets.py | 3 | 1337 | # -*- coding: utf-8 -*-
#
# Copyright © 2014-2015 Colin Duquesnoy
# Copyright © 2009- The Spyder development Team
#
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
"""
Provides QtWebEngineWidgets classes and functions.
"""
from qtpy import PYQT5, PYQT4, PYSIDE, PythonQtError
# To test ... | gpl-2.0 |
SciLifeLab/standalone_scripts | project_status_extended.py | 4 | 30984 | import sys, os, glob
import argparse
from operator import itemgetter
import subprocess
uppmax_id = 'ngi2016003'
def init_sample_hash_emtry():
empty_sample_result = {
'#Archived_runs' : 0,
'#Data_runs': 0,
'#Analysis_runs': 0,
'#Reads':0,
'RowCov':0,
'#AlignedReads'... | mit |
JimCircadian/ansible | lib/ansible/modules/network/f5/bigip_pool_member.py | 8 | 29017 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# Copyright (c) 2013 Matt Hite <mhite@hotmail.com>
# 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
ANSIBL... | gpl-3.0 |
jocave/snapcraft | snapcraft/internal/libraries.py | 6 | 3011 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2016 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... | gpl-3.0 |
funson/rt-xen | tools/python/xen/web/httpserver.py | 49 | 10765 | #============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope th... | gpl-2.0 |
ytjiang/django | tests/auth_tests/test_decorators.py | 46 | 3774 | from django.conf import settings
from django.contrib.auth import models
from django.contrib.auth.decorators import login_required, permission_required
from django.core.exceptions import PermissionDenied
from django.http import HttpResponse
from django.test import TestCase, override_settings
from django.test.client impo... | bsd-3-clause |
technologiescollege/Blockly-rduino-communication | scripts/Lib/site-packages/setuptools/command/upload.py | 210 | 1077 | import getpass
from distutils.command import upload as orig
class upload(orig.upload):
"""
Override default upload behavior to obtain password
in a variety of different ways.
"""
def finalize_options(self):
orig.upload.finalize_options(self)
# Attempt to obtain password. Short cir... | gpl-3.0 |
coinkeeper/2015-06-22_18-39_feathercoin | contrib/linearize/linearize.py | 145 | 3351 | #!/usr/bin/python
#
# linearize.py: Construct a linear, no-fork, best version of the blockchain.
#
#
# Copyright (c) 2013 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import json
import struct
impo... | mit |
suiyuan2009/tensorflow | tensorflow/contrib/data/python/kernel_tests/iterator_ops_test.py | 5 | 15518 | # 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 |
vene/marseille | experiments/exp_rnn.py | 1 | 5162 | import os
import dill
import numpy as np
from sklearn.model_selection import KFold
from marseille.custom_logging import logging
from marseille.datasets import get_dataset_loader, load_embeds
from marseille.io import cache_fname
from marseille.argrnn import ArgumentLSTM
def argrnn_cv_score(dataset, dynet_weight_deca... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.