repo_name stringlengths 5 104 | path stringlengths 4 248 | content stringlengths 102 99.9k |
|---|---|---|
OpenPathView/OPV_Tasks | opv_tasks/task/findnearestcptask.py | # coding: utf-8
# Copyright (C) 2017 Open Path View, Maison Du Libre
# 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.
# ... |
dichen001/Go4Jobs | JackChen/linked_list/328. Odd Even Linked List.py | """
Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the value in the nodes.
You should try to do it in place. The program should run in O(1) space complexity and O(nodes) time complexity.
Example:
Given 1->2->3->4->5->N... |
TimothyZhang/structer | structerui/editor/grid/struct_list.py | # Copyright 2014 Timothy Zhang(zt@live.cn).
#
# This file is part of Structer.
#
# Structer 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 vers... |
migasfree/migasfree | migasfree/catalog/migrations/0002_4_14_versions.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import markdownx.models
class Migration(migrations.Migration):
dependencies = [
('catalog', '0001_initial'),
('server', '0019_4_14_versions'),
]
operations = [
migrations.De... |
Tebazil12/AqASS | test-code/python/test-locations.py | import numpy as np
import sys
sys.path.insert(0, '../../python-code')
from locations import *
import unittest
class TestLocs(unittest.TestCase):
#loc_a = Location(52.416801,-4.091099)
#loc_b = Location(52.426801,-4.092099)
def test_dist_between(self):
print 'test'
loc1 = Location(52.416801,... |
nlholdem/icodoom | ICO1/my_basic.py | #!/usr/bin/env python
from __future__ import print_function
from vizdoom import *
import sys
import threading
import math
from random import choice
from time import sleep
from matplotlib import pyplot as plt
sys.path.append('./agent')
sys.path.append('./deep_feedback_learning')
import numpy as np
im... |
thetoine/eruditorg | erudit/erudit/migrations/0004_eruditdocument.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('erudit', '0003_auto_20160219_1716'),
]
operations = [
migrations.CreateModel(
name='EruditDocument',
... |
pnuu/halostack | bin/halostack_cli.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2014, 2015 Panu Lahtinen
# Author(s):
# Panu Lahtinen <pnuu+git@iki.fi>
# 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 v... |
totaler/facturae | facturae/facturae.py | # -*- coding: utf-8 -*-
from libcomxml.core import XmlModel, XmlField
class FacturaeRoot(XmlModel):
_sort_order = ('root', 'fileheader', 'parties', 'invoices')
def __init__(self):
nsmap = {'ds': 'http://www.w3.org/2000/09/xmldsig#',
'fe': 'http://www.facturae.es/Facturae/2014/v3.2.... |
jonnybazookatone/adsfulltext_old | lib/CheckIfExtract.py | """
CheckIfExtract Worker Functions
These are the functions for the CheckIfExtract class. This worker should determine if the record selected by the given BibCode should be modified or not based on a given timing criteria (or changleable if required).
"""
import os
import utils
import json
from datetime impo... |
JCalebBR/stellarismodinstaller | mainscript.py | """
argparse module
"""
from argparse import ArgumentParser as ArgumentParser
from os import chdir as chdir
from os import getcwd as getcwd
from os import listdir as listdir
from os import mkdir as mkdir
from os import path as path
from os import remove as Remove
from shutil import move as move
from shutil i... |
nop33/indico-plugins | importer/indico_importer/plugin.py | # This file is part of Indico.
# Copyright (C) 2002 - 2017 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; either version 3 of the
# License, or (a... |
flavioc/ibmc-bio-db | scripts/users.py | #!/usr/bin/python
import MySQLdb
import sys
from connection import *
db = create_conn()
def has_user(name):
c = db.cursor()
sql = "SELECT id FROM user WHERE name = \"%s\"" % (name)
c.execute(sql)
row = c.fetchone()
return row is not None
def add_user(name, complete_name = None, email = 'noemail@email.com'... |
lizardsystem/flooding | flooding_lib/urls.py | from django.conf.urls import patterns, url, include
from django.conf import settings
from flooding_lib import views
from flooding_lib.views import pages
from flooding_lib.models import Project
import flooding_lib.sharedproject.urls
# import djcelery.urls
info_dict = {
'queryset': Project.objects.all(),
}
urlpat... |
ahad-s/getting-rich-with-rnn-nlp-stocks | skynetNLP.py | import numpy as np
import pandas as pd
import random
from string import translate, punctuation
from nltk.data import load
from nltk.corpus import stopwords
from nltk import word_tokenize
from sklearn.ensemble import RandomForestClassifier
from sklearn.cross_validation import train_test_split
from mindController impor... |
RedBalloonShenanigans/MonitorDarkly | src/serve.py | #!/usr/bin/python2
import locale
import os
from flask import Flask, request, send_from_directory
from PIL import Image, ImageDraw, ImageFont
from tempfile import mkstemp
from cnc_packet import build_upload_gif
from shutil import move
# set the project root directory as the static folder, you can set others.
app = ... |
jlcjunk/pynet_pac | class2/exer2.py | #!/usr/bin/env python
'''
simple telnet demo
'''
# imports
import telnetlib
import time
# varsDEVICE_IP
CON_TIMEOUT = 10
DEVICE_NAME = 'pynet-rtr1'
DEVICE_IP = '184.105.247.70'
DEVICE_PORT = 23
DEVICE_USER_PROMPT = 'Username'
DEVICE_USER = 'pyclass'
DEVICE_PASSWORD_PROMPT = 'Password'
DEVICE_PASSWORD = '88newclass'
... |
yump/euler | p10.py | #!/usr/bin/env python3
# Copyright (C) 2014 Russell Haley
#
# This file is part of euler.
#
# 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 optio... |
justinvforvendetta/electrum-boli | gui/qt/transaction_dialog.py | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 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... |
lahwaacz/qutebrowser | qutebrowser/browser/hints.py | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2017 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... |
Ensembles/ert | python/python/ert/ecl/ecl_subsidence.py | # Copyright (C) 2011 Statoil ASA, Norway.
#
# The file 'ecl_subsidence.py' is part of ERT - Ensemble based
# Reservoir Tool.
#
# ERT 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 versi... |
G4m4/soundtailor | scripts/filter_chamberlin.py | #!/usr/bin/env python
'''
@file filter_chamberlin.py
@brief Prototype of a Chamberlin state variable filter
@author gm
@copyright gm 2014
This file is part of SoundTailor
SoundTailor 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... |
pombredanne/pywb | tests/test_framed_inverse.py | import webtest
from pywb.webapp.pywb_init import create_wb_router
from pywb.framework.wsgi_wrappers import init_app
from .memento_fixture import *
from .server_mock import make_setup_module, BaseIntegration
setup_module = make_setup_module('tests/test_config_frames.yaml')
class TestMementoFrameInverse(MementoMixin... |
scorpilix/Golemtest | apps/blender/task/verificator.py | from __future__ import division
import math
import random
from golem.core.common import timeout_to_deadline
from apps.rendering.task.verificator import FrameRenderingVerificator
from apps.blender.resources.scenefileeditor import generate_blender_crop_file
from apps.blender.resources.imgcompare import check_size
cla... |
pferreir/indico-backup | indico/MaKaC/common/logger.py | # -*- 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... |
mjiang-27/django_learn | admin_basic/app/models.py | # -*- coding: utf-8 -*-
'''
modules used to make codes compatible for Python2.x and Python3.x
'''
from __future__ import unicode_literals
from django.utils.encoding import python_2_unicode_compatible
from django.db import models
# Create your models here.
# @python_2_unicode_compatible
class Article(models.Model):
... |
fabiencampillo/systemes_dynamiques_agronomie | Partie3_code_Identification_Zero_Fonction.py | # -*- coding: utf-8 -*-
"""
Created on Sat Jan 13 18:05:44 2018
@author: casenave
"""
# ************ CODE POUR L'ALGORITHME de NEWTON *******************************
import numpy as np
from matplotlib import pyplot as plt
import scipy.integrate as scint
from matplotlib import patches as pat
import scipy.optimize as ... |
yasserglez/arachne | django/arachnesite/arachneapp/__init__.py | # -*- coding: utf-8 -*-
#
# Arachne: Search engine for files shared via FTP and similar protocols.
# Copyright (C) 2008-2010 Yasser González Fernández <ygonzalezfernandez@gmail.com>
# Copyright (C) 2008-2010 Ariel Hernández Amador <gnuaha7@gmail.com>
#
# This program is free software: you can redistribute it and/or mod... |
koomik/CouchPotatoServer | couchpotato/core/media/movie/providers/automation/imdb.py | import traceback
import re
from bs4 import BeautifulSoup
from couchpotato import fireEvent
from couchpotato.core.helpers.rss import RSS
from couchpotato.core.helpers.variable import getImdb, splitString, tryInt
from couchpotato.core.logger import CPLog
from couchpotato.core.media._base.providers.base import MultiProvi... |
brownharryb/erpnext | erpnext/hr/doctype/employee/employee.py | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import getdate, validate_email_address, today, add_years, format_datetime
from frappe.model.naming import set_name_by_n... |
beiko-lab/gengis | plugins/PhylogeneticDistance/PhylogeneticDistance.py | # execfile("C:\Users\Admin\Documents\PEscript.py")
from PhylogeneticDistanceLayout import PhylogeneticDistanceLayout
import GenGIS
import wx
from scipy.spatial import Delaunay
import dendropy
class PhylogeneticDistance( PhylogeneticDistanceLayout ):
combinationMethods = {"Average(Local)": "AVGLOCAL", "Av... |
nschaetti/EchoTorch | examples/generation/narma10_esn_feedbacks.py | # -*- coding: utf-8 -*-
#
# File : examples/timeserie_prediction/switch_attractor_esn
# Description : NARMA 30 prediction with ESN.
# Date : 26th of January, 2018
#
# This file is part of EchoTorch. EchoTorch is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# Licen... |
saurabh6790/erpnext | erpnext/healthcare/doctype/clinical_procedure/clinical_procedure.py | # -*- coding: utf-8 -*-
# Copyright (c) 2017, ESS LLP and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import flt, nowdate, nowtime, cstr
from erpnext.healthcare.doc... |
thetoine/eruditorg | erudit/apps/public/journal/views.py | # -*- coding: utf-8 -*-
from collections import OrderedDict
from string import ascii_lowercase
from django.core.exceptions import ObjectDoesNotExist
from django.shortcuts import get_object_or_404
from django.template import RequestContext
from django.utils.functional import cached_property
from django.views.generic i... |
hgn/machine-code-analyzer | scripts/build-kernel.py | #!/usr/bin/env python3
import math
import os
import sys
import readline
import subprocess
import multiprocessing
import datetime
import tempfile
import shutil
import re
KERNEL_VERSION = "v4.0"
KERNELDIR = "%s/%s" % (os.getcwd(), "linux-src")
KERNEL_SRC_DIR = "%s/%s" % (KERNELDIR, "src")
KERNEL_BUILD_DIR =... |
jnsebgosselin/WHAT | gwhat/gwrecharge/gwrecharge_gui.py | # -*- coding: utf-8 -*-
# Copyright © 2014-2018 GWHAT Project Contributors
# https://github.com/jnsebgosselin/gwhat
#
# This file is part of GWHAT (Ground-Water Hydrograph Analysis Toolbox).
# Licensed under the terms of the GNU General Public License.
import time
import os.path as osp
# ---- Imports: third parties
... |
fkie-cad/FACT_core | src/web_interface/file_tree/jstree_conversion.py | from common_helper_files import human_readable_file_size
from web_interface.file_tree.file_tree import get_correct_icon_for_mime
from web_interface.file_tree.file_tree_node import FileTreeNode
def convert_to_jstree_node(node: FileTreeNode):
'''
converts a file tree node to a json dict that can be rendered by... |
chienlieu2017/it_management | odoo/addons/stock/models/stock_picking.py | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from collections import namedtuple
import json
import time
from odoo import api, fields, models, _
from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT
from odoo.tools.float_utils import float_compare
from odoo.addons.... |
sio2project/oioioi | oioioi/programs/problem_instance_utils.py | from django.conf import settings
def get_allowed_languages_dict(problem_instance):
lang_dict = getattr(settings, 'SUBMITTABLE_EXTENSIONS', {})
allowed_langs = (
problem_instance.problem.controller.get_allowed_languages_for_problem(
problem_instance.problem
)
)
contest_langs... |
spasmilo/electrum | gui/qt/installwizard.py | from PyQt4.QtGui import *
from PyQt4.QtCore import *
import PyQt4.QtCore as QtCore
import electrum
from electrum.i18n import _
from electrum import Wallet, Wallet_2of2, Wallet_2of3
from electrum import bitcoin
from electrum import util
import seed_dialog
from network_dialog import NetworkDialog
from util import *
fro... |
wufangjie/leetcode | 721. Accounts Merge.py | from collections import defaultdict
class Solution(object):
def accountsMerge(self, accounts):
"""
:type accounts: List[List[str]]
:rtype: List[List[str]]
"""
dct = defaultdict(list)
for i, account in enumerate(accounts):
for email in account[1:]:
... |
cherepaha/PyDLV | pydlv/dl_model_4.py | import numpy as np
from pydlv.dl_model_base import DLModelBase
class DLModel4(DLModelBase):
'''
This class defines the mathematical model for decision landscape in the form of
a system of two ordinary differential equations. It also encapsulates the definitions of
fit error functions and its jacobians... |
pacificclimate/climdir | cfmeta/cmipfile.py | import os.path
ATTR_KEYS = [
'activity',
'product',
'institute',
'model',
'experiment',
'frequency',
'modeling_realm',
'mip_table',
'ensemble_member',
'version_number',
'variable_name',
'temporal_subset',
'geographical_info',
't_start',
't_end',
'temporal... |
westial/restfulcomm | restfulcomm/clients/superclient.py | # -*- coding: utf-8 -*-
"""Super client class"""
from abc import ABCMeta, abstractmethod
class CommClient(metaclass=ABCMeta):
METHOD_GET = 'GET'
METHOD_POST = 'POST'
METHOD_PUT = 'PUT'
METHOD_DELETE = 'DELETE'
@abstractmethod
def __init__(self, configuration):
"""Configures the reque... |
virtue1990/mongodemo | scripts/basc.py | from pymongo import MongoClient
from unittest import TestCase,main
host = '127.0.0.1'
port = 27017
class TestMongoCase(TestCase):
'''
write for python mongo basic operation
'''
def setUp(self):
self.host = host
self.port = port
self.client = MongoClient(host=host,port=port)
... |
stestagg/mu | docs/conf.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Mu documentation build configuration file, created by
# sphinx-quickstart on Wed Oct 18 16:36:40 2017.
#
# 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
# autogen... |
maduck/provisioning | setup.py | import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name="provisioning",
version="0.1",
url='http://github.com/maduck/provisioning',
license='GPL',
description="A provisioning server for VoIP phones",
... |
wmfs/chimp | src/calc/Pin.py | '''
Created on 4 Mar 2012
@author: Tim.Needham
'''
PINHEAD_SCHEMA = "pinhead"
CALC_SCHEMA = "calc"
import cs
from calc.ContentAssembler import ContentAssembler
import chimpsql
import calc
import json
import os
import chimpspec
class Pin:
def __init__(self, pinTag, settings):
self.type = "... |
JoelMon/wadv | wadv.py | #! /usr/bin/env python3
import urllib2
from xml.dom import minidom
def main():
county = 'FLC086' # County code
url = 'http://alerts.weather.gov/cap/wwaatmget.php?x={COUNTY_CODE}&y=1'.format(COUNTY_CODE=county)
site = urllib2.urlopen(url)
data = site.read()
xml = minidom.parseString(data)
... |
steinnymir/BeamProfiler | test.py | # -*- coding: utf-8 -*-
"""
@author: Steinn Ymir Agustsson
Copyright (C) 2019 Steinn Ymir Agustsson
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, ... |
berdaniera/StreamPULSE | api/app.py | from flask import Flask, request, json
from sqlalchemy import create_engine
import pandas as pa
import json
e = create_engine('sqlite:///gages.db')
app = Flask(__name__)
# some references
#http://blog.luisrei.com/articles/flaskrest.html
#http://blog.miguelgrinberg.com/post/designing-a-restful-api-with-python-and-fla... |
h4ck3rm1k3/gcc-python-plugin-1 | testcpychecker.py | # -*- coding: utf-8 -*-
# Copyright 2011 David Malcolm <dmalcolm@redhat.com>
# Copyright 2011 Red Hat, Inc.
#
# This 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, o... |
pombredanne/lizard-progress | lizard_progress/migrations/0017_auto__del_field_organization_allows_non_predefined_locations.py | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Organization.allows_non_predefined_locations'
db.delete_column('lizard_progress_organizati... |
Donkyhotay/MoonPy | zope/testbrowser/testing.py | ##############################################################################
#
# Copyright (c) 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SO... |
adimania/mongo-slow-query-killer | query-killer.py | #!/usr/bin/env python
from pymongo import MongoClient
from optparse import OptionParser
from types import NoneType
import logging
logging.basicConfig(filename='mongo-query-killer.log',level=logging.DEBUG, format='%(asctime)s %(message)s')
parser = OptionParser()
parser.add_option("-m", "--mongohost", dest="host", he... |
mostaphaRoudsari/Honeybee | src/Honeybee_EnergyPlus Window Material.py | #
# Honeybee: A Plugin for Environmental Analysis (GPL) started by Mostapha Sadeghipour Roudsari
#
# This file is part of Honeybee.
#
# Copyright (c) 2013-2020, Mostapha Sadeghipour Roudsari <mostapha@ladybug.tools>
# Honeybee is free software; you can redistribute it and/or modify
# it under the terms of the GNU G... |
defionscode/ansible | test/units/modules/network/cloudvision/test_cv_server_provision.py | # 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 version.
#
# Ansible is distributed in the hope that ... |
bablokb/nerd-alarmclock | files/usr/local/lib/python2.7/site-packages/nclock/KeyController.py | #!/usr/bin/python
# --------------------------------------------------------------------------
# Class definition of KeyController - base class with operational functions
#
# Author: Bernhard Bablok
# License: GPL3
#
# Website: https://github.com/bablokb/nerd-alarmclock
#
# ---------------------------------------------... |
ayypot/akane | models.py | from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, ForeignKey
base = declarative_base()
class Board(base):
__tablename__ = 'boards'
id = Column(Integer, primary_key=True, nullable=False, autoincrement=True)
board_name = Column(String, unique=True, nullable=Fals... |
RoryBarnes/TideLock | TLock/CTL/p10o0/survey.py | # SURVEY.PY
#
# Written by Rory Barnes
#
# Calculate the time for a planet to tidally lock over a wide range of orbits
# and stellar masses. This script creates output files for three different
# planetary masses and creates the .eps file that goes into the manuscript.
# If you have already run this script, use tloc... |
hpfn/charcoallog | charcoallog/core/migrations/0008_auto_20170318_1300.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-18 13:00
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0007_auto_20170318_1225'),
]
operations = [
migrations.AlterField(
... |
sgsdxzy/smartlink | smartlink/common.py | """Common classes routines for smartlink."""
from collections.abc import Sequence
from . import varint
class DeviceError(RuntimeError):
"""Raised by Device when the execution of a command fails."""
pass
class StreamReadWriter:
"""Class for storing the StreaReader and StreamWriter pair"""
__slots__... |
wufangjie/leetcode | 143. Reorder List.py | # Definition for singly-linked list.
class ListNode(object):
def __init__(self, x, next=None):
self.val = x
self.next = next
class Solution(object):
def reorderList(self, head):
"""
:type head: ListNode
:rtype: void Do not return anything, modify head in-place instead.
... |
mganeva/mantid | Testing/PerformanceTests/sqlresults.py | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
from __future__ import (absolute_import, divi... |
bwrsandman/ReconStruct | ReconStruct/SchemaIO/__init__.py | # -*- coding: utf-8 -*-
"""
ReconStruct
Reconstruct is a application which helps easily reverse engineer binary file
formats. It is tested to run on Python 2.7, 3.3, 3.4 and pypy.
Copyright (c) 2014 Sandy Carter
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Genera... |
ayron/ncpapy | pactl.py | #!/usr/bin/env python3
import subprocess
class Pactl:
sources = {}
sinks = {}
source_output = {}
sink_input = {}
def parse_pactl(next):
while 1:
line = next()
if line ...
def pactl():
# Get pactl output
output = subprocess.check_output(['pactl', 'list']).decode('utf-8')
lin... |
chiara-paci/baskerville | baskervilleweb/archive/management/commands/create_document.py | """
Management utility to create superusers.
"""
from django.conf import settings
from django.contrib.auth.password_validation import validate_password
from django.core import exceptions
from django.core.management.base import BaseCommand, CommandError
from PIL import Image
from PIL.ExifTags import TAGS,GPSTAGS
from... |
Grumbel/rfactorlcd | rfactorlcd/dashlets/__init__.py | # rFactor Remote LCD
# Copyright (C) 2014 Ingo Ruhnke <grumbel@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 License, or
# (at your option) any later versi... |
mhbu50/erpnext | erpnext/non_profit/doctype/donation/test_donation.py | # Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
import frappe
from erpnext.non_profit.doctype.donation.donation import create_donation
class TestDonation(unittest.TestCase):
def setUp(self):
create_donor_type()
settings = frappe.get_doc('Non Profit Settin... |
Lambdanaut/Chess | src/bot.py | import random
import pieces
import rules
from mechanics import *
class Bot(object):
def __init__ (self, player):
self.player = player
def doTurn(self, board, fails=0):
raise NotImplementedError
def pieceValue(self, piece):
if pieces.isPawn(piece): return 1
if pieces.is... |
jmdana/memprof | memprof/mp_utils.py | # Copyright (c) 2013 Jose M. Dana
#
# This file is part of memprof.
#
# memprof 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 only).
#
# memprof is distributed in the hope that it wi... |
MageJohn/Terminal_Worm | misc_utils.py | '''Terminal Worm: A remake of the classic Snake game
Copyright (C) 2012, 2013 Yuri Pieters
Terminal Worm 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
(a... |
CDSP/zephserver | zephserver/task/task_ping.py | # -*- coding: utf-8 -*-
'''
Copyright 2015
Centre de données socio-politiques (CDSP)
Fondation nationale des sciences politiques (FNSP)
Centre national de la recherche scientifique (CNRS)
License
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public L... |
Ictp/indico | indico/MaKaC/webinterface/locators.py | # -*- 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... |
M0Rf30/sacks | voip/Ui_voipInterface.py | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/marcello/Documenti/sacks/sacksSvnUser/voip/voipInterface.ui'
#
# Created: Mon Dec 21 14:15:55 2009
# by: PyQt5 UI code generator 4.4.4
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui
clas... |
gabrielfalcao/sure | sure/terminal.py | # -*- coding: utf-8 -*-
# <sure - utility belt for automated testing in python>
# Copyright (C) <2010-2021> Gabriel Falcão <gabriel@nacaolivre.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundat... |
mementum/vcexportmanager | src/vcdata/__init__.py | #!/usr/bin/env python
# -*- coding: latin-1; py-indent-offset:4 -*-
################################################################################
#
# This file is part of VCExportManager
#
# VCExportManager is a graphical interface to export Visualchart (R)
# daily data files to ASCII text
#
# Copyright (C) 2012 Se... |
pitunti/alfaPitunti | plugin.video.alfa/channels/pelisxporno.py | # -*- coding: utf-8 -*-
from core import httptools
from core import scrapertools
from platformcode import logger
def mainlist(item):
logger.info()
itemlist = []
itemlist.append(item.clone(action="lista", title="Novedades", url="http://www.pelisxporno.com/?order=date"))
itemlist.append(item.clone(act... |
sharad/calibre | src/calibre/gui2/preferences/misc.py | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import textwrap
from calibre.gui2.preferences import ConfigWidgetBase, test_widget, Setting
from calibre.gui2.preferences.... |
s-gogna/JST | tac/tac_generation.py | # This file is part of JST.
#
# JST 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.
#
# JST is distributed in the hope that it will be ... |
CroissanceCommune/autonomie | autonomie/forms/training/trainer.py | # -*- coding: utf-8 -*-
# * Authors:
# * TJEBBES Gaston <g.t@majerti.fr>
# * Arezki Feth <f.a@majerti.fr>;
# * Miotte Julien <j.m@majerti.fr>;
import functools
import deform
from colanderalchemy import SQLAlchemySchemaNode
from autonomie import forms
from autonomie.forms.user.user import get_list_sch... |
gigascience/galaxy-genome-diversity | tools/select_snps/select_snps.py | #!/usr/bin/env python
import os
import sys
import math
from optparse import OptionParser
import genome_diversity as gd
def main_function(parse_arguments=None):
if parse_arguments is None:
parse_arguments = lambda arguments: (None, arguments)
def main_decorator(to_decorate):
def decorated_main(... |
JJGO/dotfiles | mac/.bitbar/old/audio.1s.py | #!/usr/bin/env python
# Prevents Internal Speakers from working (99% of the time you don't want them to work)
# Redirects "Display Audio" and 'eqMac2' to builtin output
# Redirects DELL 25 to DELL 27
import subprocess
import os
audiodevice = os.path.expanduser('~/bin/audiodevice')
def set_output(output):
c1 =... |
sniku/loniak | loniak_module/sources/imdb.py | import urllib2
from loniak_module.sources.base import SourceBase
from loniak_module.sources import HtmlSource
from loniak_module.tr.torrent import Torrent
try:
import feedparser
except ImportError:
from loniak_module.libs import feedparser
try:
from dateutil import parser
except ImportError:
from lon... |
jantman/tuxostat | fs_backup/home/tuxostat/devel/PhidgetsPython/Phidgets/Devices/MotorControl.py | """Copyright 2008 Phidgets Inc.
This work is licensed under the Creative Commons Attribution 2.5 Canada License.
To view a copy of this license, visit http://creativecommons.org/licenses/by/2.5/ca/
"""
__author__ = 'Adam Stelmack'
__version__ = '2.1.4'
__date__ = 'May 02 2008'
from threading import *
from ... |
sondree/Master-thesis | Python EA/ea/phenotype.py | #!/usr/bin/python
import logging
from utility import list_modules,load_module
from config import GLOBAL_SECTION
class PhenoLoader(object):
def __init__(self, configuration):
self.__name = configuration.get(GLOBAL_SECTION,"phenotype")
def get_possible_phenotypes(self):
path = "./phenotype... |
elainenaomi/sciwonc-dataflow-examples | dissertation2017/Experiment 2/instances/7_2_wikiflow_1sh_1s_noannot_wmj/computeusergroup_0/ConfigDB_UserGroup_0.py | HOST = "wfSciwoncWiki:enw1989@172.31.2.76:27001/?authSource=admin"
PORT = ""
USER = ""
PASSWORD = ""
DATABASE = "wiki"
READ_PREFERENCE = "secondary"
WRITE_CONCERN = "majority"
COLLECTION_INPUT = "sessions"
COLLECTION_OUTPUT = "contributors"
PREFIX_COLUMN = "w_"
OUTPUT_FILE = "contributors.dat"
OPERATION_TYPE = "DIS... |
zodiacnan/Masterarbeit | widgets/addMaterial.py | # -*- coding: utf-8 -*-
"""
Created on Tue Jul 11 11:23:38 2017
@author: DINGNAN
"""
import sys
import os
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
import sys
sys.path.append('C:\\Users\\DINGNAN\\Desktop\\NanDing\\MA\\moduls\\Material\\')
import subprocess
cla... |
araikes/physiologic-complexity | physComplex/dfa.py | import numpy as np
import matplotlib.pyplot as plt
def _rms(time_series, bin_size):
"""Computes the root mean square error across data segments
Args:
time_series: The time series
bin_size: The number of non-overlapping points to be detrended and for which rmse will be calculated
Returns:... |
kublaj/the-maker | templateViewBuilder_spec.py | import unittest
import os
import webbrowser as web
import sys
import makerTemplateViewBuilder
from makerUtilities import readFile
class TemplateTest(unittest.TestCase):
def setUp(self):
self.sysPath = "system/"
self.viewPath = "/Users/maker/Library/Application Support/TheMaker/"
... |
turdusmerula/kipartman | kipartman/frames/part_storages_frame.py | from dialogs.panel_part_storages import PanelPartStorages
from frames.edit_part_storage_frame import EditPartStorageFrame
import helper.tree
import rest
class DataModelStorage(helper.tree.TreeContainerItem):
def __init__(self, storage):
super(DataModelStorage, self).__init__()
self.storage = storag... |
UCBerkeleySETI/breakthrough | ML/CNNFRB/research_code/resnet.py | import skimage.io # bug. need to import this before tensorflow
import skimage.transform # bug. need to import this before tensorflow
import tensorflow as tf
from tensorflow.python.ops import control_flow_ops
from tensorflow.python.training import moving_averages
from config import Config
import tensorflow as tf
impor... |
Microvellum/Fluid-Designer | win64-vc/2.78/Python/bin/2.78/scripts/startup/bl_ui/properties_freestyle.py | # ##### 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... |
CHBMB/LazyLibrarian | gsconvert.py | #!/usr/bin/python
import os
import sys
import platform
import subprocess
if len(sys.argv) != 3:
print "Usage: gsconvert input.pdf output.jpg"
else:
GS = ""
if platform.system() == "Windows":
logger.error("This version of gsconvert does not run under Windows")
else:
GS = os.path.join(os... |
Ecogenomics/GTDBNCBI | scripts_dev/ncbi_strain_summary.py | #!/usr/bin/env python
###############################################################################
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public Li... |
sanoodles/lab | python/assignment-val-ref.py | import pprint
import unittest
class C1:
def __init__(self, v):
self.a1 = v
def __repr__(self):
return self.a1
def __eq__(self, other):
return self.__dict__ == other.__dict__
def __ne__(self, other):
return self.__dict__ != other.__dict__
def setA1(self, v):
s... |
testalt/electrum-dgc | lib/util.py | import os, sys, re, json
import platform
import shutil
from datetime import datetime
is_verbose = False
class MyEncoder(json.JSONEncoder):
def default(self, obj):
from transaction import Transaction
if isinstance(obj, Transaction):
return obj.as_dict()
return super(MyEncoder, s... |
TUDelftGeodesy/Doris | prepare_stack/create_inputfiles.py | # Function created by Gert Mulder
# Institute TU Delft
# Date 9-11-2016
# Part of Doris 5.0
# This function will create the needed files for a datastack based on input information from the datastack.
import xml.etree.ElementTree as ET
import os
import pickle
# Test data
# settings_table = '/home/gert/software/doris/D... |
jbsmith86/Apartments | forrentfinddata.py | import urllib2
import csv
import json
from BeautifulSoup import BeautifulSoup
import random
class ApartmentBuilding(object):
def __init__(self, aptname, link, bedrooms, price, latitude, longitude, address, city, state, zipcode):
self.aptname = aptname
self.link = link
self.bedrooms = bedroo... |
asajeffrey/servo | tests/wpt/web-platform-tests/network-error-logging/support/report.py | import time
import json
import re
from wptserve.utils import isomorphic_decode
def retrieve_from_stash(request, key, timeout, min_count, default_value):
t0 = time.time()
while time.time() - t0 < timeout:
time.sleep(0.5)
value = request.server.stash.take(key=key)
if value is not None and len(value) >= ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.