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 |
|---|---|---|---|---|---|
# groupwise-ics: synchronize GroupWise calendar to ICS file and back
# Copyright (C) 2013 Cedric Bosdonnat <cedric@bosdonnat.fr>
# 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 ... | cbosdo/groupwise-ics | cal.py | Python | gpl-3.0 | 18,999 |
def find2Sum(arr, target):
if arr is None:
return None
sumList = []
d = dict()
for x in range(len(arr)):
if arr[x] in d:
index = d[arr[x]]
smallList = []
smallList.append(index)
smallList.append(x)
sumList.append(smallList)
else:
d[target - arr[x]] = x
print sumList
def main():
arr = [... | ruchikd/Algorithms | Python/2Sum/2Sum.py | Python | gpl-3.0 | 405 |
import random
import os
import safe
import PIL
import PIL.Image
import PIL.ImageDraw
import PIL.ImageFont
import io
import core.settings
import urllib
import aiohttp
import asyncio
import traceback
import re
import imageutil
import core.help
import advertising
import discord
import json
from queuedict import QueueDict
... | DXsmiley/mathbot | mathbot/modules/latex/__init__.py | Python | gpl-3.0 | 8,127 |
# vim: ts=4:sw=4:expandtab
# BleachBit
# Copyright (C) 2008-2017 Andrew Ziem
# https://www.bleachbit.org
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# ... | brahmastra2016/bleachbit | tests/TestGeneral.py | Python | gpl-3.0 | 5,373 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from obci.interfaces.bci.abstract_classifier import AbstractClassifier
class DummyClassifier(AbstractClassifier):
def classify(self, chunk):
print("classify called with chunk shaped "+str(chunk.shape))
return {'t... | BrainTech/openbci | obci/interfaces/bci/budzik/experimental/dummy_classifier.py | Python | gpl-3.0 | 452 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
sysrss – Let your system generate a maintenance notification RSS
Copyright © 2012, 2013 Mattias Andrée (maandree@member.fsf.org)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by... | maandree/sysrss | sysrss.py | Python | gpl-3.0 | 11,951 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) Morris Jobke 2010 <morris.jobke@googlemail.com>
#
# MailNotify 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, ... | MorrisJobke/MailNotify | includes/unreadmails.py | Python | gpl-3.0 | 3,557 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-08-30 22:36
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import mptt.fields
class Migration(migrations.Migration):
dependencies = [
('atlas_doc', '0014_auto_20170830_1803'),
... | robertdown/atlas_docs | atlas_doc/migrations/0015_auto_20170830_1836.py | Python | gpl-3.0 | 2,047 |
# -*- coding: utf-8 -*-
# Copyright (C) 2013-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 | tests/test_extract.py | Python | gpl-3.0 | 1,227 |
"""
"""
from collections.abc import Mapping
__all__ = [
"AtlasView",
"AdjacencyView",
"MultiAdjacencyView",
"UnionAtlas",
"UnionAdjacency",
"UnionMultiInner",
"UnionMultiAdjacency",
"FilterAtlas",
"FilterAdjacency",
"FilterMultiInner",
"FilterMultiAdjacency",
]
class Atlas... | SpaceGroupUCL/qgisSpaceSyntaxToolkit | esstoolkit/external/networkx/classes/coreviews.py | Python | gpl-3.0 | 13,480 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-26 13:31
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('blogadmin', '0003_auto_20170826_1836'),
]
operations = [
migrations.RenameField(
... | baike21/blog | blogadmin/migrations/0004_auto_20170826_2131.py | Python | gpl-3.0 | 435 |
# -*- coding: utf-8 -*-
# -*- mode: python -*-
from .base import BMBase
class BijectiveMap(BMBase):
'''Basic one to one bijective map'''
def __setitem__(self, key, value):
self.set_value(key, value)
def __getitem__(self, key):
return self.get_value(key)
def __delitem__(self, key):... | waipu/pybimaps | pybimaps/o2o.py | Python | gpl-3.0 | 888 |
#!/usr/bin/python
#
# This source code is part of tcga, a TCGA processing pipeline, written by Ivana Mihalek.
# Copyright (C) 2014-2016 Ivana Mihalek.
#
# 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 Fou... | ivanamihalek/tcga | tcga/01_somatic_mutations/005a_load_maf.py | Python | gpl-3.0 | 32,427 |
# $Id$
##
## This file is part of pyFormex 0.8.9 (Fri Nov 9 10:49:51 CET 2012)
## pyFormex is a tool for generating, manipulating and transforming 3D
## geometrical models by sequences of mathematical operations.
## Home page: http://pyformex.org
## Project page: http://savannah.nongnu.org/projects/pyformex/
##... | dladd/pyFormex | pyformex/examples/SpaceTrussRoof_calpy.py | Python | gpl-3.0 | 10,543 |
'''
Task Coach - Your friendly task manager
Copyright (C) 2004-2013 Task Coach developers <developers@taskcoach.org>
Task Coach is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
... | TaskEvolution/Task-Coach-Evolution | taskcoach/tests/unittests/patternsTests/ObservableTest.py | Python | gpl-3.0 | 25,981 |
#!/usr/bin/env python
import numpy as np # for numerics
import random # for random number generation
from math import sqrt,pi,e # some common function
import math
#import qutip as qp # qutip library for Bloch sphere visualisations
import cmath # library for complex numbers
from collections import Counter
#from tabulate... | mariaschuld/qc_simulator | py2/quantum_simulator_py2_no_tabulate.py | Python | gpl-3.0 | 17,997 |
# generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/pi/Documents/desenvolvimentoRos/install/include".split(';') if "/home/pi/Documents/desenvolvimentoRos/install/include" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRA... | UnbDroid/robomagellan | Codigos/Raspberry/desenvolvimentoRos/build/angles/angles/catkin_generated/pkg.installspace.context.pc.py | Python | gpl-3.0 | 492 |
# rFactor Remote LCD
# Copyright (C) 2014 Ingo Ruhnke <grumbel@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later versi... | Grumbel/rfactorlcd | rfactorlcd/dashlets/steering_dashlet.py | Python | gpl-3.0 | 1,727 |
import requests
from resources.lib.modules import workers
from resources.lib.modules import util
from resources.lib.modules import cache
import datetime
import player
PLAYER_HANDLER = player.__name__
def get_live_channels():
url = 'https://apim.oi.net.br/app/oiplay/ummex/v1/lists/651acd5c-236d-47d1-9e57-584a233a... | olavopeixoto/plugin.video.brplay | resources/lib/modules/oiplay/scraper_live.py | Python | gpl-3.0 | 4,017 |
from .lintegrate import *
__version__ = "0.1.11"
| mattpitkin/lintegrate | lintegrate/__init__.py | Python | gpl-3.0 | 50 |
import level1
def Drag(density, velocity, dragCoeff, Area):
# F = force due to drag
p = density
v = velocity
c = dragCoeff
A = Area
if v>0:
F = 0.5*p*(v**2)*c*A
elif v<0:
F = -0.5*p*(v**2)*c*A
else:
F=0
return F
| pcraddock/lander | main/Drag.py | Python | gpl-3.0 | 243 |
# -*- coding: utf-8 -*-
"""
coco.config
~~~~~~~~~~~~
the configuration related objects.
copy from flask
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import types
import errno
import json
from werkzeug.utils import import_string
class Co... | ibuler/coco | coco/config.py | Python | gpl-3.0 | 9,849 |
from tkinter import *
dt = 50
ball_radius = 10
class MainWindow:
def __init__(self):
self.root = Tk()
self.canvas = Canvas(self.root, width=600, height=400, bg='lightgreen')
self.canvas.pack()
self.a = [300, 200]
self.line = self.canvas.create_line(self.a, [400, 200], width... | tkhirianov/fox_python_2016 | lesson_19/canvas_usage.py | Python | gpl-3.0 | 1,570 |
""" EC2Endpoint class is the implementation of the EC2 interface to
a cloud endpoint
"""
import os
import json
import boto3
from DIRAC import gLogger, S_OK, S_ERROR
from DIRAC.Core.Utilities.File import makeGuid
from DIRAC.Resources.Cloud.Endpoint import Endpoint
class EC2Endpoint(Endpoint):
def __init__(sel... | DIRACGrid/DIRAC | src/DIRAC/Resources/Cloud/EC2Endpoint.py | Python | gpl-3.0 | 7,409 |
from .util import hook, colours, repl, other
from . import logging, limit
import socks, re, json, traceback, time, os, glob, importlib, requests, pkg_resources
events = []
def help_bot(conn=None, info=None):
"""Shows help for commands"""
for command in [func for func in conn.bot.events if func._event == "comm... | IndigoTiger/ezzybot | ezzybot/builtin.py | Python | gpl-3.0 | 1,710 |
import sys.os
import cv
def detectObject(image):
size = cv.GetSize(image)
grayscale = cv.CreateImage(size, 8, 1)
cv.cvtColor(image, grayscale, cv.CV_BGR2GRAY)
storage = cv.CreateMemStorage(0)
cv.EqualizeHist(grayscale, grayscale)
cascade = cv.Load("haarcascade_frontalface_alt.xml")
faces = cv.HarrDetectObjects(... | lalakiwe/FaceReg | test/face_detect.py | Python | gpl-3.0 | 734 |
from django.utils import timezone
from django.db import models
from django.dispatch import receiver
from django.db.models.signals import post_save
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from django.core.exceptions import ValidationError
from exercise.exercise_summary im... | teemulehtinen/a-plus | exercise/exercisecollection_models.py | Python | gpl-3.0 | 7,057 |
# doHacking
#
# Used by:
# Modules from group: Data Miners (9 of 9)
type = "active"
def handler(fit, module, context):
pass
| bsmr-eve/Pyfa | eos/effects/dohacking.py | Python | gpl-3.0 | 130 |
# xiaolongdolly 2017.8.20
squares = [value**2 for value in range(1, 11)]
print(squares)
| xiaolongdolly/Python_Course | chapter_4/squares/squares_3.py | Python | gpl-3.0 | 88 |
from django.contrib.auth.forms import AuthenticationForm
from django import forms
from django.forms.models import BaseModelFormSet
from players.models import *
class LoginForm(AuthenticationForm):
def confirm_login_allowed(self, user):
super(LoginForm, self).confirm_login_allowed(user)
if not use... | TreacheryLarp/downtime | players/forms.py | Python | gpl-3.0 | 3,138 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# freeseer - vga/presentation capture software
#
# Copyright (C) 2013 Free and Open Source Software Learning Centre
# http://fosslc.org
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as p... | Freeseer/freeseer | src/freeseer/__main__.py | Python | gpl-3.0 | 981 |
#!/usr/bin/env python
##############################################################################################
#
#
# regrid_emissions_N96e.py
#
#
# Requirements:
# Iris 1.10, time, cf_units, numpy
#
#
# This Python script has been written by N.L. Abraham as part of the UKCA Tutorials:
# http://www.ukca.ac.u... | acsis-project/emissions | emissions/python/timeseries_1960-2020/regrid_Monoterp_emissions_n96e_greg.py | Python | gpl-3.0 | 19,020 |
from django.urls import reverse_lazy, reverse
from django.template.defaultfilters import force_escape
from django.views.generic import ListView, View
from django.views.generic.edit import FormView
from django.shortcuts import get_object_or_404, redirect
from django.contrib.auth.decorators import login_required
from d... | AlexandreDecan/Lexpage | app/messaging/views.py | Python | gpl-3.0 | 8,456 |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
VetEpiGIS-Group
A QGIS plugin
Spatial functions for vet epidemiology
-------------------
begin : 2016-05-06
git sha : $Format:%H$
... | IZSVenezie/VetEpiGIS-Group | plugin/merge.py | Python | gpl-3.0 | 2,772 |
# Find the cube root of a perfect cube
x = int(input('Enter an integer: '))
for ans in range(0, abs(x)+1):
if ans**3 >= abs(x):
break
if ans**3 != abs(x):
print(x, 'is not a perfect cube')
else:
if x < 0:
ans = -ans
print('Cube root of', x, 'is', ans)
| bmoretz/Algorithms | Computation/ch_02/cube1.py | Python | gpl-3.0 | 286 |
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
### BEGIN LICENSE
# Copyright (C) 2013 <Kyle Francis> <guitarman_usa@yahoo.com>
# 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... | guitarmanusa/metau | metau/__init__.py | Python | gpl-3.0 | 1,928 |
#Python program to merge two sorted array a[] and b[] and storing it in c[]
a = []
b = []
c = []
num1 = int(input("Enter number of elements in array 1: "))
print("Enter your sorted array 1: ")
for i in range(0, num1):
a.insert(i, int(input())
num2 = int(input("Enter number of elements in array 2: "))
print("Enter ... | jainaman224/Algo_Ds_Notes | 1-D_Array/Python/Merge_Two_Sorted_Arrays.py | Python | gpl-3.0 | 1,097 |
# $Id: ip.py 65 2010-03-26 02:53:51Z dugsong $
"""Internet Protocol."""
import dpkt
class IP(dpkt.Packet):
__hdr__ = (
('v_hl', 'B', (4 << 4) | (20 >> 2)),
('tos', 'B', 0),
('len', 'H', 20),
('id', 'H', 0),
('off', 'H', 0),
('ttl', 'B', 64),
('p', 'B', 0),
... | packenx/PythonInstaller | app/src/main/assets/arm/static/python/lib/python2.7/site-packages/dpkt/ip.py | Python | gpl-3.0 | 11,035 |
from gi.repository import Gtk
from gi.repository import GdkPixbuf
from gi.repository import GObject
import logging
from softwarecenter.utils import get_icon_from_theme, size_to_str, utf8
from softwarecenter.backend import get_install_backend
from softwarecenter.backend.transactionswatcher import get_transactions_wat... | armikhael/software-center | softwarecenter/ui/gtk3/models/pendingstore.py | Python | gpl-3.0 | 7,630 |
import ipcalc
import ipam.exception
class ReserveIP (object):
"""
Provides the ability to reserve ip addresses before actually
having host names and MAC addresses.
"""
def __init__(self, data_store=None):
super(ReserveIP, self).__init__()
self._data_store = data_store
| vpejovski/simpleipam | ipam/reserveip.py | Python | gpl-3.0 | 308 |
# Copyright (C) 2012 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
# GNU Mailman 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 opt... | hcs/mailman | src/mailman/interfaces/configuration.py | Python | gpl-3.0 | 1,237 |
"""
BlackDog
Copyright (C) 2014 Snaipe, Therozin
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.
This program is distributed ... | Snaipe/BlackDog | blackdog/server.py | Python | gpl-3.0 | 5,246 |
import json
import sys
from nsx_rest import *
#from common.jinja import *
def get_tz_all():
r = nsxGet("/api/2.0/vdn/scopes", "json")
r_dict = json.loads(r)
tzones = {"transportzones" : []}
scopes = r_dict['allScopes']
for scope in scopes:
tzones["transportzones"].append({'name' : scope['name'], '... | FibercorpLabs/FibercorpDevops | vmware/nsx/utils/nsx/TransportZone.py | Python | gpl-3.0 | 2,162 |
# the same method as version 2 in python
import numpy as np
import scipy.io.wavfile as wav
from scipy import signal
import matplotlib.pyplot as plt
from pylab import specgram
import os
import os.path
import cv2
#audiopath='Recordings/3D + small mic 6.wav'
audiopath='sound/A1.wav'
filename=audiopath[11:-4... | Sisqui/lungcheck_django | processing codes/tagging and model learning code/show.py | Python | gpl-3.0 | 810 |
## Code outside the data string, and the setup and action blocks is ignored
## If manually editing, you must reload the code. Delete the resource timestamp so kaithem knows it's new
__data__="""
continual: false
enable: true
once: true
priority: interactive
rate-limit: 0.0
resource-timestamp: 1641276823517748
resource-... | EternityForest/KaithemAutomation | kaithem/data/modules/Chandler/2_Universes.py | Python | gpl-3.0 | 36,442 |
import os
def createTile(posx, posy, id_num, world_id_num):
looplist = '1'
values=[]#Values are all of the lines of a prefab that have the vertex coords
f = open('tf2/prefab_template/spike_prefab.txt', 'r+')
lines = f.readlines() #gathers each line of the prefab and puts numbers them
x1 = posx*512
... | baldengineers/mapper | tf2/prefabs/spike_prefab.py | Python | gpl-3.0 | 7,295 |
import argparse, json, pickle, time, random
import os.path
import networkx as nx
import numpy as np
from mapserver.graph.builder import GraphBuilder
from mapserver.graph.contractor2 import GraphContractor
from mapserver.routing.router2 import Router
from networkx.readwrite import json_graph
import matplotlib.pyplot a... | bradleyhd/netsim | graph_degree.py | Python | gpl-3.0 | 6,610 |
# Copyright 2012 David Malcolm <dmalcolm@redhat.com>
# Copyright 2012 Red Hat, Inc.
#
# 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 version 3 of the License, or
# (at your option) a... | jasonxmueller/gcc-python-plugin | misc/fedora/mass-rebuild.py | Python | gpl-3.0 | 9,408 |
#! /usr/bin/env python3
import sys
import os
import json
import operator
import base64
from subprocess import call
from .ete2 import Tree, SeqGroup
from .taxonomy_util import TaxCode
class EpaJsonParser:
"""This class parses the RAxML-EPA json output file"""
def __init__(self, jsonfin):
f=open(jsonfin)... | amkozlov/sativa | epac/json_util.py | Python | gpl-3.0 | 11,651 |
import types, string, pprint, exceptions
class EnumException(exceptions.Exception):
pass
class Enumeration:
def __init__(self, name, enumList, startAt=0):
self.__doc__ = name
lookup = { }
reverseLookup = { }
i = startAt
uniqueNames = [ ]
uniqueValues... | fsav/diffrev | generation/wikidpad_formatter/Enum.py | Python | gpl-3.0 | 1,381 |
import pytest
from feeluown.media import Media
@pytest.fixture
def media():
return Media('zzz://xxx.yyy',
http_headers={'referer': 'http://xxx.yyy'})
def test_media_copy(media):
media2 = Media(media)
assert media2.http_headers == media.http_headers
def test_media_http_headers(media):... | cosven/FeelUOwn | tests/test_media.py | Python | gpl-3.0 | 364 |
#!/usr/bin/env python3
"""
Math library for calculator.
"""
__author__ = "Mark Birger, Daniil Khudiakov, Martin Knotek"
__date__ = "26 Apr 2015"
__credits__ = ["Mark Birger", "Daniil Khudiakov", "Martin Knotek"]
__license__ = "GNU General Public License v3.0"
__version__ = "1.0"
__maintainer__ = "Mark Birger"
__stat... | kusha/calculator | mathlib.py | Python | gpl-3.0 | 4,002 |
#/* bigbob11.cc
# * Shows gripper, and how it works.
# * K. Nickels 7/24/13
# */
import sys, os
sys.path.append('/usr/local/lib/python2.7/site-packages/')
sys.path.append('/usr/local/lib64/python2.7/site-packages/')
from playerc import *
import math,time
def gripper_state (state):
return {
PLAYER_GRIPP... | lsa-pucrs/Player-Stage-Manual | code/Ch9.3/bigbob11_c.py | Python | gpl-3.0 | 2,123 |
from django.apps import AppConfig
class FragTrackerConfig(AppConfig):
name = 'frag_tracker'
| MariusLauge/dnd_tracker | frag_tracker/apps.py | Python | gpl-3.0 | 98 |
#!/usr/bin/env python
import sys
import re
from setuptools import setup
from npm2spec import __version__
description = "Small library to help you generate spec file for npm project."
long_description = """
npm2spec makes you life easier at packaging npm project for Fedora.
"""
download_url = "http://pypi.python.org... | ralphbean/npm2spec | setup.py | Python | gpl-3.0 | 1,393 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# timezone.py
#
# Copyright © 2013-2017 Antergos
#
# This file is part of Cnchi.
#
# Cnchi 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 th... | keeganmilsten/Reborn-OS | Cnchi/timezone.py | Python | gpl-3.0 | 12,445 |
(S'8e52acbb4634097ec5461a6478acf23c'
p1
(ihappydoclib.parseinfo.moduleinfo
ModuleInfo
p2
(dp3
S'_namespaces'
p4
((dp5
(dp6
tp7
sS'_import_info'
p8
(ihappydoclib.parseinfo.imports
ImportInfo
p9
(dp10
S'_named_imports'
p11
(dp12
S'frowns.Depict.MoleculeDrawer'
p13
(lp14
S'*'
asS'Tkinter'
p15
(lp16
S'*'
asS'frowns'
p17
(l... | tuffery/Frog2 | frowns/test/.happydoc.test_drawables.py | Python | gpl-3.0 | 787 |
# Auto-generated 2021-07-02T10:20:07.035522
from collections import OrderedDict
driver_info = OrderedDict([
('cameras.picam', {
'params': ['model', 'serial'],
'classes': ['PicamCamera'],
'imports': ['nicelib'],
}),
('cameras.pixelfly', {
'params': ['number'],
'classe... | mabuchilab/Instrumental | instrumental/driver_info.py | Python | gpl-3.0 | 7,203 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# tinytag - an audio meta info reader
# Copyright (c) 2014-2018 Tom Wallroth
#
# Sources on github:
# http://github.com/devsnd/tinytag/
# MIT License
# Copyright (c) 2014-2018 Tom Wallroth
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of... | EternityForest/KaithemAutomation | kaithem/src/thirdparty/tinytag/tinytag.py | Python | gpl-3.0 | 51,655 |
## HISTOGRAM PLOTTING FOR REYNOLDS AND ROSSBY NUMBERS
from __future__ import print_function
path = '/home/mkloewer/python/swm/'
import os; os.chdir(path) # change working directory
import numpy as np
from scipy import sparse
import matplotlib.pyplot as plt
import time as tictoc
from netCDF4 import Dataset
import glob
i... | milankl/swm | calc/misc/Re_hist_plot.py | Python | gpl-3.0 | 2,796 |
##Add Advanced Labeling Fields To Selected Layer=name
from PyQt4.QtCore import QVariant
from qgis.utils import iface
from qgis.core import QgsField, QgsPalLayerSettings
# Function source: https://gis.stackexchange.com/a/216110/55741
def setColumnVisibility( layer, columnName, visible ):
config = layer.attributeTab... | klakar/QGIS_resources | collections/Geosupportsystem/processing/enabelAdvancedLabels.py | Python | gpl-3.0 | 1,939 |
__author__ = 'mnowotka'
from django.db import models
from chembl_core_model.models import *
from chembl_core_db.db.models.abstractModel import ChemblCoreAbstractModel
from chembl_core_db.db.models.abstractModel import ChemblModelMetaClass
from django.utils import six
#-------------------------------------------------... | thesgc/chembiohub_ws | chembl_core_model/models/experimentalData.py | Python | gpl-3.0 | 17,784 |
"""
This class maps abundances from a MESA profile to a reduced set for FLASH.
Copyright 2015 Donald E. Willcox
This file is part of mesa2flash.
mesa2flash 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 Founda... | jselsing/mesa2flash | MapMesaComposition.py | Python | gpl-3.0 | 1,668 |
# models.py -- nothing to see here
| Fizzmint/django-hideshowpassword | hideshowpassword/models.py | Python | gpl-3.0 | 35 |
# auto-generated test file
import unittest
import umlgen.Specific.STK.StkDataTypes.StkS8
# Start of user code imports
# End of user code
class StkS8Test(unittest.TestCase):
def setUp(self):
# self._testInstance = umlgen.Specific.STK.StkDataTypes.StkS8.StkS8()
# Start of user code setUp
self... | dmanev/ArchExtractor | ArchExtractor/tests/testgen/Specific/STK/StkDataTypes/StkS8_test.py | Python | gpl-3.0 | 863 |
from bs4 import BeautifulSoup
import requests
import re
import urllib2
import os
import cookielib
import json
def get_soup(url,header):
return BeautifulSoup(urllib2.urlopen(urllib2.Request(url,headers=header)),'html.parser')
query = "porn"#raw_input("porn")# you can change the query for the image here
image_typ... | Piltra/TwitterBot | tests/pydownloader.py | Python | gpl-3.0 | 1,951 |
#!/usr/bin/python
# Copyright (C) 2014 Bitergia
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is di... | dicortazar/grimoirelib-metadata | grimoirelib_metadata/scm.py | Python | gpl-3.0 | 9,002 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Tag.verbose_title'
db.add_column(u'tags_tag', 'verbose_ti... | urlist/devcharm | tags/migrations/0002_auto__add_field_tag_verbose_title__add_field_tag_description.py | Python | gpl-3.0 | 1,651 |
##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2015 Stefan Brüns <stefan.bruens@rwth-aachen.de>
##
## 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 ... | zeldin/libsigrokdecode | decoders/usb_request/pd.py | Python | gpl-3.0 | 13,475 |
# minqlbot - A Quake Live server administrator bot.
# Copyright (C) Mino <mino@minomino.org>
# This file is part of minqlbot.
# minqlbot 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 th... | razers3dge/Modified-QL-Minobot | plugins/motd.py | Python | gpl-3.0 | 3,357 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2011, 2012 Tom Keffer <tkeffer@gmail.com>
#
# See the file LICENSE.txt for your full rights.
#
# $Id$
#
"""Unit test module weewx.wxstats"""
from __future__ import with_statement
import math
import os.path
import shutil
import sys
import syslog
import time
import unit... | sai9/weewx-gitsvn | bin/weewx/test/test_daily.py | Python | gpl-3.0 | 18,244 |
import collections
import functools
import json
import logging.config
import os
from dancebooks import const
class SmtpConfig(object):
def __init__(self, params):
self.host = params["host"]
self.port = params["port"]
self.user = params["user"]
self.password = params["password"]
self.email = params["email"]... | georgthegreat/dancebooks-bibtex | dancebooks/config.py | Python | gpl-3.0 | 5,501 |
from __future__ import division # floating-point division
class DocumentationCredibility:
"""
DocumentationCredibility class provides simple key(0-5 (LOW to HIGH)) to credibility conversion
based on Unknown to Total commands ratio.
:param credibility: credibility computed from number of unknown vs. t... | rh-lab-q/bkrdoc | bkrdoc/analysis/credibility.py | Python | gpl-3.0 | 2,147 |
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
from __future__ import (absolute_import, divi... | mganeva/mantid | Framework/PythonInterface/plugins/algorithms/CompareSampleLogs.py | Python | gpl-3.0 | 7,729 |
# low level db access - does no error checking or validation
# provides abstraction between the actual database (sqlite, mongo, etc) and the db_frontend.py
import sqlite3
import os.path
import datetime
import re
from db import DB
from flask import g
RE_int = re.compile(r'\d+') # re to check if string is positive int... | swalladge/snsrv | old/sqlite_db.py | Python | gpl-3.0 | 8,481 |
#-----------------------------------------------------------------------------
# Copyright (c) 2005-2016, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this s... | ijat/Hotspot-PUTRA-Auto-login | PyInstaller-3.2/PyInstaller/hooks/hook-gi.repository.GModule.py | Python | gpl-3.0 | 1,035 |
#!/usr/bin/env python2
"""
Copyright (c) 2015 Mia Nordentoft
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modif... | miestasmia/c2k | c2k.py | Python | gpl-3.0 | 10,323 |
#!/usr/bin/env python3
from tkinter import Toplevel, ACTIVE
from tkinter import ttk
class Tif_export(Toplevel):
'''
Class creates modal window to save tif file
about the software.
'''
def __init__(self, main_widget, widget_geometries, samples, texts):
'''
Creates top level windo... | mariuszkowalski/BioCounter | gui/misc/tif_export_gui.py | Python | gpl-3.0 | 4,446 |
import unittest
from wpull.body import Body
from wpull.protocol.ftp.request import Reply, Command, Request, Response
class TestRequest(unittest.TestCase):
def test_parse_reply(self):
reply = Reply()
reply.parse(b'200 Hello\r\n')
self.assertEqual(200, reply.code)
self.assertEqual('... | chfoo/wpull | wpull/protocol/ftp/request_test.py | Python | gpl-3.0 | 3,726 |
# -*- coding: utf8 -*-
SQL = """select
(select count(*) FROM `af3_fond` where A100=1 )A1001,
(select count(*) FROM `af3_fond` where A100=2 )A1002,
(select count(*) FROM `af3_fond` where A100=3)A1003,
(select count(*) FROM `af3_fond` where A100=4)A1004,
(select count(*) FROM `af3_fond` where A100=5)A... | ffsdmad/af-web | cgi-bin/plugins2/report_list.py | Python | gpl-3.0 | 3,580 |
import numpy
from mpi4py import MPI
from ndarray import equiv_class
def centerofmass(label, pos, boxsize=1.0, comm=MPI.COMM_WORLD):
"""
Calulate the center of mass of particles of the same label.
The center of mass is defined as the mean of positions of particles,
but care has to be taken regarding t... | DonRegan/nbodykit | nbodykit/halos.py | Python | gpl-3.0 | 2,417 |
__author__ = 'Rico'
from lang.language import translation
class CardDeck:
symbols = ["♥", "♦", "♣", "♠"]
valueInt = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10]
@staticmethod
def create_deck():
from random import shuffle
deck = list(range(1, 52)) #TODO currently only one deck ... mayb... | d-Rickyy-b/TelegramBot | game/cardDeck.py | Python | gpl-3.0 | 1,060 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2016-2020 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 ... | chipaca/snapcraft | snapcraft/plugins/v1/_plugin.py | Python | gpl-3.0 | 7,235 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import io
import os
import json
from crotal import logger
class Database(object):
"""
Database is the interface to the file 'db.json'.
"""
@classmethod
def from_file(cls, path):
"""
Read the database ... | dinever/crotal | crotal/db.py | Python | gpl-3.0 | 4,917 |
#!/usr/bin/python3
# based on chapter 13 of Python for Kids 199
# "Adding some action making the ball move"
from tkinter import *
import random
import time
tk = Tk()
tk.title("Game")
tk.resizable(0, 0)
tk.wm_attributes("-topmost", 1)
canvas = Canvas(tk, width=500, height=400, bd=0, highlightthickness=0)
canvas.pack(... | mikef656/my-emacs-setup | mybin/python_4_kids/ch13/making_the_ball_move.py | Python | gpl-3.0 | 698 |
#!/usr/bin/env python
# -*- coding: UTF8 -*-
#
# ffmpeg library python wrapper.
# Copyright (C) 2011 Josiah Gordon <josiahg@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either v... | zepto/musio-python2 | musio/ffmpeg/__init__.py | Python | gpl-3.0 | 834 |
# coding: utf-8
from __future__ import absolute_import, division, unicode_literals, print_function
import logging
from .exceptions import APIError
from . import api
import config
class GitHubIssueHandler(logging.Handler):
"""Emit logged messages as issues on GitHub."""
headers = {'Accept': "application/v... | XVMX/vmbot | vmbot/helpers/logging.py | Python | gpl-3.0 | 2,851 |
import sys
# example of dictionary usage
period = sys.argv[1]
# set up dictionary
period_dict={}
# add data
period_dict['Cambrian']=(541.0,485.4)
period_dict['Ordovician']=(485.4,443.4)
period_dict['Silurian']=(443.4,419.2)
period_dict['Devonian']=(419.2,358.9)
period_dict['Carboniferous']=(358.9,298.9)
period_dict... | eml11/PMPPython | samples/geological_periods.py | Python | gpl-3.0 | 705 |
# -*- coding: utf-8 -*-
import urllib
from core import httptools
from core import scrapertools
from platformcode import logger
def test_video_exists(page_url):
if 'googleusercontent' in page_url:
return True, "" # desactivada verificación pq se encalla!
response = httptools.downloadpage(page_url, h... | alfa-jor/addon | plugin.video.alfa/servers/gvideo.py | Python | gpl-3.0 | 2,665 |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 distrib... | kilon/sverchok | nodes/number/formula2.py | Python | gpl-3.0 | 6,390 |
# Functions for manipulating .sum summary files.
import re
import os.path
from StringIO import StringIO
# Helper regex for parse_sum_line.
sum_matcher = re.compile('^(.?(PASS|FAIL)): (.*)$')
# You must call set_web_base at startup to set this.
gdb_web_base = None
def set_web_base(arg):
global gdb_web_base
g... | tromey/gdb-buildbot | lib/sumfiles.py | Python | gpl-3.0 | 4,263 |
# --- BEGIN COPYRIGHT BLOCK ---
# Copyright (C) 2015 Red Hat, Inc.
# All rights reserved.
#
# License: GPL (version 3 or any later version).
# See LICENSE for details.
# --- END COPYRIGHT BLOCK ---
"""Brooker classes to organize ldap methods.
Stuff is split in classes, like:
* Replica
* Backend
* Suffix
... | Ilias95/lib389 | lib389/tests/config_test.py | Python | gpl-3.0 | 2,329 |
import numpy as np
from pyFTS.partitioners import partitioner
from pyFTS.models.nonstationary import common, perturbation
from pyFTS.common import FuzzySet as stationary_fs
class PolynomialNonStationaryPartitioner(partitioner.Partitioner):
"""
Non Stationary Universe of Discourse Partitioner
"""
def ... | petroniocandido/pyFTS | pyFTS/models/nonstationary/partitioners.py | Python | gpl-3.0 | 5,675 |
#!/usr/bin/env python
from functools import partial
from math import sqrt
from netCDF4 import Dataset
import sys
import optparse
import rtree
optparse.OptionParser.format_epilog = lambda self, formatter: self.epilog
class NcFiller:
def __init__(self, options ):
self.options = options
... | rsmz/ncFillMissing | ncFillMissing.py | Python | gpl-3.0 | 9,811 |
# Outspline - A highly modular and extensible outliner.
# Copyright (C) 2011-2014 Dario Giovannetti <dev@dariogiovannetti.net>
#
# This file is part of Outspline.
#
# Outspline 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... | xguse/outspline | src/outspline/plugins/wxtasklist/msgboxes.py | Python | gpl-3.0 | 2,430 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
import datetime
import hashlib
import pytz
import threading
import urllib2
import urlparse
from lxml import etree
from odoo import api, fields, models, tools, _
from odoo.modules import get_module_resource... | ayepezv/GAD_ERP | openerp/addons/base/res/res_partner.py | Python | gpl-3.0 | 36,156 |
# setBonusAsklepian
#
# Used by:
# Implants named like: Grade Asklepian (16 of 16)
# Implants named like: grade Asklepian Omega (2 of 2)
runTime = "early"
type = "passive"
def handler(fit, src, context):
fit.appliedImplants.filteredItemMultiply(lambda mod: mod.item.requiresSkill("Cybernetics"),
... | Ebag333/Pyfa | eos/effects/setbonusasklepian.py | Python | gpl-3.0 | 416 |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2016, Toshio Kuratomi <tkuratomi@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, eithe... | michael-dev2rights/ansible | lib/ansible/cli/__init__.py | Python | gpl-3.0 | 38,491 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('thumbnails', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='thumbnail',
name=b... | arhote/exchange | exchange/thumbnails/migrations/0002_auto_20170504_1443.py | Python | gpl-3.0 | 797 |
def filter_string(s):
return int(''.join(c for c in s if c.isdigit()))
| VladKha/CodeWars | 7 kyu/Filter the number/solve.py | Python | gpl-3.0 | 75 |