code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
# proxy module
from codetools.util.equivalence import *
| enthought/etsproxy | enthought/util/equivalence.py | Python | bsd-3-clause | 56 |
import os
import pytest
import random
import shutil
import tempfile
from raven.utils.testutils import TestCase
from raven.base import Client
from raven.contrib.zerorpc import SentryMiddleware
zerorpc = pytest.importorskip("zerorpc")
gevent = pytest.importorskip("gevent")
class TempStoreClient(Client):
def __ini... | Goldmund-Wyldebeast-Wunderliebe/raven-python | tests/contrib/zerorpc/tests.py | Python | bsd-3-clause | 2,939 |
# this module tries to implement a replacement for python's lack of language enforced constants.
class _UVSConst(object):
# ------------------------------------------------------------------------------------------------------------------
# save the constants here
def _PASSWORD_PROMPT(self):
re... | kouritron/uvs | libuvs/uvsconst.py | Python | bsd-3-clause | 2,870 |
from django.contrib.sessions.backends.base import SessionBase
class SessionStore(SessionBase):
"""
A simple cookie-based session storage implementation.
The session key is actually the session data, pickled and encoded.
This means that saving the session will change the session key.
"""
def __... | vsajip/django | tests/regressiontests/test_client_regress/session.py | Python | bsd-3-clause | 930 |
def extractSixtranslationTumblrCom(item):
'''
Parser for 'sixtranslation.tumblr.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'translated'),
('L... | fake-name/ReadableWebProxy | WebMirror/management/rss_parser_funcs/feed_parse_extractSixtranslationTumblrCom.py | Python | bsd-3-clause | 562 |
from importlib import import_module
from djangoautoconf.auto_conf_urls import enum_app_names
from djangoautoconf.auto_conf_utils import is_at_least_one_sub_filesystem_item_exists, get_module_path
from ufs_tools.short_decorator.ignore_exception import ignore_exc_with_result
def autodiscover():
from django.conf im... | weijia/djangoautoconf | djangoautoconf/auto_detection/routing_auto_detection.py | Python | bsd-3-clause | 1,242 |
# -*- coding: utf-8 -*-
import datetime
import json
import time
from oauth2client.client import AccessTokenRefreshError
from django.core.cache import cache
from django.utils.translation import get_language
from django.utils.encoding import force_str
from yawdadmin.resources import admin_site
from conf import settings a... | mwolff44/yawd-admin | yawdadmin/utils.py | Python | bsd-3-clause | 6,198 |
"""
This module contains examples of agents created using the map_element
wrapper. See IoTPy/IoTPy/tests/element_test.py for more examples.
map_element is a function in IoTPy/IoTPy/agents_types/op.py
The call to map_element is:
map_element(func, in_stream, out_stream, state, name, **kwargs)
where
func is a funct... | AssembleSoftware/IoTPy | examples/op/map_element_examples.py | Python | bsd-3-clause | 10,288 |
"""Functions related to rating change."""
from oppgavegen.models import User, UserLevelProgress, Level, Template
from oppgavegen.utility.decorators import Debugger
def change_elo(template, user, user_won, type):
"""Changes the elo of both user and task depending on who won."""
u = User.objects.get(username=u... | w0pke/oppgavegenerator | oppgavegen/view_logic/rating.py | Python | bsd-3-clause | 6,450 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('lab_members', '0011_auto_20141130_2335'),
]
operations = [
migrations.AddField(
model_name='scientist',
... | mfcovington/django-lab-members | lab_members/migrations/0012_scientist_email.py | Python | bsd-3-clause | 523 |
#### 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/mobile/shared_dressed_fs_village_whip.iff"
result.attribute_template_id = 9
... | anhstudios/swganh | data/scripts/templates/object/mobile/shared_dressed_fs_village_whip.py | Python | mit | 448 |
import os, sqlite3
from sys import exit
missing_auth_dir = ' neural-network-trading-bot/pyTrader/auth not found.\n' \
' auth directory has been created'
missing_data_dir = ' neural-network-trading-bot/pyTrader/data not found.\n' \
' data directory has been created'
missing... | evanhenri/RNN-Trading-Bot | pyTrader/file_check.py | Python | mit | 3,068 |
# -*- coding: utf-8 -*-
from __future__ import division
from babelfish import Language
from subliminal.providers.addic7ed import Addic7edSubtitle
from subliminal.providers.opensubtitles import OpenSubtitlesSubtitle
from subliminal.providers.podnapisi import PodnapisiSubtitle
from subliminal.score import compute_score... | Diaoul/subliminal | tests/test_score.py | Python | mit | 3,395 |
GITHUB_SIGNATURE_HEADER = 'X-Hub-Signature'
GITHUB_SECRET = 'redacted'
GITHUB_COMMIT_API = 'https://api.github.com/repos/adsabs/{repo}/git/commits/{hash}'
GITHUB_TAG_FIND_API = 'https://api.github.com/repos/adsabs/{repo}/git/refs/tags/{tag}'
GITHUB_TAG_GET_API = 'https://api.github.com/repos/adsabs/{repo}/git/tags/{has... | adsabs/mission-control | mc/config.py | Python | mit | 1,990 |
def is_palindrome(obj):
obj = str(obj)
obj_list = list(obj)
obj_list_reversed = obj_list[::-1]
return obj_list == obj_list_reversed
def generate_rotations(word):
letters = list(word)
string_rotations = []
counter = len(letters)
temp = letters
while counter != 0:
current_l... | pepincho/Python101-and-Algo1-Courses | Algo-1/Application/1-Palindromes.py | Python | mit | 937 |
import os
from ..cache import set_cache, get_cache
from ..show_error import show_error
from .vcs_upgrader import VcsUpgrader
class HgUpgrader(VcsUpgrader):
"""
Allows upgrading a local mercurial-repository-based package
"""
cli_name = 'hg'
def retrieve_binary(self):
"""
Returns... | herove/dotfiles | sublime/Packages/Package Control/package_control/upgraders/hg_upgrader.py | Python | mit | 2,518 |
from django.core.management.base import BaseCommand, CommandError
from cellcounter.main.models import CellImage, SimilarLookingGroup, CellType
import csv
class dialect(csv.Dialect):
pass
class Command(BaseCommand):
args = '<csvfile1 csvfile2 ...>'
help = 'Loads images and descriptions from specified csv f... | oghm2/hackdayoxford | cellcounter/main/management/commands/loadcsv.py | Python | mit | 1,153 |
from fabric.api import *
from fabric.contrib.files import exists
import fabric
counter = 0
@roles('master')
def start_spark():
run('/home/mdindex/scripts/startSystems.sh')
@roles('master')
def stop_spark():
run('/home/mdindex/scripts/stopSystems.sh')
@roles('master')
def start_zookeeper():
run('/home/md... | mitdbg/mdindex | scripts/fabfile/utils.py | Python | mit | 2,214 |
from control.profile.base.baseprofiler import baseprofiler
from output.__init__ import OUTPUT_DIR
from exception.exceptions import UnsupportedParserError
from control.parse.c_element_tree import cElementTreeParser as cElementTree
from control.parse.element_tree import ElementTreeParser as ElementTree
from control.parse... | gmarciani/pyprof | profile/parser_profiler.py | Python | mit | 7,000 |
import sqlalchemy
metadata = sqlalchemy.MetaData()
log_table = sqlalchemy.Table('log', metadata,
sqlalchemy.Column('id', sqlalchemy.Integer, primary_key=True),
sqlalchemy.Column('filename', sqlalchemy.Unicode),
sqlalchemy.Column('d... | Stackato-Apps/py3kwsgitest | tables.py | Python | mit | 647 |
#### 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/mobile/shared_dressed_diplomat_zabrak_male_01.iff"
result.attribute_template... | anhstudios/swganh | data/scripts/templates/object/mobile/shared_dressed_diplomat_zabrak_male_01.py | Python | mit | 457 |
"""Internal module for Python 2 backwards compatibility."""
import sys
if sys.version_info[0] < 3:
from urlparse import parse_qs, urlparse
from itertools import imap, izip
from string import letters as ascii_letters
from Queue import Queue
try:
from cStringIO import StringIO as BytesIO
... | holys/ledis-py | ledis/_compat.py | Python | mit | 2,327 |
# Copyright 2016 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... | jjas0nn/solvem | tensorflow/lib/python2.7/site-packages/tensorflow/python/debug/lib/stepper_test.py | Python | mit | 32,092 |
import re
import json
from subprocess import call, Popen, PIPE
def init_parser(parser):
parser.add_argument('name', type=str, help='Cluster name.')
parser.add_argument('--dest', '-d', required=True, type=str, help="Directory for diagnose output -- must be local.")
parser.add_argument('--hail-log', '-l', r... | danking/hail | hail/python/hailtop/hailctl/dataproc/diagnose.py | Python | mit | 5,732 |
# -*- coding: UTF-8 -*-
import pytest
from mock import MagicMock as mock
import numpy as np
from numpy.testing import assert_allclose
class TestLayer:
@pytest.fixture
def layer(self):
from yadll.layers import Layer
return Layer(mock())
@pytest.fixture
def layer2(self):
from ya... | pchavanne/dl | tests/test_layers.py | Python | mit | 17,957 |
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import get_object_or_404, render_to_response
from django.template import RequestContext
from django.contrib import messages
try:
from django.views.decorators.csrf import csrf_e... | domguard/django-admin-tools | admin_tools/menu/views.py | Python | mit | 3,362 |
# -*- coding: utf-8 -*-
"""
{{ cookiecutter.app_name }}.api.v1
{{ "~" * (cookiecutter.app_name ~ ".api.v1")|count }}
:author: {{ cookiecutter.author }}
:copyright: © {{ cookiecutter.copyright }}
:license: {{ cookiecutter.license }}, see LICENSE for more details.
templated from https://github.c... | ryanolson/cookiecutter-webapp | {{cookiecutter.app_name}}/{{cookiecutter.app_name}}/api/v1/__init__.py | Python | mit | 946 |
# This file is part of 'NTLM Authorization Proxy Server' http://sourceforge.net/projects/ntlmaps/
# Copyright 2001 Dmitry A. Rozmanov <dima@xenon.spb.ru>
#
# 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 Soft... | simpletrain/pybingwallpaper | src/ntlmauth/des_data.py | Python | mit | 18,677 |
import unittest
from isbn_verifier import is_valid
# Tests adapted from `problem-specifications//canonical-data.json`
class IsbnVerifierTest(unittest.TestCase):
def test_valid_isbn(self):
self.assertIs(is_valid("3-598-21508-8"), True)
def test_invalid_isbn_check_digit(self):
self.assertIs(i... | TGITS/programming-workouts | exercism/python/isbn-verifier/isbn_verifier_test.py | Python | mit | 1,989 |
# This file is heavily inspired from the django admin autodiscover
__version_info__ = {
'major': 1,
'minor': 0,
'micro': 2,
'releaselevel': 'final',
'serial': 0
}
def autodiscover():
"""
Auto-discover INSTALLED_APPS admin.py modules and fail silently when
not present. This forces an i... | kingctan/django-health-check | health_check/__init__.py | Python | mit | 1,966 |
# -*- coding: utf-8 -*-
#
# This file is distributed under MIT License or default open-tamil license.
# (C) 2013-2015 Muthiah Annamalai
#
# This file is part of 'open-tamil' examples
# It can be used to identify patterns in a Tamil text files;
# e.g. it has been used to identify patterns in Tamil Wikipedia
# article... | tshrinivasan/open-tamil | examples/solpattiyal.py | Python | mit | 3,639 |
'''Splitter
======
.. versionadded:: 1.5.0
.. image:: images/splitter.jpg
:align: right
The :class:`Splitter` is a widget that helps you re-size its child
widget/layout by letting you re-size it via dragging the boundary or
double tapping the boundary. This widget is similar to the
:class:`~kivy.uix.scrollview.S... | akshayaurora/kivy | kivy/uix/splitter.py | Python | mit | 13,228 |
import logging # Provides access to logging api.
import smtplib
class EmailController:
def __init__(self, username, password, server, port, sender_name):
self.logger = logging.getLogger(__name__)
self.username = username
self.password = password
self.server = server
self.p... | MingoDynasty/FoscamSort | EmailController.py | Python | mit | 1,372 |
#!/usr/bin/env python
import logging
import os
import signal
import sys
from tornado.httpclient import HTTPClient, HTTPError
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from tornado.netutil import bind_sockets
from tornado.process import fork_processes, task_id
from tornado.simple_httpc... | e1ven/Waymoot | libs/tornado-2.2/build/lib/tornado/test/process_test.py | Python | mit | 5,087 |
# -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
from __future__ import with_statement
import os
try:
import eventlet
except ImportError:
raise RuntimeError("You need eventlet installed to use this worker.")
from eventlet import hu... | samabhi/pstHealth | venv/lib/python2.7/site-packages/gunicorn/workers/geventlet.py | Python | mit | 1,452 |
# Copyright 2001-2007 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this perm... | babyliynfg/cross | tools/project-creator/Python2.6.6/Lib/logging/config.py | Python | mit | 13,800 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from holmes.validators.base import Validator
from holmes.utils import _
class TitleValidator(Validator):
@classmethod
def get_violation_definitions(cls):
return {
'page.title.not_found': {
'title': _('Page title not found'),
... | holmes-app/holmes-api | holmes/validators/title.py | Python | mit | 2,893 |
#!/usr/bin/env python
# Copyright 2009 Yu-Jie Lin
# Copyright 2003 David McClosky
#
# This code is licensed under the GPLv3
#
# This Python code does not require any Python binding library, such as
# python-xlib or PyXSS. It directly accesses libXss via ctypes.
#
# It was written with intention of using PyXSS' IdleTrac... | mariano/snakefire | snakefire/pxss.py | Python | mit | 15,957 |
from django.db import models
from django.contrib.auth.models import User
from helper_functions import my_strftime
# Create your models here.
#This only contains metadata about this thread (i.e. just the subject for now)
#It is used in a Many-to-Many relationship with User, with a through object that contains the has_... | rishabhsixfeet/Dock- | MessagesApp/models.py | Python | mit | 1,894 |
# -*- coding: utf-8 -*-
"""
EVODjango Django extensions for development aid
===============================================
.. module:: pyevo
:platform: Unix, Windows
:synopsis: EVODjango Django extensions for development aid
.. moduleauthor:: (C) 2013 Oliver Gutiérrez
"""
# Python imports
import os
from setu... | olivergs/evodjango | setup.py | Python | mit | 976 |
# For simple image-processing operations on python "Image" objects
import Image
import ImageFilter
import math
import kd_array
# These fetch the red, green or blue components of an RGB triple. A normal Image
# pixel is an RGB triple, whereas the black-white and grayscale images have scalar pixels.
def get_red(imag... | imre-kerr/swarm-epuck | controllers/swarm_controller_accelerometer/imagepro.py | Python | mit | 3,734 |
# Definition for an interval.
class Interval:
def __init__(self, s=0, e=0):
self.start = s
self.end = e
class Solution:
def eraseOverlapIntervals(self, intervals):
"""
:type intervals: List[Interval]
:rtype: int
"""
if not intervals:
return 0... | feigaochn/leetcode | p435_non_overlapping_intervals.py | Python | mit | 823 |
#!/usr/bin/env python
import urllib
import sys
import os
##### totalannotation.py by DJ Barshis
##### This script takes an input fasta file of sequence names and sequences, and blast results files of blasts against
##### nr (parsed .txt with 1 hit per line) and swissprot and tremble (in -outfmt 7) uniprot databases
... | cuttlefishh/papers | vibrio-fischeri-transcriptomics/code/python/totalannotation_v1-1.py | Python | mit | 12,403 |
from SDWLE.cards.base import MinionCard
from SDWLE.cards.heroes import Jaraxxus
from SDWLE.cards.weapons.warlock import BloodFury
from SDWLE.constants import CHARACTER_CLASS, CARD_RARITY, MINION_TYPE
from SDWLE.game_objects import Minion
from SDWLE.tags.action import Summon, Kill, Damage, Discard, DestroyManaCrystal, G... | jomyhuang/sdwle | SDWLE/cards_copy/minions/warlock.py | Python | mit | 8,778 |
# Copyright (c) 2021, CRS4
#
# 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, distribu... | crs4/ProMort | promort/reviews_manager/management/commands/build_prediction_reviews_worklist.py | Python | mit | 5,988 |
# -*- coding: UTF-8 -*-
from urllib import request
import json
def send_message(user, message):
# get token, do not change
url_gettoken = "https://a1.easemob.com/ziyuanliu/pkucarrier/token"
header = {"Content-Type":"application/json"}
body = '{"grant_type": "client_credentials","client_id": "YXA6OlYUg... | wyxpku/pkucourier | user/easemobSendMessage.py | Python | mit | 1,201 |
#### 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 = Building()
result.template = "object/building/poi/shared_naboo_tuskcattam_medium.iff"
result.attribute_template_i... | anhstudios/swganh | data/scripts/templates/object/building/poi/shared_naboo_tuskcattam_medium.py | Python | mit | 454 |
# Generated by Django 2.2.13 on 2020-08-09 14:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('workshops', '0215_auto_20200808_1356'),
]
operations = [
migrations.AddField(
model_name='workshoprequest',
name='i... | pbanaszkiewicz/amy | amy/workshops/migrations/0216_workshoprequest_instructor_availability.py | Python | mit | 625 |
x = lambda x: (lambda x: (lambda x: x + 2)(x+2))(x+2)
print x(2)
| buchuki/pyjaco | tests/basic/lambda2.py | Python | mit | 67 |
import glob
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
#plt.style.use('ggplot')
dirlist=glob.glob("./mu-*.*")
fig=plt.figure()
ax=fig.add_subplot(111)
for run in dirlist:
rundata=np.loadtxt(run+"/debugout/tabulated_averages.txt")
x=rundata[:,4]/(rundata[:,3]+r... | goirijo/thermoplotting | old/testing/dataset/rough_cooling_nuke_0/cool.py | Python | mit | 472 |
#### 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/component/item/quest_item/shared_momentum_compensator.iff"
result.a... | anhstudios/swganh | data/scripts/templates/object/tangible/component/item/quest_item/shared_momentum_compensator.py | Python | mit | 495 |
import fileinput
def str_to_int(s):
return([ int(x) for x in s.split() ])
# args = [ 'line 1', 'line 2', ... ]
def proc_input(args):
pass
def solve(args, verbose=False):
r = proc_input(args)
def test():
assert(str_to_int('1 2 3') == [ 1, 2, 3 ])
if __name__ == '__main__':
from sys import argv
if argv.pop() =... | cripplet/practice | hackerrank/quora/skeleton.py | Python | mit | 393 |
"""
MicroPython Remote - Interaction and automation tool for MicroPython
MIT license; Copyright (c) 2019-2021 Damien P. George
This program provides a set of utilities to interact with and automate a
MicroPython device over a serial connection. Commands supported are:
mpremote -- auto-det... | bvernoux/micropython | tools/mpremote/mpremote/main.py | Python | mit | 15,680 |
from __future__ import unicode_literals
import sys
sys.path = sys.path[1:]
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.conf import settings
from scipy.stats import norm, t
import pandas as pd
import numpy as np
import tempfile
import uuid
import os
### MAIN TEMPLATE PAG... | neuropower/neuropower | neuropower/apps/main/views.py | Python | mit | 439 |
from django.contrib.auth.models import User
from djblets.testing.decorators import add_fixtures
from djblets.testing.testcases import TestCase
from reviewboard.accounts.models import LocalSiteProfile
from reviewboard.reviews.models import ReviewRequest
class ProfileTests(TestCase):
"""Testing the Profile model."... | atagar/ReviewBoard | reviewboard/accounts/tests.py | Python | mit | 2,192 |
#!/usr/bin/env python
import argparse
import datetime
class Book:
def __init__(self, title, author, owned, start, end, physical, date):
self.title = title
self.author = author
self.owned = owned
self.start = start
self.end = end
self.physical = physical
self.date = date
def readTime(sel... | claman/apollo | apollo.py | Python | mit | 4,618 |
"""
URLconf for registration and activation, using django-registration's
default mods backend.
If the default behavior of these views is acceptable to you, simply
use a line like this in your root URLconf to set up the default URLs
for registration::
(r'^accounts/', include('project.registration.urls')),
This wi... | emencia/emencia_paste_djangocms_3 | emencia_paste_djangocms_3/django_buildout/project/accounts/urls.py | Python | mit | 2,293 |
import flask, functools, traceback, urllib
from .. import editor
NO_PROJECT_ERROR = 'No Project is currently loaded'
BAD_ADDRESS_ERROR = 'Bad address {address}'
BAD_GETTER_ERROR = 'Couldn\'t get address {address}'
BAD_SETTER_ERROR = 'Couldn\'t set value {value} at address {address}'
def single(method):
"""Decora... | rec/BiblioPixel | bibliopixel/control/rest/decorator.py | Python | mit | 2,062 |
# 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-compute/azure/mgmt/compute/compute/v2016_04_30_preview/models/virtual_machine_scale_set_extension_profile.py | Python | mit | 1,089 |
#! /bin/python3
# $Id
# -----------------------------------------------------------------------------
# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
#
# CppAD is distributed under multiple licenses. This distribution is under
# the terms of the
# Eclipse Public Licen... | kaskr/CppAD | bin/proj_desc.py | Python | epl-1.0 | 6,719 |
# Script executed by jython
# Can import any Java package
from org.csstudio.display.builder.runtime.script import PVUtil
# Can also import some python code that's available under Jython
import sys, time
trigger = PVUtil.getInt(pvs[0])
if trigger:
info = "%s,\ninvoked at %s" % (sys.version, time.strftime("%Y-%m-... | kasemir/org.csstudio.display.builder | org.csstudio.display.builder.model/examples/python/jython.py | Python | epl-1.0 | 377 |
#
# Copyright (C) 2004 SIPfoundry Inc.
# Licensed by SIPfoundry under the GPL license.
#
# Copyright (C) 2004 SIP Forum
# Licensed to SIPfoundry under a Contributor Agreement.
#
#
# This file is part of SIP Forum User Agent Basic Test Suite which
# belongs to the SIP Forum Test Framework.
#
# SIP Forum User Agent Basic... | VoIP-co-uk/sftf | UserAgentBasicTestSuite/case202.py | Python | gpl-2.0 | 4,465 |
from django.core.management.base import BaseCommand, CommandError
from django.db import transaction
from operator import itemgetter
import face.models.models as regis
import random, math
class Command(BaseCommand):
args = 'none'
help = 'Analyze user performance and modify individual question orderings.'
... | anyweez/regis | face/management/commands/personalize.py | Python | gpl-2.0 | 8,409 |
"""Subclass of NewMember, which is generated by wxFormBuilder."""
import copy
import wx
from beatle import model
from beatle.lib import wxx
from beatle.activity.models.ui import ui as ui
# Implementing NewMember
class MemberDialog(ui.NewMember):
"""
This dialog allows to setup data member of class
or s... | melviso/phycpp | beatle/activity/models/ui/dlg/cc/Member.py | Python | gpl-2.0 | 14,333 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('emailer', '0004_auto_20150128_2202'),
]
operations = [
migrations.RemoveField(
model_name='email',
n... | JustinWingChungHui/okKindred | emailer/migrations/0005_remove_email_creation_date.py | Python | gpl-2.0 | 358 |
#!/usr/bin/env python
# Michael Cohen <scudette@users.sourceforge.net>
#
# ******************************************************
# Version: FLAG $Version: 0.87-pre1 Date: Thu Jun 12 00:48:38 EST 2008$
# ******************************************************
#
# * This program is free software; you can redistribute it... | arkem/pyflag | src/pyflag/tests.py | Python | gpl-2.0 | 4,688 |
# -*- coding: utf-8 -*-
import sys, os, time
from Tools.HardwareInfo import HardwareInfo
def getVersionString():
return getImageVersionString()
def getImageVersionString():
try:
if os.path.isfile('/var/lib/opkg/status'):
st = os.stat('/var/lib/opkg/status')
else:
st = os.stat('/usr/lib/ipkg/status')
tm ... | 68foxboris/enigma2-openpli-vuplus | lib/python/Components/About.py | Python | gpl-2.0 | 4,073 |
#updateCheck.py
#A part of NonVisual Desktop Access (NVDA)
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
#Copyright (C) 2012 NV Access Limited
"""Update checking functionality.
@note: This module may raise C{RuntimeError} on import if update checking for this b... | ckundo/nvda | source/updateCheck.py | Python | gpl-2.0 | 14,695 |
""" Python Character Mapping Codec generated from '8859-7.TXT' with gencodec.py.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
(c) Copyright 2000 Guido van Rossum.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(... | carvalhomb/tsmells | guess/src/Lib/encodings/iso8859_7.py | Python | gpl-2.0 | 4,774 |
def embaralha (x):
import random
lista = list(x)
random.shuffle(lista)
return ''.join(lista)
nome = input ("Digite algum nome : ")
print (embaralha(nome))
| SANDEISON/Python | 04 - Funções e Arquivos À Solta/03 -Agrupando códigos em Módulos/02 - embaralha_nome.py | Python | gpl-2.0 | 176 |
#
# getlangnames.py
#
# Copyright (C) 2007 Red Hat, Inc. All rights reserved.
#
# 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... | kalev/anaconda | scripts/getlangnames.py | Python | gpl-2.0 | 1,386 |
"""
KeepNote
Low-level Create-Read-Update-Delete (CRUD) interface for notebooks.
"""
#
# KeepNote
# Copyright (c) 2008-2011 Matt Rasmussen
# Author: Matt Rasmussen <rasmus@alum.mit.edu>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Genera... | brotchie/keepnote | keepnote/notebook/connection/__init__.py | Python | gpl-2.0 | 11,118 |
# -*- coding: utf-8 -*-
import sys
sys.path.append('../')
import time
import pytest
import os
import telebot
from telebot import types
from telebot import util
should_skip = 'TOKEN' and 'CHAT_ID' not in os.environ
if not should_skip:
TOKEN = os.environ['TOKEN']
CHAT_ID = os.environ['CHAT_ID']
@pytest.mar... | jpelias/pyTelegramBotAPI | tests/test_telebot.py | Python | gpl-2.0 | 7,077 |
# Patchwork - automated patch tracking system
# Copyright (C) 2008 Jeremy Kerr <jk@ozlabs.org>
#
# This file is part of the Patchwork package.
#
# Patchwork 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; eith... | ivyl/patchwork | patchwork/views/xmlrpc.py | Python | gpl-2.0 | 22,918 |
#!/usr/bin/env python
# encoding: utf-8
"""
release_push.py
Created by Jonathan Burke on 2013-12-30.
Copyright (c) 2015 University of Washington. All rights reserved.
"""
#See README-maintainers.html for more information
from release_vars import *
from release_utils import *
from sanity_checks import *
import urll... | SoftwareEngineeringToolDemos/ICSE-2011-Checker-Framework | release/release_push.py | Python | gpl-2.0 | 24,373 |
import save
import client
def start():
def callback():
client.client.chat('/novice')
found_nations = [ (name, style, id) for name, style, id in client.get_nations() if name == 'Poles' ]
if found_nations:
name, style, id = found_nations[0]
print 'change nation to', na... | eric-stanley/freeciv-android | lib/freeciv/tutorial.py | Python | gpl-2.0 | 497 |
#!/usr/bin/python
# parsing state representing a subgraph
# initialized with dependency graph
#
from __future__ import absolute_import
import copy,sys,re
import cPickle
from parser import *
from common.util import *
from constants import *
from common.SpanGraph import SpanGraph
from common.AMRGraph import *
import num... | didzis/CAMR | graphstate.py | Python | gpl-2.0 | 68,252 |
# drive APMrover2 in SITL
from __future__ import print_function
import os
import shutil
import pexpect
from pymavlink import mavutil
from common import *
from pysim import util
from pysim import vehicleinfo
# get location of scripts
testdir = os.path.dirname(os.path.realpath(__file__))
# HOME=mavutil.location(-35.... | graitanto21/UniboQuad | Tools/autotest/apmrover2.py | Python | gpl-3.0 | 8,046 |
from Action import Action
from MusicPlayer import MusicPlayer
from SensorAction import SensorAction
from WakeAction import WakeAction
__all__ = ["Action", "MusicPlayer", "SensorAction", "WakeAction"]
| carlesm/ambrosio | ambrosio/actions/__init__.py | Python | gpl-3.0 | 202 |
from django.contrib import admin
from lugar.models import Departamento, Municipio, Microcuenca, Comunidad
class ComunidadAdmin(admin.ModelAdmin):
list_display = ['nombre', 'municipio']
class DepartamentoAdmin(admin.ModelAdmin):
pass
class MicrocuencaAdmin(admin.ModelAdmin):
pass
class MunicipioAdmin(admin.ModelAdmi... | CARocha/addac_fadcanic | lugar/admin.py | Python | gpl-3.0 | 567 |
from sympy import (
Symbol, gamma, I, oo, nan, zoo, factorial, sqrt, Rational, log,
polygamma, EulerGamma, pi, uppergamma, S, expand_func, loggamma, sin,
cos, O, cancel, lowergamma, exp, erf, beta, exp_polar, harmonic, zeta,
factorial)
from sympy.core.function import ArgumentIndexError
from sympy.utilit... | lidavidm/mathics-heroku | venv/lib/python2.7/site-packages/sympy/functions/special/tests/test_gamma_functions.py | Python | gpl-3.0 | 12,392 |
# -*- coding: utf-8 -*-
""" Python KNX framework
License
=======
- B{PyKNyX} (U{https://github.com/knxd/pyknyx}) is Copyright:
- © 2016-2017 Matthias Urlichs
- PyKNyX is a fork of pKNyX
- © 2013-2015 Frédéric Mantegazza
This program is free software; you can redistribute it and/or modify
it under the terms ... | knxd/pKNyX | pyknyx/stack/cemi/cemiFactory.py | Python | gpl-3.0 | 1,718 |
#!/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 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that ... | kenorb/BitTorrent | auto-update/sign_file.py | Python | gpl-3.0 | 1,204 |
from abuse_finder import domain_abuse, ip_abuse, email_abuse, url_abuse
from fir_artifacts.models import Artifact
from fir_celery.celeryconf import celery_app
ENRICHMENT_FUNCTIONS = {
'hostname': domain_abuse,
'ip': ip_abuse,
'email': email_abuse,
'url': url_abuse
}
@celery_app.task
def enrich_arti... | certsocietegenerale/FIR | fir_artifacts_enrichment/tasks.py | Python | gpl-3.0 | 832 |
from django.contrib.gis.db import models
from django.db.models import Q
import operator
class PriorityDepartmentsManager(models.Manager):
DEPARTMENTS = {
'Austin': {'state': 'TX', 'fdid': 'WP801'},
'Arlington': {'state': 'VA', 'fdid': '01300'},
'Chicago': {'state': 'IL', 'fdid': 'CS931'},... | garnertb/rogue_geonode | geoshape/firestation/managers.py | Python | gpl-3.0 | 1,358 |
import collections
import glob
import os
import re
import sys
import traceback
if 'mtimes' not in globals():
mtimes = {}
if 'lastfiles' not in globals():
lastfiles = set()
def make_signature(f):
return f.func_code.co_filename, f.func_name, f.func_code.co_firstlineno
def format_plug(plug, kind='', lpa... | FrozenPigs/Taigabot | core/reload.py | Python | gpl-3.0 | 5,824 |
############################################################################
#
# Copyright (C) 2016 The Qt Company Ltd.
# Contact: https://www.qt.io/licensing/
#
# This file is part of Qt Creator.
#
# Commercial License Usage
# Licensees holding valid commercial Qt licenses may use this file in
# accordance with the co... | qtproject/qt-creator | tests/system/tools/toolfunctions.py | Python | gpl-3.0 | 1,722 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from flask import Blueprint, request
import jimit as ji
from models import UidOpenidMapping
from models import Utils, Rules, User
__author__ = 'James Iter'
__date__ = '16/6/8'
__contact__ = 'james.iter.cn@gmail.com'
__copyright__ = '(c) 2016 by James Iter.'... | jamesiter/jimauth | views/user_mgmt.py | Python | gpl-3.0 | 14,179 |
# -- coding: utf-8 --
from resources.lib.gui.gui import cGui
from resources.lib.config import cConfig
from resources.lib import common
import urllib2
import xbmc
import xbmcgui
import string
import logger
import time
import os
import sys
class cDownload:
def __createProcessDialog(self):
oDialog = xbmcgui.... | kabooom/plugin.video.xstream | resources/lib/download.py | Python | gpl-3.0 | 4,301 |
__author__ = 'junz'
import os
import matplotlib.pyplot as plt
import retinotopic_mapping.RetinotopicMapping as rm
from tools import FileTools as ft
trialName = "160211_M214522_Trial1.pkl"
isSave = True
params = {'phaseMapFilterSigma': 1.,
'signMapFilterSigma': 9.,
'signMapThr': 0.3,
'e... | zhuangjun1981/retinotopic_mapping | retinotopic_mapping/examples/signmap_analysis/scripts/script_analysis.py | Python | gpl-3.0 | 1,015 |
from ROOT import TH1I, gROOT, kRed, kBlue
import unittest
import tempfile
import shutil
import os
from varial.extensions.cmsrun import Sample
from varial.wrappers import HistoWrapper
from varial.history import History
from varial import analysis
from varial import settings
from varial import diskio
class TestHistoTo... | HeinerTholen/Varial | varial/test/test_histotoolsbase.py | Python | gpl-3.0 | 2,422 |
#!/usr/bin/python
import socket
import sys
print "pass1"
clientSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print "pass2"
try:
print "pass3"
clientSocket.settimeout(4)
print "pass4"
clientSocket.connect(("192.168.1.7",6660))
print "pass5"
print("Connected to client")
sockstatus = 1
except:... | shrinidhi666/rbhus | tests/sockTest.py | Python | gpl-3.0 | 472 |
# -*- coding: utf-8 -*-
from openerp.osv import fields, osv
class AccountPaymentConfig(osv.TransientModel):
_inherit = 'account.config.settings'
_columns = {
'module_payment_transfer': fields.boolean(
'Wire Transfer',
help='-This installs the module payment_transfer.'),
... | orchidinfosys/odoo | addons/payment/models/res_config.py | Python | gpl-3.0 | 1,197 |
# This file is part of Indico.
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (a... | XeCycle/indico | indico/MaKaC/conference.py | Python | gpl-3.0 | 377,852 |
# -*- coding: utf-8 -*-
from module.plugins.internal.MultiHook import MultiHook
class RealdebridCom(MultiHook):
__name__ = "RealdebridCom"
__type__ = "hook"
__version__ = "0.46"
__config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"),
... | immenz/pyload | module/plugins/hooks/RealdebridCom.py | Python | gpl-3.0 | 1,471 |
# Copyright (C) 2012,2013
# Max Planck Institute for Polymer Research
# Copyright (C) 2008,2009,2010,2011
# Max-Planck-Institute for Polymer Research & Fraunhofer SCAI
#
# This file is part of ESPResSo++.
#
# ESPResSo++ is free software: you can redistribute it and/or modify
# it under the terms of t... | capoe/espressopp.soap | src/analysis/Test.py | Python | gpl-3.0 | 1,624 |
#!/usr/bin/env python
#
# Copyright Science and Technology Facilities Council, 2009-2012.
#
# This file is part of ARTEMIS.
#
# ARTEMIS 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 ... | jrha/artemis | tools/artemis-plot.py | Python | gpl-3.0 | 5,014 |
# -*- coding: utf-8 -*-
'''Caution:
For Python 2.7, `__init__.py` file in folders is nessary.
'''
| JarryShaw/jsntlib | src/NTLArchive/__init__.py | Python | gpl-3.0 | 100 |
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name = "python-gitlab",
version = "0.1",
packages = find_packages(),
install_requires = ['requests', 'markdown'],
# metadata for upload to PyPI
author = "Itxaka Serrano Garcia",
author_email = "itxakaserrano@gmail.co... | erikjwaxx/python-gitlab-1 | setup.py | Python | gpl-3.0 | 502 |
#!/usr/bin/env python
#***************************************************************************
# Copyright Jaime Machuca
#***************************************************************************
# Title : mavproxy_smartcamera.py
#
# Description : This file is intended to be added as ... | squilter/MAVProxy | MAVProxy/modules/mavproxy_smartcamera/__init__.py | Python | gpl-3.0 | 16,290 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.