repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
amisrs/one-eighty
venv2/lib/python2.7/site-packages/sqlalchemy/event/base.py
33
9540
# event/base.py # Copyright (C) 2005-2017 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 """Base implementation classes. The public-facing ``Events`` serves as the base class...
mit
AbsentMoniker/ECE463Honors
web2py/gluon/tests/test_contribs.py
18
1745
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Unit tests for contribs """ import sys import os import unittest def fix_sys_path(): """ logic to have always the correct sys.path '', web2py/gluon, web2py/site-packages, web2py/ ... """ def add_path_first(path): sys.path = [path] + [p f...
gpl-2.0
rendermotion/RMPY
core/dataValidators.py
2
1916
import pymel.core as pm import inspect def as_pymel_nodes(nodes): converted_to_list = False if type(nodes) not in [list, tuple]: nodes = [nodes] converted_to_list = True return_list = [] for each in nodes: if pm.general.PyNode in inspect.getmro(type(each)): return_l...
lgpl-3.0
jimgong92/allezViens
venv/lib/python2.7/site-packages/setuptools/tests/test_integration.py
16
2486
"""Run some integration tests. Try to install a few packages. """ import glob import os import sys import pytest from setuptools.command.easy_install import easy_install from setuptools.command import easy_install as easy_install_pkg from setuptools.dist import Distribution @pytest.fixture def install_context(req...
mit
UMWRG/PywrApp
tests/test_nodes_edges.py
1
1490
""" The unit tests in this module test the internal behaviour of the Pywr-Hydra application. """ from hydra_pywr.importer import PywrHydraImporter import pytest import json @pytest.fixture() def pywr_nodes_edges(): """ Example node and edge data from Pywr. This data looks like "nodes" and "edges" section of...
gpl-3.0
dingzg/onepanel
bin/install_config.py
1
3571
#!/usr/bin/env python2.6 #-*- coding: utf-8 -*- # Copyright [OnePanel] # # 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 b...
apache-2.0
mancoast/CPythonPyc_test
cpython/251_test_select.py
9
1686
# Testing select module from test.test_support import verbose, reap_children import select import os # test some known error conditions try: rfd, wfd, xfd = select.select(1, 2, 3) except TypeError: pass else: print 'expected TypeError exception not raised' class Nope: pass class Almost: def filen...
gpl-3.0
Eric89GXL/vispy
vispy/util/fonts/tests/test_font.py
1
1301
# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. import numpy as np import warnings from vispy.testing import assert_in, run_tests_if_main from vispy.util.fonts import list_fonts, _load_glyph, _vispy_fonts im...
bsd-3-clause
n-west/gnuradio-volk
gr-blocks/python/blocks/qa_vector_sink_source.py
20
2046
#!/usr/bin/env python # # Copyright 2008,2010,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your ...
gpl-3.0
maverickhuenlam/blog
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/style.py
95
3672
# -*- coding: utf-8 -*- """ pygments.style ~~~~~~~~~~~~~~ Basic style object. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.token import Token, STANDARD_TYPES class StyleMeta(type): def __new__(mcs, name, bases,...
mit
morelab/weblabdeusto
tools/wcloud/alembic/env.py
4
2340
from __future__ import with_statement from alembic import context from sqlalchemy import engine_from_config, pool from logging.config import fileConfig # this is the Alembic Config object, which provides # access to the values within the .ini file in use. config = context.config # Interpret the config file for Pytho...
bsd-2-clause
dushu1203/chromium.src
tools/telemetry/telemetry/util/global_hooks.py
47
1343
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Hooks that apply globally to all scripts that import or use Telemetry.""" import signal import sys from telemetry.util import exception_formatter def ...
bsd-3-clause
yenliangl/bitcoin
test/functional/test_runner.py
1
26026
#!/usr/bin/env python3 # Copyright (c) 2014-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Run regression test suite. This module calls down into individual test cases via subprocess. It will f...
mit
sontek/python-driver
tests/unit/test_types.py
2
18026
# Copyright 2013-2015 DataStax, 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 writi...
apache-2.0
ciarams87/PyU4V
PyU4V/tests/unit_tests/test_pyu4v_common.py
1
28205
# Copyright (c) 2020 Dell Inc. or its subsidiaries. # # 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...
mit
batermj/algorithm-challenger
code-analysis/programming_anguage/python/source_codes/Python3.5.9/Python-3.5.9/Lib/test/test_decimal.py
1
209553
# Copyright (c) 2004 Python Software Foundation. # All rights reserved. # Written by Eric Price <eprice at tjhsst.edu> # and Facundo Batista <facundo at taniquetil.com.ar> # and Raymond Hettinger <python at rcn.com> # and Aahz (aahz at pobox.com) # and Tim Peters """ These are the test cases for the Decim...
apache-2.0
drJfunk/gbmgeometry
gbmgeometry/position_interpolator.py
1
4903
import astropy.io.fits as fits import astropy.units as u import numpy as np import scipy.interpolate as interpolate from gbmgeometry.utils.gbm_time import GBMTime class PositionInterpolator(object): def __init__(self, poshist=None, T0=None, trigdat=None): # Use position history file """ ...
mit
milinbhakta/flaskmaterialdesign
venv/Lib/collections/__main__.py
213
1275
################################################################################ ### Simple tests ################################################################################ # verify that instances can be pickled from collections import namedtuple from pickle import loads, dumps Point = namedtuple('Point', 'x, y'...
gpl-2.0
mattesno1/Sick-Beard
lib/requests/packages/charade/langhebrewmodel.py
183
11519
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Simon Montagu # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Re...
gpl-3.0
zenefits/sentry
src/sentry/api/endpoints/organization_activity.py
6
1059
from __future__ import absolute_import from sentry.api.bases import OrganizationMemberEndpoint from sentry.api.paginator import DateTimePaginator from sentry.api.serializers import serialize, OrganizationActivitySerializer from sentry.models import Activity, OrganizationMemberTeam, Project class OrganizationActivity...
bsd-3-clause
servo/servo
tests/wpt/web-platform-tests/resources/test/conftest.py
3
10914
import copy import json import os import ssl import sys import subprocess import html5lib import py import pytest from six import text_type from six.moves import urllib from wptserver import WPTServer HERE = os.path.dirname(os.path.abspath(__file__)) WPT_ROOT = os.path.normpath(os.path.join(HERE, '..', '..')) HARNES...
mpl-2.0
Wulfire/visualizationlibrary
src/external/freetype/src/tools/docmaker/utils.py
515
3063
# Utils (c) 2002, 2004, 2007, 2008 David Turner <david@freetype.org> # import string, sys, os, glob # current output directory # output_dir = None # This function is used to sort the index. It is a simple lexicographical # sort, except that it places capital letters before lowercase ones. # def index_sort( s1, ...
bsd-2-clause
colinmcd94/kickdata
lib/werkzeug/utils.py
317
22676
# -*- coding: utf-8 -*- """ werkzeug.utils ~~~~~~~~~~~~~~ This module implements various utilities for WSGI applications. Most of them are used by the request and response wrappers but especially for middleware development it makes sense to use them without the wrappers. :copyright: (c) 2013 ...
apache-2.0
rabc/Gitmark
flask/testing.py
1
2318
# -*- coding: utf-8 -*- """ flask.testing ~~~~~~~~~~~~~ Implements test support helpers. This module is lazily imported and usually not used in production environments. :copyright: (c) 2010 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from werkzeug import Client, Envir...
mit
skwbc/numpy
numpy/lib/tests/test_arraypad.py
34
43332
"""Tests for the array padding functions. """ from __future__ import division, absolute_import, print_function import numpy as np from numpy.testing import (assert_array_equal, assert_raises, assert_allclose, TestCase) from numpy.lib import pad class TestConditionalShortcuts(TestCase): ...
bsd-3-clause
hubert667/AIR
build/PyYAML/examples/yaml-highlight/yaml_hl.py
95
4429
#!/usr/bin/python import yaml, codecs, sys, os.path, optparse class Style: def __init__(self, header=None, footer=None, tokens=None, events=None, replaces=None): self.header = header self.footer = footer self.replaces = replaces self.substitutions = {} for doma...
gpl-3.0
engdan77/edoAutoHomeMobile
twisted/conch/test/test_openssh_compat.py
8
3370
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.conch.openssh_compat}. """ import os from twisted.trial.unittest import TestCase from twisted.python.filepath import FilePath from twisted.python.reflect import requireModule if requireModule('Crypto.Cipher.DES3') and re...
mit
andreoliw/clitoolkit
clit/ui.py
1
1060
"""User interface.""" import sys import time from pathlib import Path from subprocess import PIPE, CalledProcessError import click from clit.files import shell def notify(title, message): """If terminal-notifier is installed, use it to display a notification.""" check = "which" if sys.platform == "linux" el...
bsd-3-clause
kizbitz/train
train/train.py
2
3154
#!/usr/bin/env python # -*- coding: utf-8 -*- """Train: AWS CLI Tool""" import argparse import sys import boto.vpc from vpc.config import * import vpc.instances as inst import vpc.labs as labs import vpc.register as register import vpc.ses as ses import vpc.util as util import vpc.vpc as vpc # configure parser pa...
apache-2.0
eeshangarg/zulip
zerver/lib/ccache.py
6
7518
import base64 import struct from typing import Any, Dict, List, Optional # This file is adapted from samples/shellinabox/ssh-krb-wrapper in # https://github.com/davidben/webathena, which has the following # license: # # Copyright (c) 2013 David Benjamin and Alan Huang # # Permission is hereby granted, free of charge, ...
apache-2.0
dxwu/BinderFilter
resources/android-toolchain-16/lib/python2.7/lib2to3/fixes/fix_imports.py
326
5693
"""Fix incompatible imports and module references.""" # Authors: Collin Winter, Nick Edds # Local imports from .. import fixer_base from ..fixer_util import Name, attr_chain MAPPING = {'StringIO': 'io', 'cStringIO': 'io', 'cPickle': 'pickle', '__builtin__' : 'builtins', 'c...
mit
wujichang/linux
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py
4653
3596
# EventClass.py # # This is a library defining some events types classes, which could # be used by other scripts to analyzing the perf samples. # # Currently there are just a few classes defined for examples, # PerfEvent is the base class for all perf event sample, PebsEvent # is a HW base Intel x86 PEBS event, and use...
gpl-2.0
rfriesen/DR1_analysis
property_histograms.py
2
7527
from astropy.io import fits import aplpy import matplotlib.pyplot as plt import matplotlib.ticker as ticker import astropy.units as u import astropy.constants as c import warnings import numpy as np from astropy.visualization import hist from config import plottingDictionary """ Make histogram plots of NH3-derived prop...
mit
rr-/docstring_parser
docstring_parser/tests/test_numpydoc.py
1
17338
import typing as T import pytest from docstring_parser.numpydoc import parse @pytest.mark.parametrize( "source, expected", [ ("", None), ("\n", None), ("Short description", "Short description"), ("\nShort description\n", "Short description"), ("\n Short description\n...
mit
mark-burnett/filament-dynamics
actin_dynamics/numerical/correlation.py
1
2220
# Copyright (C) 2011 Mark Burnett # # 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 i...
gpl-3.0
bsipocz/statsmodels
statsmodels/graphics/plot_grids.py
33
5711
'''create scatterplot with confidence ellipsis Author: Josef Perktold License: BSD-3 TODO: update script to use sharex, sharey, and visible=False see http://www.scipy.org/Cookbook/Matplotlib/Multiple_Subplots_with_One_Axis_Label for sharex I need to have the ax of the last_row when editing the earlier row...
bsd-3-clause
izapolsk/integration_tests
cfme/tests/configure/test_zones.py
1
7003
import fauxfactory import pytest from cfme import test_requirements from cfme.base.ui import ZoneAddView from cfme.exceptions import ItemNotFound from cfme.utils.appliance.implementations.ui import navigate_to from cfme.utils.update import update pytestmark = [test_requirements.configuration] NAME_LEN = 5 DESC_LEN ...
gpl-2.0
popazerty/e2_sh4
lib/python/Components/TunerInfo.py
63
4265
from GUIComponent import GUIComponent from enigma import eLabel, eSlider, iFrontendInformation from math import log class TunerInfo(GUIComponent): SNR = 0 SNR_DB = 1 AGC = 2 BER = 3 SNR_PERCENTAGE = 0 AGC_PERCENTAGE = 2 BER_VALUE = 3 SNR_BAR = 4 AGC_BAR = 5 BER_BAR = 6 LOCK_STATE = 7 SYNC_STATE = 8 LOCK...
gpl-2.0
CamDavidsonPilon/lifetimes
docs/conf.py
1
5841
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # lifetimes documentation build configuration file, created by # sphinx-quickstart on Fri Jul 7 14:10:36 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # ...
mit
andreif/django
tests/auth_tests/test_views.py
13
44307
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime import itertools import os import re from importlib import import_module from django.apps import apps from django.conf import settings from django.contrib.admin.models import LogEntry from django.contrib.auth import REDIRECT_FIELD_NAME, S...
bsd-3-clause
supergis/QGIS
python/plugins/processing/modeler/ModelerUtils.py
23
1827
# -*- coding: utf-8 -*- """ *************************************************************************** ModelerUtils.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com **************************...
gpl-2.0
WillisXChen/django-oscar
oscar/lib/python2.7/site-packages/py/_code/assertion.py
218
3287
import sys import py BuiltinAssertionError = py.builtin.builtins.AssertionError _reprcompare = None # if set, will be called by assert reinterp for comparison ops def _format_explanation(explanation): """This formats an explanation Normally all embedded newlines are escaped, however there are three exce...
bsd-3-clause
mkutlak/abrt
tests/runtests/dbus-problems2-sanity/cases/test_new_problem_sanity.py
4
8708
#!/usr/bin/python3 # vim: set makeprg=python3-flake8\ % import os import dbus import abrt_p2_testing from abrt_p2_testing import (wait_for_task_new_problem, get_huge_file_path, create_fully_initialized_problem, open_fd, ...
gpl-2.0
8l/beri
cheritest/trunk/tests/fpu/test_raw_fpu_denorm.py
2
1951
#- # Copyright (c) 2013 Michael Roe # All rights reserved. # # This software was developed by SRI International and the University of # Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 # ("CTSRD"), as part of the DARPA CRASH research programme. # # @BERI_LICENSE_HEADER_START@ # # Licensed to BER...
apache-2.0
40223141/0505
static/Brython3.1.1-20150328-091302/Lib/logging/handlers.py
736
55579
# Copyright 2001-2013 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
agpl-3.0
steilerDev/NOOBS4IoT
buildroot/support/scripts/kconfiglib.py
146
138328
# This is Kconfiglib, a Python library for scripting, debugging, and extracting # information from Kconfig-based configuration systems. To view the # documentation, run # # $ pydoc kconfiglib # # or, if you prefer HTML, # # $ pydoc -w kconfiglib # # The examples/ subdirectory contains examples, to be run with e.g. # ...
gpl-3.0
big-data-lab-team/sim
sim/other_wf_examples/nipype/NipBIDS.py
3
5510
from nipype import Workflow, MapNode, Node, Function from nipype.interfaces.utility import IdentityInterface, Function import os, json, time from sim import Sim class NipBIDS(Sim.Sim): def __init__(self, boutiques_descriptor, bids_dataset, output_dir, options={}): super(NipBIDS, self).__init__(os.pa...
gpl-3.0
enaut/Minecraft-Overviewer
contrib/testRender.py
4
5290
#!/usr/bin/env python3 "Test Render Script" import argparse import math import os import re import shutil import sys import tempfile import time from shlex import split from subprocess import PIPE, STDOUT, CalledProcessError, run overviewer_scripts = ['./overviewer.py', './gmap.py'] def check_call(args, verbose=Fa...
gpl-3.0
jereze/scikit-learn
benchmarks/bench_rcv1_logreg_convergence.py
149
7173
# Authors: Tom Dupre la Tour <tom.dupre-la-tour@m4x.org> # Olivier Grisel <olivier.grisel@ensta.org> # # License: BSD 3 clause import matplotlib.pyplot as plt import numpy as np import gc import time from sklearn.externals.joblib import Memory from sklearn.linear_model import (LogisticRegression, SGDClassifi...
bsd-3-clause
vrthra/pygram
tests/test_accesslog.py
1
16740
from urllib.parse import urlparse import induce import collections import random import accesslog random.seed(0) def test_accesslog1(): content_lines = ''' 1.1.1.1 - - [21/Feb/2014:06:35:45 +0100] "GET /robots.txt HTTP/1.1" 200 112 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" '''...
gpl-3.0
PaddlePaddle/models
dygraph/sentiment/nets.py
1
10899
# Copyright (c) 2019 PaddlePaddle 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 appli...
apache-2.0
felipebetancur/scipy
scipy/optimize/zeros.py
55
19069
from __future__ import division, print_function, absolute_import import warnings from . import _zeros from numpy import finfo, sign, sqrt _iter = 100 _xtol = 1e-12 _rtol = finfo(float).eps * 2 __all__ = ['newton', 'bisect', 'ridder', 'brentq', 'brenth'] CONVERGED = 'converged' SIGNERR = 'sign error' CONVERR = 'con...
bsd-3-clause
jiguanglizipao/ucore_os_lab
related_info/ostep/ostep6-paging-policy.py
53
10572
#! /usr/bin/env python import sys from optparse import OptionParser import random import math def convert(size): length = len(size) lastchar = size[length-1] if (lastchar == 'k') or (lastchar == 'K'): m = 1024 nsize = int(size[0:length-1]) * m elif (lastchar == 'm') or (lastchar == 'M'...
gpl-2.0
kennedyshead/home-assistant
homeassistant/components/openweathermap/sensor.py
11
3096
"""Support for the OpenWeatherMap (OWM) service.""" from .abstract_owm_sensor import AbstractOpenWeatherMapSensor from .const import ( ATTR_API_FORECAST, DOMAIN, ENTRY_NAME, ENTRY_WEATHER_COORDINATOR, FORECAST_MONITORED_CONDITIONS, FORECAST_SENSOR_TYPES, MONITORED_CONDITIONS, WEATHER_SEN...
apache-2.0
hynnet/openwrt-mt7620
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/root-ralink/usr/lib/python2.7/unittest/test/test_result.py
104
19064
import sys import textwrap from StringIO import StringIO from test import test_support import traceback import unittest class Test_TestResult(unittest.TestCase): # Note: there are not separate tests for TestResult.wasSuccessful(), # TestResult.errors, TestResult.failures, TestResult.testsRun or # TestRes...
gpl-2.0
raymondnijssen/QGIS
tests/src/python/test_python_repr.py
2
5321
# -*- coding: utf-8 -*- """QGIS Unit tests for core additions .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. """ __a...
gpl-2.0
nhmc/LAE
cloudy/find_par.py
1
13374
from __future__ import division from math import log, sqrt, pi from barak.utilities import adict from barak.absorb import split_trans_name from barak.io import parse_config, loadobj from barak.interp import AkimaSpline, MapCoord_Interpolator from cloudy.utils import read_observed import numpy as np import os from glob...
mit
CenterForOpenScience/osf.io
api/logs/views.py
13
1561
from rest_framework import generics, permissions as drf_permissions from rest_framework.exceptions import NotFound from framework.auth.oauth_scopes import CoreScopes from osf.models import NodeLog from api.logs.permissions import ( ContributorOrPublicForLogs, ) from api.base import permissions as base_permission...
apache-2.0
frederick623/wat
option_dl.py
1
1542
import sys import urllib2 import zipfile import StringIO import datetime output_path = "hkex_options" def main(argv): if len(argv) > 1: dt = datetime.datetime.strptime(argv[1], "%Y%m%d").date() else: dt = datetime.date.today() + datetime.timedelta(days=-3) while dt < datetime.date.today(): if int(dt.strfti...
apache-2.0
dr4g0nsr/phoenix-kodi-addon
plugin.video.phstreams/resources/lib/resolvers/castalba.py
5
1700
# -*- coding: utf-8 -*- ''' Genesis Add-on Copyright (C) 2015 lambda 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 ...
gpl-2.0
dburkart/check-sieve
test/5435/examples_test.py
2
4569
import unittest import checksieve class TestNotify(unittest.TestCase): def test_example1(self): sieve = ''' require ["enotify", "fileinto", "variables"]; if header :contains "from" "boss@example.org" { notify :importance "1" :message "This is probably very impo...
mit
n0m4dz/odoo
addons/hr_timesheet_invoice/report/account_analytic_profit.py
281
5811
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
anish/buildbot
master/buildbot/test/unit/test_steps_source_base_Source.py
1
6613
# 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...
gpl-2.0
mdanielwork/intellij-community
python/helpers/pydev/build_tools/build_binaries_osx.py
12
2065
from __future__ import unicode_literals import os import subprocess import sys miniconda64_envs = os.getenv('MINICONDA64_ENVS') python_installations = [ r'%s/py26_64/bin/python' % miniconda64_envs, r'%s/py27_64/bin/python' % miniconda64_envs, r'%s/py34_64/bin/python' % miniconda64_envs, r'%s/py35_64/...
apache-2.0
vsoch/deepdive
examples/tutorial_example/step1-basic/experiment-reports/v00001/code/udf/ext_has_spouse.py
90
2326
#! /usr/bin/env python import csv, os, sys # The directory of this UDF file BASE_DIR = os.path.dirname(os.path.realpath(__file__)) # Load the spouse dictionary for distant supervision. # A person can have multiple spouses spouses = set() married_people = set() lines = open(BASE_DIR + '/../data/spouses.tsv').readline...
apache-2.0
mbareta/edx-platform-ft
openedx/core/djangoapps/api_admin/tests/test_models.py
27
6282
# pylint: disable=missing-docstring from smtplib import SMTPException import ddt from django.conf import settings from django.db import IntegrityError from django.test import TestCase import mock import unittest from microsite_configuration.tests.factories import SiteFactory from openedx.core.djangoapps.api_admin.mod...
agpl-3.0
rschiang/ntusc-statute
scripts/utils.py
1
3691
# utils.py - additional functions import re # Common constants RE_CJK_NUMERICS = r'〇ㄧ一二三四五六七八九十百零' RE_CJK_NUMERICS_MIXED = r'〇ㄧ一二三四五六七八九十零壹貳參肆伍陸柒捌玖拾' RE_CJK_NUMERICS_SINGLE = r'一二三四五六七八九十' RE_CJK_PATTERN = '[\u3400-\u4DB5\u4E00-\u9FD5]' RE_CJK_BOUNDARY_PRE = re.compile(r'(?<=' + RE_CJK_PATTERN + r')\s*([\d\-A-Za-z\(]+...
gpl-3.0
ironbox360/django
django/db/models/aggregates.py
42
6612
""" Classes to represent the definitions of aggregate functions. """ from django.core.exceptions import FieldError from django.db.models.expressions import Func, Star from django.db.models.fields import FloatField, IntegerField __all__ = [ 'Aggregate', 'Avg', 'Count', 'Max', 'Min', 'StdDev', 'Sum', 'Variance', ] ...
bsd-3-clause
ProjectSWGCore/NGECore2
scripts/mobiles/rori/poisonous_krevol_queen.py
2
1538
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() mobi...
lgpl-3.0
er432/TASSELpy
TASSELpy/test/net/maizegenetics/dna/snp/GenotypeTableTest.py
1
17490
import unittest import javabridge from javabridge import JavaException, is_instance_of import numpy as np from TASSELpy.TASSELbridge import TASSELbridge try: try: javabridge.get_env() except AttributeError: print("AttributeError: start bridge") TASSELbridge.start() except AssertionEr...
bsd-3-clause
4022321818/2015cd_midterm2
static/Brython3.1.1-20150328-091302/Lib/socket.py
730
14913
# Wrapper module for _socket, providing some additional facilities # implemented in Python. """\ This module provides socket operations and some related functions. On Unix, it supports IP (Internet Protocol) and Unix domain sockets. On other systems, it only supports IP. Functions specific for a socket are available a...
agpl-3.0
ebursztein/SiteFab
SiteFab/linter/frontmatter.py
1
10590
# encoding: utf-8 from collections import Counter import re import os.path #from https://mathiasbynens.be/demo/url-regex diego's one VALID_URL= re.compile(r"^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9...
gpl-3.0
HarryRybacki/osf.io
scripts/consistency/fix_bad_children.py
64
6193
"""Find and fix consistency errors in parent-child relationships. To do a dry run: :: python -m scripts.consistency.fix_bad_chidren dry To run migration: :: python -m scripts.consistency.fix_bad_chidren dry Log: Performed on 2014-09-09 by SL. `find_orphaned_children` 2 projects (9 deleted) missing ...
apache-2.0
sammcveety/incubator-beam
sdks/python/apache_beam/io/gcp/gcsio.py
7
30935
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
Alwnikrotikz/epubia
naver_autospacing.py
3
1159
maxline = 10000 # from web-page qurl = 'http://s.lab.naver.com/autospacing/?' qvalues = { "query": "", "result_type": "paragraph" } qheaders = {"Referer": qurl, "User-Agent": "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)" } import urllib, urllib2 import re de...
mit
maxamillion/ansible-modules-extras
monitoring/zabbix_host.py
11
22461
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013-2014, Epic Games, Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (...
gpl-3.0
rahuldhote/odoo
addons/hr_payroll/report/report_contribution_register.py
377
3380
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # it...
agpl-3.0
GyrosOfWar/servo
tests/wpt/css-tests/tools/webdriver/webdriver/wait.py
263
3563
# Copyright 2011 Software Freedom Conservancy. # # 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...
mpl-2.0
Universal-Model-Converter/UMC3.0a
data/Python/x86/Lib/site-packages/pygame/surfarray.py
13
11950
## pygame - Python Game Library ## Copyright (C) 2007 Marcus von Appen ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Library General Public ## License as published by the Free Software Foundation; either ## version 2 of the License, or (at ...
mit
stackdocker/container-ops
ubuntu-16-04-vnc-desktop/image/usr/lib/web/lightop/__init__.py
2
3427
from flask import (Flask, request, abort, ) import os # Flask app app = Flask(__name__, static_folder='static', static_url_path='', instance_relative_config=True) CONFIG = os.environ.get('CONFIG') or 'config.Development' app.config.from_...
apache-2.0
HyochanPyo/kernel_3.18.9
tools/perf/scripts/python/check-perf-trace.py
1997
2539
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
gpl-2.0
gbiggs/rtsprofile
rtsprofile/message_sending.py
1
20553
# -*- Python -*- # -*- coding: utf-8 -*- '''rtsprofile Copyright (C) 2009-2015 Geoffrey Biggs RT-Synthesis Research Group Intelligent Systems Research Institute, National Institute of Advanced Industrial Science and Technology (AIST), Japan All rights reserved. Licensed under the GNU Lesser Ge...
lgpl-3.0
2947721120/sagacious-capsicum
src/service_specs/steps/http.py
3
7821
# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: david@reciprocitylabs.com # Maintained By: david@reciprocitylabs.com import datetime from behave import given, when, then from iso8601 import parse...
apache-2.0
google/uncertainty-baselines
uncertainty_baselines/datasets/datasets_test.py
1
1049
# coding=utf-8 # Copyright 2021 The Uncertainty Baselines Authors. # # 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 ap...
apache-2.0
kevinarpe/kevinarpe-rambutan3
rambutan3/check_args/collection/RRangeSizeMatcher.py
1
2658
from rambutan3 import RArgs from rambutan3.check_args.base.RAbstractTypeMatcher import RAbstractTypeMatcher from rambutan3.check_args.base.traverse.RTypeMatcherError import RTypeMatcherError from rambutan3.string.RMessageText import RMessageText class RRangeSizeMatcher(RAbstractTypeMatcher): """ This class is...
gpl-3.0
monikagrabowska/osf.io
admin/meetings/forms.py
4
4939
from datetime import datetime from django import forms from django.core.validators import validate_email from framework.auth.core import get_user from website.models import Conference from website.conferences.exceptions import ConferenceError class MultiEmailField(forms.Field): def prepare_value(self, value): ...
apache-2.0
JackWoot/E2E-Messenger
Server/requests/packages/chardet/latin1prober.py
950
5241
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
gpl-2.0
wisonwang/django-lfs
lfs/portlet/models/featured.py
4
2181
# django imports from django import forms from django.db import models from django.template import RequestContext from django.template.loader import render_to_string from django.utils.translation import ugettext_lazy as _ # portlets imports from portlets.models import Portlet # lfs imports from lfs.catalog.models imp...
bsd-3-clause
GenericStudent/home-assistant
homeassistant/components/smartthings/sensor.py
5
12132
"""Support for sensors through the SmartThings cloud API.""" from collections import namedtuple from typing import Optional, Sequence from pysmartthings import Attribute, Capability from homeassistant.const import ( AREA_SQUARE_METERS, CONCENTRATION_PARTS_PER_MILLION, DEVICE_CLASS_BATTERY, DEVICE_CLAS...
apache-2.0
axinging/chromium-crosswalk
build/android/gyp/dex.py
6
7425
#!/usr/bin/env python # # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import json import logging import optparse import os import sys import tempfile import zipfile from util import build_utils def _R...
bsd-3-clause
pxsdirac/vnpy
vn.lts/pyscript/lts_data_type.py
167
86932
# encoding: UTF-8 defineDict = {} typedefDict = {} #////////////////////////////////////////////////////////////////////// #@company shanghai liber information Technology Co.,Ltd #@file SecurityFtdcUserApiDataType.h #@brief 定义业务数据类型 #////////////////////////////////////////////////////////////////////// #/////////...
mit
ClearCorp/odoo-clearcorp
TODO-9.0/budget/hr_expense.py
2
18794
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Addons modules by CLEARCORP S.A. # Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>). # # This program is free software: you can redistribute...
agpl-3.0
mick-d/nipype
nipype/interfaces/ants/tests/test_auto_AverageImages.py
1
1328
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from __future__ import unicode_literals from ..utils import AverageImages def test_AverageImages_inputs(): input_map = dict(args=dict(argstr='%s', ), dimension=dict(argstr='%d', mandatory=True, position=0, ), environ=dict(nohash=True, ...
bsd-3-clause
timmyomahony/python-parsnip
parsnip/__init__.py
1
4250
import urllib import urllib2 import cookielib from lxml import etree DEBUG = False VERSION = "0.0.1" import logging logger = logging.getLogger(__name__) if DEBUG: logging.basicConfig(level=logging.DEBUG) from parsnip import utils class Webtext(object): """ Represents a webtext to be sent to a list of recipients...
mit
baoboa/Crystal-Space
scripts/python/frozen/cspace/iengine.py
1
102370
# This file was automatically generated by SWIG (http://www.swig.org). # Version 1.3.36 # # Don't modify this file, modify the SWIG interface instead. import _iengine import new new_instancemethod = new.instancemethod try: _swig_property = property except NameError: pass # Python < 2.2 doesn't have 'property'....
lgpl-2.1
Hernanarce/pelisalacarta
python/version-command-line/platformcode/platformtools.py
1
1188
# -*- coding: utf-8 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # platformtools # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ from core import config def dialog_ok(heading, line1, line2="", line3=""): return True def dialog_notification(heading,...
gpl-3.0
mhostetter/gnuradio
gr-digital/python/digital/qa_ofdm_serializer_vcc.py
47
9508
#!/usr/bin/env python # # Copyright 2012-2014 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your opt...
gpl-3.0
Samuel789/MediPi
MedManagementWeb/env/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/langhebrewmodel.py
2763
11318
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Simon Montagu # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved...
apache-2.0
balint256/gr-baz
python/borip.py
4
18351
#!/usr/bin/env python """ BorIP client for GNU Radio. Enables access to a remote USRP via BorIP server through a LAN. Uses gr_udp_source with modifications to enable BorIP packet support. Hooks usrp.source_c so BorIP will automatically attempt to connect to a remote server if a local USRP is not present. To spe...
gpl-3.0
slowfranklin/samba
python/samba/tests/unicodenames.py
37
1100
# Copyright (C) 2003 by Martin Pool <mbp@samba.org> # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is...
gpl-3.0