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 |
|---|---|---|---|---|---|
#!/usr/bin/env python
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that ... | gurjeet/IntelligentMirror | intelligentmirror/intelligentmirror.py | Python | gpl-2.0 | 18,091 |
# -*- coding: utf-8 -*-
from ilo_utils import * # NOQA
| jonstacks13/ilo-utils | tests/__init__.py | Python | bsd-3-clause | 57 |
# -*- coding: utf-8 -*-
"""
Copyright 2014 Michael Davidsaver
GPL 2+
See license in README
"""
import logging
LOG = logging.getLogger(__name__)
import time, os
def djangosetup(opts):
if 'DJANGO_SETTINGS_MODULE' in os.environ:
return
from django.conf import settings
settings.configure(INSTALLED_AP... | mdavidsaver/alarmmailer | alarmmail/util.py | Python | gpl-2.0 | 5,633 |
# -*- Mode: Python; test-case-name: flumotion.test.test_defer -*-
# vi:si:et:sw=4:sts=4:ts=4
#
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007 Fluendo, S.L. (www.fluendo.com).
# All rights reserved.
# This file may be distributed and/or modified under the terms of
# the GNU General Public Li... | offlinehacker/flumotion | flumotion/twisted/defer.py | Python | gpl-2.0 | 9,411 |
#!/usr/bin/python
import numpy as np
import pylab as pl
import pandas as pd
from optparse import OptionParser
#option parser for new files
usage = "usage: %prog [options] arg"
parser = OptionParser(usage)
parser.add_option("--file", type="string", dest="inputfile", default="collectedCharge")
(options, args) = parser... | maxhebditch/faunus | scripts/pythonTitration.py | Python | gpl-2.0 | 531 |
# -*- coding: utf-8 -*-
#
# Kolibri 'developer docs' build configuration file
#
# This file is execfile()d with the current directory set to its containing dir.
import inspect
import os
import sys
from datetime import datetime
import django
from django.utils.encoding import force_text
from django.utils.html import str... | DXCanas/kolibri | docs/conf.py | Python | mit | 7,987 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'G:\WorkDir\gas-sensing_resistors\ST_spectrum\ST_main.ui'
#
# Created: Tue Jan 19 22:08:53 2016
# by: PyQt4 UI code generator 4.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
from Rtime_mp... | cygnushan/measurement | ST_spectrum/Ui_ST_main.py | Python | mit | 31,581 |
# vim: set fileencoding=utf-8 :
#
# PeerDrive
# Copyright (C) 2011 Jan Klötzke <jan DOT kloetzke AT freenet DOT de>
#
# 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 Lic... | peerdrive/peerdrive | client/peerdrive/struct.py | Python | gpl-3.0 | 10,142 |
"""Contains the implementation for the DirectoryWatcher class."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from tensorflow.python.platform import gfile
from tensorflow.python.platform import logging
class DirectoryWatcher(object):
"""A ... | arunhotra/tensorflow | tensorflow/python/summary/impl/directory_watcher.py | Python | apache-2.0 | 4,586 |
#! /usr/bin/env python
# encoding: utf-8
import sys
if sys.hexversion < 0x020400f0: from sets import Set as set
import os,sys,imp,string,errno,traceback,inspect,re,shutil,datetime,gc
try:from UserDict import UserDict
except ImportError:from collections import UserDict
if sys.hexversion>=0x2060000 or os.name=='java':
i... | micove/libdesktop-agnostic | wafadmin/Utils.py | Python | lgpl-2.1 | 11,373 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from GestureAgentsTUIO.Tuio import TuioAgentGenerator
import GestureAgentsPygame.Screen as Screen
from pygame.locals import *
class MouseAsTuioAgentGenerator(object):
def __init__(self):
self.pressed = False
self.myagent = None
self.sid = -1... | chaosct/GestureAgents | GestureAgentsPygame/Mouse.py | Python | mit | 1,272 |
# Copyright 2019 The Kubeflow 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | kubeflow/pipelines | sdk/python/tests/compiler/testdata/add_pod_env.py | Python | apache-2.0 | 1,058 |
from sys import stderr
from typing import Dict, List, Tuple
n = int(input())
m = int(input())
total_yes: int = 0
total_no: int = 0
voters: Dict[str, int] = dict()
for i in range(n):
person_name, nb_vote = input().split()
nb_vote = int(nb_vote)
voters[person_name] = nb_vote
# Storage of how voted wh... | informaticienzero/CodinGame | Communautaires/Vote counting.py | Python | mit | 2,168 |
# -*- coding: utf-8 -*-
import datetime
def author_factory(author_string):
from stats.models import Author
return Author.objects.get_or_create(author_string)
def simple_method_cacher(method):
def _decorator(self, *args):
if not hasattr(self, '_%s_cache' % method.__name__):
setattr(self... | ojii/gitstats.ep.io | src/git_statistics/utils.py | Python | bsd-3-clause | 1,366 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
FILTER_COEFF = [
-845859, -459003, -573589, -703227, -848199, -1008841,
-1183669, -1372046, -1573247, -1787578, -2011503, -2243311,
-2482346, -2723079, -2964681, -3202200, -3432186, -3650186,
-3851924, -4032122, -4185340, -4306430, -4389146, -442778... | crypto-mint/ceuro | share/difficulty_adjustment/simulator.py | Python | mit | 4,915 |
from typing import Union
from ray.rllib.models.action_dist import ActionDistribution
from ray.rllib.utils.annotations import override
from ray.rllib.utils.exploration.exploration import TensorType
from ray.rllib.utils.exploration.soft_q import SoftQ
from ray.rllib.utils.framework import try_import_tf, try_import_torch... | ray-project/ray | rllib/utils/exploration/slate_soft_q.py | Python | apache-2.0 | 1,483 |
''' Dummy NFC Provider to be used on desktops in case no other provider is found
'''
from electrum_vtc_gui.kivy.nfc_scanner import NFCBase
from kivy.clock import Clock
from kivy.logger import Logger
class ScannerDummy(NFCBase):
'''This is the dummy interface that gets selected in case any other
hardware interf... | pknight007/electrum-vtc | gui/kivy/nfc_scanner/scanner_dummy.py | Python | mit | 1,508 |
"""
Created on 26 Aug 2019
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
"""
from collections import OrderedDict
from enum import Enum
from scs_core.data.json import JSONReport
# --------------------------------------------------------------------------------------------------------------------
class... | south-coast-science/scs_core | src/scs_core/data/queue_report.py | Python | mit | 4,239 |
# 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... | nathanbjenx/cairis | cairis/gui/SingleGoalDialog.py | Python | apache-2.0 | 5,016 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/data/Public/qt-learning/ui/windows/fileBrowser/forms/previewInfo.ui'
#
# Created: Tue Nov 14 18:49:58 2017
# by: PyQt4 UI code generator 4.6.2
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
c... | david-cattermole/qt-learning | python/qtLearn/windows/fileBrowser/forms/ui_previewInfo.py | Python | bsd-3-clause | 3,191 |
# -*- coding: utf-8 -*-
# This file is part of KTBS <http://liris.cnrs.fr/sbt-dev/ktbs>
# Copyright (C) 2011-2012 Pierre-Antoine Champin <pchampin@liris.cnrs.fr> /
# Françoise Conil <francoise.conil@liris.cnrs.fr> /
# Universite de Lyon <http://www.universite-lyon.fr>
#
# KTBS is free software: you can ... | ktbs/ktbs | utest/test_ktbs_method_override_param.py | Python | lgpl-3.0 | 2,966 |
#
# rtlsdr_scan
#
# http://eartoearoak.com/software/rtlsdr-scanner
#
# Copyright 2012 - 2015 Al Brown
#
# A frequency scanning GUI for the OsmoSDR rtl-sdr library at
# http://sdr.osmocom.org/trac/wiki/rtl-sdr
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gene... | dirkcgrunwald/RTLSDR-Scanner | src/main_window.py | Python | gpl-3.0 | 53,177 |
from setuptools import find_packages
from setuptools import setup
version = '3.0.1'
setup(name='helios-sdk',
version=version,
description='Use the Helios APIs in Python',
author='Michael Bayer',
author_email='mbayer@harris.com',
url='https://github.com/harris-helios/helios-sdk-python',
... | harris-helios/helios-sdk-python | setup.py | Python | mit | 1,247 |
#!/usr/bin/env python
#
# Generate pnSeed[] from Pieter's DNS seeder
#
NSEEDS=600
import re
import sys
from subprocess import check_output
def main():
lines = sys.stdin.readlines()
ips = []
pattern = re.compile(r"^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3}):31469")
for line in lines:
m = patt... | gapcoin/gapcoin | contrib/seeds/makeseeds.py | Python | mit | 709 |
# -*- coding: utf-8 -*-
# This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser 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 distri... | Affirm/suds-jurko | tests/test_wsse.py | Python | lgpl-3.0 | 1,605 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
class Migration(migrations.Migration):
dependencies = [
('idphotoupload', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='checkinphot... | prachetos/goibibo-hackathon2016 | hackathon2016/idphotoupload/migrations/0002_auto_20161014_1628.py | Python | apache-2.0 | 1,226 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2019-07-31 15:53
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('sync', '0003_synctarget_lastrun'),
]
operations = [
migrations.RenameModel(
... | tdfischer/organizer | sync/migrations/0004_auto_20190731_1553.py | Python | agpl-3.0 | 403 |
# Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | queria/my-tempest | tempest/services/compute/v3/json/extensions_client.py | Python | apache-2.0 | 1,628 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import uuid
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migra... | goldhand/link-shortener | links/migrations/0001_initial.py | Python | bsd-3-clause | 807 |
import unittest
import cheesedb
import table_objects
import sqlite3
class TestCDB(unittest.TestCase):
def setUp(self):
pass
def test_table_object_cheese(self):
x = table_objects.cheese(1, "a", "b")
self.assertEqual(x.get_id() == 1, True)
self.assertEqual(x.get_name() == "a", True)
self.assertEqual(x.g... | Jazpy/MYP-P2 | test_cheesedb.py | Python | mit | 1,405 |
#!/usr/bin/env python
"""
Setuptools bootstrapping installer.
Maintained at https://github.com/pypa/setuptools/tree/bootstrap.
Run this script to install or upgrade setuptools.
"""
import os
import shutil
import sys
import tempfile
import zipfile
import optparse
import subprocess
import platform
import textwrap
imp... | congpc/DjangoExample | tools/ez_setup.py | Python | bsd-2-clause | 12,746 |
# 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... | sammyyu/Cassandra | test/system/__init__.py | Python | apache-2.0 | 4,085 |
import os
import sys
import urllib2
import tarfile
import shutil
import stat
import platform
__version__ = "0.1.4"
base = sys.prefix
srcdir = "src"
bindir = "bin"
binpypy = os.path.join(bindir, "pypy")
pypydir = "pypy"
version = sys.version[:3]
yes = ("y", "yes")
def out(s):
print " * " + s
def install(downl... | boronine/pypyenv | pypyenv.py | Python | mit | 3,551 |
# -*- coding: utf-8 -*-
#
# SelfTest/Random/Fortuna/test_FortunaGenerator.py: Self-test for the FortunaGenerator module
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain.... | ktan2020/legacy-automation | win/Lib/site-packages/Crypto/SelfTest/Random/Fortuna/test_FortunaGenerator.py | Python | mit | 3,506 |
#-*- coding:utf-8 -*-
"""
This file is part of OpenSesame.
OpenSesame 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.
OpenSesame is distri... | amazinger2013/OpenSesame | libqtopensesame/widgets/preferences_widget.py | Python | gpl-3.0 | 4,576 |
# -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from datetime import (
datetime,
timedelta,
)
from dateutil.relativedelta import relativedelta
from base.tests.model_maker import clean_and_save
from booking.models import (
Booking,
Category,
Location,
)
def get_alpe_d_huez():
... | pkimber/booking | booking/tests/scenario.py | Python | apache-2.0 | 2,769 |
from hakoblog.model.blog import Blog
class BlogLoader:
@classmethod
def find_by_id(cls, db, blog_id):
with db.cursor() as cursor:
cursor.execute(
"""
SELECT id, owner_id, title
FROM blog
WHERE id = %s
LIMIT 1
... | hakobe/hakoblog-python | hakoblog/loader/blog.py | Python | mit | 964 |
# Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | priya-pp/Tacker | tacker/tests/unit/test_auth.py | Python | apache-2.0 | 4,418 |
"""
A management command which deletes expired accounts (e.g.,
accounts which signed up but never activated) from the database.
Calls ``RegistrationProfile.objects.delete_expired_users()``, which
contains the actual logic for determining which accounts are deleted.
"""
from django.core.management.base import NoArgsC... | ProvincalInovationManagement/provinceManagement | registration/management/commands/cleanupregistration.py | Python | agpl-3.0 | 630 |
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2014 TrilioData, Inc
# Copyright (c) 2015 EMC Corporation
# Copyright (C) 2015 Kevin Fox <kevin@efox.cc>
# Copyright (C) 2015 Tom Barron <tpb@dyncloud.net>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "Li... | cloudbase/cinder | cinder/backup/drivers/swift.py | Python | apache-2.0 | 17,026 |
class Backend:
# Constructor creating a local Strus context with the storage configuration
# string passed as argument:
def __init__(self, config):
pass
# Insert a multipart document as described in step 1 (doing nothing for the moment):
def insertDocuments( self, content):
return ... | patrickfrey/strusDocker | strus-ub1604-torntuto/src/step6/strusIR.py | Python | mpl-2.0 | 1,154 |
from functools import wraps
from django.contrib import messages
def mark_for_caching(func):
"""
Decorator that enabled caching for this page.
It's similar to ``cache_page`` decorator, but will work with middlewares
that set headers (e.g. LocaleMiddleWare, SessionMiddleware,
AuthenticationMiddleware... | rory/django-default-dont-cache | default_dont_cache/decorators.py | Python | gpl-3.0 | 782 |
"""Path-handling functions for Schevo script commands."""
# Copyright (c) 2001-2009 ElevenCraft Inc.
# See LICENSE for details.
import sys
from schevo.lib import optimize
import os
def package_path(pkg_or_path):
"""If pkg_or_path is a module, return its path; otherwise,
return pkg_or_path."""
from_list... | Schevo/schevo | schevo/script/path.py | Python | mit | 816 |
from rest_framework import serializers
from onadata.apps.api.models.project import Project
class ProjectField(serializers.WritableField):
def to_native(self, obj):
return obj.pk
def from_native(self, data):
return Project.objects.get(pk=data)
| jomolinare/kobocat | onadata/libs/serializers/fields/project_field.py | Python | bsd-2-clause | 270 |
# Copyright (C) 2014-2016 Red Hat, Inc.
# This library 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 2.1 of the License, or (at your option) any later version.
#
# This library is dis... | joehandzik/libstoragemgmt-1 | plugin/smispy/utils.py | Python | lgpl-2.1 | 3,706 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Addons modules by CLEARCORP S.A.
# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
#
# This program is free software: you can redistribute... | sysadminmatmoz/odoo-clearcorp | res_currency_priority/res_currency_priority.py | Python | agpl-3.0 | 2,703 |
#!/usr/bin/python
# Author: Shawn Hymel
# Copyright (c) 2016 SparkFun Electronics
#
# 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 rig... | whbruce/upm | examples/python/ili9341.py | Python | mit | 2,882 |
# 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
# distributed under t... | stackforge/python-openstacksdk | openstack/tests/unit/dns/v2/test_zone.py | Python | apache-2.0 | 2,965 |
'''
File that keeps log types and their column information
@package logviewer.views.indexes
@authors Deniz Eren
@authors Ibrahim Ercan
@authors Ersan Vural Zorlu
@authors Nijad Ahmadli
@copyright This project is released under BSD license
@date 2013/03/31
'''
# Network Log
network = {
... | logviewer/logviewer | src/logviewer/views/indexes.py | Python | bsd-3-clause | 4,409 |
#!/usr/bin/env python
import time
import rospy
import actionlib
from control_msgs.msg import *
from trajectory_msgs.msg import *
JOINT_NAMES = ['joint_1', 'joint_2', 'joint_3', 'joint_4', 'joint_5', 'joint_6']
Q1 = [2.2,0,-1.57,0,0,0]
Q2 = [1.5,0,-1.57,0,0,0]
Q3 = [1.5,-0.2,-1.57,0,0,0]
client = None
def move1():
... | adamleon/kuka | kuka_sim/scripts/test_move.py | Python | bsd-3-clause | 3,641 |
"""
To run `django-admin.py syncdb --settings settings --noinput` before testing.
"""
SECRET_KEY = 'x'
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'travis_ci_test',
}
}
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'dj... | datamade/represent-boundaries | settings.py | Python | mit | 419 |
'''
This file loads in data from /data/interim/interim_data.hdf and then
applies a sinusoidal regression model to the temperature data to remove
the yearly predictable variation.
NOTE: This file is intended to be executed by make from the top
level of the project directory hierarchy. We rely on os.getcwd()
and it wil... | RJTK/dwglasso_cweeds | src/data/sinusoid_regression.py | Python | mit | 2,984 |
_zoo = 1
__zar = 2
_zoo
| ahb0327/intellij-community | python/testData/completion/oneUnderscore.after.py | Python | apache-2.0 | 25 |
import serf
import pytest
import msgpack
from _base import FakeClient, FakeConnection
def test_request_query () :
_body = dict(
FilterNodes=["node0", "node1", ],
FilterTags={"role": ".*"},
RequestAck=True,
Timeout=0,
Name='response-me',
Payl... | spikeekips/serf-python-travis-test | test/test_command_query.py | Python | mpl-2.0 | 2,945 |
# 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... | alsrgv/tensorflow | tensorflow/python/ops/nn_grad.py | Python | apache-2.0 | 38,717 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pu... | sysadminmatmoz/ingadhoc | stock_picking_partner_editable/__openerp__.py | Python | agpl-3.0 | 1,618 |
from __future__ import print_function
import manifest_utils
import http_utils
import sys
import os
if len(sys.argv) < 3:
print('Usage:\n\tpython %s <manifest url> <output path>' % os.path.basename(__file__))
sys.exit(1)
_, manifestUrl, outputPath = sys.argv
code, headers, body = http_utils.getUrl(manifestUrl, {})
... | kaltura/nginx-vod-module | test/download_stream.py | Python | agpl-3.0 | 670 |
from guardian.compat import include, url, handler404, handler500
from django.conf import settings
from django.contrib import admin
from django.contrib.auth.views import LogoutView
__all__ = ['handler404', 'handler500']
admin.autodiscover()
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^logout/$', ... | rmgorman/django-guardian | example_project/urls.py | Python | bsd-2-clause | 704 |
#!/usr/bin/env python
# -*- coding: UTF8 -*-
"""The muigi python package.
Muigi --- full name "Muigi the Microplumber" --- provides control over
microfluidic devices. It is organised as python package to allow modules to
include each other.
The package currently contains two modules:
* muigi.hardware - connect and... | douglas-watson/muigi | muigi/__init__.py | Python | gpl-3.0 | 440 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '_account_settings.ui'
#
# Created: Tue Oct 12 14:22:17 2010
# by: PyQt4 UI code generator 4.7.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_Dialog(object):
def setupUi(self, Di... | mnunberg/yobot | py/gui/_account_settings.py | Python | gpl-3.0 | 7,271 |
from bs4 import BeautifulSoup
from urllib import quote_plus
import urllib2
import re
import MySQLdb
import unicodedata
import json
import argparse
parser = argparse.ArgumentParser(prog="Ski")
parser.add_argument('-v', dest='verbose', default=False, action='store_true', help='verbose')
parser.add_argument('-... | Alex-Rose/SomeScripts | ski.py | Python | mit | 8,508 |
import unittest
import shutil
import tempfile
from pathlib import Path
import cv2
import numpy as np
from inselect.lib.document import InselectDocument
from inselect.lib.ingest import IMAGE_SUFFIXES_RE
from inselect.lib.inselect_error import InselectError
from inselect.lib.utils import rmtree_readonly
from inselect... | NaturalHistoryMuseum/inselect | inselect/tests/scripts/test_ingest.py | Python | bsd-3-clause | 4,181 |
__author__ = "Radical.Utils Development Team (Andre Merzky)"
__copyright__ = "Copyright 2013, RADICAL@Rutgers"
__license__ = "MIT"
import os
import time
import lockable
import singleton
import threading
# default settings for lease manager
MAX_POOL_SIZE = 10 # unlimited
MAX_POOL_WAIT = 60 # seconds
MAX... | anisyonk/pilot | radical/utils/lease_manager.py | Python | apache-2.0 | 14,462 |
# -*- coding: utf-8 -*-
def social_grimace(entity, argument):
return True
#- Fine Funzione -
| Onirik79/aaritmud | src/socials/social_grimace.py | Python | gpl-2.0 | 98 |
class Solution:
def canVisitAllRooms(self, rooms):
"""
:type rooms: List[List[int]]
:rtype: bool
"""
N = len(rooms)
v = [0] * N
v[0] = 1
q = rooms[0]
while q:
key = q.pop(0)
if v[key] == 1:
... | YiqunPeng/Leetcode-pyq | solutions/841KeysAndRooms.py | Python | gpl-3.0 | 467 |
from django.conf import settings
_TRACKING_USPS_URL = 'http://trkcnfrm1.smi.usps.com/PTSInternetWeb/InterLabelInquiry.do?origTrackNum='
TRACKING_USPS_URL = getattr(settings, 'OWNEY_USPS_TRACKING_URL', _TRACKING_USPS_URL)
_USPS_API_URL = 'http://production.shippingapis.com/ShippingAPI.dll'
USPS_API_URL = getattr(setti... | JohnSpeno/owney | owney/conf/settings.py | Python | mit | 635 |
import os
from nose.plugins.skip import SkipTest
if os.name == "nt":
raise SkipTest("Skipped on Windows.")
import sys
import libmproxy.console.contentview as cv
from libmproxy import utils, flow, encoding
import tutils
try:
import pyamf
except ImportError:
pyamf = None
try:
import cssutils
except:
... | xtso520ok/mitmproxy | test/test_console_contentview.py | Python | mit | 7,465 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | kionetworks/openstack-dashboard-essex | openstack_dashboard/views.py | Python | apache-2.0 | 2,999 |
#! /usr/bin/python3
import os
import sys
import time
import random
class Environment:
def __init__(self, height=30, width=50):
self.height = height
self.width = width
self.agents_dict = dict()
self.__populate()
def run_next_step(self):
for (i, j), element in self.agents_dict.items():
new_position = e... | NG0S/virtual-life | old/VirtualCell.py | Python | gpl-3.0 | 1,743 |
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
from future import standard_library
standard_library.install_aliases()
from builtins import next
from nipype.testing import (assert_equal, assert_true, assert_false,
... | carolFrohlich/nipype | nipype/utils/tests/test_misc.py | Python | bsd-3-clause | 2,516 |
#!/usr/bin/env python3
# Copyright © 2012-13 Qtrac Ltd. All rights reserved.
# This program or module 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 ... | iceihehe/pipeg | python3/imagescale/Globals.py | Python | mit | 907 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
doContour.py
---------------------
Date : June 2010
Copyright : (C) 2010 by Giuseppe Sucameli
Email : brush dot tyler at gmail dot com
******************... | wonder-sk/QGIS | python/plugins/GdalTools/tools/doContour.py | Python | gpl-2.0 | 5,125 |
import datetime
from unittest.mock import patch
from django.conf import settings
from django.core.exceptions import ValidationError
from django.db import IntegrityError
from django.test import TestCase
from django.utils.timezone import now
from pytz import timezone
from libya_elections.utils import at_midnight
from .... | SmartElect/SmartElect | voting/tests/test_models.py | Python | apache-2.0 | 15,122 |
# -*- coding: utf-8 -*-
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('hs_model_program', '0004_auto_20151012_1656'),
]
operations = [
migrations.AddField(
model_name='mpmetadata',
name='modelEngine',
... | hydroshare/hydroshare | hs_model_program/migrations/0005_auto_20151104_1604.py | Python | bsd-3-clause | 2,672 |
import matplotlib.pyplot as plt
from matplotlib_scalebar.scalebar import ScaleBar
import requests
from PIL import Image
from io import BytesIO
r = requests.get("https://upload.wikimedia.org/wikipedia/commons/a/a4/Misc_pollen.jpg")
im = Image.open(BytesIO(r.content))
fig = plt.figure(figsize=(4, 4 / 1.3125))
ax = fig.... | ppinard/matplotlib-scalebar | doc/splashscreen.py | Python | bsd-2-clause | 697 |
"""Various bits of logic designed to filter out unwanted VOEvent alerts"""
from pysovo.visibility import DEG_PER_RADIAN
class ami:
@staticmethod
def reject(position):
dec_limit = 15.0
if position.dec*DEG_PER_RADIAN < dec_limit:
return "Target below declination limit of %s degrees" %... | timstaley/pysovo | pysovo/filters.py | Python | bsd-2-clause | 353 |
#! /usr/bin/env python3
# suff
#
# show different suffixes amongst arguments
import sys
def main():
files = sys.argv[1:]
suffixes = {}
for filename in files:
suff = getsuffix(filename)
suffixes.setdefault(suff, []).append(filename)
for suff, filenames in sorted(suffixe... | Orav/kbengine | kbe/src/lib/python/Tools/scripts/suff.py | Python | lgpl-3.0 | 536 |
import re
from flask import abort
from .validation import get_validation_errors
def validate_framework_agreement_details_data(framework_agreement_details, enforce_required=True, required_fields=None):
errs = get_validation_errors(
'framework-agreement-details',
framework_agreement_details,
... | alphagov/digitalmarketplace-api | app/framework_utils.py | Python | mit | 1,090 |
# Copyright 2014 - Rackspace, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | ed-/solum | solum/objects/sqlalchemy/plan.py | Python | apache-2.0 | 1,737 |
################################################################################
# The Neural Network (NN) based Speech Synthesis System
# https://svn.ecdf.ed.ac.uk/repo/inf/dnn_tts/
#
# Centre for Speech Technology Research
# ... | ashmanmode/TTSDNNRepo | src/frontend/mlpg_fast.py | Python | apache-2.0 | 5,760 |
# 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 ... | lmazuel/azure-sdk-for-python | azure-cognitiveservices-search-websearch/azure/cognitiveservices/search/websearch/models/media_object.py | Python | mit | 4,034 |
# Copyright 2022 The jax3d 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | google-research/jax3d | jax3d/projects/nesf/nerfstatic/models/grid_interpolator.py | Python | apache-2.0 | 9,790 |
from datetime import datetime
from flask import current_app
import mock
import uuid
from changes.config import db
from changes.constants import Result, Status
from changes.models.option import ItemOption
from changes.models.project import ProjectOption
from changes.lib import build_context_lib
from changes.listeners.... | wfxiang08/changes | tests/changes/listeners/test_mail.py | Python | apache-2.0 | 21,351 |
from zope.interface import implements
from Products.Five.browser import BrowserView
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from pcommerce.core.interfaces import IPaymentView, IOrder
class DocdataOverview(BrowserView):
template = ViewPageTemplateFile('overview.pt')
implements... | huubbouma/pcommerce.payment.docdata | pcommerce/payment/docdata/browser/overview.py | Python | agpl-3.0 | 615 |
#! /usr/bin/python
import json
import urllib2
import sys
import uuid
import time
import hashlib
import hmac
import requests
def sign(key, path, expires):
if not key:
return None
h = hmac.new(str(key), msg=path, digestmod=hashlib.sha1)
h.update(str(expires))
return h.hexdigest()
def get_quer... | OpenBudget/open-budget-api | upload_fixtures.py | Python | mit | 2,354 |
# Copyright 2016-2017 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | ewbankkit/cloud-custodian | c7n/filters/related.py | Python | apache-2.0 | 4,183 |
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | GdZ/scriptfile | software/googleAppEngine/google/appengine/api/search/QueryLexer.py | Python | mit | 32,125 |
#!/usr/bin/env python
# --------------------------------------------------------
# Deep Deterministic Policy Gradient
# Written by Chao Yu
# --------------------------------------------------------
flg_gpu = True
batch_size = 64
n_epochs = 1000
epoch_length = 1000
memory_size = 1000000
memory_start_size = 10000
discou... | foolyc/DDPG-mxnet | config.py | Python | mit | 681 |
import gtk
import ns.core
import ns.network
import ns.internet
from ns.ndnSIM import ndn
from visualizer.base import InformationWindow
class ShowNdnPit(InformationWindow):
(
COLUMN_PREFIX,
COLUMN_FACE
) = range(2)
def __init__(self, visualizer, node_index):
InformationWindow.... | NDNUtils/NDNSIM | src/visualizer/visualizer/plugins/ndnsim_pit.py | Python | gpl-2.0 | 2,885 |
# -*- coding: utf-8 -*-
'''
Local settings
- Run in Debug mode
- Use console backend for emails
- Add Django Debug Toolbar
- Add django-extensions as app
'''
from .common import * # noqa
# DEBUG
# ------------------------------------------------------------------------------
DEBUG = env.bool('DJANGO_DEBUG', default... | jondelmil/brainiac | config/settings/local.py | Python | bsd-3-clause | 1,961 |
#!/usr/bin/env python
"""Temperature into database"""
import glob
from time import sleep
import urllib2
import urllib
base_dir = '/sys/bus/w1/devices/'
device_folder = glob.glob(base_dir + '28*')[0]
device_file = device_folder + '/w1_slave'
try:
while True:
lines = open(device_file, 'r').readlines()
... | zimolzak/Raspberry-Pi-newbie | temperature_db.py | Python | mit | 804 |
# Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution(object):
def removeElements(self, head, val):
"""
:type head: ListNode
:type val: int
:rtype: ListNode
"""
dum... | hawkphantomnet/leetcode | RemoveLinkedListElements/Solution.py | Python | mit | 567 |
from core import Axon
from core import AxonList
from core import ConfigParser
from core import modifyConfigFile
from core import RunConfig | neuropoly/axonsegpy | axonsegpy/core/__init__.py | Python | mit | 138 |
# -*- coding: utf-8-*-
import random
import re
import jasperpath
import os
#mark1
new_word = "DISK SPACE"
WORDS = ("%s" %new_word)
PRIORITY = 4
def handle(text, mic, profile):
def getdiskspace():
p = os.popen("df -h /")
i = 0
while 1:
i = i +1
line = p.read... | DarthToker/jasper_modules | disk space.py | Python | apache-2.0 | 850 |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def Action(vim, *args, **kwargs):
'''This data object type defines the action initiated b... | xuru/pyvisdk | pyvisdk/do/action.py | Python | mit | 1,144 |
import sys
import os
import bridge
import channelselector
from core import config
from core.item import Item
from core import channeltools
from core import servertools
from DumbTools import DumbKeyboard
#Añadimos "lib" al path
sys.path.append (os.path.join( config.get_runtime_path(), 'lib' ))
# Passing log and config... | neno1978/pelisalacarta | python/version-plex/Code/__init__.py | Python | gpl-3.0 | 13,741 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-05-02 23:12
from __future__ import unicode_literals
import numpy as np
from django.db import migrations
from django.conf import settings
def populate_userinfos(apps, schema_editor):
UserInfo = apps.get_model("examples", "UserInfo")
# Use a fixed seed... | math-a3k/django-ai | django_ai/examples/migrations/0003_populate_userinfo.py | Python | lgpl-3.0 | 1,451 |
#!/usr/bin/env python3
#
# Copyright (c) 2021, The OpenThread Authors.
# 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
# ... | jwhui/openthread | tests/scripts/thread-cert/border_router/MATN/MATN_15_ChangeOfPrimaryBBRTriggersRegistration.py | Python | bsd-3-clause | 6,829 |
"""A generic class to build line-oriented command interpreters.
Interpreters constructed with this class obey the following conventions:
1. End of file on input is processed as the command 'EOF'.
2. A command is parsed out of each line by collecting the prefix composed
of characters in the identchars member.
3. A ... | vmanoria/bluemix-hue-filebrowser | hue-3.8.1-bluemix/desktop/core/ext-py/guppy-0.1.10/guppy/etc/cmd.py | Python | gpl-2.0 | 15,014 |
from django.conf.urls import url
from . import views
UUID_REGEX = (
'[a-f0-9]{8}-?'
'[a-f0-9]{4}-?'
'4[a-f0-9]{3}-?'
'[89ab][a-f0-9]{3}-?'
'[a-f0-9]{12}'
)
urlpatterns = [
url(
r'^pixelset/$',
views.PixelSetListView.as_view(),
name='pixelset_list'
),
url(
... | Candihub/pixel | apps/explorer/urls.py | Python | bsd-3-clause | 2,701 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.