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
dabiboo/youtube-dl
youtube_dl/extractor/trutube.py
147
1354
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import xpath_text class TruTubeIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?trutube\.tv/(?:video/|nuevo/player/embed\.php\?v=)(?P<id>[0-9]+)' _TESTS = [{ 'url': 'http://trutube.tv/video/14880/Ramses-II-Prov...
unlicense
SebastienBocquet/ConvertibleUAV
Tools/MAVLink/mavlink/pymavlink/mavwp.py
5
13222
''' module for loading/saving waypoints ''' import mavutil, time, copy import logging import mavutil try: from google.protobuf import text_format import mission_pb2 HAVE_PROTOBUF = True except ImportError: HAVE_PROTOBUF = False class MAVWPError(Exception): '''MAVLink WP error class''' def __i...
gpl-3.0
Beyond-Imagination/BlubBlub
ChatbotServer/ChatbotEnv/Lib/site-packages/konlpy/corpus.py
1
1849
#! /usr/bin/python2.7 # -*- coding: utf-8 -*- import os from . import utils class CorpusLoader(): """Loader for corpora. For a complete list of corpora available in KoNLPy, refer to :ref:`corpora`. .. code-block:: python >>> from konlpy.corpus import kolaw >>> fids = kolaw.fileids(...
gpl-3.0
ErickMurillo/aprocacaho
organizacion/admin.py
1
3456
from django.contrib import admin from .models import * # Register your models here. #organizacion class InlineEscuelaCampo(admin.TabularInline): model = EscuelaCampo extra = 1 class OrganizacionAdmin(admin.ModelAdmin): inlines = [InlineEscuelaCampo] list_display = ('id','nombre','siglas') list_dis...
mit
laurenrevere/osf.io
osf_tests/conftest.py
6
2359
import logging import pytest from faker import Factory from framework.django.handlers import handlers as django_handlers from framework.flask import rm_handlers from website import settings from website.app import init_app from website.project.signals import contributor_added from website.project.views.contributor im...
apache-2.0
dreamingbinary/rdbms-subsetter
setup.py
8
1365
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() curdir = os.path.dirname(os.path.realpath(__file__)) readme = op...
cc0-1.0
frouty/odoogoeen
addons/l10n_it/__init__.py
447
1161
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010 # OpenERP Italian Community (<http://www.openerp-italia.org>) # Servabit srl # Agile Business Group sagl # Domsense srl # Albatos srl # # Copyright (C)...
agpl-3.0
linktlh/Toontown-journey
toontown/toon/InventoryBase.py
3
11970
from pandac.PandaModules import * from toontown.toonbase import ToontownGlobals from toontown.toonbase.ToontownBattleGlobals import * from direct.showbase import DirectObject from direct.directnotify import DirectNotifyGlobal from direct.distributed.PyDatagram import PyDatagram from direct.distributed.PyDatagramIterato...
apache-2.0
srio/shadow3-scripts
transfocator_id30b.py
1
25823
import numpy import xraylib """ transfocator_id30b : transfocator for id13b: It can: 1) guess the lens configuration (number of lenses for each type) for a given photon energy and target image size. Use transfocator_compute_configuration() for this task 2) for a given tran...
mit
jose187/gh_word_count
gh_word_count/__init__.py
1
2681
from ommit_words import list_ommited_words from re import sub import operator class _input_list: def __init__(self,list_TITLES): self.list_TITLES = list_TITLES self.list_remove = list_ommited_words() def _word_count(self): # these are all the words that are in t...
bsd-2-clause
bdh1011/wau
venv/lib/python2.7/site-packages/twisted/internet/_glibbase.py
27
12813
# -*- test-case-name: twisted.internet.test -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ This module provides base support for Twisted to interact with the glib/gtk mainloops. The classes in this module should not be used directly, but rather you should import gireactor or gtk3react...
mit
konradxyz/dev_fileserver
plugins/riemann-controller/setup.py
2
1329
######### # Copyright (c) 2013 GigaSpaces Technologies Ltd. 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...
apache-2.0
naveentata/coala-bears
tests/hypertext/BootLintBearTest.py
24
2763
from bears.hypertext.BootLintBear import BootLintBear from coalib.testing.LocalBearTestHelper import verify_local_bear good_file = """ <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="wid...
agpl-3.0
aaronsw/watchdog
vendor/rdflib-2.4.0/rdflib/sparql/bison/Expression.py
4
2821
from Util import ListRedirect class ParsedConditionalAndExpressionList(ListRedirect): """ A list of ConditionalAndExpressions, joined by '||' """ pyBooleanOperator = ' or ' def __init__(self,conditionalAndExprList): if isinstance(conditionalAndExprList,list): self._list = condit...
agpl-3.0
languagetool-org/languagetool
languagetool-language-modules/sr/src/main/resources/org/languagetool/resource/sr/script/gettags.py
4
3785
#!/usr/bin/env python3 # coding: utf-8 """ Program reads input file line by line, matching PoS tags. They are written to the output file in order of appearance. Each tag is written to output file only once. """ import argparse import logging import re import os import sys _args_ = None _logger_ = None _out_file_ = N...
lgpl-2.1
benoitsteiner/tensorflow-xsmm
tensorflow/contrib/kfac/examples/convnet_mnist_distributed_main.py
15
2254
# Copyright 2017 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...
apache-2.0
alu042/edx-platform
openedx/core/djangoapps/profile_images/tests/test_views.py
29
21972
""" Test cases for the HTTP endpoints of the profile image api. """ from contextlib import closing import datetime from pytz import UTC import unittest from django.conf import settings from django.core.urlresolvers import reverse from django.http import HttpResponse import ddt import mock from mock import patch from ...
agpl-3.0
j-carl/ansible
lib/ansible/plugins/inventory/ini.py
2
17394
# Copyright (c) 2017 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 DOCUMENTATION = ''' inventory: ini version_added: "2.4" short_description: Uses an Ansibl...
gpl-3.0
CSD-Public/stonix
src/tests/rules/unit_tests/zzzTestRuleDisableOpenSafeSafari.py
1
4752
############################################################################### # # # Copyright 2019. Triad National Security, LLC. All rights reserved. # # This program was produced under U.S. Government contract 89233218CNA000001 # ...
gpl-2.0
tchx84/debian-pkg-sugar
extensions/cpsection/keyboard/model.py
11
6025
# Copyright (C) 2013 Sugar Labs # Copyright (C) 2009 OLPC # Author: Sayamindu Dasgupta <sayamindu@laptop.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, o...
gpl-2.0
yanchen036/tensorflow
tensorflow/contrib/learn/python/learn/learn_runner_test.py
76
16067
# Copyright 2016 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...
apache-2.0
HomeRad/TorCleaner
wc/filter/rules/FolderRule.py
1
3945
# -*- coding: iso-8859-1 -*- # Copyright (C) 2000-2009 Bastian Kleineidam """ Group filter rules into folders. """ from ... import fileutil, configuration from . import Rule def recalc_up_down(rules): """ Add .up and .down attributes to rules, used for display up/down arrows in GUIs """ upper = le...
gpl-2.0
Microsoft/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/json/tool.py
11
1463
r"""Command-line tool to validate and pretty-print JSON Usage:: $ echo '{"json":"obj"}' | python -m json.tool { "json": "obj" } $ echo '{ 1.2:3.4}' | python -m json.tool Expecting property name enclosed in double quotes: line 1 column 3 (char 2) """ import argparse import json import sys ...
apache-2.0
finch0219/linux
scripts/gdb/linux/utils.py
630
4267
# # gdb helper commands and functions for Linux kernel debugging # # common utilities # # Copyright (c) Siemens AG, 2011-2013 # # Authors: # Jan Kiszka <jan.kiszka@siemens.com> # # This work is licensed under the terms of the GNU GPL version 2. # import gdb class CachedType: def __init__(self, name): s...
gpl-2.0
WillisXChen/django-oscar
oscar/lib/python2.7/site-packages/pygments/lexers/dsls.py
72
18768
# -*- coding: utf-8 -*- """ pygments.lexers.dsls ~~~~~~~~~~~~~~~~~~~~ Lexers for various domain-specific languages. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, bygroups, words, inc...
bsd-3-clause
skg-net/ansible
lib/ansible/modules/cloud/amazon/ec2_snapshot.py
71
9675
#!/usr/bin/python # Copyright: 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', 'status': ['preview'], ...
gpl-3.0
funkring/fdoo
addons/web_linkedin/web_linkedin.py
333
4485
# -*- 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
Hybrid-Cloud/cinder
cinder/tests/unit/volume/drivers/emc/scaleio/test_create_volume.py
5
5821
# Copyright (c) 2013 - 2015 EMC Corporation. # 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 # # Unle...
apache-2.0
RAJSD2610/SDNopenflowSwitchAnalysis
TotalFlowPlot.py
1
2742
import os import pandas as pd import matplotlib.pyplot as plt import seaborn seaborn.set() path= os.path.expanduser("~/Desktop/ece671/udpt8") num_files = len([f for f in os.listdir(path)if os.path.isfile(os.path.join(path, f))]) print(num_files) u8=[] i=0 def file_len(fname): with open(fname) as f: for i,...
gpl-3.0
Stratio/cassandra
test/system/test_thrift_server.py
10
107002
# 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 u...
apache-2.0
mattskone/garage-alarm
exploring/iso_ss.py
2
1392
""" Utility script for experimenting with different ISO and shutter speeds. """ from fractions import Fraction import sys import time from picamera import PiCamera def get_camera(): camera = PiCamera() camera.hflip = True camera.vflip = True return camera def custom(): c = get_camera() is...
mit
TRESCLOUD/odoopub
addons/l10n_be/wizard/l10n_be_vat_intra.py
332
14728
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # Adapted by Noviat to # - make the 'mand_id' field optional # - support Noviat tax code scheme #...
agpl-3.0
CatsAndDogsbvba/odoo
addons/project/res_config.py
232
4551
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
codegooglecom/jaikuengine
common/test/sms.py
34
3749
# Copyright 2009 Google 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 writing, ...
apache-2.0
avanov/django
django/utils/_os.py
502
3581
from __future__ import unicode_literals import os import sys import tempfile from os.path import abspath, dirname, isabs, join, normcase, normpath, sep from django.core.exceptions import SuspiciousFileOperation from django.utils import six from django.utils.encoding import force_text if six.PY2: fs_encoding = sy...
bsd-3-clause
thjashin/tensorflow
tensorflow/python/framework/common_shapes.py
40
26355
# Copyright 2015 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...
apache-2.0
Designist/sympy
sympy/functions/elementary/tests/test_complexes.py
15
25268
from sympy import ( Abs, adjoint, arg, atan2, conjugate, cos, DiracDelta, E, exp, expand, Expr, Function, Heaviside, I, im, log, nan, oo, pi, Rational, re, S, sign, sin, sqrt, Symbol, symbols, transpose, zoo, exp_polar, Piecewise, Interval, comp, Integral) from sympy.utilities.pytest import XFAIL, raise...
bsd-3-clause
obruns/gtest
test/gtest_output_test.py
188
12260
#!/usr/bin/env python # # Copyright 2008, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
bsd-3-clause
cschenck/blender_sim
fluid_sim_deps/blender-2.69/2.69/scripts/addons/io_scene_3ds/__init__.py
1
6950
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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 program is distrib...
gpl-3.0
HyperloopTeam/FullOpenMDAO
cantera-2.0.2/interfaces/python/MixMaster/Units/unit.py
1
2833
import operator class unit: _zero = (0,) * 7 _negativeOne = (-1, ) * 7 _labels = ('m', 'kg', 's', 'A', 'K', 'mol', 'cd') def __init__(self, value, derivation): self.value = value self.derivation = derivation return def __add__(self, other): if not self.derivati...
gpl-2.0
laiqiqi886/kbengine
kbe/res/scripts/common/Lib/lib2to3/pytree.py
71
28305
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """ Python parse tree definitions. This is a very concrete parse tree; we need to keep every token and even the comments and whitespace between tokens. There's also a pattern matching implementation here. """ __autho...
lgpl-3.0
lmazuel/azure-sdk-for-python
azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/windows_configuration_py3.py
1
2719
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
ppwwyyxx/tensorflow
tensorflow/python/keras/utils/version_utils.py
3
2667
# Copyright 2019 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...
apache-2.0
matiboy/django_safari_notifications
django_safari_notifications/apps.py
1
1111
# -*- coding: utf-8 from django.apps import AppConfig import logging class DjangoSafariNotificationsConfig(AppConfig): name = 'django_safari_notifications' verbose_name = 'Safari Push Notifications' version = 'v1' service_base = 'push' userinfo_key = 'userinfo' logger = logging.getLogger('djan...
mit
TomSkelly/MatchAnnot
showAnnot.py
1
2299
#!/usr/bin/env python # Read annotation file, print selected stuff in human-readable format. # AUTHOR: Tom Skelly (thomas.skelly@fnlcr.nih.gov) import os import sys import optparse import re # regular expressions import cPickle as pickle from tt_log import logger import Annotations as anno VERSION = '201504...
gpl-3.0
gugarosa/app_h
node_modules/node-ninja/gyp/pylib/gyp/MSVSNew.py
1835
12124
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """New implementation of Visual Studio project generation.""" import os import random import gyp.common # hashlib is supplied as of Python 2.5 as the replacemen...
gpl-3.0
jamesblunt/edx-platform
lms/djangoapps/branding/migrations/0002_auto__add_brandingapiconfig.py
84
5295
# -*- coding: utf-8 -*- from south.utils import datetime_utils as 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 'BrandingApiConfig' db.create_table('branding_brandingapic...
agpl-3.0
meredith-digops/ansible
lib/ansible/modules/utilities/helper/meta.py
27
3847
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Ansible, a Red Hat company # # 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, o...
gpl-3.0
phuihock/birtconn
addons/report_birt/wizard/report_birt.py
2
13419
# -*- encoding: utf-8 -*- from collections import OrderedDict from datetime import datetime, date, time from lxml import etree from openerp import netsvc, tools, SUPERUSER_ID from openerp.osv import fields, osv from openerp.report.interface import report_int from openerp.tools.translate import _ import openerp.pooler ...
agpl-3.0
eaas-framework/virtualbox
src/VBox/GuestHost/OpenGL/spu_loader/spucopy.py
22
1634
# Copyright (c) 2001, Stanford University # All rights reserved. # # See the file LICENSE.txt for information on redistributing this software. import sys import apiutil apiutil.CopyrightC() print """ /* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED BY spucopy.py SCRIPT */ #include "cr_spu.h" #include "cr_mem.h"...
gpl-2.0
sdcooke/django
django/utils/dateformat.py
365
10712
""" PHP date() style date formatting See http://www.php.net/date for format strings Usage: >>> import datetime >>> d = datetime.datetime.now() >>> df = DateFormat(d) >>> print(df.format('jS F Y H:i')) 7th October 2003 11:39 >>> """ from __future__ import unicode_literals import calendar import datetime import re impo...
bsd-3-clause
Midrya/chromium
rietveld.py
1
26054
# coding: utf-8 # Copyright (c) 2012 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. """Defines class Rietveld to easily access a rietveld instance. Security implications: The following hypothesis are made: - Rietveld enf...
bsd-3-clause
abhikumar22/MYBLOG
blg/Lib/site-packages/django-1.11.7-py3.6.egg/django/contrib/gis/geos/prepared.py
180
1575
from .base import GEOSBase from .prototypes import prepared as capi class PreparedGeometry(GEOSBase): """ A geometry that is prepared for performing certain operations. At the moment this includes the contains covers, and intersects operations. """ ptr_type = capi.PREPGEOM_PTR destructor =...
gpl-3.0
0x27/clusterd
src/platform/tomcat/auxiliary/info_dump.py
6
1972
from src.platform.tomcat.authenticate import checkAuth from src.platform.tomcat.interfaces import TINTERFACES from auxiliary import Auxiliary from log import LOG import utility class Auxiliary: """ The Manager application for Tomcat has a nifty fingerprinting app that allows us to retrieve host OS, versio...
mit
josephnoir/RIOT
cpu/esp8266/vendor/esp-idf/partition_table/gen_esp32part.py
6
14010
#!/usr/bin/env python # # ESP32 partition table generation tool # # Converts partition tables to/from CSV and binary formats. # # See http://esp-idf.readthedocs.io/en/latest/api-guides/partition-tables.html # for explanation of partition table structure and uses. # # Copyright 2015-2016 Espressif Systems (Shanghai) PTE...
lgpl-2.1
xapi-project/xen-api-sdk
python/samples/vm_start_async.py
8
3389
#!/usr/bin/env python # Copyright (c) Citrix Systems, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1) Redistributions of source code must retain the above copyright # notice,...
bsd-2-clause
D-L/SimpleBookMarks
src/tornado/auth.py
15
57309
#!/usr/bin/env python # # Copyright 2009 Facebook # # 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 a...
gpl-2.0
planetserver/webclient
js/proj4js/tools/mergejs.py
161
7973
#!/usr/bin/env python # # Merge multiple JavaScript source code files into one. # # Usage: # This script requires source files to have dependencies specified in them. # # Dependencies are specified with a comment of the form: # # // @requires <file path> # # e.g. # # // @requires Geo/DataSource.js # # or (idea...
gpl-3.0
Mazecreator/tensorflow
tensorflow/contrib/learn/python/learn/learn_io/__init__.py
79
2464
# Copyright 2016 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...
apache-2.0
themass/zulip
api/zulip/__init__.py
115
17705
# -*- coding: utf-8 -*- # Copyright ยฉ 2012-2014 Zulip, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, mod...
apache-2.0
jmhodges/letsencrypt
letsencrypt-nginx/letsencrypt_nginx/parser.py
26
16596
"""NginxParser is a member object of the NginxConfigurator class.""" import glob import logging import os import pyparsing import re from letsencrypt import errors from letsencrypt_nginx import obj from letsencrypt_nginx import nginxparser logger = logging.getLogger(__name__) class NginxParser(object): """Cla...
apache-2.0
redhatrises/freeipa
ipatests/test_webui/ui_driver.py
2
60841
# Authors: # Petr Vobornik <pvoborni@redhat.com> # # Copyright (C) 2013 Red Hat # see file 'COPYING' for use and warranty information # # 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 ...
gpl-3.0
fzimmermann89/pyload
module/common/APIExerciser.py
41
4349
# -*- coding: utf-8 -*- import string from threading import Thread from random import choice, random, sample, randint from time import time, sleep from math import floor import gc from traceback import print_exc, format_exc from module.remote.thriftbackend.ThriftClient import ThriftClient, Destination def createURL...
gpl-3.0
TheTimmy/spack
var/spack/repos/builtin/packages/shortstack/package.py
3
1943
############################################################################## # 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...
lgpl-2.1
2014c2g4/2015cda_g7
static/Brython3.1.0-20150301-090019/Lib/site-packages/pygame/pkgdata.py
603
2146
"""pkgdata is a simple, extensible way for a package to acquire data file resources. The getResource function is equivalent to the standard idioms, such as the following minimal implementation:: import sys, os def getResource(identifier, pkgname=__name__): pkgpath = os.path.dirname(sys.modules[p...
gpl-3.0
jezdez/django-hosts
tests/test_defaults.py
3
3037
from django.core.exceptions import ImproperlyConfigured from django_hosts.defaults import host, patterns from django_hosts.resolvers import get_host_patterns from .base import HostsTestCase class PatternsTests(HostsTestCase): def test_pattern(self): host_patterns = patterns('', host(r'api', ...
bsd-3-clause
ojake/django
django/core/management/base.py
83
23884
# -*- coding: utf-8 -*- """ Base classes for writing management commands (named commands which can be executed through ``django-admin`` or ``manage.py``). """ from __future__ import unicode_literals import os import sys import warnings from argparse import ArgumentParser from optparse import OptionParser import djang...
bsd-3-clause
mm112287/2015cda_g8
static/Brython3.1.0-20150301-090019/Lib/shutil.py
720
39101
"""Utility functions for copying and archiving files and directory trees. XXX The functions here don't copy the resource fork or other metadata on Mac. """ import os import sys import stat from os.path import abspath import fnmatch import collections import errno import tarfile try: import bz2 del bz2 _...
gpl-3.0
mlaitinen/odoo
addons/auth_ldap/users_ldap.py
133
10812
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Publ...
agpl-3.0
gonicus/gosa
backend/src/gosa/backend/plugins/samba/logonhours.py
1
2755
# 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 time from gosa.backend.objects.types import AttributeType class SambaLogonHoursAttribute(At...
lgpl-2.1
JavaRabbit/CS496_capstone
appengine/standard/Capstone_inPython/reportlab/graphics/testshapes.py
3
17300
#!/bin/env python #Copyright ReportLab Europe Ltd. 2000-2017 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/testshapes.py # testshapes.py - draws shapes onto a PDF canvas. __version__ = ''' $Id $ ''' __doc__='''Execute this scrip...
apache-2.0
acrsilva/animated-zZz-machine
bundle_final_app/libs/pyqtgraph-develop/examples/customGraphicsItem.py
28
2235
""" Demonstrate creation of a custom graphic (a candlestick plot) """ import initExample ## Add path to library (just for examples; you do not need this) import pyqtgraph as pg from pyqtgraph import QtCore, QtGui ## Create a subclass of GraphicsObject. ## The only required methods are paint() and boundingRect() ## ...
lgpl-3.0
nan86150/ImageFusion
lib/python2.7/site-packages/numpy/core/tests/test_unicode.py
69
12594
from __future__ import division, absolute_import, print_function import sys from numpy.testing import * from numpy.core import * from numpy.compat import asbytes, sixu # Guess the UCS length for this python interpreter if sys.version_info[:2] >= (3, 3): # Python 3.3 uses a flexible string representation ucs4...
mit
mice-software/maus
tests/integration/test_simulation/test_beam_maker/binomial_beam_config.py
1
4151
# This file is part of MAUS: http://micewww.pp.rl.ac.uk:8080/projects/maus # # MAUS 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...
gpl-3.0
berkmancenter/mediacloud
apps/common/tests/python/mediawords/util/test_extract_article_html_from_page_html.py
1
3359
import multiprocessing from typing import Union from unittest import TestCase from mediawords.test.hash_server import HashServer from mediawords.util.config.common import CommonConfig from mediawords.util.extract_article_from_page import extract_article_html_from_page_html from mediawords.util.network import random_un...
agpl-3.0
sndnvaps/linux-1
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
charmander/livestreamer
examples/gst-player.py
22
3897
#!/usr/bin/env python from __future__ import print_function import sys import gi from gi.repository import GObject as gobject, Gst as gst from livestreamer import Livestreamer, StreamError, PluginError, NoPluginError def exit(msg): print(msg, file=sys.stderr) sys.exit() class LivestreamerPlayer(object):...
bsd-2-clause
amagnus/pulsegig
app/models.py
1
1894
from django.db import models from django.contrib.auth.models import User class Guy(models.Model): user = models.OneToOneField(User, primary_key=True) cell = models.CharField(max_length=15) metroarea_name = models.CharField(max_length=30, default=None, null=True) metroareaID = models.IntegerField(defau...
mit
liangz0707/scikit-learn
benchmarks/bench_sparsify.py
323
3372
""" Benchmark SGD prediction time with dense/sparse coefficients. Invoke with ----------- $ kernprof.py -l sparsity_benchmark.py $ python -m line_profiler sparsity_benchmark.py.lprof Typical output -------------- input data sparsity: 0.050000 true coef sparsity: 0.000100 test data sparsity: 0.027400 model sparsity:...
bsd-3-clause
trel/irods-qgis
test/qgis_interface.py
112
6395
# coding=utf-8 """QGIS plugin implementation. .. 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. .. note...
gpl-2.0
JackKelly/neuralnilm_prototype
scripts/e307.py
2
6092
from __future__ import print_function, division import matplotlib import logging from sys import stdout matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from neuralnilm import (Net, RealApplianceSource, BLSTMLayer, DimshuffleLayer, Bidirectio...
mit
mcollins12321/anita
venv/lib/python2.7/site-packages/setuptools/command/setopt.py
458
5080
from distutils.util import convert_path from distutils import log from distutils.errors import DistutilsOptionError import distutils import os from setuptools import Command __all__ = ['config_file', 'edit_config', 'option_base', 'setopt'] def config_file(kind="local"): """Get the filename of the distutils, lo...
mit
karstenw/FMPLayoutExporter
fmpa10.py
1
5014
version = 1.1 path = u'/Applications/FileMaker/FileMaker Pro 11 Advanced/FileMaker Pro Advanced.app' classes = \ [('application', 'capp'), ('window', 'cwin'), ('document', 'docu'), ('database', 'cDB '), ('table', 'cTBL'), ('FileMaker_script', 'cSCP'), ('layout', 'ctbl'), ('field', 'ccol'), ('record', 'crow'), ...
bsd-2-clause
PyBossa/pybossa
pybossa/auth/token.py
1
1271
# -*- coding: utf8 -*- # This file is part of PYBOSSA. # # Copyright (C) 2015 Scifabric LTD. # # PYBOSSA 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 op...
agpl-3.0
tpsatish95/Python-Workshop
Python Environment Setup/Alternate/1. Python/1. Installer/Python-3.4.0(Linux)/Lib/contextlib.py
83
11648
"""Utilities for with-statement contexts. See PEP 343.""" import sys from collections import deque from functools import wraps __all__ = ["contextmanager", "closing", "ContextDecorator", "ExitStack", "redirect_stdout", "suppress"] class ContextDecorator(object): "A base class or mixin that enables c...
apache-2.0
cwayne18/ActivityTracker
py/gpxpy/parser.py
3
6507
# -*- coding: utf-8 -*- # Copyright 2011 Tomo Krajina # # 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 ...
gpl-3.0
amenonsen/ansible
lib/ansible/modules/remote_management/redfish/idrac_redfish_command.py
12
5893
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2018 Dell EMC Inc. # GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'status': ['preview'], ...
gpl-3.0
ekumenlabs/terminus
terminus/generators/rndf_id_mapper.py
1
2695
""" Copyright (C) 2017 Open Source Robotics Foundation 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...
apache-2.0
Sveder/letsencrypt
letshelp-letsencrypt/docs/conf.py
17
10359
# -*- coding: utf-8 -*- # # letshelp-letsencrypt documentation build configuration file, created by # sphinx-quickstart on Sun Oct 18 13:40:19 2015. # # 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 # autogenerate...
apache-2.0
bala4901/odoo
addons/account_bank_statement_extensions/__openerp__.py
378
2357
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it u...
agpl-3.0
wkia/kodi-addon-repo
plugin.audio.openlast/default.py
1
6672
# -*- coding: utf-8 -*- import os import sys import urllib import urlparse import xbmcaddon import xbmcgui import xbmcplugin if sys.version_info < (2, 7): import simplejson as json else: import json from logging import log from util import build_url __addon__ = xbmcaddon.Addon() #__addonid__ = __addon__.get...
gpl-2.0
zchking/odoo
addons/l10n_in_hr_payroll/wizard/__init__.py
430
1110
# -*- 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
jonathan-beard/edx-platform
cms/djangoapps/contentstore/views/export_git.py
146
1723
""" This views handles exporting the course xml to a git repository if the giturl attribute is set. """ import logging from django.contrib.auth.decorators import login_required from django.core.exceptions import PermissionDenied from django.views.decorators.csrf import ensure_csrf_cookie from django.utils.translation...
agpl-3.0
JamesRaynor67/mptcp_with_machine_learning
src/config-store/bindings/modulegen__gcc_LP64.py
4
68756
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
yan12125/youtube-dl
youtube_dl/extractor/tvland.py
14
1468
# coding: utf-8 from __future__ import unicode_literals from .spike import ParamountNetworkIE class TVLandIE(ParamountNetworkIE): IE_NAME = 'tvland.com' _VALID_URL = r'https?://(?:www\.)?tvland\.com/(?:video-clips|(?:full-)?episodes)/(?P<id>[^/?#.]+)' _FEED_URL = 'http://www.tvland.com/feeds/mrss/' _...
unlicense
aacole/ursula-monitoring
sensu/plugins/metrics-nova-state.py
2
1353
#!/usr/bin/env python # #RED from argparse import ArgumentParser import socket import time import os import shade DEFAULT_SCHEME = '{}.nova.states'.format(socket.gethostname()) def output_metric(name, value): print '{}\t{}\t{}'.format(name, value, int(time.time())) def main(): parser = ArgumentParser() ...
apache-2.0
takeshineshiro/django
tests/forms_tests/tests/test_media.py
169
45896
# -*- coding: utf-8 -*- from django.forms import CharField, Form, Media, MultiWidget, TextInput from django.template import Context, Template from django.test import SimpleTestCase, override_settings from django.utils.encoding import force_text @override_settings( STATIC_URL=None, MEDIA_URL='http://media.exam...
bsd-3-clause
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/encodings/cp437.py
272
34564
""" Python Character Mapping Codec cp437 generated from 'VENDORS/MICSFT/PC/CP437.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict...
gpl-2.0
ARudiuk/mne-python
examples/inverse/plot_label_from_stc.py
31
3963
""" ================================================= Generate a functional label from source estimates ================================================= Threshold source estimates and produce a functional label. The label is typically the region of interest that contains high values. Here we compare the average time ...
bsd-3-clause
mozman/ezdxf
tests/test_06_math/test_630b_bezier4p_functions.py
1
4662
# Copyright (c) 2010-2020 Manfred Moitzi # License: MIT License import pytest import random from ezdxf.math import ( cubic_bezier_interpolation, Vec3, Bezier3P, quadratic_to_cubic_bezier, Bezier4P, have_bezier_curves_g1_continuity, bezier_to_bspline, ) def test_vertex_interpolation(): points = [(0, 0), (...
mit