repo_name
stringlengths
5
104
path
stringlengths
4
248
content
stringlengths
102
99.9k
ayushgoel/FixGoogleContacts
phonenumbers/data/region_BG.py
"""Auto-generated file, do not edit by hand. BG metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_BG = PhoneMetadata(id='BG', country_code=359, international_prefix='00', general_desc=PhoneNumberDesc(national_number_pattern='[23567]\\d{5,7}|[489]\\d{6,8}', possible...
opesci/devito
tests/test_dimension.py
from itertools import product import numpy as np from sympy import And import pytest from conftest import skipif, opts_tiling from devito import (ConditionalDimension, Grid, Function, TimeFunction, SparseFunction, # noqa Eq, Operator, Constant, Dimension, SubDimension, switchconfig, ...
MoonCheesez/stack
PiGame/pigame/manage.py
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pigame.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure that the ...
joke2k/faker
faker/providers/company/az_AZ/__init__.py
from .. import Provider as CompanyProvider class Provider(CompanyProvider): formats = ( "{{last_name}} {{company_suffix}}", "{{last_name}} {{last_name}} {{company_suffix}}", "{{large_company}}", ) large_companies = ( "AZAL", "Azergold", "SOCAR", "So...
indexofire/gork
src/gork/application/know/plugins/attachments/models.py
# -*- coding: utf-8 -*- import os.path from django.db import models from django.utils.translation import ugettext_lazy as _ from django.conf import settings as django_settings from django.db.models import signals from know.plugins.attachments import settings from know import managers from know.models.pluginbase import ...
wonjunetai/pulse
features/uniprot_core.py
# reads uniprot core file and generates core features from features_helpers import score_differences def build_uniprot_to_index_to_core(sable_db_obj): uniprot_to_index_to_core = {} for line in sable_db_obj: tokens = line.split() try: # PARSING ID prot = tokens[0] ...
Bushstar/UFO-Project
test/functional/feature_block.py
#!/usr/bin/env python3 # Copyright (c) 2015-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test block processing.""" import copy import struct import time from test_framework.blocktools import ...
atizo/braindump
brainstorming/migrations/0005_auto__add_field_idea_color.py
# -*- coding: utf-8 -*- from south.utils import datetime_utils as 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 'Idea.color' db.add_column(u'brainstorming_idea', 'color',...
onejgordon/action-potential
actionpotential.py
import os import webapp2 from actions import cronActions from views import views import secrets SECS_PER_WEEK = 60 * 60 * 24 * 7 # Enable ctypes -> Jinja2 tracebacks PRODUCTION_MODE = not os.environ.get( 'SERVER_SOFTWARE', 'Development').startswith('Development') ROOT_DIRECTORY = os.path.dirname(__file__) if no...
jdthorpe/archiver
__main__.py
# this is the interface for `python archiver` import archiver import appdirs import os import sys import pickle import json from archiver.archiver import Archiver from archiver.parser import parseArgs args = parseArgs() from edit import edit # ============================================== print args # TODO: s...
evenmarbles/mlpy
mlpy/auxiliary/datastructs.py
""" .. module:: mlpy.auxiliary.datastructs :platform: Unix, Windows :synopsis: Provides data structure implementations. .. moduleauthor:: Astrid Jackson <ajackson@eecs.ucf.edu> """ from __future__ import division, print_function, absolute_import import heapq import numpy as np from abc import ABCMeta, abstract...
ctgk/BayesianNetwork
test/image/test_util.py
import unittest import numpy as np from bayesnet.image.util import img2patch, patch2img class TestImg2Patch(unittest.TestCase): def test_img2patch(self): img = np.arange(16).reshape(1, 4, 4, 1) patch = img2patch(img, size=3, step=1) expected = np.asarray([ [img[0, 0:3, 0:3, 0]...
Kbman99/NetSecShare
app/logger_setup.py
''' logger_setup.py customizes the app's logging module. Each time an event is logged the logger checks the level of the event (eg. debug, warning, info...). If the event is above the approved threshold then it goes through. The handlers do the same thing; they output to a file/shell if the event level is above their t...
plotly/plotly.py
packages/python/plotly/plotly/validators/scattersmith/_textfont.py
import _plotly_utils.basevalidators class TextfontValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__(self, plotly_name="textfont", parent_name="scattersmith", **kwargs): super(TextfontValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
our-iot-project-org/pingow-web-service
src/posts/views.py
from django.core import serializers from rest_framework.response import Response from django.http import JsonResponse try: from urllib import quote_plus # python 2 except: pass try: from urllib.parse import quote_plus # python 3 except: pass from django.contrib import messages from django.contrib.co...
joshuamsmith/ConnectPyse
sales/order.py
from ..cw_model import CWModel class Order(CWModel): def __init__(self, json_dict=None): self.id = None # (Integer) self.company = None # *(CompanyReference) self.contact = None # (ContactReference) self.phone = None # (String) self.phoneExt = None # (String...
coinbox/coinbox-mod-base
cbmod/base/views/window.py
from pydispatch import dispatcher from PySide import QtCore, QtGui import cbpos logger = cbpos.get_logger(__name__) from .page import BasePage class MainWindow(QtGui.QMainWindow): __inits = [] def __init__(self): super(MainWindow, self).__init__() self.tabs = QtGui...
DailyActie/Surrogate-Model
01-codes/scipy-master/scipy/odr/setup.py
#!/usr/bin/env python from __future__ import division, print_function, absolute_import from os.path import join def configuration(parent_package='', top_path=None): import warnings from numpy.distutils.misc_util import Configuration from numpy.distutils.system_info import get_info, BlasNotFoundError ...
HelsinkiHacklab/urpobotti
python/motorctrl.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import zmq from zmq.eventloop import ioloop as ioloop_mod import zmqdecorators import time SERVICE_NAME = "urpobot.motor" SERVICE_PORT = 7575 SIGNALS_PORT = 7576 # How long to wait for new commands before stopping automatically COMMAND_GRACE_TIME = 0.250 class motorserv...
JamesJeffryes/MINE-Database
minedatabase/thermodynamics.py
"""Basic thermodynamic calculations for pickaxe.""" from typing import Union import pint from equilibrator_api import ( Q_, ComponentContribution, Reaction, default_physiological_ionic_strength, default_physiological_p_h, default_physiological_p_mg, default_physiological_temperature, ) fro...
Yadnyawalkya/hackRIT
hackRIT.py
import os #Decoration Starts print """ +=============================================================+ || Privilege Escalation Exploit || || +===================================================+ || || | _ _ _ ____ _ __ ____ ___ _____ | || || | | | | | / \ / ___| |/ / ...
thedemz/python-gems
bitten.py
import codecs unicode_string = "Hello Python 3 String" bytes_object = b"Hello Python 3 Bytes" print(unicode_string, type(unicode_string)) print(bytes_object, type(bytes_object)) #decode to unicode_string ux = str(object=bytes_object, encoding="utf-8", errors="strict") print(ux, type(ux)) ux = bytes_object.dec...
scikit-learn-contrib/imbalanced-learn
imblearn/over_sampling/_random_over_sampler.py
"""Class to perform random over-sampling.""" # Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com> # Christos Aridas # License: MIT from collections.abc import Mapping from numbers import Real import numpy as np from scipy import sparse from sklearn.utils import check_array, check_random_state from sklear...
phatblat/AbletonLiveMIDIRemoteScripts
Push2/session_recording.py
# Source Generated with Decompyle++ # File: session_recording.pyc (Python 2.5) from __future__ import absolute_import from pushbase.session_recording_component import FixedLengthSessionRecordingComponent class SessionRecordingComponent(FixedLengthSessionRecordingComponent): def __init__(self, *a, **k): ...
victor-o-silva/db_file_storage
demo_and_tests/model_filefields_example/migrations/0002_auto_20180826_0054.py
# Generated by Django 2.1 on 2018-08-26 00:54 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('model_filefields_example', '0001_initial'), ] operations = [ migrations.AlterField( model_name='book', name='cover', ...
jhazelwo/python-awscli
python2awscli/model/securitygroup.py
""" -*- coding: utf-8 -*- """ from python2awscli import bin_aws from python2awscli.error import AWSNotFound, ParseError, AWSDuplicate from python2awscli import must class BaseSecurityGroup(object): def __init__(self, name, region, vpc, description, inbound=None, outbound=None): """ :param name: S...
kanboard/kanboard-cli
kanboard_cli/shell.py
# The MIT License (MIT) # # Copyright (c) 2016 Frederic Guillot # # 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, ...
operepo/ope
laptop_credential/winsys/tests/test_fs/test_fs.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os, sys import tempfile from winsys._compat import unittest import uuid import win32file from winsys.tests.test_fs import utils from winsys import fs class TestFS (unittest.TestCase): filenames = ["%d" % i for i in range (5)] def setUp (se...
fierval/KaggleMalware
Learning/1dlbp_tests.py
import numpy as np import matplotlib.pylab as plt from numba import cuda, uint8, int32, uint32, jit from timeit import default_timer as timer @cuda.jit('void(uint8[:], int32, int32[:], int32[:])') def lbp_kernel(input, neighborhood, powers, h): i = cuda.grid(1) r = 0 if i < input.shape[0] - 2 * neighborho...
hhalmeida/corponovo
manage.py
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "corponovo.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure that th...
jiasir/openstack-trove
lib/charmhelpers/contrib/openstack/ip.py
from charmhelpers.core.hookenv import ( config, unit_get, ) from charmhelpers.contrib.network.ip import ( get_address_in_network, is_address_in_network, is_ipv6, get_ipv6_addr, ) from charmhelpers.contrib.hahelpers.cluster import is_clustered PUBLIC = 'public' INTERNAL = 'int' ADMIN = 'admin'...
mylokin/servy
servy/utils/dsntool.py
import collections import re import urlparse class DSN(collections.MutableMapping): ''' Hold the results of a parsed dsn. This is very similar to urlparse.ParseResult tuple. http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlsplit It exposes the following attributes: ...
Fusion-Data-Platform/fdp
fdp/lib/datasources.py
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Fri Feb 24 12:49:36 2017 @author: drsmith """ import os from .globals import FdpError def canonicalMachineName(machine=''): aliases = {'nstxu': ['nstx', 'nstxu', 'nstx-u'], 'diiid': ['diiid', 'diii-d', 'd3d'], 'cmod': ['...
sakura-internet/saklient.python
saklient/cloud/models/model_licenseinfo.py
# -*- coding:utf-8 -*- # This code is automatically transpiled by Saklient Translator import six from ..client import Client from .model import Model from ..resources.resource import Resource from ..resources.licenseinfo import LicenseInfo from ...util import Util import saklient str = six.text_type # module saklien...
jsubpy/jsub
jsub/operation/submit.py
import os import logging from jsub.util import safe_mkdir from jsub.util import safe_rmdir class Submit(object): def __init__(self, manager, task_id, sub_ids=None, dry_run=False, resubmit=False): self.__manager = manager self.__task = self.__manager.load_task(task_id) self.__sub_ids = sub_ids self.__dry_run ...
hackaugusto/raiden
raiden/tests/utils/smartcontracts.py
import os from typing import List, Tuple from raiden.network.blockchain_service import BlockChainService from raiden.network.pathfinding import get_random_service from raiden.network.proxies.service_registry import ServiceRegistry from raiden.network.rpc.client import JSONRPCClient from raiden.network.rpc.smartcontrac...
indico/indico
indico/core/oauth/__init__.py
# 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. import os from indico.core import signals from indico.core.db import db from .logger import logger from ...
daicang/Leetcode-solutions
382-linked-list-random-node.py
import random # Definition for singly-linked list. # class ListNode(object): # def __init__(self, x): # self.val = x # self.next = None class Solution(object): _largesize = 300 def __init__(self, head): self.head = head self.lsize = 0 while head.next: h...
tainstr/misura.canon
misura/canon/option/tests/test_sqlstore.py
#!/usr/bin/python # -*- coding: utf-8 -*- import unittest import os from misura.canon import option from misura.canon.option import get_typed_cols, get_insert_cmd, base_col_def, print_tree import sqlite3 from misura.canon.tests import testdir db = testdir + 'storage/tmpdb' c1 = testdir + 'storage/Conf.csv' def go(t)...
NiloFreitas/Deep-Reinforcement-Learning
reinforcement/players/player_reinforce_rnn_2.py
from players.player import player from auxiliar.aux_plot import * import random from collections import deque import sys sys.path.append('..') import tensorblock as tb import numpy as np import tensorflow as tf # PLAYER REINFORCE RNN class player_reinforce_rnn_2(player): # __INIT__ def __init__(self): ...
dmccloskey/SBaaS_rnasequencing
SBaaS_rnasequencing/stage01_rnasequencing_analysis_postgresql_models.py
from SBaaS_base.postgresql_orm_base import * class data_stage01_rnasequencing_analysis(Base): __tablename__ = 'data_stage01_rnasequencing_analysis' id = Column(Integer, Sequence('data_stage01_rnasequencing_analysis_id_seq'), primary_key=True) analysis_id = Column(String(500)) experiment_id = Column(Str...
endarthur/autti
auttitude/math.py
#!/usr/bin/python # -*- coding: utf-8 -*- # pylint: disable=invalid-name from __future__ import absolute_import from math import acos, cos, pi, radians, sin, sqrt import auttitude as at import numpy as np def normalized_cross(a, b): """ Returns the normalized cross product between vectors. Uses numpy.cros...
ADKosm/Recipes
Recipes/rcps/admin.py
from django.contrib import admin # Register your models here. from rcps.models import * class IngredientToRecipeInline(admin.TabularInline): model = Ingredient.recipes.through verbose_name = 'Ингредиент' verbose_name_plural = 'Ингредиенты' class EquipmentInline(admin.TabularInline): model = Equipme...
jiangtyd/crewviewer
project/config.py
import os class Config(object): DEBUG = False TESTING = False CSRF_ENABLED = True SECRET_KEY = "super_secret_key" SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL'] class ProductionConfig(Config): DEBUG = False SECRET_KEY = os.environ['SECRET_KEY'] class DevelopmentConfig(Config): D...
geographika/mappyfile
docs/scripts/class_diagrams.py
r""" Create MapServer class diagrams Requires https://graphviz.gitlab.io/_pages/Download/Download_windows.html https://stackoverflow.com/questions/1494492/graphviz-how-to-go-from-dot-to-a-graph For DOT languge see http://www.graphviz.org/doc/info/attrs.html cd C:\Program Files (x86)\Graphviz2.38\bin dot -Tpng D:\Git...
soulfx/gmusic-playlist
ExportLists.py
# Author: John Elkins <john.elkins@yahoo.com> # License: MIT <LICENSE> from common import * if len(sys.argv) < 2: log('ERROR output directory is required') time.sleep(3) exit() # setup the output directory, create it if needed output_dir = sys.argv[1] if not os.path.exists(output_dir): os.makedirs(ou...
nkoech/csacompendium
csacompendium/csa_practice/api/practicelevel/practicelevelviews.py
from csacompendium.csa_practice.models import PracticeLevel from csacompendium.utils.pagination import APILimitOffsetPagination from csacompendium.utils.permissions import IsOwnerOrReadOnly from csacompendium.utils.viewsutils import DetailViewUpdateDelete, CreateAPIViewHook from rest_framework.filters import DjangoFilt...
beetbox/beets
beets/dbcore/query.py
# This file is part of beets. # Copyright 2016, Adrian Sampson. # # 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, ...
foobarbazblarg/stayclean
stayclean-2018-march/serve-signups-with-flask.py
#!/usr/bin/env python import subprocess import praw from hashlib import sha1 from flask import Flask from flask import Response from flask import request from cStringIO import StringIO from base64 import b64encode from base64 import b64decode from ConfigParser import ConfigParser import OAuth2Util import os import mar...
viniciuschiele/flask-webapi
tests/test_status.py
from flask_webapi import status from unittest import TestCase class TestStatus(TestCase): def test_is_informational(self): self.assertFalse(status.is_informational(99)) self.assertFalse(status.is_informational(200)) for i in range(100, 199): self.assertTrue(status.is_informati...
Alex-Just/gymlog
gymlog/main/tests/test_models.py
# from test_plus.test import TestCase # # # class TestUser(TestCase): # # def setUp(self): # self.user = self.make_user() # # def test__str__(self): # self.assertEqual( # self.user.__str__(), # 'testuser' # This is the default username for self.make_user() # ) # ...
jminuscula/dixit-online
server/src/dixit/api/auth/serializers/user.py
from rest_framework import serializers from django.contrib.auth.models import User from dixit.account.models import UserProfile class UserProfileSerializer(serializers.ModelSerializer): class Meta: model = UserProfile fields = ('name', ) class UserSerializer(serializers.ModelSerializer): ...
simonz05/pack-command
misc/bench.py
# -*- coding: utf-8 -*- import pack_command import pack_command_python import timeit import cProfile import pstats import pycallgraph def format_time(seconds): v = seconds if v * 1000 * 1000 * 1000 < 1000: scale = u'ns' v = int(round(v*1000*1000*1000)) elif v * 1000 * 1000 < 1000: ...
nwinter/bantling
src/application/__init__.py
""" Initialize Flask app """ from flask import Flask import os from flask_debugtoolbar import DebugToolbarExtension from werkzeug.debug import DebuggedApplication app = Flask('application') if os.getenv('FLASK_CONF') == 'DEV': # Development settings app.config.from_object('application.settings.Development') ...
bennybauer/pinax-hello
runtests.py
#!/usr/bin/env python import os import sys import django from django.conf import settings DEFAULT_SETTINGS = dict( INSTALLED_APPS=[ "django.contrib.auth", "django.contrib.contenttypes", "django.contrib.sites", "pinax.pinax_hello", "pinax.pinax_hello.tests" ], MIDD...
tuzzer/ai-gym
atari_breakout/atari_breakout_dqn_cntk.py
import random import numpy as np import math from time import perf_counter import os import sys from collections import deque import gym import cntk from cntk.layers import Convolution, MaxPooling, Dense from cntk.models import Sequential, LayerStack from cntk.initializer import glorot_normal env = gym.make("Break...
sunrin92/LearnPython
1-lpthw/ex32.py
the_count = [1, 2, 3, 4, 5] fruits = ['apple', 'oranges', 'pears', 'apricots',] change = [1, 'pennies', 2, 'dimes', 3, 'quarters',] #this first kind of for-loop goes through a list for number in the_count: print("This is count %d" % number) # same as above for fruit in fruits: print("A fruit of type: %s" % fr...
fedspendingtransparency/data-act-validator
dataactvalidator/migrations/versions/c0a714ade734_adding_timestamps_to_all_tables.py
"""adding timestamps to all tables Revision ID: c0a714ade734 Revises: 1a886e694fca Create Date: 2016-04-20 14:46:06.407765 """ # revision identifiers, used by Alembic. revision = 'c0a714ade734' down_revision = '1a886e694fca' branch_labels = None depends_on = None from alembic import op import sqlalchemy as sa def ...
jleclanche/pywow
wdbc/main.py
from cStringIO import StringIO from struct import pack, unpack, error as StructError from .log import log from .structures import fields class DBFile(object): """ Base class for WDB and DBC files """ @classmethod def open(cls, file, build, structure, environment): if isinstance(file, basestring): file = op...
boniatillo-com/PhaserEditor
docs/v2/conf.py
# -*- coding: utf-8 -*- # # Phaser Editor documentation build configuration file, created by # sphinx-quickstart on Thu May 25 08:35:14 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file....
camptocamp/QGIS
python/plugins/processing/saga/SplitRGBBands.py
# -*- coding: utf-8 -*- """ *************************************************************************** SplitRGBBands.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *************************...
ulethHCI/GLuskap
plugins/moment_curve.py
#!/usr/bin/python2.3 # This is the short name of the plugin, used as the menu item # for the plugin. # If not specified, the name of the file will be used. shortname = "Moment Curve layout (Cohen et al. 1995)" # This is the long name of the plugin, used as the menu note # for the plugin. # If not specified, the short ...
repotvsupertuga/tvsupertuga.repository
script.module.openscrapers/lib/openscrapers/sources_openscrapers/en/coolmoviezone.py
# -*- coding: utf-8 -*- # ..#######.########.#######.##....#..######..######.########....###...########.#######.########..######. # .##.....#.##.....#.##......###...#.##....#.##....#.##.....#...##.##..##.....#.##......##.....#.##....## # .##.....#.##.....#.##......####..#.##......##......##.....#..##...##.##.....#....
ketan-analytics/learnpython
Safaribookonline-Python/courseware-btb/solutions/py3/patterns/properties_extra.py
''' Ohm's law is a simple equation describing electrical circuits. It states that the voltage V through a resistor is equal to the current (I) times the resistance: V = I * R The units of these are volts, ampheres (or "amps"), and ohms, respectively. In real circuits, often R is actually measured in kiloohms (10**3 o...
arannasousa/pagseguro_xml
exemplos/testes_notificacao.py
# coding=utf-8 # --------------------------------------------------------------- # Desenvolvedor: Arannã Sousa Santos # Mês: 12 # Ano: 2015 # Projeto: pagseguro_xml # e-mail: asousas@live.com # --------------------------------------------------------------- import loggin...
denys-duchier/Scolar
ZopeProducts/exUserFolder/Plugins.py
# # # (C) Copyright 2001 The Internet (Aust) Pty Ltd # ACN: 082 081 472 ABN: 83 082 081 472 # All Rights Reserved # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A ...
hylom/grrreader
backend/feedfetcher.py
#!/usr/bin/python "feed fetcher" from db import MySQLDatabase from fetcher import FeedFetcher def main(): db = MySQLDatabase() fetcher = FeedFetcher() feeds = db.get_feeds(offset=0, limit=10) read_count = 10 while len(feeds) > 0: for feed in feeds: fid = feed[0] ur...
droundy/deft
papers/hughes-saft/figs/density_calc.py
#!/usr/bin/env python import math fin = open('figs/single-rod-in-water.dat', 'r') fout = open('figs/single-rods-calculated-density.dat', 'w') kB = 3.16681539628059e-6 # This is Boltzmann's constant in Hartree/Kelvin first = 1 nm = 18.8972613 for line in fin: current = str(line) pieces = current.split('\t')...
viswimmer1/PythonGenerator
data/python_files/34574373/cmss.py
import win32pipe import win32console import win32process import time import win32con import codecs import ctypes user32 = ctypes.windll.user32 CONQUE_WINDOWS_VK = { '3' : win32con.VK_CANCEL, '8' : win32con.VK_BACK, '9' : win32con.VK_TAB, '12' : win32con.VK_CLEAR, '13' : win32con.V...
deggis/drinkcounter
clients/s60-python/client.py
import urllib2 import appuifw, e32 from key_codes import * class Drinker(object): def __init__(self): self.id = 0 self.name = "" self.prom = 0.0 self.idle = "" self.drinks = 0 def get_drinker_list(): data = urllib2.urlopen("http://192.168.11.5:8080/drinkcounter/get_da...
eesatfan/vuplus-enigma2
lib/python/Components/AVSwitch.py
from config import config, ConfigSlider, ConfigSelection, ConfigYesNo, \ ConfigEnableDisable, ConfigSubsection, ConfigBoolean, ConfigSelectionNumber, ConfigNothing, NoSave from enigma import eAVSwitch, getDesktop from SystemInfo import SystemInfo from os import path as os_path class AVSwitch: def setInput(self, inpu...
ARL-UTEP-OC/emubox
workshop-manager/bin/RequestHandler/client_updater.py
import sys import time import logging from socketio import socketio_manage from socketio.mixins import BroadcastMixin from socketio.namespace import BaseNamespace from DataAggregation.webdata_aggregator import getAvailableWorkshops logger = logging.getLogger(__name__) std_out_logger = logging.StreamHandler(sys.stdo...
bluciam/ruby_versus_python
other/dicco_numbers.py
def freq_month(obj): if obj is None or obj == []: return months = {1: 'jan', 2: 'feb', 3: 'mar', 4: 'apr', 5: 'may', 6: 'jun', 7: 'jul', 8: 'aug', 9: 'sep', 10: 'oct', ...
izrik/tudor
tests/logic_t/layer/LogicLayer/test_task_prioritize.py
#!/usr/bin/env python import unittest from werkzeug.exceptions import NotFound, Forbidden from tests.logic_t.layer.LogicLayer.util import generate_ll class TaskPrioritizeBeforeLogicLayerTest(unittest.TestCase): def setUp(self): self.ll = generate_ll() self.pl = self.ll.pl def test_add_prio...
team-phoenix/Phoenix
frontend/python/updaters/sqlTableUpdater.py
import os from collections import OrderedDict from .sqldatabase import SqlDatabase from .retrieve_core_info import retrieveCoreInfo # Root class that all SQL table updaters derive from class SqlTableUpdater(): def __init__(self, tableName, tableColumns=[], coreInfo={}): self.tableName = tableName ...
thomec/tango
accounts/authentication.py
# accounts/authentication.py import requests import logging from django.conf import settings from django.contrib.auth import get_user_model logger = logging.getLogger(__name__) User = get_user_model() PERSONA_VERIFY_URL = 'https://verifier.login.persona.org/verify' #DOMAIN = 'localhost' #DOMAIN = 'http://hotzenplot...
anurag03/integration_tests
cfme/tests/candu/test_utilization_metrics.py
# -*- coding: utf-8 -*- import random from operator import attrgetter import pytest from cfme import test_requirements from cfme.cloud.provider import CloudProvider from cfme.cloud.provider.azure import AzureProvider from cfme.cloud.provider.ec2 import EC2Provider from cfme.cloud.provider.gce import GCEProvider from...
jburel/openmicroscopy
examples/Training/python/Json_Api/Login.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2016-2017 University of Dundee & Open Microscopy Environment. # All Rights Reserved. # Use is subject to license terms supplied in LICENSE.txt # import requests from Parse_OMERO_Properties import USERNAME, PASSWORD, OMERO_WEB_HOST, \ ...
slaughterjames/static
modules/malware_bazaar_search.py
#python imports import sys import os import time import datetime import subprocess import json import requests from termcolor import colored #third-party imports #No third-party imports #programmer generated imports from logger import logger from fileio import fileio ''' ***BEGIN DESCRIPTION*** Type: Search - Descri...
QuLogic/burnman
burnman/data/input_raw_endmember_datasets/HHPH2013data_to_burnman.py
# BurnMan - a lower mantle toolkit # Copyright (C) 2012-2014, Myhill, R., Heister, T., Unterborn, C., Rose, I. and Cottaar, S. # Released under GPL v2 or later. # This is a standalone program that converts a tabulated version of the Stixrude and Lithgow-Bertelloni data format into the standard burnman format (printed ...
LPgenerator/django-db-mailer
dbmail/providers/google/android.py
# -*- encoding: utf-8 -*- try: from httplib import HTTPSConnection from urlparse import urlparse except ImportError: from http.client import HTTPSConnection from urllib.parse import urlparse from json import dumps, loads from django.conf import settings class GCMError(Exception): pass def send...
ejspina/Gene_expression_tools
Python/FilterByID_dict_parse.py
#------------------------------------------------------------------------------- # Name: module1 # Purpose: # # Author: Eli # # Created: 06/04/2014 # Copyright: (c) Eli 2014 # Licence: <your licence> #------------------------------------------------------------------------------- def m...
underdogio/tld
src/tld/update.py
from __future__ import print_function """ Deprecated. Use ``update-tld-names`` command instead. """ __title__ = 'tld.update' __author__ = 'Artur Barseghyan' __copyright__ = '2013-2015 Artur Barseghyan' __license__ = 'GPL 2.0/LGPL 2.1' from tld.utils import update_tld_names _ = lambda x: x if __name__ == '__main__'...
saloni10/librehatti_new
src/authentication/models.py
from django.db import models from django.contrib.auth.models import User class OrganisationType(models.Model): type_desc = models.CharField(max_length=200) def __unicode__(self): return self.type_desc class Address(models.Model): street_address = models.CharField(max_length=100) city = model...
portante/sosreport
sos/plugins/sysvipc.py
## Copyright (C) 2007-2012 Red Hat, Inc., Bryn M. Reeves <bmr@redhat.com> ### 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 ve...
centrumholdings/buildbot
buildbot/status/web/authz.py
from buildbot.status.web.auth import IAuth class Authz(object): """Decide who can do what.""" knownActions = [ # If you add a new action here, be sure to also update the documentation # at docs/cfg-statustargets.texinfo 'gracefulShutdown', 'forceBuild', 'forceAllBui...
joshmoore/zeroc-ice
py/test/Ice/faultTolerance/Client.py
#!/usr/bin/env python # ********************************************************************** # # Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. # # *************************************...
EdDev/vdsm
lib/vdsm/v2v.py
# Copyright 2014-2017 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in...
igrlas/CentralHub
CHPackage/src/centralhub/server/home_endpoints.py
# Endpoints for user to control the home. from datetime import datetime from flask import Blueprint, jsonify, request from services import elements_services, home_services home_api = Blueprint('/home_api', __name__) elements_services = elements_services.ElementsServices() home_services = home_services.HomeServices()...
acuriel/Nixtla
nixtla/core/tools/pympi/Elan.py
# -*- coding: utf-8 -*- import time import EafIO import warnings class Eaf: """Read and write Elan's Eaf files. .. note:: All times are in milliseconds and can't have decimals. :var dict annotation_document: Annotation document TAG entries. :var dict licences: Licences included in the file. :va...
Stiliyan92/accounting-system
common/config_parser.py
import configparser CONFIG_PATH = 'accounting.conf' class MyConfigParser(): def __init__(self, config_path=CONFIG_PATH): self.config = configparser.ConfigParser(allow_no_value=True) self.config.read(config_path) def config_section_map(self, section): """ returns all configuration op...
JHeimdal/HalIR
Test/plotf.py
#!/usr/bin/env python3 import sys import numpy as np from spc import SPC import matplotlib.pyplot as plt def plot(files, fac=1.0): for f in files: if f.split('.')[-1] == 'xy': td = np.loadtxt(f) plt.plot(td[:, 0], np.log(1. / td[:, 1]) * fac, label=f) elif f.split('.')[-1]...
jeremyherbert/TumblrServ
tumblrserv.py
#!/usr/bin/env python ## tumblrserv.py implements a Tumblr (http://www.tumblr.com) markup parsing ## engine and compatible webserver. ## ## Version: 0.2 final ## ## Copyright (C) 2009 Jeremy Herbert ## Contact mailto:jeremy@jeremyherbert.net ## ## This program is free software; you can redistribute i...
ytsapras/robonet_site
scripts/rome_fields_dict.py
field_dict={'ROME-FIELD-01':[ 267.835895375 , -30.0608178195 , '17:51:20.6149','-30:03:38.9442' ], 'ROME-FIELD-02':[ 269.636745458 , -27.9782661111 , '17:58:32.8189','-27:58:41.758' ], 'ROME-FIELD-03':[ 268.000049542 , -28.8195573333 , '17:52:00.0119','-28:49:10.4064' ], 'ROME-FIE...
poderomedia/kfdata
kgrants/spiders/grants.py
# -*- coding: utf-8 -*- from scrapy.spider import Spider from scrapy.selector import Selector from kgrants.items import KgrantsItem from scrapy.http import Request import time class GrantsSpider(Spider): name = "grants" allowed_domains = ["www.knightfoundation.org"] pages = 1 base_url = 'http://www.k...
maxiee/LearnPythonTheHardWayExercises
ex20.py
from sys import argv script, input_file = argv def print_all(f): print f.read() def rewind(f): f.seek(0) def print_a_line(line_count, f): print line_count, f.readline() current_file = open(input_file) print "First let's print the whole file:\n" print_all(current_file) print "Now let's rewind, kind o...
kodi-czsk/plugin.video.hejbejse.tv
resources/lib/hejbejse.py
# -*- coding: UTF-8 -*- #/* # * Copyright (C) 2011 Ivo Brhel # * # * # * 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, or (at your option) # * any later version. #...
lovekun/Notebook
python/chatroomServer.py
import socket import threading import time def tcplink(sock, addr): print 'Accept new connection from %s:%s...' % addr sock.send('Welcome!') while True: data = sock.recv(1024) time.sleep(1) if data == 'exit' or not data: break sock.send('Hello, %s!' %...
AugurProject/augur-launcher
Augur Installer.py
import os import sys import shutil import binascii import traceback import subprocess from win32com.client import Dispatch LAUNCHER_PATH = "C:\\Program Files\\Augur" DATA_PATH = os.path.join(os.path.expanduser('~'), 'AppData', 'Roaming', "Augur") PASSFILE = os.path.join(DATA_PATH, "password.txt") if getattr(sys, 'fro...
ancho85/pylint-playero-plugin
tests/test_funcs.py
import unittest from libs.funcs import * class TestFuncs(unittest.TestCase): def test_buildPaths(self): recPaths, repPaths, rouPaths, corePaths = buildPaths() findTxt = lambda x, y: x.find(y) > -1 assert findTxt(recPaths["Task"][0], "base") assert findTxt(recPaths["Department"][0...