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 |
|---|---|---|---|---|---|
#/*##########################################################################
# Copyright (C) 2004-2012 European Synchrotron Radiation Facility
#
# This file is part of the PyMca X-ray Fluorescence Toolkit developed at
# the ESRF by the Software group.
#
# This toolkit is free software; you can redistribute it and/or m... | tonnrueter/pymca_devel | PyMca/SpecArithmetic.py | Python | gpl-2.0 | 3,550 |
from PyQt5 import QtCore, QtGui, QtWidgets
from ui_test3 import Ui_Dialog3
class testDialog3(QtWidgets.QDialog):
def __init__(self, parent):
QtWidgets.QDialog.__init__(self, parent)
self.ui = Ui_Dialog3()
self.ui.setupUi(self)
| sergelhomme/Network_Analysis | Network_Analysis_2_1/network_analysis/tools/testdialog3.py | Python | gpl-2.0 | 245 |
#!/usr/bin/python
import numpy as np
from time import time
from ..libtest import gen_array, average
from contextlib import contextmanager
import pytest
def test_wrong_param_count():
with pytest.raises(TypeError):
average()
def test_small_average():
array = gen_array(5)
for i in range(5):
... | jepio/JKalFilter | libtest/test/test_libtest.py | Python | gpl-2.0 | 889 |
import os
import zipfile
from translate.misc import wStringIO
from pootle.tests import PootleTestCase, formset_dict
from pootle_project.models import Project
from pootle_language.models import Language
from pootle_store.models import Store
def unit_dict(pootle_path):
"""prepare a translation submission dictioa... | lehmannro/pootle | local_apps/pootle_app/tests.py | Python | gpl-2.0 | 17,651 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2011, 2012, 2013, 2014 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 ... | MSusik/invenio | invenio/modules/ranker/models.py | Python | gpl-2.0 | 10,662 |
from resources.lib.handler.requestHandler import cRequestHandler
from resources.lib.handler.inputParameterHandler import cInputParameterHandler
from resources.lib.config import cConfig
from ctypes import *
import time
import random
class cStatistic:
STATISTIC_URL = 'http://www.google-analytics.com/__utm.gif'
... | Brahimbaz/venom-xbmc-addons-beta | plugin.video.vstream/resources/lib/statistic.py | Python | gpl-2.0 | 2,754 |
from sys import argv
import smbus
import dweepy
import time
import math
import RPi.GPIO as GPIO
from LSM9DS0 import *
import datetime
bus = smbus.SMBus(1)
RAD_TO_DEG = 57.29578
M_PI = 3.14159265358979323846
G_GAIN = 0.070 # [deg/s/LSB] If you change the dps for gyro, you need to update this value accordingly
LP = 0... | hrishioa/Navo | Raspi-Code/Lib/python-LSM9DS0-gryo-accel-compass/berryIMU.py | Python | gpl-2.0 | 8,179 |
#!/usr/bin/env python
import ldap
import csv
import sys
import subprocess
import optparse
import datetime
import operator
from datetime import date
# Parameters
energy = 0
# Global values
totalCPU = 0
totalEnergy = 0
def getargs():
today=date.today()
usage = "usage: %prog [options]"
... | rug-cit-ris/slurmacc | slurmacc.py | Python | gpl-2.0 | 16,164 |
#
# Copyright (C) 2018 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 ... | atodorov/anaconda | pyanaconda/core/configuration/target.py | Python | gpl-2.0 | 2,139 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import random
import datetime
import requests
import logging
from requests.exceptions import HTTPError, Timeout
from qms_core.models import CumulativeStatus, CheckStatusErrorType
from ..check_result import CheckResult
from .baseservice_checker import BaseServiceChecker
im... | nextgis/quickmapservices_server | qms_server/qms_core/status_checker/service_checkers/tms_checker.py | Python | gpl-2.0 | 5,761 |
# -*- 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 'Feedback'
db.create_table(u'web_feedback', (
... | VentureCranial/PawTrain | app/web/migrations/0001_initial.py | Python | gpl-2.0 | 33,178 |
"""ShutIt module. See http://shutit.tk
"""
from shutit_module import ShutItModule
class shutit(ShutItModule):
def build(self, shutit):
shutit.send('mkdir -p /opt')
shutit.send('cd /opt')
shutit.send('git clone https://github.com/ianmiell/shutit.git')
shutit.send('cd shutit')
shutit.send('pip install -r r... | ianmiell/shutit-distro | shutit/shutit.py | Python | gpl-2.0 | 743 |
#!/usr/bin/env python
"""
Reads an int from the command line or input prompt and draws the die.
Works with bash or Tk.
(* This does not work.)
"""
__author__ = 'Chris Horn <hammerhorn@gmail.com>'
from cjh.config import Config
from cjh.die import Die
SHELL = Config().start_user_profile()
if SHELL.interface in ['Tk', ... | hammerhorn/hammerhorn-jive | dice/draw_die.py | Python | gpl-2.0 | 606 |
#
# keyboard_layouts.py
#
# Copyright (C) 2014-2016 Kano Computing Ltd.
# License: http://www.gnu.org/licenses/gpl-2.0.txt GNU GPL v2
#
# Country code mappings to keyboard model names, and keyboard variant names
# collected from Debian console-setup source package, version 1.88:
# http://packages.debian.org/source/... | KanoComputing/kano-settings | kano_settings/system/keyboard_layouts.py | Python | gpl-2.0 | 21,738 |
try:
import gdal
file = raw_input()
ds = gdal.Open(file)
print ds.RasterCount
except Exception as exception:
raise ValueError(exception)
| NurymKenzh/GeoServer | GeoServer/Python/GetRasterBandsCount.py | Python | gpl-2.0 | 177 |
# -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
# Copyright (C) 2006 Lukáš Lalinský
#
# 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... | samj1912/picard | picard/formats/mp4.py | Python | gpl-2.0 | 10,938 |
#!/usr/bin/env python
#
# Copyright 2009 Mike Wakerly <opensource@hoho.com>
#
# This file is part of the Pykeg package of the Kegbot project.
# For more information on Pykeg or Kegbot, see http://kegbot.org/
#
# Pykeg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public... | Alwnikrotikz/kegbot | pykeg/src/pykeg/bin/kegbot_core.py | Python | gpl-2.0 | 980 |
__author__ = 'const' | constd/spicy-brew | spicybrew/__init__.py | Python | gpl-2.0 | 20 |
#!/usr/bin/python
import pcap
import dpkt
import socket
import struct
import time
srcip = '10.24.0.109'
dstip = '10.21.2.192'
srcport = 54321
dstport = None
def checksum(data):
s = 0
n = len(data) % 2
for i in range(0, len(data)-n, 2):
s+= ord(data[i]) + (ord(data[i+1]) << 8)
if n:
s+... | dengqian/tapo_comp | raw_socket/sack.py | Python | gpl-2.0 | 5,609 |
#!/usr/bin/python3
import os
class TextTree(object):
def tostring(self, object):
strings = self.tostrings(object)
return ''.join(strings)
def tostrings(self, object):
strings = [object.name + '\n']
def add_item(item, ps1, ps2):
if isinstance(item, str):
strings.append(ps1 + item + '\n')
else:
... | jaap-karssenberg/zim-desktop-wiki | tools/class_tree.py | Python | gpl-2.0 | 1,774 |
uiStrings = {'Random Access':'~/HM-16.2/cfg/encoder_randomaccess_main.cfg',
'Low Delay':'~/HM-16.2/cfg/encoder_lowdelay_main.cfg',
'BasketballPass':'~/HM-16.2/cfg/per-sequence/BasketballPass.cfg',
'BQMall':'~/HM-16.2/cfg/per-sequence/BQMall.cfg',
'8KB':'8192',
'16KB':'16384',
'32KB':'32768',
'4MB':'4194304',
'8MB':'838... | anamativi/profilingCallsCacheHM | UI/dic.py | Python | gpl-2.0 | 346 |
from Components.Sources.Source import Source
from Components.Converter import ServiceName
from Components.config import config
from Screens.InfoBar import InfoBar, MoviePlayer
from enigma import eServiceReference, iPlayableServicePtr
class SwitchService(Source):
def __init__(self, session):
Source.__init__(self)
... | carlo0815/enigma2-plugins | webinterface/src/WebComponents/Sources/SwitchService.py | Python | gpl-2.0 | 2,511 |
"""
Encoding and encryption routines of ASCII strings to roman numerals
with some randomness thrown in.
Copyright (C) Anand B Pillai 2013.
LICENSE: GPL v2.
"""
import sys
import math
import random
import itertools
import operator
import uuid
numeral_map = zip(
(1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4,... | pythonhacker/funcode | encode_roman.py | Python | gpl-2.0 | 2,584 |
#Copyright (C) 2002-2015 The Board of Regents of the University of Wisconsin System
#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... | sanyaade-mediadev/Transana | LibraryMap.py | Python | gpl-2.0 | 137,482 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright (C) 2005-2014 Francisco José Rodríguez Bogado, #
# Diego Muñoz Escalante. #
# (pacoqueen@users.sourceforge.ne... | pacoqueen/ginn | ginn/formularios/reports.py | Python | gpl-2.0 | 13,563 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_exams.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| Lapin-Blanc/django_exams | manage.py | Python | gpl-2.0 | 255 |
from restaurant.models import Resa, Fournisseur, Fourniture, Plat, Menu, ResaResto
from django.contrib import admin
class ResaRestoAdmin(admin.ModelAdmin):
exclude = ('reservationEcrasee', 'nbPassagers', 'nbPiquesNiques')
admin.site.register(Resa)
admin.site.register(Fournisseur)
admin.site.register(F... | simonpessemesse/seguinus | restaurant/admin.py | Python | gpl-2.0 | 434 |
from bs4 import BeautifulSoup
import re
import requests
import os
link_list = [ ]
base_url = "http://www.sec.gov/cgi-bin/browse-edgar?action=getcompany&CIK=CNAT&type=10-Q&datea=20140930&owner=exclude&output=xml&count=10"
r = requests.get(base_url)
data = r.text
soup = BeautifulSoup(data)
for link in soup.find_all('... | drkbyte/edgar | edgar.py | Python | gpl-2.0 | 764 |
#!/usr/bin/python
"""
Author: Deokwooo Jung deokwoo.jung@gmail.com
======================================================================
Learning and Visualizing the BMS sensor-time-weather data structure
======================================================================
This example employs several unsupervised... | TinyOS-Camp/DDEA-DEV | DDEA-QUASAR/ddea.py | Python | gpl-2.0 | 3,464 |
# coding: utf-8
# -------------------------------------------------------------------------------
# Name: sfp_names
# Purpose: Identify human names in content fetched.
#
# Author: Steve Micallef <steve@binarypool.com>
#
# Created: 24/03/2014
# Copyright: (c) Steve Micallef
# Licence: ... | Reality9/spiderfoot | modules/sfp_names.py | Python | gpl-2.0 | 5,507 |
# Copyright (C) 2011 Michal Zielinski (michal@zielinscy.org.pl)
#
# 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, or (at your option)
# any later version.
#
# This program is d... | javaxubuntu/freeciv-android | lib/freeciv/client/__init__.py | Python | gpl-2.0 | 9,292 |
from __future__ import unicode_literals
from django.db import models
from wagtail.admin.edit_handlers import (
FieldPanel, MultiFieldPanel, PageChooserPanel
)
from wagtail.documents.edit_handlers import DocumentChooserPanel
class AbstractLinkFields(models.Model):
"""Abstract class for link fields."""
li... | kingsdigitallab/shakespeare400-django | cms/models/links.py | Python | gpl-2.0 | 1,587 |
#!/usr/bin/python2
import os
import sys
if 'hostusb' in os.environ:
sys.stderr.write('hostusb: cannot migrate VM with host usb devices\n')
sys.exit(2)
| EdDev/vdsm | vdsm_hooks/hostusb/before_vm_migrate_source.py | Python | gpl-2.0 | 161 |
#
# gPrime - A web-based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
#
# 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 optio... | sam-m888/gprime | gprime/filters/rules/source/_matchesfilter.py | Python | gpl-2.0 | 1,694 |
class Utils(object):
def __init__(self):
pass
| opendatakosovo/kosovo-assembly-transcript-api | kata/utils/utils.py | Python | gpl-2.0 | 59 |
#!/usr/bin/python -tt
"""A Python program to analyse Sumo and OVNIS outpuy.
Try running this program from the command line:
python analyse.py
"""
import os
# import csv
import matplotlib
matplotlib.use('Agg') # headless mode
import matplotlib.pyplot as plt
import numpy as np
# import time
# from matplotlib.mlab imp... | agacia/ovnis | python/analyse.py | Python | gpl-2.0 | 32,722 |
import os
def set_directory(directory):
os.chdir(directory)
def get_available_abbreviations():
return os.listdir('../database/')
def get_abbreviation_list(list_name):
l = dict()
with open(list_name, 'r') as f:
for line in f:
for a, r, l in line.split(','):
l[a] = r... | Thalmann/AbbreviationGame | abbreviations/DAL.py | Python | gpl-2.0 | 475 |
# Sketch - A Python-based interactive drawing program
# Copyright (C) 1999, 2000, 2002 by Bernhard Herzog
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the Lice... | shumik/skencil-c | Script/create_star.py | Python | gpl-2.0 | 5,806 |
# -*- coding: utf-8 -*-
"""
Method of Characteristics Nozzle Design Code
@author: Peter Senior
email: pws1g13@soton.ac.uk
"""
import numpy
from numpy import sin, tan, arcsin, arctan
import matplotlib.pyplot as plt
def mu(M):
"""Calculates and returns the value of mu for a given mach number"""
return arcsin(1 ... | Italianmoose/Year-3-IP | Nozzle/Method-of-Characteristics/Plug/Plug MoC code v2.1.py | Python | gpl-2.0 | 2,107 |
# Copyright (C) 2013-2014 Fox Wilson, Peter Foley, Srijay Kasturi, Samuel Damashek, James Forcier and Reed Koser
#
# 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 Licen... | sckasturi/saltlake | commands/inspect.py | Python | gpl-2.0 | 1,307 |
#! /usr/bin/env python
# coding: utf8
#
# Modular REST API dispatcher in Python (dispytch)
#
# Copyright (C) 2015 Denis Pompilio (jawa) <denis.pompilio@gmail.com>
# Copyright (C) 2015 Cyrielle Camanes (cycy) <cyrielle.camanes@gmail.com>
#
# This file is part of dispytch
#
# This program is free software... | outini/dispytch | modules/munin/requests.py | Python | gpl-2.0 | 3,387 |
#!/usr/bin/env python
# **********************************************************************
#
# Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# *************************************... | sbesson/zeroc-ice | java/test/Ice/slicing/objects/run.py | Python | gpl-2.0 | 1,516 |
import numpy as np
import matplotlib.pyplot as plt
data = np.loadtxt('FE_vs_T_at_n_plot_hand_data')
T = data[:,0]
fe = data[:,2]
gw = data[:,3]
plt.plot(T, fe)
plt.axhline(0)
plt.xlabel('T')
plt.ylabel('Free energy difference')
plt.figure()
plt.plot(T, gw)
plt.xlabel('T')
plt.ylabel('width')
plt.show()
| droundy/deft | papers/fuzzy-fmt/FE_vs_T_at_n_plot_hand_data.py | Python | gpl-2.0 | 309 |
from pycdas.portal.cdas import *
import time, sys
startServer = False
portal = None
request_port = 5670
response_port = 5671
host = "cldra"
server = "localhost"
if host == "webmap":
dataset = "file:/att/gpfsfs/ffs2004/ppl/tpmaxwel/cdas/cache/collections/NCML/merra_mon_ua.xml"
var = "ua"
elif host == "cldra":
... | nasa-nccs-cds/CDAS2 | python/test/localPerformanceTests/zonalAveDemo.py | Python | gpl-2.0 | 2,568 |
from django.db.models import F
from . import PostingEndpoint, PostingMiddleware
class UpdateStatsMiddleware(PostingMiddleware):
def save(self, serializer):
self.update_category(self.thread.category, self.thread)
self.update_thread(self.thread, self.post)
self.update_user(self.user)
d... | 1905410/Misago | misago/threads/api/postingendpoint/updatestats.py | Python | gpl-2.0 | 1,287 |
# -*- coding: utf-8 -*-
# Copyright 2008-2015 Jaap Karssenberg <jaap.karssenberg@gmail.com>
'''The ExportLinker object translates links in zim pages to URLS
for the export content
'''
import logging
logger = logging.getLogger('zim.exporter')
#~ import base64
from .layouts import ExportLayout
from zim.formats im... | Osndok/zim-desktop-wiki | zim/export/linker.py | Python | gpl-2.0 | 8,234 |
# color.py color output for the status and qseries commands
#
# Copyright (C) 2007 Kevin Christen <kevin.christen@gmail.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
'''colorize output from some commands
This extension mod... | spraints/for-example | hgext/color.py | Python | gpl-2.0 | 19,828 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import Skype4Py
import psycopg2
import sys
import time
connection_string=open('./.dbconfig.dat','r').read()
cn=psycopg2.connect(connection_string)
cr=cn.cursor()
cr.execute('INSERT INTO skype_net_send("to", message) VALUES (%s, %s);',(sys.argv[1],sys.argv[2]))
cn.commit()
cr... | tech22info/skype-secretary | daemon/skype_netsend.py | Python | gpl-2.0 | 339 |
# Create your views here.
from django.views.generic import ListView
from rest_framework.response import Response
from rest_framework.decorators import api_view
from galery.models import CarouArt, AutreIllu, Logo, Faction, Sectorial, Photo, Fig
from galery.serializer import PhotoSerializer
class Main_carousel(ListView... | sylvainnizac/Djangoctopus | galery/views.py | Python | gpl-2.0 | 2,685 |
#!/usr/bin/env python
###########################################################################
# obd_sensors.py
#
# Copyright 2004 Donour Sizemore (donour@uchicago.edu)
# Copyright 2009 Secons Ltd. (www.obdtester.com)
#
# This file is part of pyOBD.
#
# pyOBD is free software; you can redistribute it and/or modify
... | lcintron/PyO-X | obd_sensors.py | Python | gpl-2.0 | 7,188 |
# Copyright (C) 2018 Andrew Vitu <a.p.vitu@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 of the License, or
# (at your option) any later version.
#
# This ... | sam-m888/addons-source | HouseTimelineGramplet/housetimeline.py | Python | gpl-2.0 | 8,826 |
suite = {
"name" : "mx",
"libraries" : {
# ------------- Libraries -------------
"JACOCOAGENT" : {
"urls" : ["https://lafo.ssw.uni-linz.ac.at/pub/jacoco/jacocoagent-0.7.1-1.jar"],
"sha1" : "2f73a645b02e39290e577ce555f00b02004650b0",
},
"JACOCOREPORT" : {
"urls" : ["https://lafo.... | olpaw/mx | mx.mx/suite.py | Python | gpl-2.0 | 5,084 |
__author__ = 'Rizzy'
import os
selection = os.listdir('D:/')
for each in selection:
if 'maya' in each.lower():
print each
| riasatmanzoor/maya-tools | test.py | Python | gpl-2.0 | 136 |
import json
import re
def main():
with open('replacedict.json') as data_file:
repl_dict = json.load(data_file)
with open('somethingtoreplace.txt') as data_file:
str_file = data_file.read()
for item,value in repl_dict.items():
print '{} : {}'.format(item,value)
... | ma-tri-x/pytry | replace.py | Python | gpl-2.0 | 713 |
from vsip.view import FVector
from vsip.cuda import dda
from vsip.cuda.module import Function, Module
import numpy
from struct import pack, unpack
def _pack_arguments(*args):
"""Pack arguments from `args` into a single `struct` and return
that, together with a list of objects to be destroyed post-call."""
... | maxywb/vsipl | sourceryvsipl++-x86-3.1/src/vsipl++/python/cuda/__init__.py | Python | gpl-2.0 | 2,621 |
#!/usr/bin/env python
"""
Copyright (C) Sarah Mount, 2010.
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 di... | snim2/benchmarkr | benchmarkr/__main__.py | Python | gpl-2.0 | 821 |
'''
Created on Jul 29, 2015
@author: krzysztof
'''
import unittest
import UserInputParse as uip
class Test(unittest.TestCase):
def setUp(self):
self.inp1 = ["-s", "/home/krzysztof/Programming/Eclipse/Python/CppPyDoc/tests/testFiles/combined.cpp",
"-d", "/home/krzysztof/Programming/... | rCorvidae/CppPyDoc | tests/unitTestUserInputParse.py | Python | gpl-2.0 | 3,258 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
"""
@author: chris.hill , <im.weittor#gmail.com>
@copyright: (C) 2014 weittor
@license: GNU General Public License version 2.0 (GPLv2)
@version: 0.1
@contact:
@var:
@type:
@param:
@return:
@rtype:
@note:
@attention:
@bug:
... | weittor/python-100 | module_textwrap.py | Python | gpl-2.0 | 1,184 |
# -*- mode: python; -*-
##
## Script to build an indexed representation of a GFF file for efficient
## retrieval of genes
##
import os
import sys
import time
import glob
import shelve
from collections import defaultdict
# Add misopy path
miso_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.... | Xinglab/rmats2sashimiplot | src/MISO/misopy/index_gff.py | Python | gpl-2.0 | 7,529 |
# pylint: disable=global-statement
from PyQt4.QtCore import QT_VERSION_STR
import string
import sys
import traceback
from kang import VERSION
__mainWindow = None
__showedexmess = set()
__debug = False
def init(mainWindow, debug=False):
"""
Initialize the module
"""
global __mainWindow
global _... | geckoblu/kang | kang/modules/exceptionHandler.py | Python | gpl-2.0 | 2,411 |
__module_name__ = "Tinyurl service plugin"
__module_version__ = "1.0"
__module_description__ = "Turns a long URL into a much shorter one."
__author__ = "Mikica Ivosevic"
import hexchat
import urllib2
def get_short_url(url):
res = urllib2.urlopen('http://tinyurl.com/api-create.php?url=' + url)
return res.read()
def... | mikicaivosevic/hexchat-shorturl-addon | short_url.py | Python | gpl-2.0 | 653 |
# vim: expandtab sw=4 ts=4 sts=4:
#
# Copyright © 2003 - 2018 Michal Čihař <michal@cihar.com>
#
# This file is part of python-gammu <https://wammu.eu/python-gammu/>
#
# 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 ... | gammu/python-gammu | test/test_data.py | Python | gpl-2.0 | 1,209 |
#!/usr/bin/python3
# Opening Facebook data files
with open('friends.htm', 'r') as file:
friend_file = [line.strip() for line in file][0]
with open('events.htm', 'r') as file:
event_file = [line.strip() for line in file][0]
with open('messages.htm', 'r') as file:
messages_file_line_list = [line.strip() for line in f... | Foggalong/Facebook-Data-Analyser | scrape.py | Python | gpl-2.0 | 10,780 |
""" A model of an Infrastructure Cluster in CFME
:var page: A :py:class:`cfme.web_ui.Region` object describing common elements on the
Cluster pages.
"""
from functools import partial
from navmazing import NavigateToSibling, NavigateToAttribute
from cfme.fixtures import pytest_selenium as sel
from utils.ap... | kzvyahin/cfme_tests | cfme/infrastructure/cluster.py | Python | gpl-2.0 | 5,046 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2014 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 theF ree Software Foundation; either version 2 of the
## License, or (at your option) a... | MSusik/invenio | invenio/modules/pidstore/testsuite/test_tasks_datacite.py | Python | gpl-2.0 | 2,632 |
from nestly import Nest
from nestly.scons import SConsWrap, name_targets
import os
import os.path
import numpy
import appconfig
config = appconfig.read('config.yaml')
# Base folder
nest = Nest()
wrap = SConsWrap(nest, os.path.join(config['cluster']['folder'],
config['cluster']['al... | koadman/proxigenomics | simulation/pipeline/SConstruct_srmcl.py | Python | gpl-2.0 | 4,892 |
import django.core.handlers.wsgi
import logging
from django.template import loader,Context,RequestContext
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response
from ebaysdk import finding
from ebaysdk.exception import ConnectionError
from ebayapi.api import *
from eb... | zoyoe/ectool | zoyoeec/core/ebay.py | Python | gpl-2.0 | 18,098 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('Departamento', '0001_initial'),
('Persona', '0001_initial'),
]
operations = [
migrations.CreateModel(
na... | jrmendozat/mtvm | Trabajador/migrations/0001_initial.py | Python | gpl-2.0 | 1,826 |
#!/usr/bin/env python
# vim: expandtab sw=4 ts=4 sts=4:
#
# Copyright © 2003 - 2018 Michal Čihař <michal@cihar.com>
#
# This file is part of python-gammu <https://wammu.eu/python-gammu/>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pu... | gammu/python-gammu | examples/debugging.py | Python | gpl-2.0 | 1,756 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django_resized.forms
import core.core
import content.models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Commit',... | ellipticaldoor/dfiid | project/content/migrations/0001_initial.py | Python | gpl-2.0 | 2,604 |
#XML-RPC Introspection Client -Chapter 8- xmlrpci.py
#这方法都要自己提供,有兴趣的可以看文档
import xmlrpc.client, sys
url = 'http://localhost:51423'
s = xmlrpc.client.ServerProxy(url)
print('Gathering avilable methods...')
methods = s.listMethods()
while True:
print('\n\nAvailable Method:')
for i in range(len(methods)):
... | jiangfire/python-network-py3code | chapter8/xmlrpci.py | Python | gpl-2.0 | 743 |
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from django.db.models import Q
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.db.models import get_model
from ..models import DispatchContainerRegister
from ..classes imp... | botswana-harvard/edc-dispatch | edc_dispatch/views/return_items.py | Python | gpl-2.0 | 1,951 |
################################################################################
# Copyright (C) 2015 Surfacingx #
# #
# This Program is free software; you can redistribute it and/or modify ... | theonekodi/repo.theone | plugin.program.theone.wizard/startup.py | Python | gpl-2.0 | 21,168 |
# This file is part of the sos project: https://github.com/sosreport/sos
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# version 2 of the GNU General Public License.
#
# See the LICENSE file in the source distribution ... | nijinashok/sos | sos/plugins/nvme.py | Python | gpl-2.0 | 1,479 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016 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 option) any later... | egabancho/invenio-sse | invenio_sse/config.py | Python | gpl-2.0 | 1,248 |
characters = [{'x': 13.1015625, 'id': '', 'direction': 'W', 'ondeath': [], 'y': 8.0859375, 'name': '139'}, {'x': 11.765625, 'id': '', 'direction': 'NW', 'ondeath': ['ADD', 'item', 'Health Pill'], 'y': 3.359375, 'name': '249'}, {'x': 16.60522421789796, 'id': '', 'random_walk_area': [14.0, 24.0, 5.0, 5.0], 'ondeath': ['R... | lumidify/fahrenheit451 | maps/MapBook2/characters.py | Python | gpl-2.0 | 759 |
import random
import time
from NaoModule import NaoModule
class MoodModule(NaoModule):
# -------------------------------------
# Setup Module
# -------------------------------------
def __init__(self, name):
NaoModule.__init__(self, name)
self.handles = dict()
# get... | FirefoxMetzger/naoProject | src/MoodModule.py | Python | gpl-2.0 | 4,833 |
__title__ = 'dash.exceptions'
__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
__copyright__ = 'Copyright (c) 2013-2014 Artur Barseghyan'
__license__ = 'GPL 2.0/LGPL 2.1'
__all__ = (
'BaseException', 'InvalidRegistryItemType', 'LayoutDoesNotExist',
'NoActiveLayout', 'PluginWidgetOutOfPlaceholderBoun... | georgistanev/django-dash | src/dash/exceptions.py | Python | gpl-2.0 | 1,080 |
#!/usr/bin/env python3
import sys
import yaml
with open('hardware.yaml') as f:
hw = yaml.load(f.read())
driver_submenus = \
hw['lirc']['main_menu']['submenus']['driver_select']['submenus']
for menu in driver_submenus:
try:
for item in driver_submenus[menu]['submenus']:
hw['lirc']['re... | matzrh/lirc | configs/split_hw.py | Python | gpl-2.0 | 1,139 |
from __future__ import unicode_literals
from django.db import models
class Model1(models.Model):
field1 = models.CharField(max_length=42)
field2 = models.TextField()
class Model2(models.Model):
field1 = models.CharField(max_length=42)
| novafloss/django-MacFly | testproject/testproject/apps/testapp/models.py | Python | gpl-2.0 | 251 |
"""
Repositories in cobbler are way to create a local mirror of a yum repository.
When used in conjunction with a mirrored kickstart tree (see "cobbler import")
outside bandwidth needs can be reduced and/or eliminated.
Copyright 2006, Red Hat, Inc
Michael DeHaan <mdehaan@redhat.com>
This software may be freely redist... | brenton/cobbler | cobbler/collection_repos.py | Python | gpl-2.0 | 1,942 |
from __future__ import absolute_import, unicode_literals
from oauthlib.oauth1 import RequestTokenEndpoint, AuthorizationEndpoint, ResourceEndpoint, AccessTokenEndpoint
from oauthlib.common import Request
class AuthProvider(RequestTokenEndpoint, AuthorizationEndpoint,
AccessTokenEndpoint, ResourceEn... | stacksync/auth | stacksync_oauth/provider.py | Python | gpl-2.0 | 1,384 |
# Umount.py -- Unmount file system on clients
# Copyright (C) 2007-2015 CEA
#
# This file is part of shine
#
# 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... | cea-hpc/shine | lib/Shine/Commands/Umount.py | Python | gpl-2.0 | 3,083 |
# FreeSpeak - a GUI frontend to online translator engines
# freespeak/translators/yahoo.py
#
## Copyright (C) 2005, 2006, 2007, 2008, 2009 Luca Bruno <lethalman88@gmail.com>
##
## This file is part of FreeSpeak.
##
## FreeSpeak is free software; you can redistribute it and/or modify
## it under the terms of the GNU... | BackupTheBerlios/freespeak | freespeak/translators/yahoo.py | Python | gpl-2.0 | 5,042 |
from Screens.ChoiceBox import ChoiceBox
from Screens.MessageBox import MessageBox
from Screens.ParentalControlSetup import ProtectedScreen
from Screens.Screen import Screen
from Screens.Standby import TryQuitMainloop
from Screens.TextBox import TextBox
from Components.config import config
from Components.ActionMap impo... | eurosata1/e2 | lib/python/Screens/SoftwareUpdate.py | Python | gpl-2.0 | 11,487 |
#!/usr/bin/env python
from __future__ import print_function
from __future__ import print_function
import sys
from collections import defaultdict
from KafNafParserPy import KafNafParser
class Centity:
def __init__(self, line=None):
self.id = ''
self.type = ''
self.filename = ''
sel... | rubenIzquierdo/opinion_miner_deluxePP | match_entities_by_distance.py | Python | gpl-2.0 | 5,954 |
#!/usr/bin/env python
# encoding: utf-8
"""Module for utilities concerning Wikipedia
"""
from __future__ import unicode_literals
import re
def create_article_url(prefix, title):
"""Creates url from prefix and title of the article
"""
title = term2wuri(title)
return "%s/%s" % (prefix, title)
def te... | effa/wikicorpora | utils/wiki_utils.py | Python | gpl-2.0 | 1,136 |
"""
2161 : 카드1
URL : https://www.acmicpc.net/problem/2161
Input :
7
Output :
1 3 5 7 4 2 6
"""
N = int(input())
array = list(range(1, N + 1))
trash = []
while len(array) > 1:
trash.append(array[0])
array = array[2:] + [array[1]]
trash.append(array[0])
print('{}'.format(' '.jo... | 0x1306e6d/Baekjoon | baekjoon/2161.py | Python | gpl-2.0 | 352 |
#!/bin/python3
# Complete the 'solve' function below.
#
# The function is expected to return an INTEGER.
# The function accepts INTEGER_ARRAY arr as parameter.
# OPTIMAL (based on Discussions)
#
def solve(a: [int]) -> int:
s = stack()
l: list[int] = [0] * len(a)
for i in range(len(a)):
while not... | vargax/ejemplos | python/hackerrank/hard.py | Python | gpl-2.0 | 2,507 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2011, 2012 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 opt... | kaplun/ops | modules/bibauthorid/lib/bibauthorid_webinterface.py | Python | gpl-2.0 | 148,959 |
from duinobot import *
import numpy as np
import time
import cPickle as pickle
class RobotC():
def __init__(self,nombre,ide,control):
self.nombre=nombre
self.id=ide
self.control=control
self.frente=0
self.posX=0
self.posY=0
self.angulo=0
... | Robots-Linti/guerra-de-robots | Cliente/Robot_cliente.py | Python | gpl-2.0 | 2,560 |
#
# Copyright IBM Corp. 2012
# Copyright 2013-2014 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.
#
# T... | futurice/vdsm | tests/vmTests.py | Python | gpl-2.0 | 50,090 |
#! /usr/bin/env python
'''
p_sig.py: Builtin constant signal
Copyright (c) 2010 Bill Gribble <grib@billgribble.com>
'''
from ..processor import Processor
from ..mfp_app import MFPApp
class Sig(Processor):
doc_tooltip_obj = "Emit a constant signal"
doc_tooltip_inlet = ["Value to emit (default: initarg 0)"]
... | bgribble/mfp | mfp/builtins/sig.py | Python | gpl-2.0 | 925 |
from Components.ActionMap import ActionMap
from Components.Sensors import sensors
from Components.Sources.Sensor import SensorSource
from Components.Sources.StaticText import StaticText
from Components.ConfigList import ConfigListScreen
from Components.config import getConfigListEntry
from Screens.Screen import Screen... | martinxp/openpli-oe-core | meta-dags/recipes-bsp/enigma2/enigma2-plugin-systemplugins-tempfancontrol/plugin.py | Python | gpl-2.0 | 10,871 |
# Copyright (C) 2008 Canonical Ltd
#
# 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 ... | jelmer/python-fastimport | fastimport/commands.py | Python | gpl-2.0 | 16,185 |
# -*-python-*-
# GemRB - Infinity Engine Emulator
# Copyright (C) 2003 The GemRB Project
#
# 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) ... | Tomsod/gemrb | gemrb/GUIScripts/GUIDefines.py | Python | gpl-2.0 | 10,331 |
# This Python file uses the following encoding: utf-8
__author__ = 'JackRao'
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data', one_hot=True)
def add_layer(inputs, in_size, out_size, activation_function=None):
Weights = tf.Variable(... | caterzy/JackPlayer | TFTest/Classification.py | Python | gpl-2.0 | 1,630 |
# coding=UTF-8
### Some global variables
CONF_NAME = 'server.conf'
LIB_DIRNAME = 'lib'
TEMPLATES_DIRNAME = 'templates'
DEBUG = True
# Import all stuff we need
import os
import sys
import socket
import cherrypy
import datetime
from mako.template import Template
from mako.lookup import Temp... | kdeldycke/cherrypy_mako_formish_ooop_boilerplate | server.py | Python | gpl-2.0 | 7,319 |
#!/usr/bin/python
import platform
import sys
from os import path
from os import system
import sqlite3
#from scatterhoard.dbhoard import initDB
#Configure wack usage based on OS. / for linux/unix/macos and \ for Windows
wack = "/"
systemPlatform = 'Linux'
if platform.system() == 'Windows':
wack = "\\"
systemPlatform... | grumblor/scatter-hoard | scatterhoard/shconfig.py | Python | gpl-2.0 | 4,180 |
import datetime
from django.utils.translation import ugettext_lazy as _
from django.contrib.contenttypes.models import ContentType
from applications import settings
try:
from django.utils import timezone
now = timezone.now
except ImportError:
now = datetime.datetime.now
def action_handler(verb, **kwa... | meletakis/collato | esn/applications/actions.py | Python | gpl-2.0 | 1,489 |