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 |
|---|---|---|---|---|---|
jjmleiro/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/humanize/templatetags/humanize.py | 98 | 9276 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import re
from datetime import date, datetime
from decimal import Decimal
from django import template
from django.conf import settings
from django.template import defaultfilters
from django.utils.encoding import force_text
from django.utils.formats imp... | apache-2.0 |
hainn8x/gnuradio | gr-zeromq/examples/python/client.py | 20 | 4108 | #
# Copyright 2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio.
#
# This 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.
#
# Thi... | gpl-3.0 |
jaruba/chromium.src | build/android/pylib/system_properties.py | 97 | 1431 | # Copyright 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.
class SystemProperties(dict):
"""A dict interface to interact with device system properties.
System properties are key/value pairs as exposed by adb s... | bsd-3-clause |
ProfessionalIT/professionalit-webiste | sdk/google_appengine/google/appengine/_internal/django/core/files/temp.py | 23 | 1846 | """
The temp module provides a NamedTemporaryFile that can be re-opened on any
platform. Most platforms use the standard Python tempfile.TemporaryFile class,
but MS Windows users are given a custom class.
This is needed because in Windows NT, the default implementation of
NamedTemporaryFile uses the O_TEMPORARY flag, ... | lgpl-3.0 |
williamfeng323/py-web | flask/lib/python3.6/site-packages/pip/utils/logging.py | 516 | 3327 | from __future__ import absolute_import
import contextlib
import logging
import logging.handlers
import os
try:
import threading
except ImportError:
import dummy_threading as threading
from pip.compat import WINDOWS
from pip.utils import ensure_dir
try:
from pip._vendor import colorama
# Lots of differen... | mit |
odooindia/odoo | openerp/addons/test_convert/tests/test_convert.py | 382 | 2303 | import collections
import unittest2
from lxml import etree as ET
from lxml.builder import E
from openerp.tests import common
from openerp.tools.convert import _eval_xml
Field = E.field
Value = E.value
class TestEvalXML(common.TransactionCase):
def eval_xml(self, node, obj=None, idref=None):
return _eval_... | agpl-3.0 |
0asa/sparklingpandas | sparklingpandas/test/pandas_groupby_tests.py | 2 | 9480 | """
Test our groupby support based on the pandas groupby tests.
"""
#
# This file is licensed under the Pandas 3 clause BSD license.
#
from tempfile import NamedTemporaryFile
from sparklingpandas.test.sparklingpandastestcase import \
SparklingPandasTestCase
import sys
import pandas as pd
from pandas import date_ra... | apache-2.0 |
aliceriot/zulip | zerver/test_external.py | 115 | 8407 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from django.conf import settings
from django.core.exceptions import ValidationError
from django.test import TestCase
from unittest import skip
from zerver.forms import not_mit_mailing_list
from zerver.lib.rate_limiter import (
add_ratelimit_rule,
... | apache-2.0 |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.4/Lib/compiler/misc.py | 15 | 1825 | import types
def flatten(tup):
elts = []
for elt in tup:
if type(elt) == types.TupleType:
elts = elts + flatten(elt)
else:
elts.append(elt)
return elts
class Set:
def __init__(self):
self.elts = {}
def __len__(self):
return len(self.elts)
... | mit |
bussiere/pypyjs | website/demo/home/rfk/repos/pypy/lib-python/2.7/plat-mac/videoreader.py | 40 | 10421 | # Video file reader, using QuickTime
#
# This module was quickly ripped out of another software package, so there is a good
# chance that it does not work as-is and it needs some hacking.
#
# Jack Jansen, August 2000
#
from warnings import warnpy3k
warnpy3k("In 3.x, the videoreader module is removed.", stacklevel=2)
... | mit |
hjhsalo/reana-server | reana_server/api_client.py | 1 | 1852 | # -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2017 CERN.
#
# REANA is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# ver... | gpl-2.0 |
adamchainz/ansible | test/units/module_utils/test_postgresql.py | 63 | 2863 | import json
import sys
from ansible.compat.tests import unittest
from ansible.compat.tests.mock import patch, MagicMock
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.six.moves import builtins
from ansible.module_utils._text import to_native
from units.mock.procenv import swap_stdin_an... | gpl-3.0 |
dontnod/weblate | weblate/accounts/migrations/0012_auto_20190805_1248.py | 1 | 1517 | # Generated by Django 2.2.3 on 2019-08-05 12:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("accounts", "0011_auto_20190721_1810")]
operations = [
migrations.AlterField(
model_name="subscription",
name="notification",
... | gpl-3.0 |
samuto/ladybug | src/Ladybug_Open EPW Weather File.py | 1 | 1873 | # Open Weather data file
#
# Ladybug: A Plugin for Environmental Analysis (GPL) started by Mostapha Sadeghipour Roudsari
#
# This file is part of Ladybug.
#
# Copyright (c) 2013-2015, Mostapha Sadeghipour Roudsari <Sadeghipour@gmail.com>
# Ladybug is free software; you can redistribute it and/or modify
# it... | gpl-3.0 |
Zeken/audacity | lib-src/lv2/lv2/waflib/Tools/vala.py | 276 | 7966 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os.path,shutil,re
from waflib import Context,Task,Utils,Logs,Options,Errors
from waflib.TaskGen import extension,taskgen_method
from waflib.Configure import conf
class ... | gpl-2.0 |
Celedhrim/persomov | couchpotato/core/media/_base/providers/nzb/binnewz/nzbindex.py | 23 | 1814 | from bs4 import BeautifulSoup
from nzbdownloader import NZBDownloader, NZBGetURLSearchResult
from couchpotato.core.helpers.rss import RSS
from couchpotato.core.helpers.encoding import toUnicode, tryUrlencode
from couchpotato.core.helpers.variable import tryInt
from couchpotato.core.logger import CPLog
from couchpotato.... | gpl-3.0 |
Endika/website | website_backend_views/__openerp__.py | 14 | 1548 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2015 Therp BV <http://therp.nl>.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... | agpl-3.0 |
dsp2003/e17p | build/lib.win32-3.1/e17p/base/config.py | 2 | 3904 | #!/usr/bin/env python3
#Copyright 2010 Sebastian Hagen, Svein Ove Aas
# This file is part of E17p.
#
# E17p 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... | gpl-2.0 |
taschik/ramcloud | scripts/log.py | 1 | 2528 | #!/usr/bin/env python
# Copyright (c) 2010 Stanford University
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND T... | isc |
lhfei/spark-in-action | spark-2.x/src/main/python/mllib/svd_example.py | 1 | 1821 | #
# 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 n... | apache-2.0 |
adamhaney/airflow | airflow/contrib/hooks/azure_container_volume_hook.py | 2 | 2200 | # -*- 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 |
rds0751/colinkers | env/Lib/hmac.py | 27 | 5057 | """HMAC (Keyed-Hashing for Message Authentication) Python module.
Implements the HMAC algorithm as described by RFC 2104.
"""
import warnings as _warnings
from _operator import _compare_digest as compare_digest
import hashlib as _hashlib
trans_5C = bytes((x ^ 0x5C) for x in range(256))
trans_36 = bytes((x ^ 0x36) fo... | agpl-3.0 |
bugaevc/thefuck | tests/rules/test_django_south_merge.py | 20 | 2113 | import pytest
from thefuck.rules.django_south_merge import match, get_new_command
from tests.utils import Command
@pytest.fixture
def stderr():
return '''Running migrations for app:
! Migration app:0003_auto... should not have been applied before app:0002_auto__add_field_query_due_date_ but was.
Traceback (most ... | mit |
JeroenZegers/Nabu-MSSS | nabu/neuralnetworks/loss_computers/pit_noise_loss.py | 1 | 1142 | """@file pit_noise_loss.py
contains the PITNoiseLoss"""
import loss_computer
from nabu.neuralnetworks.components import ops
class PITNoiseLoss(loss_computer.LossComputer):
"""A loss computer that calculates the loss"""
def __call__(self, targets, logits, seq_length):
"""
Compute the loss
Creates the operat... | mit |
maohongyuan/kbengine | kbe/src/lib/python/Lib/unittest/test/test_loader.py | 81 | 50320 | import sys
import types
import unittest
class Test_TestLoader(unittest.TestCase):
### Tests for TestLoader.loadTestsFromTestCase
################################################################
# "Return a suite of all tests cases contained in the TestCase-derived
# class testCaseClass"
def te... | lgpl-3.0 |
conversocial/tweepy | examples/streaming.py | 13 | 1034 | from __future__ import absolute_import, print_function
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
# Go to http://apps.twitter.com and create an app.
# The consumer key and secret will be generated for you after
consumer_key=""
consumer_secret=""
# After the ... | mit |
yyuu/botornado | boto/pyami/__init__.py | 396 | 1107 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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, modi... | mit |
GongYiLiao/Python_Daily | 2014/Sep/8/test_opencl_benchmark.py | 1 | 3178 |
import pyopencl as cl
import numpy
import numpy.linalg as la
import scipy.special as ssf
import datetime
from time import time
import test_cython_32
def test_cython_0(zz):
time1 = time()
a, b, c = test_cython_32.test_0(zz)
run_time = time() - time1
print("Execution time of Cython on float32: ", r... | mit |
JGarcia-Panach/odoo | openerp/sql_db.py | 168 | 23783 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | agpl-3.0 |
ralphbean/taskw | taskw/fields/string.py | 2 | 1112 | import logging
import six
from taskw.utils import encode_replacements_experimental
from .base import Field
logger = logging.getLogger(__name__)
class StringField(Field):
def deserialize(self, value):
# If value is None, let's just let it pass through
if not value:
return value
... | gpl-3.0 |
wwright2/dcim3-angstrom1 | sources/openembedded-core/scripts/pybootchartgui/pybootchartgui/draw.py | 7 | 27716 | # This file is part of pybootchartgui.
# pybootchartgui 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.
# pybootchartgui is dis... | mit |
dannyboi104/SickRage | lib/babelfish/converters/countryname.py | 89 | 1077 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2013 the BabelFish authors. All rights reserved.
# Use of this source code is governed by the 3-clause BSD license
# that can be found in the LICENSE file.
#
from __future__ import unicode_literals
from . import CountryReverseConverter, CaseInsensitiveDict
from ..country import... | gpl-3.0 |
pylover/pymlconf | sphinx/conf.py | 1 | 5697 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# pymlconf documentation build configuration file, created by
# sphinx-quickstart on Sat Mar 25 00:12:51 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
# a... | mit |
willfurnass/video4fuze | GUI/v4fPreferences.py | 6 | 3007 | # -*- coding: utf-8 -*-
"""
Module implementing PreferencesDialog.
"""
from PyQt4.QtGui import QDialog
from PyQt4.QtCore import QSettings, QVariant,SIGNAL, QCoreApplication
import fuze, p2fuze
from Ui_Preferences import Ui_PreferencesDialog
class PreferencesDialog(QDialog, Ui_PreferencesDialog):
"""
video4... | gpl-3.0 |
40423244/2017springcd_hw | pelicanconf.py | 19 | 1958 | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = 'KMOL'
SITENAME = '2017Spring 協同產品設計實習 (虎尾科大MDE)'
# 不要用文章所在目錄作為類別
USE_FOLDER_AS_CATEGORY = False
#PATH = 'content'
#OUTPUT_PATH = 'output'
TIMEZONE = 'Asia/Taipei'
DEFAULT_LANG = 'en'
# Feed generation is usually not ... | agpl-3.0 |
enitihas/SAC-Website | venv/lib/python2.7/site-packages/jinja2/filters.py | 598 | 29836 | # -*- coding: utf-8 -*-
"""
jinja2.filters
~~~~~~~~~~~~~~
Bundled jinja filters.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
import math
from random import choice
from operator import itemgetter
from itertools import groupby
from jinja2.utils... | apache-2.0 |
joebowen/movement_validation_cloud | djangodev/lib/python2.7/site-packages/django/utils/dateparse.py | 82 | 2876 | """Functions to parse datetime objects."""
# We're using regular expressions rather than time.strptime because:
# - They provide both validation and parsing.
# - They're more flexible for datetimes.
# - The date/datetime/time constructors produce friendlier error messages.
import datetime
import re
from django.utils ... | mit |
femtoio/Espruino | scripts/build_jswrapper.py | 6 | 19675 | #!/usr/bin/python
# This file is part of Espruino, a JavaScript interpreter for Microcontrollers
#
# Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk>
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain on... | mpl-2.0 |
Micronaet/micronaet-mx | stock/wizard/stock_splitinto.py | 57 | 4055 | # -*- 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 |
capsci/Social-Studio | SocialStudio/node_modules/socket.io/node_modules/engine.io/node_modules/engine.io-parser/node_modules/utf8/tests/generate-test-data.py | 2214 | 1347 | #!/usr/bin/env python
import re
import json
# http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
# http://stackoverflow.com/a/13436167/96656
def unisymbol(codePoint):
if codePoint >= 0x0000 and codePoint <= 0xFFFF:
return unichr(codePoint)
elif codePoint >= 0x010000 and codePoint <= 0x10FFFF:
... | mit |
cmusatyalab/opendiamond | opendiamond/blaster/cache.py | 1 | 5375 | #
# The OpenDiamond Platform for Interactive Search
#
# Copyright (c) 2011-2012 Carnegie Mellon University
# All rights reserved.
#
# This software is distributed under the terms of the Eclipse Public
# License, Version 1.0 which can be found in the file named LICENSE.
# ANY USE, REPRODUCTION OR DISTRIBUTION OF T... | epl-1.0 |
btallman/incubator-airflow | airflow/operators/email_operator.py | 32 | 2201 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | apache-2.0 |
fieldOfView/Cura | plugins/ImageReader/ImageReaderUI.py | 4 | 5070 | # Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
import os
import threading
from PyQt5.QtCore import Qt, QUrl, pyqtSignal, QObject
from PyQt5.QtQml import QQmlComponent, QQmlContext
from UM.FlameProfiler import pyqtSlot
from UM.Application import Application
from UM.Plug... | agpl-3.0 |
ybellavance/python-for-android | python-build/python-libs/gdata/build/lib/gdata/codesearch/service.py | 161 | 4734 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2007 Benoit Chesneau <benoitc@metavers.net>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS... | apache-2.0 |
toshywoshy/ansible | lib/ansible/modules/storage/netapp/na_elementsw_check_connections.py | 59 | 4516 | #!/usr/bin/python
# (c) 2018, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
Moriadry/tensorflow | tensorflow/contrib/timeseries/python/timeseries/estimators_test.py | 52 | 6684 | # 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 |
yade/trunk | examples/rotationalResistance.py | 2 | 1465 | #!/usr/bin/env python
# encoding: utf-8
from yade import utils, plot
o = Omega()
fr = 0.5;rho=2000
tc = 0.001; en = 0.7; et = 0.7; o.dt = 0.0001*tc
r = 0.002
mat1 = O.materials.append(ViscElMat(frictionAngle=fr,mR = 0.05, mRtype = 1, density=rho,tc=tc,en=en,et=et))
mat2 = O.materials.append(ViscElMat(frictionAngle=fr... | gpl-2.0 |
aimacode/aima-python | tests/test_mdp.py | 2 | 8327 | import pytest
from mdp import *
random.seed("aima-python")
sequential_decision_environment_1 = GridMDP([[-0.1, -0.1, -0.1, +1],
[-0.1, None, -0.1, -1],
[-0.1, -0.1, -0.1, -0.1]],
term... | mit |
LCOO/eris | doc/source/conf.py | 2 | 2584 | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software... | apache-2.0 |
unnikrishnankgs/va | venv/lib/python3.5/site-packages/tensorflow/contrib/keras/python/keras/layers/convolutional.py | 15 | 68485 | # 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... | bsd-2-clause |
MOA-2011/enigma2.pli4.0 | lib/python/Screens/LocationBox.py | 25 | 16256 | #
# Generic Screen to select a path/filename combination
#
# GUI (Screens)
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Screens.InputBox import InputBox
from Screens.HelpMenu import HelpableScreen
from Screens.ChoiceBox import ChoiceBox
# Generic
from Tools.BoundFunction import bou... | gpl-2.0 |
asolntsev/selenium | py/selenium/webdriver/support/abstract_event_listener.py | 61 | 2033 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
dcifuen/cloudbday | src/lib/pytz/tzfile.py | 480 | 4869 | #!/usr/bin/env python
'''
$Id: tzfile.py,v 1.8 2004/06/03 00:15:24 zenzen Exp $
'''
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
from datetime import datetime, timedelta
from struct import unpack, calcsize
from pytz.tzinfo import StaticTzInfo, DstTzInfo, memorized_ttinfo
fro... | mit |
mfherbst/spack | var/spack/repos/builtin/packages/usearch/package.py | 5 | 2110 | ##############################################################################
# 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 |
c4fcm/CivilServant | alembic/versions/960085fce39c_generating_migration_for_a_praw_object.py | 1 | 2408 | """Generating migration for a PRAW object
Revision ID: 960085fce39c
Revises: 4d46b88366fc
Create Date: 2016-06-13 17:30:49.056215
"""
# revision identifiers, used by Alembic.
revision = '960085fce39c'
down_revision = '4d46b88366fc'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as s... | mit |
maciekcc/tensorflow | tensorflow/examples/how_tos/reading_data/fully_connected_preloaded_var.py | 100 | 6359 | # 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 |
juliantaylor/scipy | scipy/cluster/tests/test_vq.py | 7 | 6108 | #! /usr/bin/env python
# David Cournapeau
# Last Change: Wed Nov 05 07:00 PM 2008 J
from __future__ import division, print_function, absolute_import
import os.path
import warnings
import numpy as np
from numpy.testing import assert_array_equal, assert_array_almost_equal, \
TestCase, run_module_suite, assert_... | bsd-3-clause |
habanero-rice/hclib | test/performance-regression/full-apps/qmcpack/nexus/library/periodic_table.py | 2 | 57267 | from generic import obj
from developer import DevBase
from unit_converter import UnitConverter
def phys_value_dict(value=None,units=None):
vdict = UnitConverter.convert_scalar_to_all(units,value)
return obj(**vdict)
#end def phys_value_dict
class SimpleElement(DevBase):
def __init__(self):
... | bsd-3-clause |
ttelford/oh-my-zsh | plugins/git-prompt/gitstatus.py | 49 | 3299 | #!/usr/bin/env python
from __future__ import print_function
import os
import sys
import re
from subprocess import Popen, PIPE, check_output
def get_tagname_or_hash():
"""return tagname if exists else hash"""
# get hash
hash_cmd = ['git', 'rev-parse', '--short', 'HEAD']
hash_ = check_output(hash_cmd).... | mit |
coberger/DIRAC | DataManagementSystem/scripts/dirac-admin-user-quota.py | 10 | 1250 | #!/usr/bin/env python
########################################################################
# $HeadURL$
########################################################################
__RCSID__ = "$Id$"
import DIRAC
from DIRAC.Core.Base import Script
Script.setUsageMessage( """
Show storage quotas for specified users or f... | gpl-3.0 |
mitocw/edx-platform | common/test/acceptance/tests/test_cohorted_courseware.py | 4 | 12088 | """
End-to-end test for cohorted courseware. This uses both Studio and LMS.
"""
from bok_choy.page_object import XSS_INJECTION
from common.test.acceptance.fixtures.course import XBlockFixtureDesc
from common.test.acceptance.pages.common.auto_auth import AutoAuthPage
from common.test.acceptance.pages.common.utils imp... | agpl-3.0 |
manfredu/gnucash | src/python/pycons/__init__.py | 22 | 1595 | #! /usr/bin/env python
#
# Copyright (c) 2008, Nicolas Rougier
# 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
# noti... | gpl-2.0 |
milinbhakta/flaskmaterialdesign | venv/Lib/site-packages/pip/_vendor/requests/packages/chardet/gb2312prober.py | 2994 | 1681 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | gpl-2.0 |
orekyuu/intellij-community | plugins/hg4idea/testData/bin/mercurial/peer.py | 96 | 1348 | # peer.py - repository base classes for mercurial
#
# Copyright 2005, 2006 Matt Mackall <mpm@selenic.com>
# Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from i18n import _
im... | apache-2.0 |
lillialexis/python-openid | admin/gettlds.py | 126 | 1061 | """
Fetch the current TLD list from the IANA Web site, parse it, and print
an expression suitable for direct insertion into each library's trust
root validation module
Usage:
python gettlds.py (php|python|ruby)
Then cut-n-paste.
"""
import urllib2
import sys
langs = {
'php': (r"'/\.(",
"'", "|", ... | apache-2.0 |
silenceli/nova | nova/image/download/file.py | 6 | 7286 | # Copyright 2013 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | apache-2.0 |
alu042/edx-platform | common/djangoapps/student/tests/test_userstanding.py | 41 | 4180 | """
These are tests for disabling and enabling student accounts, and for making sure
that students with disabled accounts are unable to access the courseware.
"""
import unittest
from student.tests.factories import UserFactory, UserStandingFactory
from student.models import UserStanding
from django.conf import setting... | agpl-3.0 |
TribeMedia/synapse | synapse/rest/media/v1/upload_resource.py | 2 | 3506 | # -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket 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 required by applicab... | apache-2.0 |
kata-csc/ckanext-oaipmh | docs/conf.py | 1 | 8464 | # -*- coding: utf-8 -*-
#
# Kata documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 15 10:01:47 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 ... | agpl-3.0 |
dvliman/jaikuengine | .google_appengine/lib/django-1.3/django/contrib/gis/geos/libgeos.py | 154 | 5541 | """
This module houses the ctypes initialization procedures, as well
as the notice and error handler function callbacks (get called
when an error occurs in GEOS).
This module also houses GEOS Pointer utilities, including
get_pointer_arr(), and GEOM_PTR.
"""
import os, re, sys
from ctypes import c_char_p, Structur... | apache-2.0 |
binhqnguyen/lena | nsc/scons.py | 2 | 6016 | #! /usr/bin/env python26
#
# SCons - a Software Constructor
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# 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 th... | gpl-2.0 |
cgart/photobooth | mainapp/preview.py | 1 | 2172 | import piggyphoto
from kivy.uix.widget import Widget
from kivy.properties import StringProperty
from kivy.properties import NumericProperty
from kivy.properties import ListProperty, ObjectProperty
from kivy.core.image import Image as CoreImage
from kivy.uix.image import Image
# ------------------------------... | mit |
qrkourier/ansible | lib/ansible/modules/cloud/openstack/os_zone.py | 19 | 7527 | #!/usr/bin/python
# Copyright (c) 2016 Hewlett-Packard Enterprise
#
# This module 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.
#
# T... | gpl-3.0 |
TyRoXx/cdm | original_sources/boost_1_59_0/tools/build/test/project_test4.py | 64 | 1792 | #!/usr/bin/python
# Copyright 2003 Dave Abrahams
# Copyright 2002, 2003, 2004 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
import BoostBuild
t = BoostBuild.Tester(translate_suffixes=0)
t.set_tree("projec... | mit |
aviciimaxwell/odoo | addons/point_of_sale/wizard/__init__.py | 382 | 1200 | # -*- 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... | agpl-3.0 |
briancurtin/pyrax | samples/cloud_dns/update_domain.py | 13 | 1322 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c)2012 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.ap... | apache-2.0 |
Tatsh-ansible/ansible | lib/ansible/module_utils/netscaler.py | 7 | 11232 | # -*- coding: utf-8 -*-
# Copyright (c) 2017 Citrix Systems
#
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of t... | gpl-3.0 |
wfxiang08/django190 | django/utils/termcolors.py | 260 | 7480 | """
termcolors.py
"""
from django.utils import six
color_names = ('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white')
foreground = {color_names[x]: '3%s' % x for x in range(8)}
background = {color_names[x]: '4%s' % x for x in range(8)}
RESET = '0'
opt_dict = {'bold': '1', 'underscore': '4', 'blink... | bsd-3-clause |
orangepole/Snoopy | snoopy/server/bin/snoopy/src/snoopy/db/__init__.py | 4 | 2002 | """Database initialisation."""
import logging
#log = logging.getLogger('snoopy.db')
import traceback
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from . import models
from models import Base, Probe, Cookie, GpsMovement, Wigle, User
engine = None
Session = None
class... | mit |
eseidel/native_client_patches | tests/tone/run.py | 1 | 1783 | #!/usr/bin/python
# Copyright 2008, 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 co... | bsd-3-clause |
HaroldMills/Vesper | vesper/mpg_ranch/nfc_bounding_interval_annotator_1_0/annotator.py | 1 | 7220 | """
Module containing NFC bounding interval annotator, version 1.0.
An NFC bounding interval annotator sets values for the `Call Start Index`
and `Call End Index` annotations for a clip containing a nocturnal flight
call (NFC). If the annotations already exist their values are overwritten,
and if they do not already e... | mit |
mlperf/training_results_v0.7 | Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/3rdparty/onnx-tensorrt/third_party/onnx/setup.py | 1 | 11020 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from distutils.spawn import find_executable
from distutils import sysconfig, log
import setuptools
import setuptools.command.build_py
import setuptools.command.develop
im... | apache-2.0 |
sherpya/archiver | setup_all.py | 1 | 2040 | #!/usr/bin/env python
# -*- Mode: Python; tab-width: 4 -*-
#
# Netfarm Mail Archiver - release 2
#
# Copyright (C) 2005-2007 Gianluigi Tiesi <sherpya@netfarm.it>
# Copyright (C) 2005-2007 NetFarm S.r.l. [http://www.netfarm.it]
#
# This program is free software; you can redistribute it and/or modify
# it under the term... | gpl-2.0 |
boomsbloom/dtm-fmri | DTM/for_gensim/lib/python2.7/site-packages/matplotlib/tests/test_coding_standards.py | 7 | 12216 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
from fnmatch import fnmatch
import os
from nose.tools import assert_equal
from nose.plugins.skip import SkipTest
from matplotlib.testing.noseclasses import KnownFailureTest
try:
import pep8
except ImportE... | mit |
alphafoobar/intellij-community | python/testData/highlighting/unicodeOrByte25.py | 83 | 1080 | _ = "no doc comments in this file"
z = (
"simple"
"escaped \u1234 correct"
"escaped \u123z incorrect"
"escaped \U12345678 correct"
"escaped \U1234567 incorrect"
"hex <info descr="null">\x12</info> correct"
"hex <error descr="Invalid escape sequence">\x1z</error> incorrect"
"named \N{com... | apache-2.0 |
goerz/pelican-plugins | github_activity/github_activity.py | 75 | 1925 | # -*- coding: utf-8 -*-
# NEEDS WORK
"""
Copyright (c) Marco Milanesi <kpanic@gnufunk.org>
Github Activity
---------------
A plugin to list your Github Activity
"""
from __future__ import unicode_literals, print_function
import logging
logger = logging.getLogger(__name__)
from pelican import signals
class GitHub... | agpl-3.0 |
neurord/pysb | pysb/examples/run_earm_1_0.py | 4 | 2975 | #!/usr/bin/env python
"""Reproduce figures 4A and 4B from the EARM 1.0 publication (Albeck et
al. 2008)."""
from pysb.integrate import odesolve
from pylab import *
from earm_1_0 import model
# saturating level of ligand (corresponding to ~1000 ng/ml SuperKiller TRAIL)
Lsat = 6E4;
# relationship of ligand concentr... | bsd-2-clause |
pschmitt/home-assistant | tests/components/influxdb/test_init.py | 3 | 46158 | """The tests for the InfluxDB component."""
from dataclasses import dataclass
import datetime
import pytest
import homeassistant.components.influxdb as influxdb
from homeassistant.components.influxdb.const import DEFAULT_BUCKET
from homeassistant.const import (
EVENT_STATE_CHANGED,
STATE_OFF,
STATE_ON,
... | apache-2.0 |
hanlind/nova | nova/db/sqlalchemy/migrate_repo/versions/245_add_mtu_and_dhcp_server.py | 79 | 2132 | # Copyright (c) 2014 Nebula, Inc.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | apache-2.0 |
louietsai/python-for-android | python3-alpha/extra_modules/pyxmpp2/transport.py | 46 | 30861 | #
# (C) Copyright 2011 Jacek Konieczny <jajcus@jajcus.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License Version
# 2.1 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful... | apache-2.0 |
AlanZatarain/raft | analyzers/base/RegexFinder.py | 11 | 3352 | #
# Author: Seth Law
#
# Copyright (c) 2011 RAFT Team
#
# This file is part of RAFT.
#
# RAFT 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 ve... | gpl-3.0 |
wiltonlazary/arangodb | 3rdParty/V8/V8-5.0.71.39/build/gyp/test/win/gyptest-macro-targetfilename.py | 34 | 1256 | #!/usr/bin/env python
# Copyright (c) 2014 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.
"""
Make sure macro expansion of $(TargetFileName) is handled.
"""
import TestGyp
import os
import sys
if sys.platform == 'win32':
prin... | apache-2.0 |
eloquence/unisubs | apps/search/management/commands/profile_index.py | 5 | 2004 | # Amara, universalsubtitles.org
#
# Copyright (C) 2013 Participatory Culture Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your op... | agpl-3.0 |
mrunge/horizon | openstack_dashboard/dashboards/project/data_processing/cluster_templates/tabs.py | 16 | 2666 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | apache-2.0 |
mattcongy/itshop | docker-images/taigav2/taiga-back/taiga/events/backends/base.py | 2 | 1923 | # -*- coding: utf-8 -*-
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any l... | mit |
nfco/netforce | netforce_hr/netforce_hr/models/utils.py | 16 | 9103 | # Copyright (c) 2012-2015 Netforce Co. Ltd.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publ... | mit |
DeercoderResearch/theano_exercises | 02_advanced/01_symbolic/03_energy_soln.py | 12 | 2327 | import numpy as np
import theano
from theano import function
from theano.sandbox.rng_mrg import MRG_RandomStreams
import theano.tensor as T
def energy(W, V, H):
"""
W : A theano matrix of RBM weights
num visible x num hidden
V : A theano matrix of assignments to visible units
Each row is a... | bsd-3-clause |
adw0rd/lettuce | tests/integration/lib/Django-1.3/django/contrib/comments/views/moderation.py | 307 | 5037 | from django import template
from django.conf import settings
from django.shortcuts import get_object_or_404, render_to_response
from django.contrib.auth.decorators import login_required, permission_required
from utils import next_redirect, confirmation_view
from django.contrib import comments
from django.contrib.commen... | gpl-3.0 |
ragupta-git/ImcSdk | imcsdk/mometa/storage/StorageLocalDiskEp.py | 1 | 1913 | """This module contains the general information for StorageLocalDiskEp ManagedObject."""
from ...imcmo import ManagedObject
from ...imccoremeta import MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
class StorageLocalDiskEpConsts:
pass
class StorageLocalDiskEp(ManagedObject):
"""This is StorageLo... | apache-2.0 |
martindam/googlemock | test/gmock_output_test.py | 986 | 5999 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.