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 numpy as np
from collections import namedtuple
import interp
epi0 = 1. # Epsilon0
Species = namedtuple("Species", ["q", "m", "N", "x0", "vx0", "vy0"])
__cache_one_d_poisson = {}
def one_d_poisson(n):
if n in __cache_one_d_poisson:
return __cache_one_d_poisson[n]
a = np.zeros((n,n))
np... | shigh/pyes1 | pyes1/pic1d2v.py | Python | gpl-2.0 | 5,516 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.12 on 2017-02-09 08:44
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
import model_utils.fields
class Migration(migrations.Migration):
dependencies = [
('statusboard', '0005_merge'),
]
... | edigiacomo/django-statusboard | statusboard/migrations/0006_maintenance.py | Python | gpl-2.0 | 1,099 |
#!/usr/bin/env python
# This is the MIT License
# http://www.opensource.org/licenses/mit-license.php
#
# Copyright (c) 2007,2008 Nick Galbreath
#
# 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 Softw... | vollmerk/sysadm-tools | ganglia/lib/gmetric.py | Python | gpl-2.0 | 7,815 |
# -*- coding: utf-8 -*-
import pcapy
import Storage_Classes
from collections import defaultdict
#from scapy.layers.all import *
from scapy.layers.dot11 import Dot11, RadioTap
################################################################
VERBOSE = 1
### auxiliary functions ###
def show_short(p, label):
if ... | stephansigg/IPSN_localisation_passive-DF | Data_CaseStudies/CaseStudy_1312_initial/pcap_analyzer/Pcap_Parser.py | Python | gpl-2.0 | 6,609 |
# Rekall Memory Forensics
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later v... | rlugojr/rekall | rekall-agent/rekall_agent/ui/flows.py | Python | gpl-2.0 | 29,082 |
import re
from geopy import exc
from geopy.compat import urlencode
from geopy.geocoders.base import DEFAULT_SENTINEL, Geocoder
from geopy.location import Location
from geopy.util import logger
__all__ = ("What3Words", )
class What3Words(Geocoder):
"""What3Words geocoder.
Documentation at:
https://d... | phborba/dsgtoolsop | auxiliar/geopy/geocoders/what3words.py | Python | gpl-2.0 | 8,452 |
from django.apps import AppConfig
from threading import Timer
import sys
class TelegramBotConfig(AppConfig):
name = 'telegrambot'
verbose_name = "Telegram Bot"
def ready(self):
from django.conf import settings
if 'runserver' in sys.argv:
from telegrambot.wrapper import... | meska/telegrambot | apps.py | Python | gpl-2.0 | 853 |
# -*- coding: utf-8 -*-
"""
logol_analyse provide some analyse tools for logol xml results.
Without any option, it will provide the number of hit, how many sequences have
at least one hit, and a graph with the repartition of the hits.
Usage:
logol_analyse.py <input> <data> [options]
options:
--graph, -g=<name... | Nedgang/logol_analyse | analyse_logol.py | Python | gpl-2.0 | 5,660 |
#!/usr/bin/python
import sys
import csv
import json
import pycountry
import codecs
from collections import defaultdict
class Region(object):
def __init__(self, name, code=None, level=0, parent=None, verbose=False):
self.name = name
self.code = code
self.level = level
self.contains ... | mitodl/world_geographic_regions | CountriesByRegion.py | Python | gpl-2.0 | 6,565 |
# Created by Thomas Jones on 17/12/2015 - thomas@tomtecsolutions.com
# pingspec.py, a plugin for minqlx to spec players who have network latency over a certain amount.
# This plugin is released to everyone, for any purpose. It comes with no warranty, no guarantee it works, it's released AS IS.
# You can modify everythi... | tjone270/QuakeLiveDS_Scripts | minqlx-plugins/archive/beta/pingspec.py | Python | gpl-2.0 | 2,601 |
# Copyright (C) 2014 Red Hat, 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 2.1 of the License, or
# (at your option) any later version.
#
# This program is distr... | itoed/anaconda | tests/gui/inside/summary.py | Python | gpl-2.0 | 3,986 |
# This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for
# the Earth and Planetary Sciences
# Copyright (C) 2012 - 2022 by the BurnMan team, released under the GNU
# GPL v2 or later.
"""
example_fit_solution
--------------------
This example demonstrates how to fit parameters
for solution model... | geodynamics/burnman | examples/example_fit_solution.py | Python | gpl-2.0 | 9,817 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Authors : David Castellanos <dcastellanos@indra.es>
#
# Copyright (c) 2012, Telefonica Móviles España S.A.U.
#
# 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... | tgcmteam/tgcmlinux | src/tgcm/contrib/tgcm-logging/src/tgcmlogging/__init__.py | Python | gpl-2.0 | 1,034 |
# -*- coding: utf-8 -*-
__author__ = 'frank'
from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy.dialects import mysql
from datetime import datetime
db = SQLAlchemy()
# 时间都存为utcnow,具体显示根据不同的本地环境进行相应转换
# 如分析数据,或者在本地显示(采用moment插件前端显示)
class Application(db.Model):
"""twitter application"""
__table... | Fansion/crawltwitter | crawltwitter/models.py | Python | gpl-2.0 | 3,522 |
import sys
import os
import arcEC
def GNDBruninTOC_exe_G2N(parameters, messages):
# *** Start Edtiting etc. the receiving layer
# http://resources.arcgis.com/en/help/main/10.2/index.html#//00s300000008000000
# XXX Check that we are actually in an edit session ...
workspace = r"C:\Users\b004218... | MartinHvidberg/GNDB | GNDB_exe_GNDB2NamesA.py | Python | gpl-2.0 | 1,978 |
#!/usr/bin/env python
import matplotlib.pyplot as plt
# dict: {title of plot : [measure value files]}
# The input data may not have a \n at file end.
inputFiles = {'LibMergeSort_Sortierszenarien_im_Vergleich':
['sorted', 'shuffle', 'reverse']}
# different colors of the function graphs
COLORS = ['g', 'k'... | rm--/matplotlib_examples | example1/evaluate1.py | Python | gpl-2.0 | 1,327 |
from django.contrib.auth.models import User, Permission, Group
from rest_framework import serializers
from apps.account.serializers.PermissionSerializer import PermissionSerializer
class GroupSerializer(serializers.ModelSerializer):
permissions = PermissionSerializer(instance=Permission, many=True)
class Meta... | mmmaaaxxx77/Python-Django-AdminLTE2 | Demo/apps/account/serializers/GroupSerializer.py | Python | gpl-2.0 | 384 |
from rest_framework import permissions
class IsOwner(permissions.BasePermission):
def has_object_permission(self, request, view, obj):
# Only allow owners of an object to view or edit it
return obj.owner == request.user
| lesavoie/nagiosservice | controlserver/servicelevelinterface/permissions.py | Python | gpl-2.0 | 238 |
#
# Copyright 2012-2013 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed ... | futurice/vdsm | tests/utilsTests.py | Python | gpl-2.0 | 19,919 |
#!/usr/bin/env python
# coding: utf-8
# Copyright (c) 2014
# Gmail:liuzheng712
#
__author__ = 'liuzheng'
from django.conf.urls import patterns, include, url
from django.contrib import admin
import os
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'pyHBase.views.home', name='home'),
# url(r'^blog/', in... | liuzheng712/pyHBaseadmin | pyHBase/pyHBase/urls.py | Python | gpl-2.0 | 1,013 |
#
# upgrade_bootloader_gui.py: gui bootloader dialog for upgrades
#
# Copyright (C) 2002, 2007 Red Hat, Inc. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either versi... | icomfort/anaconda | iw/upgrade_bootloader_gui.py | Python | gpl-2.0 | 7,815 |
#!/usr/bin/env python
#
# This script makes a checkout of cartoweb cvs, and launches the unit tests.
# If no update of cvs was done, it does not run the tests.
#
# In case of a test failure, an email is sent to a specified address.
# Configuration: change to match your environment
DISABLING_FILE = "/tmp/auto_test_di... | camptocamp/cartoweb3 | scripts/run_auto_test.py | Python | gpl-2.0 | 4,194 |
#!/usr/bin/env python3
"""
# TOP2049 Open Source programming suite
#
# Commandline utility
#
# Copyright (c) 2014 Pavel Stemberk <stemberk@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 F... | mbuesch/toprammer | libtoprammer/chips/microchip16/makeSip6.py | Python | gpl-2.0 | 2,873 |
# -*- coding: utf-8 -*-
__author__ = 'shreejoy'
import unittest
from article_text_mining.rep_html_table_struct import rep_html_table_struct
class RepTableStructureTest(unittest.TestCase):
@property
def load_html_table_simple(self):
# creates data table object 16055 with some dummy data
with... | neuroelectro/neuroelectro_org | tests/test_rep_html_table_struct.py | Python | gpl-2.0 | 4,596 |
"""
AUTHOR: Dr. Andrew David Burbanks, 2005.
This software is Copyright (C) 2004-2008 Bristol University
and is released under the GNU General Public License version 2.
MODULE: SystemBath
PURPOSE:
Used to generate System Bath Hamiltonian, given number of bath modes.
NOTES:
The system defined by the Hamiltonian i... | Peter-Collins/NormalForm | src/py/SystemBath.py | Python | gpl-2.0 | 12,748 |
import csv
import logging
from fa.miner import yahoo
from fa.piping import csv_string_to_records
from fa.util import partition
from fa.database.query import get_outdated_symbols, update_fundamentals
import initialize
from settings import *
""" Download data from internet to database """
initialize.init()
logger = ... | kakarukeys/algo-fa | examples/update_price_data.py | Python | gpl-2.0 | 1,268 |
from infoshopkeeper_config import configuration
cfg = configuration()
dbtype = cfg.get("dbtype")
dbname = cfg.get("dbname")
dbhost = cfg.get("dbhost")
dbuser = cfg.get("dbuser")
dbpass = cfg.get("dbpass")
from sqlobject import *
if dbtype in ('mysql', 'postgres'):
if dbtype is 'mysql':
import MySQLdb as d... | johm/infoshopkeeper | components/db.py | Python | gpl-2.0 | 2,693 |
#!/usr/bin/env python
background_image_filename = 'sushiplate.jpg'
import pygame
from pygame.locals import *
from sys import exit
SCREEN_SIZE = (640, 480)
pygame.init()
screen = pygame.display.set_mode(SCREEN_SIZE, NOFRAME, 32)
background = pygame.image.load(background_image_filename).convert()
while True:
ev... | opensvn/python | pygame/resize.py | Python | gpl-2.0 | 919 |
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ /... | huiyiqun/check_mk | web/htdocs/views.py | Python | gpl-2.0 | 129,902 |
#!/usr/bin/env python
###############################################################################
# $Id: rasterize.py 32165 2015-12-13 19:01:22Z goatbar $
#
# Project: GDAL/OGR Test Suite
# Purpose: Test RasterizeLayer() and related calls.
# Author: Frank Warmerdam <warmerdam@pobox.com>
#
######################... | nextgis-extra/tests | lib_gdal/alg/rasterize.py | Python | gpl-2.0 | 11,966 |
# These are some tools I am creating to help me build the map for the game. They are a work in progress.
# I am also learning python, so I apologize in advance if I do dumb things.
# Right now this consists of just two classes: locations and coordinate systems.
# As I have it implemented here, a coordinate system is s... | nickdab/pygame | maptools.py | Python | gpl-2.0 | 2,622 |
'''
This file is part of the lenstractor project.
Copyright 2012 David W. Hogg (NYU) and Phil Marshall (Oxford).
Description
-----------
Wrapper class for tractor operation, to enable high level options (ie sampling or optimization).
To-do
-----
- debug, test
'''
import numpy as np
import os,subprocess
import tra... | davidwhogg/LensTractor | lenstractor/driver.py | Python | gpl-2.0 | 21,961 |
# -*- coding: utf-8 -*-
import json
import datetime
from django.http import HttpResponse
from django.template import RequestContext
from django.shortcuts import render_to_response
from misc.decorators import staff_required, common_ajax_response, verify_permission
from common import cache, debug, page
from message.in... | lantianlz/zx | www/admin/views_tools.py | Python | gpl-2.0 | 4,764 |
import unittest
from mock import Mock
import os
from katello.tests.core.action_test_utils import CLIOptionTestCase, CLIActionTestCase
from katello.tests.core.repo import repo_data
import katello.client.core.repo
from katello.client.core.repo import Status
from katello.client.api.utils import ApiDataError
class Requ... | Katello/katello-cli | test/katello/tests/core/repo/repo_status_test.py | Python | gpl-2.0 | 3,038 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import gtk # @UnusedImport
import gtk.glade
import gobject
from lib.pycsb19 import recibo
from lib.pycsb19 import ordenante
import sqlite3 as sqlite
import time
class Remesas:
def __init__(self):
self.Llamada=""
self.NifOrdenante=""
self.CodR... | pacoqueen/ginn | ginn/lib/pycsb19/remesas.py | Python | gpl-2.0 | 32,357 |
from bs4 import BeautifulSoup
import urllib.request
html = urllib.request.urlopen('http://www.nlotto.co.kr/common.do?method=main’')
soup = BeautifulSoup(html)
hoi = soup.find("span", id="lottoDrwNo")
numbers=[]
for n in range(1,7):
strV ="drwtNo" + str(n)
first = soup.find('img', id=strV)['alt']
... | YongJang/PythonTelegram | examples/referenced/a.py | Python | gpl-2.0 | 497 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Random mutator based on C. Miller 'algorithm' for Nightmare Fuzzing Project.
Created on Sun May 12 10:57:06 2013
@author: joxean
"""
import sys
import math
import random
#-----------------------------------------------------------------------
class CCMillerMutator(object)... | joxeankoret/nightmare | mutators/cmiller_mutator_rep.py | Python | gpl-2.0 | 1,588 |
def float_example():
a = -10
print a.__float__()
print float(a)
if __name__ == '__main__':
float_example() | ramesharpu/python | basic-coding/built-in-functions/float.py | Python | gpl-2.0 | 124 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2001 David R. Hampton
# Copyright (C) 2001-2006 Donald N. Allingham
# Copyright (C) 2007 Brian G. Matherly
# Copyright (C) 2010 Jakim Friant
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of ... | beernarrd/gramps | gramps/gen/plug/report/_reportbase.py | Python | gpl-2.0 | 3,048 |
from distutils.core import setup
setup(
name='tinyfsm',
version='0.1',
packages=[''],
url='https://github.com/tonyfunc/tinyfsm',
license='GNU Library',
author='tony',
author_email='me@tonyfunc.com',
description='A tiny implementation of Finite State Machine in Python.'
)
| tonyfunc/tinyfsm | setup.py | Python | gpl-2.0 | 305 |
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
#
# MDAnalysis --- https://www.mdanalysis.org
# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors
# (see the file AUTHORS for the full list of names)
#
# Released under t... | MDAnalysis/mdanalysis | package/MDAnalysis/analysis/waterdynamics.py | Python | gpl-2.0 | 41,156 |
#!/usr/bin/env python
# encoding: utf-8
import sys
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("-m", "--m_number", dest = "m", help = "pleaer enter the m...", type = int)
parser.add_argument("-n", "--n_number", dest = "n", help = "pleaer enter th... | gatieme/AderXCoding | language/python/argparse/m-n3.py | Python | gpl-2.0 | 435 |
# F3AT - Flumotion Asynchronous Autonomous Agent Toolkit
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version... | f3at/feat | src/feat/test/test_agencies_emu_agency.py | Python | gpl-2.0 | 11,954 |
# exercise from http://www.ling.gu.se/~lager/python_exercises.html
# solution from http://rosettacode.org/wiki/99_Bottles_of_Beer#Python
# "99 bottle of beer" is a traditional song in the US and Canada.
# it is popular to sing on long trips, as it has a very repetitive
# format which is easy to memorize, and can take ... | SurAnand/pyuthon | 99beer.py | Python | gpl-2.0 | 1,042 |
#####################################################################
# -*- coding: iso-8859-1 -*- #
# #
# Frets on Fire #
# Copyright (C) 2006 Sami Kyostila ... | cherbib/fofix | src/Guitar.py | Python | gpl-2.0 | 95,964 |
# Copyright 1999 by Jeffrey Chang. All rights reserved.
# Copyright 2000 by Jeffrey Chang. All rights reserved.
# Revisions Copyright 2007 by Peter Cock. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
#... | BlogomaticProject/Blogomatic | opt/blog-o-matic/usr/lib/python/Bio/Prosite/__init__.py | Python | gpl-2.0 | 27,006 |
import pathlib
import h5py
import numpy as np
import pytest
from scipy.ndimage.filters import gaussian_filter
import dclab
from dclab.rtdc_dataset.feat_anc_plugin.plugin_feature import (
PlugInFeature, import_plugin_feature_script,
remove_plugin_feature, remove_all_plugin_features,
PluginImportError)
from ... | ZellMechanik-Dresden/dclab | tests/test_rtdc_feat_anc_plugin.py | Python | gpl-2.0 | 29,760 |
"""
SALTS XBMC Addon
Copyright (C) 2014 tknorris
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.
T... | felipenaselva/repo.felipe | plugin.video.salts/scrapers/watch8now_scraper.py | Python | gpl-2.0 | 3,576 |
import mainUi.main
mainUi.main.main()
| MiiRaGe/cryptanalysis-tools | run.py | Python | gpl-2.0 | 39 |
# -*- coding: utf-8 -*-
import sys
sys.path.append(sys.argv[1])
from scriptlib import *
"""Файлы пакета"""
FILES = (
'7z920-x64.msi',
'7z920.msi'
)
"""Имена исполняемых файлов"""
if ARCH == '64':
INSTALLER = os.path.join('', DIR, FILES[0])
else:
INSTALLER = os.path.join('', DIR, FILES[1])
def insta... | kuchiman/wpm-pkg | 7zip/script.py | Python | gpl-2.0 | 529 |
from unittest import mock
from flask import request
from routersploit.modules.exploits.routers.tplink.wdr740nd_wdr740n_backdoor import Exploit
def apply_response(*args, **kwargs):
cmd = request.args["cmd"]
data = 'TEST; var cmdResult = new Array(\n"' + cmd + '",\n0,0 ); TEST'
return data, 200
@mock.patc... | dasseclab/dasseclab | clones/routersploit/tests/exploits/routers/tplink/test_wdr740nd_wdr740n_backdoor.py | Python | gpl-2.0 | 917 |
"""
USAGE:
twitter [action] [options]
ACTIONS:
follow add the specified user to your follow list
friends get latest tweets from your friends (default action)
help print this help text that you are currently reading
leave remove the specified user from your following list
public... | avsm/lifedb-plugins | Twitter/twitter/cmdline.py | Python | gpl-2.0 | 15,027 |
#! /usr/bin/python
######
# Copyright 2007-2009 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
#
# This code is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2
# only, as published b... | SunLabsAST/AURA | Bridge/pyaura/tagclustering/simplestats.py | Python | gpl-2.0 | 4,439 |
import codecs
import collections
import os
import shutil
from PyQt4 import QtCore, QtGui, QtSvg
from Code.QT import Colocacion
from Code.QT import Controles
from Code.QT import FormLayout
from Code.QT import Iconos
from Code.QT import QTVarios
from Code import TrListas
from Code import VarGen
from Code.Constantes imp... | lukasmonk/lucaschess | Code/QT/Piezas.py | Python | gpl-2.0 | 13,281 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2014 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 option) a... | MSusik/invenio | invenio/modules/deposit/testsuite/test_type_simplerecord.py | Python | gpl-2.0 | 3,865 |
# vim:fileencoding=utf-8:noet
try:
import pygit2 as git
class Repository(object):
__slots__ = ('directory')
def __init__(self, directory):
self.directory = directory
def _repo(self):
return git.Repository(self.directory)
def status(self, path=None):
'''Return status of repository or file.
Wit... | DaneelOliwan/dotfiles-vim | .vim/bundle/powerline/powerline/lib/vcs/git.py | Python | gpl-2.0 | 3,605 |
from random import randint, shuffle, choice
from time import clock
from _utils import InvalidTableException, copy_table
def solve(table):
table = _check_table(table)
if _is_done(table):
return table
else:
coordinates = _get_minimum_array(table)
trials = table[coordinates[... | jonasrla/web_sudoku | helper/solver.py | Python | gpl-2.0 | 3,362 |
# -*- coding: utf-8 -*-
from sqlalchemy import text
from listenbrainz import db
class User(object):
""" User class required by the api-compat """
def __init__(self, id, created, name, api_key):
self.id = id
self.created = created
self.name = name
self.api_key = api_key
... | metabrainz/listenbrainz-server | listenbrainz/db/lastfm_user.py | Python | gpl-2.0 | 2,716 |
# datepicker-1.py
from wax import *
from wax.tools.datepicker import DatePicker
import datetime
import time
class MainFrame(VerticalFrame):
def Body(self):
p1 = HorizontalPanel(self)
dp1 = DatePicker(p1)
p1.AddComponent(dp1)
p1.AddSpace(10)
b1 = But... | MSMBA/msmba-workflow | msmba-workflow/srclib/wax/examples/datepicker-1.py | Python | gpl-2.0 | 1,480 |
# -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2006 Lukáš Lalinský
#
# 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 Licen... | Sophist-UK/Sophist_picard | picard/browser/__init__.py | Python | gpl-2.0 | 823 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class User(object):
def __init__(self):
self.first_name = None
self.last_name = None
self.username = None
self.password = None
def set_full_name(self, name):
# Jaa välilyönnin mukaan
pass
| mtpajula/ijonmap | core/users/user.py | Python | gpl-2.0 | 308 |
# UPDATE THIS SECRET INFORMATION ! #
# UNCOMMENT THIS FILE IN .gitignore BEFORE YOU COMMIT! #
# SuperUser Default Password
SUPER_USER_PASSWORD = 'CHANGEME'
# Log into your Loggly account, visit: https://<Username>.loggly.com/tokens and copy the token here
LOGGLY_TOKEN = 'CHANGEME'
# Generate a very secure Django Sec... | Chaffleson/blupy | settings_local.py | Python | gpl-2.0 | 1,195 |
from getdist import loadMCSamples,plots,covmat
import numpy as np
import os,fnmatch
#filenames = fnmatch.filter(os.listdir("../output/chains/"),"mcmc_*.txt")
#for index in range(len(filenames)):
# os.rename("../output/chains/"+str(filenames[index]),"../output/chains/mcmc_final_output_"+str(index+1)+".txt")
n... | wilmarcardonac/fisher-mcmc | analyzer/compute_cov.py | Python | gpl-2.0 | 1,275 |
import os
from core import aleinst
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
class Formula():
def __init__(self, request):
self.request = request
def search(self):
package = aleinst.Aleinst(request=self.request[0:])
package.search()
def main(self):
self.se... | darker0n/ale | core/Formula/install.py | Python | gpl-2.0 | 326 |
# -*- coding: utf-8 -*-
#
# papyon - a python client library for Msn
#
# Copyright (C) 2009 Collabora 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 2 of the License, or
#... | Kjir/papyon | papyon/media/relay.py | Python | gpl-2.0 | 1,127 |
#!/usr/bin/env python
# Copyright (C) 2007--2016 the X-ray Polarimetry Explorer (XPE) team.
#
# For the license terms see the file LICENSE, distributed along with this
# software.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published... | lucabaldini/xpedaq | scripts/ixpe_evt_lib.py | Python | gpl-2.0 | 7,540 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010-2016 Red Hat, Inc.
#
# Authors:
# Thomas Woerner <twoerner@redhat.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the Li... | hos7ein/firewalld | src/firewall/core/ipXtables.py | Python | gpl-2.0 | 53,449 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2009, 2013 Zuza Software Foundation
#
# This file is part of Pootle.
#
# 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 ... | arky/pootle-dev | pootle/apps/pootle_store/tests.py | Python | gpl-2.0 | 17,327 |
#-*- coding: utf-8 -*-
from openerp.osv import fields, osv
class partner_add_contact(osv.osv_memory):
_name = "partner.add.contact"
_columns = {
"name": fields.char("Nom", size=128, required=True),
"partner_id": fields.many2one("res.partner", u"Partenaire associé"),
"firstname": fi... | ATSTI/administra | open_corretora/brokerage/wizard/partner_add_contact.py | Python | gpl-2.0 | 1,249 |
from settings import *
import pymysql
def getconn():
conn = pymysql.connect( charset = 'utf8',
host = DATABASES['default']['HOST'],
port = DATABASES['default']['PORT'],
user = DATABASES['default']['USER'],
... | kassine/caparis2mysql | sqlTools.py | Python | gpl-2.0 | 602 |
#!/usr/bin/env python
#Mercurial extension to robustly integrate prompts with other processes
#Copyright (C) 2010-2011 Willem Verstraeten
#
#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 v... | willemv/mercurial_prompthooks | prompthooks.py | Python | gpl-2.0 | 6,665 |
# -*- coding: utf-8 -*-
#
from django.contrib.staticfiles.templatetags.staticfiles import static
from django.conf import settings
from django.utils.translation import gettext_lazy as _
def jumpserver_processor(request):
# Setting default pk
context = {
'DEFAULT_PK': '00000000-0000-0000-0000-0000000000... | eli261/jumpserver | apps/jumpserver/context_processor.py | Python | gpl-2.0 | 835 |
# replaces the '%' symbol with '+', leaving the return values of actions usable for other things, such as type information,
# and leaving whitespace intact.
from dparser import Parser
# turn a tree of strings into a single string (slowly):
def stringify(s):
if not isinstance(s, str):
return ''.join(map(st... | charlesDGY/coflo | coflo-0.0.4/third_party/d/python/tests/test6.py | Python | gpl-2.0 | 743 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# ... | 3dfxsoftware/cbss-addons | incoterm_ext/incoterm.py | Python | gpl-2.0 | 1,298 |
import os
from unipath import Path
try:
# expect at ~/source/tshilo-dikotla/etc/default.cnf
# etc folder is not in the git repo
PATH = Path(os.path.dirname(os.path.realpath(__file__))).ancestor(
1).child('etc')
if not os.path.exists(PATH):
raise TypeError(
'Path to database... | botswana-harvard/tshilo-dikotla | tshilo_dikotla/databases.py | Python | gpl-2.0 | 2,422 |
""" This is script doc string. """
g = 1 # block 1 at level 0
# this is a comment that starts a line after indent
# this comment starts in column 1
h=2 # another inline comment
# see if this comment is preceded by whitespace
def f(a,b,c): # function with multiple returns
""" This is... | ipmb/PyMetrics | PyMetrics/examples/sample.py | Python | gpl-2.0 | 1,928 |
from re import compile as re_compile
from os import path as os_path, listdir
from MenuList import MenuList
from Components.Harddisk import harddiskmanager
from Tools.Directories import SCOPE_CURRENT_SKIN, resolveFilename, fileExists
from enigma import RT_HALIGN_LEFT, eListboxPythonMultiContent, \
eServiceReference, ... | openpli-arm/enigma2-arm | lib/python/Components/FileList.py | Python | gpl-2.0 | 14,837 |
'''
Copyright (C) 2015 Jacob Bieker, jacob@bieker.us, www.jacobbieker.com
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Thi... | jacobbieker/Insights | insights/google/GPlus2SQLite.py | Python | gpl-2.0 | 825 |
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Submit, Button, Field, Hidden, HTML, Div
from crispy_forms.bootstrap import FormActions, AppendedText, StrictButton, InlineField
from django import forms
from django.contrib.auth.decorators import login_required
from django.core.urlreso... | blacksph3re/alastair | cooking/ingredient/ingredient.py | Python | gpl-2.0 | 5,596 |
class Solution:
# @param haystack, a string
# @param needle, a string
# @return an integer
def strStr(self, haystack, needle):
lenH = len(haystack)
lenN = len(needle)
if lenN == 0:
return 0
for i in range(lenH-lenN+1):
p = i
q = 0
... | Dectinc/leetcode | python/28 - Implement strStr().py | Python | gpl-2.0 | 612 |
from os import environ
from os import path
from time import sleep
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.support.ui import WebDriverWait, Select
from selenium.webdriver.support import expected_condi... | Zentyal/anste | lib/anste/wdriver.py | Python | gpl-2.0 | 12,084 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2008 Raphael Ackermann
# Copyright (C) 2010 Benny Malengier
# Copyright (C) 2010 Nick Hall
# Copyright (C) 2012 Doug Blank <doug.blank@gmail.com>
#
# This program is free software; ... | pmghalvorsen/gramps_branch | gramps/gui/configure.py | Python | gpl-2.0 | 62,972 |
"""
Wilson - Implemet the Wilson model for stratified and heterogeneous regimes, and a 'framework'
that takes the lesser of the two results
"""
| rcriii42/DHLLDV | src/Wilson/__init__.py | Python | gpl-2.0 | 145 |
from preprocessing.tests import TestMetabolicStandardScaler
from preprocessing.tests import TestMetabolicChangeScaler
from preprocessing.tests import TestMetabolicSolutionScaler
from preprocessing.tests import TestMostActivePathwayScaler
from classifiers.tests import TestMetaboliteLevelDiseaseClassifier
from classifi... | MuhammedHasan/disease-diagnosis | src/tests.py | Python | gpl-3.0 | 812 |
# coding: utf-8
from __future__ import unicode_literals
import uuid
from django.db import models
from django.conf import settings
class PricePercentageChange(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4)
done = models.BooleanField('已经提醒过', default=False)
threshold = models.... | polyrabbit/WeCron | WeCron/eosram/models/percent.py | Python | gpl-3.0 | 763 |
####################################################################################################
#
# PyDvi - A Python Library to Process DVI Stream.
# Copyright (C) 2009 Salvaire Fabrice
#
####################################################################################################
#########################... | FabriceSalvaire/PyDVI | tools/CopyrightConfig.py | Python | gpl-3.0 | 2,557 |
#!/usr/bin/env python
#coding=utf-8
# Nathive (and this file) 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 newer.
#
# You should have received a copy of the GNU General ... | johnnyLadders/Nathive_CITA | nathive/plugins/home.py | Python | gpl-3.0 | 933 |
import os
import sys
import numpy as np
from copy import deepcopy
import argparse
sys.path.append(os.path.join(os.path.dirname(__file__),"../projects/tools"))
import msh
import executable_paths as exe
def parse():
parser = argparse.ArgumentParser(description="Creates mandible and masseter files for the database c... | ISCDtoolbox/FaciLe | pipeline/processMandibleAndMasseter.py | Python | gpl-3.0 | 4,598 |
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 23 13:52:07 2016
@author: huliqun
"""
import unittest
import json
import binascii
from falcon import testing
import sys
sys.path.append('..')
from workserver.util.AES_PKCS7_extension import Cryptor
from MainServer import app
class TestAuth(testing.TestCa... | LiqunHu/MVPN | testing/testAuth.py | Python | gpl-3.0 | 1,873 |
from nltk.chat.util import Chat, reflections
pairs = [
[
r"My name is (.*)",
['hello %1', '%1 mabuhay ka'],
],
[
r'hi',
['hello', 'kamusta', 'mabuhay',],
],
[
r'(.*) (hungry|sleepy|groot)',
[
"%1 %2"
]
],
[
r'(.*)(m... | davidam/python-examples | nlp/nltk/hugotbot.py | Python | gpl-3.0 | 1,251 |
from urlparse import urlparse
import sys
import socket
import os
import re
class HttpClient(object):
def __init__(self,proxy=None,logfile='headers.log'):
self.proxy = proxy
self.LOGFILE = logfile
self.parsed_url = None # Instance of class urlparse
self.http_version = "HTTP/1.1"... | tomasdelvechio/py-net-dev | Protocolos/3 - http client/http_client_object.py | Python | gpl-3.0 | 9,464 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2016-2018 Canonical Ltd
#
# 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 Foundation.
#
# This program is distributed in ... | cprov/snapcraft | tests/unit/states/test_stage.py | Python | gpl-3.0 | 3,005 |
"""
Author: Tom Daniels, Kaitlin Keenan
Purpose: Creates a force graph of IP addresses and any connections they made
"""
import igraph
import json
import plotly
import plotly.graph_objs as pg
import sys
GEN_INFO = 0 # General information
PHYS = 1 # Physical layer information
DATA = 2 # Data link laye... | TRDan6577/networkStatistics | networkNodes.py | Python | gpl-3.0 | 4,386 |
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def invertTree(self, root: TreeNode) -> TreeNode:
def recurse(node):
if not node:
... | 1337/yesterday-i-learned | leetcode/226e.py | Python | gpl-3.0 | 474 |
import requests
import random
import time
user_agent_generic="Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0"
# In case of providers whose request do not follow a regular pattern, you can use code here to form it
###################################################################################... | oscarpilote/Ortho4XP | Providers/O4_Custom_URL.py | Python | gpl-3.0 | 5,644 |
#!/usr/bin/env python
import argparse
import errno
import glob
import os
import subprocess
import sys
import zipfile
dirs = ("", "entity", "entity/chest", "colormap", "blocks", "entity/shulker", "entity/bed")
assets = "assets/minecraft/textures/"
files = [
("entity/chest/normal.png", assets + "entity/chest/normal.pn... | mapcrafter/mapcrafter | src/tools/mapcrafter_textures.py | Python | gpl-3.0 | 6,484 |
from database import Database
import argparse
class Analyzer():
ignores = ['id', 'time', 'browser_fingerprint', 'computer_fingerprint_1', "fonts"]
db = Database('uniquemachine')
cols = db.run_sql("SHOW COLUMNS FROM features")
def __init__(self):
pass
def check_imgs_difference_by_str(self... | Song-Li/dynamic_fingerprinting | research/analyze/analyze.py | Python | gpl-3.0 | 8,676 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Brian Coca <bcoca@ansible.com>
#
# 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... | jtyr/ansible-modules-core | system/systemd.py | Python | gpl-3.0 | 15,567 |
#!./python_link
# -*- coding: utf-8 -*-
################################################################################
# DChars-FE Copyright (C) 2008 Xavier Faure
# Contact: faure dot epistulam dot mihi dot scripsisti at orange dot fr
#
# This file is part of DChars-FE.
# DChars-FE is free software: you c... | suizokukan/dchars-fe | config_ini.py | Python | gpl-3.0 | 1,966 |
# -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
# OpenModes - An eigenmode solver for open electromagnetic resonantors
# Copyright (C) 2013 David Powell
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gen... | DavidPowell/OpenModes | setup.py | Python | gpl-3.0 | 7,161 |