code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
import sqlite3
class Database:
def __init__(self, dbfile, page_rows=100):
self.dbfile = dbfile
self.page_rows = page_rows
self.conn = sqlite3.connect(self.dbfile)
self.conn.row_factory = sqlite3.Row
cursor = self.conn.cursor()
cursor.execute(
"CREATE TAB... | ant9000/websup | cli/db.py | Python | gpl-3.0 | 1,581 |
# =============================================================================
# Copyright [2013] [Kevin Carter]
# License Information :
# This software has no warranty, it is provided 'as is'. It is your
# responsibility to validate the behavior of the routines and its accuracy
# using the code provided. Consult the ... | cloudnull/tribble-api | tribble/common/rpc.py | Python | gpl-3.0 | 3,626 |
def empty_reduce(rank, device_list, output, source=0):
pass
def empty_sync_matrix(rank, device_list, output, source=0, collect=False):
pass
| acopar/crow | crow/crow/transfer/mocktransfer.py | Python | gpl-3.0 | 150 |
# Copyright (C) 2015 Ross D Milligan
# GNU GENERAL PUBLIC LICENSE Version 3 (full notice can be found at https://github.com/rdmilligan/SaltwashAR)
class Speaking:
# initialize speaking
def __init__(self, text_to_speech):
self.is_speaking = False
self.text_to_speech = text_to_speech
# te... | rdmilligan/SaltwashAR | scripts/features/base/speaking.py | Python | gpl-3.0 | 476 |
__author__ = 'Math'
import unittest
from ODA.market_cols import OrderKeys, ExecutionResponse
from utils import Generear_ordenes_limit
import random
import pandas as pd
from ODA.market import Market, Request
req_ask1 = {
OrderKeys.size: 1000,
OrderKeys.direction: -1,
OrderKeys.price: 1600,
OrderKeys.id... | grupoanfi/orderbook-data-analysis | ODA/test/test_mini_market.py | Python | gpl-3.0 | 11,740 |
# Define a daysBetweenDates procedure that would produce the
# correct output if there was a correct nextDay procedure.
#
# Udacity course work
def isLeapYear(year):
if year % 400 == 0:
return True
if year % 100 == 0:
return False
if year % 4 == 0:
return True
return False
def... | rule0x42/education | Python/daysBetweenDates.py | Python | gpl-3.0 | 2,697 |
#!/usr/bin/env python3
#script is a replacement for https://github.com/Relys/3DS_Multi_Decryptor/blob/master/to3DS/CDNto3DS/CDNto3DS.py
#requires PyCrypto to be installed ("python3 -m ensurepip" then "pip3 install PyCrypto")
#requires makerom (https://github.com/profi200/Project_CTR/releases)
#this is a Python 3 script... | Plailect/PlaiCDN | PlaiCDN.py | Python | gpl-3.0 | 30,166 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
setup(name='my_project',
version='0.1.0',
packages=['my_project'],
entry_points={
'console_scripts': [
'my_project = crawler.__main__:main'
]
},
install_requires='requests'
... | Huai-Xv/CSU_FreeClassroom | setup.py | Python | gpl-3.0 | 322 |
from yaml.composer import Composer
from yaml.nodes import MappingNode
class AnsibleComposer(Composer):
def __init__(self):
self.__mapping_starts = []
super(Composer, self).__init__()
def compose_node(self, parent, index):
# the line number where the previous token has ended (plus empty ... | gitterHQ/ansible | v2/ansible/parsing/yaml/composer.py | Python | gpl-3.0 | 1,212 |
global_var = 2.11
print('main():')
print('global_var = ', ++global_var)
def func_use_global():
print('func_use_global():')
print('global_var = ', global_var)
func_use_global()
def func_modify_global():
global global_var # Must declare when to reassign global variables !!!!
global_var += 1
print('func_modify_g... | flake123p/ProjectH | Python/_Basics_/A14_Global_Variable/test.py | Python | gpl-3.0 | 1,001 |
from django.shortcuts import render
def index(request):
return render(request, 'first.html')
| poremchuk/RefactorDMS | system/views.py | Python | gpl-3.0 | 98 |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, ... | GroestlCoin/electrum-grs | electrum_grs/gui/qt/exception_window.py | Python | gpl-3.0 | 7,308 |
from __future__ import unicode_literals
from memory.mem import _Memory
class Windows2012ServerMemory(_Memory):
def __init__(self, params):
super(Windows2012ServerMemory, self).__init__(params)
def csv_all_modules_dll(self):
super(Windows2012ServerMemory, self)._csv_all_modules_dll()
def ... | SekoiaLab/Fastir_Collector | memory/windows2012ServerMemory.py | Python | gpl-3.0 | 662 |
# -*- coding: utf-8 -*-
# Copyright (C) 2008 Osmo Salomaa
#
# 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 pr... | otsaloma/nfoview | nfoview/errors.py | Python | gpl-3.0 | 1,118 |
from levels import AbstractLevel, LevelsFactory, check
import bomblevel
def allBombed(self, player):
""" Check, is all players units are bombed """
return player.units.count('default_unit') == self.fieldSize()
class Level(AbstractLevel):
def fieldSize(self):
return 5
def units(self):
... | ferustigris/battleship | simplelevel.py | Python | gpl-3.0 | 552 |
# -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | FireBladeNooT/Medusa_1_6 | lib/github/tests/IssueEvent.py | Python | gpl-3.0 | 2,785 |
import sys
import yaml
import collections
Conf = collections.namedtuple(
'Conf',
'links audio_formats show_download_progress overrride_audios'
)
class ConfManager(object):
DEFAULT_AUDIO_FORMATS = ['mp4', 'mp3', 'webm', 'm4a', 'ogg', 'wma']
@classmethod
def get_conf(cls, file_path):
with... | marcosschroh/youtube-audio-downloader | sound_downloader/conf_manager.py | Python | gpl-3.0 | 990 |
# -*- coding: utf-8 -*-
import re
from module.plugins.internal.Addon import Addon
class JustPremium(Addon):
__name__ = "JustPremium"
__type__ = "hook"
__version__ = "0.25"
__status__ = "testing"
__config__ = [("activated", "bool", "Activated" , False),
... | fzimmermann89/pyload | module/plugins/hooks/JustPremium.py | Python | gpl-3.0 | 2,420 |
from pylab import *
from math import exp, sqrt
from image import *
from filters import *
from nibabel import load
import numpy
import image_processing
import image as img
import os
# This module generates
class C:
#a Config class, just a collection of constants
output_dir = '../report/img/results/'
input... | facundoq/ipim | tp1/py/tp.py | Python | gpl-3.0 | 10,677 |
import array
class vec(object):
@staticmethod
def sized(size, type='d'):
return vec([0] * size, type)
@staticmethod
def of(content, type='d'):
return vec(content, type)
def __init__(self, content, type='d'):
self.size = len(content)
self.type = type
self.a... | planrich/pypy-simd-benchmark | vec.py | Python | gpl-3.0 | 1,851 |
import machine
import time
DIAGNOSTIC_LED = None
try:
with open('config/diagnostic_led.pin', 'r') as fp:
invert = False
value = int(fp.read())
if value < 0:
value = -value
invert = True
DIAGNOSTIC_LED = machine.Signal(value, machine.Pin.OUT, invert=invert)
... | terrence2/OpenActuator | OpenActuator/app_a/diagnostic_led.py | Python | gpl-3.0 | 838 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
##### ##### ===== 포함 파일 =====
# 개인적인 아이디, 비밀번호 파일.
from personal.jconfig import LOGIN_ID, LOGIN_PW
# scrapy item 파일.
from joonggonara.items import JoonggonaraItem
# 로그인을 위한 FormRequest.
# 로그인 이후 크롤링을 위한 Request.
from scrapy.http import FormRequest, Request
# 게시판 페이지에서 ... | munhyunsu/UsedMarketAnalysis | joonggonara_crawl/joonggonara/spiders/lgt_spiders.py | Python | gpl-3.0 | 7,133 |
import unittest
from unittest.mock import patch
from app.main.service import GitHubUserService
@patch("app.main.service.github")
class TestGitHubUserService(unittest.TestCase):
def setUp(self):
self.test_user = "test"
self.retrieved_repos_return = [
{
"fork": False,
... | darylmathison/github-user-queries | tests/main/test_service.py | Python | gpl-3.0 | 7,359 |
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
__docformat__ = 'restructuredtext en'
'''
The database used to store ebook metadata
'''
import os, sys, shutil, cStringIO, glob, time, functools, traceback, re, \
json, uuid, hashlib, copy
fr... | kobolabs/calibre | src/calibre/library/database2.py | Python | gpl-3.0 | 168,238 |
import re
from __future__ import print_function
HEADER_TEMPLATE=r"""/*
Copyright 2016, Austen Satterlee
This file is part of VOSIMProject.
VOSIMProject 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... | austensatterlee/VOSIMSynth | scripts/add_file.py | Python | gpl-3.0 | 5,486 |
#!/usr/bin/python
"""
Definition of the wflow_W3RA model.
---------------------------------------
The model is modified from the Australian Water Resources Assessment
Landscape (AWRA-L) model version 0.5
W3RA is documented in
van Dijk et al. (2013), Water Resour. Res., 49, 2729-2746, doi:10.1002/wrcr.20251
URL: http:/... | openstreams/wflow | wflow/wflow_w3ra_new.py | Python | gpl-3.0 | 44,871 |
#!/usr/bin/env python
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
d = generate_distutils_setup(
packages=['orgpmp2'],
package_dir={'': 'pythonsrc'},
)
setup(**d) | gtrll/orgpmp2 | setup.py | Python | gpl-3.0 | 220 |
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.translation import ugettext, ugettext_lazy as _
from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import GenericRelation
from django.shortcuts import get_object_or_404
from django_countries im... | alirizakeles/tendenci | tendenci/apps/forms_builder/forms/models.py | Python | gpl-3.0 | 20,327 |
from infection_monkey.utils import bit_manipulators
def test_flip_bits_in_single_byte():
for i in range(0, 256):
assert bit_manipulators.flip_bits_in_single_byte(i) == (255 - i)
def test_flip_bits():
test_input = bytes(b"ABCDEFGHIJNLMNOPQRSTUVWXYZabcdefghijnlmnopqrstuvwxyz1234567890!@#$%^&*()")
... | guardicore/monkey | monkey/tests/unit_tests/infection_monkey/utils/test_bit_manipulators.py | Python | gpl-3.0 | 1,072 |
import socket
import requests
import threading
import hashlib
import json
try:
import PyQt4
except Exception:
sys.exit("Error: Could not import PyQt4 on Linux systems, you may try 'sudo apt-get install python-qt4'")
from PyQt4.QtGui import *
from PyQt4.QtCore import *
import PyQt4.QtCore as QtCore
import PyQt... | creditbit/electrum-creditbit | plugins/labels.py | Python | gpl-3.0 | 6,933 |
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config(object):
DEBUG = False
TESTING = False
CSRF_ENABLED = True
SECRET_KEY = os.getenv('APP_SECRET_KEY', '')
# db config
DB_PORT = os.getenv('DB_PORT', '')
DB_HOST = os.getenv('DB_HOST', '')
DB_ROLE = os.getenv('DB_... | byndcivilization/toy-infrastructure | flask-app/config.py | Python | gpl-3.0 | 851 |
from sender import *
import threading
QUEUE_NAME = 'event_queue'
class CompetingReceiver(object):
def __init__(self):
self.connection = Connection().initialize()
def receive(self):
self.connection.channel.queue_declare(QUEUE_NAME, False, False, False, None)
self.connection.channel.ba... | harunyasar/rabbitmq_playground | default_exchange_receiver.py | Python | gpl-3.0 | 779 |
# -*- coding: utf-8 -*-
"""
@file costMemory.py
@author Jakob Erdmann
@author Michael Behrisch
@date 2012-03-14
@version $Id: costMemory.py 22608 2017-01-17 06:28:54Z behrisch $
Perform smoothing of edge costs across successive iterations of duaIterate
SUMO, Simulation of Urban MObility; see http://sumo.dlr.d... | 702nADOS/sumo | tools/assign/costMemory.py | Python | gpl-3.0 | 7,283 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2020 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free S... | t-wissmann/qutebrowser | qutebrowser/browser/webkit/tabhistory.py | Python | gpl-3.0 | 3,533 |
from kivy.graphics import Color, Line, Quad
from modeful.ui.diagram.relationship import Trigonometry
from modeful.ui.diagram.relationship.association import Association
class Composition(Association):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
with self.canv... | Modeful/poc | modeful/ui/diagram/relationship/composition.py | Python | gpl-3.0 | 774 |
"""This module is responsible for storing files on disk.
The storage strategy is as follows:
- Files themselves are stored in a separate directory called 'blobs'.
- Stored files are named by their SHA256 hashes (in hex).
- Stored files are grouped into directories by their first byte (two hex
characters), referred t... | sio2project/filetracker | filetracker/servers/storage.py | Python | gpl-3.0 | 17,784 |
import parser
import unittest
import sys
class TestVideoParser(unittest.TestCase):
def test_parse_video(self):
if sys.platform.startswith('win'):
path = '\\server\\Movies\\Brave (2007)\\Brave (2006).mkv'
else:
path = '/server/Movies/Brave (2007)/Brave (2006).mkv'
vi... | tickbg/skaer | naming/test_parser.py | Python | gpl-3.0 | 2,913 |
#!/usr/bin/env python3
'''Check online DNSSEC signing module (just basic checks).'''
import dns.rdatatype
from dnstest.test import Test
from dnstest.utils import *
from dnstest.module import ModOnlineSign
t = Test(stress=False)
ModOnlineSign.check()
knot = t.server("knot")
zones = t.zone_rnd(4, dnssec=False, recor... | CZ-NIC/knot | tests-extra/tests/modules/onlinesign/test.py | Python | gpl-3.0 | 2,463 |
import logging
from argos.external import six
from argos.utils.cls import check_class, check_is_a_string
logger = logging.getLogger(__name__)
class BaseTreeItem(object):
""" Base class for storing item data in a tree form. Each tree item represents a row
in the BaseTreeModel (QAbstractItemModel).
... | titusjan/argos | argos/qt/treeitems.py | Python | gpl-3.0 | 11,395 |
# 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/cpe_naming_2_3/__init__.py | Python | gpl-3.0 | 821 |
##############################################################################################
# Copyright 2014-2015 Cloud Media Sdn. Bhd.
#
# This file is part of Xuan Application Development SDK.
#
# Xuan Application Development SDK is free software: you can redistribute it and/or modify
# it under the terms of... | TheStackBox/xuansdk | SDKLibrary/com/cloudMedia/theKuroBox/sdk/paramComponents/kbxSlider.py | Python | gpl-3.0 | 1,696 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2017 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... | cprov/snapcraft | snapcraft/internal/project_loader/_env.py | Python | gpl-3.0 | 4,619 |
from flask import url_for
from decksite.view import View
from magic import tournaments
from shared import dtutil
# pylint: disable=no-self-use
class KickOff(View):
def __init__(self) -> None:
super().__init__()
kick_off_date = tournaments.kick_off_date()
if dtutil.now() > kick_off_date:
... | PennyDreadfulMTG/Penny-Dreadful-Discord-Bot | decksite/views/kickoff.py | Python | gpl-3.0 | 842 |
from sqlalchemy import *
from sqlalchemy.orm import *
from sqlalchemy.ext.declarative import declarative_base
from geoalchemy import GeometryColumn, LineString, GeometryDDL
engine = create_engine('postgres://michel@localhost/featureserver', echo=False)
session = sessionmaker(bind=engine)()
metadata = MetaData(engine)
... | guolivar/totus-niwa | service/thirdparty/featureserver/tests/geoalchemy_model.py | Python | gpl-3.0 | 605 |
import sys
from PyQt5 import QtWidgets, QtGui, QtCore
from PyQt5 import uic
from . import guiStart
from . import guiCompileSuccess
# sys.path.insert(1, 'C:/Users/GuSan/Desktop/powerOverWhelming/project/src/comp_exec')
from ..comp_exec import validation
from . import guiErrorCode
class GuiSelectCode(QtWidgets.QMainWi... | lunapocket/powerOverWhelming | project/src/gui/guiSelectCode.py | Python | gpl-3.0 | 6,372 |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Canal para tubehentai
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
import sys
from ... | conejoninja/pelisalacarta | python/main-classic/channels/tubehentai.py | Python | gpl-3.0 | 3,912 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from ErrorsHandler import *
from string import strip, find, split, lower, rjust, atoi, atof, replace, digits, zfill, join
from tools import cleanlist, which, filecopy, mkdirtree, touch, listmatch, rm, escapedfilename
from tools import get_username, get_tempdir, cm... | Xicnet/burnstation | decoder.py | Python | gpl-3.0 | 3,770 |
# coding=utf-8
"""
Program start here.
To python soon.
"""
# @Author: Zackary BEAUGELIN <gysco>
# @Date: 2017-04-10T15:43:09+02:00
# @Email: zackary.beaugelin@epitech.eu
# @Project: SSWD
# @Filename: execute.py
# @Last modified by: gysco
# @Last modified time: 2017-06-19T16:15:30+02:00
from statistics import (c... | Gysco/SSWD | pyment/execute.py | Python | gpl-3.0 | 13,004 |
from pygame.locals import *
from pypogs import player_area
from pypogs import render
class GameContainer(object):
def __init__(self, world, dimensions):
self._player_areas = []
self._world = world
self._dimensions = dimensions
self._is_online = False
def render(self, screen)... | atsheehan/pypogs | pypogs/game_container.py | Python | gpl-3.0 | 1,838 |
class Solution:
"""
@param s: The first string
@param b: The second string
@return true or false
"""
# Time: is equal to sorted O(nlogn)
# Space: O(1)
def anagram(self, s, t):
# write your code here
s = sorted(s)
t = sorted(t)
return s == t
| rosegun38/LintCode | Two_Strings_Are_Anagrams/Solution.py | Python | gpl-3.0 | 307 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for pdeo.database.sql"""
import unittest
# import responses
from pdeo.databases import sql
# if version_info[0] == 2: # utf8 for python2
# from codecs import open
class PdeoDatabaseSqlTestCase(unittest.TestCase):
def setUp(self):
pass
... | oczkers/pdeo | tests/databases/test_sql.py | Python | gpl-3.0 | 407 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
if sys.version_info < (3,):
import ConfigParser
else:
import configparser as ConfigParser
class Config:
def __init__(self):
self.interval = 30
self.access_key_id = None
self.access_key_secret = None
self.domain_name = N... | xuchao1213/AliyunDdnsPython | config.py | Python | gpl-3.0 | 1,746 |
import sys
import os
import re
from subprocess import PIPE, Popen, call
fq1, fq2, db, prefix = sys.argv[1:]
bowtie2_logfh = open(prefix+'.bowtie2.log','w')
bamfile = prefix+'.bam'
bowtie2_cmd = ['bowtie2', '-x', db, '-1', fq1, '-2', fq2]
samtools_view = ['samtools', 'view', '-bhS', '-']
samtools_sort = ['samtools', 's... | luo-chengwei/utilitomics | utils/align.PE.py | Python | gpl-3.0 | 826 |
import logging
from datetime import datetime
from .actions import actions
from .system_menu.system_menu import system_menu
from .library.buttons import library_buttons
from .book.buttons import book_buttons
from .go_to_page.buttons import go_to_page_buttons
from .bookmarks.buttons import bookmarks_buttons
from .languag... | Bristol-Braille/canute-ui | ui/buttons.py | Python | gpl-3.0 | 3,110 |
shader_code = """
<script id="orbit_shader-vs" type="x-shader/x-vertex">
uniform vec3 focus;
uniform vec3 aef;
uniform vec3 omegaOmegainc;
attribute float lintwopi;
varying float lin;
uniform mat4 mvp;
const float M_PI = 3.14159265359;
void main() {
float a = aef.x;
float e... | dtamayo/rebound | rebound/widget.py | Python | gpl-3.0 | 25,951 |
from fastpm.state import StateVector, Matter, Baryon, CDM, NCDM
from runtests.mpi import MPITest
from nbodykit.cosmology import Planck15 as cosmo
import numpy
BoxSize = 100.
Q = numpy.zeros((100, 3))
@MPITest([1, 4])
def test_create(comm):
matter = Matter(cosmo, BoxSize, Q, comm)
cdm = CDM(cosmo, BoxSize, ... | rainwoodman/fastpm-python | fastpm/tests/test_state.py | Python | gpl-3.0 | 600 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#############################################
# WARNING #
#############################################
#
# This file is au... | amenonsen/ansible | lib/ansible/modules/network/eos/eos_l3_interfaces.py | Python | gpl-3.0 | 7,195 |
import os
from unittest import TestCase
import mock
from marvel.iterables import BaseIterable
class FooIterable(BaseIterable):
def __init__(self):
self.total_pages = 20
super(FooIterable, self).__init__()
def get_items(self):
if self.total_pages == 0:
raise StopIteration... | fernandoe/the-comics | tests/marvel/iterables/test_baseIterable.py | Python | gpl-3.0 | 816 |
"""
Union-find data structure.
"""
from networkx.utils import groups
class UnionFind:
"""Union-find data structure.
Each unionFind instance X maintains a family of disjoint sets of
hashable objects, supporting the following two methods:
- X[item] returns a name for the set containing the given item... | SpaceGroupUCL/qgisSpaceSyntaxToolkit | esstoolkit/external/networkx/utils/union_find.py | Python | gpl-3.0 | 3,285 |
"""Helper functions
Consists of functions to typically be used within templates, but also
available to Controllers. This module is available to both as 'h'.
"""
from webhelpers import *
from webhelpers.html import tags
from routes import url_for
from pylons import request
def javascript_link( *urls, **attrs ):
retu... | DIRACGrid/DIRACWeb | dirac/lib/helpers.py | Python | gpl-3.0 | 1,413 |
#-------------------------------------------------------------------------------
#
# This file is part of pylibgimpplugin.
#
# Copyright (C) 2014 khalim19 <khalim19@gmail.com>
#
# pylibgimpplugin is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published ... | yfede/gimp-plugin-export-layers | export_layers/pylibgimpplugin/tests/test_settings.py | Python | gpl-3.0 | 23,801 |
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
def test_signal(T=100, fs=1):
dt = 1/fs
x = np.arange(0, T, dt)
y = np.ones(x.shape)
return np.vstack((x,y))
def test_signal1(T=16.0, fs=10.0):
dt = 1/fs
x = np.arange(-T/2, T/2, dt)
y = np.arange(-T/2, T/2, dt... | BrainTech/openbci | obci/analysis/balance/raw_analysis.py | Python | gpl-3.0 | 8,820 |
# Generated by Django 2.2.12 on 2020-04-17 14:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('controls', '0002_commoncontrol_common_control_provider'),
]
operations = [
migrations.RemoveField(
model_name='commoncontrol',
... | GovReady/govready-q | controls/migrations/0003_auto_20200417_1418.py | Python | gpl-3.0 | 598 |
"""
Methods for importing data from the OMNI.
"""
from heliopy.data import cdasrest
def _docstring(identifier, description):
return cdasrest._docstring(identifier, 'O', description)
def _omni(starttime, endtime, identifier, intervals='monthly',
warn_missing_units=True):
"""
Generic method for ... | dstansby/heliopy | heliopy/data/omni.py | Python | gpl-3.0 | 1,833 |
from rest_framework_gis.serializers import GeoFeatureModelSerializer
from districts.models import AlderDistrict
class DistrictSerializer(GeoFeatureModelSerializer):
"""
Geo Serialize the district model
"""
class Meta:
model = AlderDistrict
geo_field = 'mpoly'
fields = ('alder'... | gsvaldes/tequio | districts/serializers.py | Python | gpl-3.0 | 349 |
from flask_login import LoginManager
from server.users.models import User
login_manager = LoginManager()
@login_manager.user_loader
def load_user(user_id):
return User.get(user_id=user_id)
| Ideabin/Ideabin | server/login.py | Python | gpl-3.0 | 197 |
# -*- coding: utf-8 -*-
#!/usr/bin/env python
#
# pynbome library
# glass.py (c) Mikhail Mezyakov <mihail265@gmail.com>
#
# View through tiled glass
import os
import subprocess
from wand.image import Image
from . import prepare_filter
@prepare_filter
def apply_filter(input_filename, output_filename):
settings = ... | aluminiumgeek/psychedelizer | pynbome/filters/glass.py | Python | gpl-3.0 | 805 |
import unittest
import numpy as np
from collections import OrderedDict
from gtrackcore.metadata import GenomeInfo
from gtrackcore.track.core.GenomeRegion import GenomeRegion
from gtrackcore.track.format.TrackFormat import TrackFormat
from gtrackcore.track_operations.operations.Flank import Flank
from gtrackcore.track... | sivertkh/gtrackcore | gtrackcore/test/track_operations/FlankTest.py | Python | gpl-3.0 | 3,882 |
# ~*~ coding: utf-8 ~*~
from celery import shared_task
from django.utils.translation import ugettext as _, gettext_noop
from common.utils import get_logger
from orgs.utils import org_aware_func
from ..models import Connectivity
from . import const
from .utils import check_asset_can_run_ansible
logger = get_logger(_... | jumpserver/jumpserver | apps/assets/tasks/account_connectivity.py | Python | gpl-3.0 | 2,991 |
from __future__ import absolute_import
import re
import six
import requests
from jinja2 import Template
from bugwarrior.config import asbool, die
from bugwarrior.services import IssueService, Issue, ServiceClient
import logging
log = logging.getLogger(__name__)
class YoutrackIssue(Issue):
ISSUE = 'youtrackiss... | lyarwood/bugwarrior | bugwarrior/services/youtrack.py | Python | gpl-3.0 | 5,955 |
#!/usr/bin/env python
# -*- coding: ascii -*-
from __future__ import absolute_import
from __future__ import print_function
import sys
import base64
# use a base64 image as default/test image
TEST_IMAGE = """iVBORw0KGgoAAAANSUhEUgAAA8AAAALQCAYAAABfdxm0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz
AAASdAAAEnQB3mYfeAAAIABJREFUeJzs3... | sonofeft/DigiPlot | digiplot/sample_img.py | Python | gpl-3.0 | 72,038 |
import socket
from .attrtree import AttrTree
from .checks import Checks
config = AttrTree()
# the list of checks
config.install_attr('checks', Checks())
# This is the base granularity (in seconds) for polling
# Each check may then individually be configured to run every N * tick
config.install_attr('base_tick', 60)... | StrasWeb/picomon | picomon/__init__.py | Python | gpl-3.0 | 2,005 |
import unittest
import kata.count_by.main as cb
class Tests(unittest.TestCase):
def test_main(self):
cb.run()
| matthewdeanmartin/kata-python | kata/count_by/test.py | Python | gpl-3.0 | 124 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-03-18 21:22
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('draw', '0006_auto_20160314_1817'),
]
operations = [
migrations.AlterField(
... | hozblok/biodraw | draw/migrations/0007_auto_20160318_2122.py | Python | gpl-3.0 | 475 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# mitmprotector.py - protect's you from any kind of MITM-attacks.
#
# Copyright (C) 2020 by Jan Helbling <jh@jan-helbling.ch>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publis... | JanHelbling/mitmprotector | bin/mitmprotector.py | Python | gpl-3.0 | 27,675 |
# -*- coding: utf-8 -*-
from build import build
from push import push
from clean import clean
def deploy(args, config):
'''
convenience function that builds and pushes in one call
'''
build(args, config)
push(args, config)
| ChrisBuchholz/stonebear | stonebear/deploy.py | Python | gpl-3.0 | 245 |
#!/usr/bin/env python
#coding: utf-8
#### CLASSES ####
class fasta():
"""
"""
def __init__(self):
"""
"""
self.fastaDict = {}
#### FUNCTIONS ####
def fasta_reader(self, fastaFile):
"""
"""
fastaDict = {}
subHeader("Fasta reader")
... | brguez/TEIBA | src/python/clusterClippedReads.py | Python | gpl-3.0 | 25,308 |
# -*- coding: utf8 -*-
###########################################################################
# This is part of the module phystricks
#
# phystricks 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... | LaurentClaessens/phystricks | testing/unit_tests/testSegment.py | Python | gpl-3.0 | 2,199 |
../../../../share/pyshared/aptdaemon/crash.py | Alberto-Beralix/Beralix | i386-squashfs-root/usr/lib/python2.7/dist-packages/aptdaemon/crash.py | Python | gpl-3.0 | 45 |
"""
Currie -- you can do magic.
Goal here is to have a thread launching piglets.
And curio controlling the operation.
Aim to use joy to control which widget loop to use.
No piglets known to be harmed with this code.
So there is a pig farm and piglets running everywhere.
And currie doing magic.
"""
from collection... | openbermuda/karmapi | karmapi/currie.py | Python | gpl-3.0 | 3,935 |
import sys
sys.path.append("..\\..")
import os
import time
from api.providers.torec.hamster import TorecHashCodesHamster
from api.requestsmanager import RequestsManager
import unittest
class TestTorecHashCodeHamster(unittest.TestCase):
def setUp(self):
self.hamster = TorecHashCodesHamster(Reque... | yosi-dediashvili/SubiT | tests/api/providers/torec/test_hamster.py | Python | gpl-3.0 | 1,257 |
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 10 06:32:29 2016
@author: hugo
"""
import threading
def worker(count):
for x in range(count):
print "Programación matemática %s \n " % x
return
threads = list()
t = threading.Thread(target=worker, args=(10,))
threads.append(t)
t.sta... | hugoallan9/programacionMatematica | skeleton/App/hilo.py | Python | gpl-3.0 | 352 |
#!/usr/bin/env python3
#定义一个变量a
a = 100
#判断a是否大于等于0
if a >= 100:
# 如果大于等于0执行这里边的内容
print('a为正 a =',a)
else:
# 反之执行这段代码
print('a为负 a =',a)
#
#转义字符
#
print("I'm OK")
print('I\'m OK')
print('I\'m\tlearning\nPython')
# 使用 r'' 来使 '' 里边的字符串不需要转 // 但是这样不行 --> print(r'I'm OK')
print(r'\\n\\')
# 如果有很多换行的地方可以使用 ... | CrazyDaiDai/learningPython | hellow.py | Python | gpl-3.0 | 1,589 |
import re
import requests
import six
from jinja2 import Template
from twiggy import log
from bugwarrior.config import asbool, die, get_service_password
from bugwarrior.services import IssueService, Issue
class GitlabIssue(Issue):
TITLE = 'gitlabtitle'
DESCRIPTION = 'gitlabdescription'
CREATED_AT = 'gitl... | coddingtonbear/bugwarrior | bugwarrior/services/gitlab.py | Python | gpl-3.0 | 11,278 |
# This script is actually for Cyber Security on Windows 7. Should mostly work
# for Windows 8 and 10 too. I just absolutely hate using Windows 8 and refuse
# to test it on any Windows 8 machine.
from __future__ import print_function
from subprocess import call
from subprocess import check_output
import os
###########... | road2ge/cyber-defense-scripts | main-for-windows.py | Python | gpl-3.0 | 9,651 |
# Copyright 2015 Kevin Reid <kpreid@switchb.org>
#
# This file is part of ShinySDR.
#
# ShinySDR 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 lat... | bitglue/shinysdr | shinysdr/test/plugins/test_dsd.py | Python | gpl-3.0 | 937 |
DEPLOY_MODE = "proddev"
COMPRESS_ENABLED = True
USE_CELERY = True
DISABLE_REPORTING_DB = True
HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.BaseSignalProcessor'
BASE_ABS_URL = "https://coursys-demo.cs.sfu.ca"
| sfu-fas/coursys | machines/chef/cookbooks/coursys_demo/files/default/localsettings.py | Python | gpl-3.0 | 209 |
#-*- coding: utf-8 -*-
#+---------------------------------------------------------------------------+
#| 01001110 01100101 01110100 01111010 01101111 01100010 |
#| |
#| Netzob : Inferring communication protocols... | dasbruns/netzob | src/netzob/Common/Utils/NetzobRegex.py | Python | gpl-3.0 | 15,254 |
# crop.py
# Derek Groenendyk
# 2/15/2017
# reads input data from Excel workbook
from collections import OrderedDict
import logging
import numpy as np
import os
import sys
from cons2.cu import CONSUMPTIVE_USE
# from utils import excel
logger = logging.getLogger('crop')
logger.setLevel(logging.DEBUG)
class CROP(obje... | MoonRaker/cons2-python | cons2/crop.py | Python | gpl-3.0 | 6,619 |
from django.contrib import admin
from cms.admin.pageadmin import PageAdmin
from cms.models import Page
from .models import page, Sub_Pages
admin.site.register(page)
admin.site.register(Sub_Pages)
| ytec/instaforex-web | app/pages/admin.py | Python | gpl-3.0 | 201 |
#!/usr/bin/python2
from collections import namedtuple
from ansible.parsing.dataloader import DataLoader
from ansible.vars import VariableManager
from ansible.inventory import Inventory
from ansible.playbook.play import Play
from ansible.executor.task_queue_manager import TaskQueueManager
from ansible.plugins.callback i... | krahser/djbot | src/DJBot/utils/ansible_api.py | Python | gpl-3.0 | 8,299 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | 0x0all/nupic | examples/opf/experiments/opfrunexperiment_test/simpleOPF/hotgym_1hr_agg/description.py | Python | gpl-3.0 | 15,154 |
#
# NEPI, a framework to manage network experiments
# Copyright (C) 2014 INRIA
#
# 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 ... | phiros/nepi | src/nepi/resources/ns3/ns3server.py | Python | gpl-3.0 | 7,038 |
#! /usr/bin/env python
import requests, json
from os.path import expanduser
from coinbase.wallet.client import Client
home = expanduser('~')
client = Client('YOUR_API_KEY', 'YOUR_API_SECRET')
accounts = client.get_accounts()
print accounts ['data'][0]['balance']
| lightningvapes/conky-ethereum-ticker-with-graph-chart | cb_balance_grabber.py | Python | gpl-3.0 | 267 |
# coding=utf-8
# Author: Gonçalo M. (aka duramato/supergonkas) <supergonkas@gmail.com>
#
# This file is part of Medusa.
#
# Medusa 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... | FireBladeNooT/Medusa_1_6 | medusa/providers/torrent/xml/bitsnoop.py | Python | gpl-3.0 | 5,911 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import argparse
import numpy as np
import matplotlib
matplotlib.use('Agg')
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['svg.fonttype'] = 'none'
from deeptools import cm # noqa: F401
import matplotlib.pyplot as plt
from deeptools.correlation im... | fidelram/deepTools | deeptools/plotCorrelation.py | Python | gpl-3.0 | 10,834 |
#!/usr/bin/env python3
"""
Tools for logging in GSM package.
"""
import logging
import os
import platform
LOGGERS = {}
if platform.node() == 'ldb001':
BASE_LOG_DIR = os.path.join(os.getenv('HOME'), 'GSM')
else:
BASE_LOG_DIR = os.path.join(os.getenv('HOME'), 'prog', 'GSM')
USE_CONSOLE = False
LOG_LEVEL = logg... | kernsuite-debian/lofar | CEP/GSM/bremen/src/gsmlogger.py | Python | gpl-3.0 | 1,900 |
'''
Created on May 21, 2016
@author: zlp
'''
# import Image
hello = 100
class PILTest(object):
hello = 200
def __init__(self, name):
self._name = name
def printName(self):
print self._name
def printHelloInClass(self):
print self.hello
class2 = PILTest... | blackboarddd/PyTest | mstr/PILTest.py | Python | gpl-3.0 | 2,261 |
"""empty message
Revision ID: 4ccfe9c1b8fa
Revises: 1391ee426d4
Create Date: 2014-12-23 12:56:44.406087
"""
# revision identifiers, used by Alembic.
revision = '4ccfe9c1b8fa'
down_revision = '1391ee426d4'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - pl... | marinamarina/sure-thing | migrations/versions/4ccfe9c1b8fa_.py | Python | gpl-3.0 | 1,149 |
# $HeadURL: $
''' CacheFeederAgent
This agent feeds the Cache tables with the outputs of the cache commands.
'''
from DIRAC import S_OK#, S_ERROR, gConfig
from DIRAC.AccountingSystem.Client.ReportsClient import ReportsClient
from DIRAC.Core.Base.... | calancha/DIRAC | ResourceStatusSystem/Agent/CacheFeederAgent.py | Python | gpl-3.0 | 6,141 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.