code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
#coding=utf-8
##
# @file encrypt.py
# @brief tools for encrypting
# @author Jiexin Guo
# @version 1.0
# @date 2013-07-28
# @copyright 2013 SYSU-Software. All rights reserved.
# This project is released under MIT License.
import rsa
import os,sys
import binascii
import hashlib
base = [str(x) for x in range(10)] + [ ch... | igemsoftware/SYSU-Software2013 | project/Python27_32/web/encrypt.py | Python | mit | 2,590 |
from __future__ import print_function, division
import matplotlib
import logging
from sys import stdout
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import (Net, RealApplianceSource,
BLSTMLayer, DimshuffleLayer,
Bidirectiona... | mmottahedi/neuralnilm_prototype | scripts/e470.py | Python | mit | 7,017 |
# pylint: disable=too-few-public-methods, useless-object-inheritance
"""
False positive case of E1101:
The error is triggered when the attribute set in the base class is
modified with augmented assignment in a derived class.
https://www.logilab.org/ticket/9588
"""
__revision__ = 0
class BaseClass(object):
"The b... | ruchee/vimrc | vimfiles/bundle/vim-python/submodules/pylint/tests/functional/e/e1101_9588_base_attr_aug_assign.py | Python | mit | 1,037 |
#!/usr/bin/env python3
import socket
import sys
import json
import shlex
import subprocess
import logging
from configparser import SafeConfigParser
logging.basicConfig(level=logging.DEBUG)
log = logging.getLogger('record-all-audio-streams')
host = 'localhost'
port = 9999
log.info('Connecting to %s:%u', host, port)
c... | voc/voctomix | example-scripts/ffmpeg/record-all-audio-streams.py | Python | mit | 2,097 |
import sys, os, operator, json
from py4j.java_gateway import JavaGateway
from py4j.java_collections import ListConverter
'''
@author: Anant Bhardwaj
@date: Nov 1, 2013
'''
class Recommender:
def __init__(self):
self.gateway = JavaGateway()
def get_item_based_recommendations(self, paper_id_list):
java_p... | imclab/confer | server/recommender.py | Python | mit | 741 |
#!/usr/bin/env python
from setuptools import setup, find_packages
setup(name="i3pystatus",
version="3.35",
description="A complete replacement for i3status",
url="http://github.com/enkore/i3pystatus",
license="MIT",
classifiers=[
"Development Status :: 4 - Beta",
"Env... | Arvedui/i3pystatus | setup.py | Python | mit | 1,051 |
#!/usr/bin/env python
import scipy.sparse as sps
from apgl.graph.GeneralVertexList import GeneralVertexList
from apgl.graph.SparseGraph import SparseGraph
numVertices = 10
vList = GeneralVertexList(numVertices)
Wght = sps.lil_matrix((numVertices, numVertices))
graph = SparseGraph(vList, W=Wght, undirected=False)
# A... | showa-yojyo/notebook | source/_sample/apgl/distribution.py | Python | mit | 553 |
import re
from collections import namedtuple
component = r"""
(?:/\*\*((?:\*(?!/)|[^*])*)\*/\s+)?
(
(?:<cf)?
component\b
)
([^>{]*)
"""
component = re.compile(component, re.I | re.X | re.S)
Component = namedtuple('Component', 'script docblock attributes')
script_function = r"""
(?:/\*\*((?:\*(?!/)|[^*])*)\*... | jcberquist/sublimetext-cfml | src/component_parser/regex.py | Python | mit | 2,805 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Building()
result.template = "object/building/player/construction/shared_construction_player_house_tatooine_large_... | anhstudios/swganh | data/scripts/templates/object/building/player/construction/shared_construction_player_house_tatooine_large_style_01.py | Python | mit | 509 |
# Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules (http://sudoku.com.au/TheRules.aspx).
#
# The Sudoku board could be partially filled, where empty cells are filled with the character '.'.
#
# Note:
# A valid Sudoku board (partially filled) is not necessarily solvable. Only the filled cells nee... | jigarkb/CTCI | LeetCode/036-M-ValidSudoku.py | Python | mit | 1,045 |
from dpl.core.things import Thing, ThingFactory
class ThingRegistry(object):
"""
Класс (Singleton по задумке), который хранит список фабрик
для всех импортированных соединений
"""
__reg = dict() # type: dict[str, dict[type, ThingFactory]]
@classmethod
def register_factory(cls, type_alias... | dot-cat/dotcat_platform | dpl/core/things/thing_registry.py | Python | mit | 2,876 |
# Copyright (C) 2013 - 2016 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
import logging
import traceback
from collections import defaultdict
from ..anagonda.context import guru
from commands.base import Command
class PackageSymbols(Command):
"""Run g... | danalec/dotfiles | sublime/.config/sublime-text-3/Packages/anaconda_go/plugin/handlers_go/commands/package_symbols.py | Python | mit | 5,136 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import cstr
import mimetypes, json
from werkzeug.wrappers import Response
from frappe.website.context import get_context
f... | gangadharkadam/johnfrappe | frappe/website/render.py | Python | mit | 4,424 |
import gridfs
import tempfile
from amon.apps.core.basemodel import BaseModel
class FilesModel(BaseModel):
def __init__(self):
super(FilesModel, self).__init__()
self.fs = gridfs.GridFS(self.mongo.get_database(), collection='files')
def get_by_id(self, file_id=None):
file_id = self.ob... | martinrusev/amonone | amon/apps/files/models.py | Python | mit | 1,183 |
# -*- coding: utf-8 -*-
# Copyright (c) 2020, Frappe Technologies and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
import unittest
class TestWebsiteSettings(unittest.TestCase):
pass
| adityahase/frappe | frappe/website/doctype/website_settings/test_website_settings.py | Python | mit | 227 |
from .MidiOutFile import MidiOutFile
from .MidiInFile import MidiInFile
"""
This is an example of the smallest possible type 0 midi file, where
all the midi events are in the same track.
"""
class Transposer(MidiOutFile):
"Transposes all notes by 1 octave"
def _transp(self, ch, note):
if c... | JonathanRaiman/Dali | data/score_informed_transcription/midi/example_transpose_octave.py | Python | mit | 1,038 |
# Time: O(n)
# Space: O(1)
# Given an array of integers with possible duplicates,
# randomly output the index of a given target number.
# You can assume that the given target number must exist in the array.
#
# Note:
# The array size can be very large.
# Solution that uses too much extra space will not pass the judge... | jaredkoontz/leetcode | Python/random-pick-index.py | Python | mit | 1,340 |
# Licenced under the txaws licence available at /LICENSE in the txaws source.
"""
Tests for L{txaws.route53.model}.
"""
from ipaddress import IPv4Address
from twisted.trial.unittest import TestCase
from txaws.route53.model import (
Name, SOA, NS, CNAME, A,
)
from txaws.util import XML
class BasicResourceRecor... | twisted/txaws | txaws/route53/tests/test_model.py | Python | mit | 2,729 |
#!/usr/bin/env python3
# Copyright (c) 2017-2019 The Particl Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_particl import (
ParticlTestFramework,
isclose,
)
from test_framework.me... | particl/particl-core | test/functional/feature_part_smsgpaidfee_ext.py | Python | mit | 4,260 |
import unittest
from pkg_resources import resource_string
from .. import parse, parser, tree
def setup_java_class(content_to_add):
""" returns an example java class with the
given content_to_add contained within a method.
"""
template = """
public class Lambda {
public static void main(Strin... | c2nes/javalang | javalang/test/test_java_8_syntax.py | Python | mit | 8,702 |
# coding: utf-8
from setuptools import setup, find_packages
import os
# not so bad: http://joebergantine.com/blog/2015/jul/17/releasing-package-pypi/
version = __import__('djangocms_misc').__version__
def read(fname):
# read the contents of a text file
return open(os.path.join(os.path.dirname(__file__), fna... | bnzk/djangocms-misc | setup.py | Python | mit | 1,190 |
from datetime import datetime
import fixtures
import constants
from authomatic.providers import oauth2
conf = fixtures.get_configuration('yammer')
LINK = 'https://www.yammer.com/peterhudec.com/users/{0}'\
.format(conf.user_username)
# Yammer allows users to only set month and day of their birth day.
# The year ... | scorphus/authomatic | tests/functional_tests/expected_values/yammer.py | Python | mit | 4,202 |
class CustomSet:
def __init__(self, elements=None):
self.elements = list(elements) if elements is not None else list([])
def isempty(self):
return not self.elements
def __iter__(self):
return iter(self.elements)
def __contains__(self, element):
return element in self.e... | jmluy/xpython | exercises/practice/custom-set/.meta/example.py | Python | mit | 1,184 |
# -*- coding: utf-8 -*-
# place form definition here
| dedayoa/django-country-dialcode | country_dialcode/forms.py | Python | mit | 54 |
# -*- coding: utf-8 -*-
import errno
import itertools
import os
import os.path
import inotify_simple
import pytest
import concierge
import concierge.endpoints.cli as cli
import concierge.endpoints.daemon as daemon
import concierge.utils
def get_app(*params):
parser = cli.create_parser()
parser = daemon.Da... | 9seconds/concierge | tests/test_endpoints_daemon.py | Python | mit | 3,504 |
#!/usr/bin/env python
'''
What is a FASTA format file/string?
This module follows the NCBI conventions: http://blast.ncbi.nlm.nih.gov/blastcgihelp.shtml
'''
import cStringIO
import math
def idFromName(line):
'''
line: a fasta nameline
returns: an id parsed from the fasta nameline. The id is the first
... | todddeluca/tfd | tfd/fasta.py | Python | mit | 21,889 |
import os
import random
import string
import warnings
import numpy as np
from astropy import log
from astropy.io import fits
import stingray
from .events import EventList
from .gti import cross_two_gtis
from .io import high_precision_keyword_read
from .lightcurve import Lightcurve
from .utils import genDataPath
HAS... | abigailStev/stingray | stingray/largememory.py | Python | mit | 34,861 |
from rpython.jit.metainterp.test.test_list import ListTests
from rpython.jit.backend.x86.test.test_basic import Jit386Mixin
class TestList(Jit386Mixin, ListTests):
# for individual tests see
# ====> ../../../metainterp/test/test_list.py
pass
| jptomo/rpython-lang-scheme | rpython/jit/backend/x86/test/test_list.py | Python | mit | 256 |
from .int.address import *
from .int.code import *
from .int.common import *
from .int.datetime import *
from .int.development import *
from .int.file import *
from .int.finance import *
from .int.hardware import *
from .int.internet import *
from .int.path import *
from .int.payment import *
from .int.person import *
... | lk-geimfari/elizabeth | mimesis/data/__init__.py | Python | mit | 403 |
from jsonrpc import ServiceProxy
access = ServiceProxy("http://127.0.0.1:9447")
pwd = raw_input("Enter old wallet passphrase: ")
pwd2 = raw_input("Enter new wallet passphrase: ")
access.walletpassphrasechange(pwd, pwd2)
| IlfirinIlfirin/shavercoin | contrib/wallettools/walletchangepass.py | Python | mit | 220 |
import os
import traceback
import py
from flaky import flaky
from tox.session.commands.run import sequential
@flaky(max_runs=3)
def test_tox_parallel_build_safe(initproj, cmd, mock_venv, monkeypatch):
initproj(
"env_var_test",
filedefs={
"tox.ini": """
[tox]
... | gaborbernat/tox | tests/unit/package/test_package_parallel.py | Python | mit | 4,272 |
import os
import unittest
from oeqa.oetest import oeRuntimeTest
from oeqa.utils.decorators import *
#in the future these lists could be moved outside of module
errors = ["error", "cannot", "can\'t", "failed"]
common_errors = [
'(WW) warning, (EE) error, (NI) not implemented, (??) unknown.',
'dma timeout',
... | wwright2/dcim3-angstrom1 | sources/openembedded-core/meta/lib/oeqa/runtime/parselogs.py | Python | mit | 7,183 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_huff_darklighter.iff"
result.attribute_template_id = 9
result... | anhstudios/swganh | data/scripts/templates/object/mobile/shared_huff_darklighter.py | Python | mit | 452 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "craken_project.settings.local")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| crakensio/djph2 | craken_project/manage.py | Python | mit | 263 |
# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
# imports - standard imports
import gzip
import importlib
import json
import os
import shlex
import shutil
import subprocess
import unittest
from contextlib import contextmanager
from functools import wraps
from glob impor... | frappe/frappe | frappe/tests/test_commands.py | Python | mit | 22,402 |
#!/usr/bin/env python3
# A simple script that connects to a server and displays block headers
import time
import asyncio
from electrum.network import Network
from electrum.util import print_msg, json_encode, create_and_start_event_loop, log_exceptions
# start network
loop, stopping_fut, loop_thread = create_and_sta... | neocogent/electrum | electrum/scripts/block_headers.py | Python | mit | 955 |
# Copyright (c) 2021 The sqlalchemy-bigquery Authors
#
# 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, modify, mer... | mxmzdlv/pybigquery | tests/unit/test_select.py | Python | mit | 15,799 |
# bank_account_href is the stored href for the BankAccount
# order_href is the stored href for the Order
bank_account = balanced.BankAccount.fetch(bank_account_href)
credit = bank_account.credit(
amount=100000,
description='Payout for order #1111',
appears_on_statement_as='GoodCo #1111',
order=order_hre... | trenton42/txbalanced | snippets/credit-soft-descriptor.py | Python | mit | 323 |
"""add_error_severity
Revision ID: 65ce5d505f12
Revises: ebe2d7673a81
Create Date: 2016-07-26 13:39:13.003391
"""
# revision identifiers, used by Alembic.
revision = '65ce5d505f12'
down_revision = '50faca665f9c'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade(eng... | fedspendingtransparency/data-act-broker-backend | dataactcore/migrations/versions/65ce5d505f12_add_error_severity.py | Python | cc0-1.0 | 851 |
'''
The idea is that we record the commands sent to the debugger and reproduce them from this script
(so, this works as the client, which spawns the debugger as a separate process and communicates
to it as if it was run from the outside)
Note that it's a python script but it'll spawn a process to r... | JDSchmitzMedia/pydev | pysrc/tests_python/test_debugger.py | Python | epl-1.0 | 30,357 |
from GUIComponent import GUIComponent
from Tools.FuzzyDate import FuzzyTime
from ServiceReference import ServiceReference
from Components.MultiContent import MultiContentEntryText, MultiContentEntryPixmapAlphaTest, MultiContentEntryProgress
from Components.config import config
import os
import struct
import random
from... | 68foxboris/enigma2-openpli-vuplus | lib/python/Components/MovieList.py | Python | gpl-2.0 | 31,608 |
#!/usr/bin/env python
from .HTMLElement import HTMLElement
class HTMLFieldSetElement(HTMLElement):
def __init__(self, doc, tag):
HTMLElement.__init__(self, doc, tag)
@property
def form(self):
pass
| tweemeterjop/thug | thug/DOM/W3C/HTML/HTMLFieldSetElement.py | Python | gpl-2.0 | 229 |
# A dummy extension that installs an hgweb command that throws an Exception.
from mercurial.hgweb import webcommands
def raiseerror(web, req, tmpl):
'''Dummy web command that raises an uncaught Exception.'''
# Simulate an error after partial response.
if 'partialresponse' in req.form:
req.respond... | hekra01/mercurial | tests/hgweberror.py | Python | gpl-2.0 | 547 |
#!/usr/bin/env python
'''Translate new cache url format into human readable airport codes
based on Maurizio M. Munafo perl code:
$name =~ tr/0-9a-z/uzpkfa50vqlgb61wrmhc72xsnid83ytoje94/;
'''
import re
from string import maketrans, lowercase
import sys
import os
import logging
from optparse import OptionParser, SU... | Jamlum/pytomo | pytomo/translation_cache_url.py | Python | gpl-2.0 | 4,763 |
'''
Created on Dec 28, 2015
@author: iclosure
'''
class GLExtensionFunctions(object):
'''
classdocs
'''
def __init__(self, params):
'''
Constructor
'''
def resolve(self, context):
pass
def fboSupported(self):
pass
def openGL15Suppo... | iclosure/coolkits | src/jplot3d-py/com/smartsoft/j3d/GLExtensionFunctions.py | Python | gpl-2.0 | 438 |
"""
SALTS XBMC Addon
Copyright (C) 2014 tknorris
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.
T... | AMOboxTV/AMOBox.LegoBuild | plugin.video.salts/salts_lib/srt_scraper.py | Python | gpl-2.0 | 9,410 |
#NVDAObjects/IAccessible/sysTreeView32.py
#A part of NonVisual Desktop Access (NVDA)
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
#Copyright (C) 2007-2010 Michael Curran <mick@kulgan.net>, James Teh <jamie@jantrid.net>
from ctypes import *
from ctypes.wintypes... | daisymax/nvda | source/NVDAObjects/IAccessible/sysTreeView32.py | Python | gpl-2.0 | 10,467 |
import logging
from pymongo import MongoClient
import json
from bson import json_util
import time
import datetime
logger = logging.getLogger(__name__)
class UIPusher:
def __init__(self,core,parm):
# register event handler
core.registerEventHandler("controlleradapter", self.controllerHandler)
# register webso... | starbops/OpenADM | core/src/pox_modules/uipusher.py | Python | gpl-2.0 | 6,837 |
import copy
import itertools
import re
import operator
from datetime import datetime, timedelta
from collections import defaultdict
import numpy as np
from pandas.core.base import PandasObject
from pandas.core.common import (_possibly_downcast_to_dtype, isnull,
_NS_DTYPE, _TD_DTYPE, AB... | webmasterraj/FogOrNot | flask/lib/python2.7/site-packages/pandas/core/internals.py | Python | gpl-2.0 | 150,471 |
class Capture(object):
"""
Generic Capture entity. Base class
that both Screenshot and Pdiff can inherit from.
"""
def __init__(self, img_path):
if img_path is not None:
try:
self.path = img_path
self.hashvalue = self._set_hash()
except... | nicovillanueva/obsidian-core | src/screenshots/Capture.py | Python | gpl-2.0 | 836 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-09-16 11:54
from django.db import migrations, models
import tcms.issuetracker.validators
# This migration could be removed when squash migrations from scratch.
class Migration(migrations.Migration):
dependencies = [
("issuetracker", "0008_ad... | Nitrate/Nitrate | src/tcms/issuetracker/migrations/0009_alter_fields_see_details_inside.py | Python | gpl-2.0 | 1,332 |
#!/usr/bin/env python
#
# gst-python
# Copyright (C) 2005 Andy Wingo <wingo@pobox.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your op... | offlinehacker/flumotion | tests/checks.py | Python | gpl-2.0 | 5,092 |
#!/usr/bin/python
import urllib2
import urllib
import json
import time
import os
rootPath = os.getcwd() + "/wikiWomensStats/"
dataPath = rootPath + 'data.json'
fullDataPath = '/home/ubuntu/wikiWomen_data/data.json'
headers = { 'User-Agent' : 'Womens edit a thon India' }
cmtitle = "Category:Articles_created_or_expa... | cosmiclattes/wikiwomen | editCount/update_json.py | Python | gpl-2.0 | 3,812 |
#Written by Reid McIlroy-Young for Dr. John McLevey, University of Waterloo 2015
import unittest
import metaknowledge
import metaknowledge.WOS
import os
import filecmp
import networkx as nx
disableJournChecking = True
class TestRecordCollection(unittest.TestCase):
@classmethod
def setUpClass(cls):
met... | networks-lab/metaknowledge | metaknowledge/tests/test_recordcollection.py | Python | gpl-2.0 | 26,484 |
# Embedded file name: /usr/lib/enigma2/python/Components/NetworkTime.py
from Components.Console import Console
from config import config
from enigma import eTimer, eDVBLocalTimeHandler, eEPGCache
from Tools.StbHardware import setRTCtime
from time import time, ctime
def AutoNTPSync(session = None, **kwargs):
... | kingvuplus/boom2 | lib/python/Components/NetworkTime.py | Python | gpl-2.0 | 1,875 |
# Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
# 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.
#
# Thi... | crazyleen/msp430-gdb-7.2a | gdb/testsuite/gdb.python/py-prettyprint.py | Python | gpl-2.0 | 7,344 |
"same as queuetest2.py, but uses threading, not _threads"
numconsumers = 2 # how many consumers to start
numproducers = 4 # how many producers to start
nummessages = 4 # messages per producer to put
import threading, queue, time, sys
safeprint = threading.L... | simontakite/sysadmin | pythonscripts/programmingpython/System/Threads/queuetest3.py | Python | gpl-2.0 | 1,403 |
#
# Copyright 2012-2016 Red Hat, Inc.
#
# 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 distributed ... | nirs/vdsm | tests/storage/securable_test.py | Python | gpl-2.0 | 3,360 |
from ase import *
from espresso import espresso
from ase.lattice import bulk
import matplotlib
matplotlib.use('Agg') #turn off screen output so we can plot from the cluster
import matplotlib.pyplot as plt
import numpy as np
metal = 'Pt'
metal2 = None # if you have an alloy, specify the second metal
name = metal
if... | CBE544/CBE544.github.io | ASE/Getting_Started/run_sp.py | Python | gpl-2.0 | 2,085 |
from ..xmlbuilder import XMLBuilder, XMLProperty
class DomainLaunchSecurity(XMLBuilder):
"""
Class for generating <launchSecurity> XML element
"""
XML_NAME = "launchSecurity"
_XML_PROP_ORDER = ["type", "cbitpos", "reducedPhysBits", "policy",
"session", "dhCert"]
type = XMLPropert... | crobinso/virt-manager | virtinst/domain/launch_security.py | Python | gpl-2.0 | 1,325 |
# -*- encoding: utf-8 -*-
import pytest
from abjad import *
Component = scoretools.Component
Selection = selectiontools.Selection
def test_selectiontools_Selection__all_are_components_in_same_logical_voice_01():
r'''Unincorporated leaves do not share a logical voice.
Unicorporated leaves do not share a root c... | mscuthbert/abjad | abjad/tools/selectiontools/test/test_selectiontools_Selection__all_are_components_in_same_logical_voice.py | Python | gpl-3.0 | 46,366 |
from uuid import uuid4
import os
import platform
import signal
import time
import traceback
import webbrowser
import sys
from couchpotato.api import addApiView
from couchpotato.core.event import fireEvent, addEvent
from couchpotato.core.helpers.variable import cleanHost, md5, isSubFolder, compareVersions
from couchpot... | Maistho/CouchPotatoServer | couchpotato/core/_base/_core.py | Python | gpl-3.0 | 13,193 |
# encoding: 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):
# Adding model 'Feed'
db.create_table('feeds_feed', (
('id', self.gf('django.db.models.fields.... | CodigoSur/cyclope | cyclope/apps/feeds/migrations/0001_initial.py | Python | gpl-3.0 | 8,615 |
# Copyright (C) 2010, 2011 Linaro
#
# Author: James Westby <james.westby@linaro.org>
#
# This file is part of Linaro Image Tools.
#
# Linaro Image Tools is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either v... | tobetter/linaro-image-tools_packaging | linaro_image_tools/testing.py | Python | gpl-3.0 | 2,121 |
# -*- coding: utf-8 -*-
# Copyright (c) 2008-2010, Michael Gorven, Stefano Rivera, Adrianna Pińska
# Released under terms of the MIT/X/Expat Licence. See COPYING for details.
"""Logs messages sent and received."""
from datetime import datetime
from errno import EEXIST
import fnmatch
import logging
from os.path import... | caktus/ibid | ibid/plugins/log.py | Python | gpl-3.0 | 8,839 |
{
'name': 'SaaS Client',
'version': '1.0.0',
'author': 'Ivan Yelizariev',
'license': 'GPL-3',
'category': 'SaaS',
'website': 'https://it-projects.info',
'depends': ['auth_oauth', 'auth_oauth_check_client_id', 'saas_utils', 'mail'],
'data': [
'views/saas_client.xml',
'secu... | Endika/odoo-saas-tools | saas_client/__openerp__.py | Python | gpl-3.0 | 506 |
# -*- coding: utf-8 -*-
# Copyright (c) 2009 - Guillaume Desmottes <gdesmott@gnome.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, either version 3 of the License, or (at your option) any... | shtrom/gtg | GTG/plugins/bugzilla/bugzilla.py | Python | gpl-3.0 | 4,140 |
# shipBonusCarrierC4WarfareLinksBonus
#
# Used by:
# Ship: Chimera
type = "passive"
def handler(fit, src, context):
fit.modules.filteredItemBoost(
lambda mod: mod.item.requiresSkill("Shield Command") or mod.item.requiresSkill("Information Command"),
"warfareBuff2Value", src.getModifiedItemAttr("sh... | Ebag333/Pyfa | eos/effects/shipbonuscarrierc4warfarelinksbonus.py | Python | gpl-3.0 | 1,348 |
#!/usr/bin/env python
from HTMLParser import HTMLParser
from cStringIO import StringIO
from urllib2 import urlopen
from urlparse import urljoin
from BeautifulSoup import BeautifulSoup, SoupStrainer
from html5lib import parse, treebuilders
URLS = (
'http://python.org',
'http://google.com',
)
d... | YuxuanLing/trunk | trunk/code/study/python/core_python_appilication/ch09/parse_links.py | Python | gpl-3.0 | 2,016 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Test for anglerfish.ChainableFuture."""
import unittest
from anglerfish import ChainableFuture
class TestName(unittest.TestCase):
maxDiff, __slots__ = None, ()
def test_ChainableFuture(self):
future1 = ChainableFuture()
future2 = future1... | mktoni/anglerfish | tests/test_make_chainablefuture.py | Python | gpl-3.0 | 577 |
# Copyright 2012 Lee Verberne <lee@blarg.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, either version 3 of the License, or
# (at your option) any later version.
#
# This program is dis... | kafana/ubik | lib/ubik/fab/jettypathhack.py | Python | gpl-3.0 | 1,655 |
import six
import requests
from bugwarrior.config import die
from bugwarrior.services import Issue, IssueService, ServiceClient
import logging
log = logging.getLogger(__name__)
class TeamLabClient(ServiceClient):
def __init__(self, hostname, verbose=False):
self.hostname = hostname
self.verbose ... | lyarwood/bugwarrior | bugwarrior/services/teamlab.py | Python | gpl-3.0 | 4,419 |
# -*- coding: utf-8 -*-
# Copyright (C) Duncan Macleod (2014-2020)
#
# This file is part of GWpy.
#
# GWpy 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)... | duncanmmacleod/gwpy | gwpy/table/io/fetch.py | Python | gpl-3.0 | 4,325 |
try:
# python3
from xmlrpc.client import DateTime
except ImportError:
# python2
from xmlrpclib import DateTime
type_list = list
def list(options):
ret = [{'date_created': DateTime('20150915T18:29:16'),
'date_start': None,
'date_updated': DateTime('20150915T18:29:17'),
... | grigouze/gandi.cli | gandi/cli/tests/fixtures/_operation.py | Python | gpl-3.0 | 5,786 |
import numpy as _n
import time as _t
import spinmob.egg as egg
##### GUI DESIGN
# create the main window
w = egg.gui.Window(autosettings_path="example_sweeper_w.cfg")
# add the "go" button
b_sweep = w.place_object(egg.gui.Button("Sweep!", checkable=True)).set_width(50)
b_select = w.place_object(egg.gui.B... | ejetzer/spinmob | egg/examples/example_sweeper.py | Python | gpl-3.0 | 5,048 |
from errbot import BotPlugin, botcmd
class Example(BotPlugin):
"""
This is a very basic plugin to try out your new installation and get you started.
Feel free to tweak me to experiment with Errbot.
You can find me in your init directory in the subdirectory plugins.
"""
@botcmd # flags a comm... | errbotio/errbot | errbot/templates/initdir/example.py | Python | gpl-3.0 | 667 |
########################################################################
# $HeadURL$
# File : AgentModule.py
# Author : Adria Casajus
########################################################################
"""
Base class for all agent modules
"""
__RCSID__ = "$Id$"
import os
import threading
import types
import... | calancha/DIRAC | Core/Base/AgentModule.py | Python | gpl-3.0 | 17,589 |
from gain import Css, Item, Parser, Xpath
def test_parse():
html = '<title class="username">tom</title><div class="karma">15</div>'
class User(Item):
username = Xpath('//title')
karma = Css('.karma')
parser = Parser(html, User)
user = parser.parse_item(html)
assert user.results... | babykick/gain | tests/test_parser.py | Python | gpl-3.0 | 757 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2002 Ben Escoto <ben@emerose.org>
# Copyright 2007 Kenneth Loafman <kenneth@loafman.com>
#
# This file is part of duplicity.
#
# Duplicity is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License... | Alberto-Beralix/Beralix | i386-squashfs-root/usr/share/pyshared/duplicity/backends/rsyncbackend.py | Python | gpl-3.0 | 6,517 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | dlazz/ansible | lib/ansible/modules/cloud/google/gcp_compute_target_vpn_gateway.py | Python | gpl-3.0 | 11,232 |
"""
Copyright 2013 Steven Diamond
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software... | SteveDiamond/cvxpy | cvxpy/reductions/eliminate_pwl/atom_canonicalizers/cumsum_canon.py | Python | gpl-3.0 | 983 |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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,... | SerialShadow/SickRage | sickbeard/__init__.py | Python | gpl-3.0 | 114,709 |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Canal para PelisDanko
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
# ------------------------------------------------------------
import re
import sys
from core import config
from core im... | Hernanarce/pelisalacarta | python/main-classic/channels/pelisdanko.py | Python | gpl-3.0 | 14,522 |
from ethereum.slogging import get_logger
log = get_logger('eth.block_creation')
from ethereum.block import Block, BlockHeader
from ethereum.common import mk_block_from_prevstate, validate_header, \
verify_execution_results, validate_transaction_tree, \
set_execution_results, add_transactions, post_finalize
from... | nirenzang/Serpent-Pyethereum-Tutorial | pyethereum/ethereum/meta.py | Python | gpl-3.0 | 2,865 |
#!/usr/bin/env python
"""
@file route2alts.py
@author Daniel Krajzewicz
@author Michael Behrisch
@date 11.09.2009
@version $Id: route2alts.py 14425 2013-08-16 20:11:47Z behrisch $
Counts possible routes for all depart/arrival edges.
Builds route alternatives assigning the so determined probabilities to use a r... | cathyyul/sumo-0.18 | tools/route/route2alts.py | Python | gpl-3.0 | 3,601 |
# coding=utf-8
"""Module used to generate context for aggregation result section."""
from safe.definitions.exposure import exposure_all, exposure_population
from safe.definitions.fields import (
affected_exposure_count_field,
aggregation_name_field,
total_affected_field,
exposure_type_field,
expos... | Gustry/inasafe | safe/report/extractors/aggregate_result.py | Python | gpl-3.0 | 9,641 |
import pygame
import random
class Food:
"""
Food class to encapsulate position of food particle
state variables:
position: pygame.Rect object
"""
def __init__(self):
"""
constructor for Food.py
Transition: initializes a food object with random po... | shafeeqr2/python | Snake Game Redevelopment/Source/Food.py | Python | gpl-3.0 | 1,067 |
#!/usr/bin/env python3
########################################################################
# Solves problem 142 from projectEuler.net.
# ???
# Copyright (C) 2011 Santiago Alessandri
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public L... | sanSS/programming-contests | project-euler/problem142.py | Python | gpl-3.0 | 1,119 |
# Copyright (c) 2013-2017 Jeffrey Pfau
#
# 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/.
from ._pylib import ffi, lib # pylint: disable=no-name-in-module
from .core imp... | libretro/mgba | src/platform/python/mgba/thread.py | Python | mpl-2.0 | 1,875 |
# 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/.
from selenium.webdriver.common.by import By
from pages.firefox.base import FirefoxBasePage
class ChannelIOSPage(Firef... | sgarrity/bedrock | tests/pages/firefox/channel/ios.py | Python | mpl-2.0 | 590 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-01-31 19:38
from __future__ import unicode_literals
from django.db import migrations
import timezone_field.fields
class Migration(migrations.Migration):
dependencies = [
('groups', '0008_group_public_description'),
]
operations = [
... | yunity/yunity-core | karrot/groups/migrations/0009_group_timezone.py | Python | agpl-3.0 | 505 |
import html
import logging
import re
import urllib
from feedparser import FeedParserDict
from feedparser import parse as fp_parse
from requests.exceptions import ReadTimeout
from jarr.lib.const import FEED_MIMETYPES, GOOGLE_BOT_UA, REQUIRED_JSON_FEED
from jarr.lib.enums import FeedType
from jarr.lib.html_parsing impo... | jaesivsm/pyAggr3g470r | jarr/controllers/feed_builder.py | Python | agpl-3.0 | 9,247 |
"""
Methods for exporting course data to XML
"""
import logging
import lxml.etree
from xblock.fields import Scope
from xmodule.contentstore.content import StaticContent
from xmodule.exceptions import NotFoundError
from xmodule.modulestore import EdxJSONEncoder, ModuleStoreEnum
from xmodule.modulestore.inheritance impo... | wwj718/murp-edx | common/lib/xmodule/xmodule/modulestore/xml_exporter.py | Python | agpl-3.0 | 10,085 |
# Copyright 2004-2009 Tiny SPRL (<https://tiny.be>).
# Copyright 2013 initOS GmbH & Co. KG (<https://www.initos.com>).
# Copyright 2016 Tecnativa - Vicent Cubells
# Copyright 2016 Camptocamp - Akim Juillerat (<https://www.camptocamp.com>).
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo... | OCA/partner-contact | base_partner_sequence/models/partner.py | Python | agpl-3.0 | 2,422 |
from dateutil.relativedelta import relativedelta
from factory import CREATE_STRATEGY, SubFactory, LazyAttribute, post_generation
from factory.django import DjangoModelFactory
from freezegun import freeze_time
from karrot.groups.models import GroupMembership
from karrot.issues.models import Issue, OptionTypes
from karr... | yunity/yunity-core | karrot/issues/factories.py | Python | agpl-3.0 | 2,130 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the... | mikelarre/odoomrp-wip-1 | stock_inventory_preparation_filters/models/stock_inventory.py | Python | agpl-3.0 | 6,750 |
#!/usr/bin/python
###########################################################################
# (C) Vrije Universiteit, Amsterdam (the Netherlands) #
# #
# This file is part of AmCAT - The Amsterdam Content Analysis Toolkit ... | tschmorleiz/amcat | amcat/scripts/actions/deduplicate.py | Python | agpl-3.0 | 6,399 |
import config
import redis
import json
r = redis.StrictRedis(host=config.REDIS_HOST, port=config.REDIS_PORT, db=config.REDIS_DB)
try:
expTime=config.BTCBAL_CACHE
except:
expTime=600
def rGet(key):
return r.get(key)
def rSet(key,value):
return r.set(key,value)
def rExpire(key,sec):
return r.expire(key,sec... | achamely/omniwallet | api/cacher.py | Python | agpl-3.0 | 786 |
"""
WSGI config for orent project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "orent.settings")
from django.core.wsgi ... | link272/0rent | orent/wsgi.py | Python | agpl-3.0 | 385 |
"""
Parser and evaluator for FormulaResponse and NumericalResponse
Uses pyparsing to parse. Main function as of now is evaluator().
"""
import math
import numbers
import operator
import numpy
import scipy.constants
from pyparsing import (
CaselessLiteral,
Combine,
Forward,
Group,
Literal,
Mat... | proversity-org/edx-platform | common/lib/calc/calc/calc.py | Python | agpl-3.0 | 13,906 |