text
stringlengths
6
947k
repo_name
stringlengths
5
100
path
stringlengths
4
231
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
6
947k
score
float64
0
0.34
""" This module provides a direct client interface for managing an IRC connection. If you are trying to build a bot, :class:`ircutils.bot.SimpleBot` inherits from :class:`SimpleClient` so it has the methods listed below. """ import collections from . import connection from . import ctcp from . import events from . ...
Mortal/eggpy
ircutils/client.py
Python
mit
13,186
0.00857
# -*- coding: utf-8 -*- """ Created on Fri Sep 5 14:44:52 2014 @author: nick Pyserial interface for communicating with mini usb Analog IO board Usage: Send plaintext commands, separated by newline/cr or semicolon. An eventual reply comes terminated with cr+lf. Important commands: *IDN? Returns device i...
CQTools/analogIO-miniUSB
analogIO.py
Python
mit
2,908
0.013755
from lttngc import __version__ from lttngc import utils from PyQt4 import Qt import os.path class QLttngcAboutDialog(utils.QCommonDialog, utils.QtUiLoad): _UI_NAME = 'about' def __init__(self): super().__init__() self._setup_ui() def _set_version(self): self.version_label.setText...
eepp/lttngc
lttngc/about_dialog.py
Python
mit
763
0
#!/usr/bin/env python3 """ Unit tests for the Grammar class and for the GrammarAnalyzer class. Tests each grammar in the "grammars" folder against a variety of strings. """ import unittest from grammar import Grammar from grammaranalyzer import GrammarAnalyzer class TestGrammar(unittest.TestCase): def test_nonexis...
JVMartin/grammar-analyzer
tests.py
Python
mit
7,593
0.018833
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # 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 ...
ppasq/geonode
geonode/base/forms.py
Python
gpl-3.0
17,648
0.000793
from pages.treeherder import Treeherder def test_switch_app(base_url, selenium, test_repository): """Switch between Treeherder and Perfherder using header dropdown""" page = Treeherder(selenium, base_url).open() assert page.header.active_app == 'Treeherder' page = page.switch_to_perfherder() asser...
edmorley/treeherder
tests/selenium/test_switch_app.py
Python
mpl-2.0
790
0
""" TestCases for DB.associate. """ import sys, os, string import tempfile import time from pprint import pprint try: from threading import Thread, currentThread have_threads = 1 except ImportError: have_threads = 0 import unittest from test_all import verbose try: # For Pythons w/distutils pybsddb ...
xbmc/atv2
xbmc/lib/libPython/Python/Lib/bsddb/test/test_associate.py
Python
gpl-2.0
11,198
0.009109
#!/usr/bin/env python # Copyright (c) 2014, Alessandro Gatti - frob.it # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice...
arthurpro/HopperPlugins
tools/dumpbinary.py
Python
bsd-2-clause
5,539
0
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2006 Donald N. Allingham # Copyright (C) 2008 Brian G. Matherly # Copyright (C) 2010 Jakim Friant # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as publi...
arunkgupta/gramps
gramps/plugins/textreport/summary.py
Python
gpl-2.0
10,795
0.004354
''' Text ==== An abstraction of text creation. Depending of the selected backend, the accuracy of text rendering may vary. .. versionchanged:: 1.5.0 :attr:`LabelBase.line_height` added. .. versionchanged:: 1.0.7 The :class:`LabelBase` does not generate any texture if the text has a width <= 1. This is t...
andnovar/kivy
kivy/core/text/__init__.py
Python
mit
28,172
0.000461
from LSFEventType import LSFEventType __author__ = 'pascal' from urllib import urlopen import time from threading import Thread from glob import glob class LSFFetcher: _overview_url = '' _event_urls = [] simultaneous_threads = 10 def add_overview_url(self, overview_url): self._overview_url ...
pascalweiss/LSFEventScraper
LSFFetcher.py
Python
mit
2,374
0.001264
from cx_Oracle import CLOB from django.contrib.gis.db.backends.adapter import WKTAdapter class OracleSpatialAdapter(WKTAdapter): input_size = CLOB
hunch/hunch-gift-app
django/contrib/gis/db/backends/oracle/adapter.py
Python
mit
157
0.006369
# # (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible 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. # # Ansible is d...
e-gob/plataforma-kioscos-autoatencion
scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/plugins/terminal/aireos.py
Python
bsd-3-clause
1,999
0.0005
import copy from itertools import product from django.conf import settings from django.db.models.sql.datastructures import EmptyResultSet from djangae.db.backends.appengine.query import WhereNode from django.db import NotSupportedError # Maximum number of subqueries in a multiquery DEFAULT_MAX_ALLOWABLE_QUERIES = 1...
grzes/djangae
djangae/db/backends/appengine/dnf.py
Python
bsd-3-clause
9,768
0.001536
#### 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/creature/npc/droid/shared_wed_treadwell_base.iff" result.attribute_template_...
anhstudios/swganh
data/scripts/templates/object/creature/npc/droid/shared_wed_treadwell_base.py
Python
mit
460
0.045652
import lexicon.__main__ import pytest def test_BaseProviderParser(): baseparser = lexicon.__main__.BaseProviderParser() parsed = baseparser.parse_args(['list','capsulecd.com','TXT']) assert parsed.action == 'list' assert parsed.domain == 'capsulecd.com' assert parsed.type == 'TXT' assert parsed...
tnwhitwell/lexicon
tests/test_main.py
Python
mit
1,149
0.008703
# -*- coding: UTF-8 -*- """ Copyright (C) 2014 smokdpi 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. ...
igor-rangel7l/igorrangelteste.repository
script.module.urlresolver/lib/urlresolver/plugins/userscloud.py
Python
gpl-2.0
2,595
0.004624
import warnings import numpy as np import numpy.testing as npt from dipy.core.gradients import gradient_table from dipy.core.sphere import HemiSphere, unit_octahedron from dipy.direction.pmf import SimplePmfGen, SHCoeffPmfGen, BootPmfGen from dipy.reconst.csdeconv import ConstrainedSphericalDeconvModel from dipy.recon...
FrancoisRheaultUS/dipy
dipy/direction/tests/test_pmf.py
Python
bsd-3-clause
3,786
0
# -*- coding: utf-8 -*- # Copyright 2022 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...
googleapis/python-dialogflow-cx
samples/generated_samples/dialogflow_v3beta1_generated_test_cases_batch_run_test_cases_sync.py
Python
apache-2.0
1,663
0.000601
"""Cli for matching samples""" import logging import math import click from genotype.constants import TYPES from genotype.match.core import compare_analyses from genotype.store import api from genotype.store.models import Analysis LOG = logging.getLogger(__name__) def log_result(sample_id, result, hide_fail=False...
Clinical-Genomics/taboo
genotype/cli/match_cmd.py
Python
mit
3,397
0.000294
# -*- coding: utf-8 -*- # # Copyright 2011-2018 Matt Austin # # 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 applicabl...
mattaustin/django-thummer
thummer/templatetags/thummer.py
Python
apache-2.0
3,380
0
from alfred.modules.api.a_base_model import ABaseModel class Article(ABaseModel): def __init__(self, title, summary, date, url, image): super().__init__() self.title = title self.summary = summary self.date = date self.url = url self.image = image class Source(ABa...
Sefrwahed/alfred-news
alfred_news/models.py
Python
mit
791
0
# -*- coding: utf-8 -*- # # Copyright © 2013-2014 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions # of the GNU General Public License v.2, or (at your option) any later # version. This program is distributed...
mizdebsk/pkgdb2
tests/test_groups.py
Python
gpl-2.0
9,297
0.00043
# Copyright (c) 2018 PaddlePaddle Authors. 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 appli...
reyoung/Paddle
python/paddle/fluid/layers/layer_function_generator.py
Python
apache-2.0
10,724
0.000466
__author__ = "mfreer" __date__ = "2011-05-27 14:27" __version__ = "1.0" __all__ = ["TempVirtualCnrm"] import egads.core.egads_core as egads_core import egads.core.metadata as egads_metadata class TempVirtualCnrm(egads_core.EgadsAlgorithm): """ FILE temp_virtual_cnrm.py VERSION 1.0 CA...
eufarn7sp/egads-eufar
egads/algorithms/thermodynamics/temp_virtual_cnrm.py
Python
bsd-3-clause
3,161
0.016134
# # Test script for the curses module # # This script doesn't actually display anything very coherent. but it # does call (nearly) every method and function. # # Functions not tested: {def,reset}_{shell,prog}_mode, getch(), getstr(), # init_color() # Only called, not tested: getmouse(), ungetmouse() # import os import...
wang1352083/pythontool
python-2.7.12-lib/test/test_curses.py
Python
mit
11,284
0.004165
#!/urs/bin/python import os import graphviz # from gk_node import GKNode # from gk_link import GKLink class GKGraphic(object): """Manage graphic""" def __init__(self, label=None): self.m_label = label self.m_nodes_list = [] self.m_link_list = [] def add_link(self, link): "...
terranum-ch/GraphLink
graphlink/core/gk_graphic.py
Python
apache-2.0
1,424
0.002107
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) Philipp Wagner. All rights reserved. # Licensed under the BSD license. See LICENSE file in the project root for full license information. import sys # append facerec to module search path sys.path.append("../..") # import facerec stuff from facerec.dataset...
dashmoment/facerecognition
py/apps/scripts/fisherfaces_example.py
Python
bsd-3-clause
2,253
0.008877
from plone.app.testing import PloneWithPackageLayer from plone.app.testing import IntegrationTesting from plone.app.testing import FunctionalTesting import groupdocs.comparison GROUPDOCS_COMPARISON = PloneWithPackageLayer( zcml_package=groupdocs.comparison, zcml_filename='testing.zcml', gs_profile_id='gr...
liosha2007/plone-groupdocs-comparison-source
src/groupdocs/comparison/testing.py
Python
apache-2.0
653
0
#!/usr/bin/python ''' Created on Sep 18, 2009 @author: sgallagh ''' import unittest import os from stat import * import sys srcdir = os.getenv('srcdir') if srcdir: sys.path.insert(0, "./src/config") srcdir = srcdir + "/src/config" else: srcdir = "." import SSSDConfig class SSSDConfigTestValid(unittest....
yelley/sssd-gpo
src/config/SSSDConfigTest.py
Python
gpl-3.0
71,528
0.001566
#number = 1 #while number < 11: # print(number) # number += 1 # balance = 1000 # rate = 1.02 # years = 0 # while balance < 5000: # balance *= rate # years += 1 # print("It takes " + str(years) + " years to reach $5000.") # for i in [1,2,3,4,5,6,7,8,9,10]: # print(i) #for name in ["Jane", "John", "Matt", ...
simontakite/sysadmin
pythonscripts/webprogrammingwithpython/Working Files/Chapter 2/0206 loops.py.py
Python
gpl-2.0
381
0.015748
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # pip3 install dnspython import re import random import sleekxmpp import configparser import smtplib from email.mime.text import MIMEText from sqlalchemy import Column, String, Integer, Boolean from sqlalchemy.ext.declarative import declarative_base from collections impor...
Finn10111/PimuxBot
pimuxbot.py
Python
gpl-3.0
7,396
0.001893
# coding=utf-8 import os import glob import configuracao def main(): for arquivo in glob.glob(configuracao.DATASET_PREPARADO + '/*.csv'): linhas = 0 spam = 0 with open(arquivo, 'r') as arquivo_aberto: tupla = arquivo_aberto.readline() while tupla: li...
ebertti/nospam
contador_linhas.py
Python
mit
581
0.005164
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2010-2014 GRNET S.A. # # 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 l...
allmende/synnefo
snf-astakos-app/astakos/test/stress.py
Python
gpl-3.0
6,652
0.000903
import os, sys, re, argparse, time, json, logging import requests from glob import glob from urlparse import urlsplit from getpass import getpass from mastodon import Mastodon from markdown import markdown from html_text import extract_text from flask import (Flask, render_template, abort, request, redirect, jsonif...
thedod/gistodon
gistodon.py
Python
gpl-3.0
8,763
0.005592
""" 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 distributed in the hope that it will be useful, but WITHOUT...
Salamek/git-deploy
git_deploy/git_deploy_remote.py
Python
gpl-3.0
2,740
0.015693
#!/usr/bin/env python # -*- coding: utf-8 -*- # Answered by Billy Wilson Arante # Last updated on 2016/12/31 EST # We defined: stooges = ['Moe','Larry','Curly'] # but in some Stooges films, Curly was # replaced by Shemp. # Write one line of code that changes # the value of stooges to be: stooges[2] = "Shemp" prin...
arante/udacity
cs101/lesson3/different_stooges.py
Python
gpl-3.0
374
0.005348
import uuid from nose.tools import eq_ from kazoo.testing import KazooTestCase class KazooCounterTests(KazooTestCase): def _makeOne(self, **kw): path = "/" + uuid.uuid4().hex return self.client.Counter(path, **kw) def test_int_counter(self): counter = self._makeOne() eq_(co...
johankaito/fufuka
microblog/venv/lib/python2.7/site-packages/kazoo/tests/test_counter.py
Python
apache-2.0
883
0
#--CORBA STUBS----------------------------------------------------------------- import ACSCOURSE_MOUNT__POA #--ACS Imports----------------------------------------------------------------- from Acspy.Servants.ContainerServices import ContainerServices from Acspy.Servants.ComponentLifecycle import ComponentLifecycle fro...
jbarriosc/ACSUFRO
LGPL/CommonSoftware/acscourse/ws/src/ACSCOURSE_MOUNTImpl/Mount1.py
Python
lgpl-2.1
2,155
0.015313
''' Open Source Initiative OSI - The MIT License:Licensing Tue, 2006-10-31 04:56 nelson The MIT License Copyright (c) 2009 BK Precision 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 re...
sbobovyc/LabNotes
bk_precision_8500/profile_solarcell.py
Python
gpl-3.0
4,756
0.004626
# -*- coding: utf-8 -*- # # Copyright 2016 edX PDR Lab, National Central University, Taiwan. # # http://edxpdrlab.ncu.cc/ # # 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://w...
yrchen/CommonRepo
commonrepo/infor_api/serializers.py
Python
apache-2.0
842
0
## # Copyright 2009-2017 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (F...
ULHPC/easybuild-easyblocks
easybuild/easyblocks/c/cp2k.py
Python
gpl-2.0
35,231
0.003293
""" `GrammarLexer` is compatible with Pygments lexers and can be used to highlight the input using a regular grammar with token annotations. """ from __future__ import unicode_literals from pygments.token import Token from prompt_toolkit.layout.lexers import Lexer from .compiler import _CompiledGrammar __all__ = ( ...
niklasf/python-prompt-toolkit
prompt_toolkit/contrib/regular_languages/lexer.py
Python
bsd-3-clause
2,621
0.000763
## www.pubnub.com - PubNub Real-time push service in the cloud. # coding=utf8 ## PubNub Real-time Push APIs and Notifications Framework ## Copyright (c) 2010 Stephen Blum ## http://www.pubnub.com/ import sys from pubnub import Pubnub publish_key = len(sys.argv) > 1 and sys.argv[1] or 'demo' subscribe_key = len(sys....
teddywing/pubnub-python
python/examples/history.py
Python
mit
1,293
0.007734
from __future__ import print_function from pymatch import * import pymatch.functions as uf class Matcher: """ Matcher Class -- Match data for an observational study. Parameters ---------- test : pd.DataFrame Data representing the test group control : (pd.DataFrame) Data represe...
benmiroglio/pymatch
pymatch/Matcher.py
Python
mit
21,944
0.003418
def main(): """A simulation-ish of Summer Eights bumps racing""" import random course_length = 1000.0 bung_line_separation = 20 number_of_bung_lines = 12 class Boat: def __init__(self,name,speed,bung_line): self.name = name self.speed = speed ...
jmmL/misc
eights.py
Python
mit
931
0.022556
import pyqtgraph as pg from pyqtgraph.Qt import QtGui, QtCore from pyqtgraph.parametertree import Parameter, ParameterTree from pyqtgraph.parametertree import types as pTypes import pyqtgraph.configfile import numpy as np import user import collections import sys, os class RelativityGUI(QtGui.QWidget): def __ini...
UpSea/thirdParty
pyqtgraph-0.9.10/examples/relativity/relativity.py
Python
mit
28,282
0.013896
from media_tree.models import FileNode from media_tree.contrib.views.listing import FileNodeListingView from media_tree.contrib.views.detail import FileNodeDetailView from media_tree.contrib.views.detail.image import ImageNodeDetailView from django.views.generic.base import TemplateView from django.conf.urls import pat...
bittner/django-media-tree
demo_project/demo_project/urls.py
Python
bsd-3-clause
1,273
0.007855
import sys sys.path.append('../') import Graffity import numpy import PlotTools import glob import astropy.io.fits as pyfits from scipy import optimize from os import walk from os.path import join def fitGaussian(x, y): errfunc = lambda p, x, y: numpy.abs(p[0]*numpy.exp(-(x**2.0)/(2*p[1]**2.0)) - y) coeffs = [...
soylentdeen/Graffity
src/BCI/IRS16NM.py
Python
mit
4,007
0.010482
# -*- coding: utf-8 -*- # Resource object code # # Created: Sat May 11 12:28:54 2013 # by: The Resource Compiler for PyQt (Qt v4.8.4) # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore qt_resource_data = b"\ \x00\x00\x04\x58\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\...
haskelladdict/sconcho
sconcho/gui/icons_rc.py
Python
gpl-3.0
575,342
0.000009
#!/usr/bin/python import time from tentacle_pi.AM2315 import AM2315 am = AM2315(0x5c, "/dev/i2c-1") for x in range(10): temperature, humidity, crc_check = am.sense() print "Temperature: %s" % temperature print "Humidity: %s" % humidity print "CRC: %s" % crc_check time.sleep(2)
Cabalist/Mycodo
3.5/cgi-bin/Test-Sensor-HT-AM2315.py
Python
gpl-3.0
302
0
""" mfdrn module. Contains the ModflowDrn class. Note that the user can access the ModflowDrn class as `flopy.modflow.ModflowDrn`. Additional information for this MODFLOW package can be found at the `Online MODFLOW Guide <http://water.usgs.gov/ogw/modflow/MODFLOW-2005-Guide/index.html?drn.htm>`_. """ import...
bdestombe/flopy-1
flopy/modflow/mfdrn.py
Python
bsd-3-clause
9,662
0.001035
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # DATE_FORMAT = r'j N Y' TIME_FORMAT = r'H:i:s' DATETIME_FORMAT = r'j N Y H:i:s' YEAR_MONTH_FORMAT = r'F Y' MONTH_DAY_FORMAT = r'j \de F' SHORT_DATE_FORMAT = r'd/m/Y' SHORT_DATETIME_FORMAT = r'd/m/Y H:i' FIRST...
hunch/hunch-gift-app
django/conf/locale/es_AR/formats.py
Python
mit
735
0.005442
#!/usr/bin/env python # ___ ___ _ _ ___ ___ _ _____ ___ ___ # / __| __| \| | __| _ \ /_\_ _| __| \ # | (_ | _|| .` | _|| / / _ \| | | _|| |) | # \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____ # | \ / _ \ | \| |/ _ \_ _| | __| \_ _|_ _| # | |) | (_) | | .` | (_) || | | _|| |) | | ...
twiest/openshift-tools
openshift/installer/vendored/openshift-ansible-git-2016-04-18/roles/lib_openshift_api/library/oadm_router.py
Python
apache-2.0
28,872
0.003221
#!/usr/bin/env python2 # Simple tool to see if we have a SMI-S provider talking on the network and # if it has any systems we can test. # # Can use for scripting as exit value will be: # 0 if array is online and enumerate systems has some # 1 if we can talk to provider, but no systems # 2 Wrong credentials (Wrong user...
libstorage/libstoragemgmt
tools/smisping/smisping.py
Python
lgpl-2.1
3,066
0
"""Support for Vera cover - curtains, rollershutters etc.""" import logging from homeassistant.components.cover import CoverDevice, ENTITY_ID_FORMAT, \ ATTR_POSITION from homeassistant.components.vera import ( VERA_CONTROLLER, VERA_DEVICES, VeraDevice) DEPENDENCIES = ['vera'] _LOGGER = logging.getLogger(__na...
nugget/home-assistant
homeassistant/components/vera/cover.py
Python
apache-2.0
2,003
0
import os import mock import pytest @pytest.fixture() def mock_agent_data(): f_name = os.path.join(os.path.dirname(__file__), 'fixtures', 'agent_metrics.txt') with open(f_name, 'r') as f: text_data = f.read() with mock.patch( 'requests.get', return_value=mock.MagicMoc...
DataDog/integrations-extras
cyral/tests/conftest.py
Python
bsd-3-clause
479
0.004175
from random import randint overflowstrings = ["A" * 255, "A" * 256, "A" * 257, "A" * 420, "A" * 511, "A" * 512, "A" * 1023, "A" * 1024, "A" * 2047, "A" * 2048, "A" * 4096, "A" * 4097, "A" * 5000, "A" * 10000, "A" * 20000, "A" * 32762, "A" * 32763, "A" * 32764, "A" * 32765, "A" * 32766, "A" * 32767, "A" * 32768, "A" * ...
ausarbluhd/EternalLLC
scripts/mallory/src/fuzz.py
Python
gpl-2.0
1,915
0.019321
# -*- coding: utf-8 -*- # # Copyright (C) 2009-2010, 2013, 2015-2018, 2020 Rocky Bernstein # 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 opt...
rocky/python3-trepan
trepan/processor/cmdbreak.py
Python
gpl-3.0
5,998
0.001334
""" VirtualMachineMonitorAgent plays the role of the watch dog for the Virtual Machine """ import os import time import glob # DIRAC from DIRAC import S_OK, S_ERROR, gConfig, rootPath from DIRAC.ConfigurationSystem.Client.Helpers import Operations from DIRAC.Core.Base.AgentModule ...
atsareg/VMDIRAC
VMDIRAC/WorkloadManagementSystem/Agent/VirtualMachineMonitorAgent.py
Python
gpl-3.0
9,987
0.039652
#!/usr/bin/python -tt """Module to convert data in MongoDB to Ansible inventory JSON.""" # pylint: disable=C0103 import json import os import argparse from netspot import NetSPOT from spotmax import SPOTGroup SPECIAL_FIELDS = ['_id', 'lastModified'] class Host(object): """Class to hold a host.""" def __init_...
MaxIV-KitsControls/netspot
netspot/lib/spotmax/nsinv.py
Python
mit
4,110
0.012895
# Use Netmiko to enter into configuration mode on pynet-rtr2. # Also use Netmiko to verify your state (i.e. that you are currently in configuration mode). from getpass import getpass import time from netmiko import ConnectHandler password = getpass() pynet_rtr2 = {'device_type': 'cisco_ios', 'ip': '50.76.53.27', 'use...
linkdebian/pynet_course
class4/exercise5.py
Python
apache-2.0
563
0.005329
import sys import unittest import cbind cbind.choose_cindex_impl(cbind.CLANG_CINDEX) import suite_all if __name__ == '__main__': runner = unittest.TextTestRunner() sys.exit(not runner.run(suite_all.suite_all).wasSuccessful())
anthrotype/ctypes-binding-generator
test/suite_clang_cindex.py
Python
gpl-3.0
238
0.004202
import difflib class Repository: def __init__(self, fname=None): if not fname: fname = '/usr/share/dict/words' with open(fname) as f: self.repository = [x.rstrip('\n') for x in f.readlines()] def find_close_matches(r, w, count=3): return difflib.get_clo...
amitsaha/learning
python/strings/difflib_closest_match.py
Python
unlicense
697
0.011478
#!/usr/bin/env python3 import asyncio from grole import Grole app = Grole() @app.route('/(\d+)') async def index(env, req): await asyncio.sleep( int(req.match.group(1)) ) app.run()
witchard/grole
examples/example-async.py
Python
mit
188
0.021277
import sys import os import subprocess import time def get_slaves(): slaves = subprocess.check_output(['cat', '/root/spark-ec2/slaves']) return slaves.strip().split('\n') slaves = get_slaves() for slave in slaves: subprocess.call(['ssh', slave, 'killall', 'iperf3']) subprocess.call(['scp', '/root/spa...
Gaojiaqi/spark-ec2
test_speed_master.py
Python
apache-2.0
789
0.00507
from django.core.urlresolvers import reverse from django.db import models from midnight_main.models import BaseTree, Base, BreadCrumbsMixin, BaseComment from ckeditor.fields import RichTextField from django.utils.translation import ugettext_lazy as _ from sorl.thumbnail import ImageField from mptt.fields import TreeMan...
webadmin87/midnight
midnight_news/models.py
Python
bsd-3-clause
2,757
0.003709
#@PydevCodeAnalysisIgnore ######################################################################## # This module is a direct copy of the current # django.conf.project_template.settings # Compare when the Django is upgraded. Make your project settings # changes in settings modules that are importing this one. #########...
tuttle/django-new-project-template
src/myproject/myproject/conf/base_settings.py
Python
mit
5,761
0.001389
# -*- coding: utf-8 -*- """ This file is part of quiedit. quiedit 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. quiedit is distributed i...
smathot/quiedit
libquiedit/theme.py
Python
gpl-2.0
3,523
0.026114
# For Arduino Data: import serial, signal, sys ################################################################################################ ARDUINO_SERIAL_PORT = '/dev/ttyACM0' # Serial port should be set to the port found in the Arduino Program when programming the board parallel_data_file = "parallel_data_file....
CACTUS-Mission/TRAPSat
rpi/tim/parallel_read_arduino.py
Python
mit
929
0.020452
#!/usr/bin/python3 #-*- coding: latin-1 -*- """ Copyright (C) 2014 Technische Universität Berlin, Fakultät IV - Elektrotechnik und Informatik, Fachgebiet Regelungssysteme, Einsteinufer 17, D-10587 Berlin, Germany This file is part of PaPI. PaPI is free software: you can redistribute it and/or modify it under the t...
TUB-Control/PaPI
papi/event/data/DataBase.py
Python
gpl-3.0
1,072
0.008396
# -*- coding: utf-8 -*- # # Copyright (C) 2010-2013 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.org/wiki/TracLicense. # # This software consi...
dafrito/trac-mirror
trac/db/tests/util.py
Python
bsd-3-clause
1,572
0.001272
from django.utils.translation import ugettext_lazy as _ # The slug of the panel group to be added to HORIZON_CONFIG. Required. PANEL_GROUP = 'bsnextensions' # The display name of the PANEL_GROUP. Required. PANEL_GROUP_NAME = _('BSN Extensions') # The slug of the dashboard the PANEL_GROUP associated with. Required. PAN...
wolverineav/horizon-bsn
horizon_bsn/future_enabled/_8005_bsnextensions.py
Python
apache-2.0
356
0
# Lint as: python3 # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
mlperf/training_results_v0.7
Google/benchmarks/minigo/implementations/minigo-research-TF-tpu-v4-128/preprocessing.py
Python
apache-2.0
10,808
0.007494
""" Summary: Ief file data holder. Contains the functionality for loading ISIS .ief files from disk. Author: Duncan Runnacles Created: 01 Apr 2016 Copyright: Duncan Runnacles 2016 TODO: Updates: """ import os from ship.utils import utilfunctions as uf from ship.utils i...
duncan-r/SHIP
ship/fmp/ief.py
Python
mit
11,467
0.002703
"""Class to hold all camera accessories.""" import asyncio from datetime import timedelta import logging from haffmpeg.core import HAFFmpeg from pyhap.camera import ( VIDEO_CODEC_PARAM_LEVEL_TYPES, VIDEO_CODEC_PARAM_PROFILE_ID_TYPES, Camera as PyhapCamera, ) from pyhap.const import CATEGORY_CAMERA from ho...
titilambert/home-assistant
homeassistant/components/homekit/type_cameras.py
Python
apache-2.0
15,437
0.000518
# -*- coding: utf-8 -*- from flask import Flask from flask_sqlalchemy import SQLAlchemy from app.markdown import markdown from app.functions import format_price, format_age, format_age_range, \ format_proof, format_date, format_datetime, modify_query app = Flask(__name__) app.config.from_ob...
tjgavlick/whiskey-blog
app/__init__.py
Python
mit
908
0.002203
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2017-02-09 08:55 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('api', '0017_mentorinfo_availability'), ] operations = [ migrations.AddField...
andrewsosa/hackfsu_com
api/api/migrations/0018_hackathonsponsor_on_mobile.py
Python
apache-2.0
466
0
# Copyright 2018 the V8 project authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import random # List of configuration experiments for correctness fuzzing. # List of <probability>, <1st config name>, <2nd config name>, <2nd d8>. # Prob...
weolar/miniblink49
v8_7_5/tools/clusterfuzz/v8_fuzz_config.py
Python
apache-2.0
1,510
0.003311
def test_dummy_request(): from rasa.nlu.emulators.no_emulator import NoEmulator em = NoEmulator() norm = em.normalise_request_json({"text": ["arb text"]}) assert norm == {"text": "arb text", "time": None} norm = em.normalise_request_json({"text": ["arb text"], "time": "1499279161658"}) assert ...
RasaHQ/rasa_nlu
tests/nlu/emulators/test_no_emulator.py
Python
apache-2.0
948
0.001055
import numpy as np import matplotlib.pyplot as plt; plt.ion() import matplotlib import seaborn; seaborn.set() from astrolabels import AstroLabels al = AstroLabels() matplotlib.rcParams["axes.labelsize"] = 15 matplotlib.rcParams["legend.fontsize"] = 15 # hopefully your data doesn't look like this... plt.figure(figsiz...
jesford/AstroLabels
images/sample.py
Python
mit
481
0.004158
from setuptools import setup setup( name="tyoi.OAuth2", version="0.2.1", author="Ryan Horn", author_email="ryan.horn.web@gmail.com", description=("Implements the client side of the OAuth 2 protocol"), keywords="oauth oauth2 auth authentication", url="https://github.com/ryanhorn/tyoiOAuth2",...
ryanhorn/tyoiOAuth2
setup.py
Python
mit
463
0.00216
from itertools import chain, combinations, permutations class RankedPairsResult: def __init__(self, tallies, winners): self.tallies = tallies self.winners = winners def results(responses): """ Returns the list of ranked-pairs winners based on responses. Takes as input a list of ranki...
ASCIT/donut-python
donut/modules/voting/ranked_pairs.py
Python
mit
2,107
0.000949
# -*- coding: utf-8 -*- from __future__ import with_statement import base64 import simplejson as json from cookielib import Cookie from werkzeug.utils import parse_cookie from tests import SecurityTest def get_cookies(rv): cookies = {} for value in rv.headers.get_all("Set-Cookie"): cookies.update(...
100grams/flask-security
tests/functional_tests.py
Python
mit
9,642
0.000104
# Copyright 2014-2017 Spectra Logic Corporation. 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. A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license" ...
SpectraLogic/ds3_python3_sdk
samples/getService.py
Python
apache-2.0
784
0.002551
# coding: utf8 ''' PyVantagePro ------------ Communication tools for the Davis VantagePro2 devices. :copyright: Copyright 2012 Salem Harrache and contributors, see AUTHORS. :license: GNU GPL v3. ''' import re import sys import os from setuptools import setup, find_packages here =...
SalemHarrache/PyVantagePro
setup.py
Python
gpl-3.0
2,383
0.000839
# -*- coding: utf-8 -*- # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net> # This program is free software: you can r...
dayatz/taiga-back
taiga/base/api/settings.py
Python
agpl-3.0
8,478
0.000472
from os import environ, getcwd from os.path import exists, join from common import str2bool, env_var from group_epitopes import group_epitopes_dataframe from hla_file import read_hla_file from immunogenicity import ImmunogenicityPredictor from load_file import expand_transcripts from load_file import load_variants fro...
hammerlab/immuno
immuno/ui.py
Python
apache-2.0
14,247
0.004633
target = "microsemi" action = "synthesis" syn_device = "a3p250" syn_grade = "-2" syn_package = "208 pqfp" syn_top = "proasic3_top" syn_project = "demo" syn_tool = "libero" modules = { "local" : [ "../../../top/proasic3_sk/verilog" ], }
keyru/hdl-make
tests/counter/syn/proasic3_sk_libero/verilog/Manifest.py
Python
gpl-3.0
242
0.016529
import mongoengine from mongcore.models import Feature, Species from jsonfield import JSONField # Create your models here. class Target(Feature): species = mongoengine.ReferenceField(Species, default=1) kea_id = mongoengine.StringField(max_length=255) ebrida_id = mongoengine.StringField(max_length=255)...
hdzierz/Kaka
gene_expression/models.py
Python
gpl-2.0
644
0.001553
# Copyright (c) 2012 NTT DOCOMO, 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 requ...
houshengbo/nova_vmware_compute_driver
nova/tests/baremetal/db/test_bm_interface.py
Python
apache-2.0
2,308
0.000433
"""Tests for hermite_e module. """ from __future__ import division, absolute_import, print_function import numpy as np import numpy.polynomial.hermite_e as herme from numpy.polynomial.polynomial import polyval from numpy.testing import ( TestCase, assert_almost_equal, assert_raises, assert_equal, assert_, run...
DailyActie/Surrogate-Model
01-codes/numpy-master/numpy/polynomial/tests/test_hermite_e.py
Python
mit
18,726
0
#!/usr/bin/env python """ Usage: python get_status.py <acceleration (mm/s/s)> <max velocity (mm/s) [<serial>] Gets the status of all APT controllers, or of the one specified """ import pylibftdi import pyAPT def set_vel_params(serial, acc, max_vel): with pyAPT.MTS50(serial_number=serial) as con: print '\tSettin...
anthonyclays/pyAPT
set_velocity_params.py
Python
mit
1,322
0.020424
"""Let's Encrypt client errors.""" class Error(Exception): """Generic Let's Encrypt client error.""" class AccountStorageError(Error): """Generic `.AccountStorage` error.""" class AccountNotFound(AccountStorageError): """Account not found error.""" class ReverterError(Error): """Let's Encrypt Re...
mitnk/letsencrypt
letsencrypt/errors.py
Python
apache-2.0
2,342
0.000854
__author__ = 'Alex' from Movement import Movement class BaseCommand: def __init__(self, movement): assert isinstance(movement, Movement) self.name = 'unknown' self.m = movement def execute(selfself):pass class Forward(BaseCommand): def __init__(self, movement): assert isi...
RobotTurtles/mid-level-routines
Apps/TurtleCommands.py
Python
apache-2.0
1,101
0.006358
# Copyright (c) 2013-2014 Will Thames <will@thames.id.au> # # 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...
ansible/ansible-lint
src/ansiblelint/rules/MercurialHasRevisionRule.py
Python
mit
1,951
0
from django.conf.urls import url from .views import IndexView urlpatterns = [ url(r'^$', IndexView.as_view()), ]
AlexandroPQC/django_discusion
SistemaDiscusiones/home/urls.py
Python
gpl-3.0
118
0
import os import codecs, re, time, string, logging, math from operator import itemgetter from nltk import FreqDist from nltk.corpus import stopwords import textmining from scipy import spatial from . import filehandler def most_frequent_terms(*args): tdm = textmining.TermDocumentMatrix(simple_tokenize_remove_our_s...
c4fcm/DataBasic
databasic/logic/tfidfanalysis.py
Python
mit
4,459
0.01054
""" Django settings for findtorun project. Generated by 'django-admin startproject' using Django 1.11.2. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import ...
maheshp212/find-to-run
findtorun/findtorun/settings.py
Python
apache-2.0
3,920
0.001276
from __future__ import unicode_literals import sys from pre_commit import color from pre_commit import five def get_hook_message( start, postfix='', end_msg=None, end_len=0, end_color=None, use_color=None, cols=80, ): """Prints a message for running a hook...
philipgian/pre-commit
pre_commit/output.py
Python
mit
2,217
0