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
lekum/ansible
lib/ansible/cli/vault.py
1
4660
# (c) 2014, James Tanner <tanner.jc@gmail.com> # # 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 i...
gpl-3.0
TheTacoScott/bloomingtonpuzzles
wine-buffer-redis-custom_match.py
1
7311
""" wine.py a bipartite non directed graphing solution to the bloomreach wine puzzle example usage: python wine.py --input filename.txt """ import networkx as nx import argparse, time, sys import redis parser = argparse.ArgumentParser(description='') parser.add_argument('--input', action="store", dest="input") pars...
mit
azoft-dev-team/imagrium
env/Lib/_google_ipaddr_r234.py
9
61122
#!/usr/bin/python # # Copyright 2007 Google Inc. # Licensed to PSF under a Contributor Agreement. # # 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/LICE...
mit
heejongahn/microblog-1
tests.py
17
6235
#!flask/bin/python # -*- coding: utf8 -*- from coverage import coverage cov = coverage(branch=True, omit=['flask/*', 'tests.py']) cov.start() import os import unittest from datetime import datetime, timedelta from config import basedir from app import app, db from app.models import User, Post from app.translate impo...
bsd-3-clause
alsoicode/cmsplugin-filer
cmsplugin_filer_link/migrations_django/0001_initial.py
13
1682
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import filer.fields.file import cms.models.fields from cmsplugin_filer_link.models import LINK_STYLES class Migration(migrations.Migration): dependencies = [ ('cms', '0003_auto_20140926_2347'), ...
bsd-3-clause
PokeAPI/pokeapi
pokemon_v2/api.py
1
14424
import re from rest_framework import viewsets from rest_framework.response import Response from rest_framework.views import APIView from django.shortcuts import get_object_or_404 from django.http import Http404 from .models import * from .serializers import * # pylint: disable=no-member, attribute-defined-outside-ini...
bsd-3-clause
javandoc/Build-FFmpeg
x264/tools/test_x264.py
138
16077
#!/usr/bin/env python import operator from optparse import OptionGroup import sys from time import time from digress.cli import Dispatcher as _Dispatcher from digress.errors import ComparisonError, FailedTestError, DisabledTestError from digress.testing import depends, comparer, Fixture, Case from digress.comparer...
gpl-2.0
ICGC-TCGA-PanCancer/pcawg-central-index
pcawg_metadata_parser/get_gnos_rnaseq_info.py
1
5526
#!/usr/bin/env python import yaml import json from elasticsearch1 import Elasticsearch from parse_gnos_xml import * repo = '' metadata_dir = find_latest_metadata_dir('gnos_metadata') header_printed = False index_name = 'rna_seq_info' index_type = 'gnos_entries' es = Elasticsearch([ 'localhost:9200' ]) es.indices....
gpl-2.0
fake-name/ReadableWebProxy
WebMirror/management/rss_parser_funcs/feed_parse_extractTomotranslationsCom.py
1
1104
def extractTomotranslationsCom(item): ''' Parser for 'tomotranslations.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('A Wish To Grab Happiness', 'Negawakuba no Konote...
bsd-3-clause
chengduoZH/Paddle
python/paddle/fluid/tests/unittests/mkldnn/test_concat_int8_mkldnn_op.py
3
3963
# Copyright (c) 2019 PaddlePaddle 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 app...
apache-2.0
eneldoserrata/marcos_openerp
addons/report_geraldo/lib/geraldo/site/newsite/django_1_0/django/contrib/sitemaps/__init__.py
9
3531
from django.core import urlresolvers, paginator import urllib PING_URL = "http://www.google.com/webmasters/tools/ping" class SitemapNotFound(Exception): pass def ping_google(sitemap_url=None, ping_url=PING_URL): """ Alerts Google that the sitemap for the current site has been updated. If sitemap_url ...
agpl-3.0
leppa/home-assistant
tests/components/elgato/__init__.py
1
1484
"""Tests for the Elgato Key Light integration.""" from homeassistant.components.elgato.const import CONF_SERIAL_NUMBER, DOMAIN from homeassistant.const import CONF_HOST, CONF_PORT from homeassistant.core import HomeAssistant from tests.common import MockConfigEntry, load_fixture from tests.test_util.aiohttp import Ai...
apache-2.0
ClearCorp/odoo-clearcorp
TODO-8.0/product_price_list_report/wizard/__init__.py
4
1059
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Addons modules by CLEARCORP S.A. # Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>). # # This program is free software: you can redistribute...
agpl-3.0
vanceeasleaf/aces
aces/default.py
1
2033
# -*- coding: utf-8 -*- # @Author: YangZhou # @Date: 2017-06-16 20:21:25 # @Last Modified by: YangZhou # @Last Modified time: 2017-06-18 21:59:52 default = dict( units="metal", method="nvt", enforceThick=True, xp=1, yp=1, zp=1, useMini=True, upP=3, fixud=0, usinglat=True, ...
gpl-2.0
balloob/home-assistant
homeassistant/components/insteon/schemas.py
9
10403
"""Schemas used by insteon component.""" from binascii import Error as HexError, unhexlify from typing import Dict from pyinsteon.address import Address from pyinsteon.constants import HC_LOOKUP import voluptuous as vol from homeassistant.const import ( CONF_ADDRESS, CONF_DEVICE, CONF_ENTITY_ID, CONF_...
apache-2.0
msoftware/onion_omega2_hex_keypad
keypad.py
1
1474
#!/usr/bin/python # Keypad doc: http://www.circuitstoday.com/interfacing-hex-keypad-to-arduino import copy import omega_gpio import datetime import time import urllib2 a = [0,1,2,3,11,18,8,9] r = [0,1,2,3] c = [18,11,8,9] key = [ ["1", "2", "3", "A"], ["4", "5", "6", "B"], ["7", "8", "9", "C"], ["*"...
apache-2.0
cloew/DevLog
devlog/dates/log_year.py
1
1207
from .log_month import LogMonth from ..files import DateFiles from kao_list import KaoList class LogYear: """ Represents a specific Log Year directory """ def __init__(self, date): """ Initialize with the date to wrap """ self.date = date @property def previo...
mit
heeraj123/oh-mainline
vendor/packages/twisted/twisted/trial/test/test_log.py
20
6044
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test the interaction between trial and errors logged during test run. """ import time from twisted.internet import reactor, task from twisted.python import failure, log from twisted.trial import unittest, reporter def makeFailure(): ""...
agpl-3.0
sanethd/device-cloud-appliances
DigitalDisplay/modules/update_listener.py
5
7066
""" /** * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * WSO2 Inc. licenses this file to you 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/licen...
apache-2.0
sodexis/odoo
addons/website_membership/controllers/main.py
64
9496
# -*- coding: utf-8 -*- from openerp import SUPERUSER_ID from openerp.addons.web import http from openerp.addons.web.http import request from openerp.addons.website.models.website import unslug from openerp.tools import DEFAULT_SERVER_DATE_FORMAT from openerp.tools.translate import _ import time import werkzeug.urls ...
agpl-3.0
jjas0nn/solvem
tensorflow/lib/python2.7/site-packages/tensorflow/contrib/bayesflow/python/ops/monte_carlo.py
6
9901
# 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
RomelTorres/alpha_vantage
alpha_vantage/foreignexchange.py
1
5864
from .alphavantage import AlphaVantage as av class ForeignExchange(av): """Realtime currency exchange rates for physical and digital currencies. """ def __init__(self, *args, **kwargs): """ Inherit AlphaVantage base class with its default arguments """ super(ForeignExchang...
mit
glwu/python-for-android
python3-alpha/extra_modules/pyxmpp2/stanzaprocessor.py
46
20266
# # (C) Copyright 2003-2011 Jacek Konieczny <jajcus@jajcus.net> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License Version # 2.1 as published by the Free Software Foundation. # # This program is distributed in the hope that it will be u...
apache-2.0
clouserw/olympia
apps/amo/tests/test_install.py
7
1907
from amo.install import addons from amo.tests import TestCase from amo.urlresolvers import reverse from amo.utils import urlparams class InstallTests(TestCase): def test_generic(self): url = reverse('api.install') r = self.client.get(urlparams(url, addon_id='...
bsd-3-clause
michalliu/OpenWrt-Firefly-Libraries
staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/test/test_configparser.py
8
72028
import collections import configparser import io import os import sys import textwrap import unittest import warnings from test import support class SortedDict(collections.UserDict): def items(self): return sorted(self.data.items()) def keys(self): return sorted(self.data.keys()) def va...
gpl-2.0
kevinpetersavage/BOUT-dev
examples/elm-pb/Python/plotmode2.py
3
1596
from __future__ import print_function from __future__ import division from builtins import str from builtins import range from past.utils import old_div from numpy import *; #from scipy.io import readsav; import matplotlib.pyplot as plt; from boutdata import collect # Dynamic matplotlib settings from matplotlib impor...
gpl-3.0
luzpaz/QGIS
python/PyQt/PyQt5/uic/__init__.py
45
1461
# -*- coding: utf-8 -*- """ *************************************************************************** __init__.py --------------------- Date : February 2016 Copyright : (C) 2016 by Jürgen E. Fischer Email : jef at norbit dot de ***************************...
gpl-2.0
Aristocles/CouchPotatoServer
libs/html5lib/filters/lint.py
979
4306
from __future__ import absolute_import, division, unicode_literals from gettext import gettext _ = gettext from . import _base from ..constants import cdataElements, rcdataElements, voidElements from ..constants import spaceCharacters spaceCharacters = "".join(spaceCharacters) class LintError(Exception): pass ...
gpl-3.0
rudischilder/gr10_2
sw/airborne/test/ahrs/ahrs_utils.py
86
4923
#! /usr/bin/env python # Copyright (C) 2011 Antoine Drouin # # This file is part of Paparazzi. # # Paparazzi 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, or (at your option) # any later ...
gpl-2.0
zeuscp/zcp
app/modules/user/main.py
1
5400
#-*- coding: utf-8 -*- from app.modules.builtins.system import System class User(): def __init__(self): self.system = System() self.web_service = "" self.shell = "" self.passwd = "" self.username = "" def checkDirectory(self, path): """ Return True if d...
apache-2.0
sebotic/WikidataIntegrator
wikidataintegrator/tests/tests.py
2
8027
import copy import pprint import unittest import requests from wikidataintegrator import wdi_core, wdi_fastrun from wikidataintegrator.wdi_core import WDApiError __author__ = 'Sebastian Burgstaller-Muehlbacher' __license__ = 'AGPLv3' class TestMediawikiApiCall(unittest.TestCase): def test_all(self): wi...
agpl-3.0
danielmellado/tempest
tempest/api/volume/test_availability_zone.py
19
1316
# Copyright 2014 NEC Corporation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
apache-2.0
EnviroCentre/jython-upgrade
jython/lib/weakref.py
17
4666
"""Weak reference support for Python. This module is an implementation of PEP 205: http://www.python.org/dev/peps/pep-0205/ """ # Changed for Jython to use MapMaker in Google Collections # Naming convention: Variables named "wr" are weak reference objects; # they are called this instead of "ref" to avoid name colli...
mit
sam-m888/gprime
gprime/plugins/rel/rel_sk.py
1
24614
# -*- coding: utf-8 -*- # # gPrime - A web-based genealogy program # # Copyright (C) 2003-2007 Donald N. Allingham # Copyright (C) 2008 Brian G. Matherly # # 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 Soft...
gpl-2.0
JohnyEngine/CNC
opencamlib/src/attic/cutsim/cutsim_06.py
8
3565
import ocl import pyocl import camvtk import time import datetime import vtk import math def main(): print ocl.revision() myscreen = camvtk.VTKScreen() myscreen.camera.SetPosition(-15, -8, 15) myscreen.camera.SetFocalPoint(0,0, 0) # axis arrows camvtk.drawArrows(myscreen,center=(0,0,0))...
apache-2.0
krzysieqq/krzysieqq
src/krzysieqq/urls.py
1
1126
"""krzysieqq URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-...
mit
bottompawn/kbengine
kbe/res/scripts/common/Lib/tkinter/tix.py
89
77022
# -*-mode: python; fill-column: 75; tab-width: 8 -*- # # $Id$ # # Tix.py -- Tix widget wrappers. # # For Tix, see http://tix.sourceforge.net # # - Sudhir Shenoy (sshenoy@gol.com), Dec. 1995. # based on an idea of Jean-Marc Lugrin (lugrin@ms.com) # # NOTE: In order to minimize changes to Tkinter.py, ...
lgpl-3.0
anirudhjayaraman/Dato-Core
src/unity/python_deps/psutil/examples/top.py
44
7382
#!/usr/bin/env python # Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ A clone of top / htop. Author: Giampaolo Rodola' <g.rodola@gmail.com> $ python examples/top.py CPU0 [| ...
agpl-3.0
Ecotrust/floodplain-restoration
dst/survey/migrations/0011_bifsettings.py
1
1042
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('survey', '0010_remove_question_layers'), ...
mit
lexus24/w16b_test
static/Brython3.1.3-20150514-095342/Lib/tokenize.py
728
24424
"""Tokenization help for Python programs. tokenize(readline) is a generator that breaks a stream of bytes into Python tokens. It decodes the bytes according to PEP-0263 for determining source file encoding. It accepts a readline-like method which is called repeatedly to get the next line of input (or b"" for EOF). ...
agpl-3.0
flwh/KK_mt6589_iq451
prebuilts/python/darwin-x86/2.7.5/lib/python2.7/test/fork_wait.py
129
2291
"""This test case provides support for checking forking and wait behavior. To test different wait behavior, override the wait_impl method. We want fork1() semantics -- only the forking thread survives in the child after a fork(). On some systems (e.g. Solaris without posix threads) we find that all active threads su...
gpl-2.0
patricklucas/pyleus
setup.py
8
2665
from distutils.command.bdist import bdist as _bdist from distutils.core import Command import os import shutil import subprocess import sys from setuptools import setup from setuptools.command.sdist import sdist as _sdist from pyleus import __version__ from pyleus import BASE_JAR JAVA_SRC_DIR = "topology_builder/" B...
apache-2.0
napalm-automation/napalm-yang
napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/afi_safis/afi_safi/route_selection_options/state/__init__.py
1
52189
# -*- coding: utf-8 -*- from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListTy...
apache-2.0
batxes/4c2vhic
SHH_WT_models_highres/SHH_WT_models_highres_final_output_0.1_-0.1_5000/mtx1_models/SHH_WT_models_highres9157.py
4
88203
import _surface import chimera try: import chimera.runCommand except: pass from VolumePath import markerset as ms try: from VolumePath import Marker_Set, Link new_marker_set=Marker_Set except: from VolumePath import volume_path_dialog d= volume_path_dialog(True) new_marker_set= d.new_marker_set marker_set...
gpl-3.0
HesselTjeerdsma/Cyber-Physical-Pacman-Game
Algor/flask/lib/python2.7/site-packages/http/client.py
45
2786
from __future__ import absolute_import import sys assert sys.version_info[0] < 3 from httplib import * from httplib import HTTPMessage # These constants aren't included in __all__ in httplib.py: from httplib import (HTTP_PORT, HTTPS_PORT, _CS_IDLE, _CS...
apache-2.0
mythi/intel-iot-refkit
meta-iotqa/lib/baserunner/baserunner.py
9
6013
#!/usr/bin/env python # Copyright (C) 2013 Intel Corporation # # Released under the MIT license (see COPYING.MIT) # Base unittest module used by testrunner # This provides the common test runner functionalities including manifest input, # xunit output, timeout, tag filtering. """Base testrunner""" import os import s...
mit
cheukyin699/linux
scripts/analyze_suspend.py
1537
120394
#!/usr/bin/python # # Tool for analyzing suspend/resume timing # Copyright (c) 2013, Intel Corporation. # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published by the Free Software Foundation. # # This prog...
gpl-2.0
ProfessionalIT/maxigenios-website
sdk/google_appengine/lib/protorpc-1.0/protorpc/webapp/forms.py
45
5278
#!/usr/bin/env python # # Copyright 2010 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...
mit
ruibarreira/linuxtrail
usr/lib/python2.7/dist-packages/numpy/ma/tests/test_subclassing.py
9
6384
# pylint: disable-msg=W0611, W0612, W0511,R0201 """Tests suite for MaskedArray & subclassing. :author: Pierre Gerard-Marchant :contact: pierregm_at_uga_dot_edu :version: $Id: test_subclassing.py 3473 2007-10-29 15:18:13Z jarrod.millman $ """ from __future__ import division, absolute_import, print_function __author__...
gpl-3.0
noamelf/Open-Knesset
agendas/migrations/0006_calc_num_followers.py
14
23563
# encoding: utf-8 from south.v2 import DataMigration class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." for agenda in orm['agendas.Agenda'].objects.all(): agenda.num_followers = orm['actstream.Follow'].objects.filter( conten...
bsd-3-clause
hasanferit/trumpcrawler
crawlenv/lib/python3.5/site-packages/setuptools/command/install_scripts.py
454
2439
from distutils import log import distutils.command.install_scripts as orig import os import sys from pkg_resources import Distribution, PathMetadata, ensure_directory class install_scripts(orig.install_scripts): """Do normal script install, plus any egg_info wrapper scripts""" def initialize_options(self): ...
mit
gtko/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/bambuser.py
15
3130
from __future__ import unicode_literals import re import json import itertools from .common import InfoExtractor from ..utils import ( compat_urllib_request, ) class BambuserIE(InfoExtractor): IE_NAME = 'bambuser' _VALID_URL = r'https?://bambuser\.com/v/(?P<id>\d+)' _API_KEY = '005f64509e19a86839906...
gpl-3.0
kwantam/rust
src/etc/generate-deriving-span-tests.py
53
4071
#!/usr/bin/env python # # Copyright 2013 The Rust Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution and at # http://rust-lang.org/COPYRIGHT. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license #...
apache-2.0
john-charles/plywood
setup.py
1
1338
#!/usr/bin/env python """ This file is part of plywood. Copyright 2013 John-Charles D. Sokolow - <john.charles.sokolow@gmail.com> plywood is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation...
gpl-3.0
geodrinx/gearthview
ext-libs/twisted/python/syslog.py
29
3676
# -*- test-case-name: twisted.python.test.test_syslog -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Classes and utility functions for integrating Twisted and syslog. You probably want to call L{startLogging}. """ syslog = __import__('syslog') from twisted.python import log # These...
gpl-3.0
jrasky/planetlabs-challenge
annagrams.py
1
3132
#!/usr/bin/env python # location of the dictionary WORDS = "/usr/share/dict/words" # list of prime numbers for each letter of the alphabet PRIMES = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101] def hash_word(word): """Takes a word and hashes it s...
mit
adamchalmers/threesomes_web
lib/werkzeug/contrib/jsrouting.py
318
8534
# -*- coding: utf-8 -*- """ werkzeug.contrib.jsrouting ~~~~~~~~~~~~~~~~~~~~~~~~~~ Addon module that allows to create a JavaScript function from a map that generates rules. :copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ ...
apache-2.0
kaarl/pyload
module/plugins/hoster/ExtabitCom.py
5
3260
# -*- coding: utf-8 -*- import re from module.plugins.internal.misc import json from module.plugins.captcha.ReCaptcha import ReCaptcha from module.plugins.internal.SimpleHoster import SimpleHoster from module.plugins.internal.misc import seconds_to_midnight class ExtabitCom(SimpleHoster): __name__ = "Extabi...
gpl-3.0
ysasaki6023/NeuralNetworkStudy
data_cifar10/ZCAtest.py
1
1068
import numpy as np import cPickle as pickle def Preprocess(x,MeanSubtraction=True,ZCA=True): print "Pre-processing ..." Params = {} if MeanSubtraction or ZCA: print "Mean subtraction" mean = np.mean(x,axis=0) std = np.std(x,axis=0) x -= mean x /= std Par...
mit
breenmachine/clusterd
src/platform/jboss/undeployer.py
1
2229
from src.platform.jboss.authenticate import checkAuth from src.platform.jboss.interfaces import JINTERFACES from collections import OrderedDict from log import LOG from re import findall import utility titles = [JINTERFACES.JMX] def undeploy(fingerengine, fingerprint): """ """ if fingerprint.title is JINT...
mit
cloud9ers/gurumate
environment/lib/python2.7/site-packages/IPython/zmq/serialize.py
3
5830
"""serialization utilities for apply messages Authors: * Min RK """ #----------------------------------------------------------------------------- # Copyright (C) 2010-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as p...
lgpl-3.0
vDorst/linux
Documentation/networking/cxacru-cf.py
14668
1626
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # 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 i...
gpl-2.0
ammaradil/fibonacci
Lib/site-packages/gunicorn/util.py
19
15723
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. from __future__ import print_function import email.utils import fcntl import grp import io import os import pkg_resources import pwd import random import resource import socket import stat im...
mit
miconof/headphones
lib/requests/packages/chardet/langhungarianmodel.py
2763
12536
######################## 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
LeagueForHacker/Python-Prototypes-Demo
model/sms_spam_detection.py
1
9268
# -*- coding: UTF-8 -*- """ Description: SMS Spam Detection Author: Wallace Huang Date: 2019/7/22 Version: 1.0 """ import os import re import string from collections import Counter import nltk import pandas as pd from nltk.corpus import stopwords from scipy.sparse import csr_matrix from sklearn.base import BaseEstimat...
gpl-2.0
BitWriters/Zenith_project
zango/lib/python3.5/site-packages/django/test/signals.py
99
5931
import os import threading import time import warnings from django.conf import settings from django.core.signals import setting_changed from django.db import connections, router from django.db.utils import ConnectionRouter from django.dispatch import Signal, receiver from django.utils import timezone from django.utils...
mit
Beeko/android_kernel_htc_msm8960
tools/perf/scripts/python/net_dropmonitor.py
1258
1562
# Monitor the system for dropped packets and proudce a report of drop locations and counts import os import sys sys.path.append(os.environ['PERF_EXEC_PATH'] + \ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') from perf_trace_context import * from Core import * from Util import * drop_log = {} kallsyms = [] def...
gpl-2.0
sander76/home-assistant
tests/components/kulersky/test_light.py
5
7002
"""Test the Kuler Sky lights.""" from unittest.mock import MagicMock, patch import pykulersky import pytest from homeassistant import setup from homeassistant.components.kulersky.const import ( DATA_ADDRESSES, DATA_DISCOVERY_SUBSCRIPTION, DOMAIN, ) from homeassistant.components.light import ( ATTR_BRI...
apache-2.0
genialis/resolwe
resolwe/flow/tests/test_fields.py
1
3662
# pylint: disable=missing-docstring from django.apps import apps from django.conf import settings from django.core.management import call_command from django.db.utils import DataError from django.test import TestCase, override_settings from resolwe.flow.exceptions import SlugError CUSTOM_SETTINGS = { "INSTALLED_A...
apache-2.0
iuliat/nova
nova/tests/unit/api/openstack/compute/test_server_actions.py
13
53127
# 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
depp/sglib
test/mixer_time/test.py
1
3155
#!/usr/bin/env python3 # Copyright 2014 Dietrich Epp. # This file is part of SGLib. SGLib is licensed under the terms of the # 2-clause BSD license. For more information, see LICENSE.txt. """Test for mixer timing. We feed the mixer some data with random delays, and check that the predicted delay matches the expected...
bsd-2-clause
zidootech/zidoo-kodi-14.2
lib/gtest/xcode/Scripts/versiongenerate.py
3088
4536
#!/usr/bin/env python # # Copyright 2008, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
gpl-2.0
rghe/ansible
lib/ansible/modules/storage/infinidat/infini_export.py
70
5122
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Gregory Shulov (gregory.shulov@gmail.com) # 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': '...
gpl-3.0
sekikn/incubator-airflow
tests/providers/google/cloud/hooks/test_cloud_sql.py
7
58957
# # 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...
apache-2.0
vigilv/scikit-learn
sklearn/covariance/__init__.py
389
1157
""" The :mod:`sklearn.covariance` module includes methods and algorithms to robustly estimate the covariance of features given a set of points. The precision matrix defined as the inverse of the covariance is also estimated. Covariance estimation is closely related to the theory of Gaussian Graphical Models. """ from ...
bsd-3-clause
theoryno3/gensim
gensim/matutils.py
3
26115
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2011 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ This module contains math helper functions. """ from __future__ import with_statement import logging import math from gensim imp...
gpl-3.0
SwagColoredKitteh/servo
tests/wpt/css-tests/css-fonts-3_dev/xhtml1print/reference/support/fonts/makegsubfonts.py
1616
14125
import os import textwrap from xml.etree import ElementTree from fontTools.ttLib import TTFont, newTable from fontTools.misc.psCharStrings import T2CharString from fontTools.ttLib.tables.otTables import GSUB,\ ScriptList, ScriptRecord, Script, DefaultLangSys,\ FeatureList, FeatureRecord, Feature,\ LookupLi...
mpl-2.0
FrancescoRizzi/AWSomesauce
articles/BAS4-pws/libs-for-aws/cryptography/hazmat/primitives/kdf/hkdf.py
21
3674
# 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 six from cryptography import utils from cryptography.exceptions i...
mit
ack8006/Python-mode-klen
pymode/libs3/rope/base/pynamesdef.py
112
1719
import rope.base.oi.soi from rope.base import pynames from rope.base.pynames import * class AssignedName(pynames.AssignedName): def __init__(self, lineno=None, module=None, pyobject=None): self.lineno = lineno self.module = module self.assignments = [] self.pyobject = _Inferred(se...
lgpl-3.0
craigderington/studentloan5
studentloan5/Lib/types.py
97
5360
""" Define names for built-in types that aren't directly accessible as a builtin. """ import sys # Iterators in Python aren't a matter of type but of protocol. A large # and changing number of builtin types implement *some* flavor of # iterator. Don't check the type! Use hasattr to check for both # "__iter__" and "...
bsd-3-clause
zstackio/zstack-woodpecker
integrationtest/vm/monitor/alert_vm_all_cpus_util.py
2
2860
''' Test about monitor trigger on all vm cpu use ratio in one minute @author: Songtao,Haochen ''' import os import test_stub import random import zstacklib.utils.ssh as ssh import zstackwoodpecker.test_util as test_util import zstackwoodpecker.operations.resource_operations as res_ops import zstackwoo...
apache-2.0
violep01/fMBT
utils/fmbtuinput.py
9
42108
# fMBT, free Model Based Testing tool # Copyright (c) 2013, Intel Corporation. # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU Lesser General Public License, # version 2.1, as published by the Free Software Foundation. # # This program is distribut...
lgpl-2.1
miguelinux/ejemplos-opencv
python/ocv4/common.py
3
6679
#!/usr/bin/env python ''' This module contains some common routines used by other samples. ''' # Python 2/3 compatibility from __future__ import print_function import sys PY3 = sys.version_info[0] == 3 if PY3: from functools import reduce import numpy as np import cv2 as cv # built-in modules import os import ...
bsd-3-clause
Qalthos/ansible
lib/ansible/modules/cloud/google/gcp_compute_target_pool_facts.py
9
8545
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
yanheven/cinder
cinder/volume/targets/driver.py
41
2224
# 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
Cofyc/dnscrypt-wrapper
tests/dnscrypt-fuzzer.py
1
7804
#!/usr/bin/env python """ Requirements: * https://github.com/openalias/dnscrypt-python * https://github.com/warner/python-pure25519/blob/master/misc/djbec.py * a query file of the form `qname\tqtype`. Example query file https://nominum.com/measurement-tools/ Example usage: python dnscrypt-fuzzer.py \ --provider-...
gpl-2.0
bkochendorfer/reviewboard
reviewboard/hostingsvcs/rbgateway.py
7
10560
from __future__ import unicode_literals import json import logging from django import forms from django.utils import six from django.utils.six.moves.urllib.error import HTTPError, URLError from django.utils.translation import ugettext_lazy as _, ugettext from reviewboard.hostingsvcs.errors import (AuthorizationError...
mit
lucafavatella/intellij-community
python/helpers/pydev/pydevd_attach_to_process/winappdbg/__init__.py
102
7917
#!~/.wine/drive_c/Python25/python.exe # -*- coding: utf-8 -*- # Copyright (c) 2009-2014, Mario Vilas # 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 ...
apache-2.0
Antiun/account-financial-tools
account_asset_management/__init__.py
35
1370
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>). # Copyright (c) 2014 Noviat nv/sa (ww...
agpl-3.0
klunwebale/odoo
addons/survey/__init__.py
385
1037
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms...
agpl-3.0
LantaoJin/spark
external/kinesis-asl/src/main/python/examples/streaming/kinesis_wordcount_asl.py
42
3550
# # 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
kkdd/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/pythonwin/pywin/scintilla/bindings.py
18
5572
import IDLEenvironment import string import win32ui import win32api import win32con import keycodes import sys HANDLER_ARGS_GUESS=0 HANDLER_ARGS_NATIVE=1 HANDLER_ARGS_IDLE=2 HANDLER_ARGS_EXTENSION=3 next_id = 5000 event_to_commands = {}# dict of integer IDs to event names. command_to_events = {}# dict of event names...
apache-2.0
cryptobanana/ansible
lib/ansible/modules/cloud/cloudstack/cs_service_offering.py
24
17072
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2017, René Moser <mail@renemoser.net> # 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
aronsky/home-assistant
homeassistant/components/notify/slack.py
3
6148
""" Slack platform for notify component. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/notify.slack/ """ import logging import requests from requests.auth import HTTPBasicAuth from requests.auth import HTTPDigestAuth import voluptuous as vol import ho...
apache-2.0
jlowin/airflow
tests/www/api/experimental/test_kerberos_endpoints.py
44
3495
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
angelman/phantomjs
src/breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/internal/wire_format_test.py
571
10848
#! /usr/bin/python # # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # ...
bsd-3-clause
Keidan/gtkhex
modules/UndoRedoBuffer.py
1
8377
################################################################################### # @file UndoRedoBuffer.py # @author Keidan # @date 01/04/2014 # @par Project # gtkhex # @par Copyright # Copyright 2014 Keidan, all right reserved # This software is distributed in the hope that it will be useful, but WITHOUT # ANY WARR...
gpl-3.0
zaqwes8811/matlab_ext
code-miners/projects/prepro/src_2/hided/mFu.py
3
2181
#-*- coding: utf-8 -*- def mRETURN( args ): i = str( args[0] ) return '\n \ return' def mSlideTo( args ): Link = args[0] i = str( args[1] ) return '\n \ goto '+Link+'' def mCall( args ): link = args[0] i = str( args[1] ) return '\n \ call '+link+'' def mObject_end( args ): klass = args[0] i = str( args...
apache-2.0
jmeppley/py-metagenomics
databases/buildRefSeqAccToTaxidMap.py
1
3280
#!/usr/bin/env python """ Read RefSeq catalog from stdin: get taxid, name, accession from first three columns Read taxonomy from taxdump dir For each RefSeq entry that is a protein and is not (in)vertebrate: if taxid not in taxonomy: use name to find updated taxid print accesion (without suffix) and...
mit
Changaco/oh-mainline
vendor/packages/twisted/twisted/python/_inotify.py
18
2825
# -*- test-case-name: twisted.internet.test.test_inotify -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Very low-level ctypes-based interface to Linux inotify(7). ctypes and a version of libc which supports inotify system calls are required. """ import ctypes import ctypes.util cl...
agpl-3.0