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 |
|---|---|---|---|---|---|
"""Wrapper file to run VABS on input files for a station cross-section.
Author: Perry Roth-Johnson
Last modified: April 9, 2014
"""
import os
# -----------------------------------------------
# update these parameters!
list_of_station_nums = range(1,34+1)
# ------------------------------------------... | perryjohnson/biplaneblade | sandia_blade_lib/run_all_vabs.py | Python | gpl-3.0 | 1,452 |
# -*-coding:utf-8 -*
import os
import imaplib
from oauth2 import *
client_id="287712233618-7qua8pervof64n6g740gi8d0o7ifiu28.apps.googleusercontent.com"
client_secret="iXsCL1-rYN_D9R6RCc6mUmln"
url=GeneratePermissionUrl(client_id, scope='https://mail.google.com/')
print(url)
print("Autoriser la recherche dans vos... | MindPass/Code | technique/gmail/finalgmail.py | Python | gpl-3.0 | 1,653 |
import sys
import re
from subprocess import call
import os
from os import path
import shutil
xml_file = sys.argv[1]
print "XML File is " + xml_file
music_dir = '/home/mike/Music'
url_locs = []
dir_locs = []
with open (xml_file, 'r') as read_file:
for line in read_file:
search = re.search('<location>file:/... | mikesligo/xmlToPhone | xmlToPhone.py | Python | gpl-3.0 | 1,452 |
""" Example showing how the 'onion' geometry template can be used
to simulate a circular Si waveguide clad in SiO2.
"""
import time
import datetime
import numpy as np
import sys
import matplotlib
matplotlib.use('pdf')
import matplotlib.pyplot as plt
sys.path.append("../backend/")
import materials
import objects
i... | bjornsturmberg/NumBAT | tutorials/simo-tut_11b-onion3.py | Python | gpl-3.0 | 4,378 |
# Copyright (C) 2016-2018 YouCompleteMe contributors
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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... | micbou/YouCompleteMe | python/ycm/tests/youcompleteme_test.py | Python | gpl-3.0 | 42,991 |
#!/usr/bin/env python
# encoding: utf-8
"""
@version: ??
@author: phpergao
@license: Apache Licence
@file: test.py
@time: 16-4-16 下午10:59
"""
from sklearn.linear_model import LogisticRegression
from sklearn.svm import LinearSVC
from sklearn.metrics import classification_report
from sklearn.datasets import make_classi... | actlea/TopicalCrawler | TopicalCrawl/TopicalCrawl/classifier/sklearn_cotraining/sklearn_cotraining/test.py | Python | gpl-3.0 | 3,475 |
#coding=UTF-8
from pyspark import SparkContext, SparkConf, SQLContext, Row, HiveContext
from pyspark.sql.types import *
from datetime import date, datetime, timedelta
import sys, re, os
st = datetime.now()
conf = SparkConf().setAppName('PROC_A_TRADE_OPPONENT').setMaster(sys.argv[2])
sc = SparkContext(conf = conf)
sc.s... | cysuncn/python | spark/crm/PROC_A_TRADE_OPPONENT.py | Python | gpl-3.0 | 4,003 |
#!/usr/bin/env python
# vim: sw=4:ts=4:sts=4:fdm=indent:fdl=0:
# -*- coding: UTF8 -*-
#
# Import utility functions and classes
# Copyright (C) 2012 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 publish... | zepto/musio-python2 | musio/import_util.py | Python | gpl-3.0 | 8,995 |
#!/usr/bin/env python
# Copyright (C) 2016 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 3 of the License, or
# (at your option) any later version.
#
# This prog... | projectatomic/commissaire-http | src/commissaire_http/router/__init__.py | Python | gpl-3.0 | 3,023 |
from robocompdsl.templates.common.templatedict import TemplateDict
AGM_INCLUDES_STR = """
# AGM Agent\'s requirements
find_package(LibXml2 REQUIRED)
include_directories(LIBXML2_INCLUDE_DIRS)
include_directories(/usr/include/libxml2/)
"""
class src_CMakeLists_txt(TemplateDict):
def __init__(self, component):
... | robocomp/robocomp | tools/cli/robocompdsl/robocompdsl/templates/templateCPP/plugins/agm/functions/src/CMakeLists_txt.py | Python | gpl-3.0 | 795 |
#!/usr/bin/env python
# XGBoost training script
# Optional arguments: randomly select hyperparameters
import numpy as np
import pandas as pd
import xgboost as xgb
import sys, time, os, json
import argparse
import pyarrow.parquet as pq
from hyperopt import hp
import hyperopt.pyll.stochastic
from pprint import pprint
... | Justin-Tan/hep-analysis | classifiers/xgb/xgb_pq.py | Python | gpl-3.0 | 9,725 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('empresas', '0001_initial'),
('afiliados', '0011_auto_20160206_2348'),
]
operations = [
migrations.AddField(
... | montenegroariel/sigos | apps/afiliados/migrations/0012_titular_empresa.py | Python | gpl-3.0 | 498 |
import regex
# more or less the regex used in HexChat IRC client
patterns = dict(
scheme=r'(?:https?://)',
user=r'(?:[\w\-]+@)',
domain=r'[\pL\pN\pS][-\pL\pN\pS]*(?:\.[-\pL\pN\pS]+)*',
tld=r'\.[\pL][-\pL\pN]*[\pL]',
port=r'(?:\:\d+)',
lpar=r'\(',
rpar=r'\)',
noparens=r'[^\(\) \t\n\r]*... | knitori/shanghai-doll | shanghai/utils.py | Python | gpl-3.0 | 717 |
#!/usr/bin/env python
from __future__ import print_function
from __future__ import absolute_import
import os
import sys
if sys.version_info < (3,):
from future import standard_library
standard_library.install_aliases()
import tkFileDialog
import tkMessageBox
else:
import tkinter.filedialog as tkFi... | sonofeft/XYmath | xymath/gui/xygui.py | Python | gpl-3.0 | 18,535 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Tiger Soldier
#
# This file is part of OSD Lyrics.
#
# OSD Lyrics 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 ... | lenoch/osdlyrics | python/pattern.py | Python | gpl-3.0 | 5,754 |
# Generated by Django 2.0.9 on 2019-04-03 16:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('guidedmodules', '0047_auto_20190403_1627'),
]
operations = [
migrations.AddField(
model_name='appversion',
name='sho... | GovReady/govready-q | guidedmodules/migrations/0048_appversion_show_in_catalog.py | Python | gpl-3.0 | 631 |
"""
* Copyright (c) 2008 Zivios, LLC.
*
* This file is part of Zivios.
*
* Zivios 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... | Emergen/zivios-agent | modules/netfile.py | Python | gpl-3.0 | 2,709 |
from apport.report import Report
from apport.packaging_impl import impl as packaging
import sys
# fix gettext to output proper unicode strings
import gettext
def unicode_gettext(str):
trans = gettext.gettext(str)
if isinstance(trans, unicode):
return trans
return trans.decode('UTF-8')
def fatal... | Alberto-Beralix/Beralix | i386-squashfs-root/usr/share/pyshared/apport/__init__.py | Python | gpl-3.0 | 748 |
from qualifications.models import SkillCategory, Skill, Job, Location, PositionStatus, Position, Profile, EmployeeSkill, JobProfileSkill, EmployeePositionStatus ,EmployeePosition
from django.contrib import admin
admin.site.register(SkillCategory)
admin.site.register(Skill)
admin.site.register(Job)
admin.site.register(... | gdebure/cream | qualifications/admin.py | Python | gpl-3.0 | 548 |
# Copyright 2021 Google LLC
#
# 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 the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without ev... | google-research/heatnet | model/models.py | Python | gpl-3.0 | 13,033 |
from chapter12.textbook_exercise12_3_3 import tree_insert
from chapter13.exercise13_2_1 import right_rotate
from chapter13.textbook13_2 import left_rotate
def treap_insert(T, x):
tree_insert(T, x)
while x is not T.root and x.priority < x.p.priority:
if x is x.p.left:
right_rotate(T, x.p)
... | wojtask/CormenPy | src/chapter13/problem13_4.py | Python | gpl-3.0 | 365 |
import xml.etree.ElementTree as ET
from xml.etree.ElementTree import Element, Comment, SubElement, ElementTree, dump
import re
def indent(elem, level=0):
""" Cleanup indentation in XML """
i = "\n" + level*(" "*4)
if len(elem):
if not elem.text or not elem.text.strip():
elem.text = i + ... | ASPatterson/OptiMass-v1.0.3 | model/model_interpreter/CardReader26.py | Python | gpl-3.0 | 16,404 |
# -*- coding: utf-8 -*-
#+---------------------------------------------------------------------------+
#| 01001110 01100101 01110100 01111010 01101111 01100010 |
#| |
#| Netzob : Inferring communication protocol... | nagyistoce/netzob | src/netzob/UI/Export/Controllers/TextExportController.py | Python | gpl-3.0 | 4,873 |
#!/usr/bin/python
# set gpio18 to high when content of file state is 'ON'
import RPi.GPIO as GPIO
import time
import sys
import DB
def run(sensor):
if sensor == None:
return
valuesPolled = sensor.poll()
tempPolled = valuesPolled[0]
humidityPolled = valuesPolled[1]
#---------------------... | WarmMe/alpha1 | WarmMe/thermostat/Poll.py | Python | gpl-3.0 | 815 |
"""Unit tests for the ``activation_keys`` paths.
:Requirement: Activationkey
:CaseAutomation: Automated
:CaseLevel: Component
:CaseComponent: ActivationKeys
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from fauxfactory import gen_integer, gen_string
from nailgun import client, entities
from requ... | pgagne/robottelo | tests/foreman/api/test_activationkey.py | Python | gpl-3.0 | 18,481 |
from django.urls import re_path
from . import views
app_name = "diagnosis"
urlpatterns = [
re_path(r"^$", views.DiagnosisLandingView.as_view(), name="landing"),
]
| erudit/eruditorg | eruditorg/apps/userspace/library/diagnosis/urls.py | Python | gpl-3.0 | 169 |
#!/usr/bin/python
import warnings
warnings.simplefilter("ignore", DeprecationWarning)
warnings.simplefilter("ignore", UserWarning)
from scikits.audiolab import Format, Sndfile
from scipy.signal import firwin, lfilter
from tempfile import mkstemp
import numpy as np
import urllib2
import math
import sys
import re
import ... | AsteriskProject/Speaker-recognition-Asterisk | speechsender.py | Python | gpl-3.0 | 11,495 |
from rez.vendor import yaml
from rez.serialise import FileFormat
from rez.package_resources_ import help_schema
from rez.vendor.schema.schema import Schema, Optional, And, Or, Use
from rez.vendor.version.version import Version
from rez.utils.data_utils import SourceCode
from rez.utils.formatting import PackageRequest, ... | saddingtonbaynes/rez | src/rez/package_serialise.py | Python | gpl-3.0 | 6,901 |
# Copyright (C) 2011-2014 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 you... | trevor/mailman3 | src/mailman/rest/users.py | Python | gpl-3.0 | 9,639 |
__all__ = ['config'
'Language',
'stanford_ner_wrapper',
'utils',
'visualize_ners']
import config
import utils
from stanford_ner_wrapper import sppw
from lang_lib import Language
| WillemJan/Narralyzer | narralyzer/__init__.py | Python | gpl-3.0 | 224 |
#!/usr/bin/python
# encoding: utf-8
import sqlite3
import hashlib
import sys
import time
import io
import re
from datetime import datetime
def read_file(fn):
'''read file '''
fp=open(fn,"r")
h=fp.read()
fp.close
return h
def write_file(fn,content):
'''read file '''
fp=io.open(fn,"w")
... | s7lx/wechat2text | run.py | Python | gpl-3.0 | 4,358 |
# coding=utf-8
"""InaSAFE Disaster risk tool by Australian Aid - Metadata for ITB Earthquake
Impact Function on Population.
Contact : ole.moller.nielsen@gmail.com
.. note:: 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
... | Samweli/inasafe | safe/impact_functions/earthquake/itb_earthquake_fatality_model/metadata_definitions.py | Python | gpl-3.0 | 7,424 |
# Copyright (C) 2013-2014 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 you... | adam-iris/mailman | src/mailman/commands/cli_conf.py | Python | gpl-3.0 | 5,616 |
"""
logger:
===============================================================================
Python class (mostly) uses standar library to log the values into different
file formats.
"""
import csv
class Logger(object):
"""
Python class (mostly) uses standar library to log the values into different
fil... | neoatmatrix/cold_collection | logger.py | Python | gpl-3.0 | 2,034 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'src/players_list.ui'
#
# Created by: PyQt5 UI code generator 5.7.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_dialog_players(object):
def setupUi(self, dialog_players):
... | matuu/ligadefutbol | ligafutbol/gui/players_list.py | Python | gpl-3.0 | 5,985 |
"Represent the instructions as data instead of closures."
# t: tree node
# dn, dv: definition names, definition values (i.e. analyzed definitions)
# vn, vv: variable names, variable values
import abstract_syntax as A
def eval_program(program):
dn = tuple(defn.name for defn in program.defns)
dv = tuple(de... | darius/toot | toot8_encoded.py | Python | gpl-3.0 | 2,746 |
import unittest, doctest, copy, bisect
class PartiallySortedArray():
"""A class receiving an unsorted array, supporting rank and select operators on it in the second most greedy way.
"""
def __init__(self,A):
"""Create a Partially Sorted Array supporting rank and select operators from a simple ... | jyby/DDSRankSelectInMultisets | Implementations/Python/greedyImplementation.py | Python | gpl-3.0 | 2,091 |
"""This package provides helpers for randomzied testsing."""
from six.moves.urllib_parse import quote
import os
from ironblogger.app import db
from ironblogger.model import Blogger, Blog, Post, Party
from ironblogger.date import to_dbtime, duedate, duedate_seek
import arrow
random_ncalls = int(os.getenv('NUM_RANDOM_CA... | zenhack/iron-blogger2 | tests/util/randomize.py | Python | gpl-3.0 | 6,993 |
#! /usr/bin/env python3
'''
A Lift simulator.
Usage:
lifts <sim-file> [<file-interface-dir>]
lifts -h | --help
lifts --version
Options:
-h --help Show this screen.
--version Show version.
'''
import os
from time import time, sleep
from random import choice, gauss, seed
import toml
from docopt impo... | quasipedia/lifts | lifts/simulation.py | Python | gpl-3.0 | 5,877 |
# -*- coding: utf8 -*-
# This file is part of Saywah.
# Copyright (C) 2009 Renzo Carbonara <gnuk0001@gmail.com>
#
# Saywah 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
#... | k0001/saywah | saywah/gui/main.py | Python | gpl-3.0 | 14,097 |
# -*- coding: utf-8 -*-
#
#
# Permission actions choices
#
PERMS_ACTION_NAME_ALL = 'all'
PERMS_ACTION_NAME_CONNECT = 'connect'
PERMS_ACTION_NAME_UPLOAD_FILE = 'upload_file'
PERMS_ACTION_NAME_DOWNLOAD_FILE = 'download_file'
#
# System User login mode choices
#
MANUAL_LOGIN = 'manual'
AUTO_LOGIN = 'auto'
| jumpserver/coco | coco/const.py | Python | gpl-3.0 | 306 |
#! /usr/bin/env python
from __future__ import print_function
from openturns import *
TESTPREAMBLE()
RandomGenerator.SetSeed(0)
try:
# Instanciate one distribution object
f = NumericalMathFunction("x", "x^2 + 2 * sin(x)")
distribution = CompositeDistribution(f, Normal())
print("Distribution ", repr(di... | dubourg/openturns | python/test/t_CompositeDistribution_std.py | Python | gpl-3.0 | 4,378 |
# -*- coding: utf-8 -*-
# Copyright(C) 2009-2010 Romain Bignon
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it w... | jocelynj/weboob | weboob/backends/bnporc/browser.py | Python | gpl-3.0 | 5,869 |
# -*- coding: utf-8 -*-
"""
Module of tool that can be applied to BIRRP outputs
Created on %(date)s
@author: %(Jared Peacock)s
"""
import numpy as np
import os
import fnmatch
import datetime
from scipy import interpolate
import time
import mtpy.legacy.mttools as mt
import shutil
import subprocess
#import winsound as... | geophysics/mtpy | mtpy/legacy/birrptools.py | Python | gpl-3.0 | 107,423 |
#!/usr/bin/python
"""
Reads the .tar.bzip file provided by offical FTP
"""
import os
import sys
import time
import tarfile
from plot import plotter
from headerFileReader import extractConvertTable
from split import splitter
from colorscale import Grayscale as COLORSCALE_IR
from colorscale import VIS as COLORSCALE_V... | neoatlantis/MTSAT-2-plotter | vis_dedicated_reader.py | Python | gpl-3.0 | 3,150 |
import asyncio
import gzip
import logging
import os.path
import shutil
import socket
import time
import geoip2.database
import geoip2.errors
import requests
from cloudbot import hook
from cloudbot.util import async_util
logger = logging.getLogger("cloudbot")
DB_URL = "http://geolite.maxmind.com/download/geoip/datab... | MuffinMedic/CloudBot | plugins/geoip.py | Python | gpl-3.0 | 2,920 |
#!/usr/bin/python3 -u
# -*- coding: utf-8 -*-
#
# Copyright 2020, Timofey Titovets and the systemd-swap contributors
# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import annotations
import argparse
import glob
import os
import pickle
import re
import shutil
import signal
import stat
import subprocess
i... | Nefelim4ag/systemd-swap | src/systemd-swap.py | Python | gpl-3.0 | 34,933 |
#!/usr/bin/env python
# encoding: utf-8
"""
判断数独是否合法,模拟一下
"""
class Solution(object):
@staticmethod
def valid9(row):
fr = [c for c in row if c != '.']
dr = [c for c in fr if '1' <= c and c <= '9']
row_valid = (len(fr) == len(dr)) and (len(fr) == len(set(fr)))
return row_valid
... | ShengRang/c4f | leetcode/valid-sudoku.py | Python | gpl-3.0 | 1,030 |
import numpy as np
import scipy.interpolate
import scipy.signal
def find_peaks_ohaver(y, x=None, slope_thresh=0., amp_thresh=None,
medfilt_radius=5, maxpeakn=30000, peakgroup=10,
subchannel=True,):
"""Find peaks along a 1D line.
Function to locate the positive peak... | sillvan/hyperspy | hyperspy/misc/spectrum_tools.py | Python | gpl-3.0 | 7,192 |
# -*- coding:utf-8 -*-
# Copyright © 2011 Clément Schaff, Mahdi Ben Jelloul
"""
openFisca, Logiciel libre de simulation du système socio-fiscal français
Copyright © 2011 Clément Schaff, Mahdi Ben Jelloul
This file is part of openFisca.
openFisca is free software: you can redistribute it and/or modify
... | clems/openfisca | src/france/lgtm.py | Python | gpl-3.0 | 10,063 |
#!/usr/bin/env python
"""Loads accidents from a PNP Accidents database dump"""
import argparse
import csv
import datetime
import logging
import json
import os
from osgeo import osr, ogr
import uuid
import pytz
import requests
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')... | fungjj92/DRIVER | scripts/load_pnp_accidents.py | Python | gpl-3.0 | 7,045 |
# ext/declarative/api.py
# Copyright (C) 2005-2018 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Public API functions and helpers for declarative."""
from ...schema impor... | fernandog/Medusa | ext/sqlalchemy/ext/declarative/api.py | Python | gpl-3.0 | 25,014 |
from abc import ABC, abstractmethod
from clickable.commands.docker.docker_config import DockerConfig
class DockerSupport(ABC):
@abstractmethod
def update(self, docker_config: DockerConfig):
pass
| bhdouglass/clickable | clickable/commands/docker/docker_support.py | Python | gpl-3.0 | 214 |
# Copyright 2016 Gokhan MANKARA <gokhan@mankara.org>
import logging
import logging.handlers
import os
import sys
class Log:
def __init__(self, log_file_path=None, syslog=False):
self.log_path = log_file_path
if not log_file_path is None:
path = os.path.dirname(self.log_path)
... | gokhanm/psystem | psystem/log.py | Python | gpl-3.0 | 2,044 |
# encoding: utf-8
from __future__ import print_function
from alignment import Alignment
from expr import (Expr, Variable, BinaryOp, ComparisonOp, missing_values,
getdtype, always)
from exprbases import CompoundExpression
from exprmisc import Exp, Max, Where, Logit, Logistic, ExtExpr
from expr... | benjello/liam2 | liam2/regressions.py | Python | gpl-3.0 | 3,181 |
# fsutils.py
# -*- Mode: Python; indent-tabs-mode: nil; tab-width: 4; coding: utf-8 -*-
#
# Copyright © 2013-2014 Gwendal Le Bihan
#
# This file is part of Fever.
#
# Fever 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... | glebihan/fever | Fever/fsutils.py | Python | gpl-3.0 | 922 |
#This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
import os
import logging
from lxml import etree
from trytond.model import ModelView, ModelSQL, fields
from trytond.backend import TableHandler
from trytond.pyson import CONTEXT, ... | openlabs/trytond | trytond/ir/ui/view.py | Python | gpl-3.0 | 13,243 |
from __future__ import print_function
import IMP
import IMP.core
import IMP.test
class Tests(IMP.test.TestCase):
"""Test RestraintSets"""
def _make_stuff(self):
m = IMP.Model("restraint sets")
rs = IMP.RestraintSet(m, .5, "RS.5")
r0 = IMP._ConstRestraint(m, [], 1)
rs.add_rest... | shanot/imp | modules/kernel/test/test_restraint_sets.py | Python | gpl-3.0 | 2,171 |
import unittest
import json
from keanu.app import flask_app
class TestToken(unittest.TestCase):
def setUp(self):
"""
Setup app for testing
:return:
"""
self.app = flask_app.test_client()
self.app.testing = True
def tearDown(self):
"""
Remove app... | KanaoReeves/KeanuFromBehind | tests/token_test.py | Python | gpl-3.0 | 780 |
from django.db import models
from django.db.models import Q
class CourseManager(models.Manager):
# Filtro no banco
def search(self, query):
return self.get_queryset().filter(
Q(name__icontains=query) | Q(description__icontains=query)
) # Catch queryset and after returns all objec... | rafaelribeiroo/ensinoDistancia | src/apps/courses/models.py | Python | gpl-3.0 | 1,662 |
# -*- coding: utf-8 -*-
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
import unittest
class TestNonProfitSettings(unittest.TestCase):
pass
| ESS-LLP/erpnext | erpnext/non_profit/doctype/non_profit_settings/test_non_profit_settings.py | Python | gpl-3.0 | 239 |
'''
File containing support functions for running a simulation. The functions
in this file is not for public use; all functions in this file are private
functions.
Date created: 10th October 2013
'''
import random, inspect, os
import os.path
from datetime import datetime
from time import time
from copy import deepco... | clarencecastillo/dose | dose/simulation_calls.py | Python | gpl-3.0 | 27,438 |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from easy_thumbnails.fields import ThumbnailerImageField
import os
import uuid
def _get_logo_upload_path(instance, filename):
ext = os.path.splitext(filename)[1]
filename = str(uuid.uuid4())
return os.path.join("support... | eeriks/velo.lv | velo/supporter/models.py | Python | gpl-3.0 | 1,842 |
# vim: tabstop=4 shiftwidth=4 smarttab expandtab softtabstop=4 autoindent
"""
Document : xbmc_otr.py
Package : OTR Integration to XBMC
Author : Frank Epperlein
Copyright : 2012, Frank Epperlein, DE
License : Gnu General Public License 2
Description: Worker class library
"""
import... | gibro/xbmc-otr | resources/lib/xbmc_otr.py | Python | gpl-3.0 | 44,391 |
from ts3plugin import ts3plugin
import ts3lib, pytson, ts3client
from ts3defines import ERROR_ok, ClientPropertiesRare, TextMessageTargetMode
from PythonQt.QtGui import *
from PythonQt.QtCore import Qt
import os
from configparser import ConfigParser
import traceback
ct = ts3lib.printMessageToCurrentTab
CONF_DEFAU... | pathmann/pyTSon_repository | autoreply.py | Python | gpl-3.0 | 5,781 |
try:
import __builtin__
except:
import builtins
try:
import gdb
except:
pass
import os
import os.path
import sys
import struct
import types
from dumper import *
#######################################################################
#
# Infrastructure
#
#############################################... | frostasm/qt-creator | share/qtcreator/debugger/gdbbridge.py | Python | gpl-3.0 | 65,560 |
#!/usr/bin/env python
# -*- coding: latin-1; py-indent-offset:4 -*-
################################################################################
#
# This file is part of HttxLib
#
# HttxLib is an HTTP(s) Python library suited multithreaded/multidomain
# applications
# Copyright (C) 2010 Daniel Rodriguez (aka Dani... | mementum/bfrelay | httxlib/httxoptions.py | Python | gpl-3.0 | 10,821 |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import contextlib
import hashlib
import json
import logging
import os
import posixpath
import re
import sys
import time
from devil.android import crash_hand... | Passw/gn_GFW | build/android/pylib/local/device/local_device_instrumentation_test_run.py | Python | gpl-3.0 | 35,150 |
__all__ = ["p3dGrid","TurnsGrid","TurnsBlade","turns2moose"]
import struct
import numpy as np
sizeint = 4
sizedbl = 8
class p3dGrid(object):
'''Parent class for plot3d grids'''
X = np.array([])
iblank = np.array([],dtype=np.int32)
def __init__(self):
pass
class TurnsGrid(p3dGrid):
'''Class to re... | aniketaranake/p3dtools | p3dtools.py | Python | gpl-3.0 | 4,827 |
from test_support import gcc
gcc("volatiles_illegal_1.adb", opt=["-c", "-gnatf"])
gcc("volatiles_illegal_2.ads", opt=["-S", "-c", "-gnatf", "-gnatX"])
gcc("volatiles_illegal_3.ads", opt=["-S", "-c", "-gnatf"])
gcc("volatiles_illegal_4.adb", opt=["-c", "-gnatf"])
gcc("volatiles_illegal_5.adb", opt=["-c", "-gnatf"])
gcc... | AdaCore/spark2014 | testsuite/gnatprove/tests/TU__volatiles_illegal/test.py | Python | gpl-3.0 | 626 |
from dis_snek.client import Snake
from dis_snek.models import Scale, slash_command
from discordbot import command
from discordbot.command import MtgContext
from magic.models import Card
from shared import fetch_tools
class BugInfo(Scale):
@slash_command('buginfo')
@command.slash_card_option()
async def b... | PennyDreadfulMTG/Penny-Dreadful-Tools | discordbot/commands/buginfo.py | Python | gpl-3.0 | 850 |
# ext stats based on the xsearch example
# $Id$
# Copyright 2013 Matthew Wall, all rights reserved
"""This search list extension offers extra tags:
'alltime': All time statistics.
'seven_day': Statistics for the last seven days.
'thirty_day': Statistics for the last thirty days.
You can then use tags su... | crmorse/weewx-waterflow | extensions/xstats/bin/user/xstats.py | Python | gpl-3.0 | 3,224 |
#!/usr/bin/env python3
import hello
print(hello.greet())
| skulumani/asteroid_dumbbell | examples/boost-python/01_hello_world/hello.py | Python | gpl-3.0 | 58 |
######################### TEXTA Configuration File ########################
# This file contains all the framework's general configurable options which
# don't need changes in the source code. Some configurations are hardcoded
# into different applications' source code and may be altered to fine-tune
# the output or c... | texta-tk/texta | texta/settings.py | Python | gpl-3.0 | 15,953 |
"""
"""
import csv
import re
import sys
import argparse
import numpy as np
import matplotlib.pyplot as plt
def check_valid_value(key, val):
if key == "participant_id":
if re.match(r'sub-[0-9]{6}', val) is None:
return False
return True
# "else" statements not necessary because fun... | sguthrie/predicting-depression | scripts/find_subjects_behavior_data.py | Python | gpl-3.0 | 4,298 |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
f... | Vagab0nd/SiCKRAGE | lib3/twilio/rest/supersim/v1/network_access_profile/network_access_profile_network.py | Python | gpl-3.0 | 16,202 |
# -*- coding: utf-8 -*-
# leap_argparse.py
# Copyright (C) 2013 LEAP
#
# 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.
#... | elijh/bitmask_client | src/leap/bitmask/util/leap_argparse.py | Python | gpl-3.0 | 3,334 |
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | retr0h/ansible | lib/ansible/module_utils/basic.py | Python | gpl-3.0 | 36,105 |
# -*- coding: utf-8 -*-
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub 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 Softwar... | andresriancho/PyGithub | github/GitRef.py | Python | gpl-3.0 | 2,931 |
# -*- coding: utf-8 -*-
#
# Copyright 2017-18 Nick Boultbee
# This file is part of squeeze-alexa.
#
# squeeze-alexa 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... | declension/squeeze-alexa | squeezealexa/transport/base.py | Python | gpl-3.0 | 2,055 |
# -*- coding: utf-8 -*-
from .run import main
main()
| coxande/Twik | twik/__main__.py | Python | gpl-3.0 | 55 |
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2019 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.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, eith... | dontnod/weblate | weblate/addons/flags.py | Python | gpl-3.0 | 3,200 |
from config.server import IDLE_CONNECTION_TIMEOUT
from core import FM
class ReadImages(FM.BaseAction):
def __init__(self, request, paths, session, **kwargs):
super(ReadImages, self).__init__(request=request, **kwargs)
self.paths = paths
self.session = session
def run(self):
r... | LTD-Beget/sprutio | app/modules/ftp/actions/files/read_images.py | Python | gpl-3.0 | 715 |
import eventlet
import logging
import os
from flask import (Flask,
send_from_directory)
from flask_socketio import (SocketIO)
from resources.camera import Camera
from resources.gps import Gps
from resources.rudder import Rudder
from resources.throttle import Throttle
logging.basicConfig(level=loggin... | morgangalpin/duckomatic | duckomatic/api/api_controller_class.py | Python | gpl-3.0 | 3,464 |
'''Tests elements of queue.py, but doesn't use the queue subsystem
(redis/rabbitmq)
'''
import json
from nose.tools import assert_equal
try:
from ckan.tests.helpers import reset_db
except ImportError:
from ckan.new_tests.helpers import reset_db
from ckan import model
from ckan import plugins as p
from ckan.pl... | NicoVarg99/daf-recipes | ckan/ckan/ckanext-harvest/ckanext/harvest/tests/test_queue2.py | Python | gpl-3.0 | 5,955 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Read audio tags from local files.
Print track number, artist, song title and duration for each file,
suitable for pasting into Musicbrainz’ track parser.
Copyright (C) 2015 Rainer Schwarzbach
<blackstream-x@users.noreply.github.com>
This program is ... | blackstream-x/track-parsers | file-tags/read_tags.py | Python | gpl-3.0 | 8,892 |
###############################################################################
#
# 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_font09.py | Python | gpl-3.0 | 2,253 |
#!/usr/bin/python3
# Python 3, dev on debian 9, intending to run in alpine / python official image
import threading
import time
import sys
import yaml
import re
from slackclient import SlackClient
from common import logger
from message_router import message_router
from keywords import keywords
# Modules
class Variab... | rpkish/botiana | botiana.py | Python | gpl-3.0 | 5,558 |
from contrib.rfc4443 import unknown_informational_message_type as suite
from scapy.all import *
from veripy.testability import ComplianceTestTestCase
class UnknownInformationalMessageTypeTestCase(ComplianceTestTestCase):
def test_unrecognized_next_header_valid(self):
o = self.get_outcome(suite.Unknow... | mwrlabs/veripy | contrib/rfc4443/tests/unknown_informational_message_type_test_case.py | Python | gpl-3.0 | 700 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
class Migration(migrations.Migration):
dependencies = [
('scrumboard', '0005_auto_20150315_0205'),
]
operations = [
migrations.RemoveField(
model_name='st... | acidjunk/django-scrumboard | scrumtools/apps/scrumboard/migrations/0006_auto_20150703_2246.py | Python | gpl-3.0 | 1,476 |
# -*- coding: utf-8 -*-
"""
Load word embeddings from different representations.
"""
from __future__ import print_function
import os
import numpy as np
import logging
from itertools import izip
# local
from word_dictionary import WordDictionary
# ---------------------------------------------------------------------... | attardi/deepnl | deepnl/embeddings.py | Python | gpl-3.0 | 4,684 |
## 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__="""
{enable: true, once: true, resource-timestamp: 1570164866872275, resource-type: event}
"""
__trigger__='False'
if __name__... | EternityForest/KaithemAutomation | kaithem/data/modules/Chandler/Rules.py | Python | gpl-3.0 | 567 |
# -*- coding: UTF-8 -*-
"""Easy to use object-oriented thread pool framework.
A thread pool is an object that maintains a pool of worker threads to perform
time consuming operations in parallel. It assigns jobs to the threads
by putting them in a work request queue, where they are picked up by the
next available threa... | moses-rolston/err | errbot/bundled/threadpool.py | Python | gpl-3.0 | 12,581 |
# encoding=utf-8
from __future__ import division, absolute_import, with_statement, print_function
import logging
DEFAULT_LOGGER_NAME = 'SYS'
DEFAULT_LOGGING_FMT = '[%(asctime)s %(levelname)s %(name)s] %(message)s'
DEFAULT_LOGGIN_LEVEL = logging.NOTSET
def initialize():
import os
import sys
import logging... | Major1201/dns-router | utils/logger.py | Python | gpl-3.0 | 3,050 |
# Paperwork - Using OCR to grep dead trees the easy way
# Copyright (C) 2012-2014 Jerome Flesch
#
# Paperwork 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... | openpaperwork/paperwork | paperwork-gtk/src/paperwork/frontend/multiscan/__init__.py | Python | gpl-3.0 | 17,135 |
'''
This is obsolete.
'''
import sqlite3
import os
import logging
logger = logging.getLogger()
def grup(txtVal):
'''
Trasforms a string to uppercase special for Greek comparison
'''
ar1 = u"αάΆΑβγδεέΈζηήΉθιίϊΊκλμνξοόΌπρσςτυύΎφχψωώΏ"
ar2 = u"ΑΑΑΑΒΓΔΕΕΕΖΗΗΗΘΙΙΙΙΚΛΜΝΞΟΟΟΠΡΣΣΤΥΥΥΦΧΨΩΩΩ"
ftxt = u''... | tedlaz/pyted | tedutil/db.py | Python | gpl-3.0 | 5,128 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from libs import Parser
from libs import ShowInfo
from libs import Printer
import argparse
import downloader
import json
import os
import re
import sys
standalone_episode_regexs = [
# Newzbin style, no _UNPACK_
'(.*?)( \(([0-9... | jbonet/TuSubseeker | tusubseeker.py | Python | gpl-3.0 | 6,744 |
# -*- coding: utf-8 -*-
#
# Pimlico documentation build configuration file, created by
# sphinx-quickstart on Tue Mar 22 11:48:06 2016.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... | markgw/pimlico | docs/conf.py | Python | gpl-3.0 | 9,032 |
from enum import IntEnum
class Lookups(IntEnum):
discogs = 0
catalog = 1
class Formats(IntEnum):
flac24 = 0
flac16 = 1
opus128 = 2
opus96 = 3
opus64 = 4
| elliotsayes/cathash | defs.py | Python | gpl-3.0 | 183 |
""" This module handles the tabbed layout in PyChess """
from __future__ import absolute_import
import imp
import os
import traceback
import threading
from threading import currentThread
from gi.repository import Gdk
from gi.repository import Gtk
from gi.repository import GLib
from gi.repository import GObject
from g... | oldstylejoe/pychess-timed | lib/pychess/widgets/gamewidget.py | Python | gpl-3.0 | 42,093 |