code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
import urllib2, HTMLParser
import re
text_file = open("shakespeare.txt", 'w')
class HTMLShakespeareParser(HTMLParser.HTMLParser):
def handle_starttag(self, tag, attrs):
if tag == "a":
link = dict(attrs)["href"]
if "/index.html" in link:
works.append(link[:-11])
works = []
html_index_file = urllib2.urlop... | amiller27/First-Experiences-in-Research | writer/shakespeare_get.py | Python | gpl-2.0 | 722 |
# encoding=utf-8
'''
Created on 2013-9-8
@author: gudh
'''
start_pos = (5, 222) # 开始的位置
block_size = (67, 67) # 块大小
rel_pos = (33, 28) # 相对块头位置
colors = (
(255, 255, 255), # 白
(164, 130, 213), # 紫
(247, 214, 82), # 黄
(244, 160, 90), # 土
(90, 186, 238), # 蓝
(247, 69, 95), # 红
(173, 235, 82) # 绿
)
colornames = (u'ba', ... | Yhzhtk/pytool | game/aixiaochu/xiaochu.py | Python | gpl-2.0 | 2,786 |
# -*- coding: utf-8 -*- #
#
# Copyright 2015 Nandaja Varma <nvarma@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 3 of the License, or
# (at your option) any later ... | lioupayphone/gdeploy | gdeploycore/backend_setup.py | Python | gpl-2.0 | 19,516 |
#!/usr/bin/python
import logging, sys, re, getpass, argparse, pprint, csv, time
from pysphere import MORTypes, VIServer, VITask, VIProperty, VIMor, VIException
from pysphere.vi_virtual_machine import VIVirtualMachine
from pysphere.resources import VimService_services as VI
def sizeof_fmt(num):
for x in ['bytes','K... | jm66/vsphere_inventory_report | vsphere_inventory_report.py | Python | gpl-2.0 | 17,553 |
from django.db import models
from instruments.base import BaseTable
class German_WS(BaseTable):
item_1_choices = [('produces', 'produces')]
item_1 = models.CharField(max_length=8, choices=item_1_choices, null=True)
item_2_choices = [('produces', 'produces')]
item_2 = models.CharField(max_length=8, cho... | langcog/wordbank | instruments/schemas/German_WS.py | Python | gpl-2.0 | 77,978 |
#! /usr/bin/env python
from urllib2 import urlopen
from urllib import urlencode
from urlparse import urlparse, urljoin
import os.path
from numpy import *
from astrometry.util.file import *
from astrometry.util.usnob_get_image import *
from optparse import OptionParser
if __name__ == '__main__':
parser = OptionPa... | blackball/an-test6 | util/usnob_get_region.py | Python | gpl-2.0 | 3,265 |
"""
Plugin for URLResolver
Copyright (C) 2016 script.module.urlresolver
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) a... | dknlght/dkodi | src/script.module.urlresolver/lib/urlresolver/plugins/__generic_resolver__.py | Python | gpl-2.0 | 2,035 |
#!/usr/bin/env python
# -*- coding: utf-8; py-indent-offset: 4 -*-
import os
import pytest
import re
from remote import (actual_output, config, remotetest, remotedir, wait_agent,
write_config)
class Globals(object):
section = 'df'
alone = True
@pytest.fixture
def testfile():
return o... | huiyiqun/check_mk | agents/windows/it/test_section_df.py | Python | gpl-2.0 | 1,334 |
## BigEnemy
## Clase que implementa un tipo de enemigo mas grande y resistente
##
## Author: Santiago Faci
## Version: 2.0
from direct.showbase.DirectObject import DirectObject
import random
from Enemy import Enemy
VELOCIDAD = -2
VELOCIDAD_MISIL = 10
Y = 55
FRECUENCIA_DISPARO = 0.2
PUNTOS = 200
VIDA = 4
class Shoot... | sfaci/fighter2d | fighter2d/ShooterEnemy.py | Python | gpl-2.0 | 687 |
import json
import logging
from logging.config import dictConfig
import threading
import pickle
import redis
import aws
from settings import Settings
def terminate_worker(worker_id, instance, client):
result = aws.terminate_machine(instance)
if result is None or len(result) == 0:
logging.error('could... | witlox/dcs | controller/ilm/consuela.py | Python | gpl-2.0 | 4,723 |
#!/usr/bin/env python
# ! -*- coding:utf-8 -*-
from pagseguro_python_client.validators import ItemValidator
import inspect
import inflection
import json
class Base(object):
def underscore_to_camelcase(self, value, uppercase_first_letter=False):
return inflection.camelize(value, uppercase_first_letter)
... | geraldoandradee/pagseguro_python_client | pagseguro_python_client/models.py | Python | gpl-2.0 | 6,611 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2021 Matthias Kemmer
#
# 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 optio... | gramps-project/addons-source | Heatmap/heatmap.py | Python | gpl-2.0 | 19,644 |
# -insar.py- coding: utf-8 -*-
"""
Created on Fri Sep 3 10:46:50 2010
@author: bosmanoglu
InSAR module. Includes functions for analyzing SAR interferometry with python.
"""
from numpy import *
from pylab import *
from basic import *
import scipy
from scipy import ndimage #scipy.pkgload('ndimage')
from scipy import ... | bosmanoglu/adore-doris | lib/python/insar/__init__.py | Python | gpl-2.0 | 25,698 |
# engine/interfaces.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Define core interfaces used by the engine system."""
from .. impor... | olivierdalang/stdm | third_party/sqlalchemy/engine/interfaces.py | Python | gpl-2.0 | 31,317 |
################################
# These variables are overwritten by Zenoss when the ZenPack is exported
# or saved. Do not modify them directly here.
# NB: PACKAGES is deprecated
NAME = 'ZenPacks.community.TokyoTyrant'
VERSION = '1.0'
AUTHOR = 'B Maqueira'
LICENSE = "GPLv2"
NAMESPACE_PACKAGES = ['ZenPacks', 'ZenPack... | zenoss/ZenPacks.community.TokyoTyrant | setup.py | Python | gpl-2.0 | 2,602 |
# -*- coding: utf-8 -*-
# Automatic library update plugin
#
# (c) 2009 Joe Higton
# 2011 - 2016 Nick Boultbee
#
# 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 Licens... | elbeardmorez/quodlibet | quodlibet/quodlibet/ext/events/auto_library_update.py | Python | gpl-2.0 | 6,971 |
import logging
import sys
import requests
from bs4 import BeautifulSoup
# White pages url
WHITE_PAGES_URL = "http://www.paginebianche.it/execute.cgi"
class wp_response(object):
def __init__(self, name, tel, addr):
self.name = name
self.tel = tel
self.addr = addr
def search_wp(name, loc... | Shevraar/jovabot | modules/addressbook/paginebianche.py | Python | gpl-2.0 | 1,262 |
#!/usr/bin/env python
#
# fileobjscan.py
# Copyright 2009 Andreas Schuster <a.schuster@yendor.net>
# Copyright (C) 2009-2011 Volatile Systems
#
# 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
# ... | rainaashutosh/MyTestRekall | rekall-core/rekall/plugins/windows/filescan.py | Python | gpl-2.0 | 17,132 |
import resource_monitor
import sys
import time
@resource_monitor.monitored(limits = {'wall_time': 1e6}) # wall_time in microseconds
def my_function(n):
sys.stdout.write("waiting for {time} seconds...".format(time=n))
time.sleep(n)
sys.stdout.write("done.\n")
return n
try:
(output, resources) = ... | nkremerh/cctools | resource_monitor/src/bindings/python3/example_simple_limit.py | Python | gpl-2.0 | 791 |
from critiquebrainz.data.testing import DataTestCase
from critiquebrainz.data import utils
class DataUtilsTestCase(DataTestCase):
def test_explode_db_uri(self):
uri = "postgresql://cb_user:cb_password@localhost:5432/cb"
hostname, db_name, username, password = utils.explode_db_uri(uri)
se... | dufferzafar/critiquebrainz | critiquebrainz/data/utils_test.py | Python | gpl-2.0 | 673 |
'''
Code for reading and managing ASTER spectral library data.
'''
from __future__ import absolute_import, division, print_function, unicode_literals
from spectral.utilities.python23 import IS_PYTHON3, tobytes, frombytes
from .spectral_database import SpectralDatabase
if IS_PYTHON3:
readline = lambda fin: fin.r... | spectralpython/spectral | spectral/database/aster.py | Python | gpl-2.0 | 15,620 |
"""
This module is designed for using afni to find regions of interest from a nifti file.
"""
__author__ = "Devon Hjelm"
__copyright__ = "Copyright 2014, Mind Research Network"
__credits__ = ["Devon Hjelm"]
__licence__ = "3-clause BSD"
__email__ = "dhjelm@mrn.org"
__maintainer__ = "Devon Hjelm"
import argparse
import... | MRN-Code/pl2mind | tools/rois.py | Python | gpl-2.0 | 11,580 |
import wx
import input_indikator_kemiskinan
import peringatan
import frm_sideka_menu
def create(parent):
return Dialog1(parent)
[wxID_DIALOG1, wxID_DIALOG1BUTTON1, wxID_DIALOG1BUTTON2,
wxID_DIALOG1STATICLINE1, wxID_DIALOG1STATICTEXT1, wxID_DIALOG1STATICTEXT2,
wxID_DIALOG1TEXTCTRL1,
] = [wx.NewId() for _init... | sasongko26/sideka-desktop | login_indikator_kemiskinan.py | Python | gpl-2.0 | 2,727 |
# BurnMan - a lower mantle toolkit
# Copyright (C) 2012, 2013, Heister, T., Unterborn, C., Rose, I. and Cottaar, S.
# Released under GPL v2 or later.
"""
example_user_input_material
---------------------------
Shows user how to input a mineral of his/her choice without usint the library and which physical values... | QuLogic/burnman | examples/example_user_input_material.py | Python | gpl-2.0 | 4,958 |
import re
import xml.dom.minidom
from typing import List, Any, Optional
from pcs import utils
from pcs.cli.reports.output import warn
from pcs.common import (
const,
pacemaker,
)
from pcs.common.str_tools import format_list_custom_last_separator
# pylint: disable=not-callable
# main functions
def parse_ar... | feist/pcs | pcs/rule.py | Python | gpl-2.0 | 41,255 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2013, 2014, 2015 CERN.
#
# Invenio 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 optio... | chokribr/invenio | setup.py | Python | gpl-2.0 | 11,954 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'mainwindow.ui'
#
# Created by: PyQt5 UI code generator 5.4.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWi... | mhorn71/StarbaseMini | ui/mainwindow.py | Python | gpl-2.0 | 30,116 |
#!/usr/bin/env python2
# Solution to project euler problem 14
def collatzlength(start):
x = start
cnt = 0
while x != 1:
x = nextcollatz(x)
cnt += 1
return cnt
def nextcollatz(x):
if x % 2 == 0:
return x/2
else:
return 3*x + 1
def solution(n):
mx... | svb2357/projecteuler | 14/answer.py | Python | gpl-2.0 | 492 |
""" CS4HS Website Generator
AUTHOR: Jack Morgan
REQUIRES: Python >= 3.4.1
"""
CURRENT_DIRECTORY = '.'
OUTPUT_DIRECTORY = './output/'
TEXT_FOLDER = './text/'
FOLDERS_TO_COPY = ['css', 'files', 'img', 'js']
"""Check and install dependencies"""
import pip
# Update pip if needed and install dependencies
pip.main(['insta... | uccser/cs4hs | generate.py | Python | gpl-3.0 | 3,361 |
from setuptools import setup, find_packages, Extension
from Cython.Distutils import build_ext
from Cython.Build import cythonize
# for unix
cec2013single = Extension("cec2013single.cec2013",
["cec2013single/cec2013.pyx", "cec2013single/cec2013_func.c"],
libraries=["m"]) # Unix-like specific... | yyamnk/cec2013single | setup.py | Python | gpl-3.0 | 1,178 |
#!/usr/bin/env /usr/bin/python
#
# Copyright 2014 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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 o... | bastibl/gnuradio | gr-dtv/python/dtv/atsc_rx_filter.py | Python | gpl-3.0 | 2,603 |
import datetime
import pytest
from mock import Mock
from unittest import TestCase
import random
import logging
logging.raiseExceptions = False
from nav import logengine
now = datetime.datetime.now()
@pytest.fixture
def loglines():
return """
Oct 28 13:15:06 10.0.42.103 1030: Oct 28 13:15:05.310 CEST: %LINEPROT... | hmpf/nav | tests/unittests/general/logengine_test.py | Python | gpl-3.0 | 7,207 |
# coding: utf-8
"""
EVE Swagger Interface
An OpenAPI for EVE Online
OpenAPI spec version: 0.4.6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class PutFleetsFleetIdMembersMemberIdUnprocessableEntity(object)... | minlexx/pyevemon | esi_client/models/put_fleets_fleet_id_members_member_id_unprocessable_entity.py | Python | gpl-3.0 | 3,138 |
import serial
import sys
import math
VCC = 5.0 # Supplied voltage in volts
R0 = 10000.0 # Nominal resistance of the thermistor in ohms
T0_C = 25.0 # Temperature for nominal resistance in Celsius (almost always 25)
BETA = 3950.0 # Beta coefficient of the thermistor
R_FIX = 9650.0 # Resistance of the fix... | mondalaci/usb-temperature-sensor | host-utils/TemperatureSensor.py | Python | gpl-3.0 | 1,132 |
#!/usr/bin/env python
"""Subsest sam file to keep wanted loci
Usage:
./01_scripts/03_get_wanted_loci_sam.py input_sam_file wanted_loci output_sam_file
"""
# Modules
import sys
# Main
if __name__ == '__main__':
# Parse user input
try:
input_file = sys.argv[1]
wanted_file = sys.argv[2]
... | enormandeau/mapcomp | 01_scripts/03_extract_good_loci.py | Python | gpl-3.0 | 1,046 |
from django import forms
from django.forms import ModelForm
from django.db import models
from app.models import PoolType
class PoolTypeForm_Create(ModelForm):
name = forms.CharField(max_length = 100, label = 'Pool Type',
widget = forms.TextInput({
... | LarryHillyer/PoolHost | PoolHost/pooltype/forms.py | Python | gpl-3.0 | 911 |
# file openpyxl/writer/strings.py
# Copyright (c) 2010-2011 openpyxl
#
# 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, ... | sbhowmik7/PSSEcompare | ext_libs/openpyxl/writer/strings.py | Python | gpl-3.0 | 3,077 |
import sys
import math
import numpy as np
import scipy.special as sp
import matplotlib.pyplot as plt
sys.path.append('../functions')
from base_driver import BaseDriver
from helper_objects import BaseField
import USER_INPUT
from ERRWAVBRK1 import ERRWAVBRK1
from EXPORTER import EXPORTER
## ACES Update to python
#----... | allthroughthenight/aces | python/drivers/cnoidal_wave_theory.py | Python | gpl-3.0 | 21,381 |
# Copyright (c) 2008-2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.web.distrib}.
"""
from os.path import abspath
from xml.dom.minidom import parseString
try:
import pwd
except ImportError:
pwd = None
from zope.interface.verify import verifyObject
from twisted.python im... | Donkyhotay/MoonPy | twisted/web/test/test_distrib.py | Python | gpl-3.0 | 9,985 |
# -*- Mode: Python; test-case-name: whipper.test.test_common_program -*-
# vi:si:et:sw=4:sts=4:ts=4
# Copyright (C) 2009, 2010, 2011 Thomas Vander Stichele
# This file is part of whipper.
#
# whipper is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publ... | MerlijnWajer/whipper | whipper/common/program.py | Python | gpl-3.0 | 24,809 |
# -*- coding: utf-8 -*-
import pygame
pygame.init()
window = pygame.display.set_mode( (500, 400) )
while True:
pygame.draw.rect(window, (255, 0, 0), (100, 100, 100, 50), 2)
pygame.draw.ellipse(window, (255, 0, 0), (100, 100, 100, 50))
pygame.draw.rect(window, (0, 255, 0), (100, 150, 80, 40), 2)
pygame.draw.el... | tidus747/Tutoriales_juegos_Python | Nociones PyGame/hola_mundo.py | Python | gpl-3.0 | 592 |
#!/usr/bin/env python
# Copyright (C) 2011 Rohan Jain
# Copyright (C) 2011 Alexis Le-Quoc
#
# 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
# (a... | crodjer/paster | setup.py | Python | gpl-3.0 | 2,026 |
import arrayfire as af
import numpy as np
from bolt.lib.physical_system import physical_system
from bolt.lib.nonlinear.nonlinear_solver import nonlinear_solver
from bolt.lib.linear.linear_solver import linear_solver
import input_files.domain as domain
import input_files.boundary_conditions as boundary_conditions
impo... | ShyamSS-95/Bolt | example_problems/nonrelativistic_boltzmann/linear_modes/linear_modes_euler/1D/entropy_mode/run_cases.py | Python | gpl-3.0 | 1,686 |
# -*- coding: utf-8 -*-
# Copyright(C) 2010 Nicolas Duhamel
#
# 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, version 3 of the License.
#
# This program is distributed in the hope that it will... | jocelynj/weboob | weboob/backends/canalplus/backend.py | Python | gpl-3.0 | 2,271 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import xml.etree.ElementTree as ET
from svg.path import parse_path, Line
filename = 'tests/pcb split.svg'
outfolder = 'out'
class SvgToPoly(object):
def __init__(self, filename, outFolder = 'out', curveResolution = 1, scalingFactor = 1):
tree = ET.pars... | JarrettR/Altium-CircuitMaker-Tools | svg-parse.py | Python | gpl-3.0 | 2,419 |
# -*- coding: utf-8 -*-
# LINZ-2-OSM
# Copyright (C) 2010-2012 Koordinates Ltd.
#
# 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) an... | opennewzealand/linz2osm | linz2osm/data_dict/migrations/0007_add_model_Dataset.py | Python | gpl-3.0 | 3,063 |
#!/usr/bin/python
# This file is part of pulseaudio-dlna.
# pulseaudio-dlna 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.
# pulsea... | caio2k/pulseaudio-dlna | pulseaudio_dlna/streamserver.py | Python | gpl-3.0 | 18,157 |
# -*- coding: utf-8 -*-
import scrapy
from crawl.items import theIndependentItem
class IndependentSpider(scrapy.Spider):
name = "www.independent.co.uk"
baseURL = "https://www.independent.co.uk"
allowed_domains = ["https://www.independent.co.uk"]
start_urls = ['https://www.independent.co.uk/']
def... | v0idwalker/mgr-sources | crawl/crawl/spiders/independent.py | Python | gpl-3.0 | 714 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2017-02-09 17:08
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('scoping', '0047_auto_20170209_1626'),
]
operations... | mcallaghan/tmv | BasicBrowser/scoping/migrations/0048_auto_20170209_1708.py | Python | gpl-3.0 | 658 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Dag Wieers (@dagwieers) <dag@wieers.com>
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""Run any Kodi VRT NU plugin:// URL on the commandline"""
from __future__ import absolute_import, division, print_functi... | pietje666/plugin.video.vrt.nu | tests/run.py | Python | gpl-3.0 | 1,293 |
import clize
from . import stacks
def update(stack_type, *args):
stacks.get(stack_type).update(*args)
def main():
clize.run([stacks.staticsite, stacks.staticsitewithemail])
if __name__ == '__main__':
main()
| TheLaunchNinja/exosphere | exosphere/cli.py | Python | gpl-3.0 | 225 |
"""
Implements Monte Carlo inference for Gaussian Mixtures:
Y[i·]|(Z, mu, sig2) ~ Normal(mu[Z[i·]·], sig2[Z[i·]·])
Z[i·]|pi ~ Categorical(pi)
where Z is latent.
Data
----
Y : np.ndarray in R^(nobs, nvar)
Latent
------
Z : np.ndarray in (0:ncomp-1)^nobs
Parameters
----------
pi : np.ndarray in Simplex_nco... | timsf/bayeslib | backends/blocked_gibbs/normal_mixture.py | Python | gpl-3.0 | 4,911 |
# -*- coding: utf-8 -*-
"""
Script that lets me play with things I'm learning
"""
from __future__ import absolute_import, division, print_function, unicode_literals
def symbolic_confusion(**known):
"""
Example:
>>> known = {'tp': 10, 'fp': 100, 'total': 1000}
>>> solution = symbolic_confusion(... | Erotemic/local | misc/learn.py | Python | gpl-3.0 | 44,178 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
import frappe
from frappe.utils import cstr, flt, nowdate, random_string
from erpnext.hr.doctype.employee.test_employee import make_employee
from erpnext.hr.doctype.vehicle_log.vehicle_log import make_expense_claim... | mhbu50/erpnext | erpnext/hr/doctype/vehicle_log/test_vehicle_log.py | Python | gpl-3.0 | 3,526 |
from monitor import Monitor
try:
from python_libtorrent import get_libtorrent
lt = get_libtorrent()
except Exception, e:
import libtorrent as lt
class Dispatcher(Monitor):
def __init__(self, client):
super(Dispatcher,self).__init__(client)
def do_start(self, th, ses):
self._th = th... | ChopChopKodi/pelisalacarta | python/main-classic/lib/btserver/dispatcher.py | Python | gpl-3.0 | 805 |
import huffman
import bitstring
from bitstring import BitArray
myfile = open("foo.txt","r")
allofthefile = myfile.read()
myfile.close()
mycharset = u"\u000A"
mycharset = mycharset + " abcdefghijklmnopqrstuvwxyz"+\
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"+\
"0123456789!#$%&'()\"*+,-./:;<=>?@[\]^_`{|}~"+\
... | ashumallik/Compression-Engine | huffman.py | Python | gpl-3.0 | 2,799 |
import socket
portas = [21, 23, 80, 8080, 443]
for porta in portas:
cliente = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
cliente.settimeout(1)
codigo = cliente.connect_ex(('bancocn.com', porta))
if codigo == 0:
print porta, "OPEN" | abrandao/lab | studies/hacking_solyd/portscan.py | Python | gpl-3.0 | 253 |
# -*- coding: utf-8 -*-
#+---------------------------------------------------------------------------+
#| 01001110 01100101 01110100 01111010 01101111 01100010 |
#| |
#| Netzob : Inferring communication protocol... | nagyistoce/netzob | src/netzob/Common/Type/Format.py | Python | gpl-3.0 | 3,917 |
#!/usr/bin/env python
#coding=utf8
"""
DOCSTRING
"""
import pprint
import textwrap
import time
import easycat
from things import Thing
from cjh.tablegames.igo import Goban
from versatiledialogs.lists import Enumeration, ItemList
from versatiledialogs.terminal import Terminal
class Turn(Thing):
"""
Sequential ... | hammerhorn/working | cjh/tablegames/game_record.py | Python | gpl-3.0 | 9,731 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""usage: blobtools view -i <BLOBDB> [-x <TAXRULE>] [--rank <TAXRANK>...] [--hits]
[--list <LIST>] [--out <OUT>] [--notable]
[--concoct] [--cov] [--experimental <META>]
[--h|--help]
... | DRL/blobtools | lib/view.py | Python | gpl-3.0 | 5,130 |
import pyowm
import main
owm = pyowm.OWM('9a55dd22782984d74bc1deecec64fc9a', language='Ru')
def weather_handler(message):
try:
observation = owm.weather_at_place(message.text)
weather = observation.get_weather()
answer = weather.get_detailed_status()
temperature = wea... | Skufler/pybot | weather.py | Python | gpl-3.0 | 736 |
# Generated by Django 3.2 on 2021-04-22 04:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lrex_item', '0002_auto_20201210_0817'),
]
operations = [
migrations.AlterField(
model_name='itemfeedback',
name='scale... | 2e2a/l-rex | apps/item/migrations/0003_alter_itemfeedback_scale_values.py | Python | gpl-3.0 | 644 |
# kernelconfig - Generate custom kernel configurations from curated sources
# Copyright (C) 2015 Denis Dupeyron <calchan@gentoo.org>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License version 3, as published by the
# Free Software Foundat... | Calchan/kernelconfig | setup.py | Python | gpl-3.0 | 3,439 |
################################################################################
#
# Copyright (C) 2012-2013 Eric Conte, Benjamin Fuks
# The MadAnalysis development team, email: <ma5team@iphc.cnrs.fr>
#
# This file is part of MadAnalysis 5.
# Official website: <https://launchpad.net/madanalysis5>
#
# MadAnal... | Lana-B/Pheno4T | madanalysis/layout/plotflow.py | Python | gpl-3.0 | 19,086 |
from discord.ext import commands
import discord
from cogs.utils.settings import Settings
from cogs.utils.dataIO import dataIO
from cogs.utils.chat_formatting import inline
import asyncio
import os
import time
import sys
import logging
import logging.handlers
import shutil
import traceback
description =... | OverlordBotUploader/Red.py | red.py | Python | gpl-3.0 | 15,547 |
import os
requirements = ["numpy", "scipy", "pandas",
"matplotlib", "peakutils", "uncertainties",
"pyqtgraph"]
for package in requirements:
os.system("pip install " + package)
| laserkelvin/FTSpecViewer | setup.py | Python | gpl-3.0 | 214 |
# Script Name: darfortie.py
# Author: Ken Galle
# License: GPLv3
# Description: returns a dictionary of values to be used as parameters in the dar command:
# dar_path : path and name to dar executable, optional, defaults to 'dar'
# config : string, possibly None
# prune : list of string, possibly empty
# increm... | kagalle/darfortie | darfortie/darfortie_params.py | Python | gpl-3.0 | 4,855 |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
#Virux, Platform bağımsız bir antivirüs yazılımıdır :P
#Copyright (C) 2011, Metehan Özbek
#
#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 versi... | mthnzbk/Virux | virux.py | Python | gpl-3.0 | 7,686 |
import sys
import re
import collections
from fabric.api import * # pylint: disable=W0614,W0401
import fabric.api as fab
env.disable_known_hosts = True
env.node_providers = {}
env.providers = {}
env.roledefs = collections.defaultdict(list)
env.name_prefix = getattr(env, 'name_prefix', 'HITC-')
# hack tocheck if the u... | andreasjansson/head-in-the-clouds | headintheclouds/__init__.py | Python | gpl-3.0 | 1,735 |
#!/usr/bin/env python
"""
Paraproxio is an HTTP proxy with a parallel downloading of big files.
"""
# Copyright (C) 2016 Alexander Logger <intagger@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 Softwa... | intagger/paraproxio | paraproxio.py | Python | gpl-3.0 | 54,244 |
import socket,sys,os,hashlib,codecs,time # Import socket module
#filecodec = 'cp037'
filecodec = None
buffersize = 1024
failed = False
def filehash(filepath):
openedFile = codecs.open(filepath,'rb',filecodec)
# readFile = openedFile.read().encode()
readFile = openedFile.read()
openedFile.cl... | TNT-Samuel/Coding-Projects | File Sending/V1.0/output/receivefile.py | Python | gpl-3.0 | 5,213 |
# -*- coding: utf-8 -*-
import numpy as np
x = np.array([3, 2, 1, 0])
print(x[[0, 1, 2]])
print(x[[-1, -2, -3]])
y = np.array([[1, 2], [3, 4], [5, 6]])
print(y[[0, 1]])
print(y[[0, 1], [0, 1]])
| w01230/test | python/numpy/np_index2.py | Python | gpl-3.0 | 197 |
import random
import Image
import ImageFont
import ImageDraw
import ImageFilter
import hashlib
from random_words import RandomWords
def gen_captcha(text, fnt, fnt_sz, file_name, fmt='JPEG'):
"""Generate a captcha image"""
# randomly select the foreground color
fgcolor = random.randint(0,0xffff00)
# make the backg... | gutosurrex/feed2twister | flask_app/captcha.py | Python | gpl-3.0 | 1,492 |
######################################################################################
# class: LinkConsumer
# purpose: consumes items in the outQueue and sends to parameterFetcher for processing
######################################################################################
import logging
import Queue
import t... | testerofpens/parameterpatrol | linkConsumer.py | Python | gpl-3.0 | 1,022 |
__author__ = 'bankap'
from django.contrib.auth.models import User
from models import UserProfile, EmailSummary
from rest_framework.serializers import ModelSerializer
class EmailSummarySerializer(ModelSerializer):
"""
A serializer for EmailSummary.
"""
class Meta(object):
model = EmailSummar... | psbanka/yamzam | server/main/serializers.py | Python | gpl-3.0 | 603 |
# Copyright (c) 2014-2016, Santiago Videla
#
# This file is part of caspo.
#
# caspo 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.
#
... | bioasp/caspo | caspo/console/__init__.py | Python | gpl-3.0 | 714 |
# -*- coding: utf-8 -*-
#
# debbindiff: highlight differences between two builds of Debian packages
#
# Copyright © 2014-2015 Jérémy Bobbio <lunar@debian.org>
#
# debbindiff 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... | yashi/debbindiff | debbindiff/comparators/text.py | Python | gpl-3.0 | 1,446 |
from .settings import info
class get_settings:
def __init__(self):
self.settings = info()
self.repo = self.settings['repo']
self.repo_path = self.repo['repo_path']
self.repo_url = self.repo['repo_url']
self.key = self.repo['ssh_key']
self.slack = self.settings['slack... | persepolisdm/translation-API | pdm_api/settings/__init__.py | Python | gpl-3.0 | 688 |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from .pladform import PladformIE
from ..utils import (
unescapeHTML,
int_or_none,
ExtractorError,
)
class METAIE(InfoExtractor):
_VALID_URL = r'https?://video\.meta\.ua/(?:iframe/)?(?P<id>[0-9]+)'
_TESTS = [{
'url': 'htt... | valmynd/MediaFetcher | src/plugins/youtube_dl/youtube_dl/extractor/meta.py | Python | gpl-3.0 | 2,155 |
"""reminders URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-b... | Silvian/Reminders-App | reminders/urls.py | Python | gpl-3.0 | 1,236 |
# This file is part of Sork.
#
# Copyright (C) 2017-2019 Martin Ejdestig <marejde@gmail.com>
#
# Sork 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 ... | martin-ejdestig/sork | sork/tests/test_case_with_tmp_dir.py | Python | gpl-3.0 | 3,027 |
from PyQt4 import QtCore, QtGui
from configuration.Appconfig import Appconfig
from projManagement.Validation import Validation
from subcircuit.newSub import NewSub
from subcircuit.openSub import openSub
from subcircuit.convertSub import convertSub
class Avipanel(QtGui.QWidget):
"""
This class creates Subcircui... | avi-psvm-dutta/eSim | src/aviWidget/Avipanel.py | Python | gpl-3.0 | 1,261 |
from __future__ import print_function
import os
import sys
import fnmatch
import mmap
def clean_files(path,pattern):
all_files = os.listdir(path)
filtered = fnmatch.filter(all_files,pattern+"*")
for element in filtered:
os.remove(os.path.join(path,element))
def find_files(path,target):
matche... | burbanom/python-utils | file_utils.py | Python | gpl-3.0 | 1,260 |
"""Tests for the Google authentication."""
import unittest
from unittest import mock
from bob_emploi.frontend.server import server
from bob_emploi.frontend.server.test import base_test
@mock.patch(server.__name__ + '.auth.id_token.verify_oauth2_token')
class AuthenticateEndpointGoogleTestCase(base_test.ServerTestC... | bayesimpact/bob-emploi | frontend/server/test/auth_google_test.py | Python | gpl-3.0 | 11,110 |
###
# Copyright (c) 2005, Ali Afshar
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions, a... | kg-bot/SupyBot | plugins/Sshd/__init__.py | Python | gpl-3.0 | 2,534 |
# -*- coding: utf-8 -*-
"""
Created on Fri Dec 11 11:34:27 2015
@author: JonasAdler
"""
# Imports for common Python 2/3 codebase
from __future__ import print_function, division, absolute_import
from future import standard_library
standard_library.install_aliases()
# External
import numpy as np
# Internal
import odl... | odlgroup/odl-examples | tomography_wavelet_split_bregman.py | Python | gpl-3.0 | 2,070 |
#!usr/bin/env python3.7
#-*-coding:utf-8-*-
## TtgcBot - a bot for discord
## Copyright (C) 2017 Thomas PIOT
##
## 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... | ttgc/TtgcBot | src/utils/converters.py | Python | gpl-3.0 | 4,827 |
#!/usr/bin/env python
#
# Copyright 2012 Communications Engineering Lab (CEL) / KIT (Karlsruhe Institute of Technology)
# Author: Felix Wunsch
#
# This 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... | fewu/gnuradio_drm | gr-drm/python/qa_drm_add_tailbits_vbvb.py | Python | gpl-3.0 | 1,583 |
class PreprocessorBase(object):
def __init__(self, coords):
self.coords = coords
def preprocess(self):
return self.coords
| thcrock/map-matching-visualizer | core/preprocessors/base.py | Python | gpl-3.0 | 147 |
"""
Copyright 2014
This file is part of Phase.
Phase 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.
Phase is distributed in the hope that... | phase-dev/phase | libphase/dialogs.py | Python | gpl-3.0 | 3,325 |
#! /usr/bin/python
# -*- coding: utf-8 -*-
import requests
import wikipedia_template_parser as wtp
from lxml import etree
import re
import json
def templates_including_coords():
LINKSCOORD = "http://it.wikipedia.org/w/index.php?title="\
"Speciale:PuntanoQui/Template:Coord&namespace=10&limit=500"... | CristianCantoro/wikipedia-tags-in-osm | extract_templates.py | Python | gpl-3.0 | 4,620 |
# This file is part of django-admin-loginpatches, a project to patch
# the Django admin login interface to better support custom
# authentication backends.
# Copyright (C) 2010 Blair Bonnett
#
# django-admin-loginpatches is free software: you can redistribute it
# and/or modify it under the terms of the GNU General Pub... | bcbnz/django-admin-loginpatches | admin-loginpatches/middleware.py | Python | gpl-3.0 | 6,110 |
import bpy
from ... base_types.node import AnimationNode
from . spline_evaluation_base import SplineEvaluationBase
class TrimSplineNode(bpy.types.Node, AnimationNode, SplineEvaluationBase):
bl_idname = "an_TrimSplineNode"
bl_label = "Trim Spline"
def create(self):
self.newInput("Spline", "Spline",... | Thortoise/Super-Snake | Blender/animation_nodes-master/nodes/spline/trim_spline.py | Python | gpl-3.0 | 1,134 |
from collections import Counter
def bsearch(nums, target):
"""
Binary Search with duplicates.
:param nums: Given array
:param target: The element to find in the array
:return: first index of the element found
"""
idx, l, r = -1, 0, len(nums) - 1
while l <= r:
mid = l + (r - l... | Sriee/epi | data_structures/search/bsearch.py | Python | gpl-3.0 | 7,820 |
# generated from catkin/cmake/template/cfg-extras.context.py.in
DEVELSPACE = 'FALSE' == 'TRUE'
INSTALLSPACE = 'TRUE' == 'TRUE'
CATKIN_DEVEL_PREFIX = '/home/pi/Documents/desenvolvimentoRos/devel'
CATKIN_GLOBAL_BIN_DESTINATION = 'bin'
CATKIN_GLOBAL_ETC_DESTINATION = 'etc'
CATKIN_GLOBAL_INCLUDE_DESTINATION = 'include'
C... | UnbDroid/robomagellan | Codigos/Raspberry/desenvolvimentoRos/build/rosserial/rosserial_arduino/catkin_generated/rosserial_arduino-extras.cmake.installspace.context.cmake.py | Python | gpl-3.0 | 1,578 |
import numpy as np
from scipy.sparse import csr_matrix
def save_sparse_csr(filename, array):
np.savez(filename, data=array.data, indices=array.indices,
indptr=array.indptr, shape=array.shape)
def load_sparse_csr(filename):
loader = np.load(filename)
return csr_matrix((loader['data'], loader... | TalShor/SciLMM | scilmm/Matrices/SparseMatrixFunctions.py | Python | gpl-3.0 | 397 |
from SimpleCV import Camera, Display
import time
import wx
def slika_klik():
cam = Camera(0)
display = Display()
cam.getImage().show()
i = 0
while display.isNotDone():
start_time = time.clock()
img = cam.getImage()
if display.mouseLeft:
img.s... | GajaZ/Locevanje_odpadkov | kamera_klik.py | Python | gpl-3.0 | 666 |
from django import forms
from django.db.models import Q
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Field, Button, Submit, MultiField
from crispy_forms.bootstrap import FormActions, InlineRadios
#from beers.models import Beer
from .models import Tap
from kegs.models import Keg
f... | dennyreiter/pypints | taps/forms.py | Python | gpl-3.0 | 1,775 |
# Copyright 2016 Casey Jaymes
# This file is part of PySCAP.
#
# PySCAP 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.
#
# PySCAP is ... | cjaymes/pyscap | src/scap/model/dc_elements_1_1/Rights.py | Python | gpl-3.0 | 765 |
# Copyright 2010, 2011, 2013 (C) Adam Greig
#
# This file is part of habitat.
#
# habitat 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... | ukhas/habitat | habitat/tests/test_parser_modules/test_ukhas_parser.py | Python | gpl-3.0 | 18,589 |