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 |
|---|---|---|---|---|---|
adhoc-dev/odoo-addons | account_partner_balance/account_move_line.py | 7 | 1368 | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
import time
from datetime import datetime
from ... | agpl-3.0 |
ericzundel/pants | src/python/pants/build_graph/build_file_parser.py | 10 | 7129 | # coding=utf-8
# Copyright 2014 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 logging
impor... | apache-2.0 |
mahak/cinder | cinder/quota.py | 2 | 40059 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | apache-2.0 |
Besler/ITKGraphCutSegmentation | lib/gtest-1.7.0/test/gtest_help_test.py | 2968 | 5856 | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | gpl-3.0 |
pli3/enigma2-pli | lib/python/Screens/LocationBox.py | 10 | 16275 | #
# Generic Screen to select a path/filename combination
#
# GUI (Screens)
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Screens.InputBox import InputBox
from Screens.HelpMenu import HelpableScreen
from Screens.ChoiceBox import ChoiceBox
# Generic
from Tools.BoundFunction import bou... | gpl-2.0 |
mclaughlin6464/pylearn2 | pylearn2/models/kmeans.py | 44 | 7901 | """K-means as a postprocessing Block subclass."""
import logging
import numpy
from theano.compat.six.moves import xrange
from pylearn2.blocks import Block
from pylearn2.models.model import Model
from pylearn2.space import VectorSpace
from pylearn2.utils import sharedX
from pylearn2.utils.mem import improve_memory_erro... | bsd-3-clause |
dondamage/SPyTS | tmp/TsPacket.py | 1 | 2806 | import TsPacketError
class TsPacket(object):
"""
A wrapper class to represent an MPEG2-TS packet.
"""
TS_PKT_LEN_188 = 188
TS_PKT_LEN_204 = 204
def __init__(self, pkt):
if isinstance(pkt, bytes):
if len(pkt) in (TsPacket.TS_PKT_LEN_188, TsPacket.TS_PKT_LEN_204):
self._content = pkt
... | gpl-2.0 |
wfxiang08/django185 | django/contrib/gis/db/backends/spatialite/base.py | 82 | 3705 | import sys
from ctypes.util import find_library
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.backends.sqlite3.base import (
Database, DatabaseWrapper as SQLiteDatabaseWrapper, SQLiteCursorWrapper,
)
from django.utils import six
from .client import SpatiaL... | bsd-3-clause |
marcore/edx-platform | scripts/run_watch_data.py | 182 | 1672 | #! /usr/bin/env python
# This script requires that you have watchdog installed. You can install
# watchdog via 'pip install watchdog'
import sys
import time
import logging
import os
from subprocess import Popen
from signal import SIGTERM
from watchdog.observers import Observer
from watchdog.events import LoggingEvent... | agpl-3.0 |
tomlof/scikit-learn | examples/manifold/plot_lle_digits.py | 138 | 8594 | """
=============================================================================
Manifold learning on handwritten digits: Locally Linear Embedding, Isomap...
=============================================================================
An illustration of various embeddings on the digits dataset.
The RandomTreesEmbed... | bsd-3-clause |
craigcitro/pydatalab | solutionbox/code_free_ml/test_mltoolbox/test_transform.py | 2 | 8503 | from __future__ import absolute_import
from __future__ import print_function
import json
import os
import pandas as pd
from PIL import Image
import shutil
from six.moves.urllib.request import urlopen
import subprocess
import tempfile
import unittest
import uuid
import tensorflow as tf
from tensorflow.python.lib.io im... | apache-2.0 |
ondra-novak/chromium.src | tools/perf/record_android_profile.py | 42 | 1209 | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
import tempfile
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, 'telemetry'))
from telemetry.... | bsd-3-clause |
IronLanguages/ironpython3 | Src/StdLib/Lib/encodings/ptcp154.py | 219 | 14015 | """ Python Character Mapping Codec generated from 'PTCP154.txt' with gencodec.py.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
(c) Copyright 2000 Guido van Rossum.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,err... | apache-2.0 |
WilliamDASILVA/TheMysteryOfSchweitzer | interfaces/DialogInterface.py | 1 | 1998 | from engine import Global;
from engine.Interface import Interface;
from engine.render.image import Image;
from engine.render.text import Text;
from engine.render.sprite import Sprite;
# --------------------------------------------------- *\
# [class] DialogInterface()
#
# * The dialog interface *
#
# --------------... | mit |
kvar/ansible | lib/ansible/modules/cloud/azure/azure_rm_cdnendpoint.py | 19 | 24815 | #!/usr/bin/python
#
# Copyright (c) 2018 Hai Cao, <t-haicao@microsoft.com>, Yunge Zhu <yungez@microsoft.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 = {'metadat... | gpl-3.0 |
isandlaTech/cohorte-devtools | qualifier/deploy/cohorte-home/repo/sleekxmpp/plugins/xep_0153/vcard_avatar.py | 11 | 5444 | """
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2012 Nathanael C. Fritz, Lance J.T. Stout
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
"""
import hashlib
import logging
import threading
from sleekxmpp.stanza import Presence
from sleekxmpp.exceptions import XMPPErro... | apache-2.0 |
watchdogpolska/poradnia.siecobywatelska.pl | poradnia/judgements/parsers/gliwice.py | 3 | 2046 | import requests
from lxml import html
from poradnia.judgements.models import SessionRow
from poradnia.judgements.parsers.base import BaseParser
from poradnia.judgements.registry import register_parser
@register_parser("WSA_Gliwice")
class GliwiceETRParser(BaseParser):
URL = "http://www.gliwice.wsa.gov.pl/56/49/e... | bsd-3-clause |
madscatt/sasmol | src/python/test_sasmol/test_sassubset/test_intg_sassubset_Mask_get_dihedral_subset_mask.py | 1 | 15098 | '''
SASMOL: Copyright (C) 2011 Joseph E. Curtis, Ph.D.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
... | gpl-3.0 |
Grarak/grakernel-n1 | 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 |
Quikling/gpdb | gpMgmt/sbin/gppersistent_backup.py | 24 | 5738 | #!/usr/bin/env python
#
# Copyright (c) Pivotal Inc 2014. All Rights Reserved.
"""
Internal Use Function.
"""
from gppylib.mainUtils import simple_main, addStandardLoggingAndHelpOptions, addMasterDirectoryOptionForSingleClusterProgram
import base64
import os
import pickle
from gppylib import gplog
from gppylib.oper... | apache-2.0 |
barjacks/pythonrecherche | 07 Selenium, more beautifulsoup/zh_wie_neu.py | 1 | 1387 |
# coding: utf-8
from bs4 import BeautifulSoup
import pandas as pd
import requests
import time
import progressbar
bar = progressbar.ProgressBar()
lst = []
lst_pass = []
for elem,i in zip(range(1697,13000), bar((range(1697,13000)))):
url = "https://www.zueriwieneu.ch/report/" + str(elem)
response = requests.... | mit |
Hubert51/AutoGrading | learning/web_Haotian/venv/Lib/site-packages/click/_unicodefun.py | 136 | 4204 | import os
import sys
import codecs
from ._compat import PY2
# If someone wants to vendor click, we want to ensure the
# correct package is discovered. Ideally we could use a
# relative import here but unfortunately Python does not
# support that.
click = sys.modules[__name__.rsplit('.', 1)[0]]
def _find_unicode_l... | mit |
mosbasik/buzhug | javasrc/lib/Jython/Lib/test/test_profilehooks.py | 9 | 11894 | # see test_trace.py for the reasoning behind why we need to disable so
# many of these tests; in general we need to come up with a more
# stable mechanism for this that's not so dependent on our compilation
# process, but that is tough. Regardless, we want some testing of this
# functionality, so this will have to suff... | bsd-3-clause |
caisq/tensorflow | tensorflow/contrib/saved_model/python/saved_model/reader_test.py | 32 | 4761 | # 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 |
elmerdpadilla/iv | addons/hr_timesheet/hr_timesheet.py | 291 | 10253 | # -*- 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 |
TheTimmy/spack | var/spack/repos/builtin/packages/doxygen/package.py | 3 | 2298 | ##############################################################################
# Copyright (c) 2013-2017, 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 |
agat63/S3_MPCS_JB | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... | gpl-2.0 |
nirmeshk/oh-mainline | vendor/packages/twisted/twisted/mail/maildir.py | 26 | 15413 | # -*- test-case-name: twisted.mail.test.test_mail -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Maildir-style mailbox support
"""
import os
import stat
import socket
from zope.interface import implements
try:
import cStringIO as StringIO
except ImportError:
import StringIO... | agpl-3.0 |
sjmh/cobbler | cobbler/modules/authn_configfile.py | 14 | 2304 | """
Authentication module that uses /etc/cobbler/auth.conf
Choice of authentication module is in /etc/cobbler/modules.conf
Copyright 2007-2009, Red Hat, Inc and Others
Michael DeHaan <michael.dehaan AT gmail>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Pu... | gpl-2.0 |
ActiveState/code | recipes/Python/223610_Yet_another_way_use_fields/recipe-223610.py | 1 | 2458 | import types
class FieldNameError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return `"""Field name '%s' does not exist""" % self.value`
class fRow(tuple):
# class for each row
def __getattr__(self,i):
return tuple.__getitem__(self,self.__Field2Index__(i))
d... | mit |
geduldig/TweetBase | TweetBase/TweetCouch.py | 1 | 5890 | import couchdb
from couchdb.design import ViewDefinition
class TweetCouch(object):
def __init__(self, dbname, url=None):
try:
self.server = couchdb.Server(url=url)
self.db = self.server.create(dbname)
self._create_views()
except couchdb.http.PreconditionFailed:
self.db = self.server[dbname]
def _cr... | mit |
Icecoin/Icecoin | share/qt/make_spinner.py | 4415 | 1035 | #!/usr/bin/env python
# W.J. van der Laan, 2011
# Make spinning .mng animation from a .png
# Requires imagemagick 6.7+
from __future__ import division
from os import path
from PIL import Image
from subprocess import Popen
SRC='img/reload_scaled.png'
DST='../../src/qt/res/movies/update_spinner.mng'
TMPDIR='/tmp'
TMPNAM... | mit |
mne-tools/mne-tools.github.io | 0.21/_downloads/33b5e3cff5c172d72c79c6eec192b031/plot_label_from_stc.py | 20 | 4093 | """
=================================================
Generate a functional label from source estimates
=================================================
Threshold source estimates and produce a functional label. The label
is typically the region of interest that contains high values.
Here we compare the average time ... | bsd-3-clause |
coastmap/geonode | geonode/social/signals.py | 26 | 9292 | #########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... | gpl-3.0 |
eneldoserrata/marcos_openerp | addons/stock_invoice_directly/wizard/__init__.py | 68 | 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... | agpl-3.0 |
itucsdb1612/itucsdb1612 | Authors.py | 1 | 3560 | import psycopg2 as dbapi2
class Author:
def __init__(self,id, name, lastname, birthdate, nationality, penname,description,picture):
self.id= id
self.name= name
self.lastname=lastname
self.birthdate=birthdate
self.nationality=nationality
self.penname = penname
... | gpl-3.0 |
amaozhao/basecms | easy_thumbnails/namers.py | 8 | 2150 | from __future__ import unicode_literals
import base64
import hashlib
import os
def default(thumbnailer, prepared_options, source_filename,
thumbnail_extension, **kwargs):
"""
Easy-thumbnails' default name processor.
For example: ``source.jpg.100x100_q80_crop_upscale.jpg``
"""
filename... | mit |
glouppe/scikit-learn | sklearn/manifold/isomap.py | 229 | 7169 | """Isomap for manifold learning"""
# Author: Jake Vanderplas -- <vanderplas@astro.washington.edu>
# License: BSD 3 clause (C) 2011
import numpy as np
from ..base import BaseEstimator, TransformerMixin
from ..neighbors import NearestNeighbors, kneighbors_graph
from ..utils import check_array
from ..utils.graph import... | bsd-3-clause |
sudheesh001/oh-mainline | vendor/packages/Django/tests/regressiontests/handlers/tests.py | 44 | 2221 | from django.core.handlers.wsgi import WSGIHandler
from django.core import signals
from django.test import RequestFactory, TestCase
from django.test.utils import override_settings
from django.utils import six
class HandlerTests(TestCase):
# Mangle settings so the handler will fail
@override_settings(MIDDLEWAR... | agpl-3.0 |
mrquim/mrquimrepo | plugin.video.salts/js2py/legecy_translators/jsparser.py | 54 | 9809 | """
The process of translating JS will go like that: # TOP = 'imports and scope set'
1. Remove all the comments
2. Replace number, string and regexp literals with markers
4. Remove global Functions and move their translation to the TOP. Also add register code there.
5. Replace inline functions with lvals
6. Rem... | gpl-2.0 |
dana-i2cat/felix | msjp/module/common/util.py | 2 | 2322 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import logging.handlers
from xml.etree import ElementTree
from xml.dom import minidom
from gevent.coros import BoundedSemaphore
# constants
LOG_SIZE = 5242880 # 5MB
LOG_BACKUPS = 5
# gevent lock for DB.
semaphore_md = BoundedSemaphore()
semaphore_tpl = Bound... | apache-2.0 |
TouK/vumi | vumi/reconnecting_client.py | 3 | 7591 | # -*- coding: utf-8 -*-
# -*- test-case-name: vumi.tests.test_reconnecting_client -*-
"""A service to provide the functionality of ReconnectingClientFactory
when using Twisted's endpoints.
Melded together from code and ideas from:
* Twisted's existing ReconnectingClientFactory code.
* https://github.com/... | bsd-3-clause |
evensonbryan/yocto-autobuilder | lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/web/test/test_cgi.py | 18 | 8297 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.web.twcgi}.
"""
import sys, os
from twisted.trial import unittest
from twisted.internet import reactor, interfaces, error
from twisted.python import util, failure
from twisted.web.http import NOT_FOUND, INTERNAL_SERVER_ER... | gpl-2.0 |
Shihta/python-novaclient | novaclient/tests/v1_1/test_aggregates.py | 4 | 5744 | # 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 |
rplevka/robottelo | robottelo/cli/discoveredhost.py | 3 | 1210 | """
Usage::
hammer discovery [OPTIONS] SUBCOMMAND [ARG] ...
Parameters::
SUBCOMMAND subcommand
[ARG] ... subcommand arguments
Subcommands::
auto-provision Auto provision a host
delete Delete a discovered host
facts... | gpl-3.0 |
bkj/ernest | scrape/modules/http_handler.py | 2 | 2619 | #!/usr/bin/env python2.7
import io
import logging
import requests
import zipfile
class HTTP_HANDLER:
def __init__(self, parent_logger):
self.logger = logging.getLogger(parent_logger + '.http_handler')
self.user_agent = "Mozilla/5.0 (X11; Linux x86_64) \
AppleWebKit/537.36 (KHTML, like... | apache-2.0 |
Health123/ansible | lib/ansible/playbook/handler.py | 237 | 1957 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
yokiwhh/bookLab7 | bookapp/models.py | 1 | 1024 | from django.db import models
from django.contrib import admin
# Create your models here.
# -*- coding: utf-8 -*-
def decode(info):
return info.decode('utf-8')
class Book(models.Model):
class Meta:
verbose_name = 'book'
verbose_name_plural = verbose_name
ISBN = models.CharField('ISBN',max_l... | mit |
mohitsethi/jenkins-job-builder | jenkins_jobs/modules/scm.py | 3 | 41658 | # Copyright 2012 Hewlett-Packard Development Company, L.P.
#
# 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 |
ledtvavs/repository.ledtv | script.module.liveresolver/lib/liveresolver/resolvers/hdcastinfo.py | 11 | 1873 | # -*- coding: utf-8 -*-
import re,urlparse,urllib
from liveresolver.modules import client,constants
from liveresolver.modules.log_utils import log
def resolve(url):
try:
try:
referer = urlparse.parse_qs(urlparse.urlparse(url).query)['referer'][0]
url = url.replace('&referer=%s'%r... | gpl-3.0 |
glgerard/cloud-mdbn | src/batch_run.py | 1 | 2210 | from __future__ import print_function
import logging
import sys
import traceback
from datetime import datetime
from time import sleep
import requests
from utils import run_completed
from csv_to_config import csvToConfig
from utils import get_dyndb_table
host = 'taurus'
port = 5000
# Local DynamoDB instance
dynamod... | apache-2.0 |
thaim/ansible | test/units/modules/network/fortios/test_fortios_system_password_policy_guest_admin.py | 21 | 8660 | # Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... | mit |
ryfeus/lambda-packs | Spacy/source2.7/numpy/f2py/common_rules.py | 176 | 5030 | #!/usr/bin/env python
"""
Build common block mechanism for f2py2e.
Copyright 2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
$Date: ... | mit |
kyoshino/bedrock | bedrock/firefox/tests/test_helpers.py | 1 | 17144 | from urlparse import parse_qs, urlparse
from django.conf import settings
from django.test.client import RequestFactory
from django_jinja.backend import Jinja2
from pyquery import PyQuery as pq
from product_details import product_details
from bedrock.mozorg.tests import TestCase
jinja_env = Jinja2.get_default()
de... | mpl-2.0 |
mgogoulos/libcloud | libcloud/test/loadbalancer/test_gce.py | 18 | 8925 | # 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 |
yvaucher/bank-payment | account_payment_partner/wizard/payment_order_create.py | 2 | 1585 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Account Payment Partner module for OpenERP
# Copyright (C) 2014 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can... | agpl-3.0 |
pandeyadarsh/sympy | sympy/core/evalf.py | 33 | 48853 | """
Adaptive numerical evaluation of SymPy expressions, using mpmath
for mathematical functions.
"""
from __future__ import print_function, division
import math
import mpmath.libmp as libmp
from mpmath import (
make_mpc, make_mpf, mp, mpc, mpf, nsum, quadts, quadosc, workprec)
from mpmath import inf as mpmath_inf... | bsd-3-clause |
philsch/ansible | lib/ansible/plugins/action/template.py | 3 | 9924 | # (c) 2015, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | gpl-3.0 |
vladimirdolzhenko/gflogger | scripts/calc-report.py | 1 | 5526 | #!/usr/bin/python
import sys;
def sortedKeys(dict):
keys = dict.keys()
keys.sort()
return keys
if __name__ == '__main__':
i = 0
width = 1200
height = 600
reader = open(sys.argv[1], "r")
jsname = '%s.js' % sys.argv[1]
jswriter = open(jsname, "w")
htmlwriter = open(sys.argv[1] + '.html', "w")
charts = ... | apache-2.0 |
developerinlondon/ansible-modules-core | cloud/rackspace/rax.py | 133 | 32841 | #!/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 |
d3trax/asuswrt-merlin | release/src/router/samba-3.5.8/lib/subunit/python/subunit/tests/__init__.py | 23 | 1043 | #
# subunit: extensions to python unittest to get test results from subprocesses.
# Copyright (C) 2005 Robert Collins <robertc@robertcollins.net>
#
# 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 Foun... | gpl-2.0 |
airbnb/caravel | superset/common/query_context.py | 1 | 1786 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
freeman-lab/dask | dask/tests/test_core.py | 7 | 3541 | from dask.utils import raises
from dask.core import (istask, get, get_dependencies, flatten, subs,
preorder_traversal)
def contains(a, b):
"""
>>> contains({'x': 1, 'y': 2}, {'x': 1})
True
>>> contains({'x': 1, 'y': 2}, {'z': 3})
False
"""
return all(a.get(k) == v for k, v in b.it... | bsd-3-clause |
caphrim007/ansible-modules-extras | cloud/vmware/vmware_migrate_vmk.py | 45 | 7311 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Joseph Callen <jcallen () csc.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | gpl-3.0 |
sunzhxjs/JobGIS | lib/python2.7/site-packages/numpy/distutils/fcompiler/lahey.py | 229 | 1438 | from __future__ import division, absolute_import, print_function
import os
from numpy.distutils.fcompiler import FCompiler
compilers = ['LaheyFCompiler']
class LaheyFCompiler(FCompiler):
compiler_type = 'lahey'
description = 'Lahey/Fujitsu Fortran 95 Compiler'
version_pattern = r'Lahey/Fujitsu Fortran... | mit |
jtraver/dev | python/hex/hex2.py | 1 | 1148 | #!/usr/bin/python
def main():
# hex1()
hex2()
def hex1():
# ba1 = bytearray.fromhex("0x69")
ba1 = bytearray.fromhex("69")
print "ba1 = %s" % str(ba1)
def hex2():
strings = []
strings.append("asclient.connection.recv 1037 BYTE = 0x21 33 '!'")
strings.append("asclient.connection.recv 10... | mit |
LinuxEmbed/LinuxEmbed-RPI-Linux | tools/perf/util/setup.py | 2079 | 1438 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... | gpl-2.0 |
ehsanirani/slides_postdoc_interview | node_modules/grunt-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py | 1284 | 100329 | # Copyright (c) 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.
import collections
import copy
import hashlib
import json
import multiprocessing
import os.path
import re
import signal
import subprocess
import sys
import gyp
imp... | mit |
latticelabs/Mitty | mitty/benchmarking/misalignment_plot.py | 1 | 9184 | """Prepare a binned matrix of misalignments and plot it in different ways"""
import click
import pysam
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.path import Path
import matplotlib.patches as patches
from matplotlib.colors import LogNorm
import numpy as np
def we_have_too... | gpl-2.0 |
ian-garrett/meetMe | env/lib/python3.4/site-packages/nose/suite.py | 9 | 22405 | """
Test Suites
-----------
Provides a LazySuite, which is a suite whose test list is a generator
function, and ContextSuite,which can run fixtures (setup/teardown
functions or methods) for the context that contains its tests.
"""
import logging
import sys
import unittest
from nose.case import Test
from nose.config... | artistic-2.0 |
jart/tensorflow | tensorflow/python/ops/losses/losses.py | 61 | 1102 | # 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 |
idf/scipy_util | scipy_util/image/color_kmeans.py | 1 | 2314 | # USAGE
# python color_kmeans.py --image images/jp.png --clusters 3
# Author: Adrian Rosebrock
# Website: www.pyimagesearch.com
# import the necessary packages
from sklearn.cluster import KMeans
import matplotlib.pyplot as plt
import numpy as np
import argparse
import cv2
def centroid_histogram(clt):
# grab the... | bsd-3-clause |
kvar/ansible | lib/ansible/modules/network/a10/a10_virtual_server.py | 34 | 11180 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Mischa Peters <mpeters@a10networks.com>,
# Eric Chou <ericc@a10networks.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__ = t... | gpl-3.0 |
andrebellafronte/stoq | stoqlib/lib/pgpass.py | 2 | 2417 | # -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
##
## Copyright (C) 2014 Async Open Source <http://www.async.com.br>
## All rights reserved
##
## This program 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 F... | gpl-2.0 |
oliciv/youtube-dl | test/test_youtube_signature.py | 134 | 4024 | #!/usr/bin/env python
from __future__ import unicode_literals
# Allow direct execution
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import io
import re
import string
from test.helper import FakeYDL
from youtube_dl.extractor import YoutubeIE
fro... | unlicense |
amigocloud/amigocloud_samples | python/recordhistory.py | 1 | 3281 | # Script to query record_history across all AmigoCloud projects and export results to a CSV
# Must have AmigoCloud Account
# All projects must have a record_history dataset (no projects older than 2017)
from amigocloud import AmigoCloud
import csv
# AmigoCloud variables - change based on user
# token found at ap... | mit |
bugsduggan/locust | locust/stats.py | 1 | 26840 | import hashlib
import time
from collections import namedtuple, OrderedDict
from copy import copy
from itertools import chain
import gevent
import six
from six.moves import xrange
from . import events
from .exception import StopLocust
from .log import console_logger
STATS_NAME_WIDTH = 60
"""Default interval for how ... | mit |
kzvyahin/cfme_tests | cfme/tests/services/test_orchestration_template.py | 1 | 4984 | # -*- coding: utf-8 -*-
import fauxfactory
import pytest
from cfme.services.catalogs.orchestration_template import OrchestrationTemplate
from utils import testgen, error
from utils.update import update
from cfme.web_ui import mixins
from cfme.fixtures import pytest_selenium as sel
from cfme import test_requirements
p... | gpl-2.0 |
xkmato/youtube-dl | youtube_dl/aes.py | 114 | 15203 | from __future__ import unicode_literals
import base64
from math import ceil
from .utils import bytes_to_intlist, intlist_to_bytes
BLOCK_SIZE_BYTES = 16
def aes_ctr_decrypt(data, key, counter):
"""
Decrypt with aes in counter mode
@param {int[]} data cipher
@param {int[]} key 16/24/3... | unlicense |
gamahead/nupic | tests/unit/nupic/math/nupic_random_test.py | 12 | 5532 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | gpl-3.0 |
goodwillcoding/RIDE | utest/plugin/test_plugin_api.py | 2 | 1452 | import unittest
from robot.utils.asserts import assert_equals
from robotide.pluginapi import Plugin
from robotide.namespace import Namespace
from robotide.spec.iteminfo import ItemInfo
from robotide.robotapi import TestCaseFile
from robotide.controller.filecontrollers import DataController
from resources import FakeA... | apache-2.0 |
Zentyal/samba | third_party/waf/wafadmin/py3kfixes.py | 32 | 3876 | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2009 (ita)
"""
Fixes for py3k go here
"""
import os
all_modifs = {}
def modif(dir, name, fun):
if name == '*':
lst = []
for y in '. Tools 3rdparty'.split():
for x in os.listdir(os.path.join(dir, y)):
if x.endswith('.py'):
lst.append(y + os.sep ... | gpl-3.0 |
vatsalgit/Deep-Learning- | assignment1/data/deep/lib/python3.4/site-packages/pip/_vendor/html5lib/_utils.py | 329 | 4096 | from __future__ import absolute_import, division, unicode_literals
import sys
from types import ModuleType
from pip._vendor.six import text_type
try:
import xml.etree.cElementTree as default_etree
except ImportError:
import xml.etree.ElementTree as default_etree
__all__ = ["default_etree", "MethodDispatche... | gpl-3.0 |
yoer/hue | desktop/core/ext-py/Django-1.6.10/django/middleware/clickjacking.py | 329 | 1993 | """
Clickjacking Protection Middleware.
This module provides a middleware that implements protection against a
malicious site loading resources from your site in a hidden frame.
"""
from django.conf import settings
class XFrameOptionsMiddleware(object):
"""
Middleware that sets the X-Frame-Options HTTP heade... | apache-2.0 |
robogen/CMS-Mining | RunScripts/es_mainreduce.py | 1 | 20005 | from elasticsearch import Elasticsearch
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
from matplotlib.dates import AutoDateLocator, AutoDateFormatter
import numpy as np
import datetime as dt
import math
import json
with open('sites.json', 'r+') as txt:
sitesArray = json.load(... | mit |
andrius-preimantas/purchase-workflow | vendor_consignment_stock/model/procurement.py | 19 | 2776 | # -*- coding: utf-8 -*-
# Author: Leonardo Pistone
# Copyright 2014 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
# License, or... | agpl-3.0 |
mchiba52/mystocks-angularv2 | node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py | 1812 | 9537 | # Copyright (c) 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.
"""Utility functions shared amongst the Windows generators."""
import copy
import os
# A dictionary mapping supported target types to extensions.
TARGET_TYPE_EX... | apache-2.0 |
vmarkovtsev/django | tests/template_tests/test_library.py | 413 | 3753 | from django.template import Library
from django.template.base import Node
from django.test import TestCase
class FilterRegistrationTests(TestCase):
def setUp(self):
self.library = Library()
def test_filter(self):
@self.library.filter
def func():
return ''
self.ass... | bsd-3-clause |
entropy1337/infernal-twin | Modules/build/pillow/Tests/test_image_split.py | 11 | 2493 | from helper import unittest, PillowTestCase, hopper
from PIL import Image
class TestImageSplit(PillowTestCase):
def test_split(self):
def split(mode):
layers = hopper(mode).split()
return [(i.mode, i.size[0], i.size[1]) for i in layers]
self.assertEqual(split("1"), [('1',... | gpl-3.0 |
pandeyop/tempest | tempest/api/orchestration/stacks/test_resource_types.py | 23 | 2127 | # 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 |
atumanov/ray | python/ray/rllib/optimizers/multi_gpu_optimizer.py | 1 | 9886 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import math
import numpy as np
from collections import defaultdict
import ray
from ray.rllib.evaluation.metrics import LEARNER_STATS_KEY
from ray.rllib.policy.tf_policy import TFPolicy
from ray.... | apache-2.0 |
sarvex/tensorflow | tensorflow/python/keras/engine/base_layer_test.py | 4 | 63530 | # Copyright 2018 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 |
daniel-j-born/grpc | src/python/grpcio/grpc/_server.py | 11 | 30303 | # Copyright 2016 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | apache-2.0 |
jgosmann/psyrun | psyrun/pspace.py | 1 | 9919 | """Construction of parameter spaces."""
import collections
import itertools
from six import string_types
from psyrun.utils.doc import inherit_docs
def dict_concat(args):
"""Concatenates elements with the same key in the passed dictionaries.
Parameters
----------
args : sequenece of dict
Di... | mit |
olgabrani/synnefo | snf-astakos-app/astakos/oa2/migrations/0001_initial.py | 10 | 15918 | # -*- 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 model 'RedirectUrl'
db.create_table('oa2_redirecturl', (
('id', self.gf('django.db.mode... | gpl-3.0 |
dbaxa/django | django/db/models/sql/aggregates.py | 57 | 4842 | """
Classes to represent the default SQL aggregate functions
"""
import copy
import warnings
from django.db.models.fields import FloatField, IntegerField
from django.db.models.lookups import RegisterLookupMixin
from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.functional import cached_pr... | bsd-3-clause |
meteorcloudy/tensorflow | tensorflow/python/data/kernel_tests/list_files_dataset_op_test.py | 12 | 9157 | # 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 |
heamon7/scrapy | scrapy/extensions/spiderstate.py | 134 | 1045 | import os
from six.moves import cPickle as pickle
from scrapy import signals
from scrapy.utils.job import job_dir
class SpiderState(object):
"""Store and load spider state during a scraping job"""
def __init__(self, jobdir=None):
self.jobdir = jobdir
@classmethod
def from_crawler(cls, crawle... | bsd-3-clause |
aurarad/auroracoin | test/functional/mempool_reorg.py | 2 | 4879 | #!/usr/bin/env python3
# Copyright (c) 2009-2019 The Bitcoin Core developers
# Copyright (c) 2014-2019 The DigiByte Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test mempool re-org scenarios.
Test re-org scen... | mit |
ingadhoc/odoo | addons/account/report/account_central_journal.py | 381 | 5417 | # -*- 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.