code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
# vi: ts=4 expandtab syntax=python
##############################################################################
# Copyright (c) 2008 IBM Corporation
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distr... | Awingu/open-ovf | py/ovf/OvfPlatform.py | Python | epl-1.0 | 2,476 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on Jul 1, 2014
@author: anroco
I have a list in python and I want to invest the elements, ie the latter is the
first, how I can do?
Tengo una lista en python y quiero invertir los elementos de la lista, es
decir que el último sea el primero, ¿como puedo hacer... | OxPython/Python_lists_reverse | src/reverse_lists.py | Python | epl-1.0 | 594 |
import os
import glob
import subprocess
def expand_path(path):
return os.path.abspath(os.path.expandvars(os.path.expanduser(path)))
def is_file(path):
if not path:
return False
if not os.path.isfile(path):
return False
return True
def arg_is_file(path):
try:
if not is_file(path):
raise
... | cwlinkem/linkuce | modeltest_runner.py | Python | gpl-2.0 | 2,993 |
#resource, resources, Resources
from flask import Blueprint, render_template, request,flash, redirect, url_for
from app.{resources}.models import {Resources}, {Resources}Schema
{resources} = Blueprint('{resources}', __name__, template_folder='templates')
#http://marshmallow.readthedocs.org/en/latest/quickstart.ht... | jstacoder/Flask-Scaffold | scaffold/app/views.py | Python | gpl-2.0 | 3,123 |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
DsgTools
A QGIS plugin
Brazilian Army Cartographic Production Tools
-------------------
begin : 2019-04-26
git sha ... | lcoandrade/DsgTools | core/DSGToolsProcessingAlgs/Algs/LayerManagementAlgs/groupLayersAlgorithm.py | Python | gpl-2.0 | 8,547 |
"""
Default configuration values for certmaster items when
not specified in config file.
Copyright 2008, Red Hat, Inc
see AUTHORS
This software may be freely redistributed under the terms of the GNU
general public license.
You should have received a copy of the GNU General Public License
along with this program; if ... | jude/certmaster | certmaster/commonconfig.py | Python | gpl-2.0 | 1,224 |
import forge
from forge.models.groups import Group
class Add(object):
def __init__(self,json_args,session):
if type(json_args) != type({}):
raise TypeError("JSON Arg must be dict type")
if 'name' and 'distribution' not in json_args.keys():
... | blhughes/forge | forge/commands/group/add.py | Python | gpl-2.0 | 734 |
#!/usr/bin/env python
# encoding: utf-8
'A simple client for accessing api.ly.g0v.tw.'
import json
import unittest
try:
import urllib.request as request
import urllib.parse as urlparse
except:
import urllib2 as request
import urllib as urlparse
def assert_args(func, *args):
def inner(*args):
required_arg = ar... | zonble/lyg0vtw_client.py | lyg0vtw_client/lyg0vtw_client.py | Python | gpl-2.0 | 5,779 |
# -*- coding: utf-8 -*-
# Inforevealer
# Copyright (C) 2010 Francois Boulogne <fboulogne at april dot org>
#
# 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... | sciunto/inforevealer | src/action.py | Python | gpl-2.0 | 5,161 |
#!/usr/bin/env python
#-*- coding: ascii -*-
from __future__ import print_function
import sys
from blib_util import *
def build_kfont(build_info):
for compiler_info in build_info.compilers:
build_a_project("kfont", "kfont", build_info, compiler_info, True)
if __name__ == "__main__":
cfg = cfg_from_ar... | zhangf911/KlayGE | build_kfont.py | Python | gpl-2.0 | 435 |
# Copyright (c) 2014, Canon Inc. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and ... | teamfx/openjfx-9-dev-rt | modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/layout_tests/servers/web_platform_test_server.py | Python | gpl-2.0 | 9,422 |
"""
OK resolveurl XBMC Addon
Copyright (C) 2016 Seberoth
Version 0.0.2
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 p... | felipenaselva/felipe.repository | script.module.resolveurl/lib/resolveurl/plugins/ok.py | Python | gpl-2.0 | 2,491 |
from functions.str import w_str
from wtypes.control import WEvalRequired, WRaisedException, WReturnValue
from wtypes.exception import WException
from wtypes.magic_macro import WMagicMacro
from wtypes.boolean import WBoolean
class WAssert(WMagicMacro):
def call_magic_macro(self, exprs, scope):
if len(exprs... | izrik/wodehouse | macros/assert_.py | Python | gpl-2.0 | 802 |
"""
Builds out and synchronizes yum repo mirrors.
Initial support for rsync, perhaps reposync coming later.
Copyright 2006-2007, Red Hat, Inc
Michael DeHaan <mdehaan@redhat.com>
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
th... | colloquium/cobbler | cobbler/action_reposync.py | Python | gpl-2.0 | 22,241 |
"""Copyright (c) 2017 abhishek-sehgal954
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 prog... | abhishek-sehgal954/Inkscape_extensions_for_halftone_filters | SVG_to_SVG/svg_to_svg_ordered_dithering.py | Python | gpl-2.0 | 7,450 |
# coding=utf-8
# generate_completion_cache.py - generate cache for dnf bash completion
# Copyright © 2013 Elad Alfassa <elad@fedoraproject.org>
# 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 Lice... | rholy/dnf-plugins-core | plugins/generate_completion_cache.py | Python | gpl-2.0 | 2,729 |
from django.conf.urls import *
urlpatterns = patterns('foo.views',
# Listing URL
url(r'^$', view='browse', name='foo.browse'),
# Detail URL
url(r'^(?P<slug>(?!overview\-)[\w\-\_\.\,]+)/$', view='detail', name='foo.detail'),
) | barseghyanartur/django-slim | example/example/foo/urls.py | Python | gpl-2.0 | 243 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Joseph Herlant <herlantj@gmail.com>
# File name: hdfs_disk_usage_per_datanode.py
# Creation date: 2014-10-08
#
# Distributed under terms of the GNU GPLv3 license.
"""
This nagios active check parses the Hadoop HDFS web interface url:
http://<namenode>:<port>/d... | aerostitch/nagios_checks | hdfs_disk_usage_per_datanode.py | Python | gpl-2.0 | 3,375 |
# -*- coding: utf-8 -*-
# Asymmetric Base Framework - A collection of utilities for django frameworks
# Copyright (C) 2013 Asymmetric Ventures 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 S... | AsymmetricVentures/asymmetricbase | asymmetricbase/jinja/response.py | Python | gpl-2.0 | 1,647 |
#!/usr/bin/env python3
"""
* Copyright (c) 2015 BEEVC - Electronic Systems This file is part of BEESOFT
* 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... | beeverycreative/beeconnect | Loaders/PrinterInfoLoader.py | Python | gpl-2.0 | 5,218 |
#
# Copyright (C) 2006-2008, 2013 Red Hat, Inc.
# Copyright (C) 2006 Daniel P. Berrange <berrange@redhat.com>
#
# 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, o... | yumingfei/virt-manager | virtManager/details.py | Python | gpl-2.0 | 134,336 |
# This file is part of the Hotwire Shell user interface.
#
# Copyright (C) 2007,2008 Colin Walters <walters@verbum.org>
#
# 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 ... | pedrox/meld | meld/ui/msgarea.py | Python | gpl-2.0 | 8,901 |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
BirdChooserDialog
A QGIS plugin
Show bird observations
-------------------
begin : 2015-11-05
git sha : $Fo... | jguelat/BirdChooser | bird_chooser_dialog.py | Python | gpl-2.0 | 3,907 |
from django.conf.urls import include, url
from . import views
urlpatterns = [
url(r'^$', views.channel_list),
url(r'^play', views.play_channel),
url(r'^hello', views.hello),
] | Sistemas-Multimedia/Icecast-tracker | Django/rocio333/IcecastTracker333/IcecastTracker333app/urls.py | Python | gpl-2.0 | 179 |
from django.conf import settings
from geopy import distance, geocoders
import pygeoip
def get_geodata_by_ip(addr):
gi = pygeoip.GeoIP(settings.GEO_CITY_FILE, pygeoip.MEMORY_CACHE)
geodata = gi.record_by_addr(addr)
return geodata
def get_geodata_by_region(*args):
gn = geocoders.GeoNames()
retu... | iuscommunity/dmirr | src/dmirr.hub/dmirr/hub/lib/geo.py | Python | gpl-2.0 | 735 |
# Copright (C) 2015 Eric Skoglund
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in t... | EricIO/pasteit | pasteit/PasteSites.py | Python | gpl-2.0 | 3,878 |
import os
import string
import random
import logging
from thug.ActiveX.modules import WScriptShell
from thug.ActiveX.modules import TextStream
from thug.ActiveX.modules import File
from thug.ActiveX.modules import Folder
from thug.OS.Windows import win32_files
from thug.OS.Windows import win32_folders
log = logging.... | buffer/thug | thug/ActiveX/modules/ScriptingFileSystemObject.py | Python | gpl-2.0 | 5,185 |
#
# Copyright 2015 Red Hat, 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 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in th... | jaryn/virt-deploy | virtdeploy/test_driverbase.py | Python | gpl-2.0 | 2,986 |
# ============================================================================
'''
This file is part of the lenstractor project.
Copyright 2012 David W. Hogg (NYU) and Phil Marshall (Oxford).
Description
-----------
General-purpose data management classes and functions:
* Order a pile of FITS files into scifiles and... | davidwhogg/LensTractor | lenstractor/dm.py | Python | gpl-2.0 | 12,090 |
# -*- coding: utf-8 -*-
"""
This file is part of quiedit.
quiedit 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.
quiedit is distributed i... | smathot/quiedit | libquiedit/theme.py | Python | gpl-2.0 | 3,523 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import common
import connection
import m3u8
import base64
import os
import ustvpaths
import re
import simplejson
import sys
import time
import urllib
import xbmc
import xbmcaddon
import xbmcgui
import xbmcplugin
from bs4 import BeautifulSoup, SoupStrainer
addon = xbmcaddon.Add... | moneymaker365/plugin.video.ustvvod | resources/lib/main_aenetwork.py | Python | gpl-2.0 | 8,687 |
__author__ = 'bruno'
import unittest
import algorithms.graphs.complementGraph as ComplementGraph
class TestComplementGraph(unittest.TestCase):
def setUp(self):
pass
def test_complement_graph_1(self):
graph = {'a': {'b': 1, 'c': 1},
'b': {'a': 1, 'c': 1, 'd': 1},
... | bnsantos/python-junk-code | tests/graphs/complementGraphTest.py | Python | gpl-2.0 | 2,970 |
# Django settings for imageuploads project.
import os
PROJECT_DIR = os.path.dirname(__file__)
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql... | archatas/imageuploads | imageuploads/settings.py | Python | gpl-2.0 | 4,670 |
from StateMachine.State import State
from StateMachine.StateMachine import StateMachine
from StateMachine.InputAction import InputAction
from GameData.GameData import GameData
class StateT(State):
state_stack = list()
game_data = GameData()
def __init__(self):
self.transitions = None
def next(... | jmacleod/dotr | GameStates.py | Python | gpl-2.0 | 3,904 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from distutils.core import setup
setup(name = "palabre",
version = "0.6b",
description = "XML Socket Python Server",
long_description = "Flash XML Multiuser Socket Server",
author = "Célio Conort",
author_email = "palabre-dev@lists... | opixido/palabre | setup.py | Python | gpl-2.0 | 879 |
import sys
#Se le pasa la flag deseada, y devuelve lo que hay que escribir en el binario. CUIDADO CON LAS BACKSLASHES; hay que escaparlas
if len(sys.argv) != 2:
print "Syntax: python2 flag.py <FLAG>"
sys.exit(0)
flag = sys.argv[1]
i = 0
j = len(flag)-1
l = j
flag2 = ""
while (i<l+1):
if i <= l/2:
c ... | 0-wHiTeHand-0/CTFs | made_faqin2k18/heap/flag.py | Python | gpl-2.0 | 413 |
import subprocess
import sys
import numpy as np
import fluidfoam
import matplotlib.pyplot as plt
plt.ion()
############### Plot properties #####################
import matplotlib.ticker as mticker
from matplotlib.ticker import StrMethodFormatter, NullFormatter
from matplotlib import rc
#rc('font',**{'family':'sans-ser... | SedFoam/sedfoam | tutorials/Py/plot_tuto1DBedLoadTurb.py | Python | gpl-2.0 | 3,062 |
# Copyright (C) 2002-2006 Stephen Kennedy <stevek@gnome.org>
# Copyright (C) 2009-2013 Kai Willadsen <kai.willadsen@gmail.com>
#
# 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 ... | Spitfire1900/meld | meld/linkmap.py | Python | gpl-2.0 | 5,512 |
import csv, sqlite3
con = sqlite3.connect("toto.db") # change to 'sqlite:///your_filename.db'
cur = con.cursor()
cur.execute("CREATE TABLE t (col1, col2);") # use your column names here
with open('data.csv','r') as fin: # `with` statement available in 2.5+
# csv.DictReader uses first line in file for column headi... | fccagou/tools | python/sql/csv-to-sql.py | Python | gpl-2.0 | 537 |
# select the data using the like API
# use the python 3.5 as default
import sqlite3
def select_data(db_name, table_name, condition):
"find all the data with the same kind"
with sqlite3.connect(db_name) as db:
cursor = db.cursor()
cursor.execute("SELECT title, releaseYear FROM {0} WHERE title L... | smileboywtu/SQLite3 | coffee-shop/demon/select-like.py | Python | gpl-2.0 | 1,166 |
# This function runs a .bat file that job handles multiple GridLAB-D files
import subprocess
#C:\Projects\GridLAB-D_Builds\trunk\test\input\batch test\13_node_fault2.glm
def create_batch_file(glm_folder,batch_name):
batch_file = open('{:s}'.format(batch_name),'w')
batch_file.write('gridlabd.exe -T 0 --job\n')
#batc... | NREL/glmgen | glmgen/run_gridlabd_batch_file.py | Python | gpl-2.0 | 850 |
# -*- coding: utf-8 -*-
{
' (late)': ' (verspätet)',
'!=': '!=',
'!langcode!': 'de',
'!langname!': 'Deutsch (DE)',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '""Update" ist ein optionaler Ausdruck wie "Feld1 = \'newvalue". JOIN Ergebnisse können n... | wichmann/UpLoad | languages/de.py | Python | gpl-2.0 | 16,769 |
#!/usr/bin/python
import pygeoip
import json
from logsparser.lognormalizer import LogNormalizer as LN
import gzip
import glob
import socket
import urllib2
IP = 'IP.Of,Your.Server'
normalizer = LN('/usr/local/share/logsparser/normalizers')
gi = pygeoip.GeoIP('../GeoLiteCity.dat')
def complete(text, state):
return (gl... | radman404/Who-s-attacking-me-now-- | wamnclient.py | Python | gpl-2.0 | 2,126 |
# -*- coding: utf-8 -*-
import logging
# define here the methods needed to be run at install time
def importVarious(context):
if context.readDataFile('sc.blueprints.soundcloud_various.txt') is None:
return
logger = logging.getLogger('sc.blueprints.soundcloud')
# add here your custom methods tha... | jsbueno/sc.blueprints.soundcloud | sc/blueprints/soundcloud/setuphandlers.py | Python | gpl-2.0 | 386 |
#! /usr/bin/env python
#Written by Kjetil Matheussen: k.s.matheussen@notam02.no
import sys
import os
import urllib2
import readline
executable_path = os.path.split(os.path.abspath(os.path.realpath(sys.argv[0])))[0]
# TODO: Use bin/packages/s7/s7webserver instead, and delete the local s7webserver directory.
sys.pat... | kmatheussen/radium | bin/scheme/repl.py | Python | gpl-2.0 | 543 |
# encoding: utf-8
from yast import import_module
import_module('UI')
from yast import *
class Heading2Client:
def main(self):
UI.OpenDialog(
VBox(
Heading("This Is a Heading."),
Label("This is a Label."),
PushButton("&OK")
)
)
UI.UserInput()
UI.... | yast/yast-python-bindings | examples/Heading2.py | Python | gpl-2.0 | 361 |
###############################################################################
# #
# Copyright 2019. Triad National Security, LLC. All rights reserved. #
# This program was produced under U.S. Government contract 89233218CNA000001 #
... | CSD-Public/stonix | src/stonix_resources/rules/DisableGUILogon.py | Python | gpl-2.0 | 22,537 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as 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 'FormPlugin'
db.create_table(u'cmsplugin_formplugin', (
... | metzlar/cms-form-plugin | cms_form_plugin/migrations/0001_initial.py | Python | gpl-2.0 | 3,411 |
from utils import scaleToZoom
def jsonScript(layer):
json = """
<script src="data/json_{layer}.js\"></script>""".format(layer=layer)
return json
def scaleDependentLayerScript(layer, layerName):
min = layer.minimumScale()
max = layer.maximumScale()
scaleDependentLayer = """
if (map.ge... | radumas/qgis2web | leafletScriptStrings.py | Python | gpl-2.0 | 20,814 |
class Solution:
def reverseWords(self, s) :
print 1 / 0
tks = s.split(' ');
tks = filter(None, tks)
tks.reverse();
return ' '.join(tks).strip()
test = ["the sky is blue", " a b "]
sol = Solution();
for t in test :
print sol.reverseWords(t)
| yelu/leetcode | ReverseWords.py | Python | gpl-2.0 | 295 |
from netools import nextIpInPool, ping, aliveHost, hostsUnDone
def main():
aliveHosts = []
# pool IP
ipStart = "192.168.56.1"
ipEnd = "192.168.56.5"
print"Pools: ", ipStart + " -> " + ipEnd
print"Scanning online Router on network..."
aliveHosts = aliveHost(ipStart, ipEnd)
print "onl... | gravufo/commotion-router-testbench | ping/mainTest.py | Python | gpl-2.0 | 479 |
import collections
import re
import sys
import warnings
from bs4.dammit import EntitySubstitution
DEFAULT_OUTPUT_ENCODING = "utf-8"
PY3K = (sys.version_info[0] > 2)
whitespace_re = re.compile("\s+")
def _alias(attr):
"""Alias one attribute name to another for backward compatibility"""
@property
def alias... | ruuk/script.web.viewer2 | lib/webviewer/bs4/element.py | Python | gpl-2.0 | 61,200 |
# This file is part of the Enkel web programming library.
#
# Copyright (C) 2007 Espen Angell Kristiansen (espen@wsgi.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 Foundation; either version 2
# of... | espenak/enkel | testsuite/unittest_tpl.py | Python | gpl-2.0 | 1,046 |
#!/usr/bin/env python
#
# Copyright (C) 2004 Mark H. Lyon <mark@marklyon.org>
#
# This file is the Mbox & Maildir to Gmail Loader (GML).
#
# Mbox & Maildir to Gmail Loader (GML) is free software; you can redistribute
# it and/or modify it under the terms of the GNU General Public License
# as published by th... | jslag/gml | gml.py | Python | gpl-2.0 | 3,630 |
# -*- coding: utf-8 -*-
## Comments and reviews for records.
## This file is part of Invenio.
## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 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 Softwar... | kaplun/Invenio-OpenAIRE | modules/webcomment/lib/webcomment_templates.py | Python | gpl-2.0 | 109,494 |
#!/usr/bin/python
import os, subprocess
amsDecode = "/usr/local/bin/amsDecode"
path = "/usr/local/bin"
specDataFile = "specData.csv"
f = open("processFile.log", "w")
if os.path.exists(specDataFile):
os.remove(specDataFile)
for fileName in os.listdir('.'):
if fileName.endswith('.bin'):
#print 'file :' + fil... | jennyb/amsDecode | processBinFiles.py | Python | gpl-2.0 | 451 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# vertexdomain.py
#
# Copyright 2016 notna <notna@apparat.org>
#
# 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 ... | not-na/peng3d | docs/pyglet/graphics/vertexdomain.py | Python | gpl-2.0 | 851 |
#!/usr/bin/python3
from distutils.core import setup
setup(name='PySh',
version='0.0.1',
py_modules=['pysh'],
description="A tiny interface to intuitively access shell commands.",
author="Bede Kelly",
author_email="bedekelly97@gmail.com",
url="https://github.com/bedekelly/pysh",
... | bedekelly/pysh | setup.py | Python | gpl-2.0 | 340 |
# ------------------------------------------------------------------------------------------------
# Software: Stem Applier (staply)
# Description: Applies inflections to stem morphemes
# Version: 0.0.1a
# Module: Main
#
# Author: Frederic Bayer
# Email: f.bayer@computer.org
# Institu... | fsbayer/staply | staply/__init__.py | Python | gpl-2.0 | 1,227 |
from socket import *
import sys
clientSocket = socket(AF_INET, SOCK_STREAM) #creates socket
server_address = ('127.0.0.1', 80)#create connection at this given port
print >>sys.stderr, 'CONNECTING TO %s AT PORT %s' % server_address
clientSocket.connect(server_address)#connect to server at given address
filename=raw... | HarmeetDhillon/Socket-Programming | Client.py | Python | gpl-2.0 | 561 |
import contextvars
import gettext
import os
from telebot.asyncio_handler_backends import BaseMiddleware
try:
from babel.support import LazyProxy
babel_imported = True
except ImportError:
babel_imported = False
class I18N(BaseMiddleware):
"""
This middleware provides high-level tool for internat... | eternnoir/pyTelegramBotAPI | examples/asynchronous_telebot/middleware/i18n_middleware_example/i18n_base_midddleware.py | Python | gpl-2.0 | 3,751 |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | AndrewPeelMV/Blender2.78c | 2.78/scripts/startup/bl_ui/space_userpref.py | Python | gpl-2.0 | 50,089 |
__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
__copyright__ = 'Copyright (c) 2013 Artur Barseghyan'
__license__ = 'GPL 2.0/LGPL 2.1'
__all__ = ('FIT_METHOD_CROP_SMART', 'FIT_METHOD_CROP_CENTER', 'FIT_METHOD_CROP_SCALE',
'FIT_METHOD_FIT_WIDTH', 'FIT_METHOD_FIT_HEIGHT', 'DEFAULT_FIT_METHOD', 'FI... | georgistanev/django-dash | src/dash/contrib/plugins/image/defaults.py | Python | gpl-2.0 | 1,080 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Layman is a complete library for the operation and maintainance
on all gentoo repositories and overlays
"""
import sys
try:
from layman.api import LaymanAPI
from layman.config import BareConfig
from layman.output import Message
except ImportError:
sys.stde... | jmesmon/layman | layman/__init__.py | Python | gpl-2.0 | 1,585 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-08-21 18:59
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
dependencies = [
('dispatch', '0017_subsections'),
]
operations = [
migrations.CreateModel(... | ubyssey/dispatch | dispatch/migrations/0018_podcasts.py | Python | gpl-2.0 | 2,099 |
"""
This module instructs the setuptools to setpup this package properly
:copyright: (c) 2016 by Mehdy Khoshnoody.
:license: GPLv3, see LICENSE for more details.
"""
import os
from distutils.core import setup
setup(
name='pyeez',
version='0.1.0',
packages=['pyeez'],
classifiers=[
'... | mehdy/pyeez | setup.py | Python | gpl-2.0 | 1,167 |
#!/usr/bin/env python
import re
import sys
from urllib import urlopen
def isup(domain):
resp = urlopen("http://www.isup.me/%s" % domain).read()
return "%s" % ("UP" if re.search("It's just you.", resp,
re.DOTALL) else "DOWN")
if __name__ == '__main__':
if len(sys.argv) > 1:
print "\n".jo... | BogdanWDK/ajaxbot | src/files/isup.py | Python | gpl-2.0 | 433 |
from django import forms
from django.forms import ModelForm
from models import *
from django.forms import Textarea
from django.contrib.auth.hashers import make_password
from django.contrib.auth.models import Group
class OgretimElemaniFormu(ModelForm):
parolasi=forms.CharField(label="Parolasi",
help_text='Paro... | dogancankilment/Django-obs | yonetim/forms.py | Python | gpl-2.0 | 1,672 |
#!/usr/bin/python
import unittest
import ldc
import uuid
class TestLDCDNSInterface(unittest.TestCase):
def test_ldcdns(self):
rand_str = str(uuid.uuid4())
ldc.dns.add(rand_str, '1.1.1.1')
assert ldc.dns.resolve(rand_str) == [ '1.1.1.1' ]
ldc.dns.replace_all(rand_str,'2.2.2.2')
... | udragon/ldc | ldc/test/test_ldcdns.py | Python | gpl-2.0 | 502 |
# -*- coding: utf-8 -*-
"""
Script: GotoLineCol.py
Utility: 1. Moves the cursor position to the specified line and column for a file in Notepad++.
Especially useful for inspecting data files in fixed-width record formats.
2. Also, displays the character code (SBCS & LTR) in decimal... | bruderstein/PythonScript | scripts/Samples/GotoLineCol.py | Python | gpl-2.0 | 6,088 |
'''
Created on 22/02/2015
@author: Ismail Faizi
'''
import models
class ModelFactory(object):
"""
Factory for creating entities of models
"""
@classmethod
def create_user(cls, name, email, training_journal):
"""
Factory method for creating User entity.
NOTE: you must ex... | kanafghan/fiziq-backend | src/models/factories.py | Python | gpl-2.0 | 2,302 |
#############################################################################
##
## Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
## Contact: Qt Software Information (qt-info@nokia.com)
##
## This file is part of the Graphics Dojo project on Qt Labs.
##
## This file may be used under the terms of th... | anak10thn/graphics-dojo-qt5 | snapscroll/snapscroll.py | Python | gpl-2.0 | 3,660 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#Uncomment to debug. If you aren't me, I bet you want to change the paths, too.
import sys
from wsnamelet import wsnamelet_globals
if wsnamelet_globals.debug:
sys.stdout = open ("/home/munizao/hacks/wsnamelet/debug.stdout", "w", buffering=1)
sys.stderr = open ("/ho... | munizao/mate-workspace-name-applet | wsname_applet.py | Python | gpl-2.0 | 7,780 |
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 19 17:08:36 2015
@author: jgimenez
"""
from PyQt4 import QtGui, QtCore
import os
import time
import subprocess
types = {}
types['p'] = 'scalar'
types['U'] = 'vector'
types['p_rgh'] = 'scalar'
types['k'] = 'scalar'
types['epsilon'] = 'scalar'
types['omega'] = 'scalar'
ty... | jmarcelogimenez/petroSym | petroSym/utils.py | Python | gpl-2.0 | 11,739 |
import os
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm, colors
initDir = '../init/'
nlat = 31
nlon = 30
# Dimensions
L = 1.5e7
c0 = 2
timeDim = L / c0 / (60. * 60. * 24)
H = 200
tau_0 = 1.0922666667e-2
delta_T = 1.
sampFreq = 0.35 / 0.06 * 12 # (in year^-1)
# Case definition
muRng = n... | atantet/transferCZ | plot/plot_index_loop_seasonal.py | Python | gpl-2.0 | 5,743 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "annotator.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| richard-schwab/annotatorjs-django | manage.py | Python | gpl-2.0 | 252 |
# _dialogs.py
import wx
import _widgets as _wgt
from wx.lib.wordwrap import wordwrap
__version__ = '1.0.0'
import logging
log = logging.getLogger('root')
class CustomDialog(wx.Dialog):
def __init__(self, parent, *arg, **kw):
style = (wx.NO_BORDER | wx.CLIP_CHILDREN)
self.borderColour = wx.BLACK... | Hakugin/TimeClock | _dialogs.py | Python | gpl-2.0 | 19,476 |
"""
WSGI config for SysuLesson project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SE... | chenzeyuczy/keba | src/SysuLesson/wsgi.py | Python | gpl-2.0 | 397 |
# -- coding: utf-8 --
# Das Modul argv aus Packet sys wird importiert
from sys import argv
# Die Variablen script und filename werden entpackt
# sie müssen dem Script als Argumente mitgegeben werden beim ausführen
# z.B so: python ex15_reading_files.py ex15_sample.txt
script, filename = argv
# Der Inhalt der Datei e... | Tset-Noitamotua/_learnpython | LearnPythonTheHardWay/ex15_reading_files.py | Python | gpl-2.0 | 1,354 |
# coding=utf-8
"""DockWidget test.
.. note:: 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.
"""
__author__ = ... | NiekB4/2016_Group07_Transit-BuiltEnvironment | PTStopCalc_Plugin_Neeraj/test/test_pt_stop_calc_dockwidget.py | Python | gpl-2.0 | 1,110 |
from django.db import models
from django_crypto_fields.fields import EncryptedTextField
from edc_base.model.models import BaseUuidModel
try:
from edc_sync.mixins import SyncMixin
except ImportError:
SyncMixin = type('SyncMixin', (object, ), {})
from ..managers import CallLogManager
class CallLog (SyncMixin... | botswana-harvard/edc-contact | edc_contact/models/call_log.py | Python | gpl-2.0 | 1,199 |
# SecuML
# Copyright (C) 2016-2017 ANSSI
#
# SecuML 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.
#
# SecuML is distributed in the h... | ah-anssi/SecuML | SecuML/core/ActiveLearning/QueryStrategies/AnnotationQueries/Category.py | Python | gpl-2.0 | 8,916 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
python library for the AR.Drone 1.0 (1.11.5) and 2.0 (2.2.9).
parts of code from Bastian Venthur, Jean-Baptiste Passot, Florian Lacrampe.
tested with Python 2.7.3 and AR.Drone vanilla firmware 1.11.5.
"""
# < imports >-------------------------------------------------... | projeto-si-lansab/si-lansab | ARDrone/libARDrone.py | Python | gpl-2.0 | 36,206 |
import logging
from gettext import gettext as _
from typing import Tuple
from aai_framework.dial import ColorTxt
from aai_framework.interface import ModuleInterface
from .main import vars_, Vars
logger = logging.getLogger(__name__)
class Module(ModuleInterface):
ID = 'pkgs'
LEN_INSTALL = 2665
@property... | AnTAVR/aai2 | src/modules/pkgs/m_main.py | Python | gpl-2.0 | 667 |
# -*- coding: utf-8 -*-
# Copyright 2009,2014 Jaap Karssenberg <jaap.karssenberg@gmail.com>
'''This module contains helper classes for running external applications.
See L{zim.gui.applications} for classes with desktop integration for
applications defined in desktop entry files.
'''
import sys
import os
import logg... | Osndok/zim-desktop-wiki | zim/applications.py | Python | gpl-2.0 | 11,848 |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
QuickMapServices
A QGIS plugin
Collection of internet map services
-------------------
begin : 2014-11-21
git sha ... | nextgis/quickmapservices | src/groups_list.py | Python | gpl-2.0 | 5,024 |
import fauxfactory
import pytest
from cfme import test_requirements
from cfme.control.explorer.policies import VMControlPolicy
from cfme.infrastructure.provider.virtualcenter import VMwareProvider
from cfme.markers.env_markers.provider import ONE_PER_TYPE
from cfme.services.myservice import MyService
from cfme.utils.a... | RedHatQE/cfme_tests | cfme/tests/ansible/test_embedded_ansible_actions.py | Python | gpl-2.0 | 9,360 |
################################################################
# LiveQ - An interactive volunteering computing batch system
# Copyright (C) 2013 Ioannis Charalampidis
#
# 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 ... | wavesoft/LiveQ | liveq-common/liveq/utils/FLAT.py | Python | gpl-2.0 | 3,333 |
# -*- coding: utf-8 -*-
# $Id: $
ERROR_AUTH_FAILED = "Authorization failed"
NO_SUCH_BACKEND = "No such backend"
REDIRECTION_FAILED = "Redirection failed" | collective/ECSpooler | lib/util/errorcodes.py | Python | gpl-2.0 | 154 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
corto = 10
largo = long(corto)
print type(corto)
print type(largo)
| psicobyte/ejemplos-python | cap5/p62.py | Python | gpl-3.0 | 112 |
#!/usr/bin/python
# FRANKEN CIPHER
# WRITTEN FOR ACADEMIC PURPOSES
#
# AUTHORED BY: Dan C and james@forscience.xyz
#
# THIS SCRIPT IS WRITTEN TO DEMONSTRATE A UNIQUE ENCRYPTION ALGORITHM THAT IS INSPIRED BY A NUMBER
# OF EXISTING ALGORITHMS.
# THE SCRIPT IS WRITTEN ENTIRELY FOR ACADEMIC PURPOSES. NO WARRANTY OR GUARAN... | forScie/FrankenCipher | franken.py | Python | gpl-3.0 | 13,770 |
# -*- coding: utf-8 -*-
# Copyright 2009 James Hensman
# Licensed under the Gnu General Public license, see COPYING
#
# Gaussian Process Proper Orthogonal Decomposition.
| jameshensman/pythonGPLVM | GPPOD.py | Python | gpl-3.0 | 171 |
#!/usr/bin/env python
from distutils.core import setup
setup(
name="flowtools",
description="Tools for flow maps from modified Gromacs simulations",
long_description="See README.md",
license='GPLv3',
version='0.2.30',
url="https://github.com/pjohansson/flowtools",
... | pjohansson/flowtools | setup.py | Python | gpl-3.0 | 1,324 |
__productname__ = 'dotinstall'
__version__ = '0.1'
__copyright__ = "Copyright (C) 2014 Cinghio Pinghio"
__author__ = "Cinghio Pinghio"
__author_email__ = "cinghio@linuxmail.org"
__description__ = "Install dotfiles"
__long_description__ = "Install dofile based on some rules"
__url__ = "cinghiopinghio...."
__license__ = ... | cinghiopinghio/dotinstall | dotinstall/__init__.py | Python | gpl-3.0 | 354 |
__all__ = ['appie.appie', 'appie.extensions']
from appie.appie import *
from appie.extensions import *
| sphaero/appie | appie/__init__.py | Python | gpl-3.0 | 104 |
from django.contrib.auth.models import User
from django.views.generic.edit import CreateView, FormView
from django.shortcuts import render
from django.views.decorators.csrf import csrf_exempt
from django.utils.decorators import method_decorator
from django.core.context_processors import csrf
from django.http import Htt... | godlike64/typhon | typhon/views.py | Python | gpl-3.0 | 468 |
#!/usr/bin/env python
#
# This file is part of pacman-mirrors.
#
# pacman-mirrors 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.
#
# p... | fhdk/pacman-mirrors | pacman_mirrors/translation/i18n.py | Python | gpl-3.0 | 1,832 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2021 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | forkbong/qutebrowser | qutebrowser/misc/guiprocess.py | Python | gpl-3.0 | 6,787 |
"""Weighted maximum matching in general graphs.
The algorithm is taken from "Efficient Algorithms for Finding Maximum
Matching in Graphs" by Zvi Galil, ACM Computing Surveys, 1986.
It is based on the "blossom" method for finding augmenting paths and
the "primal-dual" method for finding a matching of maximum weight, bo... | bvancsics/TCMC | maximum_matching.py | Python | gpl-3.0 | 35,707 |
##########################################################################
# Copyright (C) 2009 - 2014 Huygens ING & Gerbrandy S.R.L.
#
# This file is part of bioport.
#
# bioport 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 ... | HuygensING/bioport-repository | bioport_repository/tests/test_common.py | Python | gpl-3.0 | 2,361 |