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 |
|---|---|---|---|---|---|
from npoapi.npoapi import NpoApi
class Schedule(NpoApi):
def get(self, guideDay=None, channel=None, sort="asc", offset=0, limit=240, properties=None, accept=None):
params = {
'guideDay': guideDay,
"sort": sort,
"max": limit,
"offset": offset,
"p... | npo-poms/pyapi | npoapi/schedule.py | Python | gpl-3.0 | 871 |
import sys
import os
from ..data.molecular_species import molecular_species
from ..data.reaction_mechanism_class import reaction_mechanism
from ..data.condition_class import condition
from ..data.reagent import reagent
from ..data.puzzle_class import puzzle
from ..data.solution_class import solution
def name(class_obj... | ckwatson/kernel | tests/quick_test.py | Python | gpl-3.0 | 893 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import tkinter as tk
from tkinter import ttk
from multiprocessing import pool
import numpy as np
import stat_functions as stat
from scipy import stats as scstats
from gui import gui_functions as guif
import os
import functions as fu
class process_charts(ttk.Frame):
de... | espensirnes/paneltime | build/lib.win-amd64-3.7/paneltime/gui/gui_charts.py | Python | gpl-3.0 | 4,478 |
compiler = './icc.py'
mpicompiler = './icc.py'
mpilinker = 'MPICH_CC=gcc mpicc'
scalapack = True
library_dirs += ['/opt/intel/Compiler/11.0/074/mkl/lib/em64t']
libraries = ['mkl_intel_lp64' ,'mkl_sequential' ,'mkl_core',
'mkl_lapack',
'mkl_scalapack_lp64', 'mkl_blacs_intelmpi_lp64',
... | robwarm/gpaw-symm | doc/install/Linux/customize_juropa_icc_libxc.py | Python | gpl-3.0 | 743 |
# -*- coding: utf-8 -*-
"""
Hardware file for the Superconducting Magnet (SCM)
QuDi 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.
QuDi is... | tobiasgehring/qudi | hardware/sc_magnet/magnet.py | Python | gpl-3.0 | 62,977 |
import re
import lxml.html
from pupa.scrape import Scraper, Organization
class WYCommitteeScraper(Scraper):
members = {}
urls = {
"list": "http://legisweb.state.wy.us/LegbyYear/CommitteeList.aspx?Year=%s",
"detail": "http://legisweb.state.wy.us/LegbyYear/%s",
}
def scrape(self, sessi... | cliftonmcintosh/openstates | openstates/wy/committees.py | Python | gpl-3.0 | 1,983 |
#!/usr/bin/env python
# gRefer is a Bibliographic Management System that uses Google Docs
# as shared storage.
#
# Copyright (C) 2011 NigelB
#
# 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 Soft... | nigelb/gRefer | gRefer/filer/startup.py | Python | gpl-3.0 | 1,643 |
"""
Load this into a Python Script widget (does not have
to be connected to any other widgets), and set the
project directory to the location of the git repo.
Hit execute and enjoy!
"""
PROJECT_DIR = '/home/mahmoud/work/qualityvis'
import sys
sys.path.append(PROJECT_DIR)
sys.path.append(PROJECT_DIR+'/orange_scripts'... | slaporte/qualityvis | orange_scripts/project_setup.py | Python | gpl-3.0 | 321 |
a = 'GeeksforGeeks'
# initialising a byte object
c = b'GeeksforGeeks'
# using encode() to encode the String
# encoded version of a is stored in d
# using ASCII mapping
d = a.encode('ASCII')
# checking if a is converted to bytes or not
if (d==c):
print ("Encoding successful")
else : print ("Encoding Unsuccessf... | srinivasanmit/all-in-all | G4G/byte_vs_string_obj.py | Python | gpl-3.0 | 683 |
from dcgpy import expression_gdual_double as expression
from dcgpy import kernel_set_gdual_double as kernel_set
from pyaudi import gdual_double as gdual
# 1- Instantiate a random expression using the 4 basic arithmetic operations
ks = kernel_set(["sum", "diff", "div", "mul"])
ex = expression(inputs = 1,
... | darioizzo/d-CGP | doc/examples/getting_started.py | Python | gpl-3.0 | 1,313 |
import random
from django.http import HttpResponse
from httplib import HTTPConnection, HTTPSConnection
from urlparse import urlsplit
import httplib2
import urllib
from django.utils import simplejson as json
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.utils.html... | cga-harvard/cga-worldmap | geonode/proxy/views.py | Python | gpl-3.0 | 15,886 |
#!/usr/bin/env python
from . import memfbf
from numpy import append
import os
import logging
from glob import glob
LOG = logging.getLogger(__name__)
class SlicerFrame(dict):
pass
class FBFSlicer(object):
"""Given a workspace directory of flat binary files, grab all useful filenames and return a record of... | davidh-ssec/pyfbf | pyfbf/slicer.py | Python | gpl-3.0 | 3,928 |
#!/usr/bin/python
# Copyright 2013 Gandi SAS
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later versio... | ericgarrigues/ansible-modules-extras | cloud/gandi/gandi_iface.py | Python | gpl-3.0 | 7,326 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#-----------------------------------------------------------------------#
# #
# This file is part of the Parametric Workbench #
# ... | David-Estevez/Parametric | Parametric/RecomputeParameters.py | Python | gpl-3.0 | 2,887 |
#
# Ophidia WPS Module
# Copyright (C) 2015-2021 CMCC Foundation
#
# 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 la... | OphidiaBigData/ophidia-wps-module | processes/__init__.py | Python | gpl-3.0 | 740 |
from rest_framework import generics
from django.utils.translation import ugettext_lazy as _
from django.utils import timezone
from aklub.models import UserProfile, AdministrativeUnit
from oauth2_provider.contrib.rest_framework import TokenHasReadWriteScope
from rest_framework import serializers
from rest_framework.p... | auto-mat/klub | apps/api/frontend/unknown_user_apply_for_membership_unit.py | Python | gpl-3.0 | 4,109 |
#cash register
#Samuel Armstrong
| samuelarm/A-Level_2016-18 | general/cash register.py | Python | gpl-3.0 | 45 |
# -*- coding: utf-8 -*-
import re
from pyload.plugin.Account import Account
class StahnuTo(Account):
__name = "StahnuTo"
__type = "account"
__version = "0.05"
__description = """StahnuTo account plugin"""
__license = "GPLv3"
__authors = [("zoidberg", "zoidberg@mujmail.cz")]
... | ardi69/pyload-0.4.10 | pyload/plugin/account/StahnuTo.py | Python | gpl-3.0 | 991 |
import SeqIterator
import Constants
"""
@author: Jacob Porter
@summary: An iterator class for iterating through two sequence record files simultaneously.
@requires: SeqIterator
"""
class SeqDoubleIterator:
def __init__(self, file_name1, file_name2, file_type=Constants.FASTQ, gzip_switch = False):
sel... | JacobPorter/BisPin | Utilities/SeqDoubleIterator.py | Python | gpl-3.0 | 775 |
# -*- coding: utf-8 -*-
# (c) Manuel Guil
# © 2016 Esther Martín - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import models, fields, api
class SaleOrder(models.Model):
_inherit = "sale.order"
period_ack = fields.Char(string='ACK Period', size=6, required=True)
... | esthermm/enco | enco_sale_order_ext/models/sale_order.py | Python | gpl-3.0 | 492 |
import unicodedata
import re
class PathExtension:
"""
Enables readable url path names instead of ids for object traversal.
Names are stored as meta.pool_filename and generated from
title by default. Automatic generation can be disabled by setting
*meta.customfilename* to False for each object.... | nive/nive | nive/extensions/path.py | Python | gpl-3.0 | 8,830 |
# -*- coding: utf-8 -*-
#
# spherepy documentation build configuration file, created by
# sphinx-quickstart on Sat Feb 7 21:35:42 2015.
#
# 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.
#
# ... | rdireen/spherepy | documentation/source/conf.py | Python | gpl-3.0 | 9,496 |
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.utils.translation import ugettext
from django.contrib.auth.decorators import login_required
from django.contrib.admin.views.dec... | hzlf/openbroadcast | website/apps/invitation/views.py | Python | gpl-3.0 | 7,841 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-12-21 14:58
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('carts', '0007_auto_20161221_1337'),
]
operations = [
migrations.AddField(
... | michel-rodrigues/ecommerce2 | source/carts/migrations/0008_cart_tax_percentage.py | Python | gpl-3.0 | 489 |
# -*- coding: utf-8 -*-
from transH import TransH
import pickle
import numpy as np
import sys
def main():
if len(sys.argv) != 3:
print '[Usage] python train.py train_data validation_data'
exit(0)
train_data, valid_data = sys.argv[1:]
X, E, R = loadData(train_data)
V = loadData(valid_data, E=E, R=R, mode='va... | Taka-Coma/graphEmbedding_impls | TransH/train.py | Python | gpl-3.0 | 1,186 |
"""
Tools to put to good use INE data
""" | JoaquimPatriarca/senpy-for-gis | gasp/ine/__init__.py | Python | gpl-3.0 | 41 |
#!/usr/bin/env python
from pylab import *
# create some data to use for the plot
dt = 0.001
t = arange(0.0, 10.0, dt)
r = exp(-t[:1000]/0.05) # impulse response
x = randn(len(t))
s = convolve(x,r)[:len(x)]*dt # colored noise
# the main axes is subplot(111) by default
plot(t, s)
#axis([0, 1, 1.1*amin(s... | lol/BCI-BO-old | orig_sig.py | Python | gpl-3.0 | 1,025 |
import glob
import sys
import serial
def serial_ports():
""" Lists serial port names
:raises EnvironmentError:
On unsupported or unknown platforms
:returns:
A list of the serial ports available on the system
"""
if sys.platform.startswith('win'):
ports = [... | pliniopereira/ccd3 | src/utils/rodafiltros/Leitura_portas.py | Python | gpl-3.0 | 920 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# ecp.py part of cellery (ceRNAs linking inference)
#
# Copyright 2016 Oscar Bedoya Reina <obedoya@igmm-linux-005>
#
# 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... | oscarcbr/cellery | cellery/ecp.py | Python | gpl-3.0 | 11,283 |
import logging
import pandas as pd
from catalog.core.search_indexes import PublicationDocSearch
from ..data_access import data_cache, IncludedStatistics
from query import Query
logger = logging.getLogger(__name__)
def _create_count_dataframe(df):
return df.groupby(['year_published']) \
.agg(dict(title=... | comses/catalog | catalog/core/visualization/data_sources/publication_counts.py | Python | gpl-3.0 | 1,439 |
# Contains functionality for responses
import numpy as np
import astropy.io.fits as fits
__all__ = ["RMF", "ARF"]
class RMF(object):
def __init__(self, filename):
self._load_rmf(filename)
pass
def _load_rmf(self, filename):
"""
Load an RMF from a FITS file.
Paramet... | dhuppenkothen/clarsach | clarsach/respond.py | Python | gpl-3.0 | 10,929 |
import numpy as np
import unittest
import logging
class _BaseTest(unittest.TestCase):
# def energy_test(self, x, e):
# e = self.pot.getEnergy(x)
# print e
# self.assertAlmostEqual(e, self.target_E, 4)
def grad_t(self, x):
log= logging.getLogger( "BaseTest.grad_t" )
... | js850/pele | pele/potentials/tests/_base_test.py | Python | gpl-3.0 | 1,834 |
__author__ = "Wren J. R. (uberfastman)"
__email__ = "wrenjr@yahoo.com"
# code snippets taken from: http://stackoverflow.com/questions/24419188/automating-pydrive-verification-process
import datetime
import logging
from pathlib import Path
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
from... | uberfastman/yahoo-fantasy-football-metrics | integrations/drive_integration.py | Python | gpl-3.0 | 8,962 |
#!/usr/bin/env python
"""rds-create-cpu-alarms
Script used to create CPUUtilization alarms in AWS CloudWatch
for all RDS instances.
A upper-limit threshold needs to be defined.
Usage:
rds-create-cpu-alarms [options] <threshold> <sns_topic_arn> <region>
rds-create-cpu-alarms -h | --help
Options:
-h --help... | percolate/rds-create-cpu-alarms | rds_create_cpu_alarms/main.py | Python | gpl-3.0 | 4,212 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/yc/code/calibre/calibre/src/calibre/gui2/dialogs/choose_format_device.ui'
#
# Created: Thu Oct 25 16:54:55 2012
# by: PyQt4 UI code generator 4.8.5
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore... | yeyanchao/calibre | src/calibre/gui2/dialogs/choose_format_device_ui.py | Python | gpl-3.0 | 2,630 |
"""
PHCpy --- a package for Polynomial Homotopy Continuation
========================================================
PHCpy is a collection of Python modules to compute solutions
of polynomial systems using PHCpack.
A homotopy defines the deformation of a start system
(system with known solutions) into the target sys... | callmetaste/PHCpack | src/Python/PHCpy3/phcpy/__init__.py | Python | gpl-3.0 | 3,727 |
import time
import RPi.GPIO as GPIO
from flask import Flask, render_template
# GPIO and Sensors ============================================================
# Objects to represent sensors used to get water level
class WaterLevelSensor:
# how high the sensor is above the top of the fish tank
offset = 0
d... | tvictor20/tvictor-advprog | aquaponics/app.py | Python | gpl-3.0 | 1,404 |
# ==========================================
# Author: Richard Wang
# Contact: rwthree@princeton.edu
#
# Performs simple parsing of an "Alpha" file
# Contents are simply (Server #, Alpha)
# Ex:
# 1, 3
# 2, 0
# 3, 1
# ==========================================
import random
import Globals
def updateAlphas(newAlphas, ... | XianliangJ/collections | CNUpdates/updates/examples/loadwild/loadbalancer/lbtest/Alphas.py | Python | gpl-3.0 | 4,597 |
#! /usr/bin/env python3
import numpy as np
import matplotlib.pyplot as plt
plt.style.use("seaborn-colorblind")
import galore
import galore.plot
vasprun = './test/MgO/vasprun.xml.gz'
xmin, xmax = (-10, 2)
fig = plt.figure()
for i, l in enumerate(np.arange(0.05, 0.50, 0.05)):
ax = fig.add_subplot(3, 3, i + 1)
... | SMTG-UCL/galore | docs/source/api_demo_pdos_broadening.py | Python | gpl-3.0 | 614 |
# -*- coding: utf-8 -*-
#
# This file is part of the jabber.at homepage (https://github.com/jabber-at/hp).
#
# This project 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... | jabber-at/hp | hp/core/tests/base.py | Python | gpl-3.0 | 8,383 |
from lokp.models import DBSession
from lokp.protocols.activity_protocol import ActivityProtocol
from lokp.review.review import BaseReview
class ActivityReview(BaseReview):
def __init__(self, request):
super(ActivityReview, self).__init__(request)
self.protocol = ActivityProtocol(DBSession)
| CDE-UNIBE/lokp | lokp/review/activities.py | Python | gpl-3.0 | 314 |
#!/usr/bin/python
import sys
import re
import numpy as np
import matplotlib.pyplot as plt
import argparse
remove_comments = re.compile("(?!\#)", re.VERBOSE)
parser = argparse.ArgumentParser()
parser.add_argument("-f", nargs=1, default=None)
parser.add_argument("files", nargs='*')
args = parser.parse_args()
if len(... | askalbania/piernik | python/plot_tsl.py | Python | gpl-3.0 | 1,065 |
# -*- coding: utf-8 -*-
import re
import datetime
import logging
from urlparse import parse_qsl
from mamchecker.model import depth_1st, problemCtxObjs, keysOmit, table_entry, ctxkey
from mamchecker.hlp import datefmt, last
from mamchecker.util import PageBase
from google.appengine.ext import ndb
def prepare(
... | mamchecker/mamchecker | mamchecker/done/__init__.py | Python | gpl-3.0 | 3,545 |
# Copyright 2015-2020 The Wazo Authors (see the AUTHORS file)
# SPDX-License-Identifier: GPL-3.0-or-later
from wazo_auth.interfaces import (
BaseAuthenticationBackend,
BaseMetadata,
DEFAULT_XIVO_UUID,
)
__all__ = [
'BaseAuthenticationBackend',
'BaseMetadata',
'DEFAULT_XIVO_UUID',
]
| wazo-pbx/xivo-auth | wazo_auth/__init__.py | Python | gpl-3.0 | 310 |
from __future__ import absolute_import, unicode_literals
import logging
from django import forms
from django.contrib import messages
from django.http import Http404
from django.utils.encoding import smart_str
from easy_maps.models import Address
from . import lib
log = logging.getLogger(__name__)
class AddressFor... | jackton1/django_google_app | map_app/forms.py | Python | gpl-3.0 | 4,132 |
#!/usr/local/lib/python2.7.10/bin/python
# -*- coding: utf-8 -*-
"""
Created on Sun Aug 09 13:15:13 2015
@author: Vedran
Fetching a schedule from Google Docs, extracting information, converting to
pdf and sending via e-mail.
Copyright (C) 2015 Vedran Vukovic <wilheru@gmail.com>
This program is free softw... | wilthewolf/rssso2015schedule | rssso2015schedule.py | Python | gpl-3.0 | 24,594 |
"""
Almost all test cases covers both tag calling and template using.
"""
from __future__ import print_function, unicode_literals
from django.conf import settings as django_settings
from django.contrib.contenttypes.models import ContentType
from django.http import HttpRequest
from django.utils.six import assertCountE... | cXhristian/django-wiki | tests/core/test_template_tags.py | Python | gpl-3.0 | 10,375 |
#!/usr/bin/python -tt
# An incredibly simple agent. All we do is find the closest enemy tank, drive
# towards it, and shoot. Note that if friendly fire is allowed, you will very
# often kill your own tanks with this code.
#################################################################
# NOTE TO STUDENTS
# This is... | bweaver2/bzrFlag | bzagents/dumb_agent.py | Python | gpl-3.0 | 5,712 |
# -*- coding: utf-8 -*-
from ..base import ComponentAPI
class CollectionsJOB(object):
"""Collections of JOB APIS"""
def __init__(self, client):
self.client = client
self.execute_task = ComponentAPI(
client=self.client, method='POST', path='/api/c/compapi/job/execute_task/',
... | tjm-1990/blueking | blueking/component/apis/job.py | Python | gpl-3.0 | 1,608 |
from datetime import datetime
from django.contrib.auth.models import User
from django.db import models
from uccaApp.models import Layers, Users, Constants
class Projects(models.Model):
id = models.AutoField(primary_key=True)
name = models.CharField(max_length=50)
description = models.CharField(max_length... | omriabnd/UCCA-App | Server/uccaApp/models/Projects.py | Python | gpl-3.0 | 847 |
import os
import webapp2
from app import routes
webapp2_config = {'webapp2_extras.sessions':
{'secret_key': 'hfgskahjfgd736987qygukr3279rtigu',
'webapp2_extras.jinja2': {'template_path': os.path.join(os.path.abspath(os.path.dirname(__file__)), 'templates')}}}
application = webapp2.WSGIApplication(debug=True, c... | Terhands/saskdance | app/main.py | Python | gpl-3.0 | 373 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-11-29 10:44
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0004_auto_20161129_0947'),
]
operations = [
migrations.AlterField(
... | petersterling1/poke-qr-viewer | main/migrations/0005_auto_20161129_1044.py | Python | gpl-3.0 | 633 |
# -*- coding: utf-8 -*-
"""
HipparchiaBuilder: compile a database of Greek and Latin texts
Copyright: E Gunderson 2016-21
License: GNU GENERAL PUBLIC LICENSE 3
(see LICENSE in the top level directory of the distribution)
"""
import re
from string import punctuation
try:
from builder.dbinteraction.connection imp... | e-gun/HipparchiaBuilder | builder/lexica/repairperseuscitations.py | Python | gpl-3.0 | 22,053 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011, De Verkeersonderneming <rits@verkeersonderneming.nl>
#
# This file is part of PyRITS - A tool for processing and analyzing transport
# management system data.
#
# PyRITS is free software: you can redistribute it and/or modify
# it under the terms of... | figure002/pyrits | pyrits/erniesoft/std.py | Python | gpl-3.0 | 61,599 |
# This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load in
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O... | SXBK/kaggle | zillow/xgb.py | Python | gpl-3.0 | 2,782 |
# annotation parser that processes our hashtags
import re
def get_abstracts(filename):
output = []
abstract_buffer = []
notes_buffer = []
last_abstract_no = 0
last_pmid = 0
last_biviewid = 0
with open(filename, 'rb') as f:
for line in f: # fast forward to abstract 1
... | ijmarshall/cochrane-nlp | parse_annotations.py | Python | gpl-3.0 | 1,910 |
#!/usr/bin/env python
# vim: set expandtab shiftwidth=4:
# http://www.voip-info.org/wiki/view/asterisk+manager+events
import asterisk.manager
import sys,os,time
import simplejson as json
from stompy.simple import Client
import ConfigParser
from sqlobject import *
from handlers.command_handler_factory import CommandHan... | gryzz/uCall | utils/asterisk-connector/ami2stomp.py | Python | gpl-3.0 | 3,524 |
# Doxyfile 1.7.4
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
#
# All text after a hash (#) is considered a comment and will be ignored.
# The format is:
# TAG = value [value, ...]
# For lists items can also be appended using:
# TAG +=... | makestuff/scripts | gendox/Doxyfile.py | Python | gpl-3.0 | 72,294 |
import os
import rospy
import rospkg
from python_qt_binding import QT_BINDING
from rqt_gui_py.plugin import Plugin
from python_qt_binding import loadUi
from python_qt_binding.QtCore import QTimer
# Attempt to load QWidget from pyqt4
try:
from python_qt_binding.QtGui import QWidget
# if not load from pyqt5
except ... | PalouseRobosub/robosub | src/rqt/rqt_control/src/rqt_control/control.py | Python | gpl-3.0 | 5,890 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Solver object
# Copyright (C) 2011-2012, Tomi Leppänen (aka Tomin)
#
# 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 t... | Tomin1/sudoku-solver | sudoku/solver.py | Python | gpl-3.0 | 7,465 |
#!/usr/bin/env python
#
# Eric S. Raymond
#
# Greatly modified by Nigel W. Moriarty
# April 2003
#
from pexpect import *
import os, sys
import getpass
import time
class ssh_session:
"Session with extra state including the password to be used."
def __init__(self, user, host, password=None, verbose=0):
... | Alberto-Beralix/Beralix | i386-squashfs-root/usr/share/doc/python-pexpect/examples/ssh_session.py | Python | gpl-3.0 | 2,839 |
from .models import *
from django.db.models import Count, F, Max, Sum
# Game info services
def get_median_points(game_id):
return median_value(Team.objects.filter(play__game__id=game_id) \
.exclude(play__team__points__isnull=True),
'play__team__points')
def get_pl... | Alberdi/marcestats | bgplays/services.py | Python | gpl-3.0 | 3,592 |
import sys
import smtplib
def output((code, msg)):
sys.stdout.write('%s %s\n' % (code, msg))
sys.stdout.flush()
smtp = smtplib.SMTP('localhost', 2500)
output(smtp.ehlo('moon.localdomain'))
print smtp.esmtp_features
output(smtp.mail('Damien Churchill <damoxc@gmail.com>'))
output(smtp.rcpt('Damien Churchill <da... | damoxc/vsmtpd | test_smtp.py | Python | gpl-3.0 | 406 |
# -*- coding: utf-8 -*-
##
##
## This file is part of Indico.
## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN).
##
## Indico 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... | Ictp/indico | bin/utils/getNameBadIndexed.py | Python | gpl-3.0 | 1,515 |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: https://sickrage.tv
# Git: https://github.com/SickRage/SickRage.git
#
# 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, ... | badloop/SickRage | sickbeard/image_cache.py | Python | gpl-3.0 | 13,572 |
#------------------------------------------------------------
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# Download Tools
# Based on the code from VideoMonkey XBMC Plugin
#------------------------------------------------------------
# pelisalacarta
# http://blog.tvalacarta.in... | golaizola/pelisalacarta-xbmc | core/scrapertools.py | Python | gpl-3.0 | 52,267 |
from pypwrctrl.pypwrctrl import Plug, PlugDevice, PlugMaster
| Innovailable/pypwrctrl | pypwrctrl/__init__.py | Python | gpl-3.0 | 61 |
import logging
import re
from datetime import datetime
from typing import List, Any, Dict, Union, Pattern
from pastehunter.common import base62_decode, base62_encode
from pastehunter.inputs.base_input import BasePasteSite
logger = logging.getLogger('pastehunter')
class IxDotIoSite(BasePasteSite):
# Yeah, yeah, ... | kevthehermit/PasteHunter | pastehunter/inputs/ixio.py | Python | gpl-3.0 | 4,534 |
"""
WSGI config for pyday2016 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.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SE... | fproldan/pyday2016 | pyday2016/wsgi.py | Python | gpl-3.0 | 396 |
#!/usr/bin/python
"""
Script: Forest, a simple Python forum script.
Author: Andrew Nelis (andrew.nelis@gmail.com)
OnTheWeb: http://www.triv.org.uk/~nelis/forest
Date: Jun 2010
Version: 1.0.3
A Python CGI script for a basic flat-file based forum.
Getting Started:
* Set up your web server/place forest.py so that it is... | whunder/Publicbox | publicbox/src/forest.py | Python | gpl-3.0 | 17,871 |
#coding: utf-8
import numpy as np
class MovieBase():
def read_from_csv(self, file_path):
f = open(file_path, 'r')
self.matrix = np.loadtxt(f, delimiter=',')
self.shape = self.matrix.shape
f.close()
def get_user_unseen_films(self, user_idx):
if user_idx >= self.shape[... | luizpericolo/alc-2014-3 | movie_base.py | Python | gpl-3.0 | 3,879 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file './QScintilla/SearchWidget.ui'
#
# Created: Tue Nov 18 17:53:58 2014
# by: PyQt5 UI code generator 5.3.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_SearchWidget(object):... | davy39/eric | QScintilla/Ui_SearchWidget.py | Python | gpl-3.0 | 4,989 |
from django.test import TestCase, RequestFactory
from main.models import *
from main.views import *
from bs4 import BeautifulSoup
from .base import *
import datetime
from feedback.models import IndividualFeedback
class StatusCheckTest(TestCase):
"""Testing the decorator test functions"""
def test_user_teache... | tobi2006/nomosdb | main/tests/test_views.py | Python | gpl-3.0 | 145,259 |
from logging import getLogger
from abstract_step import AbstractStep
import os
logger = getLogger('uap_logger')
class GffreadExtractTranscripts(AbstractStep):
'''
extract transcripts from gtf
http://ccb.jhu.edu/software/stringtie/gff.shtml
write a fasta file with spliced exons for each GFF transcript... | kmpf/uap | include/steps/gffread_extract_transcripts.py | Python | gpl-3.0 | 2,927 |
import re
import sys
import socket
from src.config import *
class IRC:
def __init__(self, queue):
self.queue = queue
def end_connection(self):
"""Send a goodbye message through irc and close the socket."""
try:
self.send_custom_message('goodbye')
channel = get_... | Shakajiub/RoboJiub | src/irc.py | Python | gpl-3.0 | 6,161 |
#
# Copyright 2010 Free Software Foundation, Inc.
#
# This file was generated by gr_modtool, a tool from the GNU Radio framework
# This file is a part of gr-paint
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
"""
Utilities for extracting text from generated classes.
"""
def is_string(txt):
if isinstance(txt, s... | drmpeg/gr-paint | docs/doxygen/doxyxml/text.py | Python | gpl-3.0 | 1,255 |
import numpy as np
def analytical_gradients(network, X, Y):
print("Calculating analytical gradients...")
print("Forward pass:", end=" ")
preds = network.predict(X)
print("done! Backward pass:", end=" ")
delta = network.cost.derivative(preds, Y)
network.backpropagate(delta)
print("done!")
... | csxeba/brainforge | brainforge/gradientcheck/raw_gradients.py | Python | gpl-3.0 | 1,211 |
#!/usr/bin/env python
#
# -*- coding: utf-8 -*-
#
# gui_helper.py -
# Copyright 2013 Tomas Hozza <thozza@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 3 of the Lic... | thozza/energy-track | energytrack/gui/gui_helper.py | Python | gpl-3.0 | 6,070 |
from django.contrib.sitemaps import Sitemap
from .models import BlogEntry
class BlogEntrySitemap(Sitemap):
changefreq = "yearly"
priority = 0.6
protocol = 'https'
def items(self):
return BlogEntry.on_site.filter(is_visible=True)
def lastmod(self, item):
return item.modification
| nim65s/MarkDownBlog | dmdb/sitemaps.py | Python | gpl-3.0 | 320 |
from test.support import verbose, run_unittest, gc_collect, bigmemtest, _2G, \
cpython_only
import io
import re
from re import Scanner
import sys
import string
import traceback
from weakref import proxy
# Misc tests from Tim Peters' re.doc
# WARNING: Don't change details in these tests if you don't know
# wha... | mancoast/CPythonPyc_test | fail/331_test_re.py | Python | gpl-3.0 | 54,426 |
# -*- coding: utf-8 -*-
import sys
from argparse import ArgumentParser
from DatabaseLogin import DatabaseLogin
from GlobalInstaller import GlobalInstaller
from PyQt5 import QtWidgets
from Ui_MainWindow import Ui_MainWindow
# import damit Installer funktioniert. auch wenn diese nicht hier benoetigt werd... | handbaggerli/DbInstaller | Python/DbInstaller.py | Python | gpl-3.0 | 6,513 |
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
import re
import heapq
from sql import Null
from sql.aggregate import Max
from sql.conditionals import Case
from collections import defaultdict
try:
import simplejson as j... | kret0s/gnuhealth-live | tryton/server/trytond-3.8.3/trytond/ir/model.py | Python | gpl-3.0 | 39,540 |
# =======================================================================
# This file is part of MCLRE.
#
# MCLRE 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 ... | augustoqm/MCLRE | src/data_partition/partition_helper_mrbpr.py | Python | gpl-3.0 | 3,228 |
import logging
import warnings
from collections import namedtuple
logger = logging.getLogger(__name__)
Field = namedtuple('Field', ('name', 'type_', 'default', 'desc', 'warn'))
class Config:
"""配置模块
用户可以在 rc 文件中配置各个选项的值
"""
def __init__(self):
object.__setattr__(self, '_fields', {})
... | cosven/FeelUOwn | feeluown/config.py | Python | gpl-3.0 | 2,065 |
# This script will calculate Shannon entropy from a MSA.
# Dependencies:
# Biopython, Matplotlib, Math
"""
Shannon's entropy equation (latex format):
H=-\sum_{i=1}^{M} P_i\,log_2\,P_i
Entropy is a measure of the uncertainty of a probability distribution (p1, ..... , pM)
https://stepic.org/lesson/Scoring-... | jrjhealey/bioinfo-tools | Shannon.py | Python | gpl-3.0 | 6,290 |
#
# My wish for Pynamite
#
from __future__ import with_statement
from pynamite import *
from pynamite.actor import TextBox
def scene1():
# define some actors
x = TextBox("Pynamite")
y = TextBox("Rocks!!!")
# tell the first actor to enter
enter(x)
# wait for a keypress to continue
pause(... | psederberg/pynamite | docs/examples/wish.py | Python | gpl-3.0 | 1,653 |
from test_support import *
prove_all(no_fail=True, steps = 400)
| ptroja/spark2014 | testsuite/gnatprove/tests/intro/test.py | Python | gpl-3.0 | 65 |
"""
Main controller.
"""
import json
from Server.Importer import ImportFromModule
class ControllerMain(ImportFromModule("Server.ControllerBase", "ControllerBase")):
"""
Main controller.
"""
def ShowPage(self, uriParameters, postedParameters):
"""
Shows the home page.
"""
... | allembedded/python_web_framework | WebApplication/Controllers/ControllerMain.py | Python | gpl-3.0 | 630 |
from platform import system
import os
from os.path import sep, expanduser, join as join_path
from collections import defaultdict
import pygame as pg
import settings
from util import ir, dd, split
class Conf (object):
IDENT = 'wvoas'
USE_SAVEDATA = True
USE_FONTS = False
# save data
SAVE = ('CU... | ikn/wvoas | game/conf.py | Python | gpl-3.0 | 19,522 |
import htmlPy
import socket
import json
import os
sock = socket.socket()
sock.connect(('localhost', 5002))
sock.send(b'')
sock.recv(1024)
sock.recv(1024)
sock.recv(1024)
app = htmlPy.AppGUI(title=u"Python Best Ever", maximized=True)
app.template_path = os.path.abspath("./html")
app.static_path = os.path.abspath("./... | JPro173/cloudpie | client/main.py | Python | gpl-3.0 | 1,186 |
# -*- coding: utf-8 -*-
import getopt
import sys
class SlopeOrientation:
def __init__(self, dem, out_layer):
print "Entering SlopeOrientation"
#ALGORITHM: Aspect
# INPUT <ParameterRaster>
# BAND <ParameterNumber>
# COMPUTE_EDGES <ParameterBoolean>
... | Minganie/qgis-plugin-peregrine-falcon | slope_orientation.py | Python | gpl-3.0 | 742 |
from django.utils.translation import ugettext_lazy as _
from crystal_dashboard.dashboards.crystal import dashboard
import horizon
class Controllers(horizon.Panel):
name = _("Controllers")
slug = 'controllers'
dashboard.CrystalController.register(Controllers)
| Crystal-SDS/dashboard | crystal_dashboard/dashboards/crystal/controllers/panel.py | Python | gpl-3.0 | 271 |
# Copyright (C) 2012 Vivek Haldar
#
# Take in a dict containing fetched RSS data, and output to printable files in
# the current directory.
#
# Dict looks like:
# feed_title -> [list of articles]
# each article has (title, body).
#
# Author: Vivek Haldar <vh@vivekhaldar.com>
import codecs
import escpos
from datetime i... | vivekhaldar/fetch_rss | output_prn.py | Python | gpl-3.0 | 928 |
__version__='0.5.1'
| havardgulldahl/jottalib | src/jottalib/__init__.py | Python | gpl-3.0 | 20 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
DEBUG = True
observer = None
ser_port = None
s = 0
ser = None
#--------------------------------------------------------------------
import signal
import sys
import os
def signal_handler(signal, frame):
global s, ser
print '\nYou pressed Ctrl+C!'
... | Ma3X/boot-talker | codes/python/talk.py | Python | gpl-3.0 | 19,742 |
import numpy as np
from assorted.GraphInput import GraphInput
from model.component.component_model import ComponentModel
class CsvInput(ComponentModel):
name = "CsvInput"
default_out_sockets = [{'position': [0, -20],
'name': 'Output'}]
default_attributes = {'path': '<argument>',
... | MichSchli/Mindblocks | packages/experiment_io/csv_input.py | Python | gpl-3.0 | 917 |
from rest_framework import serializers
from .models import Community, Objective, SocialNetwork, Sector
class ObjectiveSerializer(serializers.ModelSerializer):
class Meta:
model = Objective
class CommunitySerializer(serializers.ModelSerializer):
objectives = ObjectiveSerializer(many=True)
class Me... | david2307/backend_159 | communities/serializers.py | Python | gpl-3.0 | 460 |
from .operation import Operation
from ..operands import Register, Operand2, Opcodes, Zero
class LedOperation(Operation):
opcodes = {"but": "1111100"}
structure = [Opcodes(opcodes), Zero(21), Register]
class ButOperation(Operation):
opcodes = {"led": "1111101"}
structure = [Opcodes(opcodes), Opera... | svenstaro/uni-projekt | assembler/operations/hwiOperation.py | Python | gpl-3.0 | 329 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from mstm_studio.contributions import MieLognormSpheres
from mstm_studio.alloy_AuAg import AlloyAuAg
import numpy as np
mie = MieLognormSpheres(name='mie', wavelengths=np.linspace(300,800,51))
mie.set_material(AlloyAuAg(x_Au=1), 1.5) # golden sphere in glass
values = [1, 1.5... | lavakyan/mstm-spectrum | doc/source/scripting/mie_contrib.py | Python | gpl-3.0 | 567 |
#
# Copyright (C) 2003-2022 Sébastien Helleu <flashcode@flashtux.org>
#
# This file is part of WeeChat.org.
#
# WeeChat.org 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
#... | weechat/weechat.org | weechat/common/path.py | Python | gpl-3.0 | 1,672 |