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 |
|---|---|---|---|---|---|---|
from lib.font import *
import sys
import fcntl
import termios
import struct
class progress_bar(object):
def __init__(self, tot=100, lenght=10):
self.cp='/-\|'
self.bar_lenght = lenght
self.tot = tot
def startprogress(self, title):
"""Creates a progress bar 40 chars long on the console
and moves cursor ba... | luca-heltai/ePICURE | applications/lib/progress_bar.py | Python | gpl-2.0 | 1,682 | 0.030321 |
def _types_gen(T):
yield T
if hasattr(T, 't'):
for l in T.t:
yield l
if hasattr(l, 't'):
for ll in _types_gen(l):
yield ll
class Type(type):
""" A rudimentary extension to `type` that provides polymorphic
types for run-time type checking of JSON data types. IE:
assert type... | regmi/codenode-unr | codenode/external/jsonrpc/types.py | Python | bsd-3-clause | 1,860 | 0.013978 |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | pwong-mapr/private-hue | apps/sqoop/src/sqoop/api/job.py | Python | apache-2.0 | 8,088 | 0.011375 |
#!/usr/bin/env python
# -*- coding: latin-1 -*-
import sys
#################### <FUNCIONES> ####################################################################
##<Obtener el vector C>###################################################################################################
def GetVectorC(eq):
C=[]
j=... | Darkade/udlap | 6to/simplex.py | Python | apache-2.0 | 14,976 | 0.049195 |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "LinearTrend", cycle_length = 12, transform = "None", sigma = 0.0, exog_count = 20, ar_order = 0); | antoinecarme/pyaf | tests/artificial/transf_None/trend_LinearTrend/cycle_12/ar_/test_artificial_128_None_LinearTrend_12__20.py | Python | bsd-3-clause | 262 | 0.087786 |
# Copyright 2018 Flight Lab authors.
#
# 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 w... | google/flight-lab | controller/common/net.py | Python | apache-2.0 | 1,062 | 0.00565 |
#!/usr/bin/env python
"""
@package mi.dataset.parser.test
@file mi-dataset/mi/dataset/parser/test/test_fuelcell_eng_dcl.py
@author Chris Goodrich
@brief Test code for the fuelcell_eng_dcl parser
Release notes:
initial release
"""
__author__ = 'cgoodrich'
import os
from nose.plugins.attrib import attr
from mi.core... | petercable/mi-dataset | mi/dataset/parser/test/test_fuelcell_eng_dcl.py | Python | bsd-2-clause | 9,992 | 0.001601 |
"""
Github Authentication
"""
import httplib2
from django.conf import settings
from django.core.mail import send_mail
from oauth2client.client import OAuth2WebServerFlow
from helios_auth import utils
# some parameters to indicate that status updating is not possible
STATUS_UPDATES = False
# display tweaks
LOGIN_ME... | benadida/helios-server | helios_auth/auth_systems/github.py | Python | apache-2.0 | 2,315 | 0.015983 |
""" KeystoneClient class encapsulates the work with the keystone service interface
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import requests
from DIRAC import S_OK, S_ERROR, gLogger
from DIRAC.Core.Utilities.Time import fromString, dateTime
__RC... | DIRACGrid/VMDIRAC | VMDIRAC/Resources/Cloud/KeystoneClient.py | Python | gpl-3.0 | 9,771 | 0.007983 |
from pymemcache.client.hash import HashClient
from pymemcache.client.base import Client, PooledClient
from pymemcache.exceptions import MemcacheError, MemcacheUnknownError
from pymemcache import pool
from .test_client import ClientTestMixin, MockSocket
import unittest
import pytest
import mock
import socket
class Te... | bwalks/pymemcache | pymemcache/test/test_client_hash.py | Python | apache-2.0 | 7,403 | 0 |
# flake8: noqa
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'PersonTranslation.roman_first_name'
db.add_column('people_persontranslation',... | bitmazk/django-people | people/south_migrations/0005_auto__add_field_persontranslation_roman_first_name__add_field_persontr.py | Python | mit | 15,072 | 0.007564 |
import gtk
class ExtensionFeatures:
SYSTEM_WIDE = 0
class MountManagerExtension:
"""Base class for mount manager extensions.
Mount manager has only one instance and is created on program startup.
Methods defined in this class are called automatically by the mount manager
so you need to implement them.
""... | Azulinho/sunflower-file-manager-with-tmsu-tagging-support | application/plugin_base/mount_manager_extension.py | Python | gpl-3.0 | 1,433 | 0.032798 |
"""
Basic building blocks for generic class based views.
We don't bind behaviour to http method handlers yet,
which allows mixin classes to be composed in interesting ways.
"""
from __future__ import unicode_literals
from django.http import Http404
from rest_framework import status
from rest_framework.response import... | DeltaEpsilon-HackFMI2/FMICalendar-REST | venv/lib/python2.7/site-packages/rest_framework/mixins.py | Python | mit | 6,556 | 0.000915 |
import cv2
import numpy as np
import os
from vilay.core.Descriptor import MediaTime, Shape
from vilay.detectors.IDetector import IDetector
from vilay.core.DescriptionScheme import DescriptionScheme
class FaceDetector(IDetector):
def getName(self):
return "Face Detector"
def initialize(self):... | dakot/vilay-detect | vilay/detectors/FaceDetector.py | Python | gpl-3.0 | 1,782 | 0.014029 |
import unittest
import warnings
warnings.filterwarnings('ignore', module=r'.*fuz.*', message='.*Sequence.*')
import sys
import os.path
sys.path.insert(1, os.path.abspath('..'))
from sickbeard import common
from sickbeard.common import Quality, WantedQualities
from sickbeard.name_parser.parser import NameParser
from s... | SickGear/SickGear | tests/common_tests.py | Python | gpl-3.0 | 235,694 | 0.007259 |
def decode_args(s, delimiter="|", escapechar="\\"):
args = []
escaping = False
current_arg = ""
for c in s:
if escaping:
current_arg += c
escaping = False
elif c == escapechar:
escaping = True
elif c == delimiter:
args.append(curren... | zentralopensource/zentral | zentral/core/events/utils.py | Python | apache-2.0 | 851 | 0 |
#
# Python module to parse OMNeT++ vector files
#
# Currently only suitable for small vector files since
# everything is loaded into RAM
#
# Authors: Florian Kauer <florian.kauer@tuhh.de>
#
# Copyright (c) 2015, Institute of Telematics, Hamburg University of Technology
# All rights reserved.
#
# Redistribution and use ... | i-tek/inet_ncs | simulations/analysis_tools/python/omnet_vector.py | Python | gpl-3.0 | 3,886 | 0.008492 |
# Copyright (c) 2013-2016 Molly White
#
# 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, publish,
# di... | quanticle/GorillaBot | gorillabot/plugins/settings.py | Python | mit | 5,087 | 0.009043 |
from PyQt4 import QtCore
import sys
from ilastik.core.projectClass import Project
from ilastik.core.testThread import TestThread
from ilastik.modules.unsupervised_decomposition.core.unsupervisedMgr import UnsupervisedDecompositionModuleMgr
from ilastik.modules.unsupervised_decomposition.core.algorithms.unsupervisedDeco... | ilastik/ilastik-0.5 | ilastik/modules/unsupervised_decomposition/core/testModule.py | Python | bsd-2-clause | 11,269 | 0.011625 |
from django.utils.translation import ugettext_lazy as _ugl
default_app_config = 'django_sendgrid_parse.apps.DjangoSendgridParseAppConfig'
| letops/django-sendgrid-parse | django_sendgrid_parse/__init__.py | Python | mit | 139 | 0 |
# Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | kayhayen/Nuitka | nuitka/codegen/LineNumberCodes.py | Python | apache-2.0 | 2,550 | 0.000392 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
###############################################################################
# Module to define chemical reaction functionality
###############################################################################
from math import exp, log
import sqlite3
from numpy import pol... | edusegzy/pychemqt | lib/reaction.py | Python | gpl-3.0 | 9,477 | 0.001478 |
import unicodedata
import re
class PathExtension:
"""
Enables readable url path names instead of ids for object traversal.
Names are stored as meta.pool_filename and generated from
title by default. Automatic generation can be disabled by setting
*meta.customfilename* to False for each object.... | nive/nive | nive/extensions/path.py | Python | gpl-3.0 | 8,830 | 0.008041 |
# Copyright (C) 2016 Red Hat, Inc., Bryn M. Reeves <bmr@redhat.com>
# This file is part of the sos project: https://github.com/sosreport/sos
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# version 2 of the GNU General... | nijinashok/sos | sos/plugins/dracut.py | Python | gpl-2.0 | 862 | 0 |
# #######
# Copyright (c) 2018-2020 Cloudify Platform Ltd. 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... | cloudify-cosmo/cloudify-gcp-plugin | cloudify_gcp/admin/__init__.py | Python | apache-2.0 | 1,945 | 0 |
#### 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 = Tangible()
result.template = "object/tangible/ship/components/armor/shared_arm_reward_alderaan_elite.iff"
result.... | anhstudios/swganh | data/scripts/templates/object/tangible/ship/components/armor/shared_arm_reward_alderaan_elite.py | Python | mit | 494 | 0.044534 |
#!/usr/bin/env python
#
# This code is a part of `ardrone_autopilot` project
# which is distributed under the MIT license.
# See `LICENSE` file for details.
#
"""
This node is based on `base.py`. See there a documentation.
Inputs
------
* in/image -- main picture stream.
Outputs
-------
* out/image -- result imag... | AmatanHead/ardrone-autopilot | nodes_opencv/frame.py | Python | mit | 1,941 | 0.00103 |
# 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 not u... | xhochy/arrow | python/pyarrow/tests/test_compute.py | Python | apache-2.0 | 34,188 | 0 |
import base64
import json
import responses
from mapbox.services.datasets import Datasets
username = 'testuser'
access_token = 'pk.{0}.test'.format(
base64.b64encode(b'{"u":"testuser"}').decode('utf-8'))
def test_class_attrs():
"""Get expected class attr values"""
serv = Datasets()
assert serv.api_... | mapbox/mapbox-sdk-py | tests/test_datasets.py | Python | mit | 8,145 | 0.000859 |
# encoding=utf-8
from tsundiary import app
app.jinja_env.globals.update(theme_nicename = {
'classic': 'Classic Orange',
'tsun-chan': 'Classic Orange w/ Tsundiary-chan',
'minimal': 'Minimal Black/Grey',
'misato-tachibana': 'Misato Tachibana',
'rei-ayanami': 'Rei Ayanami',
'rei-ayanami-2': 'Rei A... | neynt/tsundiary | tsundiary/jinja_env.py | Python | mit | 1,603 | 0.00815 |
# GUI Application automation and testing library
# Copyright (C) 2006-2018 Mark Mc Mahon and Contributors
# https://github.com/pywinauto/pywinauto/graphs/contributors
# http://pywinauto.readthedocs.io/en/latest/credits.html
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or with... | vasily-v-ryabov/pywinauto | pywinauto/unittests/test_win32functions.py | Python | bsd-3-clause | 5,560 | 0.00054 |
import logging
import os
from ftplib import FTP as FTPClient
from paramiko import SFTPClient, Transport as SFTPTransport
ALLOWED_BACKEND_TYPES = ['ftp', 'sftp']
DEFAULT_BACKEND_TYPE = 'ftp'
from wok_hooks.misc import Configuration as _Configuration
class Configuration(_Configuration):
def __init__(self, path, ... | abbgrade/wok_hooks | wok_hooks/hook_distribute.py | Python | mit | 9,715 | 0.001029 |
from datetime import datetime
from email.mime import text as mime_text
from unittest.mock import MagicMock
from unittest.mock import Mock
from unittest.mock import patch
import cauldron as cd
from cauldron.session import reloading
from cauldron.test import support
from cauldron.test.support import scaffolds
from cauld... | sernst/cauldron | cauldron/test/session/test_session_reloading.py | Python | mit | 4,115 | 0 |
#!/usr/bin/python
# -*- coding: utf8 -*-
"""
Copyright (C) 2012 Xycl
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This pr... | Xycl/plugin.image.mypicsdb | resources/lib/googlemaps.py | Python | gpl-2.0 | 6,409 | 0.021688 |
from random import randint
import gobject
import clutter
import mxpy as mx
sort_set = False
filter_set = False
def sort_func(model, a, b, data):
return int(a.to_hls()[0] - b.to_hls()[0])
def filter_func(model, iter, data):
color = iter.get(0)[0]
h = color.to_hls()[0]
return (h > 90 and h < 180)
def ... | buztard/mxpy | examples/test-item-view.py | Python | lgpl-2.1 | 1,682 | 0.002973 |
# Copyright 2010-2011, Sikuli.org
# Released under the MIT License.
from org.sikuli.script import VDictProxy
import java.io.File
##
# VDict implements a visual dictionary that has Python's conventional dict
# interfaces.
#
# A visual dictionary is a data type for storing key-value pairs using
# images as keys. Using... | ck1125/sikuli | sikuli-script/src/main/python/sikuli/VDict.py | Python | mit | 3,120 | 0.030128 |
import numpy as np
import matplotlib.pyplot as pl
class BasicHMC(object):
def __init__(self, model=None, verbose=True):
"""A basic HMC sampling object.
:params model:
An object with the following methods:
* lnprob(theta)
* lnprob_grad(theta)
* (opt... | bd-j/hmc | hmc.py | Python | gpl-2.0 | 15,392 | 0.001559 |
#!/usr/bin/python2
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
A script to check that the (Linux) executables produced by gitian only contain
allowed gcc, glibc and libstdc++ ve... | fcecin/infinitum | contrib/devtools/symbol-check.py | Python | mit | 6,197 | 0.011457 |
from __future__ import unicode_literals
__all__ = (
'Key',
'Keys',
)
class Key(object):
def __init__(self, name):
#: Descriptive way of writing keys in configuration files. e.g. <C-A>
#: for ``Control-A``.
self.name = name
def __repr__(self):
return '%s(%r)' % (self.... | jaseg/python-prompt-toolkit | prompt_toolkit/keys.py | Python | bsd-3-clause | 2,546 | 0.007855 |
from django.core.urlresolvers import resolve, Resolver404
from django.test import TestCase
from conman.routes import views
class RouteRouterViewTest(TestCase):
"""Test the route_router view."""
def assert_url_uses_router(self, url):
"""Check a url resolves to the route_router view."""
resolve... | meshy/django-conman | tests/routes/test_urls.py | Python | bsd-2-clause | 1,649 | 0.000606 |
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^', 'apps.neo_graph_test.views.create_graph', name='create_graph'),
url(r'^', include('apps.citizens.urls')),
... | levithomason/neo | apps/neo_graph_test/urls.py | Python | mit | 388 | 0.002577 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys
import re
import os
from urllib.request import urlretrieve
from urllib.request import urlopen
from urllib.request import build_opener, HTTPCookieProcessor
from urllib.parse import urlencode, quote
from http.cookiejar import CookieJar
from configparser import SafeCo... | utopianf/maobot_php | imgdl.py | Python | mit | 7,849 | 0.010957 |
import Gears as gears
from .. import *
from ..Pif.Base import *
class Min(Base) :
def applyWithArgs(
self,
spass,
functionName,
*,
pif1 : 'First operand. (Pif.*)'
= Pif.Solid( color = 'white' ),
pif2 : 'Sec... | szecsi/Gears | GearsPy/Project/Components/Composition/Min.py | Python | gpl-2.0 | 828 | 0.03744 |
from biohub.core.plugins import PluginConfig
class BadPluginConfig(PluginConfig):
name = 'tests.core.plugins.bad_plugin'
title = 'My Plugin'
author = 'hsfzxjy'
description = 'This is my plugin.'
def ready(self):
raise ZeroDivisionError
| igemsoftware2017/USTC-Software-2017 | tests/core/plugins/bad_plugin/apps.py | Python | gpl-3.0 | 268 | 0 |
from util.tipo import tipo
class S_PARTY_MEMBER_INTERVAL_POS_UPDATE(object):
def __init__(self, tracker, time, direction, opcode, data):
print(str(type(self)).split('.')[3]+'('+str(len(data))+'): '+ str(data.get_array_hex(1))[1:-1])
| jeff-alves/Tera | game/message/unused/S_PARTY_MEMBER_INTERVAL_POS_UPDATE.py | Python | mit | 246 | 0.012195 |
from tkinter import *
import mysql.connector as mysql
from MySQLdb import dbConnect
from HomeOOP import *
import datetime
from PIL import Image, ImageTk
class MainMenu(Frame):
def __init__(self, parent): #The very first screen of the web app
Frame.__init__(self, parent)
w, h = parent.winfo_screen... | ACBL-Bridge/Bridge-Application | Home Files/LoginandSignupV10.py | Python | mit | 17,362 | 0.013708 |
"""
Copy RWIS data from iem database to its final resting home in 'rwis'
The RWIS data is partitioned by UTC timestamp
Run at 0Z and 12Z, provided with a timestamp to process
"""
import datetime
import sys
import psycopg2.extras
from pyiem.util import get_dbconn, utc
def main(argv):
"""Go main"""
iemdb = g... | akrherz/iem | scripts/dbutil/rwis2archive.py | Python | mit | 5,737 | 0 |
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2005 (ita)
"Module called for configuring, compiling and installing targets"
import os, sys, shutil, traceback, datetime, inspect, errno
import Utils, Configure, Build, Logs, Options, Environment, Task
from Logs import error, warn, info
from Constants import *
... | urisimchoni/samba | third_party/waf/wafadmin/Scripting.py | Python | gpl-3.0 | 15,298 | 0.032684 |
import time
from pymongo import MongoClient
from datetime import datetime, timedelta
import json
from bson import Binary, Code
from bson.json_util import dumps
client = MongoClient('localhost', 27017)
db = client['election-2016']
def dumpData(yesterdayStr):
collectionName = 't' + yesterdayStr
cursor = db[... | seungkim11/election-2016 | python_streaming/yesterday_dump.py | Python | apache-2.0 | 1,289 | 0.006206 |
"""
Settings for testing the application.
"""
import os
DEBUG = True
DJANGO_RDFLIB_DEVELOP = True
DB_PATH = os.path.abspath(os.path.join(__file__, '..', '..', '..', 'rdflib_django.db'))
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': DB_PATH,
'USER': '',
... | publysher/rdflib-django | src/rdflib_django/testsettings.py | Python | mit | 1,265 | 0.000791 |
from vint.ast.traversing import traverse, register_traverser_extension
from vint.ast.parsing import Parser
from vint.ast.node_type import NodeType
REDIR_CONTENT = 'VINT:redir_content'
class RedirAssignmentParser(object):
""" A class to make redir assignment parseable. """
def process(self, ast):
... | Kuniwak/vint | vint/ast/plugin/scope_plugin/redir_assignment_parser.py | Python | mit | 1,250 | 0.0024 |
# Used for when precision or recall == 0 to supress warnings
def warn(*args, **kwargs):
pass
import warnings
warnings.warn = warn
import numpy as np
import sklearn_crfsuite
from sklearn.metrics import make_scorer, confusion_matrix
from sklearn_crfsuite import metrics
from sklearn_crfsuite.utils import flatten
from... | bmcinnes/VCU-VIP-Nanoinformatics | NERD/CRF/CRF.py | Python | gpl-3.0 | 5,075 | 0.00532 |
'''Biblioteca que contém as rotinas de coversão dos diferentes tipos
de máquinas.
Autor: Lucas Possatti
'''
import re
import collections
def mealy_to_moore(me):
'''Converte o parâmetro 'me' (que deve ser uma máquina Mealy) para
uma máquina de Moore, que é retornada.
'''
# Verifica se a máquina recebida, realemen... | possatti/memoo | converter.py | Python | mit | 6,467 | 0.025472 |
# -*- encoding: utf-8 -*-
from __future__ import print_function, unicode_literals, division, absolute_import
from enocean.protocol.eep import EEP
eep = EEP()
# profiles = eep.
def test_first_range():
offset = -40
values = range(0x01, 0x0C)
for i in range(len(values)):
minimum = float(i * 10 + off... | kipe/enocean | enocean/protocol/tests/test_temperature_sensors.py | Python | mit | 1,616 | 0.005569 |
#!/usr/bin/env python2.7
"""
Compare all sample graphs to baseline graphs (platvcf and g1kvcf).
depends on callVariants.py output directory structure. Can do:
1)kmer set (jaccard and recall)
2)corg overlap
"""
import argparse, sys, os, os.path, random, subprocess, shutil, itertools, glob
import doctest, re, json, col... | adamnovak/hgvm-graph-bakeoff-evalutations | scripts/computeVariantsDistances.py | Python | mit | 67,700 | 0.005628 |
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""Python 2<->3 compatibility module"""
import sys
def print_(template, *args, **kwargs):
template = str(template)
if args:
template ... | grepme/CMPUT410Lab01 | virt_env/virt1/lib/python2.7/site-packages/PasteDeploy-1.5.2-py2.7.egg/paste/deploy/compat.py | Python | apache-2.0 | 961 | 0.007284 |
#How to run this:
#Python libraries needed to run this file: Flask, Git Python, SQLAlchemy
#You will need to have Git installed, and it will need to be in your path.
#For example, on Windows you should be able to run a command like 'git pull' from the
#ordinary Windows command prompt and not just from Git Bash.
#You... | Hackers-To-Engineers/ghdata-sprint1team-2 | organizationHistory/pythonBlameHistoryTree.py | Python | mit | 12,918 | 0.014476 |
# Copyright (c) 2014 Ahmed H. Ismail
# 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... | spdx/tools-python | spdx/parsers/__init__.py | Python | apache-2.0 | 577 | 0 |
#!/usr/bin/env python
# -*- coding: ascii -*-
from subprocess import Popen, PIPE
import threading
import select
import logging
import fcntl
import time
import sys
import os
TTY_OPTS="-icrnl -onlcr -imaxbel -opost -isig -icanon -echo line 0 kill ^H min 100 time 2 brkint 115200"
READERS = []
WRITERS = []
SELECT_TO = 0.1... | safl/wtty | wtty/iod.py | Python | apache-2.0 | 5,729 | 0.002095 |
from __future__ import division, absolute_import, print_function,\
unicode_literals
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup, Extension
from distutils.core import Extension
from distutils.errors import DistutilsError
from distutils.command.bui... | romanoved/nanomsg-python | setup.py | Python | mit | 2,912 | 0.003777 |
# -*- coding: utf-8 -*-
"""The application's model objects"""
from zope.sqlalchemy import ZopeTransactionExtension
from sqlalchemy.orm import scoped_session, sessionmaker
# from sqlalchemy import MetaData
from sqlalchemy.ext.declarative import declarative_base
# Global session manager: DBSession() returns the Thread-... | LamCiuLoeng/budget | budget/model/__init__.py | Python | mit | 2,408 | 0.009551 |
# -*- coding: utf8 -*-
# This file is part of Mnemosyne.
#
# Copyright (C) 2013 Daniel Lombraña González
#
# Mnemosyne is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or... | PyBossa/mnemosyne | mnemosyne/core.py | Python | agpl-3.0 | 1,728 | 0.001159 |
from django.contrib.contenttypes.models import ContentType
from lfs.core.utils import import_symbol
from lfs.criteria.models import Criterion
import logging
logger = logging.getLogger(__name__)
# DEPRECATED 0.8
def is_valid(request, object, product=None):
"""
Returns True if the given object is valid. This ... | diefenbach/django-lfs | lfs/criteria/utils.py | Python | bsd-3-clause | 3,002 | 0.001666 |
"""
Load the CCGOIS datasets into a CKAN instance
"""
import dc
import json
import slugify
import ffs
def make_name_from_title(title):
# For some reason, we're finding duplicate names
name = slugify.slugify(title).lower()[:99]
if not name.startswith('ccgois-'):
name = u"ccgois-{}".format(name)
... | nhsengland/publish-o-matic | datasets/ccgois/load.py | Python | mit | 3,287 | 0.003651 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | SUSE/azure-sdk-for-python | azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/namespace_create_or_update_parameters.py | Python | mit | 4,958 | 0.001412 |
# Copyright (c) 2014, Salesforce.com, Inc. All rights reserved.
# Copyright (c) 2015, Google, Inc.
#
# 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
... | fritzo/loom | loom/gridding.py | Python | bsd-3-clause | 3,080 | 0.000649 |
#!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
Pelix shell bundle.
Provides the basic command parsing and execution support to make a Pelix shell.
:author: Thomas Calmant
:copyright: Copyright 2014, isandlaTech
:license: Apache License 2.0
:version: 0.5.8
:status: Beta
..
Copyright 2014 isandlaTech
... | isandlaTech/cohorte-demos | led/dump/led-demo-yun/cohorte/dist/cohorte-1.0.0-20141216.234517-57-python-distribution/repo/pelix/shell/core.py | Python | apache-2.0 | 48,234 | 0 |
from .depth import *
from .camera import *
from .contact import *
from .imagefeature import *
from .arduino import *
| poppy-project/pypot | pypot/sensor/__init__.py | Python | gpl-3.0 | 117 | 0 |
# -*- coding: utf-8 -*-
"""
# This is authentication backend for Django middleware.
# In settings.py you need to set:
MIDDLEWARE_CLASSES = (
...
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.RemoteUserMiddleware',
...
)
AUTHENTICATION_BACKENDS = (
'kob... | pombredanne/https-git.fedorahosted.org-git-kobo | kobo/django/auth/krb5.py | Python | lgpl-2.1 | 1,587 | 0.00189 |
from distutils.core import setup
from setuptools import setup, find_packages
setup(
name = 'gooeydist',
packages = find_packages(), # this must be the same as the name above
version = '0.2',
description = 'Gooey Language',
author = 'Gooey Comps',
author_email = 'harrise@carleton.edu',
url = 'https://github.com/G... | GooeyComps/gooey-dist | setup.py | Python | mit | 542 | 0.068266 |
# -*- coding: utf-8 -*-
from loading import load_plugins, register_plugin
from plugz import PluginTypeBase
from plugintypes import StandardPluginType
__author__ = 'Matti Gruener'
__email__ = 'matti@mistermatti.com'
__version__ = '0.1.5'
__ALL__ = [load_plugins, register_plugin, StandardPluginType, PluginTypeBase]
| mistermatti/plugz | plugz/__init__.py | Python | bsd-3-clause | 317 | 0 |
'''
go list comprehensions
'''
def main():
a = []int(x for x in range(3))
TestError( len(a)==3 )
TestError( a[0]==0 )
TestError( a[1]==1 )
TestError( a[2]==2 )
| pombredanne/PythonJS | regtests/go/list_comprehension.py | Python | bsd-3-clause | 167 | 0.107784 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2017-09-14 23:53
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('organization', '0004_teacher_image'),
('courses', '0... | LennonChin/Django-Practices | MxOnline/apps/courses/migrations/0007_course_teacher.py | Python | apache-2.0 | 640 | 0.001563 |
import dns
import os
import socket
import struct
import threading
import time
import clientsubnetoption
import subprocess
from recursortests import RecursorTest
from twisted.internet.protocol import DatagramProtocol
from twisted.internet import reactor
emptyECSText = 'No ECS received'
nameECS = 'ecs-echo.example.'
nam... | shinsterneck/pdns | regression-tests.recursor-dnssec/test_RoutingTag.py | Python | gpl-2.0 | 11,767 | 0.003144 |
###############################################################################
# _*_ coding: utf-8
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from __future__ import unicode_literals
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook... | jvrsantacruz/XlsxWriter | xlsxwriter/test/comparison/test_utf8_03.py | Python | bsd-2-clause | 1,089 | 0 |
# Copyright 2015 The TensorFlow 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 applica... | freedomtan/tensorflow | tensorflow/python/training/ftrl.py | Python | apache-2.0 | 13,362 | 0.00232 |
# File: setup.py
# Version: 3
# Description: Setup for SHA2017 badge
# License: MIT
# Authors: Renze Nicolai <renze@rnplus.nl>
# Thomas Roos <?>
import ugfx, badge, appglue, dialogs, easydraw, time
def asked_nickname(value):
if value:
badge.nvs_set_str("owner", "name", value)
# Do the ... | SHA2017-badge/micropython-esp32 | esp32/modules/setup.py | Python | mit | 894 | 0.004474 |
import os
from home.models import ReplicaSet, WhatTorrent, WhatFulltext
def run_checks():
errors = []
warnings = []
# Check WhatFulltext integrity
def check_whatfulltext():
w_torrents = dict((w.id, w) for w in WhatTorrent.objects.defer('torrent_file').all())
w_fulltext = dict((w.id, ... | MADindustries/WhatManager2 | WhatManager2/checks.py | Python | mit | 2,864 | 0.003492 |
import asposecellscloud
from asposecellscloud.CellsApi import CellsApi
from asposecellscloud.CellsApi import ApiException
import asposestoragecloud
from asposestoragecloud.StorageApi import StorageApi
apiKey = "XXXXX" #sepcify App Key
appSid = "XXXXX" #sepcify App SID
apiServer = "http://api.aspose.com/v1.1"
data_fol... | asposecells/Aspose_Cells_Cloud | Examples/Python/Examples/ClearCellFormattingInExcelWorksheet.py | Python | mit | 1,485 | 0.010101 |
# Support for building census bundles in Ambry
__version__ = 0.8
__author__ = 'eric@civicknowledge.com'
from .generator import *
from .schema import *
from .sources import *
from .transforms import *
import ambry.bundle
class AcsBundle(ambry.bundle.Bundle, MakeTablesMixin, MakeSourcesMixin,
JamValue... | CivicKnowledge/censuslib | censuslib/__init__.py | Python | mit | 3,138 | 0.013384 |
#!/usr/bin/python
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.cli import CLI
from mininet.log import setLogLevel, info, debug
from mininet.node import Host, RemoteController, OVSSwitch
# Must exist and be owned by quagga user (quagga:quagga by default on Ubuntu)
QUAGGA_RUN_DIR = '/var/r... | TakeshiTseng/SDN-Work | mininet/bgp/topo.py | Python | mit | 3,549 | 0.001972 |
# This file is autogenerated. Do not edit it manually.
# If you want change the content of this file, edit
#
# spec/fixtures/responses/whois.nic.pw/status_available
#
# and regenerate the tests with the following script
#
# $ scripts/generate_tests.py
#
from nose.tools import *
from dateutil.parser import parse a... | huyphan/pyyawhois | test/record/parser/test_response_whois_nic_pw_status_available.py | Python | mit | 2,000 | 0.003 |
#!/usr/bin/env python
'''
simple templating system for mavlink generator
Copyright Andrew Tridgell 2011
Released under GNU GPL version 3 or later
'''
from mavparse import MAVParseError
class MAVTemplate(object):
'''simple templating system'''
def __init__(self,
start_var_token="... | kd0aij/matrixpilot_old | Tools/MAVLink/mavlink/pymavlink/generator/mavtemplate.py | Python | gpl-3.0 | 5,130 | 0.003119 |
#!/usr/bin/env python
# Copyright 2020 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 heapq
import os
import platform
import random
import signal
import subprocess
# Base dir of the build products for Release an... | youtube/cobalt | third_party/v8/tools/testrunner/testproc/util.py | Python | bsd-3-clause | 2,389 | 0.007535 |
# -*- coding: utf-8 -*-
from plugins import Plugin
from PyQt4 import QtCore, QtGui
import tempfile, codecs
import os, subprocess
class rst2pdf(Plugin):
name='rst2pdf'
shortcut='Ctrl+F8'
description='Run through rst2pdf and preview'
tmpf=None
def run(self):
print "Running rst2pdf"
... | thegooglecodearchive/marave | marave/plugins/rst2pdf.py | Python | gpl-2.0 | 1,268 | 0.014984 |
"""HOOMD simulation format."""
import itertools
import operator
import warnings
from collections import namedtuple
import numpy as np
import parmed as pmd
import mbuild as mb
from mbuild.utils.conversion import RB_to_OPLS
from mbuild.utils.io import import_
from mbuild.utils.sorting import natural_sort
from .hoomd_s... | iModels/mbuild | mbuild/formats/hoomd_simulation.py | Python | mit | 16,626 | 0.00012 |
"""
WSGI config for kanban project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` s... | clione/django-kanban | src/kanban/wsgi.py | Python | mit | 1,419 | 0.000705 |
#!/usr/bin/env python
# The really simple Python version of Qwt-5.0.0/examples/simple
# for debugging, requires: python configure.py --trace ...
if False:
import sip
sip.settracemask(0x3f)
import sys
import qt
import Qwt5 as Qwt
from Qwt5.anynumpy import *
class SimplePlot(Qwt.QwtPlot):
def __init__... | PyQwt/PyQwt5 | qt3examples/ReallySimpleDemo.py | Python | gpl-2.0 | 2,005 | 0.015461 |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from pant... | baroquebobcat/pants | tests/python/pants_test/init/repro_mixin.py | Python | apache-2.0 | 1,635 | 0.004893 |
import genxmlif
from genxmlif.xmlifODict import odict
xmlIf = genxmlif.chooseXmlIf(genxmlif.XMLIF_ELEMENTTREE)
xmlTree = xmlIf.createXmlTree(None, "testTree", {"rootAttr1":"RootAttr1"})
xmlRootNode = xmlTree.getRootNode()
myDict = odict( (("childTag1","123"), ("childTag2","123")) )
xmlRootNode.appendChild("childTag", ... | UgCS/vsm-cpp-sdk | tools/mavgen/lib/genxmlif/xmliftest.py | Python | bsd-3-clause | 670 | 0.022388 |
from jsbuild.attrdict import AttrDict
from time import strftime
class Manifest(AttrDict):
def __init__(self,*args,**kwargs):
super(AttrDict, self).__init__(*args,**kwargs)
self._buffer_ = None
self._parent_ = None
if not self.__contains__('_dict_'):
self['_dict_'] = {}
self['_dict_']... | azer/jsbuild | jsbuild/manifest.py | Python | mit | 673 | 0.028232 |
import sys
import unittest
sys.path.append('../../')
import lib.event
class TestEvents(unittest.TestCase):
def setUp(self):
TestEvents.successful = False
TestEvents.successful2 = False
def test_subscribe(self):
@lib.event.subscribe('test')
def subscribe_test():
Te... | Javex/qllbot | tests/lib_tests/events.py | Python | bsd-2-clause | 1,213 | 0.000824 |
# -*- coding: utf-8 -*-
# import sqlite3 as sqlite
import sys
import uuid
from pysqlcipher3 import dbapi2 as sqlite
def main():
print("***************** Welcome to OSS DataMaster-Rigster System *******************")
print("* *")
pri... | summychou/CSForOSS | CA/OSSQt_DataMasterRigster.py | Python | mit | 2,535 | 0.008748 |
import sys
import pytest
import numpy as np
import xgboost as xgb
from xgboost.compat import PANDAS_INSTALLED
from hypothesis import given, strategies, assume, settings
if PANDAS_INSTALLED:
from hypothesis.extra.pandas import column, data_frames, range_indexes
else:
def noop(*args, **kwargs):
pass
... | dmlc/xgboost | tests/python-gpu/test_gpu_prediction.py | Python | apache-2.0 | 17,716 | 0.000903 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# cellulist documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# 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
# a... | eddiejessup/cellulist | docs/conf.py | Python | bsd-3-clause | 8,421 | 0.005344 |
from pytest_factoryboy import register
from meinberlin.test.factories import kiezkasse
register(kiezkasse.ProposalFactory)
| liqd/a4-meinberlin | tests/kiezkasse/conftest.py | Python | agpl-3.0 | 125 | 0 |
# This file is part of Indico.
# Copyright (C) 2002 - 2022 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from wtforms.fields import StringField
from wtforms.validators import DataRequired
from wtforms_sqlalchemy... | indico/indico | indico/modules/events/tracks/forms.py | Python | mit | 2,016 | 0.001984 |
#
# (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... | rmfitzpatrick/ansible | lib/ansible/plugins/action/nxos.py | Python | gpl-3.0 | 4,638 | 0.001725 |
import _plotly_utils.basevalidators
class TypesrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self,
plotly_name="typesrc",
parent_name="scatterternary.marker.gradient",
**kwargs
):
super(TypesrcValidator, self).__init__(
plotly_name=pl... | plotly/plotly.py | packages/python/plotly/plotly/validators/scatterternary/marker/gradient/_typesrc.py | Python | mit | 454 | 0 |
#!/usr/bin/env python
import os.path
import sys
# Version file managment scheme and graceful degredation for
# setuptools borrowed and adapted from GitPython.
try:
from setuptools import setup, find_packages
# Silence pyflakes
assert setup
assert find_packages
except ImportError:
from ez_setup imp... | heroku/wal-e | setup.py | Python | bsd-3-clause | 1,831 | 0.001092 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.