code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
#!/bin/env python
# plot results from ynthetictest.py
# by Dan Stowell, spring 2013
import os.path
import csv
from math import log, exp, pi, sqrt, ceil, floor
from numpy import mean, std, shape
import numpy as np
import random
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from mpl_toolkits.mplot3d import ... | danstowell/markovrenewal | experiments/plotynth.py | Python | gpl-2.0 | 12,698 |
#
# Copyright (C) 2013 Sean Poyser
#
#
# This code is a derivative of the YouTube plugin for XBMC
# released under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 3
# Copyright (C) 2010-2012 Tobias Ussing And Henrik Mosgaard Jensen
#
# This Program is free soft... | quequino/Revolution | plugin.program.vpnicity/yt.py | Python | gpl-2.0 | 16,924 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-ç
import sys
import calcoo
import calcoohija
import csv
if __name__ == "__main__":
calc = calcoohija.CalculadoraHija()
with open(sys.argv[1]) as fichero:
reader = csv.reader(fichero)
for operandos in reader:
operacion = operandos[0]
... | cescudero/ptavi-p2 | calcplusplus.py | Python | gpl-2.0 | 1,398 |
#
# Copyright (c) 2004 Conectiva, Inc.
#
# Written by Gustavo Niemeyer <niemeyer@conectiva.com>
#
# This file is part of Smart Package Manager.
#
# Smart Package Manager 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 Fou... | colloquium/spacewalk | client/solaris/smartpm/smart/uncompress.py | Python | gpl-2.0 | 3,089 |
class PGeoException(Exception):
status_code = 400
def __init__(self, message, status_code=None, payload=None):
Exception.__init__(self, message)
self.message = message
if status_code is not None:
self.status_code = status_code
self.payload = payload
def to_dict(... | geobricks/pgeo | pgeo/error/custom_exceptions.py | Python | gpl-2.0 | 1,045 |
"""text_file
provides the TextFile class, which gives an interface to text files
that (optionally) takes care of stripping comments, ignoring blank
lines, and joining lines with backslashes."""
__revision__ = "$Id$"
from types import *
import sys, os, string
class TextFile:
"""Provides a file-like object that... | 2ndy/RaspIM | usr/lib/python2.6/distutils/text_file.py | Python | gpl-2.0 | 15,086 |
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 21 04:00:41 2016
@author: irnakat
"""
# test IOfile
import IOfile
from TFCalculator import TFCalculator as TFC
import TFDisplayTools
# validity test for SH PSV case using S wave as an input
# filename
fname = 'sampleinput_linear_elastic_1layer_halfspace.... | blueray45/GSRT | test01_validity_test_SH-PSV_input_S.py | Python | gpl-2.0 | 1,502 |
#!/usr/bin/env python
"""
plot magnetic lattice
"""
import matplotlib.pylab as plt
import numpy as np
f12 = 'AWDall.lat'
data12 = np.loadtxt(f12)
plt.plot(data12[:,0], data12[:,1], 'r-',
data12[:,0], data12[:,2], 'b-',
linewidth=2)
plt.xlim([110,240])
plt.ylim([1.5,1.53])
plt.legend([r'$a_u$',r'$a_d$'],1)
plt... | Archman/pandora | python/scripts/plotaw.py | Python | gpl-2.0 | 420 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import with_statement
from collections import defaultdict
from copy import deepcopy
import axiom_rules
import fact_groups
import instantiate
import pddl
import sas_tasks
import simplify
import timers
# TODO: The translator may generate trivial derived v... | dpattiso/igraph | lama/translate/translate_old.py | Python | gpl-2.0 | 31,909 |
# This script is an example of how you can run blender from the command line (in background mode with no interface)
# to automate tasks, in this example it creates a text object, camera and light, then renders and/or saves it.
# This example also shows how you can parse command line options to python scripts.
#
# Examp... | ivanamihalek/blender | old/bgjob.py | Python | gpl-2.0 | 3,413 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on 2/3/2015
@author: Antonio Hermosilla Rodrigo.
@contact: anherro285@gmail.com
@organization: Antonio Hermosilla Rodrigo.
@copyright: (C) 2015 by Antonio Hermosilla Rodrigo
@version: 1.0.0
'''
def UTC2GPS(fecha):
'''
@brief: Método para convertir un ... | tonihr/pyGeo | Tiempo/UTC2GPS.py | Python | gpl-2.0 | 1,716 |
# -*- coding: utf-8 -*-
import 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 'User.is_admin'
db.add_column(u'accounts_user', 'is_admin',
self.gf('dj... | Rondineli/django-sso | django_sso/accounts/migrations/0003_auto__add_field_user_is_admin.py | Python | gpl-2.0 | 5,064 |
# Install.py -- File system installation commands
# Copyright (C) 2007-2013 CEA
#
# This file is part of shine
#
# 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... | cea-hpc/shine | lib/Shine/Commands/Install.py | Python | gpl-2.0 | 4,458 |
import string
import random
import time
import json
import re
from Config import config
from Plugin import PluginManager
if "sessions" not in locals().keys(): # To keep sessions between module reloads
sessions = {}
def showPasswordAdvice(password):
error_msgs = []
if not password or not isinstance(pass... | l5h5t7/ZeroNet | plugins/disabled-UiPassword/UiPasswordPlugin.py | Python | gpl-2.0 | 5,239 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Subclass of wx.Panel"""
#-----------------------------------------------------------------------------------------
#Import
try:
#wxPython
import wx
import wx.grid
import wx.lib.scrolledpanel
#python std library
import sys
#our modules and pa... | ctu-yfsg/2015-a-grass-reclass | reclassify/Layout/ReclassifyPanel.py | Python | gpl-2.0 | 3,344 |
from typing import Any, Dict, List, Union
from flask import abort, flash, g, render_template, url_for
from flask_babel import format_number, lazy_gettext as _
from werkzeug.utils import redirect
from werkzeug.wrappers import Response
from openatlas import app
from openatlas.database.connect import Transaction
from op... | craws/OpenAtlas-Python | openatlas/views/types.py | Python | gpl-2.0 | 4,440 |
#!/usr/bin/env python
# class to allow watching multiple files and
# calling a callback when any change (size or mtime)
#
# We take exclusive use of SIGIO and maintain a global list of
# watched files.
# As we cannot get siginfo in python, we check every file
# every time we get a signal.
# we report change is size, m... | neilbrown/susman | dnotify.py | Python | gpl-2.0 | 3,660 |
#OBJ2VXP: Converts simple OBJ files to VXP expansions
#Copyright (C) 2004-2015 Foone Turing
#
#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 ... | foone/7gen | bin/obj2vxpGUI.py | Python | gpl-2.0 | 6,717 |
Skip to content
Search or jump to…
Pull requests
Issues
Marketplace
Explore
@zhejoe
9
3028PacktPublishing/Intelligent-Projects-Using-Python
Code Issues 0 Pull requests 0 Wiki Security Insights
Intelligent-Projects-Using-Python/Chapter02/TransferLearning.py
@santanupattanayak santanupattanayak chapter02 changes
67a... | zhejoe/my1stRepository | text.py | Python | gpl-2.0 | 10,082 |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
GeobricksTRMM
A QGIS plugin
Download TRMM daily data.
-------------------
begin : 2015-10-06
copyright : (C) ... | geobricks/geobricks_qgis_plugin_trmm | __init__.py | Python | gpl-2.0 | 1,510 |
import scipy.integrate as intg
import numpy as np
#Physical Constants
#Everything is in MKS units
#Planck constant [J/s]
h = 6.6261e-34
#Boltzmann constant [J/K]
kB = 1.3806e-23
#Speed of light [m/s]
c = 299792458.0
#Pi
PI = 3.14159265
#Vacuum Permitivity
eps0 = 8.85e-12
#Resistivity of the mirror
rho=2.417e-8
GHz = ... | MillerCMBLabUSC/lab_analysis | apps/4f_model/OldCode/thermo.py | Python | gpl-2.0 | 3,192 |
# encoding: utf-8
# module samba.dcerpc.wkssvc
# from /usr/lib/python2.7/dist-packages/samba/dcerpc/wkssvc.so
# by generator 1.135
""" wkssvc DCE/RPC """
# imports
import dcerpc as __dcerpc
import talloc as __talloc
class NetWkstaInfo1059(__talloc.Object):
# no doc
def __init__(self, *args, **kwargs): # real... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/samba/dcerpc/wkssvc/NetWkstaInfo1059.py | Python | gpl-2.0 | 675 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import wx
import widgetUtils
class audio_album(widgetUtils.BaseDialog):
def __init__(self, *args, **kwargs):
super(audio_album, self).__init__(title=_("Create a new album"), parent=None)
panel = wx.Panel(self)
sizer = wx.BoxSi... | manuelcortez/socializer | src/wxUI/dialogs/creation.py | Python | gpl-2.0 | 975 |
# -*- coding: utf-8 -*-
"""
uds.utils.dict
~~~~~~~~~~~~~~
Utility functions to parse string and others.
:copyright: Copyright (c) 2015, National Institute of Information and Communications Technology.All rights reserved.
:license: GPL2, see LICENSE for more details.
"""
import copy
def override_dict(new, old):
... | nict-isp/uds-sdk | uds/utils/dict.py | Python | gpl-2.0 | 789 |
from __future__ import print_function, division, absolute_import
# Copyright (c) 2013 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNES... | Lorquas/subscription-manager | src/subscription_manager/injection.py | Python | gpl-2.0 | 4,210 |
#------------------------------------------------------------------------------
#
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions d... | HyperloopTeam/FullOpenMDAO | lib/python2.7/site-packages/traits-4.3.0-py2.7-macosx-10.10-x86_64.egg/traits/trait_base.py | Python | gpl-2.0 | 19,017 |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import time
__author__ = 'mah'
__email__ = 'andrew.makhotin@gmail.com'
import MySQLdb as mdb
import sys
import ConfigParser
import logging
import logging.handlers
import re
import os
from ffprobe import FFProbe
#### LOG ###
logger = logging.getLogger('Logging for check_s... | mahandra/recipes_video_conv | rec_hls_server/check_rec_stream.py | Python | gpl-2.0 | 4,889 |
from django.conf.urls import url
urlpatterns = [
url(r'^itemsearch/(?P<index>.*)/(?P<concept_id>.*)/(?P<term>.*)$', 'wikidata.views.search_typed_items'),
]
| FUB-HCC/neonion | wikidata/urls.py | Python | gpl-2.0 | 174 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import unittest
import jsbeautifier
class TestJSBeautifier(unittest.TestCase):
def test_unescape(self):
# Test cases contributed by <chrisjshull on GitHub.com>
test_fragment = self.decodesto
bt = self.bt
bt('"\\\\s"'); # == "... | JT5D/Alfred-Popclip-Sublime | Sublime Text 2/JsFormat/libs/jsbeautifier/tests/testjsbeautifier.py | Python | gpl-2.0 | 64,176 |
# misc.py
# Copyright (C) 2012-2016 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope tha... | rpm-software-management/dnf | dnf/yum/misc.py | Python | gpl-2.0 | 11,251 |
#!/usr/bin/python
import os
import sys
import math
import glob
import sql
import process_xls as p_xls
""" Change to whatever is needed. """
DEFAULT_DATE_STR = ''
DB_NAME = 'trost_prod'
TABLE_NAME = 'plants2'
TABLE = [
'id INT(11) AUTO_INCREMENT',
'aliquot INT(11)',
'name VARCHAR(45)',
'subspecies_... | ingkebil/trost | scripts/create_tables/create_plants2table.py | Python | gpl-2.0 | 2,360 |
#!/usr/bin/python
'''
*
* Copyright (C) 2013 Simone Denei <simone.denei@gmail.com>
*
* This file is part of pyrsyncgui.
*
* pyrsyncgui 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 ... | m4tto/pyrsyncgui | pyrsyncgui.py | Python | gpl-2.0 | 8,640 |
#! /usr/bin/env python
###############################################################################
# This file is part of openWNS (open Wireless Network Simulator)
# _____________________________________________________________________________
#
# Copyright (C) 2004-2007
# Chair of Communication Networks (ComNets)
... | openwns/wrowser | openwns/wrowser/playgroundPlugins/SimulationCampaign/simcontrol.py | Python | gpl-2.0 | 23,950 |
'''
Copyright (C) 2016 Quinn D Granfor <spootdev@gmail.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2, as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
... | MediaKraken/mkarchive | pipeline-deploy-os-server-ubuntu.py | Python | gpl-2.0 | 5,822 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2018-05-25 02:21
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('itemreg', '0008_auto_20160... | tjcsl/ion | intranet/apps/itemreg/migrations/0009_auto_20180524_2221.py | Python | gpl-2.0 | 1,071 |
#!/usr/bin/env python2.7
############################################################################
##
## Copyright (c) 2000-2015 BalaBit IT Ltd, Budapest, Hungary
## Copyright (c) 2015-2018 BalaSys IT Ltd, Budapest, Hungary
##
##
## This program is free software; you can redistribute it and/or modify
## it under th... | mochrul/zorp | tests/zorpctl/test_szig.py | Python | gpl-2.0 | 3,271 |
#!/usr/bin/python3
import subprocess
from xml.dom import minidom
import imaplib
from pycious.lib.common import singleton
class Mail:
def __init__(self, username, password,\
server='imap.gmail.com', port=993):
"""
It returns -1 if there is no connection otherwise it returns
... | fsquillace/pycious | pycious/lib/web.py | Python | gpl-2.0 | 3,481 |
import fauxfactory
import pytest
from cfme import test_requirements
from cfme.fixtures.provider import rhel7_minimal
from cfme.infrastructure.provider.rhevm import RHEVMProvider
from cfme.infrastructure.provider.virtualcenter import VMwareProvider
from cfme.markers.env_markers.provider import ONE_PER_TYPE
from cfme.ma... | RedHatQE/cfme_tests | cfme/tests/v2v/test_v2v_ansible.py | Python | gpl-2.0 | 6,484 |
from .db import Database
__version__ = "0.1.1"
__maintainer__ = "Gunther Cox"
__email__ = "gunthercx@gmail.com"
| wunderlins/learning | python/jsondb/jsondatabase-0.1.1/jsondb/__init__.py | Python | gpl-2.0 | 114 |
__author__ = 'snake'
from PyQt4 import QtGui, QtCore
class SiteItems(QtGui.QListWidget):
def __init__(self):
super(SiteItems, self).__init__()
def startDrag(self, dropAction):
# create mime data object
#get all selected items
selitems = ""
for i in self.selectedIte... | slackeater/anal-beh | classes/gui/mylistwidget.py | Python | gpl-2.0 | 1,257 |
# -*- coding: utf-8 -*-
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2004-2006 Donald N. Allingham
#
# 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 t... | pmghalvorsen/gramps_branch | gramps/gen/datehandler/_date_nl.py | Python | gpl-2.0 | 10,098 |
import numpy as np
import fdasrsf as fs
from scipy.integrate import cumtrapz
from scipy.linalg import norm, expm
import h5py
fun = h5py.File('/home/dtucker/fdasrsf/debug_data_oc_mlogit.h5')
q = fun['q'][:]
y = fun['y'][:]
alpha = fun['alpha'][:]
nu = fun['nu'][:]
max_itr = 8000 # 4000
tol = 1e-4
deltag = .05
deltaO ... | glemaitre/fdasrsf | debug/debug_warp_ocmlogistic.py | Python | gpl-3.0 | 3,202 |
#!/usr/bin/env python
import os
import sys
import json
import click
import serial
import pkg_resources
import serial.tools.list_ports
import logging.config
from educube.web import server as webserver
import logging
logger = logging.getLogger(__name__)
plugin_folder = os.path.join(os.path.dirname(__file__), 'commands... | ezeakeal/educube_client | educube/client.py | Python | gpl-3.0 | 2,664 |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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... | creditbit/electrum-creditbit | gui/qt/network_dialog.py | Python | gpl-3.0 | 9,292 |
# test.py (c) Mikhail Mezyakov <mihail265@gmail.com>
# Released under the GNU GPL v.3
#
# Module sends "success" message to user on a channel
def horo(channel, user, args):
"""Send "success" message if everything is ok"""
return u'PRIVMSG {channel} :{user}: success'.format(channel=channel,
... | aluminiumgeek/horo-modules | test/test.py | Python | gpl-3.0 | 370 |
# -*- coding: utf-8 -*-
# Copyright (C) 2012-2015 Bastian Kleineidam
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#... | wummel/patool | patoolib/programs/shar.py | Python | gpl-3.0 | 1,074 |
#!/usr/bin/env python
'''
Predict missing words with n-gram model
'''
import sys, argparse
from itertools import izip
from util import tokenize_words
def opts():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('sample', type=argparse.FileType('r'),
help='Sentences with one m... | timpalpant/KaggleBillionWordImputation | scripts/predict_missing_word.space.py | Python | gpl-3.0 | 770 |
import pygame
import logging
from tools.action import Action
class Speaker(Action):
def __init__(self, id, params):
super(Speaker, self).__init__(id, params)
try:
self.path_to_audio = params["path_to_audio"]
self.repetitions = int(params["repetitions"])
except ValueError as ve: # if repetitions can't be... | SecPi/SecPi | worker/speaker.py | Python | gpl-3.0 | 1,590 |
import json
import pymarc
from siskin.conversions import (de_listify, imslp_xml_to_marc, osf_to_intermediate)
def test_imslp_xml_to_marc():
example = """<?xml version="1.0"?>
<document docID="imslpvalsskramstadhans">
<localClass localClassName="col">imslp</localClass>
<localClass localClassName=... | miku/siskin | siskin/test_conversions.py | Python | gpl-3.0 | 11,642 |
# news key word catch
import os
import random
import time
import tushare as ts
import math
import pandas
import threading
from MYSORT import *
from programdiary import *
import Stock_config_kit as Skit
import ForgeModel
COLLECTORSHOWNUM=5
fgt={'a':0.01,'a_2':0.01,'lam':0.01}
DIARYNAME='DIARY_Ver.0.1_ty2... | AuroraLHT/Akagi | KW.py | Python | gpl-3.0 | 17,607 |
#!/usr/bin/env python
import pygame
from tools import singleton
@singleton
class Audio(object):
def __init__(self, initial_musics={}, initial_sounds={}):
if pygame.mixer.get_init() is None:
pygame.mixer.init()
self.__mute = False
self.__sounds = initial_sounds
... | int-0/aftris | beatbox.py | Python | gpl-3.0 | 1,953 |
#! /usr/bin/env python
import rospy
import roslib
roslib.load_manifest('clothing_type_classification')
import actionlib
import clothing_type_classification.msg
import std_msgs
from sensor_msgs.msg import Image
from clothing_type_classification.msg import ClothesArray, Clothes
# Specified target Centroid Points and A... | kandithws/clothes_detection_egbis | clothes_detection/test_nodes/clothes_detection_dummy_node.py | Python | gpl-3.0 | 2,197 |
#### FORMS
from flask import current_app
from flask.ext.wtf import Form
from flask.ext.security.forms import RegisterForm, LoginForm, RegisterFormMixin
from wtforms import (SelectField, StringField, SubmitField, TextAreaField,
HiddenField, FileField, RadioField, SelectField, IntegerField, ValidationErr... | teffalump/rentport | common/forms.py | Python | gpl-3.0 | 6,442 |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
from datetime import datetime
from stacosys.model.comment import Comment
TIME_FORMAT = "%Y-%m-%d %H:%M:%S"
def find_comment_by_id(id):
return Comment.get_by_id(id)
def notify_comment(comment: Comment):
comment.notified = datetime.now().strftime(TIME_FORMAT)
co... | kianby/stacosys | stacosys/db/dao.py | Python | gpl-3.0 | 1,576 |
'''
A Mini-implementation of the Storlet middleware filter.
@author: josep sampe
'''
from swift.common.utils import get_logger
from swift.common.utils import register_swift_info
from swift.common.swob import Request
from swift.common.utils import config_true_value
from storlets.swift_middleware.handlers.base import Sw... | Crystal-SDS/filter-middleware | crystal_filter_middleware/filters/storlet.py | Python | gpl-3.0 | 6,161 |
#~ # -*- coding: utf-8 -*-
#~ from os.path import join
from distutils.core import setup
from yamlweb import __version__, __progname as name
# readme is needed at register/upload time, not install time
try:
with open('readme.rst') as f:
long_description = f.read()
except IOError:
long_description = ''... | mixmastamyk/yamlweb | setup.py | Python | gpl-3.0 | 1,537 |
# -*- coding: utf-8 -*-
# Gedit Better Defaults plugin
# Copyright (C) 2017 Fabio Zendhi Nagao
#
# 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 o... | nagaozen/my-os-customizations | home/nagaozen/.gnome2/gedit/plugins/better-defaults/__init__.py | Python | gpl-3.0 | 6,370 |
from ..i18n import trstring_factory
COMP_ID = 'layer'
_ = trstring_factory(COMP_ID)
| nextgis/nextgisweb | nextgisweb/layer/util.py | Python | gpl-3.0 | 85 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
from time import sleep
from random import randint
from argparse import ArgumentParser
""" Exemplo de retorno de carro e passagem de argumentos. """
parser = ArgumentParser(description='Exemplo de retorno de carro e passagem de argumentos')
parser.add_argument('-s',
... | paulocsilvajr/python-code | src/iterar.py | Python | gpl-3.0 | 1,531 |
__problem_title__ = "Counting rectangles"
__problem_url___ = "https://projecteuler.net/problem=85"
__problem_description__ = "By counting carefully it can be seen that a rectangular grid " \
"measuring 3 by 2 contains eighteen rectangles: Although there exists " \
"n... | jrichte43/ProjectEuler | Problem-0085/solutions.py | Python | gpl-3.0 | 839 |
import time
import csv
def report(ob):
#Create log file
log_file_report = ob.file_destination + "/" + "Parameters_Results.log"
log_report = file(log_file_report, 'a' )
#Print parameters
#Batch or single file
log_report.write("\nRun type: %s" % ob.runtype)
if ob.... | bw4sz/MotionMeerkat_Bisque | MotionMeerkat/report.py | Python | gpl-3.0 | 3,667 |
from os.path import join
from math import pi
from math import sqrt
from math import radians
import cv2
import numpy as np
from numpy import dot
from scipy.optimize import minimize
from scipy.optimize import differential_evolution
import matplotlib.pyplot as plt
from prototype.utils.euler import euler2rot
from pro... | chutsu/robotics | prototype/calibration/gimbal.py | Python | gpl-3.0 | 32,140 |
from sys import stdin as sin
list_index=[]
list=dict()
def fn(n):
f=1
#check if a value less that that has already been calculated
for i in range(1,n+1):
f*=i
return f
t=int(input())
for i in range(t):
n=int(sin.readline().rstrip())
print(fn(n)) | parthapritam2717/CodeChef | FCTRL2.py | Python | gpl-3.0 | 283 |
from typing import List, Optional, Sequence, Union
from decksite.data import achievements, deck, preaggregation, query
from decksite.data.models.person import Person
from decksite.database import db
from shared import dtutil, guarantee, logger
from shared.container import Container
from shared.database import sqlescap... | PennyDreadfulMTG/Penny-Dreadful-Discord-Bot | decksite/data/person.py | Python | gpl-3.0 | 17,080 |
import cv2
import random
from moviepy.editor import VideoFileClip
#from modules.ssd.main import ImageNetwork
"""
def pipeline_yolo(img):
img_undist, img_lane_augmented, lane_info = lane_process(img)
output = vehicle_detection_yolo(img, img_lane_augmented, lane_info)
return output
def process_image(img):
... | maxkferg/smart-city-model | birdseye.py | Python | gpl-3.0 | 1,354 |
# -*- coding: utf-8 -*-
#************************************************************************
#
# TeX-9 library: Python module
#
# 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 Softw... | vim-scripts/TeX-9 | ftplugin/tex_nine/tex_nine_utils.py | Python | gpl-3.0 | 3,875 |
#To-DO:NEXT: Write the show_keys email command [admin level]
#To-Do:NEXT: Write the other templates
#To-Do:NEXT: write the connect command [user level]
#TO-DO:NEXT: Fix subject bug.
#To-DO:NEXT: Make the html emails look prettier somehow.
#listening script
from core import *
import codebase
import poplib
... | Suranjandas7/EMS | admin.py | Python | gpl-3.0 | 6,167 |
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2009 Doug Hellmann All rights reserved.
#
"""
"""
__version__ = "$Id$"
#end_pymotw_header
import tarfile
import time
t = tarfile.open('example.tar', 'r')
for filename in [ 'README.txt', 'notthere.txt' ]:
try:
info = t.getmember(filename)
excep... | qilicun/python | python2/PyMOTW-1.132/PyMOTW/tarfile/tarfile_getmember.py | Python | gpl-3.0 | 463 |
from semeval import helper as helper
from semeval.lstms.LSTMModel import LSTMModel
import numpy
from keras.models import Sequential
from keras.layers import Dense, Activation, Bidirectional, LSTM, Dropout
from keras.callbacks import EarlyStopping
class EarlyStoppingLSTM(LSTMModel):
'''Model that can train an LST... | apmoore1/semeval | lstms/EarlyStoppingLSTM.py | Python | gpl-3.0 | 2,914 |
from __future__ import absolute_import
from celery import shared_task
import praw
from .commonTasks import *
from .models import Redditor, RedditorStatus, Status
@shared_task
def test(param):
return 'The test task executed with argument "%s" ' % param
@shared_task
def update_user(redditor):
update_user_st... | a-harper/RedditorProfiler | tasks.py | Python | gpl-3.0 | 532 |
#!/usr/bin/env python
from __future__ import division
from __future__ import print_function
import argparse
import numpy as np
import pandas as pd
import sys
import os
import matplotlib as mpl
#mpl.use('Agg')
from matplotlib import ticker
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import matpl... | meteoswiss-mdr/precipattractor | pyscripts/growth_errors_nans.py | Python | gpl-3.0 | 39,057 |
from .gameserver import Game
from .example import TicTacToe
| andydrop/ludicode | GameServers/__init__.py | Python | gpl-3.0 | 60 |
from .net import Net
| SF-Zhou/TinyDNN | tiny_dnn/net/__init__.py | Python | gpl-3.0 | 22 |
"""
Given Style Rules, create an SLD in XML format add it to a layer
"""
if __name__=='__main__':
import os, sys
DJANGO_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(DJANGO_ROOT)
os.environ['DJANGO_SETTINGS_MODULE'] = 'geonode.settings'
import logging
import os
from... | cga-harvard/cga-worldmap | geonode/contrib/dataverse_styles/style_layer_maker.py | Python | gpl-3.0 | 12,317 |
# -*- coding: utf-8 -*-
from openerp import api, fields, models, _
from . import exceptions
class AccountInvoice(models.Model):
_inherit = 'account.invoice'
enable_datev_checks = fields.Boolean('Perform Datev Checks', default=True)
@api.multi
def is_datev_validation_active(self):
self.ensur... | HBEE/accounting | ecoservice_financeinterface_datev/models/account_invoice.py | Python | gpl-3.0 | 3,072 |
# -*- coding: utf-8 -*-
from collections import defaultdict
from functools import partial
from itertools import count
import json
import networkx as nx
from networkx.algorithms import weakly_connected_component_subgraphs
from numpy import subtract
from numpy.linalg import norm
from typing import Any, DefaultDict, Dict... | tomka/CATMAID | django/applications/catmaid/control/graph2.py | Python | gpl-3.0 | 24,814 |
import datetime
import logging
import time
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.mail.message import EmailMultiAlternatives
from django.core.management.base import BaseCommand
from django.db.models import Q
from django.template.loader import render_to_string
fro... | waterdotorg/power.Water | project/custom/management/commands/friend_joined_email.py | Python | gpl-3.0 | 2,527 |
import frappe
def flat_item_group_tree_list(item_group, result=None):
if not result:
result = [item_group]
child_groups = frappe.get_list(
"Item Group",
filters={"parent_item_group": item_group},
fields=["name"]
)
child_groups = [child.name for child in child_groups if child not in result]
if len(chi... | neilLasrado/erpnext | erpnext/bloombrackets/coupon_commands/utils.py | Python | gpl-3.0 | 457 |
#!/usr/bin/env python
#
# This file is part of the SSM_LinearArray (Sound Sources Mapping
# using a Linear Microphone Array)
# developed by Daobilige Su <daobilige DOT su AT student DOT uts DOT edu DOT au>
#
# This file is under the GPLv3 licence.
#
import rospy
from std_msgs.msg import String
from std_msgs.msg impo... | daobilige-su/SSM_LinearArray | ROS/SSM_LinearArray/scripts/ps3_driver.py | Python | gpl-3.0 | 1,741 |
# -*- coding: utf-8 -*-
#
# diffoscope: in-depth comparison of files, archives, and directories
#
# Copyright © 2015 Jérémy Bobbio <lunar@debian.org>
# Copyright © 2015 Clemens Lang <cal@macports.org>
#
# diffoscope is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public L... | brettcs/diffoscope | tests/comparators/test_macho.py | Python | gpl-3.0 | 2,299 |
"""
Forms and validation code for user registration.
Note that all of these forms assume Django's bundle default ``User``
model; since it's not possible for a form to anticipate in advance the
needs of custom user models, you will need to write your own forms if
you're using a custom model.
"""
from __future__ import... | ArtemBernatskyy/FundExpert.NET | mutual_funds/registration/forms.py | Python | gpl-3.0 | 4,680 |
# -*- coding: utf-8 -*-
from odoo import models, fields, api
class fixing_issues_view(models.Model):
_inherit = 'project.issue' | walter-trueplus/training | fixing_issues_view/models/models.py | Python | gpl-3.0 | 133 |
from django.contrib import admin
from .models import *
class ProductAdmin(admin.ModelAdmin):
list_display = ('id', 'prd_process_id', 'prd_name',
'prd_display_name', 'prd_owner', 'prd_product_id', 'prd_date',
'prd_class', 'prd_filter', 'prd_is_public', 'prd_is_permanent',)
... | linea-it/dri | api/product/admin.py | Python | gpl-3.0 | 5,841 |
from django import forms
from ..models import BaseDemographic
class BaseDemographicForm(forms.ModelForm):
class Meta:
model = BaseDemographic
fields = ['first_name','last_name','phone','dob']
| rdespoiu/QTitan | QTitan/QTSurvey/Controllers/BaseDemographicForm.py | Python | gpl-3.0 | 214 |
from mock import patch
from .test_helper import raises
from kiwi.exceptions import KiwiPrivilegesError
from kiwi.privileges import Privileges
class TestPrivileges(object):
@raises(KiwiPrivilegesError)
@patch('os.geteuid')
def test_check_for_root_permiossion_false(self, mock_euid):
mock_euid.retu... | adrianschroeter/kiwi | test/unit/privileges_test.py | Python | gpl-3.0 | 568 |
import logging
import ssl
from typing import List # pylint: disable=unused-import
import aiohttp
import certifi
import trio_asyncio
from aiohttp.http_exceptions import HttpProcessingError
from .base import BufferedFree, Limit, Sink, Source
logger = logging.getLogger(__name__)
class AiohttpClientSessionMixin:
... | syncrypt/client | syncrypt/pipes/http.py | Python | gpl-3.0 | 5,339 |
#!/usr/bin/env python
import spear
# 1/ The tool
tool = spear.tools.ISVTool
# 2/ GMM Training
n_gaussians = 512
iterk = 25
iterg_train = 25
end_acc = 0.0001
var_thd = 0.0001
update_weights = True
update_means = True
update_variances = True
norm_KMeans = True
# 3/ JFA Training
ru = 100 # The dimensionality of the su... | guker/spear | config/tools/isv/isv_512g_u100.py | Python | gpl-3.0 | 542 |
from django.contrib.staticfiles.storage import staticfiles_storage
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
from jinja2 import Environment
from albums.models import Album, Artist, RecordLabel
def get_spotify_search_url(term):
return 'https://open.spot... | chrisbay/library.kdhx.org | library/jinja2.py | Python | gpl-3.0 | 1,663 |
import os
from glob import glob
from itertools import chain
from typing import Iterable
import json
import jinja2
import shutil
from bank_wrangler import schema
def _generate_data_json(transactions, accounts):
transactions = [list(map(str, row))
for row in transactions]
return json.dumps({... | tmerr/bank_wrangler | bank_wrangler/report/__init__.py | Python | gpl-3.0 | 2,519 |
# Generated by Django 3.1.7 on 2021-02-28 19:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('siteapp', '0041_project_tags'),
('controls', '0045_auto_20210228_1431'),
]
operations = [
migrations.AddField(
model_nam... | GovReady/govready-q | controls/migrations/0046_element_tags.py | Python | gpl-3.0 | 459 |
class orbitalWidget(QGroupBox):
def __init__(self):
super(QGroupBox, self).__init__()
self.initUI()
def initUI(self):
table= orbitalTable(0, 3)
table.horizontalHeader().setResizeMode(QHeaderView.Stretch)
btn_active = QPushButton('Active', self)
btn_active.se... | beangoben/toulouse_secretgui | cipsi/orbitalWidget.py | Python | gpl-3.0 | 1,291 |
"""SocialNewspaper URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/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')
... | Amyantis/SocialNewspaper | ArticleManagement/urls.py | Python | gpl-3.0 | 1,336 |
# -*- coding: utf-8 -*-
"""
PyRC module: pyrc_irc_abstract.irc_server
Purpose
=======
Establish and maintain a connection to an IRC server, generating events as
they occur, and sending data as required.
Legal
=====
All code, unless otherwise indicated, is original, and subject to the terms of
the GPLv2, which is... | flan/puukusoft-pyrc | pyrc_irc_abstract/irc_server.py | Python | gpl-3.0 | 71,250 |
import squeakspace.common.util as ut
import squeakspace.common.util_http as ht
import squeakspace.proxy.server.db_sqlite3 as db
import squeakspace.common.squeak_ex as ex
import config
def post_handler(environ):
query = ht.parse_post_request(environ)
cookies = ht.parse_cookies(environ)
user_id = ht.get_re... | eek6/squeakspace | www/proxy/scripts/local/node_addr.py | Python | gpl-3.0 | 2,510 |
import os
from PyQt4 import QtCore, QtGui
from Extensions.Global import sizeformat
class SearchWidget(QtGui.QLabel):
def __init__(self, parent):
QtGui.QLabel.__init__(self, parent)
self._parent = parent
self.setStyleSheet("""background: rgba(0, 0, 0, 50); border-radius: 0... | fortharris/RedCenter | Extensions/VaultManager.py | Python | gpl-3.0 | 6,621 |
"""
Copyright (C) 2015 Quinn D Granfor <spootdev@gmail.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2, as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
... | MediaKraken/MediaKraken_Deployment | source/metadata/metadata_provider_anidb.py | Python | gpl-3.0 | 10,547 |
"""template_III URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/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')
Cla... | mjiang-27/django_learn | template_III/template_III/urls.py | Python | gpl-3.0 | 1,076 |
# -*- coding: utf-8 -*-
# Copyright (c) 2009 Raymond Hettinger
#
# 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,... | WouterVH/bots | src/bots/bots_ordereddict.py | Python | gpl-3.0 | 4,249 |
class GameMenu(object):
def __init__(self, menu_name, **options):
self.menu_name = menu_name
self.options = options
| Jazende/Jaztroids | gamemenu.py | Python | gpl-3.0 | 156 |
#!/usr/bin/python3
# Copyright 2018 Francisco Pina Martins <f.pinamartins@gmail.com>
# This file is part of geste2lfmm.
# geste2lfmm is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... | StuntsPT/pyRona | helper_scripts/geste2lfmm.py | Python | gpl-3.0 | 2,430 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.