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 |
|---|---|---|---|---|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# fs.py
#
# Classes permettant d'accéder aux fonds d'écran contenus dans un
# dossier
#
# Copyright 2011 Kévin Gomez <contact@kevingomez.fr>
#
# This program is free software; you can redistribute it and/or modify
# it und... | K-Phoen/Wlppr | retrievers/fs.py | Python | gpl-3.0 | 2,326 |
# coding=utf-8
"""
InaSAFE uDisaster risk assessment tool developed by AusAid and World Bank
- **GUI Test Cases.**
Contact : ole.moller.nielsen@gmail.com
.. note:: 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 Fr... | opengeogroep/inasafe | safe_qgis/tools/test/test_keywords_dialog.py | Python | gpl-3.0 | 21,525 |
import matplotlib.pyplot as plt
import healpy as hp
import numpy as np
from interfaces import *
from utilities import *
import scipy.sparse.linalg as spla
def test_block_diagonal_precond_onto_real_data():
"""
Test the action of the block diagonal preconditioner, defined as
:math: `M_{BD}=(A^T A)^{-1}`
... | giuspugl/COSMOMAP2 | src/test_BD_precond_onto_real_data.py | Python | gpl-3.0 | 4,697 |
from twisted.application.service import Application
from redisbahn.server import RedisSubscriberConnFactory, Redis2WebsocketService
from redisbahn import broadcast
BIND = 'ws://localhost:9090'
CHANNEL = 'mychannel'
REDIS_CONN = '127.0.0.1', 6379
wsFactory = broadcast.Factory(url=BIND)
redisConnFactory = RedisSubscr... | petrushev/redisbahn | run.py | Python | gpl-3.0 | 533 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# QuickFF is a code to quickly derive accurate force fields from ab initio input.
# Copyright (C) 2012 - 2018 Louis Vanduyfhuys <Louis.Vanduyfhuys@UGent.be>
# Steven Vandenbrande <Steven.Vandenbrande@UGent.be>,
# Jelle Wieme <Jelle.Wieme@UGent.be>,
# Toon Verstraelen <Toon.... | molmod/QuickFF | scripts/qff.py | Python | gpl-3.0 | 1,457 |
#
# Copyright (C) 2009 TribleFlame Oy
#
# This file is part of TF.
#
# TF 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.
# ... | arximboldi/jagsat | lib/tf/arch/__init__.py | Python | gpl-3.0 | 892 |
vglyphs = dict([
('&', 'a'),
('V"', 'u'),
('@', 'e')])
def getvowelglyph(v):
global vglyphs
if v in vglyphs:
return vglyphs[v]
return v[0].lower()
cglyphs = dict([
('P', 'f'),
('B', 'b'),
('T', 'th'),
('D', 'th'),
('*', 'r'),
('*.', 'r'),
('S', 'sh'),
(... | tps12/Tec-Nine | language/orthography.py | Python | gpl-3.0 | 634 |
#!/usr/bin/env python
# vim: fileencoding=UTF-8 filetype=python ff=unix expandtab sw=4 sts=4 tw=120
# author: Christer Sjöholm -- goobook AT furuvik DOT net
import os
from distribute_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file... | dmaniloff/goobook | setup.py | Python | gpl-3.0 | 2,451 |
from ZODB import DB
from persistent import Persistent
import transaction
def main():
mydb = DB("C:\\Users\\Daniele\\Desktop\\mydb.db")
conn = mydb.open()
root = conn.root()
try:
del root['Test']
except KeyError:
pass
root['Test'] = TestClass()
print dir(root['Test'])
transaction.commit()
conn.close(... | dpdani/csu | src/core/stuff_with_db.py | Python | gpl-3.0 | 814 |
# -*- coding: utf-8 -*-
from datetime import datetime
from haproxy.logfile import Log
import pytest
def test_logfile_default_values():
"""Check that the default values are set."""
log_file = Log('something')
assert log_file.logfile == 'something'
assert log_file.show_invalid is False
assert log_f... | gforcada/haproxy_log_analysis | haproxy/tests/test_log_file.py | Python | gpl-3.0 | 3,969 |
#!/usr/bin/env python
# coding=utf-8
"""552. Chinese leftovers II
https://projecteuler.net/problem=552
Let An be the smallest positive integer satisfying An mod pi = i for all 1 ≤ i
≤ n, where pi is the i-th prime.
For example A2 = 5, since this is the smallest positive solution of the system
of equations
* A2 m... | openqt/algorithms | projecteuler/pe552-chinese-leftovers-ii.py | Python | gpl-3.0 | 853 |
#lib/ontologies/ie/deri | h4ck3rm1k3/gcc-ontology | lib/ontologies/ie/deri/__init__.py | Python | gpl-3.0 | 23 |
#!/usr/bin/env python3
'''
t4_fuse.py - this file is part of S3QL.
Copyright © 2008 Nikolaus Rath <Nikolaus@rath.org>
This work can be distributed under the terms of the GNU GPLv3.
'''
if __name__ == '__main__':
import pytest
import sys
sys.exit(pytest.main([__file__] + sys.argv[1:]))
from os.path impor... | s3ql/main | tests/t4_fuse.py | Python | gpl-3.0 | 12,760 |
carNum = 100
driversNum = 30
peopNumPerCar = 4.0
peopTotalNum = 90
carsNoDriver = carNum - driversNum
allIn = driversNum * peopNumPerCar
print "there are ",carNum,"cars available"
print "there are ",driversNum,"drivers available"
print "there will be ",carsNoDriver,"cars empty today"
print "Total ",driversNum * peop... | YantaiGao/learn_Python_The-Hard-Way | No4_var.py | Python | gpl-3.0 | 528 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# ultrafast documentation build configuration file, created by
# sphinx-quickstart on Thu Jul 7 22:55:24 2016.
#
# 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
# ... | marceloalcocer/ultrafast | docs/source/conf.py | Python | gpl-3.0 | 9,956 |
import ast
from django.db import models
def DictSortedStr(a):
return ('{' + ', '.join(
[str(k) + ': ' + str(v) for k, v in sorted(a.items())]) + '}')
class Availability(models.Model):
creation_time = models.DateTimeField(auto_now_add=True)
deleted = models.BooleanField(default=False)
locked = models.B... | mgeorg/scheduler | solver/models.py | Python | gpl-3.0 | 3,008 |
#!/bin/python3
f = open("result", "r")
lines = f.readlines()
f.close()
def get(symbol):
for i in range(0, len(lines)):
if lines[i] == ">>> " + symbol + "\n":
return float(lines[i + 1])
D = get("D")
H = get("H")
_C_h = get("_C.h")
_SH_h = get("_SH.h")
eff_em = get("eff_em")
_1_h= get("_1.h")
_... | alexej520/steamturbinecalculation | test2.py | Python | gpl-3.0 | 351 |
import numpy as np
import sklearn.preprocessing
from .learner import WeakLearner
class RatBoost:
def __init__(self, learner=None, max_learners=15, n_jobs=1, logger=None, verbose=0):
self.n_jobs = n_jobs
if logger is None:
self.logger = print
else:
self.logger = logg... | adrinjalali/Network-Classifier | RatBoost/ratboost.py | Python | gpl-3.0 | 2,956 |
#!/bin/python2
import sys,random,math
n = int(sys.argv[1])
if len(sys.argv) > 2:
a = float(sys.argv[2])
else:
a = 0.1
random.seed(1)
i = 0
pos=[]
vel=[]
mass=[]
while len(mass) < n:
x = [random.random() for x in range(0,3)]
c = x[0] ** (-2.0/3) - 1
R = 1/math.sqrt(c)
if R < 100:
... | anthony-arnold/nn | script/plummer.py | Python | gpl-3.0 | 2,053 |
# -*- coding: utf-8 -*-
# Copyright (c) 2016 Grant AO. All rights reserved.
import functools
import datetime
import smtplib
from email.mime.text import MIMEText
CONT_INCREASE_HEADER = u'''
连续上涨买入({date})
连续上涨天数大于等于3天的股票(1%~5%),越靠前的股票出现次数越多!股票有可能重复出现,比如最近3次和4次都上涨!
'''
UP_ALL_MAS_HEADER = u'''
突破所有均线买入({date})
最近... | aojwang/afxt | utils/email_.py | Python | gpl-3.0 | 3,963 |
#!/bin/env/python
A=[1,3,5,3,1]
#for item in A:
# if A.count(item)%2 != 0:
# print item
def solution(A):
A.sort()
counter=1
for i in xrange(len(A)-1):
if A[i+1] == A[i]:
counter += 1
else:
if counter%2 != 0:
return A[i]
if i == le... | ffakhraei/pProj | python/codility/ch2/oddOccur.py | Python | gpl-3.0 | 445 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 2 15:38:49 2018
@author: gazkune
"""
import sys
import numpy as np
from collections import Counter
# Directory of formatted datasets
INPUT_DIR = 'formatted_data/'
ROOT_NAME = 'aruba_continuous_no_t_50_10_stratified'
INPUT_ROOT_NAME = INPUT_DIR + ... | aitoralmeida/dl_activity_recognition | lstm/replicate_data.py | Python | gpl-3.0 | 3,441 |
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
# @param A : head node of linked list
# @return the head node in the linked list
def reorderList(self, A):
arr = []
ca = A
alen = 0
... | Alex-Keyes/InterviewBit | Python/reorderList.py | Python | gpl-3.0 | 802 |
# Color is a rgb string
#---Default Theme
styleD = {
# Python
'Default':'255,255,255', #white
## 'Default':'166,220,255', # blue
## 'Default':'121,193,255', # blue (good)
## 'Default':'67,183,255', # blue
## 'Default':'150,220,255', # blue
## 'Comment':'150,150,150', # gray
## 'Comment'... | lucidlylogicole/scope | plugins/scintilla/scintilla_style.py | Python | gpl-3.0 | 4,274 |
from gi.repository import Gtk, Gio, Gdk, GLib, GObject
from dialogs import SambaInputDialog, SambaResult
from dialogs import FtpInputDialog, FtpResult, SftpInputDialog
from dialogs import DavInputDialog, DavResult
from keyring import KeyringCreateError, EntryType
from plugin_base.mount_manager_extension import MountMan... | cmallwitz/Sunflower | application/plugins/file_list/gio_extension.py | Python | gpl-3.0 | 36,121 |
#----------------------------------------------------------------------------------------
# nautilus-copywinpath - Quickly copy file paths to the clipboard from Nautilus.
# Copyright (C) Ronen Lapushner 2017-2018.
# Distributed under the GPL-v3+ license. See LICENSE for more information
#-------------------------------... | ronen25/nautilus-copypath | nautilus-copywinpath.py | Python | gpl-3.0 | 2,566 |
import unittest
import sys
import io
from os.path import join as path_join
from pkg_resources import resource_filename
from galore.formats import read_gpaw_totaldos, read_gpaw_pdos
from contextlib import contextmanager
try:
from gpaw import GPAW
import ase.build
has_gpaw = True
except ImportError:
has_... | SMTG-UCL/galore | test/test_gpaw.py | Python | gpl-3.0 | 3,925 |
# -*- coding: utf-8 -*-
#
# codimension - graphics python two-way code editor and analyzer
# Copyright (C) 2010-2017 Sergey Satskiy <sergey.satskiy@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 Softw... | SergeySatskiy/codimension | codimension/ui/mainmenu.py | Python | gpl-3.0 | 47,451 |
'''
Created on 17/05/2012
@author: Fabio Zadrozny
'''
from mu_repo.print_ import Print
from mu_repo import Status
#===================================================================================================
# Run
#================================================================================================... | fabioz/mu-repo | mu_repo/action_get_vars.py | Python | gpl-3.0 | 430 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from folavirt.disks.iscsi.Snapshots import Snapshots
class Base():
def __init__(self, vg = None, name = None):
self.vg = vg
self.name = name
def getVolumeGroup(self):
"""
Zwraca nazwę grupy woluminowej do której należy baza
... | lokipl/folavirt | lib/folavirt/disks/iscsi/Base.py | Python | gpl-3.0 | 1,477 |
#!/usr/bin/python
import sys,os
from time import sleep
os.system('.//src')
o=open('fin.txt','r')
oo=o.readlines()
#print oo
ww=[]
for i in oo:
ww.append(i[:-1])
print 'Optimization : ' , ww
for i in ww:
print i
try:
ww.remove('pcnet32')
print 'Networking is Activated'
except:
print 'Not Found'... | PowerInfoSSL/speedup-boot | bootspeed.py | Python | gpl-3.0 | 422 |
import os
from unittest import mock
from os.path import join
from ubr import main, utils, psql_target as psql, s3, conf
from .base import BaseCase
class One(BaseCase):
def setUp(self):
self.db1 = "_ubr_testdb"
psql.create_if_not_exists(self.db1)
fixture = join(self.fixture_dir, "_ubr_testd... | elifesciences/ubr | ubr/tests/test_main.py | Python | gpl-3.0 | 8,639 |
#!/usr/bin/env python
from __future__ import division
from operator import itemgetter
import math
import json
__author__ = "Andrej Mernik"
__copyright__ = "Copyright 2015 Andrej Mernik"
__license__ = "GPLv3"
'''
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Genera... | R33D3M33R/jsVislice | words/jsVisliceParser.py | Python | gpl-3.0 | 4,129 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
__author__ = "Royi Reshef"
__maintainer__ = "Tsvi Mostovicz"
__version__ = "0.10.0"
import sys
from codecs import open
from os.path import abspath, dirname, join
from setuptools import setup
here = abspath(dirname(__file__))
# Get the long description from the README... | royi1000/py-libhdate | setup.py | Python | gpl-3.0 | 1,307 |
#!/usr/bin/env python
""" load mWGS Raw Seq Set into OSDF using info from data file """
import os
import re
from cutlass.HostAssayPrep import HostAssayPrep
import settings
from cutlass_utils import \
load_data, get_parent_node_id, list_tags, format_query, \
write_csv_headers, values_to_node_dict, wri... | TheJacksonLaboratory/osdf_submit | nodes/host_Assay_Prep.py | Python | gpl-3.0 | 5,625 |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
A QGIS plugin for Road contamination modelling for EMSURE Project
-------------------
begin : 2015-04-20
git sha : $Format:%H$
co... | luipir/QTraffic | algorithm.py | Python | gpl-3.0 | 13,027 |
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
# fetch values from package.xml
setup_args = generate_distutils_setup(
packages=['ernest', 'ernest.logic'],
package_dir={'': 'src'},
)
setup(**setup_args)
| simkim/ernest | setup.py | Python | gpl-3.0 | 259 |
'''
Task Coach - Your friendly task manager
Copyright (C) 2004-2010 Task Coach developers <developers@taskcoach.org>
Task Coach 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 Licens... | wdmchaft/taskcoach | taskcoachlib/command/categorizableCommands.py | Python | gpl-3.0 | 4,292 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
DEVICES_BASEPATH_TEMPLATE = "/tmp/gpio/%s"
WHITE_COLOR = (0xff, 0xff, 0xff)
BLACK_COLOR = (0x00, 0x00, 0x00)
RED_COLOR = (0xff, 0x00, 0x00)
GREEN_COLOR = (0x00, 0xff, 0x00)
| denk-mal/tft-display | modules/commonData.py | Python | gpl-3.0 | 221 |
from lino.apps.spz.spz import SPZ
from lino.apps.spz.loaders import LOADERS
from lino.adamo.store import Populator
from lino.forms import gui
loadfrom=r".\SPZ"
app=SPZ()
sess=app.quickStartup()
#sess.populate(CpasPopulator())
for lc in LOADERS:
sess.runTask(lc(loadfrom))
gui.run(sess)
| MaxTyutyunnikov/lino | obsolete/demo/spzrun.py | Python | gpl-3.0 | 295 |
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4
# Baruwa - Web 2.0 MailScanner front-end.
# Copyright (C) 2010-2012 Andrew Colin Kissa <andrew@topdog.za.net>
#
# 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 S... | TetraAsh/baruwa2 | baruwa/lib/custom_ddl.py | Python | gpl-3.0 | 1,113 |
# coding=utf-8
__all__ = ["api", "utils", "marketmaker"]
| karma0/stockfighter | stockfighter/__init__.py | Python | gpl-3.0 | 59 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2019 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 the h... | chipaca/snapcraft | snapcraft/internal/remote_build/errors.py | Python | gpl-3.0 | 4,767 |
# -*- coding: utf-8 -*-
import operator
import json
import urllib2
import openerp
from openerp import tools
from openerp import SUPERUSER_ID
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT, exception_to_unicode
from openerp.tools.translate import _
from openerp.http import reques... | nubark/odoo | addons/google_calendar/google_calendar.py | Python | gpl-3.0 | 51,421 |
# 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... | forkbong/qutebrowser | tests/unit/utils/test_utils.py | Python | gpl-3.0 | 29,461 |
# python-moretools
#
# many more basic tools for python 2/3
# extending itertools, functools and operator
#
# Copyright (C) 2011-2016 Stefan Zimmermann <zimmermann.code@gmail.com>
#
# python-moretools is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License a... | userzimmermann/python-moretools | moretools/_multi.py | Python | gpl-3.0 | 1,232 |
"""Module shapelets
This will do all the shapelet analysis of islands in an image
"""
from image import *
from islands import *
from shapelets import *
import mylogger
import statusbar
import multi_proc as mp
import itertools
import functions as func
from gausfit import find_bbox
Island.shapelet_basis=String(doc="C... | jjdmol/LOFAR | CEP/PyBDSM/src/python/shapefit.py | Python | gpl-3.0 | 6,944 |
# ##### 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... | fedackb/surface-constraint-tools | auxiliary_classes/Octree.py | Python | gpl-3.0 | 9,318 |
def search_rotate(arr, n, start, end):
"""
Start, end: search in indices of [start, end]
Return the index of n in arr, or -1 if n is not in arr
"""
if arr[start] == n:
return start
else:
if arr[end] == n:
return end
if arr[start] <= arr[end]:
# encou... | wenduowang/git_home | python/miscellaneous/search_rotate.py | Python | gpl-3.0 | 821 |
from ....common.db.sql import VARCHAR, Numeric as NUMBER, DateTime as DATETIME, Column, BaseModel, CLOB, DATE
VARCHAR2 = VARCHAR
class AShareSWIndustriesClass(BaseModel):
"""
4.199 申万行业分类
Attributes
----------
object_id: VARCHAR2(100)
对象ID
s_info_windcode: VARCHAR2(40)
Wind... | SnowWalkerJ/quantlib | quant/data/wind/tables/ashareswindustriesclass.py | Python | gpl-3.0 | 1,015 |
T = input()
buff = []
c = 0
while(T):
T -= 1
s = raw_input()
if len(buff)==0:
buff.append(s)
else:
if s!=buff[len(buff)-1]:
c += 1
buff.append(s)
print c+1
| Dawny33/Code | Code_Forces/A_Magnets.py | Python | gpl-3.0 | 221 |
from django.conf.urls import url
from django.conf import settings
from django.conf.urls.static import static
from . import views
app_name = 'map'
urlpatterns = [
url(r'^$', views.index, name='index'),
] | BrendonKing32/Traffic-Assistant | map/urls.py | Python | gpl-3.0 | 208 |
import sys
# import test_configengine
# import test_ogrwrapper
def main():
print "print sys.path:"
print sys.path
print ""
print "importing gdal"
from osgeo import gdal
print "print gdal.__file__"
print gdal.__file__
if __name__ == '__main__':
main()
| mapaction/osm2mapaction | osm2ma/gdal_on_appveyour_test.py | Python | gpl-3.0 | 287 |
#!/usr/bin/env python
"""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'
#Basi... | jantman/tuxostat | fs_backup/home/tuxostat/devel/Python/Encoder-simple.py | Python | gpl-3.0 | 3,002 |
import discord
from sigma.core.permission import check_admin
async def ignorechannel(cmd, message, args):
if check_admin(message.author, message.channel):
target = None
if not args:
await message.channel.send(cmd.help())
return
if message.channel_mentions:
... | valeth/apex-sigma | sigma/plugins/moderation/permissions/ignorechannel.py | Python | gpl-3.0 | 1,718 |
from .calc import distance, intersection, parallel, angle, orthogonal
from .draw import draw
from .line import Line
from .plane import Plane
from .point import Point
from .solver import solve
from .vector import Vector
__all__ = (
"Line",
"Plane",
"Point",
"Vector",
"angle",
"distance",
"dr... | Kingdread/sgl | sgl/__init__.py | Python | gpl-3.0 | 394 |
## Parameter file to generate SO-like data set
## Run ID - this will be used to create names
name_instrument = "SO"
#####################################################################
######################### Input sky #################################
##############################################################... | JulienPeloton/s4cmb | examples/inifiles/so_parameters.py | Python | gpl-3.0 | 5,656 |
import pygame
from pygame.locals import*
from common import lerp_colors, lerp
from libs.Sprite import Sprite
class Fade(object):
def __init__(self, main):
self.main = main
self.is_covering_screen = False
self.fade = 0
self.pre_delay = 0
self.fade_length = 120
self.dead = False
self.init()
def ini... | raubana/NeverEndingDungeon | libs/FadeSystem.py | Python | gpl-3.0 | 5,370 |
"""
Binary Search - Sqrt(x) (easy)
Description:
Given a non-negative integer x, compute and return the square root of x.
Since the return type is an integer, the decimal digits are truncated, and only
the integer part of the result is returned.
Example:
Input: x = 4
Output: 2
Constraints: 0 <= x <= 2^31 - 1
LeetC... | dreamibor/Algorithms-and-Data-Structures-Using-Python | practice/implementation/binary_search/sqrtx.py | Python | gpl-3.0 | 2,294 |
import codecs
import datetime
import json
import logging
import os
from functools import wraps
from urllib.parse import urljoin
from urllib.request import urlopen
from django.conf import settings
from django.core.cache import cache
from django.db import transaction
from django.db.models import F
from django.http impor... | pcolmant/repanier | repanier/tools.py | Python | gpl-3.0 | 25,312 |
import os
import __builtin__
import StringIO
import tempfile
import shutil
from functools import wraps
from unittest import TestCase
from mock import Mock, patch, call
#TODO keyring_base_path
class GetSignTypeTestCase(TestCase):
get_sign_type = None
exception = None
@classmethod
def factory(cls, name... | llou/gpg_ansible | test/gpg_local_common.py | Python | gpl-3.0 | 22,988 |
"""
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
from gm_base.geomop_util.serializable import Serializable
from enum import IntEnum
class MyEnum(IntEnum):
a = 1
b = 2
class RegularData:
def __init__(self, a=1, b=2):
self.a = a
self.b = b
class DataList:
__serializable... | GeoMop/GeoMop | testing/gm_base/test_serializable.py | Python | gpl-3.0 | 3,987 |
# Copyright (c) 2017 Pisay127. All rights reserved.
# See the file 'LICENSE' for the full license governing this code.
from sqlalchemy import Column
from sqlalchemy import BigInteger
from sqlalchemy.schema import ForeignKey
from .base_model import BaseModel
class Admin(BaseModel):
__tablename__ = 'admin_account... | Pisay127/pomoc-core | pomoccore/models/admin.py | Python | gpl-3.0 | 660 |
# coding=utf-8
# Author: CristianBB
# Greetings to Mr. Pine-apple
# URL: https://sickchill.github.io
#
# This file is part of SickChill.
#
# SickChill 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 ver... | coderbone/SickRage-alt | sickbeard/providers/newpct.py | Python | gpl-3.0 | 10,935 |
import click
from expipecli.utils.misc import lazy_import
@lazy_import
def pd():
import pandas as pd
return pd
@lazy_import
def sig_tools():
import exana.misc.signal_tools as sig_tools
return sig_tools
@lazy_import
def pyopenephys():
import pyopenephys
return pyopenephys
@lazy_import
def op... | CINPLA/expipe-dev | expipe-plugin-cinpla/expipe_plugin_cinpla/imports.py | Python | gpl-3.0 | 2,625 |
from __future__ import absolute_import
from gi.repository import Gtk
from threading import Lock
from queue import Queue, Empty
class OperationQueue:
"""Generic, multi-name, operation queueing support class."""
_queue_list = {}
_active_list = {}
_list_store = None
_lock = Lock()
COLUMN_TEXT = 0
COLUMN_TYPE = ... | MeanEYE/Sunflower | sunflower/queue.py | Python | gpl-3.0 | 4,418 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-13 05:44
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
... | jenriquezdeceano/asit.mx | src/pagina/migrations/0001_initial.py | Python | gpl-3.0 | 997 |
from __future__ import print_function
import sys
import os
import IMP
import IMP.em
import IMP.test
import IMP.core
import IMP.atom
import random
import math
class Tests(IMP.test.TestCase):
'''
Check if the CC by rigid rotation makes sense
'''
def load_density_map(self):
mrw = IMP.em.MRCRead... | shanot/imp | modules/em/test/medium_test_rigid_cc_score_by_grid_rotation.py | Python | gpl-3.0 | 4,795 |
from __future__ import unicode_literals, print_function
import sys
import os
from datetime import datetime
root = os.path.join(os.path.dirname(__file__), '..')
sys.path.insert(0, root)
import psycopg2
import logging
import csv
from snowball_ticketing import utils, logging_setup
from snowball_ticketing.tickets.recei... | danielrichman/snowball-ticketing | bin/harass.py | Python | gpl-3.0 | 1,421 |
import datetime
import math
import os
import logging
from pyproj import transform, Proj
from urlparse import urljoin, urlsplit
from django.db import models
from django.db.models import Q
from django.utils.translation import ugettext_lazy as _
from django.core.exceptions import ValidationError
from django.conf import ... | PhilLidar-DAD/geonode | geonode/base/models.py | Python | gpl-3.0 | 32,094 |
from django.conf.urls import url
from django.contrib import admin
from . import views
urlpatterns = [
url(r'^$', views.index),
url(r'^vehicle_sign_in/$', views.vehicle_sign_in),
url(r'^wechat_sign_in/$', views.wechat_sign_in),
url(r'^show_bind_qrcode/$', views.show_bind_qrcode),
url(r'^wechat_event... | cyanlime/Vehicle-Message-Service | account/urls.py | Python | gpl-3.0 | 574 |
'''
Created on 17 May 2016
@author: Paulo Leal
'''
from copy import copy
import datetime
from decimal import Decimal
import os
from conversions import percentage_int_to_decimal, percentage_decimal_to_int
from purchaseorder import PO_ORDER_STATUSUS, PO_PAYMENT_TERMS
from userconfig import UserConfig
... | psvnl/podb | userconfigmodel.py | Python | gpl-3.0 | 19,719 |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^fav_toggle/(?P<pk>[\d]+)/$',
views.fav_toggle,
name="fav_toggle",),
url(r'^register/$',
views.register,
name="register",),
url(r'^request_token/$',
views.request_token,
name="request_... | MaximilianKindshofer/webeats | webeats/profiles/urls.py | Python | gpl-3.0 | 491 |
"""
Django settings for cerberus project.
Generated by 'django-admin startproject' using Django 1.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths... | HCCB/cerberus | src/cerberus/cerberus/settings.py | Python | gpl-3.0 | 3,815 |
# -*- coding: UTF-8 -*-
# Copyright (C) 2004 Thierry Fromon <from.t@free.fr>
# Copyright (C) 2004, 2006-2007 Juan David Ibáñez Palomar <jdavid@itaapy.com>
# Copyright (C) 2008 Henry Obein <henry@itaapy.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General ... | kennym/itools | i18n/oracle.py | Python | gpl-3.0 | 9,298 |
#
# Copyright Applied Language Solutions 2012
#
# This file is part of Pypeline.
#
# Pypeline is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | ianj-als/pypeline | setup.py | Python | gpl-3.0 | 1,382 |
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 24 08:29:24 2016
@author: Alison Kirkby
View the data, response and model output from Occam1D
"""
import mtpy.modeling.occam1d as mtoc1d
import os.path as op
# working directory
wd = r'C:\mtpywin\mtpy\examples\model_files\Occam1d'
# model and data file names
modelfn=... | MTgeophysics/mtpy | examples/scripts/occam1d_viewoutputs.py | Python | gpl-3.0 | 1,226 |
'''
This file is part of Pymads.
Pymads is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Pymads is distributed in the hope that it wi... | campadrenalin/pymads | pymads/tests/test_recursion.py | Python | gpl-3.0 | 1,886 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import mailer
def creaPalabra(num=['','']):
num = [70, 102, 16, 70, 48, 604, 47]
palabra=''
for i in num:
palabra=palabra+chr(i)
#print palabra
return palabra
def enviarCorreo(destinatarios='Pablo <USERNAME@github.com>', asunto='Correo Test... | procamora/Librerias-Varias | send_mailer.py | Python | gpl-3.0 | 780 |
from django.conf.urls import url
from . import views
app_name = "statistiques"
urlpatterns = [
url('^$', views.DashboardView.as_view(), name="index"),
url('^charts/$', views.TypologieChartsView.as_view(), name="typologie"),
url(r'^details/(?P<pk>[0-9]+)/$', views.StatistiquesDetailsView.as_view(), name="... | artus40/maraudes_project | statistiques/urls.py | Python | gpl-3.0 | 599 |
# (c) Nelen & Schuurmans. GPL licensed, see LICENSE.txt.
import json
import logging
import string
import random
from django.contrib.auth.models import User
from django.core.cache import cache
from django.core.urlresolvers import reverse
from django.db import models
from lizard_security.manager import FilteredManager... | lizardsystem/lizard-workspace | lizard_workspace/models.py | Python | gpl-3.0 | 34,567 |
#/bin/python3
"""
MCP3008/ MCP3208
12 Bit Analog to Digital Converter 4, 8 Input 1 SAR 16-PDIP
Pin Signal Description GPIO RPI Pin
1 CH0 10K NTC Sensor - -
2 CH1 10K POT- - -
9 DGND Digital Ground GND 6... | ericgibert/ponicwatch | ponicwatch/drivers/hardware_MCP3208.py | Python | gpl-3.0 | 4,372 |
#
# Created by Aman LaChapelle on 3/23/17.
#
# pytorch-EMM
# Copyright (c) 2017 Aman LaChapelle
# Full license at pytorch-EMM/LICENSE.txt
#
__all__ = ["flat_features", "similarities"]
from .flatfeatures import num_flat_features
from .similarities import cosine_similarity
from .circular_conv import circular_convolutio... | bzcheeseman/pytorch-EMM | Utils/__init__.py | Python | gpl-3.0 | 350 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from ast import literal_eval
import functools
import itertools
import logging
import psycopg2
from odoo import api, fields, models
from odoo import SUPERUSER_ID, _
from odoo.exceptions import ValidationError, UserError
... | t3dev/odoo | odoo/addons/base/wizard/base_partner_merge.py | Python | gpl-3.0 | 26,301 |
# -*- coding: utf-8 -*-
"""
Parse, stream, create, sign and verify Bitcoin transactions as Tx structures.
The MIT License (MIT)
Copyright (c) 2013 by Richard Kiss
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to dea... | cvegaj/ElectriCERT | venv3/lib/python3.6/site-packages/pycoin/tx/Tx.py | Python | gpl-3.0 | 26,340 |
# -*- coding: utf-8 -*-
import binascii
import re
from Crypto.Cipher import AES
from module.plugins.internal.Crypter import Crypter
class ShareLinksBiz(Crypter):
__name__ = "ShareLinksBiz"
__type__ = "crypter"
__version__ = "1.18"
__status__ = "testing"
__pattern__ = r'http://(?:www\.)?(... | jansohn/pyload | module/plugins/crypter/ShareLinksBiz.py | Python | gpl-3.0 | 9,606 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
import glob
import os
... | garthylou/pootle | setup.py | Python | gpl-3.0 | 8,721 |
# coding=utf-8
"""Resources test.
.. note:: 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.
"""
__author__ = '... | sjirjies/JacqQVis | test/test_resources.py | Python | gpl-3.0 | 1,023 |
import numpy as np
from astropy.io import fits,ascii
import matplotlib.pyplot as plt
from astropy.table import Table
from astroquery.simbad import Simbad
from astropy.coordinates import SkyCoord
import astropy.constants as c
import astropy.units as u
import os
# TODO: Work masks into resample method.
# TODO: Change ... | jchowk/pyND | pyND/gbt/GBTspec.py | Python | gpl-3.0 | 15,210 |
from __future__ import absolute_import
from __future__ import unicode_literals
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
try:
from django.contrib.auth import get_user_model
except ImportError: # django < 1.5
from django.co... | prabhanshu/django-wiki | wiki/south_migrations/0003_auto__add_field_urlpath_article.py | Python | gpl-3.0 | 10,896 |
import os
import argparse
import csv
from datetime import datetime
from pathlib import Path
from rest_framework import status
from rest_framework.test import RequestsClient
from django.conf import settings
from hav.apps.accounts.models import User
from django.core.management.base import BaseCommand, CommandError
from d... | whav/hav | src/hav/apps/ingest/management/commands/csv_import.py | Python | gpl-3.0 | 6,227 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import re
PHYSICAL_SIDES = ["top", "right", "bottom", "left"]
LOGICAL_SIDES = ["block-start", "block-end", "inline-star... | mbrubeck/servo | components/style/properties/data.py | Python | mpl-2.0 | 19,929 |
# encoding: utf-8
"""
This module provides the base definition for patterns.
"""
import re
from .compat import string_types
class Pattern(object):
"""
The ``Pattern`` class is the abstract definition of a pattern.
"""
# Make the class dict-less.
__slots__ = ('include',)
def __init__(self, include):
"""
... | davidfraser/python-path-specification | pathspec/pattern.py | Python | mpl-2.0 | 2,333 |
import re
from binascii import a2b_base64, b2a_base64
from typing import Text
from Crypto.Cipher import AES
from everyclass.server.utils.config import get_config
def _fill_16(text):
"""
自动填充至十六位或十六的倍数
:param text: 需要被填充的字符串
:return: 已经被空白符填充的字符串
"""
text += '\0' * (16 - (len(text.encode()) %... | fr0der1c/EveryClass-server | everyclass/server/utils/encryption.py | Python | mpl-2.0 | 3,271 |
from __future__ import print_function
import base64
import json
import os
import subprocess
import tempfile
import threading
import traceback
import uuid
from six import iteritems
from mozprocess import ProcessHandler
from tools.serve.serve import make_hosts_file
from .base import (ConnectionlessProtocol,
... | DominoTree/servo | tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/executors/executorservo.py | Python | mpl-2.0 | 12,764 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import shutil
from configman import ConfigurationManager
from mock import Mock
import pytest
from socorro.ex... | mozilla/socorro | socorro/unittest/external/fs/test_fspermanentstorage.py | Python | mpl-2.0 | 4,628 |
# encoding: utf-8
#
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http:# mozilla.org/MPL/2.0/.
#
# Contact: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import, divisi... | klahnakoski/jx-sqlite | jx_sqlite/expressions/select_op.py | Python | mpl-2.0 | 4,385 |
import xml.etree.ElementTree as XML
import os, uuid, logging
class DeclarationError(Exception):
pass
class Declaration:
def __init__(self):
"""
parse the redo.xml
"""
self.stagedict = {}
self.layers = {}
self.baselayer = None
self.layer_remotes = {}... | carosio/redomat | libredo/Declaration.py | Python | mpl-2.0 | 8,056 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
import os
from WebIDL import IDLExternalInterface, IDLSequenceType, IDLWrapperType, WebIDLError
class Configuration:... | larsbergstrom/servo | components/script/dom/bindings/codegen/Configuration.py | Python | mpl-2.0 | 19,023 |
# Static media bundle definitions.
PIPELINE_CSS = {
'csrf-failure': {
'source_filenames': (
'css/sandstone/sandstone-resp.less',
'css/csrf-failure.less',
),
'output_filename': 'css/csrf-failure-bundle.css',
},
'about': {
'source_filenames': (
... | davehunt/bedrock | bedrock/settings/static_media.py | Python | mpl-2.0 | 60,585 |