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 |
|---|---|---|---|---|---|
import datetime
from ecl.util.util import BoolVector
from ecl.util.test import TestAreaContext
from tests import ResTest
from res.enkf import ObsBlock
class ObsBlockTest(ResTest):
def test_create(self):
block = ObsBlock("OBS" , 1000)
self.assertTrue( isinstance( block , ObsBlock ))
sel... | andreabrambilla/libres | python/tests/res/enkf/test_obs_block.py | Python | gpl-3.0 | 1,177 |
# -*- coding: utf-8 -*-
"""Configure batch3dfier with the input data."""
import os.path
from subprocess import call
from shapely.geometry import shape
from shapely import geos
from psycopg2 import sql
import fiona
def call_3dfier(db, tile, schema_tiles,
pc_file_name, pc_tile_case, pc_dir,
... | balazsdukai/batch3dfier | batch3dfier/config.py | Python | gpl-3.0 | 20,894 |
# Released under the GNU General Public License version 3 by J2897.
def get_page(page):
import urllib2
source = urllib2.urlopen(page)
return source.read()
title = 'WinSCP Updater'
target = 'Downloading WinSCP'
url = 'http://winscp.net/eng/download.php'
print 'Running: ' + title
print 'Target: ' + target
print ... | J2897/WinSCP_Updater | Update_WinSCP.py | Python | gpl-3.0 | 4,220 |
# ##### 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 3
# of the License, or (at your option) any later version.
#
# This program is distrib... | digicreatures/rigacar | __init__.py | Python | gpl-3.0 | 7,661 |
#!/usr/bin/python3
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2016 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 d... | jonathon-love/snapcraft | snapcraft/_schema.py | Python | gpl-3.0 | 2,896 |
from d51.django.auth.decorators import auth_required
from django.contrib.sites.models import Site
from django.http import Http404, HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.core.exceptions import ImproperlyConfigured
from .services import... | domain51/d51.django.apps.sharing | d51/django/apps/sharing/views.py | Python | gpl-3.0 | 1,793 |
#!/usr/bin/python3
import gpxpy
import datetime
import time
import os
import gpxpy.gpx
import sqlite3
import pl
import re
DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ'
filebase = os.environ["XDG_DATA_HOME"]+"/"+os.environ["APP_ID"].split('_')[0]
def create_gpx():
# Creating a new file:
# --------------------
gpx = g... | VictorThompson/ActivityTracker | py/geepeeex.py | Python | gpl-3.0 | 5,539 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Product.date_added'
db.add_column(u'clone_product', 'date... | indradhanush/Instamojo-Clone | clone/migrations/0002_auto__add_field_product_date_added.py | Python | gpl-3.0 | 4,593 |
class Video(object):
def __init__(self, json):
self.id = json['id']
self.slug = json['slug']
self.title = json['title']
self.presenters = json['presenters']
self.host = json['host']
self.embed_code = json['embed_code']
def presenter_names(self):
return ', '.join(map(lambda p: p['first_n... | watsonbox/xbmc-confreaks | api/video.py | Python | gpl-3.0 | 558 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'hue-gui.ui'
#
# Created by: PyQt5 UI code generator 5.8.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindo... | kusti8/hue-plus | hue_plus/hue_gui.py | Python | gpl-3.0 | 45,771 |
import praw
import json
import requests
import tweepy
import time
import os
import csv
import re
import configparser
import urllib.parse
import sys
from glob import glob
from gfycat.client import GfycatClient
from imgurpython import ImgurClient
import distutils.core
import itertools
import photohash
from PIL import Ima... | corbindavenport/me-irl-bot | memebot.py | Python | gpl-3.0 | 13,750 |
#------------------------------------------------------------------------------------------
#
# Copyright 2017 Robert Pengelly.
#
# This file is part of ppa-helper.
#
# 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
# ... | robertapengelly/ppa-helper | ppa_helper/compat.py | Python | gpl-3.0 | 3,031 |
# archive_test.py - unit tests for archive.py
# Authors:
# * Erich Blume <blume.erich@gmail.com>
#
# Copyright 2011 Erich Blume <blume.erich@gmail.com>
#
# This file is part of Tiger Lily.
#
# Tiger Lily is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Licen... | eblume/Tiger-Lily | tigerlily/utility/archive_test.py | Python | gpl-3.0 | 3,252 |
# Copyright 2019-2020 by Christopher C. Little.
# This file is part of Abydos.
#
# Abydos 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... | chrislit/abydos | abydos/distance/_roberts.py | Python | gpl-3.0 | 3,233 |
# -*- 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):
# Changing field 'Graph.slug'
db.alter_column('muparse_graph', 'slug', self.gf('django.db.models.fields.Slu... | grnet/mupy | muparse/migrations/0004_auto__chg_field_graph_slug__chg_field_graph_name.py | Python | gpl-3.0 | 4,828 |
# Standard Library
from builtins import str
import os
import zipfile
from urllib.parse import quote_plus
from urllib.request import urlopen
# Third Party Stuff
from django import template
from django.conf import settings
from django.contrib.auth.models import User
from django.db.models import Q
# Spoken Tutorial Stuf... | Spoken-tutorial/spoken-website | creation/templatetags/creationdata.py | Python | gpl-3.0 | 11,230 |
#-----------------------------------------------------------------------------
# Copyright (c) 2005-2016, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this s... | ijat/Hotspot-PUTRA-Auto-login | PyInstaller-3.2/PyInstaller/hooks/hook-sysconfig.py | Python | gpl-3.0 | 1,238 |
#!/usr/bin/env python
"""
crate_anon/nlp_manager/number.py
===============================================================================
Copyright (C) 2015-2021 Rudolf Cardinal (rudolf@pobox.com).
This file is part of CRATE.
CRATE is free software: you can redistribute it and/or modify
it under t... | RudolfCardinal/crate | crate_anon/nlp_manager/number.py | Python | gpl-3.0 | 1,874 |
"""!
@brief Cluster analysis algorithm: Expectation-Maximization Algorithm for Gaussian Mixture Model.
@details Implementation based on paper @cite article::ema::1.
@authors Andrei Novikov (pyclustering@yandex.ru)
@date 2014-2020
@copyright BSD-3-Clause
"""
import numpy
import random
from pycluster... | annoviko/pyclustering | pyclustering/cluster/ema.py | Python | gpl-3.0 | 28,795 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
**constants.py**
**Platform:**
Windows, Linux, Mac Os X.
**Description:**
Defines **Foundations** package default constants through the :class:`Constants` class.
**Others:**
"""
from __future__ import unicode_literals
import os
import platform
import fou... | KelSolaar/Foundations | foundations/globals/constants.py | Python | gpl-3.0 | 3,184 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2016/11/23 16:15
# @Author : xycfree
# @Link : http://example.org
# @Version : $
import os | xycfree/py_spider | baidu/__init__.py | Python | gpl-3.0 | 154 |
# -*- coding: utf-8 -*-
#
# This file is part of bd808's stashbot application
# Copyright (C) 2015 Bryan Davis and contributors
#
# 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... | bd808/tools-stashbot | stashbot/__init__.py | Python | gpl-3.0 | 845 |
#!/usr/bin/env python
import os, sys
sys.path.insert( 0, os.path.dirname( __file__ ) )
from common import delete
try:
assert sys.argv[2]
except IndexError:
print 'usage: %s key url [purge (true/false)] ' % os.path.basename( sys.argv[0] )
sys.exit( 1 )
try:
data = {}
data[ 'purge' ] = sys.argv[3]
e... | mikel-egana-aranguren/SADI-Galaxy-Docker | galaxy-dist/scripts/api/history_delete_history.py | Python | gpl-3.0 | 389 |
import rospy
import time
from collections import deque
class Publisher(object):
def __init__(self):
self.publishers = {}
self.queue = deque()
def add_publisher(self, alias, publisher):
self.publishers[alias] = publisher
def publish(self):
while len(self.queue) > 0:
... | jgrizou/robot_omniwheel | catkin_ws/src/roslego/scripts/publisher.py | Python | gpl-3.0 | 541 |
import os, h5py, numpy
from scipy.sparse import csc_matrix
import ml2h5.task
from ml2h5 import VERSION_MLDATA
from ml2h5.converter import ALLOWED_SEPERATORS
class BaseHandler(object):
"""Base handler class.
It is the base for classes to handle different data formats.
It implicitely handles HDF5.
@c... | open-machine-learning/mldata-utils | ml2h5/converter/basehandler.py | Python | gpl-3.0 | 11,241 |
# coding: utf-8
from __future__ import unicode_literals
import re
from hashlib import sha1
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
ExtractorError,
determine_ext,
float_or_none,
int_or_none,
unified_strdate,
)
class ProSiebenSat1BaseIE(InfoExtractor... | Dunkas12/BeepBoopBot | lib/youtube_dl/extractor/prosiebensat1.py | Python | gpl-3.0 | 17,726 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# This pro... | tkaitchuck/nupic | examples/bindings/svm_how_to.py | Python | gpl-3.0 | 8,034 |
from cantilever_divingboard import *
# We need to scale the parameters before applying the optimization algorithm
# Normally there are about 20 orders of magnitude between the dimensions and
# the doping concentration, so this is a critical step
# Run the script
freq_min = 1e3
freq_max = 1e5
omega_min = 10... | jcdoll/PiezoD | python/archive/lbfgs.py | Python | gpl-3.0 | 752 |
"""
Django settings for spa_movies project.
Generated by 'django-admin startproject' using Django 1.9.7.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os... | davgibbs/movies-spa | apps/spa_movies/settings.py | Python | gpl-3.0 | 3,710 |
# Configs for mk-livestatus lookup scripts
HOST = [ 'nagios', 'nagios1' ]
PORT = 6557
| skywalka/splunk-for-nagios | bin/mklivestatus.py | Python | gpl-3.0 | 87 |
# -*- coding: utf-8 -*-
from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo
class SendmywayCom(XFSHoster):
__name__ = "SendmywayCom"
__type__ = "hoster"
__version__ = "0.04"
__pattern__ = r'http://(?:www\.)?sendmyway\.com/\w{12}'
__description__ = """SendMyWay hoster p... | sebdelsol/pyload | module/plugins/hoster/SendmywayCom.py | Python | gpl-3.0 | 619 |
from __future__ import unicode_literals
from frappe import _
app_name = "erpnext"
app_title = "ERPNext"
app_publisher = "Frappe Technologies Pvt. Ltd."
app_description = """ERP made simple"""
app_icon = "fa fa-th"
app_color = "#e74c3c"
app_email = "info@erpnext.com"
app_license = "GNU General Public License (v3)"
sour... | ESS-LLP/erpnext-healthcare | erpnext/hooks.py | Python | gpl-3.0 | 14,269 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-05-30 22:20
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pattern', '0014_pattern_editnumber'),
]
operations = [
migrations.AddField(... | yaxu/patternlib | pattern/migrations/0015_pattern_json.py | Python | gpl-3.0 | 444 |
#!/usr/bin/env python
# import sys
# sys.path.insert(0, '../')
import pyarchey.pyarchey as py
# o = py.Output()
# print 'Distro Name Pretty Name'
# print '---------------------------'
# print o.readDistro('./slack.test')
# print o.readDistro('./arch.test')
# print o.readDistro('./raspbian.test')
def test_slack():... | walchko/pyarchey | test.py | Python | gpl-3.0 | 646 |
"""__Main__."""
import sys
import os
import logging
import argparse
import traceback
import shelve
from datetime import datetime
from CONSTANTS import CONSTANTS
from settings.settings import load_config, load_core, load_remote, load_email
from settings.settings import load_html, load_sms
from core import read_structure... | Hoohm/pyHomeVM | pyHomeVM/__main__.py | Python | gpl-3.0 | 5,792 |
# -*- coding: utf-8 -*-
import gensim, logging
class SemanticVector:
model = ''
def __init__(self, structure):
self.structure = structure
def model_word2vec(self, min_count=15, window=15, size=100):
print 'preparing sentences list'
sentences = self.structure.prepare_list_of_words... | arashzamani/lstm_nlg_ver1 | language_parser/SemanticVector.py | Python | gpl-3.0 | 679 |
# Copyright 2016 Casey Jaymes
# This file is part of PySCAP.
#
# PySCAP 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.
#
# PySCAP is ... | cjaymes/pyscap | src/scap/model/oval_5/defs/windows/EntityStatePeSubsystemType.py | Python | gpl-3.0 | 1,004 |
#!/usr/bin/env python
#
# Copyright 2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
... | Gabotero/GNURadioNext | gr-digital/python/qa_ofdm_txrx.py | Python | gpl-3.0 | 5,471 |
# -*- coding: utf-8 -*-
from sqlalchemy import create_engine
from sqlalchemy import Column, Integer, String, UniqueConstraint
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
engine = create_engine('sqlite:///challenge.sqlite', echo=False)
Session = sessionmaker(bind=eng... | alfredocdmiranda/challenge-cep | models.py | Python | gpl-3.0 | 782 |
# xVector Engine Client
# Copyright (c) 2011 James Buchwald
# 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 pr... | buchwj/xvector | client/xVClient/ErrorReporting.py | Python | gpl-3.0 | 4,145 |
#
# Test PM force parallelisation:
# check force does not depend on number of MPI nodes
import fs
import numpy as np
import h5py
import pm_setup
# read reference file
# $ python3 create_force_h5.py to create
file = h5py.File('force_%s.h5' % fs.config_precision(), 'r')
ref_id = file['id'][:]
ref_force = file['f'][:]
... | junkoda/fs2 | test/test_pm_force.py | Python | gpl-3.0 | 990 |
# encoding: utf-8
# main.py, copyright 2014 by Marko Čibej <marko@cibej.org>
#
# This file is part of SvgMapper. Full sources and documentation
# are available here: https://github.com/tumbislav/SvgMapper
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General P... | tumbislav/SvgMapper | src/main.py | Python | gpl-3.0 | 2,923 |
#!/usr/bin/env python
from distutils.core import setup
import os
import sys
def main():
SHARE_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)),
"share")
data_files = []
# don't trash the users system icons!!
black_list = ['index.theme', 'index.theme~']
for path, ... | ashh87/caffeine | setup.py | Python | gpl-3.0 | 1,042 |
import numpy as np
import cv2
from scipy import interpolate
from random import randint
import IPython
from alan.rgbd.basic_imaging import cos,sin
from alan.synthetic.synthetic_util import rand_sign
from alan.core.points import Point
"""
generates rope using non-holonomic car model dynamics (moves with turn radius)
gen... | mdlaskey/DeepLfD | src/deep_lfd/synthetic/synthetic_rope.py | Python | gpl-3.0 | 3,594 |
__author__ = 'nicolas'
# coding=utf-8
from os.path import expanduser
from ordereddict import OrderedDict
from Bio import SwissProt
import time
import MySQLdb as mdb
"""
Fuck!
from ordereddict import OrderedDict
import MySQLdb as mdb
dicc = {}
dictdebug_empty = OrderedDict()
dictdebug = dictdebug_empty
dictdebug['hol... | naikymen/QB9 | uniprot_parser/uniprot_parser_v01.py | Python | gpl-3.0 | 14,072 |
# -*- coding: utf-8 -*-
# © 2013-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields, api, _
from odoo.exceptions import ValidationError, UserError
class AccountInvoiceLine(models.Model):
_inherit = 'accou... | stellaf/sales_rental | account_invoice_start_end_dates/models/account_invoice.py | Python | gpl-3.0 | 3,875 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('agentex', '0014_remove_decision_datacollect'),
]
operations = [
migrations.AddField(
model_name='datapoint',
... | tomasjames/citsciportal | app/agentex/migrations/0015_datapoint_sorttimestamp.py | Python | gpl-3.0 | 431 |
import numpy as np
import struct
import wave
from winsound import PlaySound, SND_FILENAME, SND_ASYNC
import matplotlib.pyplot as plt
CHUNK = 1 << 8
def play(filename):
PlaySound(filename, SND_FILENAME | SND_ASYNC)
fn = r"D:\b.wav"
f = wave.open(fn)
print(f.getparams())
ch = f.getnchannels()
sw = f.getsampwidth(... | DavideCanton/Python3 | audio/freq.py | Python | gpl-3.0 | 663 |
import tensorflow as tf
from tensorflow.python.ops import rnn_cell
from tensorflow.python.ops import seq2seq
import numpy as np
class Model():
def __init__(self, args, infer=False):
self.args = args
if infer:
args.batch_size = 1
args.seq_length = 1
if args.model ==... | bottiger/Integer-Sequence-Learning | char/model.py | Python | gpl-3.0 | 4,473 |
# -*- coding: utf-8 -*-
import terrariumLogging
logger = terrariumLogging.logging.getLogger(__name__)
from pathlib import Path
import inspect
from importlib import import_module
import sys
import statistics
from hashlib import md5
from time import time, sleep
from operator import itemgetter
from func_timeout import fu... | theyosh/TerrariumPI | hardware/sensor/__init__.py | Python | gpl-3.0 | 18,830 |
# coding = utf-8
# import modules
import os
import matplotlib.pyplot as plt
import numpy as np
import scipy as sp
import my_config
path = my_config.ROOT_DIR # Please create your config file
file = my_config.FILE # Please create your config file
# get time series for ch0 and plot
import wave
def t... | ejoonie/heart_sound | main_waveform_20170517.py | Python | gpl-3.0 | 3,229 |
self.Step (Message = "Receptionist-N ->> Klient-N [genvej: fokus-modtagerliste] (måske)")
self.Step (Message = "Receptionist-N ->> Klient-N [retter modtagerlisten]")
| AdaHeads/Hosted-Telephone-Reception-System | use-cases/.patterns/adjust_recipients/test.py | Python | gpl-3.0 | 217 |
#
# Python module to parse OMNeT++ vector files
#
# Currently only suitable for small vector files since
# everything is loaded into RAM
#
# Authors: Florian Kauer <florian.kauer@tuhh.de>
#
# Copyright (c) 2015, Institute of Telematics, Hamburg University of Technology
# All rights reserved.
#
# Redistribution and use ... | i-tek/inet_ncs | simulations/analysis_tools/python/omnet_vector.py | Python | gpl-3.0 | 3,886 |
#!/usr/bin/env python
# coding=utf-8
"""598. Split Divisibilities
https://projecteuler.net/problem=598
Consider the number 48.
There are five pairs of integers $a$ and $b$ ($a \leq b$) such that $a \times
b=48$: (1,48), (2,24), (3,16), (4,12) and (6,8).
It can be seen that both 6 and 8 have 4 divisors.
So of th... | openqt/algorithms | projecteuler/pe598-split-divisibilities.py | Python | gpl-3.0 | 660 |
import pyes
import os
from models import *
from sqlalchemy import select
from downloader import download
import utils
import re
import time
class Search(object):
def __init__(self,host,index,map_name,mapping=None,id_key=None):
self.es = pyes.ES(host)
self.index = index
self.map_name = map_... | sweemeng/Malaysian-Bill-Watcher | billwatcher/indexer.py | Python | gpl-3.0 | 3,747 |
import requests
from bs4 import BeautifulSoup
def trade_spider(max_pages):
page = 1
while page <= max_pages:
url = "https://thenewboston.com/videos.php?cat=98&video=20144" #+ str(page)
source_code = request.get(url)
plain_text = source_code.text
soup = BeautifulSoup(plain_text)
... | Tbear1981/bitcoin-overseer | files/webcrawler.py | Python | gpl-3.0 | 705 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "djangorest.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that t... | IntroSDE/introsde | projects/tutorial_django_rest_framework_2017/djangorest/manage.py | Python | gpl-3.0 | 808 |
for i in range(0):
i += 1
for j in range(0, 1, 3):
j += 1
for k in range(9, 1, -9):
k += 1
for n in range(0, 1.1): # Error on this line
n += 1
for m in range(4, 5):
m += 1
| RyanDJLee/pyta | examples/invalid_range_index_example.py | Python | gpl-3.0 | 197 |
# -*- encoding: UTF-8 -*-
import datetime
from sqlalchemy import MetaData, Table, Column, String, Integer
from Interface import AbstractDataObject
from utils.String import attributes_repr
def define_event_table(meta: MetaData):
return Table(
'events', meta,
Column('book_id', String, primary_key=... | mingotang/libdata | structures/Event.py | Python | gpl-3.0 | 2,531 |
#!/usr/bin/env python
import logging
import os
import urllib
from cvmfsreplica.cvmfsreplicaex import PluginConfigurationFailure
from cvmfsreplica.interfaces import RepositoryPluginAcceptanceInterface
import cvmfsreplica.pluginsmanagement as pm
class Updatedserver(RepositoryPluginAcceptanceInterface):
def __ini... | jose-caballero/cvmfsreplica | cvmfsreplica/plugins/repository/acceptance/Updatedserver.py | Python | gpl-3.0 | 3,761 |
from django.db import models
class Licensor(models.Model):
name = models.CharField(max_length=255, unique=True)
def __unicode__(self):
return self.name
class Meta:
ordering = ['name']
| jampueroc/scrapper_anime | visualizacion/models/licensor.py | Python | gpl-3.0 | 216 |
import socket
import sys
import time
server_add = './bob_system_socket'
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
message = sys.argv[1]+" "+sys.argv[2]
if sys.argv[1] == 'set':
message+= " "+sys.argv[3]
else:
message+= " null"
try:
sock.connect(server_add)
except socket.error, msg:
print >>sys.stde... | tibor0991/OBM-BOB | bob-main/test_sender.py | Python | gpl-3.0 | 455 |
import inspect
from django.utils.translation import activate
class MenuItemMixin:
"""
This mixins injects attributes that start with the 'menu_' prefix into
the context generated by the view it is applied to.
This behavior can be used to highlight an item of a navigation component.
"""
def g... | erudit/eruditorg | eruditorg/base/viewmixins.py | Python | gpl-3.0 | 913 |
# -*- coding:utf-8 -*-
# @author xupingmao <578749341@qq.com>
# @since 2020/08/22 21:54:56
# @modified 2022/02/26 10:40:22
import xauth
import xtemplate
import xutils
import os
import re
import sys
import platform
import xconfig
from xutils import dateutil
from xutils import fsutil
from xutils import Storage
from xutil... | xupingmao/xnote | handlers/system/system_info.py | Python | gpl-3.0 | 2,138 |
# -*- coding: utf-8 -*-
from bottle import run, get, post, view, request, redirect, route, static_file, template
import bottle
import json
import threading
import requests
import time
import sys
messages = set([])
@bottle.route('/static/<path:path>')
def server_static(path):
return static_file(path, root='static'... | jpwbernardi/Computacao-Distribuida | Trabalho1/main.py | Python | gpl-3.0 | 816 |
#!/usr/bin/python3
'''
This is a simple example of how to use the dbm.gnu module of the
standard python library
NOTES:
- the attempt to insert None as value throws an exception.
so only strings and bytes are allowed.
'''
import dbm.gnu # for open
# the 'c' in the next row means open rw and create if it doesn't ex... | nonZero/demos-python | src/examples/short/dbm/gdbm_insert.py | Python | gpl-3.0 | 431 |
import gc
import os
import argparse
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
from util import generate_features
def get_arguments():
parser = argparse.ArgumentParser(description='Generate features using a previously trained model')
parser.add_argument('data', type=str, help='File containing the input smiles m... | patrick-winter-knime/deep-learning-on-molecules | smiles-vhts/generate_features.py | Python | gpl-3.0 | 769 |
"""
Diabicus: A calculator that plays music, lights up, and displays facts.
Copyright (C) 2016 Michael Lipschultz
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
(... | lipschultz/diabicus | src/numeric_tools.py | Python | gpl-3.0 | 8,003 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | tsdmgz/ansible | lib/ansible/modules/network/aci/aci_bd.py | Python | gpl-3.0 | 12,055 |
# -*- coding:utf-8 -*-
print("Hello") | okkn/YagiMed | yagimed/main.py | Python | gpl-3.0 | 37 |
#!/usr/bin/env python
import sys
import time
from envirophat import light, weather, motion, analog
def write():
try:
p = round(weather.pressure(),2)
c = light.light()
print('{"light": '+str(c)+', "pressure": '+str(p)+' }')
except KeyboardInterrupt:
pass
write()
| alexellis/docker-arm | images/armhf/python2-envirophat.dev/pressure/pressure.py | Python | gpl-3.0 | 277 |
#
# SPDX-FileCopyrightText: 2017 Dmytro Kolomoiets <amerlyq@gmail.com> and contributors.
#
# SPDX-License-Identifier: GPL-3.0-only
#
class NodeSuperimposeTr(object):
def __call__(self, g, node_uid, aug):
conv = {}
for uid in aug:
if uid == aug.get_root():
g[node_uid] = ... | miur/miur | OLD/miur/graph/transform.py | Python | gpl-3.0 | 554 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of AudioLazy, the signal processing Python package.
# Copyright (C) 2012-2014 Danilo de Jesus da Silva Bellini
#
# AudioLazy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# ... | antiface/audiolazy | examples/dft_pitch.py | Python | gpl-3.0 | 3,525 |
import os
import tempfile
import zipfile
from PyQt5 import QtCore, QtWidgets
import util
from vaults.modvault import utils
FormClass, BaseClass = util.THEME.loadUiType("vaults/modvault/upload.ui")
class UploadModWidget(FormClass, BaseClass):
def __init__(self, parent, modDir, modinfo, *args, **kwargs):
... | FAForever/client | src/vaults/modvault/uploadwidget.py | Python | gpl-3.0 | 5,368 |
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2013 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.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 Foundation, eithe... | power12317/weblate | weblate/trans/views.py | Python | gpl-3.0 | 68,329 |
# coding=utf-8
"""Dummy test.
Pointless dummy test.
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
# import pysnapsync.server
# import pysnapsync.client
def inc(arg):
"""Return arg incremented by one."""
return arg + 1
def test_answer():
... | dtaylor84/pysnapsync | pysnapsync/tests/test_dummy.py | Python | gpl-3.0 | 370 |
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.views.generic import View
from .models import \
Course, Registration, Task, TaskSubmission, ScoreProfile
from .forms import TaskSubmissionForm
class Course... | iver56/trondheim.kodeklubben.no | backend/wsgi/courses/views.py | Python | gpl-3.0 | 4,033 |
import hashlib
import re
import os
import pickle
from functools import partial
from externals.lib.misc import file_scan, update_dict
import logging
log = logging.getLogger(__name__)
VERSION = "0.0"
# Constants --------------------------------------------------------------------
DEFAULT_DESTINATION = './files/'
DEF... | richlanc/KaraKara | website/karakara/scripts/hash_matcher.py | Python | gpl-3.0 | 3,469 |
from controlscript import *
print "This is a simple control script. It just does nothing and exits successfully."
print "Start parameter is %s, additional parameters are %s" % (start, arguments)
class DoNothing(ControlAction):
""" Control script action for exiting with error 1 on stop """
def __init__(self):
Cont... | remybaranx/qtaste | Testbeds/ControlScripts/do_nothing.py | Python | gpl-3.0 | 507 |
import logging
from django.core.management.base import BaseCommand
from catalog.core.visualization.data_access import visualization_cache
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = '''Build pandas dataframe cache of primary data'''
def handle(self, *args, **options):
v... | comses/catalog | catalog/core/management/commands/populate_visualization_cache.py | Python | gpl-3.0 | 359 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 3 13:38:36 2015
@author: madengr
"""
from gnuradio import gr
import osmosdr
from gnuradio import filter as grfilter # Don't redefine Python's filter()
from gnuradio import blocks
from gnuradio import fft
from gnuradio.fft import window
from gnuradi... | kaback/ham2mon | apps/receiver.py | Python | gpl-3.0 | 25,151 |
# revlog.py - storage back-end for mercurial
#
# Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
"""Storage back-end for Mercurial.
This provides efficient delta storage with O(1... | mikel-egana-aranguren/SADI-Galaxy-Docker | galaxy-dist/eggs/mercurial-2.2.3-py2.7-linux-x86_64-ucs4.egg/mercurial/revlog.py | Python | gpl-3.0 | 44,332 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from PyQt5 import QtWidgets
from view.analysis_widget import AnalysisWidget
# noinspection PyPep8Naming
class TemporalAnalysisWidget(AnalysisWidget):
# noinspection PyArgumentList
def __init__(self, mplCanvas):
"""
Construct the Temporal Analys... | yuwen41200/biodiversity-analysis | src/view/temporal_analysis_widget.py | Python | gpl-3.0 | 1,068 |
import sys, os
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '',''))
import numpy as np
#from skgraph import datasets
from sklearn import svm
#from skgraph.ioskgraph import *
from math import sqrt
import sys
from sklearn.metrics import roc_auc_score
#"sys.path.append('..\\..\\Multiple Kernel Learning\\... | nickgentoo/scikit-learn-graph | scripts/cross_validation_from_matrix_AUC_norm.py | Python | gpl-3.0 | 3,283 |
# Copyright 2008 Dan Smith <dsmith@danplanet.com>
# Copyright 2012 Tom Hayward <tom@tomh.us>
#
# 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 opti... | cl4u2/chirp | chirpui/mainapp.py | Python | gpl-3.0 | 67,000 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__version__ = '0.1.3'
| sciunto-org/scifig | libscifig/__init__.py | Python | gpl-3.0 | 69 |
# the problem described below was fixed in 9758!
# keep_htpsit=False fails since 9473,
# on some installations (?) with:
# case A (see below in the code):
# RuntimeError: Could not locate the Fermi level!
# or the energies from the 2nd one behave strange, no convergence:
# iter: 1 18:21:49 +1.7 -3608.... | robwarm/gpaw-symm | gpaw/test/big/scf/b256H2O/b256H2O.py | Python | gpl-3.0 | 4,905 |
#!/usr/bin/python3
# Copyright (C) 2014-2016, 2018 Rafael Senties Martinelli
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License 3 as published by
# the Free Software Foundation.
#
# This program is distributed in the hope that it will... | rsm-gh/alienware-kbl | usr/lib/python3/AKBL/CCParser.py | Python | gpl-3.0 | 12,434 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-07-01 20:13
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('flocks', '0015_auto_20170624_1312'),
('feeding', '000... | forcaeluz/easy-fat | feeding/migrations/0006_auto_20170701_2013.py | Python | gpl-3.0 | 1,270 |
# -*- coding: utf-8 -*-
from ptools import *
pdb1f88 = getPDB("1F88")
WritePDB(pdb1f88, "1F88.pdb")
| glamothe/ptools | Tests/get1F88.py | Python | gpl-3.0 | 102 |
from node import models
from django.forms import ModelForm
from . import cdmsportalfunc as cpf
from django.core.exceptions import ValidationError
from django import forms
class MoleculeForm(ModelForm):
class Meta:
model = models.Molecules
fields = '__all__'
class SpecieForm(ModelForm):
datea... | cpe/VAMDC-VALD | nodes/cdms/node/forms.py | Python | gpl-3.0 | 1,963 |
"""Clean db
Revision ID: 4f8bd7cac829
Revises: 3f249e0d2769
Create Date: 2014-01-09 14:03:13.997656
"""
# revision identifiers, used by Alembic.
revision = '4f8bd7cac829'
down_revision = '3f249e0d2769'
from alembic import op
import sqlalchemy as sa
def upgrade():
''' Drop the columns calendar_multiple_meeting... | fedora-infra/fedocal | alembic/versions/4f8bd7cac829_clean_db.py | Python | gpl-3.0 | 1,420 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Takes Google's json encoded spreadsheet and prints a python dictionary keyed by
the values in the first column of the SS. ©2017 J. J. Crump, GNU general public
license
"""
import urllib2
from pprint import pprint
import re
import json
# This is the url of a sample googl... | jjon/Google-Spreadsheet-python-scripts | GSheet2Python.py | Python | gpl-3.0 | 1,622 |
#-*- encoding: utf-8 -*-
from django.contrib.auth import authenticate, login, logout
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render_to_response, RequestContext, render
from membro_profile.forms import MembroForm, MembroProfileForm, EditProfileForm
from django.contrib.aut... | pixies/academic | membro_profile/views.py | Python | gpl-3.0 | 4,644 |
# -*- coding: utf-8 -*-
class ImproperlyConfigured(Exception):
pass
class TaskHandlingError(Exception):
pass
| Outernet-Project/artexinweb | artexinweb/exceptions.py | Python | gpl-3.0 | 121 |
# Eve W-Space
# Copyright (C) 2013 Andrew Austin and other contributors
#
# 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... | viarr/eve-wspace | evewspace/Map/views.py | Python | gpl-3.0 | 43,116 |
from datetime import datetime
import uuid
class Torrent(object):
def __init__(self):
self.tracker = None
self.url = None
self.title = None
self.magnet = None
self.seeders = None
self.leechers = None
self.size = None
self.date = None
self.detai... | stopstop/duvet | duvet/objects.py | Python | gpl-3.0 | 1,485 |
import math
import os
import re
import itertools
from types import LambdaType
import pkg_resources
import numpy
from PyQt4 import QtGui, QtCore, QtWebKit
from PyQt4.QtCore import Qt, pyqtSignal as Signal
from PyQt4.QtGui import QCursor, QApplication
import Orange.data
from Orange.widgets.utils import getdeepattr
fro... | PythonCharmers/orange3 | Orange/widgets/gui.py | Python | gpl-3.0 | 126,299 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# CodeBug Tether documentation build configuration file, created by
# sphinx-quickstart on Thu Jun 20 15:23:09 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this... | codebugtools/codebug_tether | docs/conf.py | Python | gpl-3.0 | 8,707 |
'''
Nibblegen: A script to convert LaTex text to html usable in Nibbleblog Forked from the latex2wp project (the licenceing for which is below).
Copyright (C) 2014 Theodore Jones
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as publis... | theoj2/Nibbletex | nibblegen/nibblegen.py | Python | gpl-3.0 | 19,283 |