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 |
|---|---|---|---|---|---|
jason-vallet/graph-ryder-api | routes/utils.py | 1 | 2215 | from flask_restful import reqparse
from flask import make_response
import json
import sys
import shutil
parser = reqparse.RequestParser()
parser.add_argument('limit')
parser.add_argument('orderBy')
parser.add_argument('start')
parser.add_argument('end')
def addlimit():
args = parser.parse_args()
if args['lim... | lgpl-3.0 |
AOSPU/external_chromium_org | native_client_sdk/src/build_tools/nacl-mono-archive.py | 102 | 2289 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import optparse
import os
import sys
import tarfile
import buildbot_common
def main(args):
parser = optparse.OptionParser()
... | bsd-3-clause |
tanmaythakur/django | django/contrib/gis/db/backends/oracle/schema.py | 608 | 4050 | from django.contrib.gis.db.models.fields import GeometryField
from django.db.backends.oracle.schema import DatabaseSchemaEditor
from django.db.backends.utils import truncate_name
class OracleGISSchemaEditor(DatabaseSchemaEditor):
sql_add_geometry_metadata = ("""
INSERT INTO USER_SDO_GEOM_METADATA
... | bsd-3-clause |
wemanuel/smry | ee/tests/function_test.py | 14 | 2866 | #!/usr/bin/env python
"""Tests for the ee.function module."""
import unittest
import ee
# A function to experiment on.
TEST_FUNC = ee.Function()
TEST_FUNC.getSignature = lambda: { # pylint: disable-msg=g-long-lambda
'description': 'Method description.',
'returns': 'Image',
'args': [
{
... | apache-2.0 |
aam-at/tensorflow | tensorflow/python/kernel_tests/identity_n_op_py_test.py | 14 | 2624 | # 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 |
hpe-storage/horizon-hpe-storage-ui | horizon_hpe_storage/storage_panel/config/tables.py | 2 | 12289 | # (c) Copyright [2015] Hewlett Packard Enterprise Development LP
#
# 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 r... | apache-2.0 |
joshuajan/odoo | addons/account_followup/wizard/__init__.py | 437 | 1076 | # -*- 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 |
chrisndodge/edx-platform | common/test/acceptance/tests/lms/test_oauth2.py | 7 | 3872 | # -*- coding: utf-8 -*-
"""Tests for OAuth2 permission delegation."""
from common.test.acceptance.pages.lms.oauth2_confirmation import OAuth2Confirmation
from common.test.acceptance.pages.lms.auto_auth import AutoAuthPage
from bok_choy.web_app_test import WebAppTest
from urlparse import urlparse, parse_qsl
class OAu... | agpl-3.0 |
abzaloid/maps | django-project/lib/python2.7/site-packages/django/views/decorators/clickjacking.py | 550 | 1759 | from functools import wraps
from django.utils.decorators import available_attrs
def xframe_options_deny(view_func):
"""
Modifies a view function so its response has the X-Frame-Options HTTP
header set to 'DENY' as long as the response doesn't already have that
header set.
e.g.
@xframe_optio... | mit |
adit-chandra/tensorflow | tensorflow/python/keras/layers/convolutional.py | 3 | 114187 | # 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 |
Learningtribes/edx-platform | openedx/core/djangoapps/user_api/tests/test_models.py | 56 | 6016 | """
Test UserPreferenceModel and UserPreference events
"""
from django.db import IntegrityError
from django.test import TestCase
from student.tests.factories import UserFactory
from student.tests.tests import UserSettingsEventTestMixin
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulest... | agpl-3.0 |
mshafiq9/django | tests/staticfiles_tests/test_storage.py | 102 | 18551 | from __future__ import unicode_literals
import os
import shutil
import sys
import tempfile
import unittest
from django.conf import settings
from django.contrib.staticfiles import finders, storage
from django.contrib.staticfiles.management.commands import collectstatic
from django.contrib.staticfiles.management.comman... | bsd-3-clause |
dogmaphobic/MAVProxy | MAVProxy/modules/mavproxy_misseditor/me_event.py | 14 | 1762 | #!/usr/bin/env python
'''
Event class and enums for Mission Editor
Michael Day
June 2014
'''
#MissionEditorEvents come FROM the GUI (with a few exceptions where the Mission Editor Module sends a message to itself, e.g., MEE_TIME_TO_QUIT)
#MissionEditorGUIEvents go TO the GUI
#enum for MissionEditorEvent types
MEE_READ_... | gpl-3.0 |
tomtor/QGIS | python/plugins/processing/script/ScriptAlgorithmProvider.py | 29 | 5223 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ScriptAlgorithmProvider.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***************... | gpl-2.0 |
LumPenPacK/NetworkExtractionFromImages | osx_build/nefi2_osx_amd64_xcode_2015/bin/nefi2/main.py | 4 | 2177 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
The main nefi2 startup script.
It loads extension loader and initializes UI.
It also enables console batch processing mode.
"""
import os
from nefi2.model.ext_loader import ExtensionLoader
from nefi2.model.pipeline import Pipeline
from nefi2.view.main_controller impor... | bsd-2-clause |
ChristinaHammer/Client_Database | cdbtabledef.py | 1 | 2662 | """cdbtabledef.py
Developer: Noelle Todd
Last Updated: August 30, 2014
This module will create 4 tables for the client database, using the
sqlalchemy module, and the sqlite database. This module is still in
early testing stages, and as such, is subject to many changes, and
probably contains bugs.
"""
from sqlalchem... | mit |
willzhang05/postgrestesting1 | postgrestesting1/lib/python3.5/site-packages/pip/wheel.py | 187 | 30186 | """
Support for installing and building the "wheel" binary package format.
"""
from __future__ import absolute_import
import compileall
import csv
import errno
import functools
import hashlib
import logging
import os
import os.path
import re
import shutil
import stat
import sys
import tempfile
import warnings
from ba... | mit |
javachengwc/hue | desktop/core/ext-py/Django-1.6.10/tests/utils_tests/test_tzinfo.py | 149 | 3072 | import copy
import datetime
import os
import pickle
import time
from django.utils.tzinfo import FixedOffset, LocalTimezone
from django.utils import unittest
class TzinfoTests(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.old_TZ = os.environ.get('TZ')
os.environ['TZ'] = 'US/Eastern'... | apache-2.0 |
snowballhg/node-gyp | gyp/pylib/gyp/xcode_emulation.py | 149 | 42289 | # 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.
"""
This module contains classes that help to emulate xcodebuild behavior on top of
other build systems, such as make and ninja.
"""
import gyp.common
import os.p... | mit |
DFEC-R2D2/r2d2 | final_design/python/states/static.py | 2 | 2514 |
from __future__ import division
from __future__ import print_function
# from random import randint
import time
import cv2
# from opencvutils import Camera
from library import factory
from library import reset_all_hw
# import multiprocessing as mp
# Static Mode
def static_func(hw, ns):
print("Starting static")
dom... | mit |
wlerin/streamlink | src/streamlink/plugins/dogus.py | 4 | 2489 | import re
import logging
from streamlink.plugin import Plugin
from streamlink.plugin.api.utils import itertags
from streamlink.plugins.youtube import YouTube
from streamlink.stream import HLSStream
from streamlink.utils import update_scheme
log = logging.getLogger(__name__)
class Dogus(Plugin):
"""
Support ... | bsd-2-clause |
dongjoon-hyun/tensorflow | tensorflow/python/training/learning_rate_decay_test.py | 9 | 17918 | # 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 |
you21979/phantomjs | src/qt/qtwebkit/Tools/QueueStatusServer/model/svnrevision.py | 143 | 1735 | # 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 |
webmull/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/test/skip.py | 174 | 2299 | # Copyright (C) 2010 Apple 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:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
trezorg/django | django/utils/decorators.py | 55 | 4832 | "Functions that help with dynamically creating decorators for views."
try:
from functools import wraps, update_wrapper, WRAPPER_ASSIGNMENTS
except ImportError:
from django.utils.functional import wraps, update_wrapper, WRAPPER_ASSIGNMENTS # Python 2.4 fallback.
class classonlymethod(classmethod):
def __g... | bsd-3-clause |
hzzyyy/pymcef | script/Russell3000.py | 1 | 1164 | from bs4 import BeautifulSoup
import requests
import pandas as pd
def _get_listed_table(url):
# Scrape the HTML at the url
r = requests.get(url)
# Turn the HTML into a Beautiful Soup object
soup = BeautifulSoup(r.text, "html.parser")
table = soup.find(text='AAPL').parent.parent.parent
return ... | bsd-3-clause |
DeMille/emailhooks | django_nonrel/django/contrib/localflavor/id/id_choices.py | 439 | 3217 | import warnings
from django.utils.translation import ugettext_lazy as _
# Reference: http://id.wikipedia.org/wiki/Daftar_provinsi_Indonesia
# Indonesia does not have an official Province code standard.
# I decided to use unambiguous and consistent (some are common) 3-letter codes.
warnings.warn(
'There have been... | mit |
shaunstanislaus/zulip | zerver/management/commands/bulk_change_user_name.py | 115 | 1120 | from __future__ import absolute_import
from django.core.management.base import BaseCommand
from zerver.lib.actions import do_change_full_name
from zerver.models import UserProfile, get_user_profile_by_email
class Command(BaseCommand):
help = """Change the names for many users."""
def add_arguments(self, par... | apache-2.0 |
ukos-git/python-swnt-reactor | src/MKDatabase.py | 1 | 30109 | #!/usr/bin/env python
import MySQLdb as mysqlconnector
from MySQLdb.constants import CLIENT
import os
import socket
import decimal
import struct
from time import sleep
import multiprocessing
import ConfigParser
from MKFlowMessage import FBconvertLong # converter for long numbers to float and percent
#cvd-client->rbBm... | mit |
smashwilson/ansible-modules-core | cloud/amazon/ec2_elb.py | 18 | 12691 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | gpl-3.0 |
sjvasquez/AIChallenge | Index.py | 1 | 4810 | from solver_utils import *
class Index():
def __init__(self, filename, analyzer, sentences=False, textbook=None, wiki=None, reindex=False):
self.analyzer = analyzer
self.schema = Schema(title=TEXT(stored=True, analyzer=analyzer),
content=TEXT(stored=True, analyzer=ana... | mit |
stacywsmith/ansible | lib/ansible/modules/cloud/openstack/_quantum_network.py | 12 | 10404 | #!/usr/bin/python
#coding: utf-8 -*-
# (c) 2013, Benno Joy <benno@ansible.com>
#
# 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 ... | gpl-3.0 |
drpngx/tensorflow | tensorflow/contrib/image/python/ops/distort_image_ops.py | 68 | 5793 | # 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 |
reingart/pyfpdf | fpdf/template.py | 1 | 9458 | # -*- coding: iso-8859-1 -*-
"PDF Template Helper for FPDF.py"
from __future__ import with_statement
__author__ = "Mariano Reingart <reingart@gmail.com>"
__copyright__ = "Copyright (C) 2010 Mariano Reingart"
__license__ = "LGPL 3.0"
import sys,os,csv
from .fpdf import FPDF
from .py3k import PY3K, basestring, unicod... | lgpl-3.0 |
bluesea/zulip | api/integrations/codebase/zulip_codebase_config.py | 124 | 2537 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2014 Zulip, Inc.
#
# 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
#... | apache-2.0 |
FrancoCotter/ReactTimerAPP | node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py | 1534 | 3426 | # 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.
import collections
import os
import gyp
import gyp.common
import gyp.msvs_emulation
import json
import sys
generator_supports_multiple_toolsets = True
generator_... | mit |
ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/PyKDE4/kdeui/NETRootInfo.py | 1 | 5242 | # encoding: utf-8
# module PyKDE4.kdeui
# from /usr/lib/python2.7/dist-packages/PyKDE4/kdeui.so
# by generator 1.135
# no doc
# imports
import PyKDE4.kdecore as __PyKDE4_kdecore
import PyQt4.QtCore as __PyQt4_QtCore
import PyQt4.QtGui as __PyQt4_QtGui
import PyQt4.QtSvg as __PyQt4_QtSvg
from NET import NET
class NE... | gpl-2.0 |
johngian/mozillians | mozillians/phonebook/tests/test_views/test_views_profile.py | 3 | 11143 | from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.test import Client
from django.test.utils import override_settings
from mock import patch
from nose.tools import ok_, eq_
from mozillians.common.templatetags.helpers import redirect, urlparams
from mozil... | bsd-3-clause |
svogl/mbed-os | tools/libraries.py | 42 | 3221 | """
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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 wr... | apache-2.0 |
Mikk36/OctoPrint | src/octoprint/filemanager/__init__.py | 8 | 15661 | # coding=utf-8
from __future__ import absolute_import
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
import logging
import os
im... | agpl-3.0 |
waldol1/BYU-AWESOME | scripts/compute_features.py | 1 | 16441 |
import os
import sys
import cv2
import scipy.ndimage as nd
import scipy.ndimage.morphology
import numpy as np
import traceback
def invert(im):
return 255 - im
def divide(im):
return im / 255
# deprecated
def gt_original_to_processed(im):
im = im / 255
im = 1 - im
return im
# deprecated
def gt_processed_to_o... | gpl-3.0 |
KristoferHellman/gimli | python/pygimli/viewer/mayaview.py | 1 | 2081 | # -*- coding: utf-8 -*-
import sys
import os
from matplotlib import pyplot as plt
showMesh3DFunct = 'showMesh3DMayvi'
try:
from mayavi import mlab
except ImportError:
error_msg = """Visualization in 3D requires Mayavi.\n""" + \
"""Try 'pip install mayavi' depending on your system.\n""" + \
... | gpl-3.0 |
aboutsajjad/Bridge | app_packages/youtube_dl/extractor/espn.py | 8 | 8708 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from .once import OnceIE
from ..compat import compat_str
from ..utils import (
determine_ext,
int_or_none,
unified_timestamp,
)
class ESPNIE(OnceIE):
_VALID_URL = r'''(?x)
https?://
... | mit |
bjzhang/xen | tools/python/xen/util/Brctl.py | 48 | 5242 | """Bridge control utilities.
"""
import os
import os.path
import re
import sys
CMD_IFCONFIG = 'ifconfig'
CMD_ROUTE = 'route'
CMD_BRCTL = 'brctl'
CMD_IPTABLES = "iptables"
opts = None
class Opts:
def __init__(self, defaults):
for (k, v) in defaults.items():
setattr(self, k, v)
p... | gpl-2.0 |
asadziach/tensorflow | tensorflow/python/training/adagrad.py | 64 | 4181 | # 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 |
pballand/congress | thirdparty/antlr3-antlr-3.5/runtime/Python3/unittests/testdfa.py | 2 | 1531 |
import unittest
import antlr3
class TestDFA(unittest.TestCase):
"""Test case for the DFA class."""
def setUp(self):
"""Setup test fixure.
We need a Recognizer in order to instanciate a DFA.
"""
class TRecognizer(antlr3.BaseRecognizer):
api_version = 'HEAD'
... | apache-2.0 |
asm-products/movie-database-service | ani/lib/python2.7/site-packages/rest_framework/status.py | 110 | 1982 | """
Descriptive HTTP status codes, for code readability.
See RFC 2616 - http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
And RFC 6585 - http://tools.ietf.org/html/rfc6585
"""
from __future__ import unicode_literals
def is_informational(code):
return code >= 100 and code <= 199
def is_success(code):
r... | agpl-3.0 |
eayunstack/nova | nova/scheduler/filters/aggregate_multitenancy_isolation.py | 20 | 1972 | # Copyright (c) 2011-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
#
# Un... | apache-2.0 |
khancyr/ardupilot | libraries/AP_HAL_ChibiOS/hwdef/scripts/dma_resolver.py | 15 | 20646 | #!/usr/bin/env python
import sys, fnmatch
import importlib
# peripheral types that can be shared, wildcard patterns
SHARED_MAP = ["I2C*", "USART*_TX", "UART*_TX", "SPI*", "TIM*_UP", "TIM*_CH*"]
ignore_list = []
dma_map = None
debug = False
def check_possibility(periph, dma_stream, curr_dict, dma_map, check_list, c... | gpl-3.0 |
mezz64/home-assistant | homeassistant/components/flunearyou/__init__.py | 3 | 6840 | """The flunearyou component."""
import asyncio
from datetime import timedelta
from pyflunearyou import Client
from pyflunearyou.errors import FluNearYouError
import voluptuous as vol
from homeassistant.config_entries import SOURCE_IMPORT
from homeassistant.const import CONF_LATITUDE, CONF_LONGITUDE
from homeassistant... | apache-2.0 |
Fafou/Sick-Beard | sickbeard/providers/piratebay/__init__.py | 30 | 12946 | # Author: Mr_Orange <mr_orange@hotmail.it>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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... | gpl-3.0 |
supertree-toolkit/stk | stk_gui/stk_gui/tree.py | 1 | 14918 | #/usr/bin/env python
# This file is part of Diamond.
#
# Diamond 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.
#
# ... | gpl-3.0 |
tacaswell/scikit-beam | skbeam/core/fitting/tests/test_background.py | 5 | 3709 | # ######################################################################
# Copyright (c) 2014, Brookhaven Science Associates, Brookhaven #
# National Laboratory. All rights reserved. #
# #
# @author: Li Li (lili@bnl.g... | bsd-3-clause |
margguo/python-ivi | ivi/agilent/agilentDSO90604A.py | 7 | 1686 | """
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2014 Alex Forencich
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... | mit |
ujenmr/ansible | lib/ansible/modules/network/aci/aci_encap_pool.py | 27 | 8605 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 |
Tesora/tesora-tempest | tempest/api/compute/servers/test_server_actions.py | 2 | 25976 | # Copyright 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 requ... | apache-2.0 |
maurofaccenda/ansible | lib/ansible/modules/cloud/ovirt/ovirt_affinity_labels.py | 5 | 6900 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, 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 |
godfreyy/tablib | tablib/formats/_dbf.py | 10 | 2640 | # -*- coding: utf-8 -*-
""" Tablib - DBF Support.
"""
import tempfile
import struct
import os
from tablib.compat import StringIO
from tablib.compat import dbfpy
from tablib.compat import is_py3
if is_py3:
from tablib.packages.dbfpy3 import dbf
from tablib.packages.dbfpy3 import dbfnew
from tablib.package... | mit |
arank/mxnet | example/speech_recognition/stt_bi_graphemes_util.py | 16 | 1494 | import csv
from collections import Counter
def split_every(n, label):
index = 0
if index <= len(label) - 1 <= index + n - 1:
yield label[index:len(label)]
index = index + n
while index+n-1 <= len(label)-1:
yield label[index:index+n]
index = index + n
if index <= len... | apache-2.0 |
nilbus/sublime-text-2-plugin | floobits.py | 1 | 16380 | # coding: utf-8
import os
import sys
import json
import threading
import traceback
import subprocess
import urllib2
import webbrowser
import sublime_plugin
import sublime
from floo import api
from floo import AgentConnection
from floo.listener import Listener
from floo import msg
from floo import shared as G
from flo... | apache-2.0 |
dyoung418/tensorflow | tensorflow/contrib/slim/python/slim/nets/inception_v1_test.py | 112 | 8960 | # 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 |
adamkoziol/sipprcommon | bowtie.py | 1 | 62181 | #!/usr/bin/env python
from Bio.Application import _Option, AbstractCommandline, _Switch, _Argument
import re
__author__ = 'mike knowles'
__doc__ = 'Wrapper for bowtie2'
class _PipeArgumentList(_Argument):
"""Represent a variable list of arguments for piping on a command line, e.g. sam to bam to sorted bam."""
... | mit |
gramps-project/gramps | gramps/gen/datehandler/_date_ru.py | 6 | 6750 | # -*- coding: utf-8 -*-
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2004-2006 Donald N. Allingham
#
# 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 t... | gpl-2.0 |
noobies/f240l-kernel | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
ahmadiga/min_edx | openedx/core/djangoapps/content/course_overviews/admin.py | 25 | 1357 | """
Django admin page for CourseOverviews, the basic metadata about a course that
is used in user dashboard queries and other places where you need info like
name, and start dates, but don't actually need to crawl into course content.
"""
from django.contrib import admin
from .models import CourseOverview
class Cour... | agpl-3.0 |
superdesk/superdesk-core | superdesk/data_updates.py | 1 | 1044 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
from superde... | agpl-3.0 |
DanielTakeshi/rl_algorithms | dqn/atari_wrappers.py | 9 | 5290 | import cv2
import numpy as np
from collections import deque
import gym
from gym import spaces
class NoopResetEnv(gym.Wrapper):
def __init__(self, env=None, noop_max=30):
"""Sample initial states by taking random number of no-ops on reset.
No-op is assumed to be action 0.
"""
super(... | mit |
Pluto-tv/chromium-crosswalk | tools/telemetry/telemetry/internal/actions/page_action.py | 29 | 4383 | # Copyright 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import re
from telemetry import decorators
GESTURE_SOURCE_DEFAULT = 'DEFAULT'
GESTURE_SOURCE_MOUSE = 'MOUSE'
GESTURE_SOURCE_TOUCH = 'TOUCH'
SUPPORTED_GESTU... | bsd-3-clause |
Mitchkoens/sympy | examples/advanced/relativity.py | 89 | 4384 | #!/usr/bin/env python
"""
This example calculates the Ricci tensor from the metric and does this
on the example of Schwarzschild solution.
If you want to derive this by hand, follow the wiki page here:
http://en.wikipedia.org/wiki/Deriving_the_Schwarzschild_solution
Also read the above wiki and follow the reference... | bsd-3-clause |
Venturi/cms | env/lib/python2.7/site-packages/filer/admin/patched/admin_utils.py | 5 | 3016 | # -*- coding: utf-8 -*-
"""
Copy of ``django.contrib.admin.utils.get_deleted_objects`` and a subclass of
``django.contrib.admin.utils.NestedObjects`` that work with djongo_polymorphic querysets.
Ultimatly these should go directly into django_polymorphic or, in a more generic way, into django itself.
This code has been... | gpl-2.0 |
crew/metrics-api | doc/source/conf.py | 1 | 7185 | # -*- coding: utf-8 -*-
#
# Crew Metrics API documentation build configuration file, created by
# sphinx-quickstart on Thu Oct 21 19:18:52 2010.
#
# 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... | mit |
google/contentbox | main/models.py | 4 | 6204 | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | apache-2.0 |
davidcusatis/horizon | openstack_dashboard/static_settings.py | 7 | 6577 | # 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
# d... | apache-2.0 |
Kingclove/lab5info3180 | main/lib/werkzeug/contrib/profiler.py | 315 | 4920 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.profiler
~~~~~~~~~~~~~~~~~~~~~~~~~
This module provides a simple WSGI profiler middleware for finding
bottlenecks in web application. It uses the :mod:`profile` or
:mod:`cProfile` module to do the profiling and writes the stats to the
stream provide... | mit |
flipjack/django | oscar/apps/payment/migrations/0001_initial.py | 51 | 4813 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import oscar.models.fields.autoslugfield
from django.conf import settings
from decimal import Decimal
class Migration(migrations.Migration):
dependencies = [
('order', '0001_initial'),
migrat... | bsd-3-clause |
CLOUGH/info3180-project-2 | lib/flask/__init__.py | 345 | 1672 | # -*- coding: utf-8 -*-
"""
flask
~~~~~
A microframework based on Werkzeug. It's extensively documented
and follows best practice patterns.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
__version__ = '0.10'
# utilities we import from Werkzeug and J... | apache-2.0 |
dennis-sheil/commandergenius | project/jni/python/src/Demo/turtle/tdemo_tree.py | 32 | 1406 | #!/usr/bin/python
""" turtle-example-suite:
tdemo_tree.py
Displays a 'breadth-first-tree' - in contrast
to the classical Logo tree drawing programs,
which use a depth-first-algorithm.
Uses:
(1) a tree-generator, where the drawing is
quasi the side-effect, whereas the generator
always yields None.
(... | lgpl-2.1 |
frederica07/Dragon_Programming_Process | PyOpenGL-3.0.2/OpenGL/raw/GL/AMD/performance_monitor.py | 1 | 2250 | '''Autogenerated by get_gl_extensions script, do not edit!'''
from OpenGL import platform as _p, constants as _cs, arrays
from OpenGL.GL import glget
import ctypes
EXTENSION_NAME = 'GL_AMD_performance_monitor'
def _f( function ):
return _p.createFunction( function,_p.GL,'GL_AMD_performance_monitor',False)
_p.unpack... | bsd-2-clause |
zerkrx/zerkbox | lib/pip/_vendor/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 |
amrdraz/kodr | app/brython/www/src/Lib/multiprocessing/util.py | 696 | 9917 | #
# Module providing various facilities to other parts of the package
#
# multiprocessing/util.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
import sys
import functools
import os
import itertools
import weakref
import atexit
import threading # we want threading to ... | mit |
prodromou87/gem5 | util/stats/profile.py | 87 | 15976 | # Copyright (c) 2005 The Regents of The University of Michigan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list ... | bsd-3-clause |
gentunian/tellapic | src/client/python/pyqt/ToolBoxUi.py | 2 | 30199 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'toolBox.ui'
#
# Created: Mon Nov 7 17:01:59 2011
# by: PyQt4 UI code generator 4.8.6
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except Attribu... | gpl-3.0 |
qpxu007/Flask-AppBuilder | examples/quickfiles/app/views.py | 3 | 1312 | from flask.ext.appbuilder.models.sqla.interface import SQLAInterface
from flask.ext.appbuilder.views import ModelView, CompactCRUDMixin
from app.models import Project, ProjectFiles
from app import appbuilder, db
class ProjectFilesModelView(ModelView):
datamodel = SQLAInterface(ProjectFiles)
label_columns = {... | bsd-3-clause |
SmartArduino/Arduino-1 | arduino-core/src/processing/app/i18n/python/requests/packages/charade/euctwprober.py | 2994 | 1676 | ######################## 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... | lgpl-2.1 |
crackhopper/TFS-toolbox | tests/dataset/dataset_test.py | 1 | 1408 | import pytest
import tensorflow as tf
import numpy as np
from tfs.dataset.skdata import *
from tfs.dataset.predefined import *
import tfs.dataset.data_tool as dtool
import shutil
@pytest.fixture
def data():
return MakeBlobs(test_percent=0.3,n_samples=100)
class TestDataTool:
def test_split(self,capsys):
d=np... | mit |
WatanabeYasumasa/edx-platform | lms/djangoapps/courseware/migrations/0004_add_field_studentmodule_course_id.py | 194 | 9027 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'StudentModule.course_id'
db.add_column('courseware_studentmodule', 'course_id',
... | agpl-3.0 |
fernandoacorreia/DjangoWAWSLogging | DjangoWAWSLogging/env/Lib/site-packages/pywin32-218-py2.7-win32.egg/Demos/BackupSeek_streamheaders.py | 34 | 3454 | ## demonstrates using BackupSeek to enumerate data streams for a file
import win32file, win32api, win32con
from win32com import storagecon
import pythoncom, pywintypes
import struct, traceback
stream_types={
win32con.BACKUP_DATA:"Standard data",
win32con.BACKUP_EA_DATA:"Extended attribute data",
win32con... | mit |
FireWRT/OpenWrt-Firefly-Libraries | staging_dir/host/lib/python2.7/test/test_httplib.py | 8 | 26664 | import httplib
import array
import StringIO
import socket
import errno
import os
import unittest
TestCase = unittest.TestCase
from test import test_support
here = os.path.dirname(__file__)
# Self-signed cert file for 'localhost'
CERT_localhost = os.path.join(here, 'keycert.pem')
# Self-signed cert file for 'fakehost... | gpl-2.0 |
thnee/ansible | lib/ansible/modules/network/aci/aci_aep.py | 8 | 7111 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 |
HelloAWorld/NoahGameFrame | Dependencies/protobuf-2.5.0/python/mox.py | 603 | 38237 | #!/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 |
gauthierm/bedrock | bedrock/grants/views.py | 38 | 1352 | # 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 one at http://mozilla.org/MPL/2.0/.
from operator import attrgetter
from django.http import Http404
from lib import l10n_utils
import bleach
from grants_d... | mpl-2.0 |
krafczyk/spack | var/spack/repos/builtin/packages/linkphase3/package.py | 2 | 1744 | ##############################################################################
# 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 |
repotvsupertuga/repo | script.video.F4mProxy/lib/f4mUtils/cryptomath.py | 135 | 8356 | # Authors:
# Trevor Perrin
# Martin von Loewis - python 3 port
# Yngve Pettersen (ported by Paul Sokolovsky) - TLS 1.2
#
# See the LICENSE file for legal information regarding use of this file.
"""cryptomath module
This module has basic math/crypto code."""
from __future__ import print_function
import os
impor... | gpl-2.0 |
bitkeeper/python-opcua | opcua/server/standard_address_space/standard_address_space.py | 1 | 1407 |
import os.path
import opcua
from opcua.server.standard_address_space.standard_address_space_part3 import create_standard_address_space_Part3
from opcua.server.standard_address_space.standard_address_space_part4 import create_standard_address_space_Part4
from opcua.server.standard_address_space.standard_address_space... | lgpl-3.0 |
singlebrook/AWS-ElasticBeanstalk-CLI | eb/macosx/python3/lib/aws/requests/packages/charade/hebrewprober.py | 2929 | 13359 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Shy Shalom
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#... | apache-2.0 |
rppowell-lasfs/loscon2py | models/db.py | 12 | 3887 | # -*- coding: utf-8 -*-
#########################################################################
## This scaffolding model makes your app work on Google App Engine too
## File is released under public domain and you can use without limitations
#########################################################################
... | mit |
Godiyos/python-for-android | python-build/python-libs/gdata/tests/gdata_tests/contacts/service_test.py | 87 | 10530 | #!/usr/bin/python
#
# Copyright (C) 2007 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 ... | apache-2.0 |
KontorConsulting/odoo | addons/account/wizard/account_fiscalyear_close.py | 222 | 15660 | # -*- 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 |
kvar/ansible | lib/ansible/plugins/cliconf/nos.py | 31 | 3829 | #
# (c) 2018 Extreme Networks Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ans... | gpl-3.0 |
DucQuang1/youtube-dl | youtube_dl/extractor/vevo.py | 104 | 8366 | from __future__ import unicode_literals
import re
import xml.etree.ElementTree
from .common import InfoExtractor
from ..compat import (
compat_urllib_request,
)
from ..utils import (
ExtractorError,
int_or_none,
)
class VevoIE(InfoExtractor):
"""
Accepts urls from vevo.com or in the format 'vevo... | unlicense |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.