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/env nix-shell
#!nix-shell --pure -i python3 -p "python3.withPackages (ps: with ps; [ requests ])"
import json
import re
import requests
import sys
releases = ["openjdk11"]
oses = ["mac", "linux"]
types = ["jre", "jdk"]
impls = ["hotspot", "openj9"]
arch_to_nixos = {
"x64": "x86_64",
"aarch64": "aa... | SymbiFlow/nixpkgs | pkgs/development/compilers/adoptopenjdk-bin/generate-sources.py | Python | mit | 2,081 |
"""
<Program>
mocklib.py
<Author>
Justin Samuel
<Date Started>
Aug 10, 2009
<Purpose>
This provides functions that take care of mocking out (read: monkey
patching) various parts of seattlegeni's internal api, including calls to:
nodemanager.get_node_info
lockserver.create_lockserver_handle
... | SensibilityTestbed/clearinghouse | tests/mocklib.py | Python | mit | 4,074 |
from actstream.models import Follow, Like
from django.template import Library
register = Library()
def is_following(user, actor):
"""
retorna True si el usuario esta siguiendo al actor
::
{% if request.user|is_following:another_user %}
You are already following {{ another_user }}
... | LagunaJS/Midori | Feed/templatetags/activity_tags.py | Python | mit | 517 |
import argparse
import collections
import inspect
import json
import logging
import multiprocessing as mp
import numpy as np
import re
import sys
import zipfile
from datetime import datetime, timedelta
from os import path, listdir, environ, getpid
from textwrap import wrap
PARALLEL_PROCESS_NUM = mp.cpu_count()
TIMESTA... | kengz/openai_lab | rl/util.py | Python | mit | 16,973 |
def subleq(a, b, c):
instr = "%s %s %s" % (a,b,c);
return instr;
def next_subleq(a,b):
return subleq(a,b,"NEXT");
def clear(a):
return subleq(a,a,"NEXT"); | purisc-group/purisc | compiler/class_def/conversions/helpers.py | Python | gpl-2.0 | 168 |
'''<b>Conserve Memory</b> speeds up CellProfiler by removing images from memory.
<hr>
This module removes images from memory, which can speed up processing and
prevent out-of-memory errors.
<i>Note:</i> CellProfiler 1.0's <b>SpeedUpCellProfiler</b> had an option that let you
choose how often the output file of measu... | LeeKamentsky/CellProfiler | cellprofiler/modules/conservememory.py | Python | gpl-2.0 | 5,810 |
from run import run_base
class run_names(run_base):
# Verify behavior when multiple --name options passed
def init_subargs(self):
cont = self.sub_stuff["cont"]
name_base = cont.get_unique_name()
names = []
for number in xrange(self.config['names_count']):
name = ('... | afomm/autotest-docker | subtests/docker_cli/run/run_names.py | Python | gpl-2.0 | 1,479 |
import os
from unittest import TestCase, skipIf
from zabbix.api import ZabbixAPI
from pyzabbix import ZabbixAPIException
@skipIf('TRAVIS' not in os.environ.keys(), "Travis CI test")
class FunctionalAPI(TestCase):
def test_LoginToServer(self):
try:
ZabbixAPI(url='http://127.0.0.1',
... | blacked/py-zabbix | tests/test_Functional_API_Old.py | Python | gpl-2.0 | 469 |
from enigma import getPrevAsciiCode
from Tools.NumericalTextInput import NumericalTextInput
from Tools.Directories import resolveFilename, SCOPE_CONFIG, fileExists
from Components.Harddisk import harddiskmanager
from copy import copy as copy_copy
from os import path as os_path
from time import localtime, strftime
# Co... | Open-Plus/opgui | lib/python/Components/config.py | Python | gpl-2.0 | 57,531 |
# -*- coding: utf-8 -*-
"""
Calculate a position from an IP or Address and save it into a file.
Usage:
geolocation.py [(-v | --verbose)] [--no-wait] (-m | --me)
geolocation.py [(-v | --verbose)] (-a | --address) [(-r | --remove)] [(-p | --previous-city)] <address>
geolocation.py [(-v | --verbose)] (-s | --symli... | humitos/argentinaenpython.com | web/geolocation.py | Python | gpl-2.0 | 8,271 |
#!/usr/bin/env python3.7
import asyncio
import iterm2
# This script was created with the "basic" environment which does not support adding dependencies
# with pip.
async def main(connection):
# This is an example of using an asyncio context manager to register a custom control
# sequence. You can send a custo... | lgouger/iTerm2 | sources/template_basic_daemon.py | Python | gpl-2.0 | 864 |
#!/bin/python
import xbmcgui,xbmc,os,sys
xbmc.executebuiltin('XBMC.RunPlugin(plugin://plugin.video.iptvxtra-de/?zapsidemenu)') | noba3/KoTos | addons/plugin.video.streamnetwork/resources/lib/zapsidemenu.py | Python | gpl-2.0 | 126 |
# This file is part of Buildbot. Buildbot 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 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | mitya57/debian-buildbot | buildbot/status/web/auth.py | Python | gpl-2.0 | 7,563 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2013, 2014 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your opt... | PXke/invenio | invenio/modules/communities/forms.py | Python | gpl-2.0 | 4,175 |
# Base folder support
# Copyright (C) 2002 John Goerzen
# <jgoerzen@complete.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 2 of the License, or
# (at your opt... | brong/brong-offlineimap | offlineimap/folder/Base.py | Python | gpl-2.0 | 15,637 |
#!/bin/python
# -*- coding: utf-8 -*-
# Author: Pavel Studenik
# Email: pstudeni@redhat.com
# Date: 24.9.2013
import json
import logging
import os
import re
from django.utils import timezone
from datetime import datetime, timedelta
from urlparse import urlparse
from xml.dom.minidom import parseString
import git
from... | SatelliteQE/GreenTea | apps/core/models.py | Python | gpl-2.0 | 55,908 |
import os
from pkg_resources import resource_filename
def get_fn(name):
"""Get the full path to one of the reference files shipped for testing
In the source distribution, these files are in ``thermopyl/data``,
but on installation, they're moved to somewhere in the user's python
site-packages directory... | choderalab/ThermoPyL | thermopyl/utils.py | Python | gpl-2.0 | 3,405 |
#!/usr/bin/python
import spimage
import pylab
# Read input image
img = spimage.sp_image_read('../ring/raw_ring.h5',0)
# Convolute with a 2 pixel
# standard deviation gaussian
img_blur = spimage.sp_gaussian_blur(img,2.0)
rel_diff = abs((pylab.real(img_blur.image)-
pylab.real(img.image))
/p... | FilipeMaia/hawk | examples/python/plot_pattern_roughness.py | Python | gpl-2.0 | 448 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2017-2018 Nick Hall
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) a... | prculley/gramps | gramps/gen/plug/docgen/treedoc.py | Python | gpl-2.0 | 24,461 |
from Screen import Screen
from Screens.HelpMenu import HelpableScreen
from Screens.MessageBox import MessageBox
from Components.InputDevice import iInputDevices, iRcTypeControl
from Components.Sources.StaticText import StaticText
from Components.Sources.List import List
from Components.config import config, ConfigYesNo... | vitmod/dvbapp | lib/python/Screens/InputDeviceSetup.py | Python | gpl-2.0 | 16,079 |
import gzip
import os
import sys
import pickle as pkl
import numpy as np
from scipy.sparse import csr_matrix, csc_matrix
if __name__ == '__main__':
if len(sys.argv) != 3:
print('Usage:', sys.argv[0], 'DIR1 DIR2')
sys.exit(0)
dir1 = sys.argv[1]
dir2 = sys.argv[2]
print('checking songs ...')
son... | chengsoonong/digbeta | dchen/music/src/check_equal_s4.py | Python | gpl-3.0 | 2,368 |
from ase import *
a = 4.0 # approximate lattice constant
b = a / 2
ag = Atoms('Ag',
cell=[(0,b,b), (b,0,b), (b,b,0)],
pbc=1,
calculator=EMT()) # use EMT potential
cell = ag.get_cell()
traj = PickleTrajectory('Ag.traj', 'w')
for x in np.linspace(0.95, 1.05, 5):
ag.set_cell(cell * ... | freephys/python_ase | doc/tutorials/eos/eos1.py | Python | gpl-3.0 | 360 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This file is part of NSUChat2.
#
# Copyright (©) 2014 Marcel Ribeiro Dantas
#
# <mribeirodantas at fedoraproject.org>
#
# NSUChat2 is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as
# published by the Free Softw... | mribeirodantas/nsuchat2 | __init__.py | Python | gpl-3.0 | 794 |
"""Add PersonalDataType.position
Revision ID: 98f411f40bb
Revises: 468343faea20
Create Date: 2015-11-05 16:02:43.260085
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = '98f411f40bb'
down_revision = '468343faea20'
def upgrade():
op.drop_constraint('ck_form_items_valid_enum_person... | belokop/indico_bare | migrations/versions/201511051602_98f411f40bb_add_personaldatatype_position.py | Python | gpl-3.0 | 991 |
'''
Created on 2013 mai 24
@author: peio
'''
import subprocess
import os
from tempfile import NamedTemporaryFile
from Bio import SeqIO
from Bio.Seq import Seq
class IsIndelError(Exception):
pass
class OutsideAlignment(Exception):
pass
class BetweenSegments(Exception):
pass
class SeqCoords(object):... | JoseBlanca/vcf_crumbs | vcf_crumbs/prot_change.py | Python | gpl-3.0 | 10,257 |
from otree.api import Currency as c, currency_range
from . import pages
from ._builtin import Bot
from .models import Constants
from random import randint
import time
class PlayerBot(Bot):
def play_round(self):
yield (pages.Bienvenue_Page)
yield (pages.ID_Etudiant_Page,
{'id_etudia... | anthropo-lab/XP | EPHEMER/EDHEC_Project/connect_and_filter_en/tests.py | Python | gpl-3.0 | 359 |
#Copyright 2013 Paul Barton
#
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#
#This program is distributed in the hope tha... | audiossis/RemoteKbM | Files/PyUserInput/pykeyboard/x11.py | Python | gpl-3.0 | 22,679 |
import theano
import theano.tensor as T
## common activation functions
sigmoid = T.nnet.sigmoid
def softmax(x):
# expected input dimensions:
# 0 = minibatches
# 1 = units
# 2 = states
r = x.reshape((x.shape[0]*x.shape[1], x.shape[2]))
# r 0 = minibatches * units
# r 1 = states
... | benanne/morb | morb/activation_functions.py | Python | gpl-3.0 | 1,031 |
from gchecky.controller import ControllerLevel_1, Controller
from gchecky import model as gmodel
from django.conf import settings
class GController(Controller):
def __init__(self, automatically_charge = False, *args, **kwargs):
self.automatically_charge = automatically_charge
return super(GControll... | BlessedEj/objets-d-art | store/checkout.py | Python | gpl-3.0 | 3,341 |
# shipMiningBonusOREfrig1
#
# Used by:
# Variations of ship: Venture (3 of 3)
type = "passive"
def handler(fit, module, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining"),
"miningAmount", module.getModifiedItemAttr("shipBonusOREfrig1"),
... | Ebag333/Pyfa | eos/effects/shipminingbonusorefrig1.py | Python | gpl-3.0 | 369 |
# -*- coding: utf-8 -*-
# #START_LICENSE###########################################################
#
#
# This file is part of the Environment for Tree Exploration program
# (ETE). http://ete.cgenomics.org
#
# ETE is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public ... | zhangjiajie/tax_benchmark | script/ete2/treeview/_about.py | Python | gpl-3.0 | 4,290 |
[10, [0, 2, 172, 14, 8, 9, 10]] # 10 u'\n' 10
[32, [0, 2, 96, 14, 8, 250, 248]] # 32 u' ' 32
[33, [0, 2, 14, 108, 1, 20, 2, 20, 1, 68, 2, 32, 108, 14, 8, 254, 253]] # 33 u'!' 33
[34, [0, 2, 14, 8, 255, 250, 68, 1, 35, 2, 16, 1, 43, 2, 76, 48, 14, 8, 253, 1]] # 34 u'"' 34
[35, [0, 2, 14, 8, 254, 250, 36, 1, 64, 2, 3... | zecruel/dxf_le | mini_cad/fonte_padrao.py | Python | gpl-3.0 | 34,230 |
"""Colorful worry-free console applications for Linux, Mac OS X, and Windows.
Supported natively on Linux and Mac OSX (Just Works), and on Windows it works the same if Windows.enable() is called.
Gives you expected and sane results from methods like len() and .capitalize().
https://github.com/Robpol86/colorclass
htt... | hkff/AccLab | pyAAL/tools/color.py | Python | gpl-3.0 | 31,055 |
#This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
from trytond.model.fields.field import Field
from trytond.transaction import Transaction
class Binary(Field):
'''
Define a binary field (``str``).
'''
_type = ... | mediafactory/tryton_core_daemon | trytond/model/fields/binary.py | Python | gpl-3.0 | 1,971 |
# Author: echel0n <echel0n@sickrage.ca>
# URL: https://sickrage.ca
#
# This file is part of SickRage.
#
# SickRage 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... | SiCKRAGETV/SickRage | sickrage/core/searchers/backlog_searcher.py | Python | gpl-3.0 | 6,370 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2018 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',
... | hkariti/ansible | lib/ansible/modules/network/edgeos/edgeos_facts.py | Python | gpl-3.0 | 8,335 |
#
# Copyright (C) 2012 Uninett AS
#
# This file is part of Network Administration Visualized (NAV).
#
# NAV 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... | hmpf/nav | python/nav/web/macwatch/utils.py | Python | gpl-3.0 | 1,854 |
# -*- test-case-name: twisted.python.test.test_util -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from __future__ import division, absolute_import, print_function
import os, sys, errno, warnings
try:
import pwd, grp
except ImportError:
pwd = grp = None
try:
from os import set... | Architektor/PySnip | venv/lib/python2.7/site-packages/twisted/python/util.py | Python | gpl-3.0 | 28,267 |
from django.apps import AppConfig
from django.contrib.admin.apps import AdminConfig
class AircoxConfig(AppConfig):
name = 'aircox'
verbose_name = 'Aircox'
class AircoxAdminConfig(AdminConfig):
default_site = 'aircox.admin_site.AdminSite'
| lordblackfox/aircox | aircox/apps.py | Python | gpl-3.0 | 256 |
# telepathy-mixer - a MXit connection manager for Telepathy
#
# Copyright (C) 2008 Ralf Kistner <ralf.kistner@gmail.com>
#
# Adapted from telepathy-butterfly,
# Copyright (C) 2006-2007 Ali Sabil <ali.sabil@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the... | detrout/telepathy-mixer | mixer/connection_manager.py | Python | gpl-3.0 | 3,436 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2015 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | larryhynes/qutebrowser | qutebrowser/mainwindow/tabbedbrowser.py | Python | gpl-3.0 | 22,640 |
# -*- coding: utf-8 -*-
from __future__ import with_statement
from cms.tests.menu_page_viewperm import ViewPermissionTests
from django.contrib.auth.models import User
class ViewPermissionComplexMenuStaffNodeTests(ViewPermissionTests):
"""
Test CMS_PUBLIC_FOR=staff group access and menu nodes rendering
... | hzlf/openbroadcast | website/cms/tests/menu_page_viewperm_staff.py | Python | gpl-3.0 | 16,554 |
from openanalysis.string_matching import StringMatchingAlgorithm, StringMatchingAnalyzer
class BruteForceMatch(StringMatchingAlgorithm):
"""
Class to implement Brute Force String Matching Algorithm
"""
def __init__(self):
StringMatchingAlgorithm.__init__(self, "Brute Force String Matching")
... | OpenWeavers/openanalysis | analysistest/string_matching.py | Python | gpl-3.0 | 4,632 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import cstr, cint
from frappe.contacts.d... | mbauskar/erpnext | erpnext/accounts/doctype/tax_rule/tax_rule.py | Python | gpl-3.0 | 6,495 |
__kupfer_name__ = _("Search the Web")
__kupfer_sources__ = ("OpenSearchSource", )
__kupfer_text_sources__ = ()
__kupfer_actions__ = (
"SearchFor",
"SearchWithEngine",
)
__description__ = _("Search the web with OpenSearch search engines")
__version__ = "2020-04-19"
__author__ = "Ulrik Sverdrup <ulrik... | kupferlauncher/kupfer | kupfer/plugin/websearch.py | Python | gpl-3.0 | 8,532 |
#
# Copyright 2009 Eigenlabs Ltd. http://www.eigenlabs.com
#
# This file is part of EigenD.
#
# EigenD is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) a... | barnone/EigenD | plg_synth/rectangle_oscillator_plg.py | Python | gpl-3.0 | 1,915 |
# -*- coding: utf-8 -*-
"""Tests for various magic functions.
Needs to be run by nose (to make ipython session available).
"""
from __future__ import absolute_import
#-----------------------------------------------------------------------------
# Imports
#--------------------------------------------------------------... | alephu5/Soundbyte | environment/lib/python3.3/site-packages/IPython/core/tests/test_magic.py | Python | gpl-3.0 | 27,805 |
#!/usr/bin/env python
# coding: utf-8
# Copyright 2011 Álvaro Justen
# 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... | turicas/outputty | tests/test_Table_text.py | Python | gpl-3.0 | 2,601 |
# -*- coding: utf-8 -*-
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
# import frappe
from frappe.model.document import Document
class EInvoiceUser(Document):
pass
| frappe/erpnext | erpnext/regional/doctype/e_invoice_user/e_invoice_user.py | Python | gpl-3.0 | 241 |
#
# Copyright © 2012–2022 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, either version 3 of the Licens... | nijel/weblate | weblate/checks/tests/test_render_checks.py | Python | gpl-3.0 | 2,761 |
# Copyright (C) 2012-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/commands/tests/test_help.py | Python | gpl-3.0 | 2,367 |
#!/usr/bin/env python3
'''
TYPE 1 - BEST. Has all of the following characteristics:
1. GM-ES prediction identical to a CEGMA prediction.
2. Identical to an AAT alignment of at least one C. muris or C. parvum homologue.
3. Intron-exon boundaries of model supported by assembled transcripts, with start
... | zctea/biocode | sandbox/jorvis/custom.classify_mucor_tier3_genes.py | Python | gpl-3.0 | 6,864 |
#!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os, sh... | jelly/calibre | src/calibre/ebooks/metadata/worker.py | Python | gpl-3.0 | 3,102 |
#-*- coding: utf-8 -*-
#
#copyright 2010 Dominik "Socek" Długajczyk
#
#This file is part of Gadu History.
#
#Gadu History is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 2 of the License, or
#(at ... | porridge/gaduhistory | lib/gui/base.py | Python | gpl-3.0 | 3,927 |
'''
Small class to handle a single body. The notation follows
loosely the paper Brownian dynamics of confined rigid
bodies, Steven Delong et al. The Journal of Chemical
Physics 143, 144107 (2015). doi: 10.1063/1.4932062
'''
import numpy as np
import copy
from quaternion_integrator.quaternion import Quaternion
import ... | stochasticHydroTools/RigidMultiblobsWall | body/body.py | Python | gpl-3.0 | 6,853 |
# -*- encoding: utf-8 -*-
from abjad import *
def test_timespantools_Timespan_stops_at_or_after_offset_01():
timespan = timespantools.Timespan(0, 10)
offset = durationtools.Offset(-5)
assert timespan.stops_at_or_after_offset(offset)
def test_timespantools_Timespan_stops_at_or_after_offset_02():
times... | mscuthbert/abjad | abjad/tools/timespantools/test/test_timespantools_Timespan_stops_at_or_after_offset.py | Python | gpl-3.0 | 1,048 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Getting Things GNOME! - a personal organizer for the GNOME desktop
# Copyright (c) 2008-2013 - Lionel Dricot & Bertrand Rousseau
#
# This program is free software: you can redistribute it and... | partp/gtg-services | GTG/info.py | Python | gpl-3.0 | 11,510 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division, unicode_literals
##
## This file is part of MoaT, the Master of all Things.
##
## MoaT is Copyright © 2007-2016 by Matthias Urlichs <matthias@urlichs.de>,
## it is licensed under the GPLv3. See the file `README.rst` for details... | smurfix/MoaT | moat/cmd/dummy.py | Python | gpl-3.0 | 1,858 |
#!/usr/bin/env python2
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
import httplib, zlib, json, binascii, time, os
from io import BytesIO
from ... | jelly/calibre | src/calibre/srv/tests/content.py | Python | gpl-3.0 | 9,684 |
"""
WSGI config for osmcha-django project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICAT... | batpad/osmcha-django | config/wsgi.py | Python | gpl-3.0 | 1,452 |
"""
Copyright 2014-2021 Vincent Texier <vit@free.fr>
DuniterPy 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.
DuniterPy is distributed in... | ucoin-io/ucoin-python-api | examples/request_data_async.py | Python | gpl-3.0 | 2,394 |
# -*- coding: utf-8 -*-
class Charset:
common_name = u'Danish Accents'
native_name = u'Danske Accenter'
key = ord(u'å')
abbreviation = 'DANA'
danishAccents = u"æøåÆØÅ"
glyphs = map(ord, danishAccents)
| davelab6/pyfontaine | fontaine/charsets/internals/danish-accents.py | Python | gpl-3.0 | 232 |
class Tank:
def __init__(self, leftMotor, rightMotor):
self._leftMotor = leftMotor
self._rightMotor = rightMotor
def off(self, brake):
self._leftMotor.off(brake = brake)
self._rightMotor.off(brake = brake)
def on(self, leftPower, rightPower):
self._leftMotor.on(power = leftPower)
self._rightMotor.on(po... | LE-GO-LE-STOP/Robocup-Junior-Rescue-2016 | src/python/ev3/controllers.py | Python | gpl-3.0 | 1,072 |
# -*- coding: utf-8 -*-
##
##
## This file is part of Indico.
## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN).
##
## Indico 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... | Ictp/indico | indico/ext/livesync/blueprint.py | Python | gpl-3.0 | 1,186 |
# -*- coding: utf-8 -*-
# Natural Language Toolkit: Interface to the TreeTagger POS-tagger
#
# Copyright (C) Mirko Otto
# Author: Mirko Otto <dropsy@gmail.com>
"""
A Python module for interfacing with the Treetagger by Helmut Schmid.
"""
import os
from subprocess import Popen, PIPE
from nltk.internals import find_bi... | metzzo/Paraphrase_Identification | treetagger.py | Python | gpl-3.0 | 6,201 |
import os
import time
import sys
import subprocess
import urllib.request
import pyfastaq
class Error (Exception): pass
def syscall(cmd, allow_fail=False, verbose=False, verbose_filehandle=sys.stdout, print_errors=True, shell=True):
if verbose:
print('syscall:', cmd, flush=True, file=verbose_filehandle)
... | sanger-pathogens/ariba | ariba/common.py | Python | gpl-3.0 | 2,380 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-11-02 22:06
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0008_remove_vendeur_code_carte_etudiante'),
]
operations = [
migrati... | Scriptodude/EnceFAL | django/main/migrations/0009_vendeur_code_carte_etudiante.py | Python | gpl-3.0 | 581 |
#!/usr/bin/env python
# flake8: noqa
import os
import json
import yaml
from nose.tools import *
from linchpin.InventoryFilters import BeakerInventory
def setup_beaker_inventory_filter():
global filter
global topo
filter = BeakerInventory.BeakerInventory()
provider = 'general'
base_path = ... | herlo/linchpin | linchpin/tests/InventoryFilters/test_BeakerInventory_pass.py | Python | gpl-3.0 | 2,306 |
import mock
import os
import shutil
import sys
from stetl.etl import ETL
from stetl.outputs.execoutput import Ogr2OgrExecOutput
from tests.stetl_test_case import StetlTestCase
class Ogr2OgrExecOutputTest(StetlTestCase):
"""Unit tests for Ogr2OgrExecOutput"""
def setUp(self):
super(Ogr2OgrExecOutputTe... | fsteggink/stetl | tests/outputs/test_ogr2ogr_exec_output.py | Python | gpl-3.0 | 7,744 |
"""Tests for qutebrowser.keyinput."""
| mnick/qutebrowser | qutebrowser/test/keyinput/__init__.py | Python | gpl-3.0 | 38 |
# -*- 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):
# Adding model 'BlockedEmail'
db.create_table(u'news_blockedemail', (
(u'id', self.gf('django.db... | meandavejustice/basket | news/migrations/0013_auto__add_blockedemail.py | Python | mpl-2.0 | 6,001 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-09-27 02:16
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('api', '0002_auto_20170921_2137'),
]
operations = [
migrations.AlterUniqueTogether(
... | StanfordBioinformatics/loom | server/loomengine_server/api/migrations/0003_auto_20170927_0216.py | Python | agpl-3.0 | 702 |
# Generated by Django 1.11.14 on 2018-07-23 15:12
import django
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
if django.VERSION >= (2, 0):
dot_migration = '0001_initial'
else:
dot_migration = '0006_auto_20171214_2232'
class Migration(migrations.M... | eduNEXT/edunext-platform | openedx/core/djangoapps/oauth_dispatch/migrations/0007_restore_application_id_constraints.py | Python | agpl-3.0 | 1,304 |
# -*- coding: utf-8 -*-
"""
# primary URL: http://feeds.dshield.org/block.txt
# PGP Sign.: http://feeds.dshield.org/block.txt.asc
#
# updated: Tue Dec 15 15:33:38 2015 UTC
#
# This list summarizes the top 20 attacking class C (/24) subnets
# over the last three days. The number of 'attacks' indicates the
... | robcza/intelmq | intelmq/bots/parsers/dshield/parser_block.py | Python | agpl-3.0 | 2,308 |
"""EdX Branding API
Provides a way to retrieve "branded" parts of the site,
such as the site footer.
This information exposed to:
1) Templates in the LMS.
2) Consumers of the branding API.
This ensures that branded UI elements such as the footer
are consistent across the LMS and other sites (such as
the marketing si... | shubhdev/openedx | lms/djangoapps/branding/api.py | Python | agpl-3.0 | 8,875 |
#!/usr/bin/env python3
# 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 the License, or
# (at your option) any later version.
#
# This program is distributed in the ho... | scylladb/scylla-cluster-tests | sdcm/microbenchmarking.py | Python | agpl-3.0 | 25,144 |
import os
import struct
import tempfile
from django.contrib.gis.gdal import GDAL_VERSION, GDALRaster
from django.contrib.gis.gdal.error import GDALException
from django.contrib.gis.gdal.raster.band import GDALBand
from django.contrib.gis.shortcuts import numpy
from django.test import SimpleTestCase
from ..data.raster... | nesdis/djongo | tests/django_tests/tests/v21/tests/gis_tests/gdal_tests/test_raster.py | Python | agpl-3.0 | 28,256 |
#!/usr/bin/python3
# $Id: rst2pseudoxml.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
A minimal front end to the Docutils Publisher, producing pseudo-XML.
"""
try:
import locale
locale.setlocale(locale.LC... | superdesk/Live-Blog | documentor/libraries/docutils-0.9.1-py3.2/EGG-INFO/scripts/rst2pseudoxml.py | Python | agpl-3.0 | 601 |
import urllib2
import urllib
import sys
import os
import re
def writeLog(msg):
global log
log += msg + '\r\n'
print msg
# log http redirects
class MyHTTPRedirectHandler(urllib2.HTTPRedirectHandler):
def http_error_302(self, req, fp, code, msg, headers):
newurl = None
if 'location' in headers:
newurl = hea... | jessp01/play-server | poc/utils/debug/debugStream.py | Python | agpl-3.0 | 4,577 |
# -*- coding: utf-8 -*-
# Copyright 2021 FactorLibre - Rodrigo Bonilla <rodrigo.bonilla@factorlibre.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import test_l10n_es_aeat_sii
| JuanjoA/l10n-spain | l10n_es_aeat_sii_oss/tests/__init__.py | Python | agpl-3.0 | 206 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import crm_partner_binding
import crm_lead_to_opportunity
import crm_merge_opportunities
| tvtsoft/odoo8 | addons/crm/wizard/__init__.py | Python | agpl-3.0 | 189 |
# This file is part of wger Workout Manager.
#
# wger Workout Manager 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 later version.
#
# wger W... | DeveloperMal/wger | wger/weight/tests/test_csv_import.py | Python | agpl-3.0 | 2,631 |
__author__ = 'Cosmo Harrigan'
from flask import Flask, request
from flask_restful import Api
from flask_cors import CORS
from apiatomcollection import *
from apitypes import *
from apishell import *
from apischeme import *
from apighost import *
from flask_restful_swagger import swagger
class RESTAPI(object):
""... | misgeatgit/opencog | opencog/python/web/api/apimain.py | Python | agpl-3.0 | 3,098 |
# Generated by Django 2.2.5 on 2020-01-09 16:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('salesforce', '0030_auto_20191220_1353'),
]
operations = [
migrations.AddField(
model_name='partner',
name='image_1',... | Connexions/openstax-cms | salesforce/migrations/0031_auto_20200109_1048.py | Python | agpl-3.0 | 979 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Matio(AutotoolsPackage):
"""matio is an C library for reading and writing Matlab MAT files... | iulian787/spack | var/spack/repos/builtin/packages/matio/package.py | Python | lgpl-2.1 | 3,139 |
# This file is part of the GOsa framework.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de
#
# See the LICENSE file in the project's top-level directory for details.
import re
from tornado.testing import AsyncHTTPTestCase
from gosa.common.gjson import dumps
from tor... | gonicus/gosa | common/src/tests/RemoteTestCase.py | Python | lgpl-2.1 | 3,081 |
import os
import sys
red = "\033[31m"
reset = "\033[0m"
bright = "\033[1;32m"
dir = sys.path[0]
if len(sys.argv) >= 2:
dir = sys.argv[1]
is_test = lambda x: x.startswith('test-') and not os.path.splitext(x)[1]
tests = [f for f in os.listdir(dir) if is_test(f)]
if not tests:
print 'No tests found in "%s".' % ... | GNOME/gtkimageview | tests/alltests.py | Python | lgpl-2.1 | 617 |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | wscullin/spack | lib/spack/spack/mirror.py | Python | lgpl-2.1 | 10,271 |
#
# @BEGIN LICENSE
#
# QCDB: quantum chemistry common driver and databases
#
# Copyright (c) 2011-2017 The QCDB Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This file is part of QCDB.
#
# QCDB is free software; you can redistribute it and/or modify
# it ... | loriab/qcdb | qcdb/basislist.py | Python | lgpl-3.0 | 6,873 |
import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate... | agry/NGECore2 | scripts/mobiles/yavin4/skreeg_hunter.py | Python | lgpl-3.0 | 1,701 |
#
# This file is part of Dragonfly.
# (c) Copyright 2007, 2008 by Christo Butcher
# Licensed under the LGPL.
#
# Dragonfly is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the L... | Versatilus/dragonfly | dragonfly/grammar/rule_mapping.py | Python | lgpl-3.0 | 9,033 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from autoslug.fields import AutoSlugField
from django_markdow... | kevinmanncito/django-markdown-blog | build/lib/blog/models.py | Python | unlicense | 1,762 |
import urllib2
import json
import urllib
#https://farm{farm-id}.staticflickr.com/{server-id}/{id}_{secret}.jpg
for ii in range(1,25):
inp = urllib2.urlopen('https://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=76711e1fc2a9195b21fe63994864ed1c&tags=fire&content_type=1&per_page=1000&page='+str(ii... | JBed/Fire_Findr | 3_Training_Data/flickr_download.py | Python | apache-2.0 | 667 |
import os
import tempfile
import yaml
from test.framework.functional.base_functional_test_case import BaseFunctionalTestCase
from test.functional.job_configs import JOB_WITH_SETUP_AND_TEARDOWN
class TestConsoleOutput(BaseFunctionalTestCase):
def setUp(self):
super().setUp()
self.project_dir = t... | nickzuber/ClusterRunner | test/functional/master/test_console_output.py | Python | apache-2.0 | 1,578 |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# 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 applica... | xzturn/tensorflow | tensorflow/python/keras/optimizer_v2/adam_test.py | Python | apache-2.0 | 25,146 |
# Copyright 2012-2013 James McCauley
#
# 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 to in ... | damomeen/pox-datapath | pox/forwarding/l2_multi.py | Python | apache-2.0 | 15,558 |
#!/usr/bin/env python
# pylint: disable=missing-docstring
# flake8: noqa: T001
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ ... | tiwillia/openshift-tools | openshift/installer/vendored/openshift-ansible-3.5.5/roles/lib_openshift/library/oc_label.py | Python | apache-2.0 | 52,074 |
"""
Classes allowing "generic" relations through ContentType and object-id fields.
"""
from django.core.exceptions import ObjectDoesNotExist
from django.db import connection
from django.db.models import signals
from django.db import models
from django.db.models.fields.related import RelatedField, Field, ManyToManyRel
... | sanjuro/RCJK | vendor/django/contrib/contenttypes/generic.py | Python | apache-2.0 | 15,830 |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import functools
imp... | gmalmquist/pants | src/python/pants/backend/jvm/tasks/jvm_compile/jvm_compile.py | Python | apache-2.0 | 38,176 |
# -*- coding: utf-8 -*-
# Copyright 2021 Google LLC
#
# 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 o... | googleapis/python-aiplatform | google/cloud/aiplatform/metadata/constants.py | Python | apache-2.0 | 1,194 |