code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
#! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os
from waflib import Task,Utils,Options,Errors,Logs
from waflib.TaskGen import taskgen_method,before_method,after_method,feature
@taskgen_method
def add_marsha... | bit-trade-one/SoundModuleAP | lib-src/lv2/sratom/waflib/Tools/glib2.py | Python | gpl-2.0 | 8,343 |
from django.utils.decorators import method_decorator
from corehq.apps.reports.dispatcher import ReportDispatcher, ProjectReportDispatcher, datespan_default
from corehq.apps.users.decorators import require_permission
from corehq.apps.users.models import Permissions
require_can_edit_data = require_permission(Permissions... | gmimano/commcaretest | corehq/apps/data_interfaces/dispatcher.py | Python | bsd-3-clause | 910 |
import sys
import traceback
from socket import error
from gevent.pywsgi import WSGIServer
from socketio.handler import SocketIOHandler
from socketio.policyserver import FlashPolicyServer
from socketio.virtsocket import Socket
from geventwebsocket.handler import WebSocketHandler
__all__ = ['SocketIOServer']
class ... | grokcore/dev.lexycross | wordsmithed/src/gevent-socketio/socketio/server.py | Python | mit | 6,574 |
from waxy import *
import waxy
import waxy.containers as containers
import waxy.styles as styles
import wx.lib.scrolledpanel as scrolled
from wx import MilliSleep
from wx import EmptyImage
import string
from math import *
def Error(msg,parent=None):
dlg = MessageDialog(parent, "Error",
msg,ico... | bblais/plasticity | plasticity/dialogs/mywaxy.py | Python | mit | 5,394 |
# -*- coding: utf-8 -*-
"""
longboxed.signals
~~~~~~~~~~~~~~~~~
longboxed signals module
"""
from flask.ext.security.signals import user_registered
from werkzeug.local import LocalProxy
from .core import db
from .models import Bundle
from .helpers import current_wednesday, next_wednesday, two_wednesdays... | timbueno/longboxed | longboxed/signals.py | Python | mit | 1,256 |
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from .base import FunctionalTest
class RecipeEditTest(FunctionalTest):
def test_can_add_a_recipe(self):
# Ben goes to the recipe website homepage
self.browser.get(self.server_url)
# He notices the page title m... | benosment/recipes | functional_tests/test_edit_recipe.py | Python | mit | 8,273 |
strings = IN[0]
replace = IN[1]
strlist = []
for str in strings:
str = str.replace('\\', replace)
str = str.replace(':', replace)
str = str.replace('{', replace)
str = str.replace('}', replace)
str = str.replace('[', replace)
str = str.replace(']', replace)
str = str.replace('|', replace)
str = str.replace(';',... | andydandy74/ClockworkForDynamo | nodes/2.x/python/String.ReplaceIllegalRevitCharacters.py | Python | mit | 529 |
#!/usr/bin/python
import os
import subprocess
import re
def runCommand(command):
p = subprocess.Popen(command,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
p.wait()
return iter(p.stdout.readline, b'')
def dumpRunCommand(command,... | xianggong/m2c_unit_test | test/relational/signbit_float8/compile.py | Python | gpl-2.0 | 4,430 |
import uuid
from django.db import models
from django.conf import settings
from django.contrib.auth.models import AbstractUser
from django.contrib.auth.models import BaseUserManager
from django.utils import timezone
from accelerator_abstract.models import BaseUserRole
from accelerator_abstract.models.base_base_profile... | masschallenge/django-accelerator | simpleuser/models.py | Python | mit | 6,632 |
import os
from tkinter import *
ALL = N+S+E+W
class Application(Frame):
def __init__(self, master=None):
Frame.__init__(self, master)
self.master.rowconfigure(0, weight=1)
self.master.columnconfigure(0, weight=1)
self.grid(sticky=ALL)
root.bind("<Return>", self.file_op... | ceeblet/OST_PythonCertificationTrack | Python2/MoreGuiLayout_homework/src/moreframesandbuttons2.py | Python | mit | 3,128 |
#
# Copyright (c) SAS Institute Inc.
#
# 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 w... | sassoftware/mint | mint/django_rest/rbuilder/users/views/v1/urls.py | Python | apache-2.0 | 1,378 |
#!/usr/bin/env python
import re
import urllib2
import sys
import argparse
import math
import textwrap
def generate_ovpn(metric):
results = fetch_ip_data()
rfile=open('routes.txt','w')
for ip,mask,_ in results:
route_item="route %s %s net_gateway %d\n"%(ip,mask,metric)
rfile.write(route_... | vmlinz/vpn-deploy-playbook | roles/proxy-config-host/files/chnroutes.py | Python | gpl-3.0 | 7,738 |
"""
File-watching subroutines, built on watchdog.
"""
import sys
import time
def make_handler(ctx, task_, regexes, ignore_regexes, *args, **kwargs):
args = [ctx] + list(args)
try:
from watchdog.events import RegexMatchingEventHandler
except ImportError:
sys.exit("If you want to use this, ... | mrjmad/invocations | invocations/watch.py | Python | bsd-2-clause | 1,250 |
#!/usr/bin/env python
import os
import sys
import json
import base64
import binascii
import mimetypes
import xml.etree.ElementTree as et
# Import burp export and return a list of decoded data
def get_burp_list(filename):
if not os.path.exists(filename):
return []
with open(filename) as f:
fil... | c0deh4xor/xssless | xssless.py | Python | gpl-2.0 | 19,383 |
import os
NAME='mono'
CFLAGS = os.popen('pkg-config --cflags mono-2').read().rstrip().split()
LDFLAGS = []
LIBS = os.popen('pkg-config --libs mono-2').read().rstrip().split()
GCC_LIST = ['mono_plugin']
if os.uname()[0] == 'Darwin':
LIBS.append('-framework Foundation')
def post_build(config):
if os.system("s... | jyotikamboj/container | uw-plugins/mono/uwsgiplugin.py | Python | mit | 598 |
# -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import json
class TencentPipeline(object):
def __init__(self):
self.filename = open("tencent.json", "w")
def ... | xiaoshi657/myfile | spider/tencent/tencent/pipelines.py | Python | apache-2.0 | 559 |
#!/usr/bin/python
import re
import cgi
import cgitb
import sys
import json
import uuid
import redis
import subprocess as sp
import zipfile as zf
#print "Content-Type: text/html; charset=utf-8;"
#print
cgitb.enable();
jsonsch_exec = "/home/meow/pykicad/jsonsch.py"
jsonbrd_exec = "/home/meow/pykicad/jsonbrd.py"
brd... | timofonic/bleepsix | cgi/bleepsixDataManager.py | Python | agpl-3.0 | 8,090 |
# ---------------------------------------------------------#
# astroNN.data.__init__: tools for loading data
# ---------------------------------------------------------#
import os
import astroNN
def datapath():
"""
Get astroNN embedded data path
:return: full path to embedded data folder
:rtype: s... | henrysky/astroNN | astroNN/data/__init__.py | Python | mit | 1,744 |
def test():
t = 0
a = 10
i = 0
while i < 1e7:
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t += a; t += a; t += a
t += a; t += a; t ... | tassmjau/duktape | tests/perf/test-assign-addto.py | Python | mit | 898 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
from .mutaprops import MutaProperty, MutaAction, MutaPropClass, MutaSource
logger = logging.getLogger(__name__)
def mutaprop_class(display_name, gui_id=None, gui_major_version=0,
gui_minor_version=0):
""" Class-level decorator. It i... | calcite/mutaprops | mutaprops/decorators.py | Python | mit | 7,758 |
import base64
from urllib.parse import unquote, quote
from lxml import etree
from lxml.etree import tostring
from signxml import XMLSigner, XMLVerifier
import signxml
from OpenSSL import crypto
from cryptography.hazmat.primitives import serialization
import sys
placeholder = '<Signature Id="placeholder"><... | stephenbradshaw/pentesting_stuff | utilities/sso-helpers.py | Python | bsd-3-clause | 5,473 |
#
# 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 writing, software
# ... | rh-s/heat | heat/engine/resources/openstack/heat/swiftsignal.py | Python | apache-2.0 | 11,618 |
import asyncio
import os
from unittest import mock
import pytest
from yarl import URL
import aiohttp
from aiohttp import web
@pytest.fixture
def proxy_test_server(raw_test_server, loop, monkeypatch):
"""Handle all proxy requests and imitate remote server response."""
_patch_ssl_transport(monkeypatch)
... | playpauseandstop/aiohttp | tests/test_proxy_functional.py | Python | apache-2.0 | 17,181 |
from django import forms
from django.utils.translation import ugettext_lazy as _
from fobi.base import BaseFormFieldPluginForm, get_theme
from fobi.helpers import validate_initial_for_choices
__title__ = 'fobi.contrib.plugins.form_elements.fields.select.forms'
__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.co... | mansonul/events | events/contrib/plugins/form_elements/fields/select/forms.py | Python | mit | 3,598 |
def res_and_ens_test():
import pandas as pd
import numpy as np
import pyemu
# make some fake residuals
np.random.seed(42)
t = np.linspace(1,20, 200)
obs = t/10 * np.sin(np.pi*t)
mod = obs+np.random.randn(200)*.5
obsnames = ['ob_t_{:03d}'.format(i) for i in range(len(t))]
ob... | jtwhite79/pyemu | autotest/metrics_tests.py | Python | bsd-3-clause | 2,982 |
#!/usr/bin/python3
# @begin:license
#
# Copyright (c) 2015-2019, Benjamin Niemann <pink@odahoda.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at y... | odahoda/noisicaa | noisicaa/builtin_nodes/pianoroll_track/track_ui.py | Python | gpl-2.0 | 53,058 |
from testsuite.config import script_folder, script_folder_url
from core.generate import generate, save_generated
from core.channels.channel import Channel
from unittest import TestCase
import utils
import random
import hashlib
import os
class TestGenerators(TestCase):
def test_generators(self):
for i in ... | jorik041/weevely3 | testsuite/test_generators.py | Python | gpl-3.0 | 1,441 |
'''
#################
OpenGL Renderer (``owopenglrenderer``)
#################
.. autoclass:: VertexBuffer
.. autoclass:: OWOpenGLRenderer
'''
from ctypes import c_void_p
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4 import QtOpenGL
import OpenGL
OpenGL.ERROR_CHECKING = False
OpenGL.ERROR_LOGGI... | yzl0083/orange | Orange/OrangeWidgets/plot/owopenglrenderer.py | Python | gpl-3.0 | 15,939 |
# Transform config/index.html so that all of its image, font, CSS, and script
# dependencies are inlined, and convert the result into a data URI.
#
# This makes it possible to view the Urchin configuration page without an
# internet connection. Also, since the config page is bundled with the app
# (rather than hosted o... | mddub/urchin-cgm | make_inline_config.py | Python | mit | 3,104 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import subprocess
from flask_script import Manager, Shell, Server
from flask_migrate import MigrateCommand
from dragon_lite.app import create_app
from dragon_lite.user.models import User
from dragon_lite.settings import DevConfig, ProdConfig
from drago... | Magellanea/Dragon-Lite | manage.py | Python | bsd-3-clause | 1,109 |
from fitting_gui import Form
from correlation_gui import *
import sys
if __name__ == '__main__':
""" Initialises the gui. """
app = QtWidgets.QApplication(sys.argv)
par_obj = ParameterClass()
win_tab = QtWidgets.QTabWidget()
fit_obj = Form('point')
#Ensures the the fit tab can ... | dwaithe/FCS_point_correlator | focuspoint/FCS_point_correlator.py | Python | gpl-2.0 | 595 |
import numpy as np
# ==============================================================================
# BAG OF WORDS VECTOR
# ==============================================================================
def bow_vector(doc, word_to_id, unknown_id=0, dtype=np.i... | ronrest/convenience_py | nlp/bag_of_words.py | Python | apache-2.0 | 1,525 |
#!/usr/bin/env python
#
# Copyright 2014 tigmi
#
# 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 agre... | hancockt/python-kubernetes | kubernetes/action.py | Python | apache-2.0 | 14,694 |
"""Wrap interactions with Grafana or logging Grafana URLs."""
from cfme.utils.conf import cfme_performance
from cfme.utils.log import logger
def get_scenario_dashboard_urls(scenario, from_ts, to_ts, output_to_log=True):
"""Builds a dictionary of URLs to Grafana Dashboards of relevant appliances for a single
w... | Yadnyawalkya/integration_tests | cfme/utils/grafana.py | Python | gpl-2.0 | 1,570 |
# -*- coding: utf-8 -*-
# © 2015 Eficent Business and IT Consulting Services S.L. -
# Jordi Ballester Alomar
# © 2015 Serpent Consulting Services Pvt. Ltd. - Sudhir Arya
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import test_stock_account_operating_unit
checks = [
test_stock_accou... | Eficent/odoo-operating-unit | stock_account_operating_unit/tests/__init__.py | Python | agpl-3.0 | 343 |
import sys
import pytest
from click_testing_utils import clirunner_invoke_piped
import clifunzone.txttool as sut
from clifunzone import txt_utils
def test_none():
expected = 'I was invoked without a subcommand...'
clirunner_invoke_piped(sut.cli, [], '', exit_code=0, out_ok=expected)
def test_none_debug():... | Justin-W/clifunland | tests/test_txttool.py | Python | bsd-2-clause | 11,966 |
# 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 writing, software
# distributed under t... | stackforge/python-openstacksdk | openstack/tests/unit/network/v2/test_agent.py | Python | apache-2.0 | 5,825 |
from __future__ import absolute_import
from django.core.urlresolvers import reverse
from sentry.models import Project
from sentry.testutils import APITestCase
class TeamProjectIndexTest(APITestCase):
def test_simple(self):
self.login_as(user=self.user)
team = self.create_team(slug='baz')
... | mitsuhiko/sentry | tests/sentry/api/endpoints/test_team_project_index.py | Python | bsd-3-clause | 1,728 |
#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
# 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
... | kdart/pycopia | core/pycopia/OS/Linux/proc/net/netstat.py | Python | apache-2.0 | 3,993 |
from rlib import jit
from som.vm.globals import nilObject
from som.vmobjects.array import Array
from som.vmobjects.object_with_layout import Object
from som.interpreter.objectstorage.object_layout import ObjectLayout
class Class(Object):
_immutable_fields_ = [
"_super_class",
"_name",
"_i... | SOM-st/PySOM | src/som/vmobjects/clazz.py | Python | mit | 6,582 |
from django.conf.urls import patterns, url
from anycluster import views
from django.conf import settings
urlpatterns = patterns('',
url(r'^grid/(\d+)/(\d+)/$', views.getGrid, name='getGrid'),
url(r'^kmeans/(\d+)/(\d+)/$', views.getPins, name='getPins'),
url(r'^getClusterContent/(\d+)/(\d+)/$', views.getClu... | prafful002/clustering | anycluster/urls.py | Python | mit | 512 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/iam/v1/policy.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflect... | michaelbausor/api-client-staging | generated/python/grpc-google-iam-v1/google/iam/v1/policy_pb2.py | Python | bsd-3-clause | 4,654 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""This file is part of the prometeo project.
This program 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 License, or (at your
option... | zuck/prometeo-erp | partners/forms.py | Python | lgpl-3.0 | 4,833 |
import matplotlib.pyplot as plt
import matplotlib.patches as mpatch
import numpy as np
import os
nx = 5
ny = 4
np.random.seed(0)
mask = set(np.random.randint(0, nx*ny, 11))
fig = plt.figure(figsize=(nx//2*3, ny//2), facecolor='w')
# ax = fig.add_axes([0, 0, 1, 1], xticks=[], yticks=[], frameon=True)
ax = fig.add_sub... | ueapy/enveast_python_course_materials | scripts/draw_masked_array.py | Python | mit | 1,550 |
import os.path
from crepehat import SObject
class Kitchen(SObject):
sources = []
extensions = []
def __init__(self, sources, extensions=None):
if not hasattr(sources, "__iter__"):
sources = [sources]
self.sources = sources
if extensions and not hasattr(extensions, "_... | hyphyphyph/lascaux | crepehat/kitchen.py | Python | mit | 1,587 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import time
from tests.functional import PmxbotHarness
class TestPmxbotMessages(PmxbotHarness):
def test_no_op(self):
"""
Test that the harness is working.
"""
def test_non_ascii_message(self):
"""
pmxbot should still be able to send inter... | jamwt/diesel-pmxbot | tests/functional/test_messages.py | Python | bsd-3-clause | 492 |
#!/usr/bin/env python
import argparse
import os
import psycopg2
from settings import connection_string
import csv
__author__ = 'John J. Horton'
__copyright__ = 'Copyright (C) 2012 John Joseph Horton'
__license__ = 'All rights reserved'
__maintainer__ = 'johnjosephhorton'
__email__ = 'john.joseph.horton@gmail.com'
_... | johnjosephhorton/runSQL | runSQL.py | Python | gpl-2.0 | 2,185 |
#--
# Copyright (c) 2012-2014 Net-ng.
# All rights reserved.
#
# This software is licensed under the BSD License, as described in
# the file LICENSE.txt, which you should have received as part of
# this distribution.
#--
import peak
import datetime
from nagare import presentation, security, ajax, i18n
from nagare.i18... | Net-ng/kansha | kansha/card_addons/due_date/view.py | Python | bsd-3-clause | 2,112 |
# coding=utf-8
"""Test cases for Zinnia's admin"""
from __future__ import unicode_literals
from django.contrib.admin.sites import AdminSite
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.test import RequestFactory
from django.test import TestCase
from django.utils ... | ghachey/django-blog-zinnia | zinnia/tests/test_admin.py | Python | bsd-3-clause | 18,228 |
from __future__ import division
import numpy as np
from numpy.lib.stride_tricks import as_strided as ast
import scipy.linalg
import copy, collections, os, shutil, hashlib
from contextlib import closing
from urllib2 import urlopen
from itertools import izip, chain, count, ifilter
def solve_psd(A,b,chol=None,overwrite_b... | theDataGeek/pyhsmm | pyhsmm/util/general.py | Python | mit | 9,598 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
#
# 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 you... | pmghalvorsen/gramps_branch | gramps/gen/utils/lds.py | Python | gpl-2.0 | 3,932 |
"""
[pro@WSCENTOS64_x64 20:35:27 gevent_test]$time python raw_client.py
time= 1410439094.08
time= 1410439104.24
real 0m10.200s
user 0m1.045s
sys 0m5.536s
"""
import socket
import struct
import time
HEAD_LEN=4
sock=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(('192.168.1.70',18600))
... | dungeonsnd/test-code | dev_examples/perf_gevent_echo_test/raw_client.py | Python | gpl-3.0 | 652 |
# ***************************************************************************
# * Copyright (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> *
# * Copyright (c) 2009, 2010 Ken Cline <cline@frii.com> *
# * Copyright (c) 2020 FreeCAD Developers *
# * ... | sanguinariojoe/FreeCAD | src/Mod/Draft/draftmake/make_drawingview.py | Python | lgpl-2.1 | 4,982 |
"""
Support for IOTA wallets.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/iota
"""
import logging
from datetime import timedelta
from homeassistant.components.iota import IotaDevice, CONF_WALLETS
from homeassistant.const import CONF_NAME
_LOGGER = ... | tinloaf/home-assistant | homeassistant/components/sensor/iota.py | Python | apache-2.0 | 2,864 |
r"""UUID objects (universally unique identifiers) according to RFC 4122.
This module provides immutable UUID objects (class UUID) and the functions
uuid1(), uuid3(), uuid4(), uuid5() for generating version 1, 3, 4, and 5
UUIDs as specified in RFC 4122.
If all you want is a unique ID, you should probably call uu... | ZerpaTechnology/AsenZor | static/js/brython/Lib/uuid.py | Python | lgpl-3.0 | 23,093 |
#!/usr/bin/env python
"""
A demo of how to load a csv file
"""
import pandas
df = pandas.read_csv(
"/etc/passwd",
sep=":",
header=None, )
print(df)
print(df.shape)
| veltzer/demos-python | src/examples/short/pandas/read_csv.py | Python | gpl-3.0 | 179 |
from otopi import util
from . import version
@util.export
def createPlugins(context):
version.Plugin(context=context)
# vim: expandtab tabstop=4 shiftwidth=4
| yingyun001/ovirt-engine | packaging/setup/plugins/ovirt-engine-setup/eayunos-version/__init__.py | Python | apache-2.0 | 168 |
""" Create implicit exchange reactions for dFBA submodels.
:Author: Arthur Goldberg <Arthur.Goldberg@mssm.edu>
:Author: Jonathan Karr <jonrkarr@gmail.com>
:Date: 2018-11-28
:Copyright: 2017-2018, Karr Lab
:License: MIT
"""
from .core import Transform
from wc_onto import onto
from wc_utils.util.ontology import are_ter... | KarrLab/obj_model | tests/fixtures/migrate/wc_lang_fixture/wc_lang/transform/create_implicit_dfba_ex_rxns.py | Python | mit | 4,570 |
"""
This script generates the caseConversionMaps.py and wordBreakProperties.py modules.
It references the following Unicode files:
PropList.txt
SpecialCasing.txt
UnicodeData.txt
WordBreakProperty.txt
"""
import os
import pprint
import time
import compositor
# -----
# Tools
# -----
def filterLines(pat... | moyogo/compositor | tools/UnicodeReferenceGenerator.py | Python | mit | 4,624 |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2012-8 Met Office.
#
# This file is part of Rose, a framework for meteorological suites.
#
# Rose is free software: you can redistribute it and/or modify
# it under the terms of the GNU ... | aosprey/rose | lib/python/rose/config_editor/valuewidget/character.py | Python | gpl-3.0 | 5,589 |
# Copyright 2012 (C) Mickael Menu <mickael.menu@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 2 of the License, or
# (at your option) any later version.
#
# This pr... | fredokun/TikZ-Editor | tikz_editor/views/document/feedback/__init__.py | Python | gpl-2.0 | 3,146 |
#!/usr/bin/env python
###############################################################################
#
# SageMathCloud: A collaborative web-based interface to Sage, IPython, LaTeX and the Terminal.
#
# Copyright (C) 2014, 2015, William Stein
#
# This program is free software: you can redistribute it and/or modi... | timothyclemansinsea/smc | src/smc_pyutil/smc_pyutil/smc_compute.py | Python | gpl-3.0 | 44,536 |
import sys
import os
import pysos
import signal
# these two variables should be changed depending on the test drivers PID
# and the type of message it will be sending, If you are using the generic_test.c
# then it is likely these two values can stay the same
TEST_MODULE = 0x81
MSG_TEST_DATA= 33
ALARM_LEN = 60
START_... | nesl/sos-2x | modules/unit_test/modules/kernel/post_raw/source_trick/reciever/source_trick_reciever.py | Python | bsd-3-clause | 3,085 |
# Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
"""
Cross Site Request Forgery and Session HTTP Header Middleware.
This module provides middleware that implements protection
against request forgeries from other sites.
"""
from django.conf import settings
from django.utils.depre... | uw-it-aca/django-blti | blti/middleware.py | Python | apache-2.0 | 1,282 |
from js9 import j
try:
from urllib.parse import unquote, quote
except BaseException:
from urllib.parse import unquote, quote
import re
matchquote = re.compile(r'\'[^\']*\'')
JSBASE = j.application.jsbase_get_class()
class Tags(JSBASE):
"""
represent set of tags & _labels
label is e.g. important (... | Jumpscale/core9 | JumpScale9/data/tags/Tags.py | Python | apache-2.0 | 5,995 |
import unittest
from flask import Blueprint, request
from flask_restful import Api, Resource
from drift.tests import DriftTestCase
from drift.core.extensions.schemachecker import simple_schema_request, schema_response, register_extension
bp = Blueprint("schema", __name__)
api = Api(bp)
class MyTest(DriftTestCase)... | 1939Games/drift | drift/tests/test_schemachecker.py | Python | mit | 2,164 |
# Copyright 2015 Michael Broxton
#
# 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 writi... | samklr/spark-gce | setup.py | Python | apache-2.0 | 1,354 |
from system_api import SystemResource, CustomAPIResource, OperatingSystemData
from systems.models import System
from tastypie.test import ResourceTestCase
from django.core.exceptions import ValidationError
import json
from django.http import HttpRequest
from mozdns.view.models import View
from core.vlan.models import V... | rtucker-mozilla/mozilla_inventory | api_v3/tests.py | Python | bsd-3-clause | 16,015 |
import numpy as np
import matplotlib.pyplot as plt
import polytrope as poly
import scipy.interpolate as intp
from astropy.io import fits
import sys
from scipy.optimize import minimize
#argument to plots.py is the index of the polytrope
n = float(sys.argv[1])
filename='poly'+str(n)
#if the fits file exists, use it. If ... | sfxfactor/StellarNumericalProj | plots.py | Python | mit | 2,582 |
import numpy as np
def tau_branch(tau,epp):
N = len(tau[0,:])
branch_cnt = []
for i in range(N):
branch_cnt.append(np.sum(tau[i,:]>epp))
return branch_cnt | zjost/antsystem | functions/tau_branch.py | Python | gpl-2.0 | 184 |
#
# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
#
# 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 2 of the License.
#
# This program is distributed in th... | mysql/mysql-utilities | mysql-test/suite/replication/t/replicate.py | Python | gpl-2.0 | 10,797 |
"""
Django settings for django_branches project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR,... | codedbyjay/django-branches | django_branches/settings.py | Python | gpl-2.0 | 3,806 |
# This file is part of Indico.
# Copyright (C) 2002 - 2019 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from indico.core.db import db
from indico.util.string import form... | mvidalgarcia/indico | indico/modules/users/models/suggestions.py | Python | mit | 2,186 |
'''
Copyright (C) 2013 Rasmus Eneman <rasmus@eneman.eu>
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... | Pajn/RAXA-Django | common/views.py | Python | agpl-3.0 | 2,418 |
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
from hashlib import md5
from django.core.ur... | r-o-b-b-i-e/pootle | pootle/apps/accounts/proxy.py | Python | gpl-3.0 | 1,275 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
EditScriptDialog.py
---------------------
Date : December 2012
Copyright : (C) 2012 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
*******... | wbyne/QGIS | python/plugins/processing/gui/ScriptEditorDialog.py | Python | gpl-2.0 | 11,269 |
#!/usr/bin/env python
# coding: utf-8
import unittest
import xmlrunner
def runner(output='python_tests_xml'):
return xmlrunner.XMLTestRunner(
output=output
)
def find_tests():
return unittest.TestLoader().discover('src')
if __name__ == '__main__':
runner().run(find_tests())
| ontiyonke/mobile-loans | test_runner.py | Python | mit | 304 |
"""
byceps.services.image.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2021 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from __future__ import annotations
from typing import BinaryIO, Iterable, Union
from ...util.image import read_dimensions
from ...util.image.models imp... | homeworkprod/byceps | byceps/services/image/service.py | Python | bsd-3-clause | 1,383 |
import logging
from jenkinsapi import jenkins
from jenkinsflow.flow import serial
def main(api):
logging.basicConfig()
logging.getLogger("").setLevel(logging.WARNING)
with serial(api, timeout=200, report_interval=3) as ctrl1:
ctrl1.invoke('compile_helloworld')
with ctrl1.parallel(timeo... | lechat/devops-python-jenkins | basic_flow/flow.py | Python | mit | 600 |
import warnings
import larray.extra.ipfp as ipfp
warnings.warn('ipfp function should be imported as "from larray import ipfp" or not imported explicitly at all if you '
'use "from larray import *"', FutureWarning, stacklevel=2)
| liam2/larray | larray/ipfp/__init__.py | Python | gpl-3.0 | 244 |
# swap.py
# Device format classes for anaconda's storage configuration module.
#
# Copyright (C) 2009 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your optio... | mulkieran/blivet | blivet/formats/swap.py | Python | gpl-2.0 | 5,538 |
# -*- encoding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from h2o.utils.compatibility import * # NOQA
import h2o
from .model_base import ModelBase
class H2OAutoEncoderModel(ModelBase):
def anomaly(self, test_data, per_feature=False):
"""
Obtai... | mathemage/h2o-3 | h2o-py/h2o/model/autoencoder.py | Python | apache-2.0 | 1,065 |
"""Numeric derivative of data coming from a source sensor over time."""
from decimal import Decimal, DecimalException
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
ATTR_UNIT_OF_MEASUREMENT,
CONF_NAME,
CONF_SOURCE,
... | tboyce021/home-assistant | homeassistant/components/derivative/sensor.py | Python | apache-2.0 | 7,250 |
from django.contrib import admin
from modularblog.core.admin import BaseAdmin
from fragments.models import Post, Fragment
@admin.register(Post)
class PostAdmin(BaseAdmin):
list_display = ('pk', 'title', 'author', 'org', 'state', 'created',)
search_fields = [
'title',
'author__username',
... | tarequeh/django-modular-blog | fragments/admin.py | Python | mit | 700 |
# -*- coding: utf-8 -*-
###
# Copyright (c) 2009-2011 by Elián Hanisch <lambdae2@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your optio... | OmeGak/dotfiles | weechat/weechat.symlink/python/grep.py | Python | mit | 62,687 |
# coding: utf-8
"""
captcha.audio
~~~~~~~~~~~~~
Generate Audio CAPTCHAs, with built-in digits CAPTCHA.
This module is totally inspired by https://github.com/dchest/captcha
"""
import os
import copy
import wave
import struct
import random
import operator
import sys
if sys.version_info[0] != 2:
im... | contracode/captcha | captcha/audio.py | Python | bsd-3-clause | 7,597 |
from flask import Flask, jsonify, Blueprint, current_app
from flask_restful import Resource, Api
from sqlalchemy.orm.exc import NoResultFound, MultipleResultsFound
from pprint import pprint
from . import api, db
from .models import Fact
from .schemas import FactSchema
fact_schema = FactSchema()
class FactoidsAll(... | bnrubin/userv | userv/encyclopedia/views.py | Python | mit | 1,021 |
"""Interact with the graphics libraries via mouse events.
- MOUSE_CLICKED
- MOUSE_PRESSED
- MOUSE_RELEASED
- MOUSE_MOVED
- MOUSE_DRAGGED
"""
# TODO(sredmond): Clarify the difference between MOUSE_PRESSED and MOUSE_CLICKED.
# TODO(sredmond): Add support for mouse entry and exits.
# TODO(sredmond): Add support for doubl... | sredmond/acmpy | campy/gui/events/mouse.py | Python | mit | 6,688 |
# A part of pdfrw (https://github.com/pmaupin/pdfrw)
# Copyright (C) 2006-2015 Patrick Maupin, Austin, Texas
# MIT license -- See LICENSE.txt for details
'''
Converts pdfrw objects into reportlab objects.
Designed for and tested with rl 2.3.
Knows too much about reportlab internals.
What can you do?
The interface t... | Wintermute0110/plugin.program.advanced.MAME.launcher | pdfrw/pdfrw/toreportlab.py | Python | gpl-2.0 | 4,385 |
# Copyright 2013 OpenStack Foundation
# 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 requ... | HybridF5/tempest_debug | tempest/api/identity/admin/v3/test_roles.py | Python | apache-2.0 | 8,714 |
"""kickstarter_django URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/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... | pratyaymodi/kickstarter | kickstarter_django/kickstarter_django/urls.py | Python | mit | 1,940 |
#!/usr/bin/python3
import logging
import tarfile
import io
import re
logger = logging.getLogger(__name__)
LANG_DEFAULT = "en"
def get_label(node, knowledge_graphs=[], lang=LANG_DEFAULT, fallback=True):
""" Retrieve label in preferred language
:param node: a resource
:param knowledge_graphs: a list of K... | wxwilcke/MINOS | writers/auxiliarly.py | Python | gpl-3.0 | 2,199 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ThetaTauMiami.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| ThetaTauMiami/ThetaTauMiami-old | manage.py | Python | apache-2.0 | 256 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_unsee
----------------------------------
Tests for `unsee` module.
"""
import unittest
from unsee import unsee
class TestUnsee(unittest.TestCase):
def setUp(self):
pass
def test_something(self):
pass
def tearDown(self):
... | vrdhn/unsee | tests/test_unsee.py | Python | isc | 325 |
# -*- coding: utf-8 -*-
"""
* Copyright (c) 2017 SUSE LLC
*
* openATTIC 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 package is distributed in the hope that it will be usefu... | openattic/openattic | backend/oa_settings/urls.py | Python | gpl-2.0 | 1,730 |
#!/usr/bin/env python
##Copyright 2009-2015 Thomas Paviot (tpaviot@gmail.com)
##
##This file is part of pythonOCC.
##
##pythonOCC 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... | sven-hm/pythonocc-core | examples/core_display_quality.py | Python | lgpl-3.0 | 2,053 |
class InvalidParameter(Exception):
pass
| useblocks/groundwork | groundwork/configuration/exceptions.py | Python | mit | 44 |
#!/usr/bin/python
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['removed'],
'supported_by': 'core'}
DOCUMENTATION = '''
---
module: test_docs_removed_status
short_description: Tes... | thaim/ansible | test/integration/targets/ansible-doc/library/test_docs_removed_status.py | Python | mit | 631 |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import pytest
from datetime import datetime, timedelta
from flexget.plugins.filter.seen import SeenEntry
from flexget.api.app import base_message
from flexget.api.plugins... | jacobmetrick/Flexget | flexget/tests/api_tests/test_series_api.py | Python | mit | 58,100 |
class EnvironmentException(Exception):
"""Exception from the environment classes."""
def __init__(self):
pass
| blendit/env | src/exception.py | Python | gpl-3.0 | 126 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.