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 |
|---|---|---|---|---|---|
#coding:utf-8
from flask import Flask,request, render_template
app = Flask(__name__)
@app.route('/')
def index():
return render_template('demo.html')
if __name__ == '__main__':
app.run(host='0.0.0.0', debug=True)
| gensmusic/test | third_party/python/flask/third-party/pagedown/usage.py | Python | gpl-2.0 | 230 |
# coding=utf-8
import numpy as np
def textParse(bigString):
import re
listOfTokens=re.split(r'\W*',bigString)
return [tok.lower() for tok in listOfTokens if len(tok)>2]
def createVocabList(docList):
vocabList=set([])
for doc in docList:
vocabList=vocabList|set(doc)
return list(vocabLis... | linpingchuan/misc | python/ml/book1/ch4/bayes2.py | Python | gpl-2.0 | 2,621 |
syscall_table = {}
syscall_table[202]="accept"
syscall_table[242]="accept4"
syscall_table[1033]="access"
syscall_table[89]="acct"
syscall_table[217]="add_key"
syscall_table[171]="adjtimex"
syscall_table[1059]="alarm"
syscall_table[1075]="bdflush"
syscall_table[200]="bind"
syscall_table[214]="brk"
syscall_table[90]="cap... | alexpark07/ARMSCGen | shellcodes/arm64/syscall.py | Python | gpl-2.0 | 9,178 |
#!/usr/bin/python
def toggle_bit_at_position(variable, position):
if type(variable) is long or type(variable) is int:
if type(position) is long or type(position) is int:
position = position - 1
value = variable ^ (1 << position)
return ("Variable: " + str(variable) + " ... | RGU5Android/PythonLectureNotes | HomeWork/09-27-14/toggle_bit_at_position.py | Python | gpl-2.0 | 635 |
"Convenience wrappers around dbus-python"
import dbus
import functools
# TODO rename to adaptors
from func import Adaptor, MethodAdaptor, PropertyAdaptor, SignalAdaptor
def object_path(o):
"""Return the object path of o.
If o is a proxy object, use its appropriate attribute.
Otherwise assume that o alre... | mvidner/cnetworkmanager | dbusclient/__init__.py | Python | gpl-2.0 | 6,611 |
# -*- coding: utf-8 -*-
# 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.
from gi.repository import Gtk
import os
import... | elbeardmorez/quodlibet | quodlibet/tests/test_library_libraries.py | Python | gpl-2.0 | 24,563 |
import random
import copy
from fractions import Fraction
def get_matrix(file_name="matrix_new.txt"):
file = open(file_name, "r")
A = []
for line in file:
A.append([Fraction(x) for x in line.split()])
return A
def print_file(A, comment = ""):
file = open("matrix_show.txt", "a")
file.wr... | Lamzin/myPython | Algebra/matrix_extreme.py | Python | gpl-2.0 | 8,779 |
# Authors:
# Rob Crittenden <rcritten@redhat.com>
# Pavel Zuna <pzuna@redhat.com>
#
# Copyright (C) 2010 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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... | tbabej/freeipa | ipatests/test_xmlrpc/test_old_permission_plugin.py | Python | gpl-3.0 | 41,582 |
# Natural Language Toolkit: Ngram Association Measures
#
# Copyright (C) 2001-2016 NLTK Project
# Author: Joel Nothman <jnothman@student.usyd.edu.au>
# URL: <http://nltk.org>
# For license information, see LICENSE.TXT
"""
Provides scoring functions for a number of association measures through a
generic, abstr... | adazey/Muzez | libs/nltk/metrics/association.py | Python | gpl-3.0 | 15,878 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016-2020 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free S... | The-Compiler/qutebrowser | qutebrowser/browser/navigate.py | Python | gpl-3.0 | 8,364 |
#!/usr/bin/env python3
import os
import sys
sys.path.insert(1, os.path.join(sys.path[0], '..'))
from SetupTools.SetupConfig import SetupConfig
from Interface.Interface import Interface
import importlib
import logging
class Previewer:
def __init__(self):
logging.basicConfig(filename='ArchSetup.preview.log',... | mame98/ArchSetup | scripts/debug-preview.py | Python | gpl-3.0 | 1,383 |
#!/usr/bin/python3
import sys
if len(sys.argv) != 3:
print("usage: python io blocksize blockcount")
sys.exit(1)
size = int(sys.argv[1])
count = int(sys.argv[2])
buffer = bytearray(size)
f = open("pythonio.out", 'wb')
for i in range(0,count):
f.write(buffer)
f.close()
| xuanthanhbk92/Programe-for-Linux | PluralSight/linux-systems-programming/2-linux-systems-programming-m2-exercise-files/pythonio.py | Python | gpl-3.0 | 281 |
from rest_framework import permissions
from pyuser.models import (USER_TYPE_ADMIN,
USER_TYPE_NORMAL,
USER_TYPE_VISITOR)
class IsAdminOrReadOnly(permissions.BasePermission):
def has_permission(self, request, view):
return request.user.pyuser.type == USE... | ray525/djangular | backend/oauth_test/books/permissions.py | Python | gpl-3.0 | 496 |
#!/usr/bin/env python3
# -----------------------------------------------------------------------------
# Copyright (C) British Crown (Met Office) & Contributors.
#
# This file is part of Rose, a framework for meteorological suites.
#
# Rose is free software: you can redistribute it and/or modify
# it under the terms of... | metomi/rose | metomi/rosie/svn_pre_commit.py | Python | gpl-3.0 | 13,444 |
"""
WSGI config for clairweb 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_SET... | eike-welk/clair | src/clairweb/clairweb/wsgi.py | Python | gpl-3.0 | 394 |
import gzip
import hashlib
import os
import re
import warnings
from struct import unpack
import six
class _StarDictIfo(object):
"""
The .ifo file has the following format:
StarDict's dict ifo file
version=2.4.2
[options]
Note that the current "version" string must be "2.4.2" or "3.0.0". If... | lig/pystardict | pystardict.py | Python | gpl-3.0 | 19,916 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render
from django.http import HttpResponse
def hello_world_view(request):
return HttpResponse("hello world", content_type="text/plain")
| ludovic-bouguerra/tutorial-travis-docker | webservice/views.py | Python | gpl-3.0 | 237 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@since: 2014-11-28
@author: Javier Garcia
@contact: javier.garcia@bskapital.com
@summary: Update from websources and csv the Master Securities
SQLITE database.
'''
# General imports
import pandas.io.data as web
import pandas as pd
import numpy as ... | JavierGarciaD/athena | mneme/db_updater.py | Python | gpl-3.0 | 8,366 |
#! /usr/bin/python
'''
@author: Alister Maguire
Given a counts file and a taxa file, condense
repeated genus' and their counts, and output
a file that maps genus names to their counts
for each experiment.
'''
import argparse
def is_number(s):
try:
float(s)
return True
except ValueError:
... | aowen87/PhyloViewer | src/condense.py | Python | gpl-3.0 | 3,122 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import pwd
import stat
import time
import os.path
import logging
def root_dir():
root_dir = os.path.split(os.path.realpath(__file__))[0]
return root_dir
def get_logger(name):
def local_date():
return str(time.strftime("%Y-%m-%d"... | cwlseu/recipes | pyrecipes/utils.py | Python | gpl-3.0 | 2,631 |
#!/usr/bin/env python
"""
Configuration script for the analyzer of B0s -> K*0 Ds+ Ds- background events
| | |-> tau- nu
| | |-> pi- pi- pi+ nu
... | semkiv/heppy_fcc | background_Bs2DsDsK_with_Ds2TauNu_analysis_cfg.py | Python | gpl-3.0 | 3,807 |
import sys
try:
import myahll
except Exception as e:
for info in e.args:
print info
sys.exit(1)
| flyxiao2000/myide | python_resource/myexception.py | Python | gpl-3.0 | 118 |
#!/usr/bin/env python
from __future__ import print_function
from molmod import *
# 0) Load the molecule and set the default graph
mol = Molecule.from_file("dopamine.xyz")
mol.set_default_graph()
# 1) Build a list of atom indexes involved in angles.
angles = []
# First loop over all atoms on the molecule.
for i1 in ... | molmod/molmod | molmod/examples/003_internal_coordinates/b_bending_angles.py | Python | gpl-3.0 | 1,360 |
import gtk
import pygtk
import pexpect
import gio
import commands
import gobject
class RemoteMounter:
def login_remote(self, host, port, username, password):
'''
Mount the remote file system and update the remote file
chooser to the corresponding location.
Any remote filesystem, previously mounted by the ... | viswanathgs/EratoSCP | src/mountremote.py | Python | gpl-3.0 | 2,361 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-07-05 10:03
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('account', '0003_auto_20170705_0958'),
]
operations = [
migrations.RenameField(
... | BdEINSALyon/resa | account/migrations/0004_auto_20170705_1003.py | Python | gpl-3.0 | 620 |
from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:8332")
else:
access = Ser... | v4l3r10/goingxincoin | contrib/bitrpc/bitrpc.py | Python | gpl-3.0 | 7,843 |
#!/usr/bin/env python
#
# Copyright 2011 Markus Pielmeier
#
# This file is part of minecraft-world-io.
#
# minecraft-world-io 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... | marook/minecraft-world-io | src/test/marook_test/minecraft_test/tag_test/test_entities.py | Python | gpl-3.0 | 1,426 |
#Convert to lower (lol)
string = input()
print (string.lower())
| LTKills/languages | python/17.py | Python | gpl-3.0 | 66 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014-2019 khalim19
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | khalim19/gimp-plugin-export-layers | export_layers/pygimplib/__init__.py | Python | gpl-3.0 | 11,842 |
cost, zeros = map(int, input().split())
print(int(round(cost, -zeros))) | JonSteinn/Kattis-Solutions | src/Slatkisi/Python 3/main.py | Python | gpl-3.0 | 71 |
# Node image tools (core)
# Copyright 2013 Victor Lavrentev
import json, sys
from node_lib import *
from PIL import Image, ImageDraw, ImageFilter
import numpy
print '\nNode image tools (core) v01a\n'
# Read node file *.json
try:
file_node=sys.argv[1]
except:
print '->Error. No script'
sys.... | shrimo/node_image_tools | node_core.py | Python | gpl-3.0 | 2,317 |
'''
Contains physical constants used in snow modeling.
@var a_gravity: Gravitational acceleration [m s-2]
@var eta0: Viscosity of snow at T=0C and density=0 [N s m- 2 = kg m-1 s-1]
@var rho_air: Density of air [kg m-3], dry air at 0 C and 100 kPa
@var rho_water: Density of water [kg m-3]
@var rho_ice: Density o... | kmunve/pysenorge | pysenorge/constants.py | Python | gpl-3.0 | 1,844 |
import os
import re
import sys
import platform
import subprocess
from setuptools import setup, Extension, find_packages
from setuptools.command.build_ext import build_ext
from distutils.version import LooseVersion
class CMakeExtension(Extension):
def __init__(self, name, sourcedir=''):
Extension.__init__... | citp/BlockSci | blockscipy/setup.py | Python | gpl-3.0 | 2,879 |
#!/usr/bin/env python3
"""
Call Operators in Python
"""
#Setup our variables
num1 = 1
num2 = 2
var1 = 'a'
var2 = 'b'
'''
+ / Additions / Can combine strings or numbes
'''
totalNum = num1 + num2
totalVar = var1 + var2
print(totalNum, totalVar )
'''
- / Subtraction
'''
totalNum = num1 - num2
'''
* / Multiplica... | hackerpals/Python-Tutorials | Kids-Pthon-Workshops/guessing-game/ex2/call-op.py | Python | gpl-3.0 | 591 |
import collections
from jsonfield import JSONField
from datetime import datetime
from django.utils import timezone
from django.db import models
# Stores information about fields for a data entry form
class InputFieldGroup(models.Model):
GROUP_VIS = {'open': 'Show Field Group in an open panel',
'... | portableant/open-context-py | opencontext_py/apps/edit/inputs/fieldgroups/models.py | Python | gpl-3.0 | 2,043 |
import netifaces
from netaddr import *
for inter in netifaces.interfaces():
addrs = netifaces.ifaddresses(inter)
try:
print(addrs)
print(addrs[netifaces.AF_INET][0]["addr"])
print(addrs[netifaces.AF_INET][0]["broadcast"])
print(addrs[netifaces.AF_INET][0]["netmask"])
loc... | GadgeurX/NetworkLiberator | Daemon/Utils.py | Python | gpl-3.0 | 1,119 |
from django.db import models
# Create your models here.
class ParklePlayer(models.Model):
""" Consider this our User model for a Registered Parkle Player.
"""
username = models.CharField(max_length=30, unique=True)
email = models.EmailField(unique=True)
player_key = models.CharField(max_length=32,... | matteius/parkle-api | accounts/models.py | Python | gpl-3.0 | 422 |
#!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | omererdem/honeything | src/cwmp/tr/vendor/tornado/tornado/web.py | Python | gpl-3.0 | 82,697 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import six
import unittest2
from robottelo.ui.location import Location
from robottelo.ui.locators import common_locators
from robottelo.ui.locators import locators
if six.PY2:
import mock
else:
from unittest import mock
class LocationTestCase(... | sghai/robottelo | tests/robottelo/ui/test_location.py | Python | gpl-3.0 | 2,887 |
class KnownUsers:
"""
This deals with both the dedicated server log AND the xml "user" file, as related to the known users.
TODO: refactor this to have a distinct class for the dedicatedLog and the users.xml
"""
def __init__(self, existing_users_filename):
"""Setup init variables parsing t... | mccorkle/seds-utils | KnownUsers.py | Python | gpl-3.0 | 4,260 |
from docs import *
| cyphactor/lifecyclemanager | extra/plugins/docs/docs/__init__.py | Python | gpl-3.0 | 20 |
class BASIC_MOVE:
ID = 0
Name = 1
Type = 2
PW = 3
Duration = 4
NRG = 5
NRGPS = 6
DPS = 7
# Adapted from the GAME_MASTER_FILE Json Output at:
# https://github.com/pokemongo-dev-contrib/pokemongo-game-master/
# https://raw.githubusercontent.com/pokemongo-dev-contrib/pokemongo-game-master/... | darkshark007/PoGoCollection | Data/moves.py | Python | gpl-3.0 | 11,221 |
#!/usr/bin/env python
import subprocess, os, sys
import colorama
from colorama import Fore, Back, Style
# Store paths and connection info
sourcetree = "/home/flux/Projects/hackday"
gitlabapi = ""
drupalbootstrap = sourcetree + "/drupal/includes/bootstrap.inc"
contrib = sourcetree + "/all/modules/contrib"
rpmmodules = ... | Andy-Thornton/drupal-security-updates | security-updates.py | Python | gpl-3.0 | 1,721 |
# Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution(object):
def rotateRight(self, head, k):
"""
:type head: ListNode
:type k: int
:rtype: ListNode
"""
xs = []
... | ShengRang/c4f | leetcode/rotate-list.py | Python | gpl-3.0 | 617 |
import subprocess as sp
def matches(text):
return text.startswith('#')
def process(text):
text = text[1:]
result = sp.check_output(text, shell=True).decode('utf-8').rstrip().replace('\\n', '\n')
return result
| maateen/TextSuggestBangla | textsuggest/processors/command.py | Python | gpl-3.0 | 219 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'effect_size_locations_page.ui'
#
# Created: Tue Aug 27 16:49:55 2013
# by: PyQt4 UI code generator 4.10.2
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fro... | gdietz/OpenMEE | common_wizard_pages/ui_effect_size_locations_page.py | Python | gpl-3.0 | 5,558 |
# -*- coding: utf-8 -*-
# Mathmaker creates automatically maths exercises sheets
# with their answers
# Copyright 2006-2018 Nicolas Hainaux <nh.techn@gmail.com>
# This file is part of Mathmaker.
# Mathmaker is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License... | nicolashainaux/mathmaker | tests/integration/mental_calculation/04_yellow1/test_04_yellow1_multi_divi_10_100_1000.py | Python | gpl-3.0 | 1,673 |
from django.urls import path
from . import views
app_name = "contact"
urlpatterns = [
path("thanks", views.ThanksView.as_view(), name="thanks"),
path("", views.ContactView.as_view(), name="contact"),
]
| GarrettArm/TheDjangoBook | mysite_project/contact/urls.py | Python | gpl-3.0 | 212 |
# encoding: utf-8
#
# 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 d... | zeratul2099/crypt_app | crypto/models.py | Python | gpl-3.0 | 4,784 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "schedule_plugin.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| nyu-mhealth/project-smsurvey | plugins/schedule_plugin/manage.py | Python | gpl-3.0 | 258 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2021 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free S... | fiete201/qutebrowser | qutebrowser/__init__.py | Python | gpl-3.0 | 1,276 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import time
from io import BytesIO
import requests
from PIL import Image, ImageDraw
from facepp import API, File
API_KEY = '185839fab47af2675b5e458275215a39'
API_SECRET = 'x7EXrX4c5WgIjAQ9un3SgI4-QYTad7Dx'
class ImageDetector:
''' Image Detector class demo'''
... | deljuven/Guozijian | face/ImageDetector.py | Python | gpl-3.0 | 2,562 |
import machine
import time
# 2+2
3*4.0
# 102**1023
print("Hi from ESP")
pin = machine.Pin(2, machine.Pin.OUT)
pin.high()
pin.low()
def toggle(p):
p.value(not p.value())
# toggle(pin)
while True:
toggle(pin)
time.sleep_ms(500)
| fandres/Monitor-heladas | Code/examples/Test.py | Python | gpl-3.0 | 244 |
import matplotlib.pyplot as plt
import numpy as np
import allantools as allan
def example1():
"""
Compute the GRADEV of a white phase noise. Compares two different
scenarios. 1) The original data and 2) ADEV estimate with gap robust ADEV.
"""
N = 1000
f = 1
y = np.random.randn(1,N)[0,:]
x = np.linspace(1,len(... | telegraphic/allantools | examples/gradev-demo.py | Python | gpl-3.0 | 1,437 |
from motuus.play.base_player import BasePlayer
class Player(BasePlayer):
"""This is the main class of motuus.
Use it to process Movement objects as they come in and to bind them to multimedia events.
An instance of this class is kept alive throughout every http session between the mobile device browser a... | Vysybyl/motuus | players/3d_model_sample.py | Python | gpl-3.0 | 1,369 |
#!/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 | lib/EoS/Cubic/PT.py | Python | gpl-3.0 | 7,861 |
import sys
import xbmc,xbmcaddon,xbmcvfs
import sqlite3
from subprocess import Popen
import datetime,time
channel = sys.argv[1]
start = sys.argv[2]
ADDON = xbmcaddon.Addon(id='script.tvguide.Vader')
def adapt_datetime(ts):
# http://docs.python.org/2/library/sqlite3.html#registering-an-adapter-callable
return ... | ledtvavs/repository.ledtv | script.tvguide.Vader/resources/playwith/playwithchannel.py | Python | gpl-3.0 | 2,435 |
# -*- coding=utf-8 -*-
"""
All entry points for API are defined here.
Attributes:
mod (Blueprint): Flask Blueprint object used to separate api from
website code.
"""
from flask import Blueprint, request, send_from_directory
from flask_restful import Api, Resource
import os
fr... | Pseudonick47/sherlock | backend/api/data.py | Python | gpl-3.0 | 37,646 |
import os
def get_files(extension):
for root, dirnames, filenames in os.walk("."):
for filename in filenames:
if filename.endswith(extension):
yield os.path.join(root, filename)
def get_roles():
return sorted(os.listdir("./roles"))
def pytest_generate_tests(metafunc):
... | ideascube/pibox-installer | ansiblecube/tests/conftest.py | Python | gpl-3.0 | 733 |
from DataGathering.sanitizeString import sanitizeString
def checkProperNamePresence(text,namesList):
wordPresence = [word in namesList for word in sanitizeString(text).split()]
return True in wordPresence
def getProperNamePresence(df, namesList):
return df['Discurso'].map(lambda d: checkProperNamePresen... | hugolouzada/ImpeachmentPrediction | DataTransform/getProperNamePresence.py | Python | gpl-3.0 | 341 |
"""
Django settings for makingmx project.
Generated by 'django-admin startproject' using Django 1.10.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import o... | MakingMexico/web_page | makingmx/settings/base.py | Python | gpl-3.0 | 3,343 |
from __future__ import print_function
import nose
from numpy.testing.decorators import slow
from datetime import datetime
from numpy import nan
from pandas import date_range,bdate_range, Timestamp
from pandas.core.index import Index, MultiIndex, Int64Index
from pandas.core.common import rands
from pandas.core.api im... | alephu5/Soundbyte | environment/lib/python3.3/site-packages/pandas/tests/test_groupby.py | Python | gpl-3.0 | 130,215 |
"""
Copyright 2008-2011 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion 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 l... | ambikeshwar1991/gnuradio-3.7.4 | grc/python/FlowGraph.py | Python | gpl-3.0 | 9,529 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-06-21 15:44
from __future__ import unicode_literals
from django.db import migrations
import djgeojson.fields
class Migration(migrations.Migration):
dependencies = [
('survey', '0044_auto_20160618_1412'),
]
operations = [
migrat... | simonspa/django-datacollect | datacollect/survey/migrations/0045_record_coords.py | Python | gpl-3.0 | 498 |
#!/usr/bin/env python
# -*- coding: utf-8
"""
Created on 13:48 16/04/2018 2018
This module contains a tools for ploting regulator .bed files distributed with
Dorina.
"""
import multiprocessing
from pathlib import Path
import numpy as np
import pandas as pd
import pybedtools
from bokeh.layouts import gridplot
from bok... | dieterich-lab/dorina | dorina/report.py | Python | gpl-3.0 | 6,747 |
# -*- coding: utf-8 -*-
import argparse
import time
import socket
import sys
import json
__prog__ = 'xbmc-command'
PROG = __prog__
__version__ = '0.4.1'
VERSION = __version__
class XBMC(object):
def __init__(self, host, port):
self.address = (host, port)
self.__socket = socket.socket(socket.AF_... | mychris/xbmc-command | xbmc_command/core.py | Python | gpl-3.0 | 4,244 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2016-2017 Canonical Ltd
#
# 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 ... | elopio/snapcraft | snapcraft/plugins/plainbox_provider.py | Python | gpl-3.0 | 3,098 |
from Test_controller import Test_controller
import Stub_urllib2
from controller.Groups import Groups
from model.Group import Group
from model.User import User
class Test_groups( Test_controller ):
def setUp( self ):
Test_controller.setUp( self )
Groups.urllib2 = Stub_urllib2
self.group_name = u"my grou... | osborne6/luminotes | controller/test/Test_groups.py | Python | gpl-3.0 | 5,743 |
from twisted.application.internet import TimerService
from twisted.application.service import Service
from twisted.internet import task
from twisted.internet import defer
class LoopingCall(task.LoopingCall):
def __call__(self):
def cb(result):
if self.running:
self._reschedule()
... | teknogods/eaEmu | eaEmu/util/timer.py | Python | gpl-3.0 | 2,714 |
# -*- coding: utf-8 -*-
##
## Copyright © 2007, Matthias Urlichs <matthias@urlichs.de>
##
## 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... | smurfix/HomEvenT | modules/bool.py | Python | gpl-3.0 | 2,922 |
from collections import defaultdict
def check_for_hits(planets, counts):
total = 0
for planet in planets():
if counts(planet):
total += 1
return total
def parse():
actions = {"U": (lambda: map_x[x], lambda j: j > y),
"D": (lambda: map_x[x], lambda j: j < y),
... | Krigu/python_fun | Pland1/Parser.py | Python | gpl-3.0 | 1,456 |
# -*- coding: utf-8 -*-
"""
encode a unicode string as an ascii byte string with smart replacement
Support for encoding in ascii where iso-88591-1 characters (i.e. those code
points which can be encoded in iso-8859-1 aka latin-1) beyond ascii chars
(i.e. those code points which can be encoded in ascii) are replaced w... | emsrc/daeso-dutch | lib/daeso_nl/string/ascii.py | Python | gpl-3.0 | 3,263 |
#!/usr/bin/env python2
import sys
myFile = open(sys.argv[1],"r")
myFile2 = open("output.txt","w")
nl = ''
ciphertext = myFile.read()
freqDict = {
"A" :"t",
"O" :"h",
"U" :"d",
"B" :"e",
"V" :"a",
"M" :"n",
"X" :"o",
"P" :"i",
"N" :"g",
"F... | f41c0r/Cipher-Frequency-Analyzer | translator.py | Python | gpl-3.0 | 717 |
#
# This file contains functions and constants to talk
# to and from a Novation Launchpad via MIDI.
#
# Created by paul for mididings.
from mididings import *
# MEASURES - constants useful for the Pad
side = list(range(0, 8))
longside = list(range(0, 9))
step = 16 # vertical gap on pad
FirstCtrl = 104 # ctrl o... | m4773rcl0ud/launchpaddings | launchpad_utils.py | Python | gpl-3.0 | 4,442 |
# -*- coding: utf-8 -*-
import rules
from rules.predicates import is_staff
from rules.predicates import is_superuser
from core.journal.predicates import is_journal_member
from .defaults import AuthorizationConfig as AC
from .predicates import HasAuthorization
# This permission assume to use a 'Journal' object to p... | erudit/eruditorg | eruditorg/core/authorization/rules.py | Python | gpl-3.0 | 501 |
"""
Updates start offsets, stop offsets and indicators everywhere in score.
.. note:: This is probably the most important part of Abjad to optimize. Use the
profiler to figure out how many unnecessary updates are happening. Then reimplement.
As a hint, the update manager implements a weird version of the "obs... | Abjad/abjad | abjad/_update.py | Python | gpl-3.0 | 15,897 |
# -*- coding: utf-8 -*-
# Pretend to be /usr/bin/id3v2 from id3lib, sort of.
# Copyright 2005 Joe Wreschnig
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
import sys
import code... | jetskijoe/headphones | lib/mutagen/_tools/mid3v2.py | Python | gpl-3.0 | 17,271 |
#!/usr/bin/env python
# -*- coding: utf-8; py-indent-offset:4 -*-
###############################################################################
#
# Copyright (C) 2015-2020 Daniel Rodriguez
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License a... | mementum/backtrader | tests/test_ind_priceosc.py | Python | gpl-3.0 | 1,613 |
import numpy
import data_generator
class Generator:
def __init__(self):
self.combinations = data_generator.generateAllByteToAx25DataCombinations()
self.frameSeparatorOne = data_generator.calculateNewAx25DataFromOldImpl(1, 0, 0x7E, False)
self.frameSeparatorZero = data_generator.calculateNew... | far-far-away-science/hab-v2 | software/ax25-utils/code_generation_v2.py | Python | gpl-3.0 | 2,693 |
# -*- coding: utf-8 -*-
# Copyright(C) 2008-2010 Romain Bignon
#
# 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, version 3 of the License.
#
# This program is distributed in the hope that it w... | jocelynj/weboob | weboob/backends/aum/pages/base.py | Python | gpl-3.0 | 4,096 |
#!/usr/bin/env python
'''
A/V control for System76 laptop using Unity
'''
import os
from execute import returncode
# check for the existence of /dev/video0 which is used currently for webcam
webcam = lambda: os.path.exists('/dev/video0') == False
def webcam_toggle():
if webcam():
returncode('sudo /sbin/m... | mgmtech/sys76_unity_webmic | unity_avindicator/webmic.py | Python | gpl-3.0 | 751 |
# [1] https://doi.org/10.1002/jcc.26495
# Habershon, 2021
"""
prp a901cdfacc579eb63b193cbc9043212e8b57746f
pysis 340ab6105ac4156f0613b4d0e8f080d9f195530c
do_trans accidentally disabled in transtorque
"""
from functools import reduce
import itertools as it
import numpy as np
from pysisyphus.calculators import (
... | eljost/pysisyphus | pysisyphus/drivers/precon_pos_rot.py | Python | gpl-3.0 | 19,597 |
import pi_time
from os import path
from autobahn.twisted.wamp import ApplicationSession
from autobahn.twisted.util import sleep
from autobahn.wamp.exception import ApplicationError
from twisted.internet.defer import inlineCallbacks
from twisted.python import log
from pi_time import settings
from pi_time.api import ... | si618/pi-time | pi_time/laptimer/laptimer/laptimer.py | Python | gpl-3.0 | 1,522 |
# -*- coding:utf-8 -*-
# ##### 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.
#
# ... | s-leger/archipack | archipack_molding.py | Python | gpl-3.0 | 29,198 |
#!/usr/bin/python
import sys
from subprocess import call
print "Usage: bg_count.py ListOfBamFiles Reference"
try:
li = sys.argv[1]
except:
li = raw_input("Introduce List of indexed BAM files: ")
try:
ref = sys.argv[2]
except:
ref = raw_input("Introduce Reference in FASTA format: ")
files = open(li)... | fjruizruano/ngs-protocols | bg_count.py | Python | gpl-3.0 | 764 |
## Broker settings.
BROKER_URL = "amqp://guest:guest@localhost:5672//"
# List of modules to import when celery starts.
CELERY_IMPORTS = ("pegCelery", )
## Using amqp also to send task state and results.
CELERY_RESULT_BACKEND = "amqp"
# Settings required for PHP AMQP extension
CELERY_RESULT_SERIALIZER = "json"
CELERY... | markboots/peg | celeryconfig.py | Python | gpl-3.0 | 349 |
from __future__ import unicode_literals
from memory.mem import _Memory
class Windows2012ServerR2Memory(_Memory):
def __init__(self, params):
super(Windows2012ServerR2Memory, self).__init__(params)
def csv_all_modules_dll(self):
super(Windows2012ServerR2Memory, self)._csv_all_modules_dll()
... | SeungGiJeong/SK_FastIR | memory/windows2012ServerR2Memory.py | Python | gpl-3.0 | 440 |
# -*- coding: utf-8 -*-
#
#!/usr/bin/env python
#
# Copyright (C) 2014 Bitergia
#
# 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 late... | jgbarah/GrimoireLib | vizgrimoire/GrimoireUtils.py | Python | gpl-3.0 | 24,306 |
from gi.repository import GLib, GUPnP, GSSDP, GObject, libsoup
from gupnp_device_tests import device_available
from gupnp_control_point_tests import test_control_point
from gupnp_service_proxy_tests import device_available_service_test
# Note: glib.thread_init() doesn't work here, have to use the gobject call
GObject.... | ZachGoldberg/gupnp-python | test/gupnp.py | Python | gpl-3.0 | 1,115 |
__author__ = "Jacob Lydon"
__copyright__ = "Copyright 2017"
__credits__ = []
__license__ = "GPLv3"
__version__ = "0.1"
__maintainer__ = "Jacob Lydon"
__email__ = "jlydon001@regis.edu"
__status__ = "Development" | lydonjake/cs-grad-school-app | program/__init__.py | Python | gpl-3.0 | 211 |
__author__ = 'davide'
import itertools as it
from euler._utils import genera_primi
if __name__ == "__main__":
n = it.islice(genera_primi(), 10000, 8359265)
print(next(n)) | DavideCanton/Python3 | euler/ex7.py | Python | gpl-3.0 | 182 |
#!/usr/bin/env python3
import sys
import argparse
from ucca.convert import from_text, to_json
from uccaapp.api import ServerAccessor
desc = """Upload a passage from a streussel format file"""
class StreusselPassageUploader(ServerAccessor):
def __init__(self, user_id, source_id, project_id, **kwargs):
s... | danielhers/ucca | uccaapp/upload_streussel_passages.py | Python | gpl-3.0 | 3,363 |
from rambutan3.check_args.annotation.NON_EMPTY_BUILTIN_FROZENSET_OF import NON_EMPTY_BUILTIN_FROZENSET_OF
from tests.check_args.annotation import RSetMatcherTestUtil
def test():
RSetMatcherTestUtil.core_test_non_empty_set_of_matcher(NON_EMPTY_BUILTIN_FROZENSET_OF, frozenset)
| kevinarpe/kevinarpe-rambutan3 | tests/check_args/annotation/test_NON_EMPTY_BUILTIN_FROZENSET_OF.py | Python | gpl-3.0 | 282 |
#!/usr/bin/python2
"""fkmonthgraph - graph of enemy fighter kills & losses, by month
Requires matplotlib, see http://matplotlib.org or search your package
manager (Debian: apt-get install python-matplotlib)
"""
import sys
import hdata, fighterkill
from extra_data import Fighters as extra
import matplotlib.pyplot as p... | ec429/harris | stats/fkmonthgraph.py | Python | gpl-3.0 | 2,243 |
# ------------------------------------------------------------------------------
# Name: test_nansat.py
# Purpose: Test the Nansat class
#
# Author: Morten Wergeland Hansen, Asuka Yamakawa, Anton Korosov
#
# Created: 18.06.2014
# Last modified:24.08.2017 14:00
# Copyright: (c) NERSC
# Licence... | nansencenter/nansat | nansat/tests/test_nansat.py | Python | gpl-3.0 | 34,081 |
import socket, sys,os,re
from struct import *
mymac=sys.argv[1]
rmac=sys.argv[2]
interface=sys.argv[3]
mode=sys.argv[4]
def address (a) :
b = "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x" % (ord(a[0]) , ord(a[1]) , ord(a[2]), ord(a[3]), ord(a[4]) , ord(a[5]))
return b
try:
s = socket.socket( socket.AF_PACKET , socket.SO... | europa502/shARP_2.0 | mac_decoder.py | Python | gpl-3.0 | 1,454 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015-16, Ritesh Khadgaray <khadgaray () gmail.com>
# Copyright: (c) 2018, Ansible Project
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__... | pgmillon/ansible | lib/ansible/modules/cloud/vmware/vmware_vm_shell.py | Python | gpl-3.0 | 13,224 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-02 14:22
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rstorch', '0001_initial'),
]
operations = [
migrations.AddField(
... | alevnyaa/restfulstorch | rstorch/migrations/0002_auto_20170302_1722.py | Python | gpl-3.0 | 602 |
from django.core.exceptions import ObjectDoesNotExist
from edc_registration.models import RegisteredSubject
from member.models import HouseholdMember
class ClinicMemberUpdater:
"""A class to update the clinic household member if it already
exists queried on the identity/OMANG.
"""
plot_identifier_su... | botswana-harvard/bcpp-subject | bcpp_subject/models/subject_consent/clinic_member_updater.py | Python | gpl-3.0 | 1,097 |
# -*- coding: utf-8 -*-
# The encoding declaration is necessary to tell Python that we are
# using Unicode in this file. See
# <http://www.python.org/dev/peps/pep-0263/>.
""":mod:`cpg_islands.views.qt` --- Views based on Q toolkit
"""
from xml.sax import saxutils
from PySide import QtGui, QtCore
from cpg_islands im... | seanfisk/cpg-islands | cpg_islands/qt/views.py | Python | gpl-3.0 | 21,504 |