repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
SyamGadde/cython
pyximport/test/test_pyximport.py
13
2070
from __future__ import absolute_import, print_function from pyximport import pyximport; pyximport.install(reload_support=True) import os, sys import time, shutil import tempfile def make_tempdir(): tempdir = os.path.join(tempfile.gettempdir(), "pyrex_temp") if os.path.exists(tempdir): remove_tempdir...
apache-2.0
yize/grunt-tps
tasks/lib/python/Lib/python2.7/test/test_contextlib.py
125
9103
"""Unit tests for contextlib.py, and other context managers.""" import sys import tempfile import unittest from contextlib import * # Tests __all__ from test import test_support try: import threading except ImportError: threading = None class ContextManagerTestCase(unittest.TestCase): def test_contextm...
mit
afrolov1/nova
nova/virt/baremetal/db/sqlalchemy/api.py
3
11612
# Copyright (c) 2012 NTT DOCOMO, INC. # Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "Lic...
apache-2.0
lthurlow/Network-Grapher
proj/external/networkx-1.7/build/lib.linux-i686-2.7/networkx/algorithms/traversal/breadth_first_search.py
14
1422
""" ==================== Breadth-first search ==================== Basic algorithms for breadth-first searching. """ __author__ = """\n""".join(['Aric Hagberg <hagberg@lanl.gov>']) __all__ = ['bfs_edges', 'bfs_tree', 'bfs_predecessors', 'bfs_successors'] import networkx as nx from collections import defa...
mit
emilydolson/forestcat
pyrobot/brain/psom/visvector.py
2
7394
#A set of model vector visualization tools. #Each visualizer should be a subclass of VisVector, which is an abstract class. #If a visualizer is added, it should be added to the if statement in #VisVectorFactory. Each new class should follow the nameing convention #XVisVector, where X is the string that gets passed to ...
agpl-3.0
mantidproject/mantid
scripts/Muon/GUI/Common/home_runinfo_widget/home_runinfo_widget_presenter.py
3
2415
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + from...
gpl-3.0
DavidLP/home-assistant
homeassistant/components/point/__init__.py
4
11084
"""Support for Minut Point.""" import asyncio import logging import voluptuous as vol from homeassistant import config_entries from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_TOKEN, CONF_WEBHOOK_ID from homeassistant.helpers import config_validation as cv from homeassistant.h...
apache-2.0
vmindru/ansible-modules-core
network/basics/uri.py
4
17344
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Romeo Theriault <romeot () hawaii.edu> # # 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 th...
gpl-3.0
paran0ids0ul/infernal-twin
build/pip/pip/index.py
237
47847
"""Routines related to PyPI, indexes""" from __future__ import absolute_import import logging import cgi from collections import namedtuple import itertools import sys import os import re import mimetypes import posixpath import warnings from pip._vendor.six.moves.urllib import parse as urllib_parse from pip._vendor....
gpl-3.0
github-account-because-they-want-it/django
django/contrib/contenttypes/views.py
380
3608
from __future__ import unicode_literals from django import http from django.apps import apps from django.contrib.contenttypes.models import ContentType from django.contrib.sites.requests import RequestSite from django.core.exceptions import ObjectDoesNotExist from django.utils.translation import ugettext as _ def sh...
bsd-3-clause
StevenBlack/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/test/finder_unittest.py
124
5471
# Copyright (C) 2012 Google, Inc. # # 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, this list of conditions and the following disclaimer...
bsd-3-clause
addition-it-solutions/project-all
addons/crm/wizard/crm_phonecall_to_phonecall.py
8
4319
# -*- 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
talavis/Protein-Data-Visualisation
project.py
1
13480
#!/usr/bin/env python2 import sys # check input parameters, generate INDATA list # code placed here to avoid unneccesary vtk loading if len(sys.argv) == 1 : sys.stderr.write('Using standard data set, to use other data:\n'.format(sys.argv[0])) sys.stderr.write('Usage: {0} <pdb file> <connection file> |<protna...
bsd-3-clause
fbradyirl/home-assistant
homeassistant/components/braviatv/media_player.py
2
11127
"""Support for interface with a Sony Bravia TV.""" import ipaddress import logging from getmac import get_mac_address import voluptuous as vol from homeassistant.components.media_player import MediaPlayerDevice, PLATFORM_SCHEMA from homeassistant.components.media_player.const import ( SUPPORT_NEXT_TRACK, SUPP...
apache-2.0
Effi-01/Testing
script.video.F4mProxy/lib/f4mUtils/asn1parser.py
206
1191
# Author: Trevor Perrin # Patch from Google adding getChildBytes() # # See the LICENSE file for legal information regarding use of this file. """Class for parsing ASN.1""" from .compat import * from .codec import * #Takes a byte array which has a DER TLV field at its head class ASN1Parser(object): def __init__(se...
gpl-2.0
gsobczyk/hamster
src/hamster/lib/dbus.py
1
3725
import dbus from dbus.mainloop.glib import DBusGMainLoop as DBusMainLoop from json import dumps, loads from calendar import timegm from hamster.lib import datetime as dt from hamster.lib.fact import Fact """D-Bus communication utilities.""" # file layout: functions sorted in alphabetical order, # not taking into ac...
gpl-3.0
himanshuo/osf.io
website/addons/github/views/hooks.py
36
3114
# -*- coding: utf-8 -*- import os # noqa from dateutil.parser import parse as dateparse from flask import request from website import models from website.project.decorators import must_be_valid_project from website.project.decorators import must_not_be_registration from website.project.decorators import must_have_a...
apache-2.0
thewangcj/MyFlasky
app/__init__.py
1
1626
from flask import Flask from flask_bootstrap import Bootstrap from flask_mail import Mail from flask_moment import Moment from flask_sqlalchemy import SQLAlchemy from config import config # 导入配置 from flask_login import LoginManager from flask_pagedown import PageDown # 初始化flask-login login_manager = LoginManager() #...
mit
jagill/treeano
treeano/sandbox/nodes/paired_conv.py
2
2082
""" node for 2 conv's paired together, which allows more flexible combinations of filter size and padding - specifically even filter sizes can have "same" padding """ import numpy as np import theano import theano.tensor as T import treeano import treeano.nodes as tn import canopy fX = theano.config.floatX @treeano...
apache-2.0
Bedrock02/digital-tribe-site
lib/werkzeug/contrib/cache.py
84
30341
# -*- coding: utf-8 -*- """ werkzeug.contrib.cache ~~~~~~~~~~~~~~~~~~~~~~ The main problem with dynamic Web sites is, well, they're dynamic. Each time a user requests a page, the webserver executes a lot of code, queries the database, renders templates until the visitor gets the page he sees. ...
mit
babble/babble
include/jython/Lib/test/test_binop.py
87
10683
"""Tests for binary operators on subtypes of built-in types.""" import unittest from test import test_support def gcd(a, b): """Greatest common divisor using Euclid's algorithm.""" while a: a, b = b%a, a return b def isint(x): """Test whether an object is an instance of int or long.""" re...
apache-2.0
danielfrg/word2vec
word2vec/wordclusters.py
1
1041
import numpy as np class WordClusters(object): def __init__(self, vocab, clusters): self.vocab = vocab self.clusters = clusters def ix(self, word): """ Returns the index on self.vocab and self.clusters for 'word' """ temp = np.where(self.vocab == word)[0] ...
apache-2.0
brokenjacobs/ansible
lib/ansible/modules/network/cloudengine/ce_snmp_traps.py
39
19559
#!/usr/bin/python # # 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 # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
flan/media-storage
clients/python/media_storage/compression.py
2
6538
""" media-storage : compression =========================== Offers efficient handlers for compressing and decompressing data, using file-like objects (often tempfiles). This module is shared by every Python facet of the media-storage project and changes to one instance should be reflected in all. Usage ----- (De)co...
lgpl-3.0
ahb0327/intellij-community
python/lib/Lib/site-packages/django/contrib/gis/tests/geometries.py
90
33343
import re wkt_regex = re.compile(r'^(?P<type>[A-Z]+) ?\(') class TestGeom: "The Test Geometry class container." def __init__(self, wkt, **kwargs): self.wkt = wkt self.bad = kwargs.pop('bad', False) if not self.bad: m = wkt_regex.match(wkt) if not m: ...
apache-2.0
nitin-cherian/LifeLongLearning
Web_Development_Python/RealPython/real-python-test/env/lib/python3.5/site-packages/pkg_resources/_vendor/packaging/requirements.py
454
4355
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import string import re from pkg_resources.extern.pyparsing import string...
mit
echa/gearman-go
example/py/client.py
7
1499
#!/usr/bin/python import gearman def check_request_status(job_request): if job_request.complete: print "Job %s finished! Result: %s - %s" % (job_request.job.unique, job_request.state, job_request.result) elif job_request.timed_out: print "Job %s timed out!" % job_request.unique elif job_r...
mit
borosnborea/SwordGO_app
example/kivymap/.buildozer/venv/lib/python2.7/site-packages/pip/commands/list.py
168
7412
from __future__ import absolute_import import logging import warnings from pip.basecommand import Command from pip.exceptions import CommandError from pip.index import PackageFinder from pip.utils import ( get_installed_distributions, dist_is_editable) from pip.utils.deprecation import RemovedInPip10Warning from ...
gpl-3.0
micolous/metrodroid
extra/mct_to_mfcdump.py
1
2747
#!/usr/bin/env python3 # -*- mode: python; indent-tabs-mode: nil; tab-width: 2 -*- """ mct_to_mfcdump.py - Converts a dump from MIFARE Classic Tool to mfoc/mfcuk .mfc format (raw data) Copyright 2015-2018 Michael Farrell <micolous+git@gmail.com> This program is free software: you can redistribute it and/or modify it ...
gpl-3.0
migua1204/jikexueyuan
极客学院/BusStopBoard/node_modules/.3.4.0@node-gyp/gyp/pylib/gyp/flock_tool.py
1835
1748
#!/usr/bin/env python # Copyright (c) 2011 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. """These functions are executed via gyp-flock-tool when using the Makefile generator. Used on systems that don't have a built-in flock.""" ...
apache-2.0
chewable/django
django/contrib/localflavor/jp/jp_prefectures.py
543
2089
from django.utils.translation import ugettext_lazy JP_PREFECTURES = ( ('hokkaido', ugettext_lazy('Hokkaido'),), ('aomori', ugettext_lazy('Aomori'),), ('iwate', ugettext_lazy('Iwate'),), ('miyagi', ugettext_lazy('Miyagi'),), ('akita', ugettext_lazy('Akita'),), ('yamagata', ugettext_lazy('Yamagat...
bsd-3-clause
fivejjs/GPy
GPy/models/bcgplvm.py
4
1639
# Copyright (c) 2012-2014, GPy authors (see AUTHORS.txt). # Licensed under the BSD 3-clause license (see LICENSE.txt) import numpy as np from ..core import GP from ..models import GPLVM from ..mappings import * class BCGPLVM(GPLVM): """ Back constrained Gaussian Process Latent Variable Model :param Y: ...
bsd-3-clause
aloverso/SoftwareSystems
hw04/wave3/thinkdsp.py
23
31996
"""This file contains code used in "Think DSP", by Allen B. Downey, available from greenteapress.com Copyright 2013 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ import array import math import numpy import random import scipy import scipy.stats import struct import subprocess import thi...
gpl-3.0
a10networks/a10-openstack-lib
a10_openstack_lib/tests/test_resources.py
1
1779
# Copyright (C) 2016 A10 Networks Inc. 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 requi...
apache-2.0
yongshengwang/builthue
desktop/core/ext-py/requests-2.0.0/requests/packages/bs4/tests/test_html5lib.py
293
2929
"""Tests to ensure that the html5lib tree builder generates good trees.""" import warnings try: from bs4.builder import HTML5TreeBuilder HTML5LIB_PRESENT = True except ImportError, e: HTML5LIB_PRESENT = False from bs4.element import SoupStrainer from bs4.testing import ( HTML5TreeBuilderSmokeTest, ...
apache-2.0
highco-groupe/odoo
addons/delivery/stock.py
8
8971
# -*- 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
foobarbazblarg/stayclean
stayclean-2017-december/display-during-signup.py
1
6725
#!/usr/bin/python # TODO: issues with new oauth2 stuff. Keep using older version of Python for now. # #!/usr/bin/env python from participantCollection import ParticipantCollection import string import re import datetime import pyperclip # Edit Me! # Remember, this is during signup, so current month is not March, it'...
mit
ModdedPA/android_external_chromium_org
chrome/browser/resources/web_dev_style/js_checker.py
59
8940
# 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. """Presubmit script for Chromium JS resources. See chrome/browser/resources/PRESUBMIT.py """ class JSChecker(object): def __init__(self, input_api, o...
bsd-3-clause
hogarthj/ansible
test/units/modules/cloud/amazon/test_elb_application_lb.py
33
4551
# # (c) 2017 Michael Tinning # # 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) import json from copy import deepcopy import pytest from ansible.module_utils._text import to_bytes from ansible.module_utils...
gpl-3.0
0jpq0/kbengine
kbe/res/scripts/common/Lib/email/_encoded_words.py
85
7913
""" Routines for manipulating RFC2047 encoded words. This is currently a package-private API, but will be considered for promotion to a public API if there is demand. """ # An ecoded word looks like this: # # =?charset[*lang]?cte?encoded_string?= # # for more information about charset see the charset module. ...
lgpl-3.0
peterwilletts24/Python-Scripts
plot_scripts/EMBRACE/heat_flux/plot_from_pp_3234_diff_8km.py
2
5598
""" Load pp, plot and save """ import os, sys import matplotlib matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from matplotlib import rc from matplotlib.font_manager import FontProperties from matplotlib import rcParams from mpl_toolkits.basemap import Basemap rc('font', family = '...
mit
111pontes/ydk-py
cisco-ios-xe/ydk/models/cisco_ios_xe/Cisco_IOS_XE_environment_oper.py
1
4896
""" Cisco_IOS_XE_environment_oper This module contains a collection of YANG definitions for monitoring Environment of a Network Element.Copyright (c) 2016\-2017 by Cisco Systems, Inc.All rights reserved. """ import re import collections from enum import Enum from ydk.types import Empty, YList, YLeafList, DELETE,...
apache-2.0
IsaacHaze/tweepy
tweepy/binder.py
40
10796
# Tweepy # Copyright 2009-2010 Joshua Roesslein # See LICENSE for details. from __future__ import print_function import time import re from six.moves.urllib.parse import quote import requests import logging from tweepy.error import TweepError, RateLimitError, is_rate_limit_error_message from tweepy.utils import co...
mit
shashank971/edx-platform
common/lib/xmodule/xmodule/video_module/bumper_utils.py
86
4238
""" Utils for video bumper """ import copy import json import pytz import logging from collections import OrderedDict from datetime import datetime, timedelta from django.conf import settings from .video_utils import set_query_parameter try: import edxval.api as edxval_api except ImportError: edxval_api = No...
agpl-3.0
esemin83/python_training
test/test_db_matches_ui.py
1
1134
from model.group import Group from timeit import timeit from model.group_address import Address_data from test.test_string_value import merge_emails from test.test_string_value import merge_phones_like_on_homepage #def test_group_list(app, db): # print(timeit(lambda: app.group.get_group_list(), number=1)) # def ...
apache-2.0
smlbiobot/SML-Cogs
figlet/figlet.py
1
2994
# -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2017 SML 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...
mit
agry/NGECore2
scripts/mobiles/naboo/kaadu_female.py
2
1593
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
timothycrosley/WebBot
instant_templates/create_webbot_appengine/pygments/lexers/hdl.py
27
16181
# -*- coding: utf-8 -*- """ pygments.lexers.hdl ~~~~~~~~~~~~~~~~~~~ Lexers for hardware descriptor languages. :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, bygroups, include, using, t...
gpl-2.0
glatard/nipype
nipype/workflows/smri/freesurfer/utils.py
15
13485
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: import nipype.pipeline.engine as pe import nipype.interfaces.fsl as fsl import nipype.interfaces.freesurfer as fs import nipype.interfaces.meshfix as mf import nipype.interfaces.io as nio import nipype.in...
bsd-3-clause
steebchen/youtube-dl
youtube_dl/extractor/foxsports.py
31
1391
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( smuggle_url, update_url_query, ) class FoxSportsIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?foxsports\.com/(?:[^/]+/)*(?P<id>[^/]+)' _TEST = { 'url': 'http://www.foxsports.com/tennessee/v...
unlicense
SiriusBizniss/evetowerthing
requests-master/requests/packages/chardet/constants.py
3008
1335
######################## 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...
mit
feinno-tang/framework
node_modules/node-gyp/gyp/tools/graphviz.py
2679
2878
#!/usr/bin/env python # Copyright (c) 2011 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. """Using the JSON dumped by the dump-dependency-json generator, generate input suitable for graphviz to render a dependency graph of targets...
apache-2.0
marcwebbie/youtube-dl
youtube_dl/extractor/vube.py
26
6929
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_str, ) from ..utils import ( int_or_none, ExtractorError, ) class VubeIE(InfoExtractor): IE_NAME = 'vube' IE_DESC = 'Vube.com' _VALID_URL = r'https?://vube\.com/(?:[^/]+/)+(?P<id...
unlicense
zbqf109/goodo
openerp/addons/project_timesheet/__openerp__.py
23
1210
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Bill Time on Tasks', 'version': '1.0', 'category': 'Project Management', 'description': """ Synchronization of project task work entries with timesheet entries. ================================...
gpl-3.0
frt-arch/taiga-back
taiga/projects/issues/permissions.py
6
2290
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # 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 F...
agpl-3.0
benoitsteiner/tensorflow-xsmm
tensorflow/contrib/distributions/python/kernel_tests/seed_stream_test.py
39
3229
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
dpetzold/django
tests/file_storage/models.py
219
1603
""" Storing files according to a custom storage system ``FileField`` and its variations can take a ``storage`` argument to specify how and where files should be stored. """ import random import tempfile from django.core.files.storage import FileSystemStorage from django.db import models class CustomValidNameStorag...
bsd-3-clause
rs2/pandas
pandas/core/arrays/sparse/dtype.py
1
12178
"""Sparse Dtype""" import re from typing import TYPE_CHECKING, Any, List, Optional, Tuple, Type import warnings import numpy as np from pandas._typing import Dtype, DtypeObj from pandas.errors import PerformanceWarning from pandas.core.dtypes.base import ExtensionDtype, register_extension_dtype from pandas.core.dty...
bsd-3-clause
davidcusatis/horizon
openstack_dashboard/dashboards/project/volumes/volumes/forms.py
10
35894
# Copyright 2012 Nebula, Inc. # 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 applicable law o...
apache-2.0
benjaminjkraft/django
tests/select_for_update/tests.py
123
9449
from __future__ import unicode_literals import threading import time from multiple_database.routers import TestRouter from django.db import DatabaseError, connection, router, transaction from django.test import ( TransactionTestCase, override_settings, skipIfDBFeature, skipUnlessDBFeature, ) from .models im...
bsd-3-clause
rve/pracmcm
ca/final.py
1
10402
import random lane_num = 2 lane = [[], []] max_car_num = 10000 road_len = 1000 h = 6 p_b = 0.94 p_0 = 0.5 p_d = 0.1 v_max = [6, 10] gap = 7 p_car = 1 p_crash = 0 time_period = 200 class Car: car_cnt = 0 def __init__(self, v = 1, lane = 1): self.size = 1 if random.random() < 0.1: ...
mit
zorroz/microblog
flask/lib/python2.7/site.py
306
27543
"""Append module search paths for third-party packages to sys.path. **************************************************************** * This module is automatically imported during initialization. * **************************************************************** In earlier versions of Python (up to 1.5a3), scripts or...
bsd-3-clause
basinilya/openwrt
target/linux/x86/image/mkimg_bifferboard.py
561
1265
#!/usr/bin/env python """ Create firmware for 4/8MB Bifferboards, suitable for uploading using either bb_upload8.py or bb_eth_upload8.py """ import struct, sys # Increase the kmax value if the script gives errors about the kernel being # too large. You need to set the Biffboot kmax value to the same value yo...
gpl-2.0
dut3062796s/PTVS
Python/Tests/TestData/VirtualEnv/env/Lib/encodings/rot_13.py
88
2697
#!/usr/bin/env python """ Python Character Mapping Codec for ROT13. See http://ucsub.colorado.edu/~kominek/rot13/ for details. Written by Marc-Andre Lemburg (mal@lemburg.com). """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): ...
apache-2.0
zhouzhenghui/python-for-android
python3-alpha/python3-src/Doc/includes/test.py
139
3744
"""Test module for the noddy examples Noddy 1: >>> import noddy >>> n1 = noddy.Noddy() >>> n2 = noddy.Noddy() >>> del n1 >>> del n2 Noddy 2 >>> import noddy2 >>> n1 = noddy2.Noddy('jim', 'fulton', 42) >>> n1.first 'jim' >>> n1.last 'fulton' >>> n1.number 42 >>> n1.name() 'jim fulton' >>> n1.first = 'will' >>> n1.n...
apache-2.0
rouxbuciu/Handle-My-Music-Business
menu_services.py
2
1960
import os import menu_main import fr_functions import cfg # ================================= # SERVICES MENU # ================================= def view_services(): os.system('clear') print("\n\nService".ljust(40) + " Price") print("="*60) for n in cfg.SERVICES: print("| " + str(n)....
gpl-2.0
terryshi96/script
repo.py
1
2429
#! /usr/bin/python # -*- encoding: utf-8 -*- import sys import os import commands import datetime def post_dingtalk(msg): print('sending dingtalk message.....') os.system("curl %s -H 'Content-Type: application/json' \ -d '{\"msgtype\": \"text\",\"text\": {\"content\": \" %s \"}}'"%(dingtalk_url, msg))...
mit
determinedcheetahs/cheetah_juniper
hadoop/contrib/hod/hodlib/GridServices/service.py
182
8174
#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 use thi...
apache-2.0
brianparry/elastalert
tests/config_test.py
6
7403
# -*- coding: utf-8 -*- import copy import datetime import mock import pytest import elastalert.alerts import elastalert.ruletypes from elastalert.config import get_file_paths from elastalert.config import load_configuration from elastalert.config import load_options from elastalert.config import load_rules from elas...
apache-2.0
zbitmanis/cmanager
scalerd/zba.py
1
3189
#!/usr/bin/env python3 """ Copyright 2017 Andris Zbitkovskis 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 a...
apache-2.0
ovnicraft/openerp-restaurant
account/wizard/account_unreconcile.py
385
2086
# -*- 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
iemejia/beam
sdks/python/apache_beam/transforms/util.py
2
45927
# # 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
sdgdsffdsfff/jumpserver
apps/tickets/views.py
2
1446
from django.views.generic import TemplateView, DetailView from django.utils.translation import ugettext as _ from common.permissions import PermissionsMixin, IsValidUser from .models import Ticket from . import mixins class TicketListView(PermissionsMixin, TemplateView): template_name = 'tickets/ticket_list.html...
gpl-2.0
jeeftor/alfredToday
src/lib/dateutil/tz/tz.py
41
33867
# -*- coding: utf-8 -*- """ This module offers timezone implementations subclassing the abstract :py:`datetime.tzinfo` type. There are classes to handle tzfile format files (usually are in :file:`/etc/localtime`, :file:`/usr/share/zoneinfo`, etc), TZ environment string (in all known formats), given ranges (with help fr...
mit
Changaco/oh-mainline
vendor/packages/Django/django/contrib/staticfiles/management/commands/findstatic.py
101
1185
from __future__ import unicode_literals import os from optparse import make_option from django.core.management.base import LabelCommand from django.utils.encoding import smart_text from django.contrib.staticfiles import finders class Command(LabelCommand): help = "Finds the absolute paths for the given static fi...
agpl-3.0
ipfire/pakfire
src/pakfire/logger.py
1
2606
#!/usr/bin/python3 ############################################################################### # # # Pakfire - The IPFire package management system # # Copyright (C) 2011 Pakfire development team ...
gpl-3.0
armijnhemel/cleanup-for-discogs
cleanup-discogs-continuous.py
1
63272
#!/usr/bin/env python3 # Tool to discover 'smells' in the Discogs data via the API. It downloads # release data and flags releases that need to be fixed. # # The checks are (nearly) identical to cleanup-discogs.py # # The results that are printed by this script are by no means complete # or accurate. # # Licensed unde...
gpl-3.0
mrshelly/openerp71313
openerp/addons/marketing/__init__.py
55
1073
# -*- 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...
agpl-3.0
nydehi/google-appengine-wx-launcher
launcher/log_console_unittest.py
28
2208
#!/usr/bin/env python # # Copyright 2008 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 o...
apache-2.0
Neural-Network/TicTacToe
pybrain/supervised/evolino/population.py
25
6360
__author__ = 'Michael Isik' from pybrain.supervised.evolino.gpopulation import Population, SimplePopulation from pybrain.supervised.evolino.gfilter import Randomization from pybrain.supervised.evolino.individual import EvolinoIndividual, EvolinoSubIndividual from pybrain.tools.kwargsprocessor import KWArgsProcessor ...
bsd-3-clause
wangyum/spark
python/pyspark/sql/window.py
23
12863
# # 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
vermouth1992/deep-learning-playground
utils/data_utils.py
2
8781
import cPickle as pickle import numpy as np import os from scipy.misc import imread def load_CIFAR_batch(filename): """ load single batch of cifar """ with open(filename, 'rb') as f: datadict = pickle.load(f) X = datadict['data'] Y = datadict['labels'] X = X.reshape(10000, 3, 3...
apache-2.0
suyashphadtare/vestasi-erp-1
erpnext/accounts/doctype/pricing_rule/pricing_rule.py
31
9280
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt # For license information, please see license.txt from __future__ import unicode_literals import frappe import json import copy from frappe import throw, _ from frappe.utils import flt, cint from frappe.model.docume...
agpl-3.0
VaishnoReddy/Aminator-
aminator/plugins/provisioner/apt.py
5
7258
# -*- coding: utf-8 -*- # # # Copyright 2013 Netflix, 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 ...
apache-2.0
shootsoft/practice
LeetCode/python/061-090/068-text-justification/formatstring.py
1
2595
class Solution: # @param words, a list of strings # @param L, an integer # @return a list of strings def fullJustify(self, words, L): result = [] length = len(words) i = 0 c = 0 sublength =0 sub = [] while i < length: lc = len(words[i...
apache-2.0
bdh1011/wau
venv/lib/python2.7/site-packages/numpy/ma/timer_comparison.py
76
17500
from __future__ import division, absolute_import, print_function import timeit from functools import reduce import numpy as np from numpy import float_ import np.core.fromnumeric as fromnumeric from np.testing.utils import build_err_msg # Fixme: this does not look right. np.seterr(all='ignore') pi = np.pi class ...
mit
cognitiveclass/edx-platform
common/djangoapps/service_status/views.py
51
1304
""" Django Views for service status app """ import json import time from django.http import HttpResponse from dogapi import dog_stats_api from service_status import tasks from djcelery import celery from celery.exceptions import TimeoutError def index(_): """ An empty view """ return HttpResponse(...
agpl-3.0
brandond/ansible
lib/ansible/modules/windows/win_pagefile.py
52
3997
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Liran Nisanov <lirannis@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # this is a windows documentation stub. actual code lives in the .ps1 # file of the same name ANSIBLE_METADATA = {'metadata...
gpl-3.0
smx-smx/dsl-n55u-bender
release/src/router/libxml2/doc/index.py
87
32908
#!/usr/bin/python -u # # imports the API description and fills up a database with # name relevance to modules, functions or web pages # # Operation needed: # ================= # # install mysqld, the python wrappers for mysql and libxml2, start mysqld # Change the root passwd of mysql: # mysqladmin -u root password ...
gpl-2.0
sho-h/ruby_env
devkit/mingw/bin/lib/posixfile.py
67
8240
"""Extended file operations available in POSIX. f = posixfile.open(filename, [mode, [bufsize]]) will create a new posixfile object f = posixfile.fileopen(fileobject) will create a posixfile object from a builtin file object f.file() will return the original builtin file object f.dup() ...
mit
ch1nh5/tizen_rt
external/iotivity/iotivity_1.2-rel/extlibs/gtest/gtest-1.7.0/test/gtest_test_utils.py
1100
10812
#!/usr/bin/env python # # Copyright 2006, 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...
apache-2.0
espadrine/opera
chromium/src/chrome/test/chromedriver/archive.py
3
2295
# Copyright (c) 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. """Downloads items from the Chromium continuous archive.""" import os import platform import urllib import util CHROME_27_REVISION = '190466' CHROME_2...
bsd-3-clause
akashsinghal/Speech-Memorization-App
Python_Backend/env/lib/python3.6/site-packages/pip/_vendor/cachecontrol/adapter.py
327
4608
import types import functools from pip._vendor.requests.adapters import HTTPAdapter from .controller import CacheController from .cache import DictCache from .filewrapper import CallbackFileWrapper class CacheControlAdapter(HTTPAdapter): invalidating_methods = set(['PUT', 'DELETE']) def __init__(self, cach...
apache-2.0
ekamioka/gpss-research
experiments/2014-01-09-radio.py
4
1466
Experiment(description='Trying to recreate old results using latest code', data_dir='../data/radio/', max_depth=4, random_order=False, k=1, debug=False, local_computation=False, n_rand=9, sd=2, jitter_sd=0.1, ...
mit
nadley/Sick-Beard
lib/hachoir_parser/archive/ace.py
90
9964
""" ACE parser From wotsit.org and the SDK header (bitflags) Partial study of a new block type (5) I've called "new_recovery", as its syntax is very close to the former one (of type 2). Status: can only read totally file and header blocks. Author: Christophe Gisquet <christophe.gisquet@free.fr> Creation date: 19 jan...
gpl-3.0
ibmdb/db2pythonbuildpack
vendor/pip-1.3.1/pip/basecommand.py
63
7160
"""Base Command class, and related routines""" import os import socket import sys import tempfile import traceback import time import optparse from pip.log import logger from pip.download import urlopen from pip.exceptions import (BadCommand, InstallationError, UninstallationError, Command...
mit
dandygithub/kodi
addons/plugin.audio.music.yandex/requests/__init__.py
35
2197
# -*- coding: utf-8 -*- # __ # /__) _ _ _ _ _/ _ # / ( (- (/ (/ (- _) / _) # / """ Requests HTTP library ~~~~~~~~~~~~~~~~~~~~~ Requests is an HTTP library, written in Python, for human beings. Basic GET usage: >>> import requests >>> r = requests.get('https://www.python.org') >>> ...
gpl-3.0
cr/fxos-certsuite
web-platform-tests/tests/tools/pywebsocket/src/mod_pywebsocket/handshake/hybi.py
139
17070
# Copyright 2012, 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 of conditions and the f...
mpl-2.0
VisheshHanda/production_backup
erpnext/buying/doctype/purchase_order/test_purchase_order.py
19
5835
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import unittest import frappe import frappe.defaults from frappe.utils import flt, add_days, nowdate from erpnext.buying.doctype.purchase_order.purchase...
gpl-3.0
CKehl/pylearn2
pylearn2/models/vae/kl.py
45
5415
""" Classes implementing logic related to the analytical computation of the KL divergence between :math:`q_\\phi(\\mathbf{z} \\mid \\mathbf{x})` and :math:`p_\\theta(\\mathbf{z})` in the VAE framework """ __authors__ = "Vincent Dumoulin" __copyright__ = "Copyright 2014, Universite de Montreal" __credits__ = ["Vincent D...
bsd-3-clause