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 |
|---|---|---|---|---|---|
#!/usr/bin/python
import re
from sys import argv
from orig import strxor
#Load dictionary for validation
with open('cracklib-small', 'r') as fp:
wordlist = set(fp.read().split('\n'))
def isprintable(inp):
words = inp.split(' ')
if len(words) == 1:
return False
for word in words:
wor... | rkrp/2timepad-breaker | crack.py | Python | gpl-3.0 | 1,264 |
import numpy as np
import fir_filter
import gauss_pulse
import comms_filters
class generic_modulator:
def __init__(self, modulation_type, samples_per_symbol, pulse_factor, pulse_length, config):
""" Create the generic modulator object and specify the modulation parameters.
Supported modulation types ar... | phase4ground/DVB-receiver | modem/python/library/generic_modulator.py | Python | gpl-3.0 | 36,780 |
class Predicate(object):
def __init__(self, name, arguments):
self.name = name
self.arguments = arguments
self.value_mapping = dict()
self.cost_str = ""
def __str__(self):
return "%s(%s)" % (self.name, ", ".join(map(str, self.arguments)))
def get_arity(self):
... | robertmattmueller/sdac-compiler | pddl/predicates.py | Python | gpl-3.0 | 503 |
#!/usr/bin/env python
import chef
import datetime
from errbot import BotPlugin, botcmd
from time import time
STALE_TIME = 60 * 30 # 30 minutes
class Chef(BotPlugin):
def pretty_time(self, time):
return datetime.datetime.fromtimestamp(int(time)).strftime('%Y-%m-%d %H:%M:%S')
def search... | jordant/err-chef | chef.py | Python | gpl-3.0 | 2,609 |
# 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 | tests/distance/test_distance_clark.py | Python | gpl-3.0 | 2,001 |
#!/usr/bin/env python
"""casper.py
Utility class for getting and presenting information from casper.jxml.
The results from casper.jxml are undocumented and thus quite likely to be
removed. Do not rely on its continued existence!
Copyright (C) 2014 Shea G Craig <shea.craig@da.org>
This program is free software: you ... | novaksam/python-jss | jss/casper.py | Python | gpl-3.0 | 3,498 |
print ("Hello World !!")
| ronas/PythonGNF | Eduardo/L01.ExeSeq01.py | Python | gpl-3.0 | 25 |
"""
A "mirroring" ``stdout`` context manager.
While active, the context manager reverses text output to
``stdout``::
# BEGIN MIRROR_GEN_DEMO_1
>>> from mirror_gen import looking_glass
>>> with looking_glass() as what: # <1>
... print('Alice, Kitty and Snowdrop')
... print(what)
... | YuxuanLing/trunk | trunk/code/study/python/Fluent-Python-example-code/15-context-mngr/mirror_gen.py | Python | gpl-3.0 | 1,453 |
# -*- coding: utf-8 -*-
'''
Printmodel django module for condominium
@author: Laurent GAY
@organization: sd-libre.fr
@contact: info@sd-libre.fr
@copyright: 2016 sd-libre.fr
@license: This file is part of Lucterios.
Lucterios is free software: you can redistribute it and/or modify
it under the terms of the GNU General... | Diacamma2/syndic | diacamma/condominium/printmodel/Owner_0001.py | Python | gpl-3.0 | 28,968 |
# sqlalchemy/pool.py
# Copyright (C) 2005-2011 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
"""Connection pooling for DB-API connections.
Provides a number of connection poo... | jokajak/itweb | data/env/lib/python2.6/site-packages/SQLAlchemy-0.6.7-py2.6.egg/sqlalchemy/pool.py | Python | gpl-3.0 | 33,545 |
#!/usr/bin/env python3
#
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
# Copyright (C)2013-2022 The MMGen Project <mmgen@tuta.io>
#
# 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 Softwa... | mmgen/mmgen | mmgen/color.py | Python | gpl-3.0 | 3,151 |
# -*- coding: UTF-8 -*-
# Copyright (C) 2007, 2009, 2011-2012 J. David Ibáñez <jdavid.ibp@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 y... | hforge/itools | itools/database/backends/git.py | Python | gpl-3.0 | 14,062 |
import nltk
PLUS = 'plus'
MUL = 'multiplied by'
DIV = 'divided by'
MIN = 'minus'
OPENB = 'open bracket'
CLOSEB = 'close bracket'
with open('../grammars/math.cfg', 'r') as file:
grammar_str = file.read()
def validate(text):
grammar = nltk.CFG.fromstring(grammar_str)
parser = nltk.ChartParser(grammar)
trees ... | HarishAtGitHub/Sentence-Understanding---Natural-Language-Understanding | sentance-understanding/core/understander/math.py | Python | gpl-3.0 | 1,682 |
class AbortAction(RuntimeError):
pass | aetherfirma/lazor | lazor/exceptions.py | Python | gpl-3.0 | 41 |
# generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []
PROJECT_NAME = "r2_description"
PROJECT_SPACE_DIR = "... | mkhuthir/catkin_ws | src/chessbot/build/nasa_r2_common/r2_description/catkin_generated/pkg.installspace.context.pc.py | Python | gpl-3.0 | 392 |
from bot.server import main
main()
| fedorlol/Tolyan | bot/__main__.py | Python | gpl-3.0 | 36 |
from rambutan3.check_args.annotation.NUMBER import NUMBER
def test():
assert not NUMBER.matches("abc")
assert not NUMBER.matches(True)
assert NUMBER.matches(-1.234)
assert NUMBER.matches(-1)
assert NUMBER.matches(0)
assert NUMBER.matches(0.234)
assert NUMBER.matches(1)
assert NUMBER.ma... | kevinarpe/kevinarpe-rambutan3 | tests/check_args/annotation/test_NUMBER.py | Python | gpl-3.0 | 362 |
#!/usr/bin/python3
#
# Copyright: Conor O'Callghan 2016
# Version: v1.1.3
#
# Please feel free to fork this project, modify the code and improve
# it on the github repo https://github.com/brioscaibriste/iarnrod
#
# Powered by TfL Open Data
# This program is free software: you can redistribute it and/or modi... | brioscaibriste/iarnrod | coire.py | Python | gpl-3.0 | 6,003 |
#!/usr/bin/python
# Copyright: (c) 2018, Hewlett Packard Enterprise Development LP
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | brandond/ansible | lib/ansible/modules/storage/hpe3par/ss_3par_cpg.py | Python | gpl-3.0 | 9,304 |
# painttheworld/game.py
#
# Represent and track the current game state.
import numpy as np
import datetime
import math
from painttheworld import constants
from painttheworld.constants import m1, m2, m3, m4, p1, p2, p3
''' Note that Latitude is North/South and Longitude is West/East'''
class GameState:
"""Keeps tr... | richardmin97/PaintTheWorld | Server/painttheworld/game.py | Python | gpl-3.0 | 8,968 |
from functools import reduce
from itertools import chain, combinations, product, permutations
# This class is used to represent and examine algebras on atom tables.
# It is intended to be used for nonassociative algebras, but this is not assumed.
class AtomicAlgebra:
# Create an algebra from a table of... | mdneuzerling/AtomicAlgebra | AtomicAlgebra.py | Python | gpl-3.0 | 23,406 |
"""Routines related to PyPI, indexes"""
import sys
import os
import re
import mimetypes
import posixpath
from pip.log import logger
from pip.util import Inf, normalize_name, splitext, is_prerelease
from pip.exceptions import (DistributionNotFound, BestVersionAlreadyInstalled,
InstallationE... | ncdesouza/bookworm | env/lib/python2.7/site-packages/pip/index.py | Python | gpl-3.0 | 40,408 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-30 12:53
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_... | pashinin-com/pashinin.com | src/core/migrations/0002_auto_20161030_1553.py | Python | gpl-3.0 | 478 |
# -*- coding: utf-8 -*-
############################################################################
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU Affero General Public License as #
# published by the Free Software Foundation, either version 3 of... | wangjun/pyload | module/plugins/crypter/PastebinCom.py | Python | gpl-3.0 | 1,621 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "projects_morelab.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| OscarPDR/projects_morelab | manage.py | Python | gpl-3.0 | 259 |
from unittest import TestCase, main
from io import StringIO
from brocclib.parse import (
read_blast, iter_fasta, parse_accession,
)
class AccessionTests(TestCase):
def test_parse_accession_old_format(self):
self.assertEqual(
parse_accession('gi|259100874|gb|GQ513762.1|'),
... | kylebittinger/brocc | tests/test_parse.py | Python | gpl-3.0 | 3,541 |
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# Copyright 2015 Abhijit Menon-Sen <ams@2ndQuadrant.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... | ngpestelos/ansible | lib/ansible/plugins/connection/ssh.py | Python | gpl-3.0 | 28,684 |
import logging
logger = logging.getLogger(__name__)
class SyncSectors:
def __init__(self, sector_model, sectors, disable_on=None, simulate=False):
self.sector_model = sector_model
self.sectors = sectors
self.disable_on = disable_on
self.simulate = simulate
def log(self, msg,... | UKTradeInvestment/export-wins-data | mi/sync_sectors.py | Python | gpl-3.0 | 2,373 |
#!/usr/bin/env python3
# Copyright 2016 - 2021 Bas van Meerten and Wouter Franssen
# This file is part of ssNake.
#
# ssNake 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, o... | smeerten/ssnake | src/safeEval.py | Python | gpl-3.0 | 2,736 |
# -*- coding: utf-8 -*-
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
import os
from os import listdir
from os.path import isfile, join
import random
import datetime
def files_in_dir(directory):
"""
:param directory: The directory
:return: List of all files in directory
"""
re... | wernersa/Streprogen_web | app/__init__.py | Python | gpl-3.0 | 1,393 |
# -*- coding: UTF-8 -*-
#
# Copyright (c) 2009 Ars Aperta, Itaapy, Pierlis, Talend.
#
# Authors: Romain Gauthier <romain@itaapy.com>
# Hervé Cauwelier <herve@itaapy.com>
# David Versmisse <david.versmisse@itaapy.com>
#
# This file is part of Lpod (see: http://lpod-project.org).
# Lpod is free software... | kiniou/blender-smooth-slides | tools/lpod/test/test_content.py | Python | gpl-3.0 | 4,392 |
# -*- 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 'Response.ts'
db.alter_column(u'survey_response', 'ts', self.gf('django.db.models.fields.D... | point97/hapifis | server/apps/survey/migrations/0077_auto__chg_field_response_ts__chg_field_respondant_review_status__chg_f.py | Python | gpl-3.0 | 17,288 |
#!/usr/bin/env python
# vim: set fileencoding=utf-8
import os
import argparse
from gff3 import genes, get_gff3_id, get_rbs_from, feature_test_true, feature_lambda, feature_test_type
from cpt_gffParser import gffParse, gffWrite
from Bio import SeqIO
from jinja2 import Environment, FileSystemLoader
import logging
from ma... | TAMU-CPT/galaxy-tools | tools/phage/phage_annotation_table.py | Python | gpl-3.0 | 19,472 |
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
''' Post installation script for linux '''
import sys, os, cPickle, textwrap, stat, errno
from subprocess import check_call, check_output
from functools import partial
from calibre import __appname__, prints, guess_type
from calib... | jelly/calibre | src/calibre/linux.py | Python | gpl-3.0 | 45,645 |
#!/usr/bin/python
import os
import sys
import commentjson
import time
import json
import datetime
from parse_input import check_config_structure
from build_nova import build_infrastructure, wait_for_spawn
from url_requests import test_infrastructure
import subprocess
### MAIN
if __name__ == "__main__":
if len(sy... | stepanvanecek/failover_test_framework | source/infrastructure/main.py | Python | gpl-3.0 | 2,430 |
#!/bin/env python
"""
#######################################################################
# #
# Copyright (c) 2012, Prateek Sureka. All Rights Reserved. #
# This module provides an idempotent mechanism to remotely configure #
# ntp sync... | surekap/fabric-recipes | fabfile/ntp_client.py | Python | gpl-3.0 | 2,215 |
# coding=utf-8
import sys, os.path
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), '../lib')))
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import locale
import unittest
import test_lib as test
import sickbeard
from sickbeard.helpers import sanitizeFil... | srluge/SickRage | tests/encoding_tests.py | Python | gpl-3.0 | 1,487 |
"""Проверки модуля system_wrappers."""
from logging import INFO
from unittest import TestCase
from unittest.mock import Mock, call, patch
from codestyle import system_wrappers
from codestyle.system_wrappers import (
ExitCodes,
check_output,
interrupt_program_flow,
)
class Test(TestCase):
"""Проверка ... | webpp-studio/codestyle | tests/test_system_wrappers.py | Python | gpl-3.0 | 4,814 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | dagwieers/ansible | lib/ansible/modules/database/postgresql/postgresql_schema.py | Python | gpl-3.0 | 11,616 |
import random
import actor
from vector import Vector as v
class SmokePuff(actor.Actor):
collides = False
def __init__(self, world, pos):
super(SmokePuff, self).__init__(world, pos=pos, radius=10, image_file="images/all/star.svgz")
self.apply_impulse(v((random.gauss(0,2),random.gauss(0,2))))... | italomaia/turtle-linux | games/DigbyMarshmallow/lib/effects.py | Python | gpl-3.0 | 472 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# slackbuild.py file is part of slpkg.
# Copyright 2014-2015 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved.
# Slpkg is a user-friendly package manager for Slackware installations
# https://github.com/dslackw/slpkg
# Slpkg is free software: you can redi... | BrentonEarl/slpkg | slpkg/sbo/slackbuild.py | Python | gpl-3.0 | 13,275 |
# coding=utf8
from setuptools import setup
setup(name='fbones',
version='0.0.5',
description='A bootstrap toolkit to kickoff a flask project',
url='https://github.com/ipconfiger/fbones',
author='Alexander.Li',
author_email='superpowerlee@gmail.com',
license='GNU GENERAL PUBLIC LIC... | ipconfiger/fbones | setup.py | Python | gpl-3.0 | 623 |
import sys
from os import sep
from PyQt4.QtGui import QApplication
from src import mainwindow
if __name__ == "__main__":
print "los gehts"
app = QApplication(sys.argv)
window = mainwindow.CCMainWindow()
sys.exit(app.exec_()) | AxXxel001/commentCreator_v2 | old/CommentCreator/main.py | Python | gpl-3.0 | 229 |
"""is_teklif_sistemi URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home'... | ufukdogan92/is-teklif-sistemi | is_teklif_sistemi/urls.py | Python | gpl-3.0 | 774 |
import kivy
kivy.require('1.9.1')
from kivy.app import Builder
from kivy.uix.gridlayout import GridLayout
from kivy.properties import ObjectProperty
from kivy.logger import Logger
from settingsview import SettingsView, SettingsSwitch, SettingsButton
from autosportlabs.widgets.separator import HLineSeparator
from autosp... | ddimensia/RaceCapture_App | autosportlabs/racecapture/views/configuration/rcp/wireless/bluetoothconfigview.py | Python | gpl-3.0 | 3,672 |
# moduleBonusAfterburner
#
# Used by:
# Modules from group: Propulsion Module (62 of 127)
type = "active"
runTime = "late"
def handler(fit, module, context):
fit.ship.increaseItemAttr("mass", module.getModifiedItemAttr("massAddition"))
speedBoost = module.getModifiedItemAttr("speedFactor")
mass = fit.ship... | Ebag333/Pyfa | eos/effects/modulebonusafterburner.py | Python | gpl-3.0 | 479 |
# -*- coding: utf-8 -*-
# Copyright 2007-2016 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... | vidartf/hyperspy | hyperspy/io_plugins/__init__.py | Python | gpl-3.0 | 2,279 |
# -*- coding: utf-8 -*-
from py3Des.pyDes import triple_des, ECB, PAD_PKCS5
class TripleDES:
__triple_des = None
@staticmethod
def init():
TripleDES.__triple_des = triple_des('1234567812345678',
mode=ECB,
IV... | codeMarble/codeMarble_Web | codeMarble_Web/codeMarble_py3des.py | Python | gpl-3.0 | 649 |
#task_2
a = int(input())
print(sum(list(map(int, list((bin(a))[2:]))))) | Senbjorn/mipt_lab_2016 | contest_7/task_2.py | Python | gpl-3.0 | 71 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# 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.... | Taifxx/xxtrep | context.addtolib/lfm_service.py | Python | gpl-3.0 | 2,631 |
#!/usr/bin/env python
from __future__ import absolute_import, print_function
import copy
import matplotlib
from grid_cell_model.submitting import flagparse
import noisefigs
from noisefigs.env import NoiseEnvironment
import config
parser = flagparse.FlagParser()
parser.add_flag('--gammaSweep')
args = parser.parse_ar... | MattNolanLab/ei-attractor | grid_cell_model/simulations/007_noise/figures/cosyne2015-abstract/figure_gamma.py | Python | gpl-3.0 | 492 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
---------------------------------------------------------------------------------------------------
dlg_subida
mantém as informações sobre a dialog de subida
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Pub... | mlabru/ptracks | view/piloto/dlg_subida.py | Python | gpl-3.0 | 7,178 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-05-16 18:59
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0012_auto_20180227_0858'),
]
operations = [
migrations.AlterModelOptions(
... | cmjatai/cmj | cmj/core/migrations/0013_auto_20180516_1559.py | Python | gpl-3.0 | 1,070 |
'''
t4_adm.py - this file is part of S3QL (http://s3ql.googlecode.com)
Copyright (C) 2008-2009 Nikolaus Rath <Nikolaus@rath.org>
This program can be distributed under the terms of the GNU GPLv3.
'''
from __future__ import division, print_function, absolute_import
from s3ql.backends import local
from s3ql.backends.c... | thefirstwind/s3qloss | tests/t4_adm.py | Python | gpl-3.0 | 2,378 |
import urllib
import urllib2
import json
import functools
def buildUrl(url, params = []):
if(len(params) > 0):
if url.find('?') < 0:
# no '?' in the url
url += '?'
first = True
else:
first = False
for key, value in params:
... | marook/python-crucible | src/modules/crucible/rest.py | Python | gpl-3.0 | 1,700 |
#!/usr/bin/env python
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
import re
from lxml.etree import XPath as X
from calibre.utils.filenames im... | pra85/calibre | src/calibre/ebooks/docx/names.py | Python | gpl-3.0 | 4,127 |
"""
This file is part of Maml.
Maml 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.
Maml is distributed in the hope tha... | brianhawthorne/maml | maml/test/test_parser.py | Python | gpl-3.0 | 2,468 |
# -*- coding: utf8 -*-
from django.conf import settings
from django.contrib import auth
from django.http import Http404, HttpResponse, HttpResponseRedirect
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.views.decorators.csrf import csrf_exempt, csrf_protect
from django.views.decora... | Wang-Sen/nqzx-backend | bootcamp/app/views.py | Python | gpl-3.0 | 11,441 |
# vim: ts=4:sw=4:expandtab
# BleachBit
# Copyright (C) 2008-2020 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
# ... | tstenner/bleachbit | tests/TestCommon.py | Python | gpl-3.0 | 2,298 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
##Copyright (c) 2017 Benoit Valot and Panisa Treepong
##benoit.valot@univ-fcomte.fr
##UMR 6249 Chrono-Environnement, Besançon, France
##Licence GPL
from . import variables
class ClipRead():
"""Clip read object"""
def __init__(self, alignedsegment):
self.read_... | bvalot/panISa | lib/clipread.py | Python | gpl-3.0 | 2,634 |
import contextlib
import unittest
import pytest
from cryptography import x509
import six
from ipapython.dn import DN, RDN, AVA
if six.PY3:
unicode = str
def cmp(a, b):
if a == b:
assert not a < b
assert not a > b
assert not a != b
assert a <= b
... | apophys/freeipa | ipatests/test_ipapython/test_dn.py | Python | gpl-3.0 | 48,955 |
import requests
import os
def post_var(token, ubi_source, ubi_var, value, timestamp=None, context=None):
'''
This function posts data to ubidots
Input parameters:
token: The Ubidots token
ubi_source: The name of the user's Ubidots datasource
ubi_var: The name of the user's Ubidots variable
value: Value to b... | jotathebest/ubi-tools | src/connect.py | Python | gpl-3.0 | 1,710 |
#!/usr/bin/env python2
from __future__ import division
import os
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import GObject as gobject
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import Notify
from gi.repository import AppIndicator3 as appindicator
from time import t... | bcostea/tomate2 | tomate2.py | Python | mpl-2.0 | 5,644 |
#!/usr/bin/env python
import os.path
config = {
"default_vcs": "tc-vcs",
"default_actions": [
'checkout-sources',
'build',
'build-symbols',
'make-updates',
'prep-upload',
'submit-to-balrog'
],
"balrog_credentials_file": "balrog_credentials",
"nightly_b... | lissyx/build-mozharness | configs/b2g/taskcluster-spark-dogfood.py | Python | mpl-2.0 | 1,365 |
import os
import unittest
import mozharness.base.python as python
here = os.path.dirname(os.path.abspath(__file__))
class TestVirtualenvMixin(unittest.TestCase):
def test_package_versions(self):
example = os.path.join(here, 'pip-freeze.example.txt')
output = file(example).read()
mixin = p... | ctalbert/mozharness | test/test_base_python.py | Python | mpl-2.0 | 1,129 |
import smtplib
import email.utils
from email.mime.text import MIMEText
import functools
import qiniu
try:
from config import AIRBB_HOST
except Exception, e:
print '==============no AIRBB_HOST set, ues airbb.xx as default==============', e
AIRBB_HOST = 'airbb.ml'
AIRBB_SUPPORT = 'support@%s' % AIRBB_HOST
d... | txdywy/airbb | misc/util.py | Python | mpl-2.0 | 1,425 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at http://mozilla.org/MPL/2.0/.
from atmo.stats.models import Metric
def test_metrics_record(now, one_hour_ago):
Metric.record("metric-key-1")
... | mozilla/telemetry-analysis-service | tests/test_stats.py | Python | mpl-2.0 | 1,163 |
from django.conf.urls import include, patterns, url
from django.views.generic.base import RedirectView
from mdn.urls import mdn_urlpatterns
from webplatformcompat.routers import router
from .views import RequestView, ViewFeature
webplatformcompat_urlpatterns = patterns(
'',
url(r'^$', RequestView.as_view(
... | renoirb/browsercompat | webplatformcompat/urls.py | Python | mpl-2.0 | 1,187 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import mock
import os
from configman import ConfigurationManager
from socorro.external.elasticsearch import crashstora... | bsmedberg/socorro | socorro/unittest/external/elasticsearch/unittestbase.py | Python | mpl-2.0 | 1,754 |
def get (request, query):
import badge
import archived
from ..issuers.library.badges import library
from ..issuers.library.programs.mit.badges import scratch
badges = [
badge.get(request, query)['badge'],
archived.get(request, query)['badge'],
library.get(request, query)['ba... | mozilla/badgekit-api-python-client | test/fixtures/systems/chicago/badges/__init__.py | Python | mpl-2.0 | 2,435 |
# Generated by Django 3.2.5 on 2021-08-17 19:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fares', '0003_auto_20210602_1534'),
]
operations = [
migrations.AlterField(
model_name='tariff',
name='access_zones'... | jclgoodwin/bustimes.org.uk | fares/migrations/0004_alter_tariff_access_zones.py | Python | mpl-2.0 | 414 |
from unittest import TestCase
import neuropsydia as n
n.start(open_window=False)
class TestColor(TestCase):
def test_is_string(self):
c = n.color("w")
self.assertTrue(isinstance(c, tuple)) | neuropsychology/Neuropsydia.py | neuropsydia/tests/test_color.py | Python | mpl-2.0 | 210 |
# encoding: utf-8
#
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import
from _... | klahnakoski/MySQL-to-S3 | vendor/mo_logs/log_usingThreadedStream.py | Python | mpl-2.0 | 3,886 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-25 21:58
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0004_auto_20170716_0901'),
]
operations = [
migrations.RemoveField(... | shmish/core-assess | core/migrations/0005_auto_20170725_1458.py | Python | mpl-2.0 | 556 |
#!/usr/bin/python
# This file is part of Espruino, a JavaScript interpreter for Microcontrollers
#
# Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk>
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain on... | 0xPIT/Espruino | scripts/build_board_docs.py | Python | mpl-2.0 | 13,737 |
NOT_GIT_REPO_MSG = "#{red}Not a git repository (or any of the parent directories)"
HOOK_ALREADY_INSTALLED_MSG = "The pre-commit hook has already been installed."
EXISTING_HOOK_MSG = (
"#{yellow}There is an existing pre-commit hook.\n"
"#{reset_all}Therapist can preserve this legacy hook and run it before the ... | rehandalal/therapist | therapist/messages.py | Python | mpl-2.0 | 2,098 |
from astrodata.ReductionObjects import PrimitiveSet
class OBSERVEDPrimitives(PrimitiveSet):
astrotype = "OBSERVED"
def init(self, rc):
print "OBSERVEDPrimitives.init(rc)"
return
def typeSpecificPrimitive(self, rc):
print "OBSERVEDPrimitives::typeSpecificPrimitive()"
... | pyrrho314/recipesystem | trunk/astrodata/samples/astrodata_Sample/RECIPES_Sample/primitives/primitives_OBSERVED.py | Python | mpl-2.0 | 968 |
import openerp.tests
inject = [
"./../../../website/static/src/js/website.tour.test.js",
"./../../../website_event_sale/static/src/js/website.tour.event_sale.js",
]
class TestUi(openerp.tests.HttpCase):
def test_admin(self):
self.phantom_js("/", "openerp.website.Tour.run_test('banner')", "openerp.... | ttfseiko/openerp-trunk | openerp/addons/website_event_sale/tests/test_ui.py | Python | agpl-3.0 | 665 |
import gc
import os
import hashlib
import inspect
import shutil
import tempfile
import yaml
import zipfile
from juju.errors import CharmError, FileNotFound
from juju.charm.errors import InvalidCharmFile
from juju.charm.metadata import MetaData
from juju.charm.directory import CharmDirectory
from juju.charm.bundle impo... | anbangr/trusted-juju | juju/charm/tests/test_directory.py | Python | agpl-3.0 | 8,532 |
#!/usr/bin/env python3
"""
echo_cmdline_client.py
Copyright (c) 2018-2019 Alan Yorinks All right reserved.
Python Banyan is free software; you can redistribute it and/or
modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
Version 3 as published by the Free Software Foundation; either
or (at your ... | MrYsLab/python_banyan | examples/echo_cmdline_client.py | Python | agpl-3.0 | 7,036 |
#!/usr/bin/env python2.6
# This file is part of VoltDB.
# Copyright (C) 2008-2018 VoltDB Inc.
#
# This file contains original code and/or modifications of original code.
# Any modifications made by VoltDB Inc. are licensed under the following
# terms and conditions:
#
# Permission is hereby granted, free of charge, to... | simonzhangsm/voltdb | tools/vmc_stats_emulator.py | Python | agpl-3.0 | 4,874 |
#!/usr/bin/python2
#
# Copyright 2016 ScyllaDB
#
#
# This file is part of Scylla.
#
# Scylla is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | duarten/scylla | dist/common/scripts/scylla_config_get.py | Python | agpl-3.0 | 1,682 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | xrg/openerp-server | bin/tools/amount_to_text.py | Python | agpl-3.0 | 7,774 |
from django.core.validators import validate_email
from django import forms
from captcha.fields import ReCaptchaField
from .models import ContactUs
class CreateContact(forms.ModelForm):
captcha = ReCaptchaField()
class Meta:
model = ContactUs
fields = '__all__'
widgets = {
... | emanuelcovaci/TLT | blog/contact/forms.py | Python | agpl-3.0 | 1,487 |
# -*- coding: utf-8 -*-
import controllers
#import models
| optima-ict/odoo | addons/professional_templates/controllers/__init__.py | Python | agpl-3.0 | 58 |
#! /usr/bin/env python
"""
Author: Gary Foreman
Created: August 6, 2016
This script scrapes thumbnail images from thread links in the For Sale: Bass
Guitars forum at talkbass.com
"""
from __future__ import print_function
from glob import glob
import os
import sys
import urllib
from PIL import Image, ImageOps
import p... | garyForeman/LHBassClassifier | image_scrape/get_thumbnails.py | Python | agpl-3.0 | 3,278 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('website', '0016_auto_20151128_2006'),
]
operations = [
migrations.CreateModel(
name='Comment',
field... | atuljain/coderbounty | website/migrations/0017_comment.py | Python | agpl-3.0 | 819 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Odoo Addon, Open Source Management Solution
# Copyright (C) 2014-now Equitania Software GmbH(<http://www.equitania.de>).
#
# This program is free software: you can redistribute it and/or modify
# it un... | equitania/myodoo-addons-v10 | eq_stock/models/eq_report_stock.py | Python | agpl-3.0 | 3,096 |
# -*- coding: utf-8 -*-
# © 2012-2016 Therp BV <http://therp.nl>
# © 2013 Agile Business Group sagl <http://www.agilebg.com>
# <lorenzo.battistini@agilebg.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Accounting Financial Report Horizontal",
"version": "10.0.1.0.0",
"a... | luc-demeyer/account-financial-reporting | account_financial_report_horizontal/__manifest__.py | Python | agpl-3.0 | 701 |
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import models, fields, api
from openerp import tools
class LapKbMutasiCommon(models.AbstractModel):
_name = "l10n_id.djbc_kb_lap_mutasi_common"
_description = "Common Mo... | open-synergy/opnsynid-l10n-indonesia | l10n_id_djbc_kb_lap_common/reports/lap_kb_mutasi_common.py | Python | agpl-3.0 | 8,054 |
from . import manager
def warm_up_redis_func(app=None, db=None, user_model=None, redis_store=None):
not_available = set()
available = set()
cur = db.session.connection().connection.cursor()
cur.execute("""
SELECT taxi.id AS taxi_id, vd.status, vd.added_by FROM taxi
LEFT OUTER JOIN vehicle ON veh... | l-vincent-l/APITaxi | APITaxi/commands/warm_up_redis.py | Python | agpl-3.0 | 1,795 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2015 Serpent Consulting Services Pvt. Ltd. (<http://www.serpentcs.com>)
# Copyright (C) 2016 FairCoop (<http://fair.coop>)
#
# This program is f... | Punto0/addons-fm | website_product_brand/__openerp__.py | Python | agpl-3.0 | 1,807 |
#!/usr/bin/env python
# This file is part of VoltDB.
# Copyright (C) 2008-2016 VoltDB Inc.
#
# 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 limitati... | paulmartel/voltdb | tests/bench/throughput/run.py | Python | agpl-3.0 | 1,927 |
# Generated by Django 2.2.14 on 2020-09-03 02:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('enterprise', '0109_remove_use_enterprise_catalog_sample'),
]
operations = [
migrations.AddField(
model_name='enterprisecustomer... | edx/edx-enterprise | enterprise/migrations/0110_add_default_contract_discount.py | Python | agpl-3.0 | 1,163 |
from . import geodis
from . import geodis_common_ws
from . import geodis_api_ws
from . import geodis_api_find_localite_ws
from . import geodis_api_edi
from . import geodis_api_rest_ws
from . import geodis_encoder_ws
from . import geodis_encoder_edi
from . import geodis_encoder_rest_ws
from . import geodis_decoder_ws
fr... | akretion/roulier | roulier/carriers/geodis/__init__.py | Python | agpl-3.0 | 463 |
# -*- coding: utf-8 -*-
# Akvo RSR is covered by the GNU Affero General Public License.
# See more details in the license.txt file located at the root folder of the Akvo RSR module.
# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >.
import logging
from typing import Type
... | akvo/akvo-rsr | akvo/rsr/models/partnership.py | Python | agpl-3.0 | 11,614 |
# Generated by Django 2.0.8 on 2018-10-05 19:45
from django.db import migrations
from django.core.exceptions import ObjectDoesNotExist
def cria_sistema_cultura(apps, schema_editor):
erros = []
SistemaCultura = apps.get_model('adesao', 'SistemaCultura')
Municipio = apps.get_model('adesao', 'Municipio')
... | culturagovbr/sistema-nacional-cultura | adesao/migrations/0019_auto_20181005_1645.py | Python | agpl-3.0 | 8,604 |
# -*- coding: utf-8 -*-
from ast import literal_eval
from odoo import models, fields, api
class SaleOrderLine(models.Model):
_inherit = 'sale.order.line'
config_ok = fields.Boolean(
related='product_id.config_ok',
string="Configurable",
readonly=True
)
@api.multi
def re... | microcom/odoo-product-configurator | product_configurator_wizard/models/sale.py | Python | agpl-3.0 | 1,538 |
from . import test_account_invoice_validate_tax
| oihane/odoo-addons | account_invoice_validate_tax/tests/__init__.py | Python | agpl-3.0 | 48 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Post-installation configuration helpers
# Copyright (C) 2015 OpusVL (<http://opusvl.com/>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General P... | OpusVL/odoo-confutil | confutil/account_setup.py | Python | agpl-3.0 | 4,594 |