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 |
|---|---|---|---|---|---|
myrtleTree33/lego-mosaic | quantization.py | 1 | 3006 | import numpy as np
import cv2
import xlwt
import csv
GRID_SPACE = 7
LENGTH = 96
# def base16(n):
# a = np.base_repr(n, 16)
# if len(a) == 1:
# return "0" + a
# else:
# return a
#
# def rgbToHex(r,g,b):
# print "#" + base16(r) + base16(g) + base16(b)
#
# rgbToHex(50,255,0)
### The 48... | gpl-3.0 |
damiencalloway/djtut | mysite/env/lib/python2.7/site-packages/django/template/debug.py | 110 | 3602 | from django.template.base import Lexer, Parser, tag_re, NodeList, VariableNode, TemplateSyntaxError
from django.utils.encoding import force_text
from django.utils.html import escape
from django.utils.safestring import SafeData, EscapeData
from django.utils.formats import localize
from django.utils.timezone import templ... | mit |
spoonysonny/SAKS-tutorials | saks-v1.x/digital-stopwatch/entities/tact.py | 8 | 4911 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015 NXEZ.COM.
# http://www.nxez.com
#
# Licensed under the GNU General Public 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.gnu.org/licen... | gpl-2.0 |
tito/pymt | examples/games/bubblebattle/bubblebattle.py | 2 | 10109 | # PYMT Plugin integration
IS_PYMT_PLUGIN = True
PLUGIN_TITLE = 'Bubble Battle !'
PLUGIN_AUTHOR = 'Mathieu Virbel'
PLUGIN_DESCRIPTION = 'Fight the bubbles !!!!! ]:X'
from pymt import *
from OpenGL.GL import *
from random import random, randint
class Basic(MTWidget):
def __init__(self, **kwargs):
super(Basi... | lgpl-3.0 |
lintzc/gpdb | src/test/tinc/tincrepo/mpp/gpdb/tests/storage/filerep/mpp18932/test_mpp18932.py | 9 | 2376 | """
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
... | apache-2.0 |
rsjohnco/rez | src/rez/cli/view.py | 3 | 2091 | """
View the contents of a package.
"""
def setup_parser(parser, completions=False):
formats = ("py", "yaml")
parser.add_argument(
"-f", "--format", default="yaml", choices=formats,
help="format to print the package in")
parser.add_argument(
"-a", "--all", action="store_true",
... | gpl-3.0 |
Elandril/SickRage | tornado/test/curl_httpclient_test.py | 39 | 4486 | from __future__ import absolute_import, division, print_function, with_statement
from hashlib import md5
from tornado.escape import utf8
from tornado.httpclient import HTTPRequest
from tornado.stack_context import ExceptionStackContext
from tornado.testing import AsyncHTTPTestCase
from tornado.test import httpclient_... | gpl-3.0 |
jrmanrique/ekalay-finance | finance/functions.py | 1 | 8287 | from calendar import monthrange
from datetime import date, datetime
from decimal import *
from django.contrib.auth.models import Group
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Sum
from . import forms
from .models import AccountTypes, CashInflow, CashOutflow, ChartOfAccounts
... | mit |
aselle/tensorflow | tensorflow/contrib/estimator/python/estimator/early_stopping_test.py | 10 | 8408 | # 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 |
feigames/Odoo | addons/knowledge/__init__.py | 436 | 1064 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 |
Tutakamimearitomomei/Kongcoin | 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 |
ibressler/pyqtgraph | pyqtgraph/WidgetGroup.py | 14 | 10580 | # -*- coding: utf-8 -*-
"""
WidgetGroup.py - WidgetGroup class for easily managing lots of Qt widgets
Copyright 2010 Luke Campagnola
Distributed under MIT/X11 license. See license.txt for more infomation.
This class addresses the problem of having to save and restore the state
of a large group of widgets.
"""
from... | mit |
epssy/hue | desktop/core/ext-py/django-openid-auth-0.5/example_consumer/settings.py | 42 | 5475 | # django-openid-auth - OpenID integration for django.contrib.auth
#
# Copyright (C) 2007 Simon Willison
# Copyright (C) 2008-2013 Canonical Ltd.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions o... | apache-2.0 |
rghe/ansible | lib/ansible/modules/monitoring/grafana_plugin.py | 27 | 7426 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Thierry Sallé (@seuf)
# 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
ANSIBLE_METADATA = {
'status': ['preview'],
'supported_by': 'com... | gpl-3.0 |
HIIT/mediacollection | test/test_seura.py | 1 | 1036 | import sys
import os
import filecmp
import importlib
import datetime
import common
path = os.path.abspath('.')
sys.path.append(path)
domain = 'seura'
url = 'http://seura.fi/puheenaihe/ajankohtaista/vasemmisto-kehuu-kokoomusta-harjoittavat-rehellisesti-politiikkaa-joka-on-ajanut-suomen-lamaan/?shared=43026-ad87bd06-50... | mit |
danielkza/dnf | tests/test_main.py | 17 | 1729 | # Copyright (C) 2014 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be u... | gpl-2.0 |
robcarver17/pysystemtrade | sysdata/production/historic_orders.py | 1 | 4692 |
"""
Historic orders
Orders which are still being executed live in the order stack type; see sysexecution
Note orderID here are different from ones used in order stack (which are temporary)
We store three types of orders: strategy level, contract level and broker level
Use to analyse execution and also construct s... | gpl-3.0 |
naterh/cloud-init-rax-pkg | cloudinit/url_helper.py | 3 | 12910 | # vi: ts=4 expandtab
#
# Copyright (C) 2012 Canonical Ltd.
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
# Copyright (C) 2012 Yahoo! Inc.
#
# Author: Scott Moser <scott.moser@canonical.com>
# Author: Juerg Haefliger <juerg.haefliger@hp.com>
# Author: Joshua Harlow <harlowja@yahoo-inc.... | gpl-3.0 |
zentol/flink | flink-python/pyflink/table/__init__.py | 4 | 4723 | ################################################################################
# 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... | apache-2.0 |
ClearCorp-dev/management-system | mgmtsystem/__openerp__.py | 1 | 1845 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or modify
# it und... | agpl-3.0 |
0x776b7364/kali-scripts | page-enum.py | 2 | 1620 | #!/usr/bin/env python
import requests
from random import randint
from time import sleep
from bs4 import BeautifulSoup
from PIL import Image
from StringIO import StringIO
import mimetypes
import subprocess
USER_AGENT = "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0"
INITIAL_URL = "https:... | mit |
mstrader/MkidDigitalReadout | DataReadout/ChannelizerControls/Roach2Controls.py | 1 | 90924 | """
Author: Alex Walter
Date: April 25, 2016
Firmware: darkS2*.fpg
This class is for setting and reading LUTs, registers, and other memory components in the ROACH2 Virtex 6 FPGA using casperfpga tools.
It's also the IO for the ADC/DAC board's Virtex 7 FPGA through the ROACH2
NOTE: All freqencies are consider... | gpl-2.0 |
ressu/SickGear | SickBeard.py | 1 | 21195 | #!/usr/bin/env python2
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickGear.
#
# SickGear 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 ve... | gpl-3.0 |
mgedmin/mgp2pdf | samples/python/l5filter.py | 1 | 1505 | #!/usr/bin/python
import sys
pagesize = 11
preamble = """
%nodefault,area 90 90, vgap 260, size 8, font "standard", fore "#134d73", back "white", right, newimage -zoom 75 "vu-logo.png"
%size 3
%size 6, vgap 40, left
""".strip()
pagebreak = "%page\n" + preamble
def format(lines):
iterlines = iter(lines)
de... | gpl-2.0 |
Jeromefromcn/shadowsocks | tests/nose_plugin.py | 1072 | 1164 | #!/usr/bin/env python
#
# Copyright 2015 clowwindy
#
# 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 ... | apache-2.0 |
lidiamcfreitas/FenixScheduleMaker | ScheduleMaker/brython/www/src/Lib/test/fork_wait.py | 32 | 2152 | """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... | bsd-2-clause |
extertioner/django-blog-zinnia | zinnia/tests/test_admin_fields.py | 10 | 2666 | """Test cases for Zinnia's admin fields"""
from django.test import TestCase
from django.utils.encoding import smart_text
from zinnia.models import Category
from zinnia.admin.fields import MPTTModelChoiceIterator
from zinnia.admin.fields import MPTTModelMultipleChoiceField
class MPTTModelChoiceIteratorTestCase(TestCa... | bsd-3-clause |
dkdewitt/werkzeug | werkzeug/contrib/fixers.py | 259 | 10183 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.fixers
~~~~~~~~~~~~~~~~~~~~~~~
.. versionadded:: 0.5
This module includes various helpers that fix bugs in web servers. They may
be necessary for some versions of a buggy web server but not others. We try
to stay updated with the status of the bug... | bsd-3-clause |
Bysmyyr/chromium-crosswalk | third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/wptserve/wptserve/response.py | 158 | 14749 | from collections import OrderedDict
from datetime import datetime, timedelta
import Cookie
import json
import types
import uuid
import socket
from constants import response_codes
from logger import get_logger
missing = object()
class Response(object):
"""Object representing the response to a HTTP request
:p... | bsd-3-clause |
frank10704/DF_GCS_W | MissionPlanner-master/packages/IronPython.StdLib.2.7.5-beta1/content/Lib/distutils/sysconfig.py | 42 | 21927 | """Provide access to Python's configuration information. The specific
configuration variables available depend heavily on the platform and
configuration. The values may be retrieved using
get_config_var(name), and the list of variables is available via
get_config_vars().keys(). Additional convenience functions a... | gpl-3.0 |
creighton/ADL_LRS | oauth_provider/models.py | 3 | 6783 | import uuid
import urllib
import urlparse
from datetime import datetime
from time import time
import oauth2 as oauth
from Crypto.PublicKey import RSA
from django.db import models
from oauth_provider.compat import AUTH_USER_MODEL, get_random_string
from oauth_provider.managers import TokenManager
from oauth_provider.co... | apache-2.0 |
saisrisathya/whatsapps | build/lib/yowsup/layers/protocol_groups/protocolentities/iq_groups_create_success.py | 41 | 1076 | from yowsup.structs import ProtocolTreeNode
from yowsup.layers.protocol_iq.protocolentities import ResultIqProtocolEntity
class SuccessCreateGroupsIqProtocolEntity(ResultIqProtocolEntity):
'''
<iq type="result" id="{{id}}" from="g.us">
<group id="{group_id}"></group>
</iq>
'''
def __init__(... | gpl-3.0 |
jirikuncar/invenio-base | invenio_base/config.py | 1 | 28704 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2012, 2013, 2014, 2015 CERN.
#
# Invenio 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... | gpl-2.0 |
cokrzys/mindh2jsondh | source/worker.py | 1 | 7160 | """
worker.py
Worker class to manage an export for the mindh2jsondh application.
For more information see: https://github.com/cokrzys/mindh2jsondh
Copyright (C) 2015 cokrzys
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated document... | mit |
ojii/sandlib | lib/lib-python/2.7/plat-mac/lib-scriptpackages/StdSuites/Standard_Suite.py | 73 | 25045 | """Suite Standard Suite: Common terms for most applications
Level 1, version 1
Generated from /Volumes/Sap/System Folder/Extensions/AppleScript
AETE/AEUT resource version 1/0, language 0, script 0
"""
import aetools
import MacOS
_code = 'core'
from _builtinSuites.builtin_Suite import *
class Standard_Suite_Events(b... | bsd-3-clause |
Zlash65/erpnext | erpnext/education/doctype/course/test_course.py | 9 | 1595 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and Contributors
# See license.txt
from __future__ import unicode_literals
from erpnext.education.doctype.topic.test_topic import make_topic
from erpnext.education.doctype.topic.test_topic import make_topic_and_linked_content
import frappe
import unitte... | gpl-3.0 |
stdweird/aquilon | lib/python2.6/aquilon/worker/commands/search_hardware.py | 2 | 1816 | # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2013 Contributor
#
# 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 t... | apache-2.0 |
jboecker/dcs-witchcraft | windows/nodejs/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py | 566 | 9386 | # 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
_TARGET_TYPE_EXT = {
'executable': '.exe',
'loadable_module': '.dll',
... | gpl-3.0 |
tcstewar/genome_browser | server.py | 1 | 2209 | import swi
import os
import json
import StringIO
import matplotlib
matplotlib.use('Agg')
import pylab
import bigwig
import numpy as np
bigwigs = {}
def get_bigwig(name):
bw = bigwigs.get(name, None)
if bw is None:
bw = bigwig.BigWig(name)
bigwigs[name] = bw
return bw
class Server(swi.Si... | gpl-2.0 |
HugoKuo/keystone-essex3 | keystone/backends/sqlalchemy/api/tenant.py | 1 | 12120 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 OpenStack LLC.
# 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/... | apache-2.0 |
hydroshare/hydroshare | hs_core/management/commands/solr_prepare.py | 1 | 4767 | """
This calls all preparation routines involved in creating SOLR records.
It is used to debug SOLR harvesting. If any of these routines fails on
any resource, all harvesting ceases. This has caused many bugs.
"""
from django.core.management.base import BaseCommand
from django.db.models import Q
from hs_core.models im... | bsd-3-clause |
ccastell/Transfer-System | Website/env/lib/python3.5/site-packages/django/utils/_os.py | 502 | 3581 | from __future__ import unicode_literals
import os
import sys
import tempfile
from os.path import abspath, dirname, isabs, join, normcase, normpath, sep
from django.core.exceptions import SuspiciousFileOperation
from django.utils import six
from django.utils.encoding import force_text
if six.PY2:
fs_encoding = sy... | apache-2.0 |
biswajitsahu/kuma | vendor/packages/pygments/lexers/dalvik.py | 72 | 4420 | # -*- coding: utf-8 -*-
"""
pygments.lexers.dalvik
~~~~~~~~~~~~~~~~~~~~~~
Pygments lexers for Dalvik VM-related languages.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, bygr... | mpl-2.0 |
kevinarpe/kevinarpe-rambutan3 | rambutan3/check_args/base/RStrictInstanceMatcher.py | 1 | 1930 | from rambutan3.check_args.base.RAbstractForwardingTypeMatcher import RAbstractForwardingTypeMatcher
from rambutan3.check_args.base.RAbstractTypeMatcher import RAbstractTypeMatcher
from rambutan3.check_args.base.RInstanceMatcher import RInstanceMatcher
from rambutan3.check_args.base.traverse.RTypeMatcherError import RTy... | gpl-3.0 |
dcifuen/cloudbday | src/lib/requests/packages/charade/jpcntx.py | 949 | 19104 | ######################## 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... | mit |
brenolf/k-flow | thm.py | 1 | 3692 | import sys
N = -1
G = None
H = None
vis = None
vis_aux = None
valence = None
flows = {}
answer = []
allowed_flows = {
3 : [-1, 1],
4 : [-1, 1, 2],
5 : [-1, 1, 2, -2]
}
def has_k_flow (graph):
global N, G, H, vis, valence, flows
G = graph
N = len(G)
H = [[0] * N for i in xrange(0, N)]
vis = [False] * N
... | apache-2.0 |
rubenfonseca/titanium-dropboxsync | build.py | 1 | 6556 | #!/usr/bin/env python
#
# Appcelerator Titanium Module Packager
#
#
import os, subprocess, sys, glob, string
import zipfile
from datetime import date
cwd = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename))
os.chdir(cwd)
required_module_keys = ['name','version','moduleid','description','copyright','... | mit |
HoracioAlvarado/fwd | venv/Lib/site-packages/pip/utils/deprecation.py | 23 | 2282 | """
A module that implments tooling to enable easy warnings about deprecations.
"""
from __future__ import absolute_import
import logging
import warnings
class PipDeprecationWarning(Warning):
pass
class RemovedInPip9Warning(PipDeprecationWarning, DeprecationWarning):
pass
class RemovedInPip10Warning(PipD... | mit |
sestrella/ansible | lib/ansible/modules/network/fortios/fortios_system_replacemsg_admin.py | 13 | 10079 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# 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 Lic... | gpl-3.0 |
aliyun/oss-ftp | python27/win32/Lib/email/generator.py | 64 | 14203 | # Copyright (C) 2001-2010 Python Software Foundation
# Contact: email-sig@python.org
"""Classes to generate plain text from a message object tree."""
__all__ = ['Generator', 'DecodedGenerator']
import re
import sys
import time
import random
import warnings
from cStringIO import StringIO
from email.header import Hea... | mit |
Big-B702/python-for-android | python-modules/twisted/twisted/internet/unix.py | 49 | 11359 | # -*- test-case-name: twisted.test.test_unix,twisted.internet.test.test_unix,twisted.internet.test.test_posixbase -*-
# Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Various asynchronous TCP/IP classes.
End users shouldn't use this module directly - use the reactor APIs instead.... | apache-2.0 |
vladmm/intellij-community | python/lib/Lib/smtplib.py | 87 | 27148 | #! /usr/bin/env python
'''SMTP/ESMTP client class.
This should follow RFC 821 (SMTP), RFC 1869 (ESMTP), RFC 2554 (SMTP
Authentication) and RFC 2487 (Secure SMTP over TLS).
Notes:
Please remember, when doing ESMTP, that the names of the SMTP service
extensions are NOT the same thing as the option keywords for the RC... | apache-2.0 |
abdellatifkarroum/odoo | addons/crm_partner_assign/crm_lead.py | 112 | 2985 | # -*- 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 |
qenter/vlc-android | toolchains/arm/lib/python2.7/os.py | 147 | 25769 | r"""OS routines for Mac, NT, or Posix depending on what system we're on.
This exports:
- all functions from posix, nt, os2, or ce, e.g. unlink, stat, etc.
- os.path is one of the modules posixpath, or ntpath
- os.name is 'posix', 'nt', 'os2', 'ce' or 'riscos'
- os.curdir is a string representing the current di... | gpl-2.0 |
cgstudiomap/cgstudiomap | main/parts/odoo/addons/web_linkedin/web_linkedin.py | 333 | 4485 | # -*- 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 |
ecrespo/django_kanban-agile | kanban/lib/python2.7/site-packages/setuptools/tests/test_windows_wrappers.py | 151 | 6154 | """
Python Script Wrapper for Windows
=================================
setuptools includes wrappers for Python scripts that allows them to be
executed like regular windows programs. There are 2 wrappers, one
for command-line programs, cli.exe, and one for graphical programs,
gui.exe. These programs are almost ident... | mit |
jiasir/redis-ha | redis_ha_installer_el6.py | 1 | 3062 | #!/usr/bin/env python
# Install redis server
# Usage: sudo python redis_ha_installer.py [master|backup]
# Author: jiasir (Taio Jia)
# E-Mail: jiasir@icloud.com
# License: The MIT License
import os
import sys
import shutil
import logging
from command import Command
run = Command()
def usage():
print 'Usage: sudo ... | mit |
gelisam/evercal | lib/thrift/server/TNonblockingServer.py | 83 | 10950 | #
# 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... | bsd-2-clause |
edx/ecommerce | ecommerce/extensions/dashboard/users/tests/test_views.py | 1 | 3915 |
import json
import httpretty
import mock
from django.contrib.messages import constants as MSG
from django.urls import reverse
from requests import Timeout
from testfixtures import LogCapture
from ecommerce.core.tests import toggle_switch
from ecommerce.core.url_utils import get_lms_enrollment_api_url
from ecommerce... | agpl-3.0 |
MostafaGazar/tensorflow | tensorflow/contrib/distributions/python/kernel_tests/quantized_distribution_test.py | 4 | 18061 | # 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 |
nitzmahone/ansible | test/units/parsing/yaml/test_objects.py | 42 | 5607 | # This file is part of Ansible
# -*- coding: utf-8 -*-
#
# 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 distr... | gpl-3.0 |
jss-emr/openerp-7-src | openerp/addons/sale_margin/sale_margin.py | 30 | 4116 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... | agpl-3.0 |
letsencrypt/letsencrypt | certbot-apache/certbot_apache/configurator.py | 1 | 99590 | """Apache Configuration based off of Augeas Configurator."""
# pylint: disable=too-many-lines
import copy
import fnmatch
import logging
import os
import pkg_resources
import re
import six
import socket
import time
import zope.component
import zope.interface
from acme import challenges
from acme.magic_typing import An... | apache-2.0 |
papouso/odoo | addons/hr_payroll/report/report_contribution_register.py | 377 | 3380 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it... | agpl-3.0 |
hzy001/ansible | lib/ansible/executor/stats.py | 251 | 1716 | # (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 |
thezimmee/os-zimmee | sublime/Plugins/Focus Active View/focus-active-view.py | 1 | 3934 | import os
from shutil import copyfile
import sublime
import sublime_plugin
# Returns color scheme path for where the unfocused scheme should be.
def get_unfocused_scheme_path(view):
main_scheme = view.settings().get("color_scheme")
return os.path.join(sublime.packages_path(), "User/UnfocusedThemes", os.path.dirname(... | mit |
bluecmd/hackrf | firmware/tools/make-dfu.py | 1 | 1819 | #!/usr/bin/env python2
# vim: set ts=4 sw=4 tw=0 et pm=:
import struct
import sys
import os.path
import getopt
import zlib
options, remainder = getopt.getopt(sys.argv[1:], 'p:v:d:S:v', ['pid=',
'vid=',
'did=',
'spec=',
'verbose',
])
pid = 0x000c
vi... | gpl-2.0 |
richardmg/qtcreator | share/qtcreator/debugger/stdtypes.py | 1 | 22697 | ############################################################################
#
# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
# Contact: http://www.qt-project.org/legal
#
# This file is part of Qt Creator.
#
# Commercial License Usage
# Licensees holding valid commercial Qt licenses may use this file in
# ... | lgpl-2.1 |
dhimmel/networkx | examples/graph/unix_email.py | 62 | 2683 | #!/usr/bin/env python
"""
Create a directed graph, allowing multiple edges and self loops, from
a unix mailbox. The nodes are email addresses with links
that point from the sender to the recievers. The edge data
is a Python email.Message object which contains all of
the email message data.
This example shows the po... | bsd-3-clause |
leliel12/scikit-criteria | skcriteria/divcorr.py | 1 | 3513 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2016-2017, Cabral, Juan; Luczywo, Nadia
# 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 retai... | bsd-3-clause |
LumaPictures/rez | src/rezplugins/build_system/cmake.py | 1 | 11415 | """
CMake-based build system
"""
from rez.build_system import BuildSystem
from rez.build_process_ import BuildType
from rez.resolved_context import ResolvedContext
from rez.exceptions import BuildSystemError
from rez.util import create_forwarding_script
from rez.packages_ import get_developer_package
from rez.utils.pla... | lgpl-3.0 |
houzhenggang/hiwifi-openwrt-HC5661-HC5761 | staging_dir/host/lib/python2.7/encodings/iso8859_5.py | 593 | 13271 | """ Python Character Mapping Codec iso8859_5 generated from 'MAPPINGS/ISO8859/8859-5.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='... | gpl-2.0 |
michaelkuty/horizon-contrib | horizon_contrib/generic/tables.py | 1 | 1617 |
from horizon_contrib import tables
class GenericTable(tables.PaginatedTable):
"""
Generic table
.. attribute:: cls_name String or django model class
note: best way is ModelClass because find by content_type
makes additional db queries
.. attribute:: order_by is default to ("-i... | bsd-3-clause |
srluge/SickRage | lib/dogpile/cache/region.py | 47 | 47567 | from __future__ import with_statement
from dogpile.core import Lock, NeedRegenerationException
from dogpile.core.nameregistry import NameRegistry
from . import exception
from .util import function_key_generator, PluginLoader, \
memoized_property, coerce_string_conf, function_multi_key_generator
from .api import NO_... | gpl-3.0 |
eduNEXT/edunext-platform | openedx/core/lib/blockstore_api/tests/test_blockstore_api.py | 4 | 8710 | # -*- coding: utf-8 -*-
"""
Tests for xblock_utils.py
"""
import unittest
from uuid import UUID
from django.conf import settings
from openedx.core.lib import blockstore_api as api
# A fake UUID that won't represent any real bundle/draft/collection:
BAD_UUID = UUID('12345678-0000-0000-0000-000000000000')
@unittest.... | agpl-3.0 |
ReganBell/QReview | build/lib/networkx/algorithms/tree/tests/test_recognition.py | 54 | 4061 |
from nose.tools import *
import networkx as nx
class TestTreeRecognition(object):
graph = nx.Graph
multigraph = nx.MultiGraph
def setUp(self):
self.T1 = self.graph()
self.T2 = self.graph()
self.T2.add_node(1)
self.T3 = self.graph()
self.T3.add_nodes_from(range... | bsd-3-clause |
sencha/chromium-spacewalk | third_party/markupsafe/_native.py | 1243 | 1187 | # -*- coding: utf-8 -*-
"""
markupsafe._native
~~~~~~~~~~~~~~~~~~
Native Python implementation the C module is not compiled.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from markupsafe import Markup
from markupsafe._compat import text_type
def escape(... | bsd-3-clause |
jarvys/django-1.7-jdb | django/db/migrations/graph.py | 6 | 6570 | from __future__ import unicode_literals
from django.utils.datastructures import OrderedSet
from django.db.migrations.state import ProjectState
class MigrationGraph(object):
"""
Represents the digraph of all migrations in a project.
Each migration is a node, and each dependency is an edge. There are
... | bsd-3-clause |
ReachingOut/unisubs | libs/markdown/extensions/abbr.py | 131 | 2899 | '''
Abbreviation Extension for Python-Markdown
==========================================
This extension adds abbreviation handling to Python-Markdown.
Simple Usage:
>>> import markdown
>>> text = """
... Some text with an ABBR and a REF. Ignore REFERENCE and ref.
...
... *[ABBR]: Abbreviation
... | agpl-3.0 |
jostep/tensorflow | tensorflow/python/estimator/canned/head.py | 4 | 36816 | # 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 |
newfies-dialer/newfies-dialer | newfies/apirest/api_appointment/view_rule.py | 4 | 1095 | # -*- coding: utf-8 -*-
#
# Newfies-Dialer License
# http://www.newfies-dialer.org
#
# 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/.
#
# Copyright (C) 2011-2015 Star2Bil... | mpl-2.0 |
roth1002/react-native-intro-qnap | node_modules/node-gyp/gyp/pylib/gyp/generator/android.py | 542 | 45270 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Notes:
#
# This generates makefiles suitable for inclusion into the Android build system
# via an Android.mk file. It is based on make.py, the standard makefile
... | mit |
gvlproject/tools-iuc | tools/query_tabular/query_db.py | 7 | 1966 | #!/usr/bin/env python
from __future__ import print_function
import re
import sqlite3 as sqlite
import sys
TABLE_QUERY = \
"""
SELECT name, sql
FROM sqlite_master
WHERE type='table'
ORDER BY name
"""
def regex_match(expr, item):
return re.match(expr, item) is not None
def regex_search... | mit |
nexiles/odoo | odoo.py | 257 | 5618 | #!/usr/bin/env python
#----------------------------------------------------------
# odoo cli
#
# To install your odoo development environement type:
#
# wget -O- https://raw.githubusercontent.com/odoo/odoo/8.0/odoo.py | python
#
# The setup_* subcommands used to boostrap odoo are defined here inline and may
# only depe... | agpl-3.0 |
yesudeep/mils-secure | app/jinja2/tests/test_lexer.py | 6 | 2087 | # -*- coding: utf-8 -*-
"""
unit test for the lexer
~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2009 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from jinja2 import Environment
env = Environment()
RAW = '{% raw %}foo{% endraw %}|{%raw%}{{ bar }}|{% baz %}{% endraw %}'
BAL... | mit |
amifsud/sot-stabilizer | src/dynamic_graph/sot/application/stabilizer/scenarii/pg_lqr_twoDof_coupled_stabilizer_hrp2_encoders.py | 1 | 2099 | from dynamic_graph.sot.application.stabilizer.scenarii.pg_lqr_twoDof_coupled_stabilizer import PgLqrTwoDofCoupledStabilizer
from dynamic_graph.sot.application.stabilizer.scenarii.hrp2_lqr_twoDof_coupled_stabilizer_encoders import HRP2LqrTwoDofCoupledStabilizerEncoders
from dynamic_graph.sot.core.meta_tasks import GainA... | lgpl-3.0 |
tomellericcardo/SafeChat | server-side/safeBase.py | 1 | 3601 | # -*- coding: utf-8 -*-
from os.path import realpath, dirname, join
from re import compile
from sqlite3 import connect
class SafeBase:
def __init__(self, g, database_filename):
self.g = g
posizione = dirname(realpath(__file__))
self.percorso = join(posizione, database_filename)
... | apache-2.0 |
VinGarcia/kivy | examples/kinect/kinectviewer.py | 56 | 7964 | import freenect
from time import sleep
from threading import Thread
from collections import deque
from kivy.app import App
from kivy.clock import Clock
from kivy.properties import NumericProperty, StringProperty
from kivy.graphics import RenderContext, Color, Rectangle
from kivy.graphics.texture import Texture
from kiv... | mit |
knightsamar/github-edu-effectiveness | store.py | 1 | 1233 | #builds a db store using the Github data
import github
from pymongo import MongoClient
from settings import MONGO_HOST, MONGO_PORT, MONGO_DB
'''
Why do we store the data when we can get it from GitHub API anytime we need?
1. Because GitHub API seems to say that we can get data only as old as 90 days in case of things ... | gpl-2.0 |
nkolban/Espruino | boards/STM32F429IDISCOVERY.py | 6 | 5414 | #!/bin/false
# This file is part of Espruino, a JavaScript interpreter for Microcontrollers
#
# Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk>
#
# 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 h... | mpl-2.0 |
ihsanudin/odoo | openerp/tools/float_utils.py | 312 | 10296 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | agpl-3.0 |
merfii/PythonExercises | DIYgod/0007/test/test.py | 78 | 1114 | # -*- coding: utf-8 -*-
import re
import os
# Get all files in designated path
def get_files(path):
filepath = os.listdir(path)
files = []
for fp in filepath:
fppath = path + '/' + fp
if(os.path.isfile(fppath)):
files.append(fppath)
elif(os.path.isdir(fppath)):
... | mit |
drufat/vispy | vispy/visuals/line/line.py | 3 | 18295 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Line visual implementing Agg- and GL-based drawing modes.
"""
from __future__ import division
import numpy as np
from ... import gloo, glsl
from ...color import Color, C... | bsd-3-clause |
MechaCM/android_kernel_htc_mecha | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (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, sys
sys.path.append(os.env... | gpl-2.0 |
LuoZijun/uOffice | temp/pydocxx/docx/opc/packuri.py | 19 | 3880 | # encoding: utf-8
"""
Provides the PackURI value type along with some useful known pack URI strings
such as PACKAGE_URI.
"""
import posixpath
import re
class PackURI(str):
"""
Provides access to pack URI components such as the baseURI and the
filename slice. Behaves as |str| otherwise.
"""
_file... | gpl-3.0 |
dsajkl/123 | cms/djangoapps/contentstore/management/commands/prompt.py | 70 | 1095 | import sys
def query_yes_no(question, default="yes"):
"""Ask a yes/no question via raw_input() and return their answer.
"question" is a string that is presented to the user.
"default" is the presumed answer if the user just hits <Enter>.
It must be "yes" (the default), "no" or None (meaning
... | agpl-3.0 |
opencloudinfra/orchestrator | venv/Lib/site-packages/requests/packages/urllib3/response.py | 197 | 18103 | from __future__ import absolute_import
from contextlib import contextmanager
import zlib
import io
from socket import timeout as SocketTimeout
from socket import error as SocketError
from ._collections import HTTPHeaderDict
from .exceptions import (
ProtocolError, DecodeError, ReadTimeoutError, ResponseNotChunked
... | gpl-3.0 |
sanghinitin/golismero | thirdparty_libs/django/template/defaulttags.py | 39 | 47883 | """Default tags used by the template system, available to all templates."""
from __future__ import unicode_literals
import sys
import re
from datetime import datetime
from itertools import groupby, cycle as itertools_cycle
from django.conf import settings
from django.template.base import (Node, NodeList, Template, Co... | gpl-2.0 |
noba3/KoTos | addons/plugin.video.phstreams/resources/lib/sources/dizibox_tv.py | 7 | 6433 | # -*- coding: utf-8 -*-
'''
Genesis Add-on
Copyright (C) 2015 lambda
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 ... | gpl-2.0 |
isaiah1782-cmis/isaiah1782-cmis-cs2 | cs2quiz2.py | 1 | 2232 | #PART 1: Terminology
#1) Give 3 examples of boolean expressions.
#a)
# >>>bool(1)
# >>>True
#b)
# >>>bool(0)
# >>>False
#c)
# >>>p = False
# >>>bool(p)
# >>>False
#
#2) What does 'return' do?
#
#The retrun command puts a variable's assigned value, that you assigned in a function, for the function so that ... | cc0-1.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.