repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
edx-solutions/edx-platform | lms/djangoapps/verify_student/migrations/0002_auto_20151124_1024.py | 1 | 3849 | # -*- coding: utf-8 -*-
from django.db import migrations, models
import model_utils.fields
import django.db.models.deletion
import django.utils.timezone
from django.conf import settings
from opaque_keys.edx.django.models import CourseKeyField
class Migration(migrations.Migration):
dependencies = [
('ve... | agpl-3.0 |
tellapart/flower | flower/api/control.py | 10 | 17444 | from __future__ import absolute_import
import time
import logging
import collections
from tornado import web
from tornado import gen
from ..views import BaseHandler
logger = logging.getLogger(__name__)
class ControlHandler(BaseHandler):
INSPECT_METHODS = ('stats', 'active_queues', 'registered', 'scheduled',
... | bsd-3-clause |
NL66278/odoo | addons/point_of_sale/wizard/pos_payment.py | 344 | 4976 | # -*- 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 |
ObsidianBlk/GemRB--Unofficial- | gemrb/GUIScripts/pst/FloatMenuWindow.py | 1 | 15728 | # -*-python-*-
# GemRB - Infinity Engine Emulator
# Copyright (C) 2003 The GemRB Project
#
# 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
# of the License, or (at your option) ... | gpl-2.0 |
chand3040/cloud_that | lms/djangoapps/course_wiki/settings.py | 260 | 1247 | """
These callables are used by django-wiki to check various permissions
a user has on an article.
"""
from course_wiki.utils import user_is_article_course_staff
def CAN_DELETE(article, user): # pylint: disable=invalid-name
"""Is user allowed to soft-delete article?"""
return _is_staff_for_article(article, ... | agpl-3.0 |
octoblu/alljoyn | alljoyn/alljoyn_c/unit_test/test_report/test_harness-android.py | 5 | 7253 |
# Copyright (c) 2013, AllSeen Alliance. All rights reserved.
#
# Permission to use, copy, modify, and/or 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... | isc |
Koshu/thinkpad_tablet_ics_kernel | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 183 | 5410 | # SchedGui.py - Python extension for perf trace, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... | gpl-2.0 |
mistercrunch/panoramix | tests/queries/saved_queries/commands_tests.py | 1 | 8730 | # 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 |
ecolitan/fatics | venv/lib/python2.7/site-packages/twisted/mail/tap.py | 11 | 12937 | # -*- test-case-name: twisted.mail.test.test_options -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
I am the support module for creating mail servers with twistd
"""
import os
import warnings
from twisted.mail import mail
from twisted.mail import maildir
from twisted.mail import rel... | agpl-3.0 |
mirnylab/cooler | cooler/util.py | 1 | 24268 | # -*- coding: utf-8 -*-
from __future__ import division, print_function
from collections import OrderedDict, defaultdict
from contextlib import contextmanager
import six
import re
import os
from pandas.api.types import is_scalar, is_integer
import numpy as np
import pandas as pd
import h5py
def partition(start, stop... | bsd-3-clause |
sajeeshcs/nested_quota_final | nova/tests/unit/test_weights.py | 31 | 1875 | # Copyright 2011-2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | apache-2.0 |
phaethon/scapy | kamene/all.py | 5 | 1024 | ## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
"""
Aggregate top level objects from all Scapy modules.
"""
from .config import *
from .base_classes import *
from .dadi... | gpl-2.0 |
vivekmishra1991/scikit-learn | examples/tree/plot_iris.py | 271 | 2186 | """
================================================================
Plot the decision surface of a decision tree on the iris dataset
================================================================
Plot the decision surface of a decision tree trained on pairs
of features of the iris dataset.
See :ref:`decision tree ... | bsd-3-clause |
vdmann/cse-360-image-hosting-website | lib/python2.7/site-packages/requests/packages/chardet/chardetect.py | 743 | 1141 | #!/usr/bin/env python
"""
Script which takes one or more file paths and reports on their detected
encodings
Example::
% chardetect somefile someotherfile
somefile: windows-1252 with confidence 0.5
someotherfile: ascii with confidence 1.0
If no paths are provided, it takes its input from stdin.
"""
from ... | mit |
adsabs/ADSfulltext | tests/test_integration/test_error_handler_queue_standard_extract_resubmit.py | 1 | 7070 | """
Integration test that sends packets that cause the StandardExtract workers to
crash. The ErrorHandler worker should then correctly extract the content that is
perfectly fine.
"""
__author__ = 'J. Elliott'
__maintainer__ = 'J. Elliott'
__copyright__ = 'Copyright 2015'
__version__ = '1.0'
__email__ = 'ads@... | gpl-3.0 |
ianstalk/Flexget | flexget/plugins/filter/content_filter.py | 3 | 4772 | from fnmatch import fnmatch
from loguru import logger
from flexget import plugin
from flexget.config_schema import one_or_more
from flexget.event import event
logger = logger.bind(name='content_filter')
class FilterContentFilter:
"""
Rejects entries based on the filenames in the content. Torrent files only... | mit |
stitchfix/splits | splits/readers.py | 1 | 3004 |
class SplitReader(object):
def __init__(self,
manifest_path_or_list,
fileClass=open,
fileArgs={'mode': 'rb'}):
self.fileClass = fileClass
self.fileArgs = fileArgs
if type(manifest_path_or_list) == list:
self.manifest = iter(se... | mit |
nhanle020285/MyNodeApp | node_modules/meanio/node_modules/npm/node_modules/node-gyp/gyp/gyptest.py | 525 | 7988 | #!/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.
__doc__ = """
gyptest.py -- test runner for GYP tests.
"""
import os
import optparse
import subprocess
import sys
class CommandRunner:
"... | mit |
kawamon/hue | desktop/core/ext-py/nose-1.3.7/nose/proxy.py | 94 | 6879 | """
Result Proxy
------------
The result proxy wraps the result instance given to each test. It
performs two functions: enabling extended error/failure reporting
and calling plugins.
As each result event is fired, plugins are called with the same event;
however, plugins are called with the nose.case.Test instance tha... | apache-2.0 |
lamefun/colosseum-xp | utils/image_to_wml.py | 1 | 3995 | import sys
from PIL import Image
path = sys.argv[1]
name = sys.argv[2]
img = Image.open(path)
image_width, image_height = img.size
# (color, marked)
in_pixels=[]
for y in range(0, image_height):
for x in range(0, image_width):
red, green, blue, alpha = img.getpixel((x, y))
opacity = int(round((a... | gpl-2.0 |
dsbrown/FreeCAD | src/Mod/Robot/KukaExporter.py | 28 | 2260 | # Kuka export lib (c) Juergen Riegel 2009 LGPL 2.1 or higher
import time
TeachPointFold = """
;FOLD LIN P4 Vel= 0.2 m/s CPDAT1 Tool[1] Base[0];%{PE}%R 5.4.27,%MKUKATPBASIS,%CMOVE,%VLIN,%P 1:LIN, 2:P4, 3:, 5:0.2, 7:CPDAT1
$BWDSTART = FALSE
LDAT_ACT=LCPDAT1
FDAT_ACT=FP4
BAS(#CP_PARAMS,0.2)
LIN XP4
;ENDFOLD... | lgpl-2.1 |
chyeh727/django | tests/gis_tests/geoapp/tests.py | 189 | 41436 | from __future__ import unicode_literals
import re
import tempfile
from django.contrib.gis import gdal
from django.contrib.gis.db.models import Extent, MakeLine, Union
from django.contrib.gis.geos import (
GeometryCollection, GEOSGeometry, LinearRing, LineString, Point, Polygon,
fromstr,
)
from django.core.man... | bsd-3-clause |
blackzw/openwrt_sdk_dev1 | staging_dir/host/lib/python2.7/idlelib/macosxSupport.py | 34 | 6028 | """
A number of function that enhance IDLE on MacOSX when it used as a normal
GUI application (as opposed to an X11 application).
"""
import sys
import Tkinter
from os import path
_appbundle = None
def runningAsOSXApp():
"""
Returns True if Python is running from within an app on OSX.
If so, assume that ... | gpl-2.0 |
waseem18/oh-mainline | vendor/packages/webtest/tests/test_http.py | 15 | 2148 | # -*- coding: utf-8 -*-
from tests.compat import unittest
from webob import Request
from webtest.debugapp import debug_app
from webtest import http
class TestServer(unittest.TestCase):
def setUp(self):
self.s = http.StopableWSGIServer.create(debug_app)
def test_server(self):
s = self.s
... | agpl-3.0 |
NetApp/cinder | cinder/tests/unit/test_hacking.py | 4 | 19645 | # Copyright 2014 Red Hat, 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 a... | apache-2.0 |
rhyolight/nupic.research | projects/sequence_prediction/continuous_sequence/run_tm_model.py | 4 | 16413 | ## ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013-2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This ... | gpl-3.0 |
cyberark-bizdev/ansible | lib/ansible/modules/network/junos/junos_config.py | 5 | 13349 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, 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',
... | gpl-3.0 |
youprofit/phantomjs | src/qt/qtwebkit/Tools/QueueStatusServer/handlers/statusbubble_unittest.py | 128 | 2482 | # Copyright (C) 2010 Google, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
PlanTool/plantool | wrappingPlanners/Deterministic/LAMA/seq-sat-lama(finished)/translate/sas_tasks.py | 10 | 4793 |
#######################################################################
#
# Author: Malte Helmert (helmert@informatik.uni-freiburg.de)
# (C) Copyright 2003-2004 Malte Helmert
# Modified by: Silvia Richter (silvia.richter@nicta.com.au)
# (C) Copyright 2008: NICTA
#
# This file is part of LAMA.
#
# LAMA is free software... | gpl-2.0 |
BigBearGCU/googletest | xcode/Scripts/versiongenerate.py | 3088 | 4536 | #!/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 |
indefini/linux | scripts/checkkconfigsymbols.py | 371 | 11716 | #!/usr/bin/env python2
"""Find Kconfig symbols that are referenced but not defined."""
# (c) 2014-2015 Valentin Rothberg <valentinrothberg@gmail.com>
# (c) 2014 Stefan Hengelein <stefan.hengelein@fau.de>
#
# Licensed under the terms of the GNU GPL License version 2
import os
import re
import sys
from subprocess imp... | gpl-2.0 |
axelkennedal/dissen | dissenEnv/lib/python3.5/site-packages/django/contrib/auth/management/__init__.py | 348 | 6851 | """
Creates permissions for all installed apps that need permissions.
"""
from __future__ import unicode_literals
import getpass
import unicodedata
from django.apps import apps
from django.contrib.auth import get_permission_codename
from django.core import exceptions
from django.core.management.base import CommandErr... | mit |
Bege13mot/python_koans_solution | python3/runner/runner_tests/test_sensei.py | 102 | 10551 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import unittest
import re
from libs.mock import *
from runner.sensei import Sensei
from runner.writeln_decorator import WritelnDecorator
from runner.mockable_test_result import MockableTestResult
from runner import path_to_enlightenment
class AboutParrots:
... | mit |
Icenowy/MissionPlanner | Lib/site-packages/numpy/distutils/ccompiler.py | 58 | 22774 | import re
import os
import sys
import types
from copy import copy
from distutils.ccompiler import *
from distutils import ccompiler
from distutils.errors import DistutilsExecError, DistutilsModuleError, \
DistutilsPlatformError
from distutils.sysconfig import customize_compiler
from distut... | gpl-3.0 |
markap/TravelMap | boilerplate/forms.py | 6 | 5536 | """
Created on June 10, 2012
@author: peta15
"""
from wtforms import fields
from wtforms import Form
from wtforms import validators
from lib import utils
from webapp2_extras.i18n import lazy_gettext as _
from webapp2_extras.i18n import ngettext, gettext
FIELD_MAXLENGTH = 50 # intended to stop maliciously long input
... | lgpl-3.0 |
danimajo/pineapple_pdf | reportlab/pdfgen/canvas.py | 5 | 75018 | #Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
__version__=''' $Id$ '''
__doc__="""
The Canvas object is the primary interface for creating PDF files. See
doc/reportlab-userguide.pdf for copious examples.
"""
__all__ = ['Canvas']
ENABLE_TRACKING = 1 # turn this off to do profile testin... | mit |
fpy171/django | django/db/backends/postgresql/version.py | 632 | 1517 | """
Extracts the version of the PostgreSQL server.
"""
import re
# This reg-exp is intentionally fairly flexible here.
# Needs to be able to handle stuff like:
# PostgreSQL #.#.#
# EnterpriseDB #.#
# PostgreSQL #.# beta#
# PostgreSQL #.#beta#
VERSION_RE = re.compile(r'\S+ (\d+)\.(\d+)\.?(\d+)?')
def _parse_... | bsd-3-clause |
dillonjerry/aws | AWS-ElasticBeanstalk-CLI-2.6.2/eb/linux/python2.7/lib/aws/requests/compat.py | 289 | 2433 | # -*- coding: utf-8 -*-
"""
pythoncompat
"""
from .packages import charade as chardet
import sys
# -------
# Pythons
# -------
# Syntax sugar.
_ver = sys.version_info
#: Python 2.x?
is_py2 = (_ver[0] == 2)
#: Python 3.x?
is_py3 = (_ver[0] == 3)
#: Python 3.0.x
is_py30 = (is_py3 and _ver[1] == 0)
#: Python 3.1.... | gpl-2.0 |
QuickSander/CouchPotatoServer | libs/requests/packages/chardet/chardistribution.py | 2755 | 9226 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 R... | gpl-3.0 |
tchellomello/home-assistant | homeassistant/components/derivative/sensor.py | 4 | 7282 | """Numeric derivative of data coming from a source sensor over time."""
from decimal import Decimal, DecimalException
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
ATTR_UNIT_OF_MEASUREMENT,
CONF_NAME,
CONF_SOURCE,
... | apache-2.0 |
bzennn/blog_flask | python/lib/python3.5/site-packages/lxml/html/builder.py | 149 | 4310 | # --------------------------------------------------------------------
# The ElementTree toolkit is
# Copyright (c) 1999-2004 by Fredrik Lundh
# --------------------------------------------------------------------
"""
A set of HTML generator tags for building HTML documents.
Usage::
>>> from lxml.html.builder im... | gpl-3.0 |
sachintaware/sublime-wakatime | packages/wakatime/packages/pygments_py3/pygments/lexers/chapel.py | 72 | 3338 | # -*- coding: utf-8 -*-
"""
pygments.lexers.chapel
~~~~~~~~~~~~~~~~~~~~~~
Lexer for the Chapel language.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, bygroups, words
from pygments.token import... | bsd-3-clause |
smashwilson/ansible-modules-core | packaging/os/apt_rpm.py | 74 | 5126 | #!/usr/bin/python -tt
# -*- coding: utf-8 -*-
# (c) 2013, Evgenii Terechkov
# Written by Evgenii Terechkov <evg@altlinux.org>
# Based on urpmi module written by Philippe Makowski <philippem@mageia.org>
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Pub... | gpl-3.0 |
jcshen007/cloudstack | test/integration/component/test_overcommit.py | 3 | 17228 | # 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 |
yljhao/GAE_WiFiSwitch | lib/flask/config.py | 781 | 6234 | # -*- coding: utf-8 -*-
"""
flask.config
~~~~~~~~~~~~
Implements the configuration related objects.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import imp
import os
import errno
from werkzeug.utils import import_string
from ._compat import string_type... | apache-2.0 |
jean/sentry | src/sentry/api/endpoints/event_file_committers.py | 1 | 6977 | from __future__ import absolute_import
from rest_framework.response import Response
import operator
import six
from sentry.api.bases.project import ProjectEndpoint
from sentry.api.serializers import serialize
from sentry.models import (Release, ReleaseCommit, Commit, CommitFileChange, Event, Group)
from sentry.api.s... | bsd-3-clause |
Theer108/invenio | invenio/modules/oauth2server/forms.py | 15 | 5319 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014, 2015 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any... | gpl-2.0 |
bowang/tensorflow | tensorflow/python/estimator/export_strategy_test.py | 4 | 9800 | # 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 |
google-research/seed_rl | agents/policy_gradient/modules/popart.py | 1 | 6455 | # coding=utf-8
# Copyright 2019 The SEED Authors
# 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 agre... | apache-2.0 |
nopoolcoin/p2pool-mom | SOAPpy/Utilities.py | 294 | 5112 | """
################################################################################
# Copyright (c) 2003, Pfizer
# Copyright (c) 2001, Cayce Ullman.
# Copyright (c) 2001, Brian Matthews.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provid... | gpl-3.0 |
kifcaliph/odoo | addons/hr_contract/__openerp__.py | 260 | 1834 | # -*- 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 |
gaddman/ansible | lib/ansible/modules/network/fortios/fortios_system_central_management.py | 10 | 14960 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2018 Fortinet, Inc.
#
# 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 Lic... | gpl-3.0 |
menardorama/ReadyNAS-Add-ons | headphones-1.0.0/debian/headphones/etc/apps/headphones/lib/cherrypy/process/win32.py | 68 | 5772 | """Windows service. Requires pywin32."""
import os
import win32api
import win32con
import win32event
import win32service
import win32serviceutil
from cherrypy.process import wspbus, plugins
class ConsoleCtrlHandler(plugins.SimplePlugin):
"""A WSPBus plugin for handling Win32 console events (like Ctrl-C)."""
... | gpl-2.0 |
arnavd96/Cinemiezer | myvenv/lib/python3.4/site-packages/music21/ext/nbconvert/preprocessors/tests/test_execute.py | 6 | 5995 | """
Module with tests for the execute preprocessor.
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import copy
import glob
import io
import os
import re
try:
from queue import Empty # Py 3
except ImportError:
from Queue import Empty # Py 2
from IPy... | mit |
eht16/suds-improvements | suds/transport/__init__.py | 209 | 3895 | # 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 |
ldm5180/hammerhead | client/plot/bionetplot.py | 1 | 6828 | #!/usr/bin/python
# Copyright (c) 2008-2010, Regents of the University of Colorado.
# This work was supported by NASA contracts NNJ05HE10G, NNC06CB40C, and
# NNC07CB47C.
# 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... | lgpl-2.1 |
mungerd/plastex | plasTeX/Logging.py | 6 | 5546 | #!/usr/bin/env python
import textwrap, types
from logging import CRITICAL, DEBUG, INFO, Logger, StreamHandler, Formatter
from logging import addLevelName, setLoggerClass, FileHandler, Filter
from plasTeX.Config import config as _config
MAX_WIDTH = 75
LOG_FORMAT = '[%(name)s] %(levelname)s: %(message)s'
STATUS_FORMAT ... | mit |
martin-craig/Airtime | python_apps/pypo/install/pypo-remove-files.py | 2 | 1555 | import os
import shutil
import sys
from configobj import ConfigObj
if os.geteuid() != 0:
print "Please run this as root."
sys.exit(1)
PATH_INI_FILE = '/etc/airtime/pypo.cfg'
def remove_file(path):
try:
os.remove(path)
except Exception, e:
pass
# load config file
try:
config = Con... | gpl-3.0 |
dagwieers/ansible | test/units/modules/network/f5/test_bigip_gtm_topology_record.py | 16 | 3757 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
import sys
if sys.version_info < (2... | gpl-3.0 |
NelisVerhoef/scikit-learn | sklearn/linear_model/tests/test_bayes.py | 299 | 1770 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
#
# License: BSD 3 clause
import numpy as np
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import SkipTest
from sklearn.linear_model.bayes import BayesianRidge, ARDRegres... | bsd-3-clause |
funderburkjim/ScharfSandhi | pythonv4/bucknell/prep_vowel.py | 1 | 2375 | """prep_vowel.py
Aug 10, 2015.
Convert External sandhi vowel rules from table in Bucknell, p. 75
to form used by ScharfSandhiTest2.py.
See pythonv4/notes.org
"""
# table codes Sanskrit in slp1
vowel_table="""
-a/-A:-i/-I:-u/-U:-f:-O:-E:-e:-o::C-^8
-A-:-ya-:-va-:-ra-:-Ava-:-A a-:-e '-:-o '-::a-
-A-:-yA-:-vA-:-rA-:-A... | mit |
jbuchbinder/youtube-dl | youtube_dl/extractor/meta.py | 81 | 2623 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from .pladform import PladformIE
from ..utils import (
unescapeHTML,
int_or_none,
ExtractorError,
)
class METAIE(InfoExtractor):
_VALID_URL = r'https?://video\.meta\.ua/(?:iframe/)?(?P<id>[0-9]+)'
_TESTS = [... | unlicense |
venkatsatish/incubator-singa | tool/python/singa/utils/utility.py | 2 | 2793 | #!/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 licen... | apache-2.0 |
xZise/pywikibot-core | tests/utils.py | 1 | 12638 | # -*- coding: utf-8 -*-
"""Test utilities."""
#
# (C) Pywikibot team, 2013-2014
#
# Distributed under the terms of the MIT license.
#
from __future__ import print_function, unicode_literals
__version__ = '$Id$'
#
import os
import re
import subprocess
import sys
import time
import traceback
from warnings import warn
... | mit |
shankari/e-mission-server | emission/analysis/classification/inference/mode/seed/section_features.py | 2 | 16550 | # Standard imports
import math
import logging
import numpy as np
import utm
from sklearn.cluster import DBSCAN
# Our imports
import emission.core.get_database as edb
from emission.core.get_database import get_section_db, get_mode_db, get_routeCluster_db,get_transit_db
from emission.core.common import calDistance, Incl... | bsd-3-clause |
jazcollins/models | domain_adaptation/domain_separation/losses.py | 16 | 10411 | # 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 applicab... | apache-2.0 |
robertnishihara/ray | python/ray/prometheus_exporter.py | 3 | 12904 | # NOTE: This file has been copied from OpenCensus Python exporter.
# It is because OpenCensus Prometheus exporter hasn't released for a while
# and the latest version has a compatibility issue with the latest OpenCensus
# library.
import re
from prometheus_client import start_http_server
from prometheus_client.core i... | apache-2.0 |
proxysh/Safejumper-for-Mac | buildlinux/env64/lib/python2.7/site-packages/twisted/internet/test/test_stdio.py | 21 | 6449 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.internet.stdio}.
"""
from __future__ import absolute_import, division
from twisted.python.runtime import platform
from twisted.internet.test.reactormixins import ReactorBuilder
from twisted.internet.protocol import Protoc... | gpl-2.0 |
kragniz/mypaint | gui/colors/util.py | 2 | 1665 | # This file is part of MyPaint.
# Copyright (C) 2012 by Andrew Chadwick <andrewc-git@piffle.org>
#
# 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 of the License, or
# (at your ... | gpl-2.0 |
labinf/2017.2-cc-rede1-lab05 | peerconn.py | 1 | 2682 | # coding=utf-8
import socket
import struct
import threading
import traceback
class PeerConnection:
def __init__(self, peer_id, host, port, sock=None, debug=True):
# quaisquer exceções serão lançadas para cima
self.id = peer_id
self.debug = debug
if not sock:
self.so... | mit |
srjoglekar246/sympy | sympy/functions/special/polynomials.py | 2 | 36216 | """
This module mainly implements special orthogonal polynomials.
See also functions.combinatorial.numbers which contains some
combinatorial polynomials.
"""
from sympy.core.basic import C
from sympy.core.singleton import S
from sympy.core import Rational
from sympy.core.function import Function, ArgumentIndexError
... | bsd-3-clause |
popazerty/dvbapp-gui2 | lib/python/Plugins/SystemPlugins/PositionerSetup/rotor_calc.py | 85 | 3252 | import math
f = 1.00 / 298.257 # Earth flattning factor
r_sat = 42164.57 # Distance from earth centre to satellite
r_eq = 6378.14 # Earth radius
def calcElevation(SatLon, SiteLat, SiteLon, Height_over_ocean = 0):
a0 = 0.58804392
a1 = -0.17941557
a2 = 0.29906946E-1
a3 = -0.25187400E-2
a4 = 0.82622101E-4
sin... | gpl-2.0 |
santidediego/LearningDjango | lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/charsetgroupprober.py | 2929 | 3791 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 ... | mit |
johan--/Geotrek | geotrek/trekking/forms.py | 1 | 9858 | from django.utils.translation import ugettext as _
from django.conf import settings
from django.forms.models import inlineformset_factory
import floppyforms as forms
from crispy_forms.helper import FormHelper
from crispy_forms.bootstrap import FormActions
from crispy_forms.layout import Layout, Submit, HTML, Div, Fiel... | bsd-2-clause |
VincentYu/docker | vendor/src/github.com/hashicorp/go-msgpack/codec/msgpack_test.py | 1232 | 3478 | #!/usr/bin/env python
# This will create golden files in a directory passed to it.
# A Test calls this internally to create the golden files
# So it can process them (so we don't have to checkin the files).
import msgpack, msgpackrpc, sys, os, threading
def get_test_data_list():
# get list with all primitive typ... | apache-2.0 |
minhphung171093/GreenERP_V8 | openerp/addons/anonymization/__openerp__.py | 260 | 2129 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
beol/reviewboard | reviewboard/admin/validation.py | 9 | 1596 | from __future__ import unicode_literals
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext as _
def validate_bug_tracker(input_url):
"""Validate a bug tracker URL.
This checks that the given URL string contains one (and only one) `%s`
Python format specifica... | mit |
2hf/redis-in-action | python/ch10_listing_source.py | 7 | 30578 |
import binascii
from collections import defaultdict
from datetime import date
from decimal import Decimal
import functools
import json
from Queue import Empty, Queue
import threading
import time
import unittest
import uuid
import redis
CONFIGS = {}
CHECKED = {}
def get_config(conn, type, component, wait=1):
key... | mit |
trevstanhope/hive-node | libs/Adafruit_Python_GPIO/tests/MockGPIO.py | 13 | 1654 | # Copyright (c) 2014 Adafruit Industries
# Author: Tony DiCola
#
# 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, m... | bsd-3-clause |
baiyunping333/BurpSuite-Plugins | Sqlmap/lib/utils/sqlalchemy.py | 7 | 2985 | #!/usr/bin/env python
"""
Copyright (c) 2006-2014 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import imp
import logging
import os
import re
import sys
import warnings
_sqlalchemy = None
try:
f, pathname, desc = imp.find_module("sqlalchemy", sys.path[1:])
_ = i... | gpl-2.0 |
SlimRemix/android_kernel_samsung_trlte | tools/perf/python/twatch.py | 7370 | 1334 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
pallets/werkzeug | src/werkzeug/serving.py | 1 | 38030 | """A WSGI and HTTP server for use **during development only**. This
server is convenient to use, but is not designed to be particularly
stable, secure, or efficient. Use a dedicate WSGI server and HTTP
server when deploying to production.
It provides features like interactive debugging and code reloading. Use
``run_si... | bsd-3-clause |
asidev/aybu-manager | aybu/manager/models/__init__.py | 1 | 1644 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright 2010-2012 Asidev s.r.l.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required b... | apache-2.0 |
yanirs/servo | tests/wpt/css-tests/tools/pywebsocket/src/test/test_dispatch.py | 488 | 13127 | #!/usr/bin/env python
#
# Copyright 2011, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | mpl-2.0 |
venmo/ansible | v1/tests/TestFilters.py | 107 | 5974 | '''
Test bundled filters
'''
import os.path
import unittest, tempfile, shutil
from ansible import playbook, inventory, callbacks
import ansible.runner.filter_plugins.core
import ansible.runner.filter_plugins.mathstuff
INVENTORY = inventory.Inventory(['localhost'])
BOOK = '''
- hosts: localhost
vars:
var: { a: ... | gpl-3.0 |
centaurustech/AnjoMeu | anjo/campaign/migrations/0009_auto__chg_field_campaign_goal.py | 2 | 4453 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Campaign.goal'
db.alter_column(u'campaign_campaign', '... | gpl-2.0 |
LeeRisk/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 |
iulian787/spack | lib/spack/spack/test/container/conftest.py | 2 | 1159 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import pytest
import spack.util.spack_yaml as syaml
@pytest.fixture()
def minimal_configuration():
return {
... | lgpl-2.1 |
ryfeus/lambda-packs | Spacy/source2.7/numpy/core/tests/test_memmap.py | 8 | 7031 | from __future__ import division, absolute_import, print_function
import sys
import os
import shutil
from tempfile import NamedTemporaryFile, TemporaryFile, mktemp, mkdtemp
import mmap
from numpy import (
memmap, sum, average, product, ndarray, isscalar, add, subtract, multiply)
from numpy.compat import Path
from... | mit |
GunnerJnr/_CodeInstitute | Stream-2/Back-End-Development/5.Boggle-Solver-Part-One/6.Words/Solution/test_boggle.py | 2 | 2554 | import unittest
import boggle
from string import ascii_uppercase
class TestBoggle(unittest.TestCase):
def test_Is_This_Thing_On(self):
self.assertEquals(1, boggle.check())
def test_can_create_an_empty_grid(self):
grid = boggle.make_grid(0, 0)
self.assertEquals(len(grid), 0)
def test_grid_size_... | mit |
bsipocz/bokeh | examples/plotting/file/unemployment.py | 46 | 1846 | from collections import OrderedDict
import numpy as np
from bokeh.plotting import ColumnDataSource, figure, show, output_file
from bokeh.models import HoverTool
from bokeh.sampledata.unemployment1948 import data
# Read in the data with pandas. Convert the year column to string
data['Year'] = [str(x) for x in data['Y... | bsd-3-clause |
gameduell/duell | bin/win/python2.7.9/Lib/encodings/cp862.py | 593 | 33626 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP862.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors='strict'):
... | bsd-2-clause |
OrangeJuices/demobuild | googletest-release-1.7.0/test/gtest_shuffle_test.py | 3023 | 12549 | #!/usr/bin/env python
#
# Copyright 2009 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... | mit |
benoitsteiner/tensorflow-opencl | tensorflow/contrib/learn/python/learn/learn_io/numpy_io_test.py | 79 | 9338 | # 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 |
faust64/ansible | lib/ansible/module_utils/api.py | 106 | 3560 | #
# (c) 2015 Brian Ccoa, <bcoca@ansible.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) any later versio... | gpl-3.0 |
kingvuplus/bh-s | lib/python/Screens/AutoDiseqc.py | 35 | 10119 | from Screens.Screen import Screen
from Components.ConfigList import ConfigListScreen, ConfigList
from Components.ActionMap import ActionMap
from Components.Sources.FrontendStatus import FrontendStatus
from Components.Sources.StaticText import StaticText
from Components.config import config, configfile, getConfigListEnt... | gpl-2.0 |
hamzehd/edx-platform | common/test/acceptance/pages/lms/pay_and_verify.py | 110 | 6385 | """Payment and verification pages"""
import re
from bok_choy.page_object import PageObject
from bok_choy.promise import Promise
from . import BASE_URL
from .dashboard import DashboardPage
class PaymentAndVerificationFlow(PageObject):
"""Interact with the split payment and verification flow.
The flow can be... | agpl-3.0 |
njmube/erpnext | erpnext/stock/doctype/item_attribute/item_attribute.py | 47 | 2236 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe import _
from erpnext.controllers.item_variant import (validate_is_increm... | agpl-3.0 |
tempbottle/restcommander | play-1.2.4/python/Lib/site-packages/win32/scripts/killProcName.py | 38 | 1766 | # Kills a process by process name
#
# Uses the Performance Data Helper to locate the PID, then kills it.
# Will only kill the process if there is only one process of that name
# (eg, attempting to kill "Python.exe" will only work if there is only
# one Python.exe running. (Note that the current process does not
# coun... | apache-2.0 |
EKiefer/edge-starter | py34env/Lib/site-packages/pip/cmdoptions.py | 34 | 15877 | """
shared options and groups
The principle here is to define options once, but *not* instantiate them
globally. One reason being that options with action='append' can carry state
between parses. pip parses general options twice internally, and shouldn't
pass on state. To be consistent, all options will follow this de... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.