repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
harri88/harri88.github.io | node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/styles/vim.py | 364 | 1976 | # -*- coding: utf-8 -*-
"""
pygments.styles.vim
~~~~~~~~~~~~~~~~~~~
A highlighting style for Pygments, inspired by vim.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keywor... | mit |
jmcorgan/gnuradio | gr-blocks/python/blocks/qa_wavfile.py | 51 | 2216 | #!/usr/bin/env python
#
# Copyright 2008,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 |
LegitSavage/namebench | nb_third_party/graphy/line_chart.py | 205 | 4253 | #!/usr/bin/python2.4
#
# Copyright 2008 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 o... | apache-2.0 |
tianweizhang/nova | nova/virt/libvirt/vif.py | 2 | 27960 | # Copyright (C) 2011 Midokura KK
# Copyright (C) 2011 Nicira, Inc
# 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
#
# ... | apache-2.0 |
XXMrHyde/android_external_chromium_org | chrome/test/functional/webrtc_write_wsh.py | 66 | 2397 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# This module is handler for incoming data to the pywebsocket standalone server
# (source is in http://code.google.com/p/pywebsocket/source/browse/trunk... | bsd-3-clause |
loco-odoo/localizacion_co | openerp/addons/crm_helpdesk/report/__init__.py | 442 | 1083 | # -*- 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 |
t3dev/odoo | addons/resource/tests/common.py | 15 | 1756 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests.common import TransactionCase
class TestResourceCommon(TransactionCase):
def _define_calendar(self, name, attendances, tz):
return self.env['resource.calendar'].create({
'name':... | gpl-3.0 |
bvcms/bvcms | CmsWeb/Lib/multiprocessing/dummy/connection.py | 168 | 2807 | #
# Analogue of `multiprocessing.connection` which uses queues instead of sockets
#
# multiprocessing/dummy/connection.py
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditi... | gpl-2.0 |
faun/django_test | build/lib/django/contrib/gis/db/backends/oracle/models.py | 310 | 2184 | """
The GeometryColumns and SpatialRefSys models for the Oracle spatial
backend.
It should be noted that Oracle Spatial does not have database tables
named according to the OGC standard, so the closest analogs are used.
For example, the `USER_SDO_GEOM_METADATA` is used for the GeometryColumns
model and the `SDO_... | bsd-3-clause |
lulufei/youtube-dl | test/test_YoutubeDL.py | 24 | 20870 | #!/usr/bin/env python
from __future__ import unicode_literals
# Allow direct execution
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import copy
from test.helper import FakeYDL, assertRegexpMatches
from youtube_dl import YoutubeDL
from youtube_d... | unlicense |
lochiiconnectivity/boto | boto/ec2/reservedinstance.py | 12 | 8480 | # Copyright (c) 2006-2009 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 |
jyejare/robottelo | tests/foreman/cli/test_repository.py | 1 | 102147 | # -*- encoding: utf-8 -*-
"""Test class for Repository CLI
:Requirement: Repository
:CaseAutomation: Automated
:CaseLevel: Component
:CaseComponent: Repositories
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
import pytest
from fauxfactory import gen_alphanumeric
from fauxfactory import gen_string... | gpl-3.0 |
matteocrippa/dsl-n55u-bender | release/src/router/openvpn/win/build_ddk.py | 11 | 1559 | import os
from wb import system, home_fn, choose_arch
def build_ddk(config, dir, x64):
ddk_path = config['DDK_PATH']
ddk_major = int(config['DDKVER_MAJOR'])
debug = 'PRODUCT_TAP_DEBUG' in config
return build_tap(ddk_path, ddk_major, debug, dir, x64)
def build_tap(ddk_path, ddk_major, debug, dir, x64):... | gpl-2.0 |
gnieboer/gnuradio | gr-wxgui/python/wxgui/const_window.py | 58 | 6131 | #
# Copyright 2008 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
#... | gpl-3.0 |
Angoreher/xcero | stats/models.py | 1 | 1039 | # -*- coding: utf-8 -*-
""" Models for the stats application. """
# standard library
# django
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.translation import ugettext_lazy as _
# models
from base.models import BaseModel
from users.models import User
class Stat(BaseMode... | mit |
jessstrap/servotk | tests/wpt/web-platform-tests/tools/wptserve/wptserve/ranges.py | 142 | 3004 | from .utils import HTTPException
class RangeParser(object):
def __call__(self, header, file_size):
prefix = "bytes="
if not header.startswith(prefix):
raise HTTPException(416, message="Unrecognised range type %s" % (header,))
parts = header[len(prefix):].split(",")
ran... | mpl-2.0 |
rghe/ansible | lib/ansible/modules/packaging/os/opkg.py | 95 | 5138 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Patrick Pelletier <pp.pelletier@gmail.com>
# Based on pacman (Afterburn) and pkgin (Shaun Zinck) modules
#
# 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... | gpl-3.0 |
greut/invenio-kwalitee | kwalitee/views.py | 3 | 12240 | # -*- coding: utf-8 -*-
#
# This file is part of kwalitee
# Copyright (C) 2014, 2015 CERN.
#
# kwalitee 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) an... | gpl-2.0 |
andrewleech/SickRage | sickbeard/providers/hdtorrents_it.py | 3 | 8277 | # coding=utf-8
# Author: Dustyn Gibson <miigotu@gmail.com>
#
# URL: https://sickrage.github.io
#
# This file is part of SickRage.
#
# SickRage 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 o... | gpl-3.0 |
kxliugang/edx-platform | lms/djangoapps/lti_provider/tests/test_tasks.py | 36 | 4381 | """
Tests for the LTI outcome service handlers, both in outcomes.py and in tasks.py
"""
import ddt
from django.test import TestCase
from mock import patch, MagicMock
from student.tests.factories import UserFactory
from lti_provider.models import GradedAssignment, LtiConsumer, OutcomeService
import lti_provider.tasks ... | agpl-3.0 |
openhatch/oh-mainline | vendor/packages/gdata/src/atom/http_core.py | 40 | 19862 | #!/usr/bin/env python
#
# Copyright (C) 2009 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... | agpl-3.0 |
duyet-website/api.duyet.net | lib/faker/providers/address/uk_UA/__init__.py | 3 | 5601 | # coding=utf-8
from __future__ import unicode_literals
from random import randint
from .. import Provider as AddressProvider
class Provider(AddressProvider):
address_formats = ['{{street_address}}, {{city}}, {{postcode}}']
building_number_formats = ['#', '##', '###']
city_formats = ['{{city_prefix}} {{f... | mit |
JMY1000/CyclesMineways | CyclesMineways.py | 1 | 46368 | # Cycles Mineways setup
# Version 1.3.0, 5/28/16
# Copyright © 2016
# Please send suggestions or report bugs at https://github.com/JMY1000/CyclesMineways/
# 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 Foundat... | gpl-3.0 |
ClovisIRex/Snake-django | env/lib/python3.6/site-packages/rest_framework/throttling.py | 25 | 8143 | """
Provides various throttling policies.
"""
from __future__ import unicode_literals
import time
from django.core.cache import cache as default_cache
from django.core.exceptions import ImproperlyConfigured
from rest_framework.compat import is_authenticated
from rest_framework.settings import api_settings
class Ba... | mit |
lyft/graphite-web | webapp/graphite/finders/standard.py | 30 | 4096 | import os
from os.path import isdir, isfile, join, basename
from django.conf import settings
from graphite.logger import log
from graphite.node import BranchNode, LeafNode
from graphite.readers import WhisperReader, GzippedWhisperReader, RRDReader
from graphite.util import find_escaped_pattern_fields
from . import fs... | apache-2.0 |
oceanobservatories/mi-instrument | mi/platform/rsn/test/test_oms_client.py | 9 | 1674 | # #!/usr/bin/env python
#
# """
# @package ion.agents.platform.rsn.test.test_oms_client
# @file ion/agents/platform/rsn/test/test_oms_client.py
# @author Carlos Rueda
# @brief Test cases for CIOMSClient. The OMS enviroment variable can be used
# to indicate which CIOMSClient will be tested.
# """
#
# __a... | bsd-2-clause |
dataxu/ansible | lib/ansible/modules/cloud/openstack/os_keypair.py | 5 | 4722 | #!/usr/bin/python
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013, Benno Joy <benno@ansible.com>
# Copyright (c) 2013, John Dewey <john@dewey.ws>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, div... | gpl-3.0 |
yaojenkuo/BuildingMachineLearningSystemsWithPython | ch03/rel_post_20news.py | 24 | 3903 | # This code is supporting material for the book
# Building Machine Learning Systems with Python
# by Willi Richert and Luis Pedro Coelho
# published by PACKT Publishing
#
# It is made available under the MIT License
import sklearn.datasets
import scipy as sp
new_post = \
"""Disk drive problems. Hi, I have a probl... | mit |
hef/samba | python/samba/netcmd/spn.py | 46 | 7603 | # spn management
#
# Copyright Matthieu Patou mat@samba.org 2010
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# T... | gpl-3.0 |
ace02000/pyload | module/plugins/accounts/FastshareCz.py | 1 | 1470 | # -*- coding: utf-8 -*-
import re
from module.plugins.internal.Account import Account
from module.plugins.internal.Plugin import set_cookie
class FastshareCz(Account):
__name__ = "FastshareCz"
__type__ = "account"
__version__ = "0.11"
__status__ = "testing"
__description__ = """Fastshare... | gpl-3.0 |
bowlofstew/common | api/biiapi.py | 5 | 2554 | from abc import ABCMeta, abstractmethod
from biicode.common.model.symbolic.reference import References
from biicode.common.edition.block_holder import BlockHolder
class BiiAPI(object):
'''The main interface to user-access biicode published information'''
#TODO: Clearly specify raised Exceptions in each method... | mit |
gbriones1/cloud-init | cloudinit/sources/DataSourceNone.py | 15 | 1846 | # vi: ts=4 expandtab
#
# Copyright (C) 2012 Yahoo! Inc.
#
# Author: Joshua Harlow <harlowja@yahoo-inc.com>
#
# 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... | gpl-3.0 |
HerkCoin/herkcoin | share/qt/extract_strings_qt.py | 2945 | 1844 | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
they can be picked up by Qt linguist.
'''
from subprocess import Popen, PIPE
import glob
import operator
OUT_CPP="src/qt/bitcoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' format produced by x... | mit |
jhonatajh/mtasa-blue | vendor/google-breakpad/src/tools/gyp/test/win/gyptest-link-opt-icf.py | 344 | 1319 | #!/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.
"""
Make sure comdat folding optimization setting is extracted properly.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test... | gpl-3.0 |
locationtech/geowave | python/src/main/python/pygw/store/accumulo/accumulo_options.py | 2 | 2877 | #
# Copyright (c) 2013-2020 Contributors to the Eclipse Foundation
#
# See the NOTICE file distributed with this work for additional information regarding copyright
# ownership. All rights reserved. This program and the accompanying materials are made available
# under the terms of the Apache License, Version 2.0 whic... | apache-2.0 |
matthewrudy/kubernetes | cluster/juju/layers/kubernetes/reactive/k8s.py | 53 | 14370 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... | apache-2.0 |
jephianlin/minrank_aux | xi_dict.py | 1 | 6449 | print("---SAPreduced_matrix, has_SAP, find_ZFloor, Zsap, etc.")
def SAPmatrix(A):
"""
Input: a symmetric matrix A
Output: The matrix for checking if A has SAP
"""
if A.is_symmetric()==False:
raise ValueError("Input matrix is not symmetric.")
AA=[];
n=A.dimensions()[0];
row_num=0... | gpl-2.0 |
Lh4cKg/sl4a | python/src/Lib/test/test___all__.py | 52 | 6085 | import unittest
from test.test_support import run_unittest
import sys
import warnings
class AllTest(unittest.TestCase):
def check_all(self, modname):
names = {}
with warnings.catch_warnings():
warnings.filterwarnings("ignore", ".* (module|package)",
... | apache-2.0 |
Andr3iC/courtlistener | cleaning_scripts/correct_links_to_resource_org_186.py | 5 | 2193 | import os
import sys
execfile('/etc/courtlistener')
sys.path.append(INSTALL_ROOT)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
from alert.search.models import Document, Citation
from alert.lib.db_tools import queryset_generator
from alert.lib.string_utils import clean_string
from alert.lib.string_utils... | agpl-3.0 |
Fokko/incubator-airflow | airflow/contrib/hooks/gdrive_hook.py | 1 | 5267 | # -*- 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 |
zzjkf2009/Midterm_Astar | opencv/samples/python/squares.py | 1 | 1774 | #!/usr/bin/env python
'''
Simple "Square Detector" program.
Loads several images sequentially and tries to find squares in each image.
'''
# Python 2/3 compatibility
import sys
PY3 = sys.version_info[0] == 3
if PY3:
xrange = range
import numpy as np
import cv2
def angle_cos(p0, p1, p2):
d1, d2 = (p0-p1).... | mit |
rbian/virt-test | tools/package_jeos.py | 15 | 1491 | #!/usr/bin/python
import os
import sys
import logging
import shutil
import common
from autotest.client import utils
from autotest.client.shared import logging_manager
from virttest import utils_misc
def package_jeos(img):
"""
Package JeOS and make it ready for upload.
Steps:
1) Move /path/to/jeos.q... | gpl-2.0 |
husni75/p2pool_idc | p2pool/bitcoin/sha256.py | 285 | 3084 | from __future__ import division
import struct
k = [
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0... | gpl-3.0 |
aisipos/django | django/db/backends/base/operations.py | 43 | 23170 | import datetime
import decimal
import warnings
from importlib import import_module
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.backends import utils
from django.utils import six, timezone
from django.utils.dateparse import parse_duration
from django.utils.dep... | bsd-3-clause |
blackzw/openwrt_sdk_dev1 | staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/lib/python2.7/test/test_strftime.py | 132 | 6956 | """
Unittest for time.strftime
"""
import calendar
import sys
import re
from test import test_support
import time
import unittest
# helper functions
def fixasctime(s):
if s[8] == ' ':
s = s[:8] + '0' + s[9:]
return s
def escapestr(text, ampm):
"""
Escape text to deal with possible locale val... | gpl-2.0 |
Don42/youtube-dl | youtube_dl/extractor/ina.py | 129 | 1064 | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class InaIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?ina\.fr/video/(?P<id>I?[A-Z0-9]+)'
_TEST = {
'url': 'http://www.ina.fr/video/I12055569/francois-hollande-je-crois-que-c-est-clair-video.... | unlicense |
xpac1985/ansible | lib/ansible/plugins/action/win_copy.py | 185 | 1153 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
blindroot/django | django/contrib/gis/db/backends/spatialite/base.py | 445 | 3615 | import sys
from ctypes.util import find_library
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.backends.sqlite3.base import (
Database, DatabaseWrapper as SQLiteDatabaseWrapper, SQLiteCursorWrapper,
)
from django.utils import six
from .client import SpatiaL... | bsd-3-clause |
RO-ny9/python-for-android | python3-alpha/python3-src/Lib/idlelib/AutoComplete.py | 67 | 9061 | """AutoComplete.py - An IDLE extension for automatically completing names.
This extension can complete either attribute names of file names. It can pop
a window with all available names, for the user to select from.
"""
import os
import sys
import string
from idlelib.configHandler import idleConf
# This string inclu... | apache-2.0 |
collex100/odoo | addons/sale_journal/__openerp__.py | 262 | 2637 | # -*- 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 |
domesticduck/MenuConciergeServer | vendor/bundle/ruby/2.0.0/gems/libv8-3.16.14.3/vendor/v8/tools/testrunner/local/verbose.py | 19 | 3680 | # Copyright 2012 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditi... | apache-2.0 |
theo-l/django | tests/postgres_tests/test_hstore.py | 11 | 14088 | import json
from django.core import checks, exceptions, serializers
from django.db import connection
from django.db.models import OuterRef, Subquery
from django.db.models.expressions import RawSQL
from django.forms import Form
from django.test.utils import CaptureQueriesContext, isolate_apps
from . import PostgreSQLS... | bsd-3-clause |
eranchetz/nupic | examples/opf/experiments/anomaly/spatial/10field_many_balanced/description.py | 96 | 16581 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, 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 progra... | agpl-3.0 |
bjolivot/ansible | lib/ansible/modules/network/lenovo/cnos_template.py | 19 | 7146 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Lenovo, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# ... | gpl-3.0 |
Amechi101/indieapp | account/auth_backends.py | 5 | 1360 | from __future__ import unicode_literals
from django.db.models import Q
from django.contrib.auth.backends import ModelBackend
from account.compat import get_user_model, get_user_lookup_kwargs
from account.models import EmailAddress
class UsernameAuthenticationBackend(ModelBackend):
def authenticate(self, **cre... | mit |
nelsonw2014/watershed | setup.py | 1 | 1598 | import setuptools
from os import path
if __name__ == "__main__":
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'DESCRIPTION.rst'), encoding='utf-8') as f:
long_description = f.read()
setuptools.setup(
name="watershed",
version="0.0.1",
description="Da... | apache-2.0 |
dennissergeev/faamtools | faamtools/avaps.py | 2 | 2620 | # -*- coding: utf-8 -*-
"""
Functions to process AVAPS dropsondes data
"""
import datetime
import netCDF4 as nc
import numpy as np
from . import DsFld, ObsData
from . import utils
def read_avaps_nc(fname, flds=None, time2datetime=False):
"""Read AVAPS dropsonde data from a NetCDF file.
Open a NetCDF file an... | mit |
CSGreater-Developers/HMC-Grader | app/userViews/instructor/testSettings.py | 2 | 4117 | # coding=utf-8
'''This module handles all functions responsible for modifying the course
settings page.
View Function: instructorEditTestFile (instructor/testSettings.html)
Redirect Functions: TODO
AJAX Fuctions: TODO
'''
#Import the app
from app import app
#Import needed flask functions
from flask import g, rend... | mit |
hugovk/pylast | tests/test_pylast.py | 1 | 4174 | #!/usr/bin/env python
"""
Integration (not unit) tests for pylast.py
"""
import os
import time
import unittest
import pytest
from flaky import flaky
import pylast
def load_secrets():
secrets_file = "test_pylast.yaml"
if os.path.isfile(secrets_file):
import yaml # pip install pyyaml
with op... | apache-2.0 |
weiting-chen/manila | manila/tests/fake_volume.py | 4 | 1978 | # Copyright 2013 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 requi... | apache-2.0 |
napkindrawing/ansible | lib/ansible/utils/module_docs_fragments/vyos.py | 224 | 2754 | #
# (c) 2015, Peter Sprygada <psprygada@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 late... | gpl-3.0 |
waxmanr/moose | framework/contrib/nsiqcppstyle/rules/RULE_4_1_B_indent_each_enum_item_in_enum_block.py | 43 | 3015 | """
Indent the each enum item in the enum block.
== Violation ==
enum A {
A_A, <== Violation
A_B <== Violation
}
== Good ==
enum A {
A_A, <== Good
A_B
}
"""
from nsiqcppstyle_rulehelper import *
from nsiqcppstyle_reporter import *
from nsiqcppstyle_rulemanager import... | lgpl-2.1 |
CryToCry96/android_kernel_mt6572 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | 5411 | # SchedGui.py - Python extension for perf script, 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 |
petrus-v/odoo | addons/l10n_ro/__openerp__.py | 186 | 2241 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Author: Fekete Mihai <feketemihai@gmail.com>, Tatár Attila <atta@nvm.ro>
# Copyright (C) 2011-2014 TOTAL PC SYSTEMS (http://www.erpsystems.ro).
# Copyright (C) 2014 Fekete Mihai
# Copyright (C) 201... | agpl-3.0 |
Eureka22/ASM_xf | PythonD/lib/python2.4/site-packages/display/PIL/Image.py | 2 | 54748 | #
# The Python Imaging Library.
# $Id: //modules/pil/PIL/Image.py#47 $
#
# the Image class wrapper
#
# partial release history:
# 1995-09-09 fl Created
# 1996-03-11 fl PIL release 0.0 (proof of concept)
# 1996-04-30 fl PIL release 0.1b1
# 1996-05-27 fl PIL release 0.1b2
# 1996-11-04 fl PIL release 0.2b1
# 199... | gpl-2.0 |
mhnatiuk/phd_sociology_of_religion | scrapper/build/scrapy/build/lib.linux-x86_64-2.7/scrapy/commands/deploy.py | 15 | 8793 | from __future__ import print_function
import sys
import os
import glob
import tempfile
import shutil
import time
import urllib2
import netrc
import json
from urlparse import urlparse, urljoin
from subprocess import Popen, PIPE, check_call
from w3lib.form import encode_multipart
from scrapy.command import ScrapyComman... | gpl-2.0 |
Alwnikrotikz/cortex-vfx | test/IECore/CubeColorLookupTest.py | 12 | 2884 | ##########################################################################
#
# Copyright (c) 2008-2010, Image Engine Design 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:
#
# * Redis... | bsd-3-clause |
devassistant/dapi | wsgi.py | 1 | 40852 | #!/usr/bin/python
import os
virtenv = os.environ['OPENSHIFT_PYTHON_DIR'] + '/virtenv/'
virtualenv = os.path.join(virtenv, 'bin/activate_this.py')
try:
execfile(virtualenv, dict(__file__=virtualenv))
except IOError:
pass
#
# IMPORTANT: Put any additional includes below this line. If placed above this
# line, i... | agpl-3.0 |
haad/ansible | lib/ansible/modules/identity/ipa/ipa_hbacrule.py | 134 | 13226 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
jswope00/griffinx | common/test/acceptance/tests/lms/test_lms_acid_xblock.py | 122 | 5837 | # -*- coding: utf-8 -*-
"""
End-to-end tests for the LMS.
"""
from unittest import expectedFailure
from ..helpers import UniqueCourseTest
from ...pages.lms.auto_auth import AutoAuthPage
from ...pages.lms.course_info import CourseInfoPage
from ...pages.lms.tab_nav import TabNavPage
from ...pages.xblock.acid import Aci... | agpl-3.0 |
jelugbo/hebs_repo | lms/envs/common.py | 2 | 62020 | # -*- coding: utf-8 -*-
"""
This is the common settings file, intended to set sane defaults. If you have a
piece of configuration that's dependent on a set of feature flags being set,
then create a function that returns the calculated value based on the value of
FEATURES[...]. Modules that extend this one can change th... | agpl-3.0 |
sachintyagi22/spark | examples/src/main/python/ml/generalized_linear_regression_example.py | 76 | 2506 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
hitszxp/scikit-learn | sklearn/linear_model/tests/test_ransac.py | 40 | 12814 | import numpy as np
from numpy.testing import assert_equal, assert_raises
from numpy.testing import assert_array_almost_equal
from scipy import sparse
from sklearn.utils.testing import assert_less
from sklearn.linear_model import LinearRegression, RANSACRegressor
from sklearn.linear_model.ransac import _dynamic_max_tri... | bsd-3-clause |
TheWardoctor/Wardoctors-repo | script.module.fantastic/lib/resources/lib/sources/en/to_be_fixed/needsfixing/crazy.py | 1 | 6406 | # -*- coding: utf-8 -*-
'''
fantastic Add-on
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This pro... | apache-2.0 |
vipullakhani/mi-instrument | mi/dataset/parser/dosta_ln_auv.py | 8 | 3170 | """
@package mi.dataset.parser
@file marine-integrations/mi/dataset/parser/dosta_ln_auv.py
@author Jeff Roy
@brief Parser and particle Classes and tools for the dosta_ln_auv data
Release notes:
initial release
"""
__author__ = 'Jeff Roy'
__license__ = 'Apache 2.0'
from mi.core.log import get_logger
log = get_logger(... | bsd-2-clause |
stelfrich/openmicroscopy | components/tests/ui/library/python/ImageCheckLibrary.py | 14 | 1094 |
import Image
from numpy import asarray
def crop_image(path, cropX, cropY, cropW, cropH):
image = Image.open(path)
x = int(cropX)
y = int(cropY)
x2 = int(cropW) + x
y2 = int(cropH) + y
img = image.crop((x, y, x2, y2))
img.save(path)
def image_should_be_blank(path, expected=True):
i... | gpl-2.0 |
mrrrgn/AutobahnPython | examples/twisted/wamp/basic/pubsub/complex/backend.py | 8 | 1506 | ###############################################################################
##
## Copyright (C) 2014 Tavendo GmbH
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http:/... | apache-2.0 |
jettisonjoe/openhtf | examples/phase_groups.py | 2 | 4400 | # Copyright 2018 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 agre... | apache-2.0 |
LeeMendelowitz/malign_viz | server/cors.py | 8 | 1654 | from datetime import timedelta
from flask import make_response, request, current_app
from functools import update_wrapper
def crossdomain(origin=None, methods=None, headers=None,
max_age=21600, attach_to_all=True,
automatic_options=True):
if methods is not None:
methods = '... | gpl-3.0 |
hehongliang/tensorflow | tensorflow/contrib/learn/python/learn/estimators/rnn_common.py | 42 | 12923 | # 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 |
code-sauce/tensorflow | tensorflow/python/kernel_tests/substr_op_test.py | 55 | 8327 | # 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 |
marcoscaceres/bedrock | bedrock/base/tests/test_middleware.py | 28 | 2690 | from django.test import TestCase, RequestFactory
from django.test.utils import override_settings
from bedrock.base.middleware import LocaleURLMiddleware
@override_settings(DEV=True)
class TestLocaleURLMiddleware(TestCase):
def setUp(self):
self.rf = RequestFactory()
self.middleware = LocaleURLMid... | mpl-2.0 |
laperry1/android_external_chromium_org | native_client_sdk/src/tools/tests/create_html_test.py | 108 | 1808 | #!/usr/bin/env python
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import unittest
import shutil
import sys
import tempfile
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARENT_D... | bsd-3-clause |
aplicatii-romanesti/allinclusive-kodi-pi | .kodi/addons/plugin.video.movie4k/plugintools.py | 1 | 19027 | # -*- coding: utf-8 -*-
#---------------------------------------------------------------------------
# Plugin Tools v1.0.8
#---------------------------------------------------------------------------
# License: GPL (http://www.gnu.org/licenses/gpl-3.0.html)
# Based on code from youtube, parsedom and pelisalacarta addon... | apache-2.0 |
m-kuhn/QGIS | python/plugins/db_manager/db_plugins/oracle/plugin.py | 6 | 22780 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS (Oracle)
Date : Aug 27, 2014
copyright : (C) 2014 by Médéric RIBREUX
email : meder... | gpl-2.0 |
miqlar/PyFME | src/pyfme/utils/trimmer.py | 5 | 8158 | # -*- coding: utf-8 -*-
"""
Python Flight Mechanics Engine (PyFME).
Copyright (c) AeroPython Development Team.
Distributed under the terms of the MIT License.
Trimmer
-------
This module solves the problem of calculating the values of the state and
control vectors that satisfy the state equations of the aircraft at th... | mit |
vericred/vericred-python | test/test_providers_api.py | 1 | 10307 | # coding: utf-8
"""
Vericred API
Vericred's API allows you to search for Health Plans that a specific doctor
accepts.
## Getting Started
Visit our [Developer Portal](https://developers.vericred.com) to
create an account.
Once you have created an account, you can create one Application for
Production and an... | apache-2.0 |
Yuudachimoe/HikariChun-RedBot | lib/youtube_dl/extractor/abc.py | 24 | 6210 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
js_to_json,
int_or_none,
parse_iso8601,
)
class ABCIE(InfoExtractor):
IE_NAME = 'abc.net.au'
_VALID_URL = r'https?://(?:www\.)?abc\.net\.au/news/(?:[^/]+/){1,2}(?P<id>\d+... | gpl-3.0 |
xianjunzhengbackup/Cloud-Native-Python | env/lib/python3.5/site-packages/pip/_vendor/distlib/metadata.py | 335 | 38833 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""Implementation of the Metadata for Python packages PEPs.
Supports all metadata formats (1.0, 1.1, 1.2, and 2.0 experimental).
"""
from __future__ import unicode_literals
import codecs
from email... | mit |
Elettronik/SickRage | lib/hachoir_metadata/metadata.py | 54 | 9258 | # -*- coding: utf-8 -*-
from hachoir_core.compatibility import any, sorted
from hachoir_core.endian import endian_name
from hachoir_core.tools import makePrintable, makeUnicode
from hachoir_core.dict import Dict
from hachoir_core.error import error, HACHOIR_ERRORS
from hachoir_core.i18n import _
from hachoir_core.log i... | gpl-3.0 |
cloudbase/neutron-virtualbox | neutron/plugins/ml2/plugin.py | 1 | 65394 | # Copyright (c) 2013 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 |
kmarius/qutebrowser | tests/end2end/fixtures/webserver.py | 4 | 6473 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | gpl-3.0 |
xissy/titanium-mobile-sdk | android/run.py | 1 | 1625 | import os, subprocess, types, sys, re
def check_output_for_error(output, match, error_in_first_match):
success = re.findall(match, output)
if len(success) > 0:
if (error_in_first_match):
print "[ERROR] %s" % success[0]
sys.exit(1)
else:
return True
else:
return False
def check_and_print_err(err, war... | apache-2.0 |
s20121035/rk3288_android5.1_repo | external/clang/bindings/python/tests/cindex/test_cdb.py | 38 | 4306 | from clang.cindex import CompilationDatabase
from clang.cindex import CompilationDatabaseError
from clang.cindex import CompileCommands
from clang.cindex import CompileCommand
import os
import gc
kInputsDir = os.path.join(os.path.dirname(__file__), 'INPUTS')
def test_create_fail():
"""Check we fail loading a data... | gpl-3.0 |
dtrip/weevely3 | modules/audit/phpconf.py | 15 | 6310 | from core.vectors import PhpCode, ShellCmd, ModuleExec, Os
from core.module import Module
from core import messages
from core import modules
import re
class Phpconf(Module):
"""Audit PHP configuration."""
def init(self):
self.register_info(
{
'author': [
... | gpl-3.0 |
tima/ansible | lib/ansible/modules/network/netvisor/pn_show.py | 72 | 5460 | #!/usr/bin/python
""" PN CLI show commands """
#
# 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 ver... | gpl-3.0 |
webmakin/scrapy | tests/test_utils_signal.py | 121 | 2741 | from testfixtures import LogCapture
from twisted.trial import unittest
from twisted.python.failure import Failure
from twisted.internet import defer, reactor
from pydispatch import dispatcher
from scrapy.utils.signal import send_catch_log, send_catch_log_deferred
class SendCatchLogTest(unittest.TestCase):
@defe... | bsd-3-clause |
veger/ansible | test/units/conftest.py | 37 | 1052 | """Monkey patch os._exit when running under coverage so we don't lose coverage data in forks, such as with `pytest --boxed`."""
import gc
import os
try:
import coverage
except ImportError:
coverage = None
try:
test = coverage.Coverage
except AttributeError:
coverage = None
def pytest_configure():
... | gpl-3.0 |
nave91/dbt | test/integration/014_hook_tests/test_model_hooks_bq.py | 1 | 4613 | from nose.plugins.attrib import attr
from test.integration.base import DBTIntegrationTest
MODEL_PRE_HOOK = """
insert into {{this.schema}}.on_model_hook (
state,
target_name,
target_schema,
target_type,
target_threads,
run_started_at,
invocation_id
) VALUES... | apache-2.0 |
niksolaz/GeoJS | venv/lib/python2.7/site-packages/pip/commands/install.py | 61 | 15982 | from __future__ import absolute_import
import logging
import operator
import os
import tempfile
import shutil
import warnings
from pip.req import InstallRequirement, RequirementSet, parse_requirements
from pip.locations import build_prefix, virtualenv_no_global, distutils_scheme
from pip.basecommand import Command
fr... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.