code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
"""
***************************************************************************
SagaAlgorithm213.py
---------------------
Date : December 2014
Copyright : (C) 2014 by Victor Olaya
Email : volayaf at gmail dot com
********************... | herow/planning_qgis | python/plugins/processing/algs/saga/SagaAlgorithm214.py | Python | gpl-2.0 | 2,536 |
import os
import unittest
from vsg.rules import block
from vsg import vhdlFile
from vsg.tests import utils
sTestDir = os.path.dirname(__file__)
lFile, eError =vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir,'rule_502_test_input.vhd'))
lExpected_lower = []
lExpected_lower.append('')
utils.read_file(os.path.join(... | jeremiah-c-leary/vhdl-style-guide | vsg/tests/block/test_rule_502.py | Python | gpl-3.0 | 2,032 |
from chat.tests.message import *
from chat.tests.channel import *
from chat.tests.test_url import *
| dionyziz/ting | API/chat/tests/__init__.py | Python | mit | 100 |
# Copyright 2011 David Malcolm <dmalcolm@redhat.com>
# Copyright 2011 Red Hat, Inc.
#
# This is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) a... | ruediger/gcc-python-plugin | tests/plugin/functions/script.py | Python | gpl-3.0 | 3,300 |
#!/usr/bin/env python
"""
Run and graph the results of patest_suggested_vs_streaminfo_latency.c
Requires matplotlib for plotting: http://matplotlib.sourceforge.net/
"""
import os
from pylab import *
import numpy
from matplotlib.backends.backend_pdf import PdfPages
testExeName = "PATest.exe" # rename to whatever the... | powerboat9/USTL | src/portaudio/test/patest_suggested_vs_streaminfo_latency.py | Python | mit | 5,354 |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | chardet/chardet | chardet/codingstatemachine.py | Python | lgpl-2.1 | 3,559 |
meta = {'DDI': {'columns': [{'field': 'PhoneNumberStart',
'title': 'Phone Number Start',
'width': '14em'},
{'field': 'cid', 'title': 'Cid', 'width': '22em'},
{'field': 'RangeLength',
'title': 'Range Length',
... | axiros/misc_transcrypt | doc/kendo/src/ch5/server/meta.py | Python | bsd-3-clause | 11,820 |
import numpy as np
from scipy.stats import poisson, gamma as gammafunc
def gen_pseudo(pdf2d): #effectively H1 case
"""
Generate pseudo dataset from pdf2d
return psedo dataset
"""
PseudoSet = []
for iE,iData in enumerate(pdf2d):
#print np.shape(pdf2d)
for iCosZ, iMu in enume... | 221B-Haibara/IceCube_MultiFlavourPeVCutoffAna | generator/PseudoExperiment.py | Python | mit | 5,484 |
import pickle
import numpy as np
import sys
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ms2ldaviz.settings")
import django
django.setup()
import jsonpickle
from basicviz.models import Experiment,Mass2Motif
if __name__ == '__main__':
with open('/Users/simon/git/lda/notebooks/beer3.dict','r') as f:
... | sdrogers/ms2ldaviz | ms2ldaviz/add_topic_dict_beer3.py | Python | mit | 579 |
#
# Copyright (c) 2009--2015 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... | davidhrbac/spacewalk | backend/common/checksum.py | Python | gpl-2.0 | 2,616 |
"""Complete the main method in this script,
by completing the methods described."""
from pprint import pprint
FILENAME = 'fat_kakapo.txt'
DOUGLAS_ADAMS_QUOTE = '''The kakapo is an extremely fat bird.
A good-sized adult will weigh about six or seven pounds,
and its wings are just about good for waggling a bit
if it th... | theJollySin/python_for_scientists | classes/04_advanced_strings/problem_set_1_solutions.py | Python | gpl-3.0 | 3,426 |
# Copyright 2014 Cloudbase Solutions Srl
#
# All Rights Reserved.
#
# 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... | dims/nova | nova/tests/unit/virt/hyperv/test_volumeops.py | Python | apache-2.0 | 23,650 |
import glob
import os
csv_files_for_2011 = glob.glob("*2011*.csv")
for filename in csv_files_for_2011:
filename_wildcard_expression = filename.replace("2011","*")
output_filename = filename.replace("2011","")
os.system("awk 'FNR==1 && NR!=1{next;}{print}' " + filename_wildcard_expression + "> " + output_filenam... | daguar/netfile-etl | merge_csvs_across_years.py | Python | bsd-3-clause | 324 |
# -*- coding: utf-8 -*-
"""
Tests for an API endpoint for client-side user data validation.
"""
from __future__ import absolute_import
import unittest
import ddt
from django.conf import settings
from django.contrib.auth.models import User
from django.test.utils import override_settings
from django.urls import revers... | ESOedX/edx-platform | openedx/core/djangoapps/user_api/validation/tests/test_views.py | Python | agpl-3.0 | 8,853 |
from os.path import join
from bundlewrap.utils.testing import make_repo, run
def test_groups_for_node(tmpdir):
make_repo(
tmpdir,
nodes={
"node-foo": {'groups': {"group-foo"}},
"node-bar": {},
"node-baz": {},
"node-pop": {'groups': {"group-baz"}},
... | bundlewrap/bundlewrap | tests/integration/bw_plot.py | Python | gpl-3.0 | 4,976 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
from spack import *
class Icedtea(AutotoolsPackage):
"""The IcedTea project provides a harness to build t... | LLNL/spack | var/spack/repos/builtin/packages/icedtea/package.py | Python | lgpl-2.1 | 9,183 |
Display( "Message" )
Display( "Message", WARNING )
Display( "Message", Severity = WARNING )
Display( "Messsage", {Severity:WARNING} )
Display( "Message", ERROR )
Display( "Message", DUMMY ) | Spacecraft-Code/SPELL | src/executor/arena/tests/T01_Display.py | Python | lgpl-3.0 | 196 |
# coding=utf-8
"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.... | angadpc/Alexa-Project- | twilio/rest/api/v2010/account/sip/domain/__init__.py | Python | mit | 22,469 |
from __future__ import absolute_import
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'src'))
| pipet/pipet | conftest.py | Python | apache-2.0 | 130 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import webapp2
import jinja2
import re
from google.appengine.ext import ndb
from google.appengine.ext import blobstore
from google.appengine.api import users
from google.appengine.ext.webapp import blobstore_handlers
import logging
import parsers
import headers
import os
... | Dataliberate/bibliograph-live | api.py | Python | apache-2.0 | 45,400 |
import copy
import resource
import sys
import traceback
import unittest
import mock
import numpy as np
import sklearn.datasets
import sklearn.decomposition
import sklearn.ensemble
import sklearn.svm
from sklearn.utils.testing import assert_array_almost_equal
from HPOlibConfigSpace.configuration_space import Configura... | hmendozap/auto-sklearn | test/test_pipeline/test_regression.py | Python | bsd-3-clause | 18,360 |
import scriptcontext
from . import utility as rhutil
import Rhino
import System.Guid, System.Array, System.Drawing.Color
def AddMesh(vertices, face_vertices, vertex_normals=None, texture_coordinates=None, vertex_colors=None):
"""Adds a mesh object to the document
Parameters:
vertices = list of 3D points... | ksteinfe/decodes | src/decodes/io/rhinoscript/mesh.py | Python | gpl-3.0 | 27,301 |
# Copyright 2018 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | GoogleCloudPlatform/django-cloud-deploy | django_cloud_deploy/cloudlib/billing.py | Python | apache-2.0 | 5,223 |
from django.shortcuts import render
def index(request):
return render(request, 'backbone_ajax/index.html')
| zmetcalf/django-webdev | backbone_ajax/views.py | Python | gpl-3.0 | 112 |
class MainSystem:
# Array of registers
# Array of stage one chips
# Array of stage two chips
# Array of stage three chips
# Array of stage four chips
@classmethod
def construct_register_chips(self):
# Type: Register
# ID: U_0_010
# Name: Regist... | BenProjex/ArchProject | MainSystem.py | Python | gpl-3.0 | 7,490 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mySite.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
... | spa46/myDjango | manage.py | Python | bsd-3-clause | 804 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2011, Nicolas Clairon
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the abov... | aquavitae/mongokit-py3 | tests/test_versioned.py | Python | bsd-3-clause | 15,008 |
from __future__ import absolute_import
# Debug level. 0 is no debug, 1 is basic debugging, 2 is complex invariant checking
DEBUG = 1
ITERATIONS = 1
PRETTY_DISPLAY = 1
GENERATE_IMPORT_ERRS = 0
VERBOSE = 1
import _ast
import collections
import glob
import hashlib
import heapq
import os.path
import time
import tracebac... | kmod/icbd | icbd/type_analyzer/type_checker.py | Python | mit | 77,036 |
from unittest import TestCase
from hamcrest import *
from chapter10.exercise10_3_4 import compact_list_allocate_object, compact_list_free_object
from list_util import get_random_compact_list, get_multiple_array_list_keys, get_multiple_array_list_free_cells, \
assert_multiple_array_list_consistent, assert_compact_... | wojtask/CormenPy | test/test_chapter10/test_exercise10_3_4.py | Python | gpl-3.0 | 2,376 |
"""
Special functions used mainly to evaluate characteristic
functions of various distributions.
@authors : Daniel Csaba <daniel.csaba@nyu.edu>
Spencer Lyon <spencer.lyon@stern.nyu.edu>
@date : 2016-07-26
"""
from . import _rmath_ffi
from numba import vectorize, jit
from numba import cffi_support
cffi_s... | QuantEcon/Distributions.py | rvlib/specials.py | Python | gpl-2.0 | 1,486 |
#!/usr/bin/env python
# pip installs packages in editable mode using pip_install.py
#
# cryptography is currently using this script in their CI at
# https://github.com/pyca/cryptography/blob/a02fdd60d98273ca34427235c4ca96687a12b239/.travis/downstream.d/certbot.sh#L8-L9.
# We should try to remember to keep their repo up... | letsencrypt/letsencrypt | tools/pip_install_editable.py | Python | apache-2.0 | 629 |
# -*- coding: utf-8 -*-
# Copyright 2011 Takeshi KOMIYA
#
# 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 applica... | aboyett/blockdiag | src/blockdiag/plugins/__init__.py | Python | apache-2.0 | 1,527 |
import compiler
import re
def is_log_callfunc(n):
"""LOG.xxx('hello %s' % xyz) and LOG('hello')"""
if isinstance(n.parent, compiler.ast.Mod):
n = n.parent
if isinstance(n.parent, compiler.ast.CallFunc):
if isinstance(n.parent.node, compiler.ast.Getattr):
if isinstance(n.parent.... | yamahata/tacker | tools/i18n_cfg.py | Python | apache-2.0 | 3,488 |
# Copyright 2021 Google LLC
#
# 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, s... | googleapis/nodejs-redis | owlbot.py | Python | apache-2.0 | 939 |
#!/usr/bin/env python
"""
Copyright (c) 2020 Alex Forencich
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, merg... | alexforencich/xfcp | lib/eth/tb/eth_mac_1g_gmii/test_eth_mac_1g_gmii.py | Python | mit | 6,323 |
# Copyright 2016 Capital One Services, LLC
#
# 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... | siddartha1992/cloud-custodian | tools/c7n_mailer/tests/common.py | Python | apache-2.0 | 5,989 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('bulb', '0005_groups'),
]
operations = [
migrations.AddField(
model_name='session',
name='is_online',... | enjaz/enjaz | bulb/migrations/0006_online_sessions.py | Python | agpl-3.0 | 1,240 |
'''tests for the registry module'''
import pytest
from lima import exc, schema, registry
@pytest.fixture
def reg():
return registry.Registry()
# mock Schema class to register later on
class Schema:
pass
def test_register1(reg):
'''Test if mock Schema class can be registered without raising.'''
r... | b6d/lima | test/test_registry.py | Python | mit | 1,909 |
""" smashlib.plugins.cli_update
The handler for "smash --update". This will default to
using whatever branch is already checked out
"""
from fabric import api
from goulash.python import splitext, ops
from smashlib import get_smash
from smashlib.util import CLOpt
from smashlib.plugins import Plugin
from smash... | mattvonrocketstein/smash | smashlib/plugins/cli_update.py | Python | mit | 1,850 |
#! /usr/bin/env python
#-*- coding: utf-8 -*-
#################################################################
# Copyright (C) 2015 Sean Guo. All rights reserved.
#
# > File Name: < get_touch.py >
# > Author: < Sean Guo >
# > Mail: < iseanxp+code@gmail.com >
# > Creat... | SeanXP/Nao-Robot | python/touch/get_touch.py | Python | gpl-2.0 | 2,912 |
"""
OAuth backend for BitBucket
"""
import json
import logging
import requests
from oic.utils.authn.authn_context import UNSPECIFIED
from oic.oauth2.consumer import stateID
from satosa.backends.oauth import _OAuthBackend
from satosa.internal import AuthenticationInformation
logger = logging.getLogger(__name__)
cla... | SUNET/SATOSA | src/satosa/backends/bitbucket.py | Python | apache-2.0 | 3,385 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('rango', '0003_auto_20150408_1924'),
]
operations = [
migrations.AddField(
model_name='category',
nam... | mazulo/tango_with_django_project | rango/migrations/0004_category_slug.py | Python | mit | 444 |
from __future__ import absolute_import
from flask import request, Response
from changes.api.base import APIView
from changes.models.patch import Patch
class PatchDetailsAPIView(APIView):
def get(self, patch_id):
patch = Patch.query.get(patch_id)
if patch is None:
return '', 404
... | dropbox/changes | changes/api/patch_details.py | Python | apache-2.0 | 451 |
import web
from hashlib import md5
from markdown2 import markdown
from web import form
from models import Episode
from google.appengine.ext import db
from google.appengine.api.memcache import delete as mdel
import template
env = template.env
urls = (
'', 'resubmit',
'/', 'submit',
)
BLANK = '/image/so... | tokyo-jesus/indieinvasion.net | submit.py | Python | unlicense | 1,639 |
# Copyright 2020 Google LLC
#
# 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, ... | GoogleCloudPlatform/functions-framework-python | tests/test_functions/http_log_exception/main.py | Python | apache-2.0 | 995 |
from askmath.entities import TextMessage
from askmath.models.discipline import Discipline as DisciplineModel
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.utils.decorator... | saraivaufc/askMathPlus | askmath/views/manager/discipline/proxydiscipline.py | Python | gpl-2.0 | 4,939 |
from .prology import *
| mistasse/Prology | prology/__init__.py | Python | mit | 23 |
#!/usr/bin/env python
# Version 0.1
# NDVI automated acquisition and calculation by Vladyslav Popov
# Using landsat-util, source: https://github.com/developmentseed/landsat-util
# Uses Amazon Web Services Public Dataset (Lansat 8)
# Script should be run every day
from os.path import join, abspath, dirname, exis... | vladanti/ndvi_calc | ndvi.py | Python | gpl-3.0 | 4,318 |
#!/usr/bin/env python2.7
# uses python2-requests-2.2.1-1
import requests
import xml.etree.ElementTree
import bbs_io
import string
import re
#garbage Collection (Needed to Clear Memory!)
import gc
bbs = 'hTc'
usrname = u'mrmisticismo@hotmail.com'
pssword = u'******'
# Minus the header/Footer
real_limit = bbs_io.pyGe... | M-griffin/Enthral | src/scripts/onelinerz.py | Python | gpl-2.0 | 4,153 |
# -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
import re
from openerp import netsvc
from openerp.... | adhoc-dev/odoo-nautical | nautical/craft_brand.py | Python | agpl-3.0 | 689 |
# Author: Shao Zhang and Phil Saltzman
# Last Updated: 4/18/2005
#
# This tutorial shows how to use a sequence of textures on an object to
# achieve a specific effect. Popular uses of this technique are:
# -Animated sprites
# -Moving shadows
#
# This tutorial also demonstrates the billboard function which orients
# an ... | toontownfunserver/Panda3D-1.9.0 | samples/Texture-Swapping/Tut-Texture-Swapping.py | Python | bsd-3-clause | 8,401 |
# MIT License
#
# Copyright (c) 2018 chakki
#
# 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, merge, publi... | hankcs/HanLP | hanlp/metrics/chunking/sequence_labeling.py | Python | apache-2.0 | 14,144 |
""" Non-negative matrix factorization
"""
# Author: Vlad Niculae
# Lars Buitinck <L.J.Buitinck@uva.nl>
# Author: Chih-Jen Lin, National Taiwan University (original projected gradient
# NMF implementation)
# Author: Anthony Di Franco (original Python and NumPy port)
# License: BSD 3 clause
from __future__ ... | B3AU/waveTree | sklearn/decomposition/nmf.py | Python | bsd-3-clause | 19,415 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2012 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | kurkop/server-tools | __unported__/users_ldap_populate/model/populate_wizard.py | Python | agpl-3.0 | 1,830 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ***********************IMPORTANT NMAP LICENSE TERMS************************
# * *
# * The Nmap Security Scanner is (C) 1996-2013 Insecure.Com LLC. Nmap is *
# * also a registered trademark of Inse... | grongor/school_rfid | lib/nmap-6.40/zenmap/zenmapCore/Paths.py | Python | gpl-2.0 | 14,916 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obt... | plumgrid/plumgrid-nova | nova/tests/db/fakes.py | Python | apache-2.0 | 16,317 |
"""Utility code for constructing importers, etc."""
from ._bootstrap import module_for_loader
from ._bootstrap import set_loader
from ._bootstrap import set_package
from ._bootstrap import _resolve_name
def resolve_name(name, package):
"""Resolve a relative module name to an absolute one."""
if not... | ZerpaTechnology/AsenZor | static/js/brython/Lib/importlib/util.py | Python | lgpl-3.0 | 672 |
#!/usr/bin/env python
# Thu, 13 Mar 14 (PDT)
# ip6.py: Demonstrate IPv6 objects
# Copyright (C) 2017, Nevil Brownlee, U Auckland | WAND
import plt
import natkit as nk
from plt_testing import *
#ba = bytearray(b"\x10\x02\x20\x04\x30\x05\x40\x06")
ba = bytearray.fromhex(u"1002 2004 3005 4006")
test_print('', get_tag(... | nevil-brownlee/python-libtrace | test/v2-test-cases/test-u32.py | Python | gpl-3.0 | 1,751 |
################################################################################
# The Neural Network (NN) based Speech Synthesis System
# https://svn.ecdf.ed.ac.uk/repo/inf/dnn_tts/
#
# Centre for Speech Technology Research
# ... | ashmanmode/TTSDNNRepo | src/frontend/acoustic_composition.py | Python | apache-2.0 | 10,088 |
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2011,2012,2013,2014,2015,2016,2017 Contributor
#
# 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... | guillaume-philippon/aquilon | lib/aquilon/worker/commands/bind_feature.py | Python | apache-2.0 | 6,372 |
# Project imports
import NanoConfig.Index
import NanoConfig.Column
import NanoTypes
from NanoBlocks._VariableMemoryBlock import VariableMemoryBlock
class Config(VariableMemoryBlock):
# Class Attributes
name = None
columns = None
indices = None
rowSize = None
# VariableMemoryBlock definitions
... | warrenspe/NanoDB | NanoConfig/Table.py | Python | gpl-3.0 | 765 |
# -*- coding: utf8 -*-
'''
Класс регистра для остановки процессора.
'''
class ClsRegBP:
def __init__(self, adr_break=0, flag_act=0, adr_proc=0):
'''
adr_break -- aдрес, на который бряк
flag_act -- активность регистра
adr_proc -- куда перекинуть управление
'''
self.a... | prospero78/pyPC | pak_pc/pak_cpu/pak_reg/mod_reg_bp.py | Python | lgpl-3.0 | 1,036 |
# -*- coding: utf-8 -*-
"""Tools to deal with multi-processing."""
import multiprocessing
def batch_job(producer, consumer, chunksize=10000, processes=None, consumer_args={}):
"""
Call consumer on everything that is produced from producer, using a pool.
Arguments:
producer (func/list) -- Produces the... | lrvick/synt | synt/utils/processing.py | Python | agpl-3.0 | 2,014 |
# pylint: disable=E0611
from nose.tools import assert_equal, assert_is_not_none
from selenium.webdriver.support.wait import TimeoutException
from ..util import get_real_siblings
step_matcher("re")
@then(ur"the selection is wrapped in a new element\.?")
def step_impl(context):
util = context.util
item = con... | lddubeau/wed | selenium_test/steps/transform.py | Python | mpl-2.0 | 4,774 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import mmap
import re
import collections
import math
import detectlanguage
import codecs
detectlanguage.configuration.api_key = "d6ed8c76914a9809b58c2e11904fbaa3"
class Analyzer:
def __init__(self, passwd):
self.evaluation = {}
self._passwd = passwd
... | haastt/analisador | src/Analyzer.py | Python | mit | 8,325 |
# -*- coding: utf-8 -*-
"""
d ln[S(t)] = (r(t)-0.5 sigma(t))dt + sqrt(sigma(t)) dW_S
d sigma(t) = epsilon(sigma_mean-sigma(t))dt + omega sqrt(sigma(t)) dW_Sigma
d x(t) = -a x(t) dt + sigma_rate_short dW_x
d y(t) = -b y(t) dt + sigma_rate_long dW_y
r(t) = x(t) + y(t) + phi(t)
<dW_x, dW_y) = rho_xy dt
<dW_S, dW_sigma> =... | bramjochems/BJFinanceLib | BJFinanceLib/simulation/hullwhiteheston.py | Python | gpl-3.0 | 15,005 |
# Copyright (c) 2010-2012 OpenStack Foundation
#
# 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 agree... | revoer/keystone-8.0.0 | swift/cli/ringbuilder.py | Python | apache-2.0 | 49,956 |
#!/usr/bin/python
from distutils.core import setup, Extension
setup(name='pypdlib',
version='0.1',
py_modules = [
'pylibpd'
],
ext_modules = [
Extension("_pylibpd",
define_macros = [
('PD', 1),
('HAVE_UNISTD_H', 1),
... | jconst/SoundDrop | SoundDrop/libpd/python/setup.py | Python | mit | 4,445 |
# Copyright (c) 2015 Uber Technologies, Inc.
#
# 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, merge, publ... | Willyham/tchannel-python | tchannel/tornado/connection.py | Python | mit | 21,958 |
"""terminalcommand.py -- A minimal interface to Terminal.app.
To run a shell command in a new Terminal.app window:
import terminalcommand
terminalcommand.run("ls -l")
No result is returned; it is purely meant as a quick way to run a script
with a decent input/output window.
"""
#
# This module is a fairly s... | xbmc/atv2 | xbmc/lib/libPython/Python/Lib/plat-mac/terminalcommand.py | Python | gpl-2.0 | 1,429 |
__author__ = 'Kirsten White'
if __name__ == "__main__":
print("bless up")
| kaw3ut/cs3240-labdemo | anothaone.py | Python | mit | 76 |
from lbrynet.core.Strategy import get_default_strategy, OnlyFreeStrategy
from lbrynet import conf
from decimal import Decimal
class BasePaymentRateManager(object):
def __init__(self, rate=None, info_rate=None):
self.min_blob_data_payment_rate = rate if rate is not None else conf.settings['data_rate']
... | zestyr/lbry | lbrynet/core/PaymentRateManager.py | Python | mit | 4,661 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import codecs
from setuptools import setup, find_packages
from axes import get_version
setup(
name='django-axes',
version=get_version(),
description='Keep track of failed login attempts in Django-powered sites.',
l... | kawamon/hue | desktop/core/ext-py/django-axes-4.5.4/setup.py | Python | apache-2.0 | 2,056 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# 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 ... | EricssonResearch/calvin-base | calvin/Tools/www/csweb.py | Python | apache-2.0 | 1,951 |
# -*- coding: utf-8 -*-
"""
tmdbsimple.movies
~~~~~~~~~~~~~~~~~
This module implements the Movies, Collections, Companies, Keywords, and
Reviews functionality of tmdbsimple.
Created by Celia Oakley on 2013-10-31.
:copyright: (c) 2013-2020 by Celia Oakley
:license: GPLv3, see LICENSE for more details
"""
from .base ... | pymedusa/SickRage | ext/tmdbsimple/movies.py | Python | gpl-3.0 | 19,588 |
from twisted.plugin import IPlugin
from twisted.words.protocols import irc
from txircd.module_interface import IModuleData, ModuleData
from zope.interface import implementer
from typing import Callable, List, Optional, Tuple
# Numerics and names are taken from the IRCv3.1 SASL specification at http://ircv3.net/specs/e... | Heufneutje/txircd | txircd/modules/core/accountdata.py | Python | bsd-3-clause | 1,023 |
# -*- coding: utf-8 -*-
import sys
import json
import re
import copy
import jieba
import jieba.posseg as pseg
from server.lib import nlp_process, jieba_process
from service_call import connect_turing, connect_rest_api
reload(sys)
sys.setdefaultencoding('utf-8')
def rule_based_intent_recognition(sentence):
se... | xiaotianyi/INTELLI-City | server/service/intent_recgnition.py | Python | mit | 2,494 |
from __future__ import absolute_import
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from allauth.socialaccount.helpers import render_authentication_error, send_social_connection_error_email
from allauth.socialaccount.providers.oauth.client import (OAuthClient,
... | joebos/django-allauth | allauth/socialaccount/providers/oauth/views.py | Python | mit | 3,898 |
#!/usr/bin/env python
"""
Copyright (C) 2015 Louis Dijkstra
This file is part of gonl-sv
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 lat... | louisdijkstra/gonl-sv | back-up/version4/GWASCatalogueReader.py | Python | gpl-3.0 | 2,330 |
import numpy as np
import matplotlib.pyplot as plt
def f(x, r):
"""Discrete logistic equation with parameter r"""
return r*x*(1-x)
if __name__ == '__main__':
# initial condition for x
ys = []
rs = np.linspace(0, 4, 400)
#rs = [1+ 2*np.sqrt(2)]
# Loop through `rs`. `r` is assigned the valu... | wesleybowman/chaos | chao2.py | Python | mit | 1,527 |
# Copyright 2009-2015 MongoDB, Inc.
#
# 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 writin... | gormanb/mongo-python-driver | gridfs/__init__.py | Python | apache-2.0 | 14,740 |
from django.conf.urls import patterns, url
from django.template.response import TemplateResponse
from django.views.generic import TemplateView, RedirectView
from myapp import settings
urlpatterns = patterns(
'',
url(r'^$', TemplateView.as_view(template_name='index.html'), name="home"),
#url(r'^api/', inclu... | howieweiner/django-angular-boilerplate | myapp/urls.py | Python | mit | 744 |
from os import system
def tts(utterance):
system('say ' + utterance) | linnnh/Tenkiba | tts.py | Python | mit | 71 |
from test_delete import *
from test_openid import *
from test_edit import *
| cc-archive/commoner | src/commoner/profiles/tests/__init__.py | Python | agpl-3.0 | 76 |
import sys
def correct_parens(s):
s = s.strip()
l = 0
r = 0
for c in s:
if c == '(':
l += 1
elif c == ')':
r += 1
paren_diff = l-r
if paren_diff < 0:
# print('Too many right parens!')
# print(l)
# print(r)
# print(s + '|')
s = s[:paren_diff]
# print(s + '|')
# pri... | modelblocks/modelblocks-release | resource-childes/scripts/get_linetrees.py | Python | gpl-3.0 | 748 |
# -*- coding: utf-8 -*-
from distutils.core import setup
setup(
name='user-agents',
version='0.3.2',
author='Selwin Ong',
author_email='selwin.ong@gmail.com',
packages=['user_agents'],
url='https://github.com/selwin/python-user-agents',
license='MIT',
description='A library to identify ... | zpzgone/python-user-agents | setup.py | Python | mit | 1,248 |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_HTTPError
from ..utils import (
float_or_none,
parse_iso8601,
str_or_none,
try_get,
unescapeHTML,
url_or_none,
ExtractorError,
)
class RteBaseIE(InfoExtractor):
def _real_extract(s... | valmynd/MediaFetcher | src/plugins/youtube_dl/youtube_dl/extractor/rte.py | Python | gpl-3.0 | 5,026 |
from flask_login import current_user
import psycopg2 as dbapi2
from flask import current_app, request
from bug import *
class Buglist:
def __init__(self):
self.bugs = {}
self.last_key = 0
def getid(self):
connection = dbapi2.connect(current_app.config['dsn'])
cursor = connectio... | itucsdb1616/itucsdb1616 | buglist.py | Python | gpl-3.0 | 4,878 |
import argparse
import datetime
from distutils.core import Command
from distutils.errors import DistutilsOptionError
class BuildManPage(Command):
# Start ignoring LineContinuationBear
"""
Add a ``build_manpage`` command to your setup.py.
To use this Command class add a command to call this class::
... | jayvdb/coala | coalib/misc/BuildManPage.py | Python | agpl-3.0 | 7,352 |
"""
Test widget discovery
"""
import logging
import unittest
from ..discovery import WidgetDiscovery, widget_descriptions_from_package
from ..description import CategoryDescription, WidgetDescription
from ..utils import category_from_package_globals
class TestDiscovery(unittest.TestCase):
def setUp(self):
... | ales-erjavec/orange-canvas | orangecanvas/registry/tests/test_discovery.py | Python | gpl-3.0 | 2,314 |
"""
Copyright (c) 2016-2017 Dell Inc. or its subsidiaries. All Rights Reserved.
This file contains (very very crude, at the moment!) self
tests of the logging infrastructure.
"""
from flogging.infra_logging import logger_get_logging_dir
import os
from unittest import TestCase
class TestInfraLogging(TestCase):
de... | johren/RackHD | test/stream-monitor/test/test_infra_logging.py | Python | apache-2.0 | 1,885 |
"""utility methods"""
def impl_key_dict(value, priority=1):
"""to reduce duplicate code in configs.py and handcar_configs.py"""
return {
'syntax': 'STRING',
'displayName': 'Implementation Key',
'description': 'Implementation key used by Runtime for class loading',
'values': [
... | mitsei/dlkit | dlkit/runtime/utilities.py | Python | mit | 386 |
#!/usr/bin/python
import fileinput
import string
import sys
import os
mpi = True
if ( mpi ):
print 'Using MPI'
else:
print 'Not using MPI'
# BGP
fortran_compiler = 'bgxlf_r'
fortran_opt_flags = '-O5 -g -qipa -qsmp=omp -qarch=450d -qtune=450 -qprefetch -qunroll=yes -qmaxmem=-1 -qextname -qalias=noaryovrlp:nop... | jeffhammond/spaghetty | branches/old/python/archive/build_executables_superflush_noflop.py | Python | bsd-2-clause | 17,322 |
# Python implementation of the MySQL client-server protocol
# http://forge.mysql.com/wiki/MySQL_Internals_ClientServer_Protocol
try:
import hashlib
sha_new = lambda *args, **kwargs: hashlib.new("sha1", *args, **kwargs)
except ImportError:
import sha
sha_new = sha.new
import socket
try:
import ss... | pouyana/teireader | webui/gluon/contrib/pymysql/connections.py | Python | mit | 37,363 |
import sys
import time
import numpy as np
from scipy.sparse import isspmatrix_coo, isspmatrix_csc
from lbfgs import LBFGS, LBFGSError # pip install pylbfgs
def risk_per_user(v, Wu, mu, X, Yu, Pu, Qu, p, N):
"""
Empirical risk of bottom version of p-classification loss
Input:
- W: cur... | chengsoonong/digbeta | dchen/music/src/models/MTC.py | Python | gpl-3.0 | 7,546 |
from django.contrib.staticfiles.storage import ManifestStaticFilesStorage
from whitenoise.storage import HelpfulExceptionMixin, CompressedStaticFilesMixin
class PatchedManifestStaticFilesStorage(ManifestStaticFilesStorage):
"""
A static file system storage backend which also saves
hashed copies of the file... | metakermit/django-spa | spa/storage.py | Python | mit | 1,129 |
# -*- coding: utf-8 -*-
import time
from datetime import datetime
from openerp.osv import fields, osv, orm
from openerp.tools.translate import _
from openerp import tools
import openerp.addons.decimal_precision as dp
class account_move_line(osv.osv):
_inherit = "account.move.line"
def _net(self, cr, uid, i... | levkar/odoo-addons | account_partner_balance/account_move_line.py | Python | agpl-3.0 | 1,130 |
from setuptools import setup, find_packages, Extension
from Cython.Distutils import build_ext
from Cython.Build import cythonize
# for unix
cec2013single = Extension("cec2013single.cec2013",
["cec2013single/cec2013.pyx", "cec2013single/cec2013_func.c"],
libraries=["m"]) # Unix-like specific... | yyamnk/cec2013single | setup.py | Python | gpl-3.0 | 1,178 |
# -*- coding: utf-8 -*-
"""
Copyright (c) 2015 Federico Vaga <federico.vaga@gmail.com>
License GNU Public License v3
"""
from ConfigParser import ConfigParser
import toggl
import os
class PlasmogglConfigManager():
PLASMOGGL_CONFIG_FILE = "~/.plasmogglcfg"
def __init__(self):
# Retreive configuration... | FedericoVaga/plasmoggl | contents/code/plasmoggl_config_manager.py | Python | gpl-3.0 | 3,845 |
# Fallout password terminal challenge
# intro message
print('''
Welcome to the Fallout Terminal Management System.
Details about the services offered by this Terminal are listed below.
Have a nuclear day!
Mushroom Corp. Security Systems.
==========================================... | rosswd/fallout-pwd | fallout.py | Python | mit | 3,846 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.