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 |
|---|---|---|---|---|---|
__author__ = 'suwelack'
from msml.io.mapper.base_mapping import *
import msml.model.generated.msmlScene as mod
import msml.model.generated.abaqus as ab
import msml.model.generated.msmlBase as mbase
from jinja2 import Template, Environment, PackageLoader
class Abaqus2StringMapping(BaseMapping):
def __init__(sel... | CognitionGuidedSurgery/msml | src/msml/io/mapper/abaqus2string_mapping.py | Python | gpl-3.0 | 3,374 |
'''
qobuz.api.easy
~~~~~~~~~~~~~~
Add 'get' to qobuz.api.raw, All requests made trough this method are
cached (see qobuz.cache.qobuz)
:part_of: kodi-qobuz
:copyright: (c) 2012-2018 by Joachim Basmaison, Cyril Leclerc
:license: GPLv3, see LICENSE for more details.
'''
from qobuz import conf... | tidalf/plugin.audio.qobuz | resources/lib/qobuz/api/easy.py | Python | gpl-3.0 | 4,196 |
"""
WSGI config for eve_site 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.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "eve_site.settings")
from django.core... | spatuloricaria/Uncap | eve_site/eve_site/wsgi.py | Python | gpl-3.0 | 391 |
"""
Management command to load language fixtures as tags
"""
from __future__ import unicode_literals
import csv
import os
import re
from django.contrib.auth.models import User
from django.core.management.base import BaseCommand, CommandError
from orb.models import Category, Tag
def has_data(input):
"""Identify... | mPowering/django-orb | orb/management/commands/load_orb_languages.py | Python | gpl-3.0 | 2,656 |
"""
Wviews: Worldview Solver for Epistemic Logic Programs
Build 1.0 - Port from C++ -> Python.
Copyright (C) 2014 Michael Kelly
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 Founda... | galactose/wviews | wview.py | Python | gpl-3.0 | 6,822 |
import pymongo
class BaseMigration(object):
def __init__(self,
host='127.0.0.1',
port='27017',
database=None,
user=None,
password=None,
url=None):
if url and database and user is not None: #provide auth_d... | DoubleCiti/mongodb-migrations | mongodb_migrations/base.py | Python | gpl-3.0 | 967 |
from ase import *
from ase.units import Ha
from ase.dft import monkhorst_pack
from ase.parallel import paropen
from ase.lattice.hexagonal import Graphite
from gpaw import *
from gpaw.response.cell import get_primitive_cell, set_Gvectors
kpts = monkhorst_pack((12,12,4))
kpts += np.array([1/24., 1/24., 1/8.])
a = 2.46 ... | ajylee/gpaw-rtxs | doc/tutorials/rpa/gs_graph.py | Python | gpl-3.0 | 1,358 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from settings import DISKS, FORCE_CLEAN, LOGLEVEL
from disk import Disk
def select_disk():
disks = []
for name, path in DISKS:
try:
disks.append(Disk(mount_point=path))
except FileNotFoundError:
print("{} is not a valid pa... | donkeyxote/rsync-backup | rsbackup/rsbackup.py | Python | gpl-3.0 | 832 |
from django.apps import AppConfig
class ReqsConfig(AppConfig):
name = 'reqs'
| inspectorbean/spat | reqs/apps.py | Python | gpl-3.0 | 83 |
#!/usr/bin/env python
# Thu, 13 Mar 14 (PDT)
# bpf-filter.rb: Create a packet filter,
# use it to print udp records from a trace
# Copyright (C) 2015, Nevil Brownlee, U Auckland | WAND
from plt_testing import *
t = get_example_trace('anon-v4.pcap')
filter = plt.filter('udp port 53') # Only want DNS ... | nevil-brownlee/pypy-libtrace | test/pypy-test-cases/test-bpf-filter.py | Python | gpl-3.0 | 780 |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import serialize
from twilio.base import values
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
from twilio.base.page im... | Vagab0nd/SiCKRAGE | lib3/twilio/rest/sync/v1/service/sync_stream/stream_message.py | Python | gpl-3.0 | 5,237 |
import re
import spotlight
from requests import ConnectionError, HTTPError
class EnglishQuestionParser():
"""
Poor-man's english question parser. Not even close to conclusive, but
appears to construct some decent w|a queries and responses.
__author__ = 'seanfitz'
"""
def __init__(... | JarbasAI/jarbas-core | mycroft/jarbas-skills/LILACS_core/question_parser.py | Python | gpl-3.0 | 5,535 |
# -*- coding: utf-8 -*-
#
# HelixMC documentation build configuration file, created by
# sphinx-quickstart on Thu Mar 21 15:51:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# A... | fcchou/HelixMC | doc/source/conf.py | Python | gpl-3.0 | 8,069 |
# -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 Viper2k4
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... | viranch/exodus | resources/lib/sources_de/streamkiste.py | Python | gpl-3.0 | 5,119 |
import os
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
TEST_ROOT = os.path.join(os.path.dirname(PROJECT_ROOT), "tests")
SINGLE_ORCA_RUN_FILE = os.path.join(PROJECT_ROOT, "code", "single_core_run_orca.py")
SINGLE_RUN_MOB_KMC_FILE = os.path.join(
PROJECT_ROOT, "code", "single_core_run_mob_KMC.py"
)
SING... | matty-jones/MorphCT | morphct/definitions.py | Python | gpl-3.0 | 419 |
from kivy.app import App
from kivy.uix.button import Button
class RobotControlApp(App):
def build(self):
return Button(text='Hello World')
if __name__ == '__main__':
RobotControlApp().run()
| develru/RobotControlCenterKivy | main.py | Python | gpl-3.0 | 210 |
# This file is part of Trackma.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... | Hairo/trackma | trackma/tracker/inotify.py | Python | gpl-3.0 | 3,446 |
from AccessControl.SecurityManagement import getSecurityManager
from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManagement import setSecurityManager
from Products.CMFCore.utils import getToolByName
from opencore.member.interfaces import IOpenMember
from opencore.member.utils i... | socialplanning/opencore | opencore/member/subscribers.py | Python | gpl-3.0 | 2,470 |
import abc
import numpy as np
from numpy.random import shuffle
class MazeSolveAlgo:
__metaclass__ = abc.ABCMeta
def solve(self, grid, start, end):
""" helper method to solve a init the solver before solving the maze
Args:
grid (np.array): maze array
start (tuple): pos... | theJollySin/mazelib | mazelib/solve/MazeSolveAlgo.py | Python | gpl-3.0 | 6,364 |
from .RuleEditor import *
class SeatingChart:
def __init__(self, m, n):
self.M, self.N = m, n
self._pos = list(range(len(self)))
self.names = None
self.rule_editor = RuleEditor(m, n)
self.maintain()
def __len__(self) -> int:
"""Return the number of students in ... | hr567/seating-chart | SeatingChart/API/SeatingChart.py | Python | gpl-3.0 | 2,072 |
# ##### 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... | Gamebasis/3DGamebasisServer | GameData/blender-2.71-windows64/2.71/scripts/freestyle/styles/blueprint_circles.py | Python | gpl-3.0 | 1,917 |
from multiprocessing import Process
import time
import commands
from socketconnection import SocketConnection
from json_message import *
from subprocess import Popen, PIPE, STDOUT
import sdnlb_conf
class HeartBeat (object):
def __init__(self,ip,services,sendEvent=False):
self.services = services
self.sendEvent =... | whinedo/sdnlb | sdnlb/heartbeat/heartbeat.py | Python | gpl-3.0 | 4,347 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
'''Pychemqt, Chemical Engineering Process simulator
Copyright (C) 2009-2017, Juan José Gómez Romera <jjgomera@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 Softwar... | jjgomera/pychemqt | tools/terminal.py | Python | gpl-3.0 | 2,742 |
# -*- coding: utf-8 -*-
"""
pint.quantity
~~~~~~~~~~~~~
:copyright: 2016 by Pint Authors, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import division, unicode_literals, print_function, absolute_import
import contextlib
import copy
import datetime
imp... | EternityForest/KaithemAutomation | kaithem/src/thirdparty/pint/quantity.py | Python | gpl-3.0 | 68,988 |
from pyspark.sql.types import StringType
from pyspark.sql.functions import udf
maturity_udf = udf(lambda age: "adult" if age >=18 else "child", StringType())
df = sqlContext.createDataFrame([{'name': 'Alice', 'age': 1}])
df.withColumn("maturity", maturity_udf(df.age))
| elmi-gemini/pyspark_utils | pyspark_udf-withcolumn.py | Python | gpl-3.0 | 273 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-05-23 11:29
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('gestioneide', '0019_auto_20160517_2232'),
]
operations = [
migrations.AlterF... | Etxea/gestioneide | gestioneide/migrations/0020_auto_20160523_1329.py | Python | gpl-3.0 | 471 |
from django.db import models
from django.utils import timezone
# Create your models here.
class Mail(models.Model):
"""
Mail objects are the entities which represents the mail to send.
"""
recipient = models.EmailField(max_length=256, blank=False, null=False)
reply_address = models.Email... | pelgoros/kwyjibo | mailing/models.py | Python | gpl-3.0 | 922 |
# -*- coding: utf-8 -*-
# This file is part of addfips.
# http://github.com/fitnr/addfips
# Licensed under the GPL-v3.0 license:
# http://opensource.org/licenses/GPL-3.0
# Copyright (c) 2016, fitnr <fitnr@fakeisthenewreal>
# pylint: disable=missing-docstring,invalid-name
import csv
import io
import subprocess
import sy... | fitnr/addfips | tests/test_cli.py | Python | gpl-3.0 | 3,471 |
from __future__ import print_function
# http://pyrocko.org - GPLv3
#
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
import sys
import logging
import os.path as op
from optparse import OptionParser
from pyrocko import util, scenario, guts, gf
from pyrocko import __version__
logger = lo... | pyrocko/pyrocko | src/apps/colosseo.py | Python | gpl-3.0 | 7,525 |
import argparse
import glob2
import os
def parse_args(args):
""" return results of parsing the given args
ie: "-c *.py -c *.img -c *.png -nc temp.py -n counter.html form.html -f / fallback.html -f /form fallbackform.html
returns
Namespace(cache=[['*.py'], ['*.img'], ['*.png']], fallba... | kdahlhaus/manifest_generator | manifestgen/args.py | Python | gpl-3.0 | 2,241 |
import pymongo
import logging
import time
# import sys
# import os
# sys.path.insert(0, os.path.normpath(os.path.join(__file__, '..', '..', '..')))
# from lib.db.base import Base
from .base import Base
logger = logging.getLogger('db.jolla')
client = pymongo.MongoClient()
db = client['jolla']
# TODO: support more sit... | TylerTemp/tomorrow | lib/db/jolla.py | Python | gpl-3.0 | 11,853 |
#!/usr/bin/env python3
# Copyright (C) 2017 Fioratto Raffaele
# 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 ... | ImperiumMaximus/budgie-cpupower-applet | applet/cpupower.py | Python | gpl-3.0 | 11,958 |
#============================================================================
# Name : circ-pic.py
# Author : Luke Mondy
# ============================================================================
#
# Copyright (C) 2012 Mondy Luke
#
# This program is free software: you can redistribute it and/or modify
#... | OlympusMonds/PyCircleriser | PyCircleriser.py | Python | gpl-3.0 | 8,228 |
# -*- coding: utf-8 -*-
import re
import urllib
import urlparse
from core import httptools
from core import scrapertools
from core.item import Item
from platformcode import config, logger
host = "https://www.porntrex.com"
def mainlist(item):
logger.info()
itemlist = []
config.set_setting("url_error", ... | pitunti/alfaPitunti | plugin.video.alfa/channels/porntrex.py | Python | gpl-3.0 | 12,905 |
# core.py - core library module for pyinsim
#
# Copyright 2008-2015 Alex McBride <xandermcbride@gmail.com>
#
# This software may be used and distributed according to the terms of the
# GNU Lesser General Public License version 3 or any later version.
#
# Dependencies
import socket
import asyncore
import traceback
impo... | alexmcbride/pyinsim | pyinsim/core.py | Python | gpl-3.0 | 18,391 |
# labs_coordinate_music
# Ben Fisher, 2016
# Released under the GNU General Public License version 3
import re
import copy
import codecs
import time
from labs_coordinate_music.coordmusicutil import *
from labs_coordinate_music.recurring_music_to_url import SaveDiskSpaceMusicToUrl
from labs_coordinate_music.recurring_l... | downpoured/labs_coordinate_music | labs_coordinate_music/recurring_coordinate.py | Python | gpl-3.0 | 22,111 |
# Copyright 2020-2021 Peppy Player peppy.player@gmail.com
#
# This file is part of Peppy Player.
#
# Peppy Player 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 you... | project-owner/Peppy | ui/screen/info.py | Python | gpl-3.0 | 9,237 |
### Generating picture frames to a "pic" folder
#from pylab import *
import numpy as np
from time import sleep
import matplotlib
matplotlib.use("Agg")
from matplotlib import rc
matplotlib.rcParams['text.usetex'] = True
matplotlib.rcParams['text.latex.unicode'] = True
import matplotlib.pyplot as plt
#matplotlib.use("A... | AlxMar/conduction-cylinder | genpics.py | Python | gpl-3.0 | 2,141 |
# Program to print raw data of the accelerometer device
import sys
sys.path.append ("../../../lib")
import accel
import time
import numpy
import os
A = accel.Init ()
while(1):
time.sleep(0.25)
os.system ("clear")
print "\n\n\n\n"
(status, x) = accel.get_x (A)
(status, y) = accel.get_y (A)
(s... | Daniel-Brosnan-Blazquez/DIT-100 | examples/IMU/acc/raw_data.py | Python | gpl-3.0 | 461 |
from particle import RandomParticle
import numpy as np
import matplotlib.pyplot as plt
from time import time
t0 = time()
num_of_paths = (50, 500, 5000)
max_num_of_collisions = 1000
particle = RandomParticle(1)
rms = np.zeros((3, max_num_of_collisions))
for n in range(3):
path = num_of_paths[n]
data = np.ze... | Jokiva/Computational-Physics | lecture 15/1a_init.py | Python | gpl-3.0 | 927 |
"""Tests for certbot.account."""
import datetime
import json
import os
import shutil
import stat
import unittest
import mock
import pytz
from acme import jose
from acme import messages
from certbot import errors
from certbot.tests import util
from certbot.tests.util import TempDirTestCase
KEY = jose.JWKRSA.load(... | nohona/cron-crm | usr/local/certbot/certbot/tests/account_test.py | Python | gpl-3.0 | 7,861 |
# coding: utf8
# kagami.py
# 10/10/2012 jichi
#
# Gospel, Gossip, Grimoire, Omajinai, and Mirage
#import textwrap
from functools import partial
from PySide.QtCore import Signal, Slot, Property, QObject, QTimer
from PySide.QtGui import QFont, QFontMetrics
from sakurakit import skdatetime
from sakurakit.skclass import c... | Dangetsu/vnr | Frameworks/Sakura/py/apps/reader/qml/kagami.py | Python | gpl-3.0 | 21,000 |
# -*- coding: utf-8 -*-
from django.views.generic import View
from django.contrib import messages
from django.contrib.auth import get_user_model
from django.core.urlresolvers import reverse
from django.core.mail import EmailMultiAlternatives
from django.shortcuts import redirect, resolve_url
from django.views.decorator... | labhackercd/colab-edemocracia-plugin | src/colab_edemocracia/views.py | Python | gpl-3.0 | 12,087 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'network'}
DOCUMENTATION = """
---
module: nxos_interfac... | mheap/ansible | lib/ansible/modules/network/nxos/nxos_interface.py | Python | gpl-3.0 | 26,385 |
# (C) British Crown Copyright 2013 - 2016, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | davidnmurray/iris | docs/iris/example_tests/test_polar_stereo.py | Python | gpl-3.0 | 1,351 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# BFRES Tool
# Version 5.1
# Copyright © 2017-2018 AboodXD
# This file is part of BFRES Tool.
# BFRES Tool 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, eith... | aboood40091/BFRES-Tool | structs.py | Python | gpl-3.0 | 1,321 |
"""empty message
Revision ID: 5ddd839de57c
Revises: 0b1bd71fb58d
Create Date: 2016-02-22 07:40:21.142754
"""
# revision identifiers, used by Alembic.
revision = '5ddd839de57c'
down_revision = '0b1bd71fb58d'
from alembic import op
import sqlalchemy as sa
def upgrade():
pass
def downgrade():
pass
| UMDIEEE/ieee-web | migrations/versions/5ddd839de57c_.py | Python | gpl-3.0 | 312 |
#! /usr/bin/env python3
# pylint: disable = no-self-use, attribute-defined-outside-init
import time
import tests.util
import tests.doubles
from yak_server import usbdevice
TIMEOUT = 0.1
class SwitchInterfaceV0_0_1ProtocolTest:
# pylint: disable = no-member
DEVICE_CLASS_ID = usbdevice.DeviceClassID(vendo... | snah/yak-software | yak_server/tests/protocol/test_switch_interface_protocol.py | Python | gpl-3.0 | 4,572 |
from sklearn.feature_extraction.text import TfidfVectorizer
import xgboost as xgb
import cPickle as pickle
from string import punctuation
from nltk import word_tokenize
from nltk.stem import snowball
import numpy as np
import pandas as pd
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
plt.style... | mgupta011235/TweetSafe | tfidf/train_xgboost.py | Python | gpl-3.0 | 7,095 |
# Bulletproof Arma Launcher
# Copyright (C) 2017 Lukasz Taczuk
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# b... | overfl0/Bulletproof-Arma-Launcher | src/utils/requests_wrapper.py | Python | gpl-3.0 | 2,188 |
"""
A pure Python "ping" implementation, based on a rewrite by Johannes Meyer,
of a script originally by Matthew Dixon Cowles. Which in turn was derived
from "ping.c", distributed in Linux's netkit. The version this was forked
out of can be found here: https://gist.github.com/pklaus/856268
I've rewritten nearly eve... | nicolacimmino/LoP-RAN | LoPAccessPoint/icmp_packet.py | Python | gpl-3.0 | 6,510 |
# coding=utf-8
# Author: Mr_Orange <mr_orange@hotmail.it>
# URL: https://sickrage.github.io
#
# This file is part of SickRage.
#
# SickRage 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 ... | cortedeltimo/SickRage | sickbeard/clients/transmission_client.py | Python | gpl-3.0 | 5,187 |
print "Creating downloadable package"
# Remove unwanted files
s=os.path.join(conf.t.dir,'testing')
rmrf(s)
os.rmdir(s)
s=os.path.join(conf.t.dir,'timing')
rmrf(s)
os.rmdir(s)
s=os.path.join(conf.t.dir,'reference')
rmrf(s)
os.rmdir(s)
# Recursively remove the .git files
for root, dirs, files in os.walk(conf.t.dir, t... | hagenw/ltfat | mat2doc/mat/release.py | Python | gpl-3.0 | 770 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import doctest
from proteindf_bridge.ssbond import SSBond
class SSBondTest(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
# def test_check(self):
# tmp_pdb = Pdb('./data/1hls.pdb')
# model... | ProteinDF/ProteinDF_bridge | tests/test_ssbond.py | Python | gpl-3.0 | 649 |
# Generic functions used by all the parsers
import time, datetime
import sysparse.syslog_parser
import sysparse.audit_parser
def time_convert(date):
year = time.localtime()[0]
date = str(year) + " " + date
intermediate_date = datetime.datetime.strptime(date, "%Y %b %d %H:%M:%S")
converted_date = inter... | jcastp/syslog_parsing | sysparse/libparser.py | Python | gpl-3.0 | 1,244 |
"""
Testing python specific API for Minimizer related classes.
"""
import sys
import os
import unittest
import bornagain as ba
class TestMinimizerHelper:
def __init__(self):
self.m_ncalls = 0
self.m_pars = None
def objective_function(self, pars):
self.m_ncalls += 1
self.m_pars... | gpospelov/BornAgain | Tests/Functional/PyFit/minimizer_api.py | Python | gpl-3.0 | 2,947 |
# -*- encoding: utf-8 -*-
# https://github.com/justintv/Twitch-API/blob/master/v3_resources/blocks.md
from twitch.queries import query
# Needs Authentification
@query
def by_name(user):
raise NotImplementedError
# Needs Authentification, needs PUT
@query
def add_block(user, target):
raise NotImplementedErr... | ingwinlu/python-twitch | twitch/api/v3/blocks.py | Python | gpl-3.0 | 430 |
from django.forms.formsets import BaseFormSet, formset_factory
from django.forms.models import BaseModelFormSet
from django.forms.models import modelformset_factory
from django import forms
from models import PlanillaHistoricas, ConceptosFolios, Folios, Tomos
class PlanillaHistoricasForm(forms.Form):
codi_empl_pe... | heraldmatias/django-payroll | src/inei/planilla/forms.py | Python | gpl-3.0 | 3,110 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import psutil
from common import bytes2human, right_text, title_text, tiny_font
def stats(interface):
def render(draw, width, height):
address = psutil.net_if_addrs()[interface][0].address
counters = psutil.net_io_counters(pernic=True)[interface]
... | delattreb/TemperatureHumidityServer | Doc/ssd1306-master/examples/hotspot/network.py | Python | gpl-3.0 | 822 |
import pdb
from pandas import HDFStore
import pandas.rpy.common as com
from rpy2.robjects import r
__version__ = "0.0"
def stat(year):
print("Calcul des statistiques individuelles")
simul = "C:/til/output/simul.h5"
simul = HDFStore(simul)
df = simul['entities/register']
df = df.loc[df['period... | TaxIPP-Life/til-france | til_france/pgm/output/stat_final.py | Python | gpl-3.0 | 737 |
# Copyright (C) 2013 Eliot Berriot <contact@eliotberriot.com>
#
# This file is part of savior.
#
# Savior 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) ... | EliotBerriot/savior | src/errors.py | Python | gpl-3.0 | 1,506 |
import logging
import signal
import socket
import configparser
import importlib.machinery
import serial
import copy
import zmq
class Dispatcher(object):
""" Superclass for all Dispatchers.
This is the part of the simulator that handles the connections.
"""
def __init__(self, dispatcher_type, dispatche... | InTraffic/TSTK | TSTK/dispatcher.py | Python | gpl-3.0 | 20,467 |
# Problem 28
# Starting with the number 1 and moving to the right in a clockwise direction a 5 by 5 spiral is formed as follows:
#
# 21 22 23 24 25
# 20 7 8 9 10
# 19 6 1 2 11
# 18 5 4 3 12
# 17 16 15 14 13
#
# It can be verified that the sum of the numbers on the diagonals is 101.
#
# What is the sum of the n... | chriscallan/Euler | Probs_1_to_50/028_NumberSpiralDiagonals.py | Python | gpl-3.0 | 3,489 |
from command import Command
import os
class Rm(Command):
name = 'rm'
desc = 'Removes a file or directory'
usage = 'rm <file|dir>'
author = 'native'
def call(self, args=None):
if args is not None and len(args) > 0:
path = self.dire.realdir + '/' + args[0]
try:
... | ThePerkinrex/PercOS | PercOS_filesystem/bin/rm.py | Python | gpl-3.0 | 406 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import os, locale, sys
from core import controller
locale.setlocale(locale.LC_ALL, 'fr_FR.UTF-8')
debug = False
if len(sys.argv) > 1: debug = sys.argv[1] == '-d'
# Initialisation du controller principale
ctrl = controller.Controller(debug)
# démarrage du serveur
ctrl.run() | btouchard/piserver | src/piserver.py | Python | gpl-3.0 | 320 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2014 emijrp
# 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 versio... | 15Mpedia/15Mpedia-scripts | completa-circulos-podemos.py | Python | gpl-3.0 | 4,844 |
# Copyright (C) 2012-2016 Julie Marchant <onpon4@riseup.net>
#
# This file is part of the Pygame SGE.
#
# The Pygame SGE is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, ... | iirlas/OpenJam-2017 | sge/gfx.py | Python | gpl-3.0 | 106,231 |
from __future__ import absolute_import
from sippers import logger
from sippers.utils import build_dict
from sippers.adapters.endesa import EndesaSipsAdapter, EndesaMeasuresAdapter
from sippers.models.endesa import EndesaSipsSchema, EndesaMeasuresSchema
from sippers.parsers.parser import Parser, register
class Endesa... | gisce/sippers | sippers/parsers/endesa.py | Python | gpl-3.0 | 2,937 |
#!/usr/bin/env python
# encoding: utf-8
from __future__ import print_function
from waflib import Build, ConfigSet, Configure, Context, Errors, Logs, Options, Utils
from waflib.Configure import conf
from waflib.Scripting import run_command
from waflib.TaskGen import before_method, feature
import os.path, os
from collec... | collmot/ardupilot | Tools/ardupilotwaf/ardupilotwaf.py | Python | gpl-3.0 | 16,193 |
from django.test import TestCase
from ..factories import IssueSubmissionFactory
from ..models import IssueSubmission
class IssueSubmissionTestCase(TestCase):
def test_version(self):
issue = IssueSubmissionFactory()
copy = issue.save_version()
self.assertEqual(issue.journal, copy.journal)... | thetoine/eruditorg | erudit/core/editor/tests/test_models.py | Python | gpl-3.0 | 927 |
import urllib2, sys, threading, time, os, mt
from mt import threads
class PackageDownloader(threads.Thread):
class fileDownload():
def __init__(self, url, save_to):
self.url = url
self.save_to = save_to
self.response = urllib2.urlopen(url)
self.size = int(sel... | andr3wmac/metaTower | packages/package_manager/downloader.py | Python | gpl-3.0 | 3,038 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2009 Mitja Kleider
#
# This file is part of Openstreetbugs.
#
# Openstreetbugs 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 t... | derickr/openstreetbugs | stats/stats.py | Python | gpl-3.0 | 2,957 |
#!/usr/bin/env python
# counts the number of words in a text file. Also works for the same word multiple times on one line.
# usage: script FILE WORD
# cf: http://bytes.com/topic/python/answers/797207-regular-expressions-get-number-matches
import sys
import re
txt=open(sys.argv[1]).read()
len(txt)
rexp = re.compile(s... | KIAaze/bin_and_dotfiles_public | bins/public_bin/count_words.py | Python | gpl-3.0 | 373 |
"""
Contains all unit tests for the Tools app.
"""
# Django
# from django.conf import settings
# from django.core.files.uploadedfile import SimpleUploadedFile
from django.test import TestCase
from django.urls import reverse
# from django.utils import timezone
# local Django
# from accounts.models import User
# from e... | sigdotcom/acm.mst.edu | ACM_General/tools/tests.py | Python | gpl-3.0 | 857 |
from multiprocessing import Process, Array
from multiprocessing import Event as Stop
from numpy import exp, linspace, meshgrid, column_stack, ndarray
from sklearn.neighbors import KernelDensity
from .parameters import GridMapperParams, KDE_PARAMETERS
ARRAY = type(Array('d', 10))
class GridMapper(Process):
def __... | yedivanseven/LPDE | sklKDE/density/gridmapper.py | Python | gpl-3.0 | 1,899 |
#!/usr/bin/env python
#
# Copyright (C) 2013 Google Inc.
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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 you... | tokuhirom/ycmd | ycmd/handlers.py | Python | gpl-3.0 | 7,766 |
# -*- coding: utf-8 -*-
"""
Copyright (C) 2013 Dariusz Suchojad <dsuch at zato.io>
Licensed under LGPLv3, see LICENSE.txt for terms and conditions.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
# Bunch
from bunch import Bunch
# Zato
from zato.common import zato_namespace
fr... | alirizakeles/zato | code/zato-server/test/zato/server/service/internal/kvdb/data_dict/test_impexp.py | Python | gpl-3.0 | 1,497 |
"""
compact_group.py - Part of millennium-compact-groups package
Defines CompactGroup object to handle information about a single
compact group.
Copyright(C) 2016 by
Trey Wenger; tvwenger@gmail.com
Chris Wiens; cdw9bf@virginia.edu
Kelsey Johnson; kej7a@virginia.edu
GNU General Public License v3 (GNU GPLv3)
This pro... | tvwenger/millennium-compact-groups | compact_group.py | Python | gpl-3.0 | 5,674 |
'''
This is not really a package init file, it is only here to simplify the
packaging and installation of pubsub.core's protocol-specific subfolders
by setuptools. The python modules in this folder are automatically made
part of pubsub.core via pubsub.core's __path__. Hence, this should not
be imported directly, ... | TaskEvolution/Task-Coach-Evolution | taskcoach/taskcoachlib/thirdparty/pubsub/core/arg1/__init__.py | Python | gpl-3.0 | 648 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0030_add_field_service_to_connections'),
]
operations = [
migrations.AddField(
model_name='productionserv... | efornal/pulmo | app/migrations/0031_add_field_url_to_servers.py | Python | gpl-3.0 | 1,551 |
from GangaCore.testlib.GangaUnitTest import GangaUnitTest
from GangaGUI.api import internal
# ******************** Test Class ******************** #
# Templates API Tests
class TestGangaGUIInternalTemplatesAPI(GangaUnitTest):
# Setup
def setUp(self, extra_opts=[]):
super(TestGangaGUIInternalTemplat... | ganga-devs/ganga | ganga/GangaGUI/test/test_internal_templates_api.py | Python | gpl-3.0 | 3,358 |
'''
Created on Sep 27, 2013
@author: leal
Default JSON MESSAGES
'''
import ast
import logging
import config.config
logger = logging.getLogger(__name__)
class Messages(object):
'''
classdocs
'''
messageTemplate = """{
'success' : '%r',
'message' : '%s',
'details' : %r
... | ricleal/reductionServer | src/data/messages.py | Python | gpl-3.0 | 1,661 |
#!/usr/bin/env python
import itertools as it
import ubelt as ub
def check_relationships(branches):
ancestors = {b: set() for b in branches}
length = len(branches) * (len(branches) - 1)
for b1, b2 in ub.ProgIter(it.combinations(branches, 2), length=length):
ret = ub.cmd('git merge-base --is-ancest... | Erotemic/local | git_tools/git_branch_relationships.py | Python | gpl-3.0 | 2,945 |
#!/usr/bin/env python3
import kxg
import pyglet
from .world import Player
from .messages import SetupPlayer, MakeInvestment
class Gui:
def __init__(self):
self.window = pyglet.window.Window()
self.window.set_visible(True)
self.batch = pyglet.graphics.Batch()
self.texts = []
... | kxgames/seacow_economy_minigame | src/gui.py | Python | gpl-3.0 | 2,254 |
#!/usr/bin/env python
'''
Using Arista's pyeapi, create a script that allows you to add a VLAN (both the
VLAN ID and the VLAN name). Your script should first check that the VLAN ID is
available and only add the VLAN if it doesn't already exist. Use VLAN IDs
between 100 and 999. You should be able to call the script ... | the-packet-thrower/pynet | Week07/ex2_vlan.py | Python | gpl-3.0 | 3,369 |
from prometheus import login_manager
from . import auth
from flask import render_template, url_for, redirect, request, flash
from flask.ext.login import login_user, logout_user, login_required
from prometheus.models.auth import User, Role
from .forms import LoginForm
login_manager.login_view = 'auth.login'
@login_man... | kickapoo/prometheus | prometheus/blueprints/auth/views.py | Python | gpl-3.0 | 1,737 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Chatham Financial <oss@chathamfinancial.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... | andsens/ansible-modules-extras | messaging/rabbitmq_user.py | Python | gpl-3.0 | 7,797 |
import requests
from requests.utils import quote
from bs4 import BeautifulSoup
from telegram import Emoji, InlineQueryResultArticle, InlineQueryResultPhoto, InputTextMessageContent
import os, strings
lang = os.environ.get('lang')
def serialize(near, date=0, time=0, sort=0, q='', id=''):
url = "http://google.com/mov... | cauebs/cineminha-bot | fetch.py | Python | gpl-3.0 | 4,972 |
T = input()
while(T):
T -= 1
s = input()
s = str(oct(s))
if s == s[::-1]:
print 1
else:
print -1
| Dawny33/Code | CodeChef/CDAV14/PND.py | Python | gpl-3.0 | 134 |
#!/usr/bin/env python
import json
import logging
import tempfile
import unittest
import pytest
from tests.utils.issue_mock import IssueMock
from tests.utils.repo_mock import RepoMock
from tests.utils.helpers import get_issue
from ansibullbot.triagers.plugins.ci_rebuild import get_rebuild_merge_facts
from ansibullbot... | jctanner/ansibullbot | tests/unit/triagers/plugins/test_rebuild_merge.py | Python | gpl-3.0 | 3,614 |
from io import BytesIO
try:
import simplejson as json
except ImportError:
import json
try:
import msgpack
has_msgpack = True
except ImportError:
has_msgpack = False
class SpecialBase(object):
def __init__(self, *args, **kvargs):
self.encoding = 'utf-8'
def json(self, *args, **kvarg... | waipu/bakawipe | lib/sup/special.py | Python | gpl-3.0 | 2,073 |
'''
This file is part of evopy.
Copyright 2012, Jendrik Poloczek
evopy 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.
evopy is distribut... | jpzk/evopy | evopy/examples/problems/SchwefelsProblem26/ORIDSESAlignedSVC.py | Python | gpl-3.0 | 2,196 |
#!/usr/bin/env python
#
# Copyright 2005,2006,2007 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at you... | trnewman/VT-USRP-daughterboard-drivers_python | gnuradio-examples/python/usrp/usrp_wfm_rcv2_nogui.py | Python | gpl-3.0 | 5,930 |
RUN_AUTO = 0 # First item of this block is cued right after last item of previous block
RUN_MANUAL = 1 # Playback stops at the end of the last item of previous block
RUN_SOFT = 2 # First item of this block is cued if previous block is running and current_time >= scheduled_time
RUN_HARD = 3 # First... | immstudios/nebula-core | nebulacore/constants/run_modes.py | Python | gpl-3.0 | 439 |
import calendar
from dateutil.parser import parse
import os
from os import listdir
from os.path import isfile, join
from selfspy import config as cfg
from objc import YES, NO
from AppKit import *
from CBGraphView import CBGraphView
TIMELINE_WIDTH = 960
TIMELINE_HEIGHT = 20
WINDOW_PADDING = 18
def unixTimeFromStr... | activityhistory/selfspy | selfspy/helpers.py | Python | gpl-3.0 | 3,410 |
"""Grab the tips from Options.xml
$Id: extopts.py,v 1.1 2007/01/14 14:07:31 stephen Exp $
Originally ROX-Filer/src/po/tips.py by Thomas Leonard.
"""
from xml.sax import *
from xml.sax.handler import ContentHandler
import os, sys
class Handler(ContentHandler):
data = ""
def startElement(self, tag, attrs):
for x i... | nilsonmorales/Badass | Packages_POU/pre-paquetes/20140430/20140430.pet/usr/share/local/apps/VideoThumbnail/extopts.py | Python | gpl-3.0 | 1,009 |
# coding=utf-8
# Author: Dustyn Gibson <miigotu@gmail.com>
#
# URL: https://sick-rage.github.io
#
# This file is part of SickRage.
#
# SickRage 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 ... | Arcanemagus/SickRage | sickbeard/providers/speedcd.py | Python | gpl-3.0 | 7,229 |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2011 thomasv@gitorious
#
# 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... | wozz/electrum-myr | lib/transaction.py | Python | gpl-3.0 | 30,650 |
# -*- coding: utf-8 -*-
# Royal HaskoningDHV
from xsboringen.scripts.write_csv import write_csv
from xsboringen.scripts.write_shape import write_shape
from xsboringen.scripts.plot import plot_cross_section
import click
import yaml
from collections import ChainMap
import logging
import os
log = logging.getLogger(os.... | tomvansteijn/xsb | xsboringen/scripts/xsb.py | Python | gpl-3.0 | 1,552 |
#!/usr/bin/env python
"""
This script generates the ROBODOC headers located in the Abinit directories (e.g src/70_gw/_70_gw_)
Usage: mkrobodoc_dirs.py abinit/src/
"""
from __future__ import print_function
import sys
import os
import fnmatch
def is_string(s):
"""True if s behaves like a string (duck typing test)."... | abinit/abinit | fkiss/mkrobodoc_dirs.py | Python | gpl-3.0 | 5,753 |