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 |
|---|---|---|---|---|---|
"""NCover uncovered lines collector."""
from .base import NCoverCoverageBase
class NCoverUncoveredLines(NCoverCoverageBase):
"""Collector to get the uncovered lines.
Since NCover doesn't report lines, but sequence points, we use those.
See http://www.ncover.com/blog/code-coverage-metrics-sequence-point-... | ICTU/quality-time | components/collector/src/source_collectors/ncover/uncovered_lines.py | Python | apache-2.0 | 376 |
import numpy as np
import cv2
class Utility:
def __init__(self, datasets, sess, nClasses, x, y_, keep_prob):
self.nClasses = nClasses
self.datasets = datasets
self.sess = sess
self.x = x
self.y_ = y_
self.keep_prob = keep_prob
def draw(self, pool, w, h, num_rows, num_cols, pr... | andpol5/whaleDetector | alphaWhales/utilities.py | Python | mit | 2,739 |
from channels import Channel,Group
from channels.sessions import channel_session, enforce_ordering
from channels.auth import channel_session_user, channel_session_user_from_http
from room.models import RoomMember
from core.models import Reponse,Question
from django.core import serializers
from django.contrib.auth.mode... | batebates/L3ProjetWeb | BDR/room/consumers.py | Python | mit | 5,488 |
import pymel.core as pm
import logging
log = logging.getLogger("ui")
class BaseTemplate(pm.ui.AETemplate):
def addControl(self, control, label=None, **kwargs):
pm.ui.AETemplate.addControl(self, control, label=label, **kwargs)
def beginLayout(self, name, collapse=True):
pm.ui.AETe... | haggi/OpenMaya | src/mayaToLux/mtlu_devmodule/scripts/Lux/AETemplate/AEluxBlender_distortednoiseTemplate.py | Python | mit | 1,781 |
#! /usr/bin/env python
"""
Sort lines of a file according to the 1st column separated by tab.
"""
import sys
if len(sys.argv) != 2:
print "USAGE: " + sys.argv[0] + " [file-name]"
quit()
file = open(sys.argv[1], 'r');
lines = []
try:
for line in file:
lines.append(line.split('\t')[0])
lines.sort()
for... | basicthinker/Cinquain-Delta | util/sort.py | Python | apache-2.0 | 375 |
# encoding=utf-8
'''Application support.'''
import gettext
import logging
import sys
from http.cookiejar import CookieJar
from wpull.application.tasks.conversion import LinkConversionSetupTask, \
LinkConversionTask, QueuedFileSource
from wpull.application.tasks.database import DatabaseSetupTask
from wpull.applicat... | chfoo/wpull | wpull/application/builder.py | Python | gpl-3.0 | 9,288 |
#!/usr/bin/py.test
import ctypes as c
import curve25519
import random
import ecdsa
import hashlib
import binascii
import os
import pytest
def bytes2num(s):
res = 0
for i, b in enumerate(reversed(bytearray(s))):
res += b << (i * 8)
return res
curves = {
'nist256p1': ecdsa.curves.NIST256p,
... | jhoenicke/trezor-crypto | test_curves.py | Python | mit | 12,370 |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
"""This script automates testing of insane_striping algorithms.
You should fill configuration file with your own values,then start this script
as 'python parse.py <config>'. If you test LRC, make sure that stripe-searcher
is in './searcher' catalogue.
Results of tests will be c... | raidixlab/insane_striping | parse.py | Python | gpl-2.0 | 10,189 |
# -*- coding: utf-8 -*-
try:
from fcntl import ioctl
from termios import TIOCGWINSZ
except ImportError: # on windows: cannot have this
ioctl = None
TIOCGWINSZ = None
import struct
import sys
from .log import cprint, logger, sprintf
from .characters import CHARACTERS
from .yamlmgr import yamler
from .... | naparuba/opsbro | opsbro/cli_display.py | Python | mit | 17,125 |
"""Module to create damage curves from point data and additional logging
utils relevant to impact_functions.
"""
import numpy
from safe.common.interpolation1d import interpolate1d
class Damage_curve:
"""Class for implementation of damage curves based on point data
"""
def __init__(self, data):
... | ingenieroariel/inasafe | safe/impact_functions/utilities.py | Python | gpl-3.0 | 2,460 |
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='django-pipstatus',
# Versions should compl... | soerenbe/django-pipstatus | setup.py | Python | gpl-2.0 | 3,436 |
GEO_INTERFACE_MARKER = "__geo_interface__"
def is_mapping(ob):
return hasattr(ob, "__getitem__")
def to_mapping(ob):
if hasattr(ob, GEO_INTERFACE_MARKER):
candidate = ob.__geo_interface__
candidate = to_mapping(candidate)
else:
candidate = ob
if not is_mapping(candidate):
... | skitazaki/jpgridmap | server/geojson/mapping.py | Python | apache-2.0 | 1,326 |
import codecs
input_filename = '/home/jittat/mydoc/directadm53/payment/assignment.csv'
quota_filename = '/home/jittat/mydoc/directadm53/payment/quota.txt'
output_filename = '/home/jittat/mydoc/directadm53/payment/assignment-added.csv'
def read_quota():
q_data = {
'nat_id': {},
'firstname': {},
... | jittat/ku-eng-direct-admission | scripts/filter_quota.py | Python | agpl-3.0 | 1,880 |
# Copyright 2019 Zadara Storage, Inc.
# Originally authored by Jeremy Brown - https://github.com/jwbrown77
#
# 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... | zadarastorage/zadarapy | zadarapy/vpsa/snapshot_policies.py | Python | apache-2.0 | 14,127 |
#!/usr/bin/env python
"""This script solves the Project Euler problem "Smallest multiple". The
problem is: What is the smallest positive number that is evenly divisible by
all of the numbers from 1 to 20?
"""
import argparse
import math
def main(args):
"""Smallest multiple"""
multiple = 1
primes = get... | iansealy/projecteuler | optimal/5.py | Python | gpl-3.0 | 1,354 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import sys
import time
from collections import OrderedDict
from jsonselect import jsonselect
DEBUG = False
UNSPECIFIED = 0
KEEP = 1
DELETE = 2
def selector_to_ids(selector, obj, mode):
def bail_on_match(obj, matches):
return matches
bail_f... | Digitalxero/pyjsonselect | cli.py | Python | apache-2.0 | 5,279 |
# -*- coding: utf-8 -*-
import sys
import csv
import pyley # https://github.com/ziyasal/pyley
reload(sys)
sys.setdefaultencoding('utf-8')
csv.field_size_limit(sys.maxsize)
NAME = "http://www.w3.org/2000/01/rdf-schema#label"
ALIAS = "http://rdf.basekb.com/ns/common.topic.alias"
ALIAS_PATTERN = "\"%s\"@en"
TYPE = "ht... | postfix/ensu | preprocessing/match_politicians.py | Python | mit | 2,725 |
import _plotly_utils.basevalidators
class IdsValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(self, plotly_name="ids", parent_name="treemap", **kwargs):
super(IdsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
anim=kw... | plotly/python-api | packages/python/plotly/plotly/validators/treemap/_ids.py | Python | mit | 475 |
'''
Created on 2-14-2016
@author: Wuga
'''
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(10)
plt.plot(x, x)
plt.plot(x, 2 * x)
plt.plot(x, 3 * x)
plt.plot(x, 4 * x)
plt.show() | wuga214/FullyConnectedDeepNeuralNetwork | ANN/src/experiments/test.py | Python | mit | 198 |
import json
from allauth.socialaccount.providers.oauth.client import OAuth
from allauth.socialaccount.providers.oauth.views import (OAuthAdapter,
OAuthLoginView,
OAuthCallbackView)
from .provider import B... | agconti/njode | env/lib/python2.7/site-packages/allauth/socialaccount/providers/bitbucket/views.py | Python | bsd-3-clause | 1,712 |
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
# Examples:
# url(r'^$', 'demo.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
url(r'^api/', include('api.ur... | pombredanne/rest-framework | demo/demo/urls.py | Python | mit | 376 |
# -*- coding: utf-8 -*-
#
# AWL simulator - symbol table parser
#
# Copyright 2014-2015 Michael Buesch <m@bues.ch>
#
# 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 Licen... | gion86/awlsim | awlsim/core/symbolparser.py | Python | gpl-2.0 | 13,818 |
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from .code_generator_info import CodeGeneratorInfo
from .composition_parts import WithCodeGeneratorInfo
from .composition_parts import WithComponent
from .co... | scheib/chromium | third_party/blink/renderer/bindings/scripts/web_idl/constant.py | Python | bsd-3-clause | 2,792 |
# Copyright 2016 Google Inc. 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 required by applicable law or a... | turbomanage/training-data-analyst | courses/dev-depl-windows/aspnet-core/labinfra/common/software_status.py | Python | apache-2.0 | 6,047 |
#
# 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
# ... | takeshineshiro/heat | heat/tests/test_os_database.py | Python | apache-2.0 | 32,292 |
class ProcessRunningError(Exception):
pass
class ProcessNotStartingError(Exception):
pass
| Parsely/testinstances | testinstances/exceptions.py | Python | apache-2.0 | 99 |
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2015 Michal Čihař <mcihar@suse.cz>
#
# This file is part of python-suseapi
# <https://github.com/openSUSE/python-suseapi>
#
# 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 F... | openSUSE/python-suseapi | suseapi/browser.py | Python | gpl-3.0 | 4,951 |
from django.conf.urls.defaults import patterns, url
from ummeli.vlive.community import views
from django.contrib.auth.decorators import login_required
from ummeli.vlive.utils import pin_required
from django.views.generic.base import TemplateView
urlpatterns = patterns('',
url(r'^jobs/$', views.community_jobs, nam... | praekelt/ummeli | ummeli/vlive/community/urls.py | Python | bsd-3-clause | 778 |
# File name: video.py
import kivy
kivy.require('1.9.0')
from kivy.uix.video import Video as KivyVideo
from kivy.properties import ObjectProperty
from kivy.factory import Factory
from kivy.lang import Builder
Builder.load_file('video.kv')
class Video(KivyVideo):
image = ObjectProperty(None)
def on_state(se... | pimier15/PyGUI | Kivy/Kivy/Bk_Interractive/sample/Chapter_06_code/02 - AsyncImage - creating a cover for the video/video.py | Python | mit | 997 |
import os
import os.path
import numpy
from numpy.distutils.misc_util import Configuration
from sklearn._build_utils import get_blas_info
def configuration(parent_package="", top_path=None):
config = Configuration("metrics", parent_package, top_path)
cblas_libs, blas_info = get_blas_info()
if os.name ==... | valexandersaulys/airbnb_kaggle_contest | venv/lib/python3.4/site-packages/sklearn/metrics/setup.py | Python | gpl-2.0 | 1,024 |
#!/usr/bin/env python3
import randopt as ro
@ro.cli
def test1(arg1=20, arg2='name', arg3=1.23):
print('test1')
print('arg1', arg1)
print('arg2', arg2)
print('arg3', arg3)
@ro.cli
def test2(arg1=20, arg2='name', arg3=1.23):
"""
The docstring serves as help when using the --help flag.
Ar... | seba-1511/randopt | examples/command_example.py | Python | apache-2.0 | 1,067 |
from setuptools import setup
setup(
name='neo4django',
version='0.1.8',
author='Matt Luongo',
author_email='mhluongo@gmail.com',
description='A Django/Neo4j ORM layer.',
license = 'GPL',
url = "https://neo4django.readthedocs.org/en/latest/",
packages=['neo4django','neo4django.graph_auth... | scholrly/neo4django | setup.py | Python | gpl-3.0 | 1,480 |
import os, sys, subprocess, getopt
from bs4 import BeautifulSoup as BS
import image_scraper as IS
import requests
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
#... | amy3478/matin_email | src/etc/scraper.py | Python | mit | 3,973 |
# Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... | StackStorm/st2 | st2reactor/st2reactor/container/hash_partitioner.py | Python | apache-2.0 | 5,032 |
# Copyright (c) 2007-2009 Citrix Systems 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; version 2 only.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ... | Chunjie/xsconsole | XSConsoleCurses.py | Python | gpl-2.0 | 12,430 |
#!/usr/bin/env python
import argparse
import datetime
from nltk.translate import bleu_score
import numpy
import progressbar
import six
import chainer
from chainer.backends import cuda
import chainer.functions as F
import chainer.links as L
from chainer import training
from chainer.training import extensions
UNK = ... | ronekko/chainer | examples/seq2seq/seq2seq.py | Python | mit | 14,495 |
import maya.cmds as cmds
import pymel.all as pm
import traceback
controlCurve = pm.PyNode('control_curve')
## to make a numerical 'floating point'
## attribute, we use at='double', keyable=True
controlCurve.addAttr( 'allCurl', at='double', keyable=True )
controlCurve.addAttr( 'pointerAllCurl', at='double', keyable... | joetainment/mmmmtools | MmmmToolsMod/script_file_runner_scripts/hand_auto_rigging.py | Python | gpl-3.0 | 5,762 |
"""
Serve HTML5 video sources for acceptance tests
"""
from SimpleHTTPServer import SimpleHTTPRequestHandler
from .http import StubHttpService
from contextlib import contextmanager
import os
from logging import getLogger
LOGGER = getLogger(__name__)
class VideoSourceRequestHandler(SimpleHTTPRequestHandler):
"""
... | louyihua/edx-platform | common/djangoapps/terrain/stubs/video_source.py | Python | agpl-3.0 | 1,368 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('MSG', '0020_student_marks_gp_id'),
]
operations = [
migrations.RemoveField(
model_name='student_marks',
... | rajeev001114/Grade-Recording-System | project/MSG/migrations/0021_remove_student_marks_gp_id.py | Python | gpl-3.0 | 355 |
import datetime
from cerberus import Validator
import requests
AUTH_HEADER = 'X-Pblog-Token'
class ClientException(Exception):
pass
class AuthenticationError(ClientException):
def __init__(self, code):
super().__init__("401 response (%s)" % code)
class UnexpectedResponse(ClientException):
d... | Nicals/pblog | pblog/client.py | Python | mit | 3,938 |
"""
Command line 'tool' to search for strings :)
Danger: use at your own risk!
Written just for fun.
"""
import argparse
import os
import sys
def main():
parser = setup_parser()
args = parser.parse_args()
print 'About to search for: %s' % args.term
if not args.target:
print ('Sorry, have... | oldhill/halloween | python-sys-stuff/grep.py | Python | mit | 1,367 |
""" Python 'utf-16-be' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
encode = codecs.utf_16_be_encode
def decode(input, errors='strict'):
return codecs.utf_16_be_decode(input, errors, True)
class... | zwChan/VATEC | ~/eb-virt/Lib/encodings/utf_16_be.py | Python | apache-2.0 | 1,079 |
#
# This file is part of Dragonfly.
# (c) Copyright 2007, 2008 by Christo Butcher
# Licensed under the LGPL.
#
# Dragonfly is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the L... | Versatilus/dragonfly | dragonfly/grammar/elements_compound.py | Python | lgpl-3.0 | 9,034 |
from ahkab.testing import NetlistTest
from ahkab import options
options.plotting_show_plots = False
def test():
nt = NetlistTest('sffmckt')
nt.setUp()
nt.test()
nt.tearDown()
test.__doc__ = "SFFM circuit test"
if __name__ == '__main__':
nt = NetlistTest('sffmckt')
nt.setUp()
nt.test()
| ahkab/ahkab | tests/sffmckt/test_sffmckt.py | Python | gpl-2.0 | 317 |
# Copyright (c) 2015, Michael Boyle
# See LICENSE file for details: <https://github.com/moble/scri/blob/master/LICENSE>
import pytest
import os.path
import numpy as np
import h5py
import scri
import scri.SpEC
# NOTE: if test_file_io() comes after test_NRAR_extrapolation() in this file, then the
# output of the latter... | moble/scri | tests/test_SpEC.py | Python | mit | 3,584 |
"""Pexpect is a Python module for spawning child applications and controlling
them automatically. Pexpect can be used for automating interactive applications
such as ssh, ftp, passwd, telnet, etc. It can be used to a automate setup
scripts for duplicating software package installations on different servers. It
can be u... | LukeCarrier/py3k-pexpect | pexpect.py | Python | mit | 76,682 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | apache/nuvem | nuvem-parallel/nuvem/fbprofile.py | Python | apache-2.0 | 877 |
from django.conf.urls import url
from . import views
urlpatterns = [
url('^draugiem/login/$', views.login, name="draugiem_login"),
url('^draugiem/callback/$', views.callback, name='draugiem_callback'),
]
| okwow123/djangol2 | example/env/lib/python2.7/site-packages/allauth/socialaccount/providers/draugiem/urls.py | Python | mit | 215 |
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'Fetch' implementations
Classes for obtaining upstream sources for the
BitBake build tools.
"""
# Copyright (C) 2003, 2004 Chris Larson
#
# This program is free software; you can redistribute it and/or modify
# it un... | hulifox008/bitbake | lib/bb/fetch/__init__.py | Python | gpl-2.0 | 26,984 |
"""bookmark.py - Bookmarks handler (including menu and dialog)."""
import os
import cPickle
import gtk
import gobject
import constants
import constants
_pickle_path = os.path.join(constants.DATA_DIR, 'bookmarks.pickle')
class BookmarksMenu(gtk.Menu):
"""BookmarksMenu extends gtk.Menu with convenience methods... | bloopletech/Comix | src/bookmark.py | Python | gpl-2.0 | 12,064 |
# $Id: $
#
# Test configuration parameters
#
class TestConfig:
#hostname = "zoo-admiral-behav.zoo.ox.ac.uk"
#hostname = "zoo-admiral-silk.zoo.ox.ac.uk"
#hostname = "zoo-admiral-devel.zoo.ox.ac.uk"
hostname = "zoo-admiral-ibrg.zoo.ox.ac.uk"
#hostname = "z... | tectronics/admiral-jiscmrd | test/FileShare/tests/TestConfig.py | Python | mit | 984 |
from django import http
from django.shortcuts import render, redirect
from django.template import (loader, TemplateDoesNotExist)
from django.views.decorators.csrf import requires_csrf_token
from django.core.urlresolvers import reverse
from lib.templatetags.base_extras import set_notification
import smtplib
from datetim... | vecnet/vnetsource | lib/views/error_views.py | Python | mpl-2.0 | 3,043 |
# -*- coding: utf-8 -*-
#
# move.py - move commander module
#
# Copyright (C) 2010 - Jesse van den Kieboom
#
# 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,... | sphax3d/gedit-plugins | plugins/commander/modules/move.py | Python | gpl-2.0 | 3,728 |
# -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# 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 above copyright notice, this
... | vlegoff/tsunami | src/primaires/communication/contextes/__init__.py | Python | bsd-3-clause | 1,671 |
"""
Courseware views functions
"""
import logging
import urllib
import json
from collections import defaultdict
from django.utils.translation import ugettext as _
from django.conf import settings
from django.core.context_processors import csrf
from django.core.exceptions import PermissionDenied
from django.core.urlr... | hkawasaki/kawasaki-aio8-1 | lms/djangoapps/courseware/views.py | Python | agpl-3.0 | 32,876 |
import os, requests, json
from flask import Flask, Response, request, url_for, send_from_directory, redirect, render_template
import plivoxml, plivo
import urllib
app = Flask(__name__, static_url_path='')
messages = {}
@app.route('/')
def index():
return send_from_directory('static', 'index.html')
@app.route('/... | shaoandrew/TextToCall | app.py | Python | mit | 1,703 |
# -*- coding: utf-8 -*-
#
# docxtemplater documentation build configuration file, created by
# sphinx-quickstart on Thu May 8 11:17:49 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.... | fponticelli/docxtemplater | docs/source/conf.py | Python | gpl-3.0 | 8,332 |
# This file contains code samples from the book:
# "Neural Networks and Deep Learning".
"""
mnist_loader
~~~~~~~~~~~~
A library to load the MNIST image data. For details of the data
structures that are returned, see the doc strings for ``load_data``
and ``load_data_wrapper``. In practice, ``load_data_wrapper`` is ... | avicorp/firstLook | src/mnist_loader.py | Python | apache-2.0 | 4,390 |
# Copyright (c) 2013-2015 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr>
# Copyright (c) 2013-2014 Google, Inc.
# Copyright (c) 2015 Dmitry Pribysh <dmand@yandex.ru>
# Copyright (c) 2015-2016 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2016 Yannack <yannack@users.noreply.github.com>
# Licensed under the GP... | arju88nair/projectCulminate | venv/lib/python3.5/site-packages/pylint/test/unittest_checker_base.py | Python | apache-2.0 | 12,800 |
# coding=utf-8
# Author: Idan Gutman
#
# URL: https://sickrage.github.io
#
# 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, or
# (a... | p0psicles/SickRage | sickbeard/providers/scenetime.py | Python | gpl-3.0 | 6,139 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Cloudscaling Group, 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/LI... | DPaaS-Raksha/raksha | raksha/openstack/common/rpc/matchmaker.py | Python | apache-2.0 | 12,220 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: POGOProtos/Map/Fort/FortModifier.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf im... | Mickey32111/pogom | pogom/pgoapi/protos/POGOProtos/Map/Fort/FortModifier_pb2.py | Python | mit | 3,308 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'qt/misc.ui'
#
# Created: Fri Dec 12 11:45:10 2014
# by: pyside-uic 0.2.15 running on PySide 1.2.2
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, QtGui
class Ui_Misc(object):
def setupUi(self, M... | MusculoskeletalAtlasProject/mapclient-src | mapclient/tools/pluginwizard/ui_misc.py | Python | gpl-3.0 | 2,843 |
from thespian.actors import ValidatedSource, ActorSystemMessage
class TestUnitValidatedSourceMsg(object):
def test_equality(self):
m1 = ValidatedSource(1, 2)
assert m1 == ValidatedSource(1, 2)
assert m1 == ValidatedSource(1, 4)
assert m1 == ValidatedSource(1, 'nine')
m2 = ... | kquick/Thespian | thespian/test/test_msg_ValidatedSource.py | Python | mit | 1,429 |
import re
from itertools import chain
from dulwich import objects
from subprocess import Popen, PIPE
from vcs.conf import settings
from vcs.backends.base import BaseChangeset, EmptyChangeset
from vcs.exceptions import (
RepositoryError, ChangesetError, NodeDoesNotExistError, VCSError,
ChangesetDoesNotExistErro... | codeinn/vcs | vcs/backends/git/changeset.py | Python | mit | 19,413 |
#!/usr/bin/env python
"""
The LibVMI Library is an introspection library that simplifies access to
memory in a target virtual machine or in a file containing a dump of
a system's physical memory. LibVMI is based on the XenAccess Library.
Copyright 2011 Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000... | jie-lin/libvmi | tools/pyvmi/examples/process-list.py | Python | gpl-3.0 | 1,982 |
#!/usr/bin/env python3
import os
import time
from configparser import SafeConfigParser
from pathlib import Path
from flask import Flask
from flask import render_template, make_response, request, abort
import opentracing
from jaeger_client import Config
from flask_opentracing import FlaskTracer
from prometheus_clie... | kubernetes-for-developers/kfd-flask | src/exampleapp.py | Python | apache-2.0 | 4,147 |
#!/usr/bin/python
# Copyright (c) 2014 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A package is a JSON file describing a list of package archives."""
from __future__ import print_function
import json
import o... | endlessm/chromium-browser | native_client/build/package_version/package_info.py | Python | bsd-3-clause | 10,833 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='CatalogueItem',
fields=[
('id', models.AutoFiel... | arjweb/openeye | catalogue/migrations/0001_initial.py | Python | bsd-3-clause | 1,126 |
import pandas as pd
import os
# needs to be run whenever the qaqc csv is updated
csv_path = os.path.join(os.path.dirname(__file__),"agdrift_qaqc.csv")
csv_in = os.path.join(os.path.dirname(__file__),"agdrift_qaqc_in_transpose.csv")
csv_exp = os.path.join(os.path.dirname(__file__),"agdrift_qaqc_exp_transpose.csv")
#sk... | puruckertom/ubertool | ubertool/agdrift/tests/agdrift_process_qaqc.py | Python | unlicense | 1,210 |
"""
Support for the EPH Controls Ember themostats.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/climate.ephember/
"""
import logging
from datetime import timedelta
import voluptuous as vol
from homeassistant.components.climate import (
ClimateDevi... | stefan-jonasson/home-assistant | homeassistant/components/climate/ephember.py | Python | mit | 3,368 |
from procgame.events import EventManager
import unittest
TEST_EVENT='test'
class EventsTest(unittest.TestCase):
def setUp(self):
self.events = EventManager()
self.events.add_event_handler(name=TEST_EVENT, object=None, handler=self.handler_no_obj)
self.events.add_event_handler(name=TEST_EVENT, object=self, han... | mjocean/PyProcGameHD-SkeletonGame | tests/test_events.py | Python | mit | 1,181 |
# !/usr/bin/env python
# SerialGrabber reads data from a serial port and processes it with the
# configured processor.
# Copyright (C) 2012 NigelB
#
# 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 Foundati... | nigelb/SerialGrabber | serial_grabber/state.py | Python | gpl-2.0 | 2,290 |
#!/usr/bin/env python
import os,sys
import getopt
(opts, args) = getopt.getopt(sys.argv[1:],
"n:",
[
"numframes=",
],
)
numframes = None
for option, arg in opts:
if option in ('-n', '--numframes'):
numframes = int(arg)
if numframes is None:
raise ValueError, "You must supply the maximum number of fram... | paultcochrane/pyvisi | special_vis/steffen/make_frames.py | Python | gpl-2.0 | 594 |
import make_places.fundamental as fu
import mp_utils as mpu
import mp_bboxes as mpbb
import mp_vector as cv
import make_places.blueprints as bp
import make_places.scenegraph as sg
import make_places.primitives as pr
import make_places.waters as mpw
import make_places.cities as cities
import make_places.buildings as blg... | ctogle/make_places | mp/make_places/make_place.py | Python | gpl-2.0 | 13,614 |
VERSION = (1, 2, 1, 'final', 0)
def get_version(version=None):
"""Derives a PEP386-compliant version number from VERSION."""
if version is None:
version = VERSION
assert len(version) == 5
assert version[3] in ('alpha', 'beta', 'rc', 'final')
# Now build the two parts of the version number... | joar/django-enumfield | django_enumfield/__init__.py | Python | mit | 741 |
"""
Provides various models and associated functionality, that can be
related to any other model using generic relationshipswith Django's
contenttypes framework, such as comments, keywords/tags and voting.
"""
from __future__ import unicode_literals
# These methods are part of the API for django.contrib.comments
def... | TecnoSalta/bg | mezzanine/generic/__init__.py | Python | bsd-2-clause | 527 |
#!/usr/bin/env python3
#
# Copyright © 2019 Endless Mobile, Inc.
#
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# Original author: Philip Withnall
"""
Checks that a merge request doesn’t add any instances of the string ‘todo’
(in uppercase), or similar keywords. It may remove instances of that keyword,
or move them ... | endlessm/glib | .gitlab-ci/check-todos.py | Python | lgpl-2.1 | 2,831 |
import _plotly_utils.basevalidators
class OutlinecolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self,
plotly_name="outlinecolor",
parent_name="scattergl.marker.colorbar",
**kwargs
):
super(OutlinecolorValidator, self).__init__(
pl... | plotly/plotly.py | packages/python/plotly/plotly/validators/scattergl/marker/colorbar/_outlinecolor.py | Python | mit | 466 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Management script."""
import os
from flask_script import Manager, Server, Shell
from flask_migrate import Migrate, MigrateCommand
from flask_script.commands import Clean, ShowUrls
from oneiNote.app import create_app
from oneiNote.database import db
from oneiNote.settin... | on3iro/oneiNote | manage.py | Python | mit | 1,779 |
from sympy.diffgeom.rn import R2, R2_p, R2_r, R3, R3_r, R3_c, R3_s
from sympy.diffgeom import (Manifold, Patch, CoordSystem, Point, Commutator,
BaseScalarField, BaseVectorField, Differential, TensorProduct,
WedgeProduct, BaseCovarDerivativeOp, CovarDerivativeOp, LieDerivative,
covariant_order, c... | beni55/sympy | sympy/diffgeom/tests/test_diffgeom.py | Python | bsd-3-clause | 8,260 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from Conexion import DbPrecio_Sector
Sectores ={
"Sector_A":{
"N":["Condado del Rey","Los Andes N° 1", "Pan de Azucar","9 de Enero","Fátima","El Martillo","El Cristo"]
,"S":["Santa Clara","Villa Lucre","Colonia Las Lomas","La Pulida","Punta Fresca"]
},
"Sector_B":{
... | mdmirabal/Parcial2-Prog3 | att.py | Python | mit | 3,199 |
#Running this file starts the application
if __name__ == '__main__':
import sys
from package import app
sys.exit(app.Application().run())
| joewledger/Green_Labs_Plotting | main.py | Python | lgpl-3.0 | 151 |
import srddl.data as sd
import srddl.models as sm
import srddl.fields as sf
class B(sm.Struct):
b_first = sf.IntField(size=sf.IntField.Size.INT32)
class A(sm.Struct):
a_first = sf.IntField('First field')
a_second = sf.IntField('Second field', size=sf.IntField.Size.INT32,
... | fmichea/srddl | examples/foo.py | Python | bsd-3-clause | 1,976 |
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright (c) 2013 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... | devendermishrajio/nova | nova/virt/xenapi/volume_utils.py | Python | apache-2.0 | 11,752 |
import requests
__url = 'http://www.baidu.com/s?wd=' # 搜索请求网址
def page(word):
r = requests.get(__url + word)
if r.status_code == 200: # 请求错误(不是200)处理
return r.text
else:
print(r.status_code)
return False
| JianmingXia/StudyTest | KnowledgeQuizTool/MillionHeroes/baiduSearch/get.py | Python | mit | 277 |
import sys
for line in sys.stdin:
x, y = map(int, line.split())
if not x or not y:
break
if x > 0 and y > 0:
print('primeiro')
elif x < 0 and y < 0:
print('terceiro')
elif x < 0:
print('segundo')
else:
print('quarto')
| deniscostadsc/playground | solutions/beecrowd/1115/1115.py | Python | mit | 285 |
#!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2012, Willow Garage, Inc.
# 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... | dan-git/outdoor_bot | src/outdoor_bot/object_detection.py | Python | bsd-2-clause | 12,000 |
# -*- coding: utf-8 -*-
"""
Interface for logging small amounts of time series data to some place.
First use case is Influxdb.
Qudi 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,... | tobiasgehring/qudi | interface/data_logger_interface.py | Python | gpl-3.0 | 1,320 |
from __future__ import print_function
import collections
import math
import numpy as np
import os
import random
import tensorflow as tf
try:
from matplotlib import pylab
HAS_PYLAB = True
except ImportError:
HAS_PYLAB = False
from six.moves import range
from six.moves.urllib.request import urlretrieve
try:
fr... | eliben/deep-learning-samples | ud730/assign5_word2vec.py | Python | unlicense | 9,219 |
'''A system for parallel, remote execution of multiple arbitrary tasks.
Much of this, both in concept and execution, was inspired by (and in some
cases based heavily on) the ``concurrent.futures`` package from Python 3.2,
with some simplifications and adaptations (thanks to Brian Quinlan and his
futures implementatio... | westpa/westpa | lib/wwmgr/work_managers/__init__.py | Python | mit | 1,500 |
#!/usr/bin/env python
"""Ripple ledger extractor.
Grapple extracts the ledger from rippled via websocket. It starts at the
current ledger index, and walks backwards until it reaches the genesis ledger.
The genesis ledger index is set by default to 152370.
If you have previously run Grapple, data will only be collect... | tinybike/grapple | grapple/grapple.py | Python | mit | 24,929 |
# _*_coding:utf-8_*_
# 客户端程序
from socket import *
import time
from sys import exit
import notebooknets
def main():
BUF_SIZE = 65565
ss_addr = ('127.0.0.1', 8800)
cs = socket(AF_INET, SOCK_DGRAM)
notebooknets.printhistory()
while True:
global data
data = raw_input('今日记录,请输入(输入quit退出... | picklecai/OMOOC2py | _src/om2py3w/3wex0/notebooknetc.py | Python | mit | 645 |
"""
bridge to docker-compose
"""
import logging
from compose.container import Container
from compose.cli.command import get_project as compose_get_project, get_config_path_from_options
from compose.config.config import get_default_config_files
from compose.config.environment import Environment
def ps_(project):
"... | piti118/docker-compose-ui | scripts/bridge.py | Python | mit | 1,639 |
#!/usr/bin/python
"""
twitter module for feedIO.
"""
__version__ = "0.0.5"
__license__ = """
Copyright (C) 2011 Sri Lanka Institute of Information Technology.
feedIO 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 ... | seejay/feedIO | feedio/twitterPlugin.py | Python | gpl-3.0 | 2,378 |
from handler.base_plugin import CommandPlugin, DEFAULTS
from utils import traverse, parse_user_id, parse_user_name
class StaffControlPlugin(CommandPlugin):
__slots__ = ("commands_base", "commands_get_list", "commands_add_to_list",
"set_admins", "commands_remove_from_list", "admins", "moders",
"ba... | VKBots/VBot | plugins/control/control_staff.py | Python | mit | 13,223 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from numpy import array
from numpy import eye
from numpy import finfo
from numpy import float64
from numpy import maximum
from numpy import mean
from numpy import newaxis
from numpy import ones
from numpy impo... | compas-dev/compas | src/compas/numerical/descent/descent_numpy.py | Python | mit | 2,450 |
#!/usr/bin/python3
# -*- coding:utf-8 -*-
from pyclt.res.languages import *
import json
import os
def getText(language_type):
'''获取语言字符'''
if language_type =="zh_cn":
return zh_cn()
| zsh2401/PYCLT | pyclt/res/__init__.py | Python | gpl-3.0 | 211 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013-2017, 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 p... | numenta/nupic.core | bindings/py/tests/algorithms/cells4_test.py | Python | agpl-3.0 | 9,307 |
"""Config flow for Coronavirus integration."""
from __future__ import annotations
from typing import Any
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.data_entry_flow import FlowResult
from . import get_coordinator
from .const import DOMAIN, OPTION_WORLDWIDE
class ConfigFlow... | lukas-hetzenecker/home-assistant | homeassistant/components/coronavirus/config_flow.py | Python | apache-2.0 | 1,587 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.