repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
cinepost/Copperfield_FX | copper/shout/drivers/refined.py | 1 | 2799 | #!/usr/bin/env python
#
# This program shows how to write data to mplay by writing data to the
# imdisplay program using a pipe.
#
# This program uses the -k option on imdisplay to perform progressive
# refinement when rendering an image. The image is quite simple.
#
# Notes:
# This uses the simple format (... | unlicense |
nvoron23/scipy | scipy/linalg/tests/test_build.py | 78 | 1776 | from __future__ import division, print_function, absolute_import
from subprocess import call, PIPE, Popen
import sys
import re
from numpy.testing import TestCase, dec
from numpy.compat import asbytes
from scipy.linalg import _flapack as flapack
# XXX: this is copied from numpy trunk. Can be removed when we will dep... | bsd-3-clause |
corpnewt/CorpBot.py | Cogs/BotAdmin.py | 1 | 12950 | import asyncio, discord, re, random
from operator import itemgetter
from discord.ext import commands
from Cogs import Utils, DisplayName, Message, PickList
def setup(bot):
# Add the bot and deps
settings = bot.get_cog("Settings")
bot.add_cog(BotAdmin(bot, settings))
class BotAdmin(commands.Cog):
... | mit |
JulienMcJay/eclock | windows/Python27/Lib/imputil.py | 228 | 25764 | """
Import utilities
Exported classes:
ImportManager Manage the import process
Importer Base class for replacing standard import functions
BuiltinImporter Emulate the import mechanism for builtin and frozen modules
DynLoadSuffixImporter
"""
from warnings import warnpy3k
warnpy3k("the imputil... | gpl-2.0 |
connorimes/servo | tests/wpt/harness/wptrunner/wptmanifest/tests/test_tokenizer.py | 195 | 11355 | # 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/.
import sys
import os
import unittest
sys.path.insert(0, os.path.abspath(".."))
from cStringIO import StringIO
from .. ... | mpl-2.0 |
goodwinnk/intellij-community | python/lib/Lib/ntpath.py | 80 | 16985 | # Module 'ntpath' -- common operations on WinNT/Win95 pathnames
"""Common pathname manipulations, WindowsNT/95 version.
Instead of importing this module directly, import os and refer to this
module as os.path.
"""
import os
import stat
import sys
__all__ = ["normcase","isabs","join","splitdrive","split","splitext",
... | apache-2.0 |
rue89-tech/edx-analytics-dashboard | analytics_dashboard/core/tests/test_middleware.py | 4 | 2222 | import logging
from django.template.response import TemplateResponse
from django.test import RequestFactory, TestCase
from django_dynamic_fixture import G
from lang_pref_middleware.tests import LangPrefMiddlewareTestCaseMixin
from testfixtures import LogCapture
from core.exceptions import ServiceUnavailableError
from... | agpl-3.0 |
mezz64/home-assistant | tests/components/bond/test_switch.py | 9 | 3661 | """Tests for the Bond switch device."""
from datetime import timedelta
from bond_api import Action, DeviceType
from homeassistant import core
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN
from homeassistant.const import ATTR_ENTITY_ID, SERVICE_TURN_OFF, SERVICE_TURN_ON
from homeassistant.helpers... | apache-2.0 |
jmesteve/openerpseda | openerp/addons/account/report/__init__.py | 68 | 1601 | # -*- 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 |
alsrgv/tensorflow | tensorflow/python/training/adagrad.py | 15 | 5086 | # 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 |
Precis/Diamond | src/collectors/conntrack/conntrack.py | 57 | 3012 | # coding=utf-8
"""
Collecting connections tracking statistics from nf_conntrack/ip_conntrack
kernel module.
#### Dependencies
* nf_conntrack/ip_conntrack kernel module
"""
import diamond.collector
import os
class ConnTrackCollector(diamond.collector.Collector):
"""
Collector of number of conntrack conne... | mit |
Belxjander/Kirito | Python-3.5.0-Amiga/Lib/unittest/case.py | 6 | 56072 | """Test case implementation"""
import sys
import functools
import difflib
import logging
import pprint
import re
import warnings
import collections
import contextlib
import traceback
from . import result
from .util import (strclass, safe_repr, _count_diff_all_purpose,
_count_diff_hashable, _common_... | gpl-3.0 |
Zeken/audacity | lib-src/lv2/suil/waflib/extras/autowaf.py | 176 | 22430 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import glob
import os
import subprocess
import sys
from waflib import Configure,Context,Logs,Node,Options,Task,Utils
from waflib.TaskGen import feature,before,after
global g_i... | gpl-2.0 |
mindbender-studio/setup | bin/windows/python36/Lib/site-packages/bson/decimal128.py | 15 | 10798 | # Copyright 2016 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | mit |
dwhswenson/openpathsampling | openpathsampling/high_level/interface_set.py | 2 | 14534 | import openpathsampling as paths
import openpathsampling.netcdfplus as netcdfplus
import collections
import copy
from functools import partial
def _cv_max_func(trajectory, cv):
return max(cv(trajectory))
def _netcdfplus_cv_max(cv):
return paths.netcdfplus.FunctionPseudoAttribute(
name="max " + cv.nam... | mit |
andr7e/android_kernel_elephone_p6000 | kernel/scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
proyectosdeley/proyectos_de_ley | migrate_db.py | 1 | 2327 | import dataset
import datetime
import os
import unicodedata
def convert_name_to_slug(name):
"""Takes a congresista name and returns its slug."""
name = name.replace(",", "").lower()
name = name.split(" ")
if len(name) > 2:
i = 0
slug = ""
while i < 3:
slug += name[... | mit |
gdub/django | tests/flatpages_tests/test_csrf.py | 290 | 4819 | from django.contrib.auth.models import User
from django.contrib.flatpages.models import FlatPage
from django.contrib.sites.models import Site
from django.test import Client, TestCase, modify_settings, override_settings
from .settings import FLATPAGES_TEMPLATES
@modify_settings(INSTALLED_APPS={'append': 'django.contr... | bsd-3-clause |
xujb/odoo | openerp/report/render/rml2pdf/utils.py | 381 | 7143 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2003, Fabien Pinckaers, UCL, FSA
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesse... | agpl-3.0 |
chand3040/sree_odoo | openerp/addons/event_sale/event_sale.py | 40 | 13597 | # -*- 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 |
ubports-weblate/gallery-app | tests/autopilot/gallery_app/emulators/photo_viewer.py | 1 | 9588 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
# Copyright 2012-2015 Canonical
#
# 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.
import logging
from auto... | gpl-3.0 |
jiangzhuo/kbengine | kbe/src/lib/python/Lib/encodings/iso8859_9.py | 272 | 13156 | """ Python Character Mapping Codec iso8859_9 generated from 'MAPPINGS/ISO8859/8859-9.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_table)
def decode(self,input,errors='... | lgpl-3.0 |
dorodj/support-tools | wiki_to_md/impl/constants.py | 151 | 6658 | # Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
ESS-LLP/erpnext-medical | erpnext/patches/v9_0/add_user_to_child_table_in_pos_profile.py | 13 | 1267 | # Copyright (c) 2017, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
if frappe.db.table_exists("POS Profile User"):
frappe.reload_doc('accounts', 'doctype', 'pos_profile_user')
frappe.db.sql(""" update `tabPO... | gpl-3.0 |
Britefury/scikit-image | skimage/_shared/tests/test_safe_as_int.py | 36 | 1771 | import numpy as np
from skimage._shared.utils import safe_as_int
def test_int_cast_not_possible():
np.testing.assert_raises(ValueError, safe_as_int, 7.1)
np.testing.assert_raises(ValueError, safe_as_int, [7.1, 0.9])
np.testing.assert_raises(ValueError, safe_as_int, np.r_[7.1, 0.9])
np.testing.assert_r... | bsd-3-clause |
deathspawn/moffit | plugins/quran.py | 6 | 1466 | import requests
from cloudbot import hook
def statuscheck(status, item):
"""since we are doing this a lot might as well return something more meaningful"""
out = ""
if status == 404:
out = "It appears {} does not exist.".format(item)
elif status == 503:
out = "Qur'an API is having prob... | gpl-3.0 |
kave/zenhub-slackbot | slackbot/utils.py | 6 | 1854 | # -*- coding: utf-8 -*-
import os
import logging
import tempfile
import requests
from contextlib import contextmanager
from six.moves import _thread, range, queue
import six
logger = logging.getLogger(__name__)
def download_file(url, fpath):
logger.debug('starting to fetch %s', url)
r = requests.get(url, st... | mit |
rizumu/django | django/db/migrations/recorder.py | 478 | 2868 | from __future__ import unicode_literals
from django.apps.registry import Apps
from django.db import models
from django.db.utils import DatabaseError
from django.utils.encoding import python_2_unicode_compatible
from django.utils.timezone import now
from .exceptions import MigrationSchemaMissing
class MigrationRecor... | bsd-3-clause |
YongseopKim/crosswalk-test-suite | webapi/tct-csp-w3c-tests/csp-py/csp_connect-src_self.py | 5 | 3077 | def main(request, response):
response.headers.set("Content-Security-Policy", "connect-src 'self'; script-src 'self' 'unsafe-inline'")
response.headers.set("X-Content-Security-Policy", "connect-src 'self'; script-src 'self' 'unsafe-inline'")
response.headers.set("X-WebKit-CSP", "connect-src 'self'; script-sr... | bsd-3-clause |
wikkiewikkie/flask-googlecharts | docs/conf.py | 1 | 4921 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Flask-GoogleCharts documentation build configuration file, created by
# sphinx-quickstart on Tue Dec 6 20:15:31 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present i... | mit |
MaxMorgenstern/EmeraldAI | EmeraldAI/Logic/KnowledgeGathering/Weather.py | 1 | 1741 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import pyowm
from datetime import datetime
from EmeraldAI.Logic.Singleton import Singleton
from EmeraldAI.Config.Config import Config
class Weather(object):
__metaclass__ = Singleton
__owm = None
__language = None
__defaultCountry = None
def __init__(sel... | apache-2.0 |
Tokyo-Buffalo/tokyosouth | env/lib/python3.6/site-packages/twisted/mail/_except.py | 12 | 8439 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Exceptions in L{twisted.mail}.
"""
from __future__ import absolute_import, division
class IMAP4Exception(Exception):
pass
class IllegalClientResponse(IMAP4Exception):
pass
class IllegalOperation(IMAP4Exception):
pass
cl... | mit |
discosultan/quake-console | Samples/Sandbox/Lib/distutils/command/upload.py | 176 | 7002 | """distutils.command.upload
Implements the Distutils 'upload' subcommand (upload package to PyPI)."""
import os
import socket
import platform
from urllib2 import urlopen, Request, HTTPError
from base64 import standard_b64encode
import urlparse
import cStringIO as StringIO
from hashlib import md5
from distutils.errors... | mit |
jeffdwyatt/taiga-back | taiga/projects/tasks/api.py | 8 | 8229 | # Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the F... | agpl-3.0 |
emonty/ansible-container | ansible_container/shipit/modules/k8s_deployment.py | 1 | 9208 | #!/usr/bin/python
#
# Copyright 2016 Red Hat | Ansible
#
# 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 la... | lgpl-3.0 |
showell/zulip | zerver/webhooks/opsgenie/view.py | 2 | 2877 | from typing import Any, Dict
from django.http import HttpRequest, HttpResponse
from zerver.decorator import webhook_view
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success
from zerver.lib.webhooks.common import check_send_webhook_message
from zerver.models import Us... | apache-2.0 |
smurfix/DaBroker | dabroker/client/codec.py | 1 | 10644 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division, unicode_literals
##
## This file is part of DaBroker, a distributed data access manager.
##
## DaBroker is Copyright © 2014 by Matthias Urlichs <matthias@urlichs.de>,
## it is licensed under the GPLv3. See the file `README.rst` fo... | gpl-3.0 |
microelly2/cadquery-freecad-module | CadQuery/Libs/pyqode/core/_forms/dlg_unsaved_files_ui.py | 3 | 1782 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/colin/Documents/pyqode/core/forms/dlg_unsaved_files.ui'
#
# Created: Sun Oct 12 17:19:30 2014
# by: PyQt5 UI code generator 5.3.2
#
# WARNING! All changes made in this file will be lost!
from pyqode.qt import QtCore, QtGui, QtWid... | lgpl-3.0 |
mjames-upc/python-awips | dynamicserialize/dstypes/com/raytheon/uf/common/activetable/request/RetrieveRemoteActiveTableRequest.py | 1 | 2284 | ##
##
# File auto-generated against equivalent DynamicSerialize Java class
class RetrieveRemoteActiveTableRequest(object):
def __init__(self, serverHost=None, serverPort=0, serverProtocol=None,
mhsId=None, siteId=None, ancfAddress=None, bncfAddress=None,
transmitScript=None):
... | bsd-3-clause |
credativUK/OCB | addons/account_check_writing/__init__.py | 446 | 1111 | # -*- 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 |
mbox/django | django/utils/synch.py | 116 | 2627 | """
Synchronization primitives:
- reader-writer lock (preference to writers)
(Contributed to Django by eugene@lazutkin.com)
"""
import contextlib
try:
import threading
except ImportError:
import dummy_threading as threading
class RWLock(object):
"""
Classic implementation of reader-writer lock ... | bsd-3-clause |
dstroppa/openstack-smartos-nova-grizzly | nova/tests/api/openstack/compute/contrib/test_snapshots.py | 8 | 7829 | # Copyright 2011 Denali Systems, 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 requ... | apache-2.0 |
hms-dbmi/clodius | test/tiles/multivec_test.py | 1 | 1503 | import os.path as op
import base64
import h5py
import pytest
import clodius.tiles.multivec as hgmu
def test_multivec():
filename = op.join("test/sample_data", "sample_gwas.multires.mv5")
with h5py.File(filename, "r") as h5:
tile_size = h5["info"].attrs["tile-size"]
resolutions = list(h5["reso... | mit |
tongfa/vent | wserve/wserve/views.py | 1 | 1406 | from django.http import HttpResponse
from django.template.loader import get_template
from django.template import Context
from wserve.settings import VENT_WD, VENT_WWW_CLIENT_EP
import cPickle as pickle
import json, time, os
def address2key(address):
r = 0
for s in address[0].split('.'):
r = r << 8
... | mit |
rcarrillocruz/ansible | lib/ansible/modules/network/panos/panos_lic.py | 78 | 4915 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage PaloAltoNetworks Firewall
# (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish... | gpl-3.0 |
Godiyos/python-for-android | python-modules/twisted/twisted/test/stdio_test_halfclose.py | 56 | 1899 | # -*- test-case-name: twisted.test.test_stdio.StandardInputOutputTestCase.test_readConnectionLost -*-
# Copyright (c) 2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Main program for the child process run by
L{twisted.test.test_stdio.StandardInputOutputTestCase.test_readConnectionLost}
to test that IH... | apache-2.0 |
dmoliveira/yapf | yapftests/subtype_assigner_test.py | 3 | 8469 | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
liyu1990/sklearn | sklearn/cluster/tests/test_hierarchical.py | 230 | 19795 | """
Several basic tests for hierarchical clustering procedures
"""
# Authors: Vincent Michel, 2010, Gael Varoquaux 2012,
# Matteo Visconti di Oleggio Castello 2014
# License: BSD 3 clause
from tempfile import mkdtemp
import shutil
from functools import partial
import numpy as np
from scipy import sparse
from... | bsd-3-clause |
sunyihuan326/DeltaLab | Andrew_NG_learning/class_two/week_two/testCases.py | 1 | 4051 | import numpy as np
def update_parameters_with_gd_test_case():
np.random.seed(1)
learning_rate = 0.01
W1 = np.random.randn(2, 3)
b1 = np.random.randn(2, 1)
W2 = np.random.randn(3, 3)
b2 = np.random.randn(3, 1)
dW1 = np.random.randn(2, 3)
db1 = np.random.randn(2, 1)
dW2 = np.random.... | mit |
gtoonstra/airflow | airflow/migrations/versions/e3a246e0dc1_current_schema.py | 3 | 12374 | # -*- 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 |
herqles-io/hq-manager | src/hqmanager/api/user.py | 1 | 5040 | import cherrypy
class UserAPIController(object):
exposed = True
def __init__(self, identity, assignment):
self.identity = identity
self.assignment = assignment
def index(self):
return "User api Index"
@cherrypy.tools.json_out()
@cherrypy.tools.json_in()
@cherrypy.to... | mit |
lseyesl/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/python_unittests.py | 130 | 1524 | #
# Copyright (C) 2011 Google Inc. All rights reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# T... | bsd-3-clause |
jorik041/phantomjs | src/qt/qtwebkit/Tools/QueueStatusServer/model/patchlog.py | 119 | 3107 | # Copyright (C) 2013 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 |
davidgardenier/frbpoppy | tests/dm_snr/future.py | 1 | 6523 | """Check the log N log F slope for future surveys."""
import numpy as np
import matplotlib.pyplot as plt
from copy import copy
from frbpoppy import CosmicPopulation, Survey, LargePopulation, SurveyPopulation, hist
from frbpoppy import unpickle, pprint
import frbpoppy.direction_dists as did
import frbpoppy.galacticops ... | mit |
HousekeepLtd/django | tests/admin_filters/models.py | 98 | 2149 | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.encoding import python_2_unicode_compa... | bsd-3-clause |
fkorotkov/pants | tests/python/pants_test/init/test_plugin_resolver.py | 4 | 5766 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import tim... | apache-2.0 |
AcorpBG/PokemonGo-Bot | pokemongo_bot/cell_workers/catch_lured_pokemon.py | 4 | 1626 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from pokemongo_bot.cell_workers.utils import fort_details
from pokemongo_bot.cell_workers.pokemon_catch_worker import PokemonCatchWorker
from pokemongo_bot.base_task import BaseTask
class CatchLuredPokemon(BaseTask):
SUPPORTED_TASK_API_VERSION = 1
... | mit |
i02sopop/Kirinki | gstreamer/examples/video_receiver.py | 1 | 2317 | #!/usr/bin/env python
# -=- encoding: utf-8 -=-
################ VIDEO RECEIVER
import gobject, pygst
pygst.require("0.10")
import gst
# TODO: detect from the RTPSource element inside the GstRtpBin
REMOTE_HOST = '192.168.34.150'
READ_VIDEO_CAPS = 'video.caps'
pipeline = gst.Pipeline('server')
caps = open(READ_VIDE... | agpl-3.0 |
Phuehvk/gyp | pylib/gyp/input_test.py | 1841 | 3207 | #!/usr/bin/env python
# Copyright 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for the input.py file."""
import gyp.input
import unittest
import sys
class TestFindCycles(unittest.TestCase):
def setUp(self... | bsd-3-clause |
cloudysunny14/CloudySwitch | cloudyswitch/app/psyco_eventlet.py | 1 | 2308 | """A wait callback to allow psycopg2 cooperation with eventlet.
Use `make_psycopg_green()` to enable eventlet support in Psycopg.
"""
# Copyright (C) 2010 Daniele Varrazzo <daniele.varrazzo@gmail.com>
# and licensed under the MIT license:
#
# Permission is hereby granted, free of charge, to any person obtaining a co... | apache-2.0 |
kennethreitz/pipenv | pipenv/vendor/zipp.py | 7 | 8089 | import io
import posixpath
import zipfile
import itertools
import contextlib
import sys
import pathlib
if sys.version_info < (3, 7):
from collections import OrderedDict
else:
OrderedDict = dict
def _parents(path):
"""
Given a path with elements separated by
posixpath.sep, generate all parents of ... | mit |
fpdetective/fpdetective | src/crawler/fp_regex.py | 1 | 2460 | BLUECAVA = 1
INSIDEGRAPH = 2
THREATMETRIX = 3
IOVATION = 4
MAXMIND = 5
ANALYTICSENGINE = 6
COINBASE = 7
SITEBLACKBOX = 8
PERFERENCEMENT = 9
MYFREECAMS = 10
MINDSHARE = 11
AFKMEDIA = 12
CDNNET = 13
ANALYTICSPROS = 14
ANONYMIZER = 15
AAMI = 16
VIRWOX = 17
ISINGLES = 18
BBELEMENTS = 19
PIANOMEDIA = 20
ALIBABA = 21
MERCADO... | gpl-3.0 |
xaviercobain88/framework-python | openerp/addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py | 52 | 8708 | # -*- 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 |
tu-rbo/differentiable-particle-filters | methods/dpf_kitti.py | 1 | 43029 | import os
import numpy as np
import sonnet as snt
import tensorflow as tf
import matplotlib.pyplot as plt
from utils.data_utils_kitti import wrap_angle, compute_statistics, split_data, make_batch_iterator, make_repeating_batch_iterator, rotation_matrix, load_data_for_stats
from utils.method_utils import atan2, compute... | mit |
ff94315/hiwifi-openwrt-HC5661-HC5761 | staging_dir/host/lib64/scons-2.1.0/SCons/Tool/RCS.py | 21 | 2349 | """SCons.Tool.RCS.py
Tool-specific initialization for RCS.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foundatio... | gpl-2.0 |
cohortfsllc/cohort-cocl2-sandbox | tools/test_timing.py | 13 | 3602 | #!/usr/bin/python2.4
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of... | bsd-3-clause |
nextstrain/auspice | docs/conf.py | 1 | 2559 | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | agpl-3.0 |
muntasirsyed/intellij-community | python/lib/Lib/macurl2path.py | 332 | 3275 | """Macintosh-specific module for conversion between pathnames and URLs.
Do not import directly; use urllib instead."""
import urllib
import os
__all__ = ["url2pathname","pathname2url"]
def url2pathname(pathname):
"""OS-specific conversion from a relative URL of the 'file' scheme
to a file system path; not r... | apache-2.0 |
westurner/pyglobalgoals | notebooks/globalgoals-pyglobalgoals.py.py | 1 | 16352 |
# coding: utf-8
# # @TheGlobalGoals for Sustainable Development
# ## Background
#
# * Homepage: **http://www.globalgoals.org/**
# - Twitter: https://twitter.com/TheGlobalGoals
# - Instagram: https://instagram.com/TheGlobalGoals/
# - Facebook: https://www.facebook.com/globalgoals.org
# - YouTube: https://www.youtube... | bsd-3-clause |
raoulbq/scipy | scipy/linalg/decomp_schur.py | 117 | 8375 | """Schur decomposition functions."""
from __future__ import division, print_function, absolute_import
import numpy
from numpy import asarray_chkfinite, single, asarray
from scipy._lib.six import callable
# Local imports.
from . import misc
from .misc import LinAlgError, _datacopied
from .lapack import get_lapack_fun... | bsd-3-clause |
liuquncn/PythonExercises | sudoku/sudoku.py3.py | 2 | 22277 |
import copy
def list_add_one(set_of_number):
return [x+1 for x in list(set_of_number)]
def torow(block,order):
return (block//3)*3+order//3
def tocolumn(block,order):
return (block%3)*3+order%3
def toblock(row,column):
return (row//3)*3+column//3
def toorder(row,column):
return (row%3)*3+colum... | gpl-3.0 |
GoogleCloudPlatform/healthcare-deid | setup.py | 1 | 1364 | """Setup module for the healthcare_deid DLP pipeline.
All of the code necessary to run the pipeline is packaged into a source
distribution that is uploaded to the --staging_location specified on the command
line. The source distribution is then installed on the workers before they
start running.
When remotely execut... | apache-2.0 |
proxysh/Safejumper-for-Mac | buildmac/Resources/env/lib/python2.7/site-packages/cryptography/hazmat/backends/__init__.py | 13 | 2215 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import pkg_resources
from cryptography.hazmat.backends.multibackend impo... | gpl-2.0 |
VitalPet/sale-workflow | sale_payment_term_interest/tests/test_sale_order.py | 25 | 5144 | # -*- coding: utf-8 -*-
#
#
# Authors: Guewen Baconnier
# Copyright 2015 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# Licens... | agpl-3.0 |
ryfeus/lambda-packs | Tensorflow_OpenCV_Nightly/source/tensorflow/contrib/keras/api/keras/activations/__init__.py | 46 | 1815 | # 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... | mit |
pplatek/odoo | addons/account/report/account_journal.py | 255 | 10035 | # -*- 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 |
Dhivyap/ansible | lib/ansible/modules/cloud/openstack/os_user_info.py | 21 | 5263 | #!/usr/bin/python
# Copyright (c) 2016 Hewlett-Packard Enterprise Corporation
# 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 |
stackforge/python-openstacksdk | openstack/tests/functional/baremetal/test_baremetal_chassis.py | 3 | 2873 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 |
leandrotoledo/oppia | extensions/rules/nonnegative_int_test.py | 9 | 1048 | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | apache-2.0 |
idovear/odoo | addons/l10n_uk/__openerp__.py | 260 | 1999 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2011 Smartmode LTD (<http://www.smartmode.co.uk>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as... | agpl-3.0 |
django-nonrel/django-nonrel | django/contrib/gis/db/backends/postgis/adapter.py | 311 | 1165 | """
This object provides quoting for GEOS geometries into PostgreSQL/PostGIS.
"""
from psycopg2 import Binary
from psycopg2.extensions import ISQLQuote
class PostGISAdapter(object):
def __init__(self, geom):
"Initializes on the geometry."
# Getting the WKB (in string form, to allow easy pickling ... | bsd-3-clause |
evanson/emacs.d | vendor/pymacs/contrib/Giorgi/dotEmacs.py | 9 | 1726 | # -*- coding: utf-8 -*-
# jjEmacsPythoned.py
#
import sys
import os.path
import string
from Pymacs import lisp
sys.path.append(".")
interactions = {}
def debug(msg):
msg = "<D> "+msg
def t():
lisp.message(msg)
lisp.set_buffer("*LogBuffer*")
lisp.goto_line(lisp.point_max())
... | gpl-3.0 |
Obus/scikit-learn | sklearn/linear_model/base.py | 89 | 14608 | """
Generalized Linear models.
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Olivier Grisel <olivier.grisel@ensta.org>
# Vincent Michel <vincent.michel@inria.fr>
# Peter Prettenhofer <peter.prettenhofer@gmail.com>
# ... | bsd-3-clause |
abrowning80/solutions-geoevent-java | data/packages/geoprocessing/visibility/Toolshare/scripts/visibility.py | 4 | 12131 | #-------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: patr5136
#
# Created: 28/08/2013
# Copyright: (c) patr5136 2013
# Licence: <your licence>
#-------------------------------------------------------------------------------
import... | apache-2.0 |
simontegg/valuenetwork | valuenetwork/valueaccounting/migrations/0036_auto__del_field_valueequationbucket_filter_rule__add_field_valueequati.py | 3 | 65239 | # -*- 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):
# Deleting field 'ValueEquationBucket.filter_rule'
db.delete_column('valueaccounting_valueequationbucket', '... | agpl-3.0 |
YihaoLu/statsmodels | statsmodels/base/_penalties.py | 32 | 4308 | """
A collection of smooth penalty functions.
Penalties on vectors take a vector argument and return a scalar
penalty. The gradient of the penalty is a vector with the same shape
as the input value.
Penalties on covariance matrices take two arguments: the matrix and
its inverse, both in unpacked (square) form. The ... | bsd-3-clause |
kun--hust/libcloud_with_cn | libcloud/compute/providers.py | 2 | 7681 | # 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 use ... | apache-2.0 |
SethGreylyn/gwells | gwells/migrations/0009_auto_20170711_1600_squashed_0010_auto_20170713_0917.py | 1 | 20389 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-07-13 17:57
from __future__ import unicode_literals
from decimal import Decimal
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
replaces = [('gwells', '0009... | apache-2.0 |
BFriedland/UserDataBase-Heroku | venv/Lib/warnings.py | 14 | 13725 | """Python part of the warnings subsystem."""
import sys
__all__ = ["warn", "showwarning", "formatwarning", "filterwarnings",
"resetwarnings", "catch_warnings"]
def showwarning(message, category, filename, lineno, file=None, line=None):
"""Hook to write a warning to a file; replace if you like."""
... | mit |
tashaxe/Red-DiscordBot | lib/youtube_dl/extractor/c56.py | 91 | 2083 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import js_to_json
class C56IE(InfoExtractor):
_VALID_URL = r'https?://(?:(?:www|player)\.)?56\.com/(?:.+?/)?(?:v_|(?:play_album.+-))(?P<textid>.+?)\.(?:html|swf)'
IE_NAME = '56.com'
_TESTS = ... | gpl-3.0 |
peterheim1/robbie_ros | robbie_behave/src/robbie_behave/markovian.py | 2 | 1196 | import random
class Markov(object):
def __init__(self, open_file):
self.cache = {}
self.open_file = open_file
self.words = self.file_to_words()
self.word_size = len(self.words)
self.database()
def file_to_words(self):
self.open_file.seek(0)
data = self.open_file.read()
words = data.split()
r... | bsd-3-clause |
dsparrow27/zoocore | zoo/libs/command/commandui.py | 1 | 2760 | from functools import partial
from qt import QtWidgets, QtGui, QtCore
from zoo.libs import iconlib
from zoo.libs.utils import zlogging
logger = zlogging.getLogger(__name__)
class CommandActionBase(QtCore.QObject):
"""CommandUi class deals with encapsulating a command as a widget
"""
triggered = QtCore.S... | gpl-3.0 |
suxinde2009/zulip | zerver/management/commands/set_default_streams.py | 113 | 1657 | from __future__ import absolute_import
from django.core.management.base import BaseCommand
from zerver.models import Realm
from zerver.lib.actions import set_default_streams
from optparse import make_option
import sys
class Command(BaseCommand):
help = """Set default streams for a realm
Users created under thi... | apache-2.0 |
sirpercival/kivy | examples/widgets/unicode_textinput.py | 12 | 10803 | # -*- coding: utf-8 -*-
from kivy.app import App
from kivy.lang import Builder
from kivy.properties import StringProperty, ObjectProperty
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.spinner import SpinnerOption
from kivy.uix.popup import Popup
import os
Builder... | mit |
toomanyjoes/mrperfcs386m | src/conv.py | 2 | 3969 | #!/usr/bin/python
"""Hadoop Simulator
This simulator takes three configuration files, topology.xml, metadata.xml,
and job.xml, describing a Hadoop job and the topology it will run on.
Two tcl files, topology.tcl and events.tcl, will be generated as input
for ns-2 for further simulation.
"""
#import xml.dom
import x... | mit |
toylee/my-portable-configs | Emacs-config/.emacs.d/emacs-for-python/python-libs/rope/base/oi/transform.py | 91 | 9858 | """Provides classes for persisting `PyObject`\s"""
import os
import re
import rope.base.builtins
from rope.base import exceptions
class PyObjectToTextual(object):
"""For transforming `PyObject` to textual form
This can be used for storing `PyObjects` in files. Use
`TextualToPyObject` for converting bac... | gpl-3.0 |
Microvellum/Fluid-Designer | win64-vc/2.78/Python/bin/2.78/scripts/addons/io_blend_utils/bl_utils/subprocess_helper.py | 1 | 5646 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# 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) any later version.
#
# This program is distrib... | gpl-3.0 |
kc-lab/dms2dfe | dms2dfe/lib/io_ml.py | 2 | 24058 | #!usr/bin/python
# Copyright 2016, Rohan Dandage <rraadd_8@hotmail.com,rohan@igib.in>
# This program is distributed under General Public License v. 3.
"""
================================
``io_ml``
================================
"""
from os.path import abspath,dirname,exists,basename
from os import makedirs
from ... | gpl-3.0 |
tetra5/radiance | ui/widgets/verticallabel.py | 1 | 1370 | # -*- coding: utf-8 -*-
"""
Created on 28.01.2011
@author: vda
"""
from PyQt4 import QtCore, QtGui
class VerticalLabel(QtGui.QWidget):
def __init__(self, text, parent=None):
QtGui.QLabel.__init__(self, parent)
self.text = text
fm = QtGui.QApplication.fontMetrics()
se... | mit |
supermaik/selbot | Quote_Command.py | 1 | 1175 | from Quotes import Quote
from Command import Command
class Quote_Command(Command):
def __init__(self, config):
self.connection = config['connection']
self.event = config['event']
self.channel = config['channel']
pass
def resolve(self):
args = self.event.arguments[0].sp... | unlicense |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.