repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
WikipediaLibrary/TWLight
refs/heads/master
TWLight/users/migrations/0066_move_editcounts_to_log.py
1
# Generated by Django 3.0.11 on 2020-11-20 19:32 from django.db import migrations def move_wp_editcounts_to_logs(apps, schema_editor): Editor = apps.get_model("users", "Editor") EditorLog = apps.get_model("users", "EditorLog") for editor in Editor.objects.all(): if ( editor.wp_editcou...
ahnqirage/thrift
refs/heads/master
lib/py/src/transport/__init__.py
348
# # 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...
DiptoDas8/Biponi
refs/heads/master
lib/python2.7/site-packages/braintree/util/constants.py
5
class Constants(object): @staticmethod def get_all_constant_values_from_class(klass): return [klass.__dict__[item] for item in dir(klass) if not item.startswith("__")]
liu602348184/django
refs/heads/master
django/contrib/sites/requests.py
695
from __future__ import unicode_literals from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class RequestSite(object): """ A class that shares the primary interface of Site (i.e., it has ``domain`` and ``name`` attributes) but gets its data from a Django HttpReq...
agry/NGECore2
refs/heads/master
scripts/expertise/expertise_en_sweeping_pirouette_1.py
2
import sys def addAbilities(core, actor, player): if actor.getLevel() >= 26: actor.addAbility("en_sweeping_pirouette_0") if actor.getLevel() >= 38: actor.addAbility("en_sweeping_pirouette_1") if actor.getLevel() >= 50: actor.addAbility("en_sweeping_pirouette_2") if actor.getLevel() >= 62: actor.addAbility(...
lancezlin/ml_template_py
refs/heads/master
lib/python2.7/site-packages/pip/_vendor/packaging/utils.py
1126
# 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 re _canonicalize_regex = re.compile(r"[-_.]+") def canonicalize...
tvwerkhoven/pretty-plots
refs/heads/master
matplotlib-ref-density.py
1
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- # # @file matplotlib-ref-density.py -- matplotlib example script # Copyright (C) 2011--2013 Tim van Werkhoven (timvanwerkhoven@gmail.com) # # This work is licensed under the Creative Commons Attribution-Share Alike # 3.0 Unported License. To view a copy of this license,...
ProfessionalIT/maxigenios-website
refs/heads/master
sdk/google_appengine/google/appengine/_internal/django/core/files/images.py
23
""" Utility functions for handling images. Requires PIL, as you might imagine. """ from google.appengine._internal.django.core.files import File class ImageFile(File): """ A mixin for use alongside django.core.files.base.File, which provides additional features for dealing with images. """ def _g...
jermowery/xos
refs/heads/master
xos/core/models/reservation.py
3
import os import datetime from django.db import models from core.models import PlCoreBase from core.models import Instance from core.models import Slice from core.models import ServiceResource # Create your models here. class Reservation(PlCoreBase): startTime = models.DateTimeField() slice = models.ForeignKe...
SnappleCap/oh-mainline
refs/heads/master
vendor/packages/Django/tests/modeltests/tablespaces/models.py
150
from django.db import models # Since the test database doesn't have tablespaces, it's impossible for Django # to create the tables for models where db_tablespace is set. To avoid this # problem, we mark the models as unmanaged, and temporarily revert them to # managed during each test. We also set them to use the same...
lidan-fnst/samba
refs/heads/master
source4/dsdb/tests/python/dirsync.py
2
#!/usr/bin/env python # # Unit tests for dirsync control # Copyright (C) Matthieu Patou <mat@matws.net> 2011 # Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2014 # # 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 ...
o5k/openerp-oemedical-v0.1
refs/heads/master
openerp/addons/hr_timesheet_sheet/wizard/__init__.py
443
# -*- 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...
spirali/shampoo
refs/heads/master
src/base/paths.py
1
# # Copyright (C) 2014 Stanislav Bohm # # This file is part of Shampoo. # # Shampoo 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 3 of the License. # # Shampoo is distributed in the...
silenceli/nova
refs/heads/master
nova/tests/unit/api/openstack/compute/test_microversions.py
6
# Copyright 2014 IBM Corp. # # 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 t...
bhgv/bCNC
refs/heads/master
EditorPage.py
1
# -*- coding: ascii -*- # $Id$ # # Author: vvlachoudis@gmail.com # Date: 18-Jun-2015 __author__ = "Vasilis Vlachoudis" __email__ = "vvlachoudis@gmail.com" try: from Tkinter import * except ImportError: from tkinter import * import tkExtra import Utils import Ribbon import CNCList import CNCRibbon from CNCCanvas...
3rdcycle/pyqtgraph
refs/heads/develop
pyqtgraph/multiprocess/remoteproxy.py
4
import os, time, sys, traceback, weakref import numpy as np try: import __builtin__ as builtins import cPickle as pickle except ImportError: import builtins import pickle # color printing for debugging from ..util import cprint class ClosedError(Exception): """Raised when an event handler receives...
thomasrogers03/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/Scripts/webkitpy/style/checkers/xcodeproj.py
194
# Copyright (C) 2011 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: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
SilverLiningSystems/cxmanage-test2
refs/heads/master
cxmanage_api/tests/fabric_test.py
4
# pylint: disable=protected-access # pylint: disable=too-many-public-methods # Copyright (c) 2012-2013, Calxeda 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 s...
lokirius/python-for-android
refs/heads/master
python3-alpha/extra_modules/pyxmpp2/version.py
46
# pylint: disable=C0111,C0103 version = '2.0alpha2'
percy-g2/Novathor_xperia_u8500
refs/heads/master
6.1.1.B.1.54/external/webkit/Tools/Scripts/webkitpy/layout_tests/port/gtk.py
15
# Copyright (C) 2010 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 ...
SHA2017-badge/micropython-esp32
refs/heads/master
tests/extmod/uzlib_decompio_gz.py
26
try: import uzlib as zlib import uio as io except ImportError: print("SKIP") raise SystemExit # gzip bitstream buf = io.BytesIO(b'\x1f\x8b\x08\x08\x99\x0c\xe5W\x00\x03hello\x00\xcbH\xcd\xc9\xc9\x07\x00\x86\xa6\x106\x05\x00\x00\x00') inp = zlib.DecompIO(buf, 16 + 8) print(buf.seek(0, 1)) print(inp.read...
adambreznicky/python
refs/heads/master
Early/EventsLayer.py
2
# --------------------------------------------------------------------------- # EventsLayer.py # Created on: 2013-05-21 12:09:49.00000 # (generated by ArcGIS/ModelBuilder) # Description: # --------------------------------------------------------------------------- # Import arcpy module import arcpy # Local variab...
hachreak/invenio-communities
refs/heads/master
invenio_communities/tasks.py
4
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015, 2016 CERN. # # Invenio is free software; you can redistribute it # and/or modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any...
affansyed/bcc
refs/heads/master
tools/old/offcputime.py
4
#!/usr/bin/python # # offcputime Summarize off-CPU time by kernel stack trace # For Linux, uses BCC, eBPF. # # USAGE: offcputime [-h] [-u] [-p PID] [-v] [-f] [duration] # # The current implementation uses an unrolled loop for x86_64, and was written # as a proof of concept. This implementation should b...
technologiescollege/s2a_fr
refs/heads/portable
s2a/Python/Lib/site-packages/PyMata/pymata_serial.py
2
__author__ = 'Copyright (c) 2013 Alan Yorinks All rights reserved.' """ Created on Tue Sep 3 07:12:01 2013 @author: Alan Yorinks Copyright (c) 2013-14 Alan Yorinks All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as publis...
blrm/openshift-tools
refs/heads/stg
openshift/installer/vendored/openshift-ansible-3.10.0-0.29.0/roles/lib_utils/library/openshift_cert_expiry.py
7
#!/usr/bin/python # -*- coding: utf-8 -*- # pylint: disable=line-too-long,invalid-name """For details on this module see DOCUMENTATION (below)""" import base64 import datetime import io import os import subprocess import yaml # pylint import-error disabled because pylint cannot find the package # when installed in a...
fitermay/intellij-community
refs/heads/master
python/testData/refactoring/extractmethod/Py479.after.py
79
class Foo: def __init__(self): self.tmp = False def extract_method(self, condition1, condition2, condition3, condition4): list = (1, 2, 3) a = 6 b = False if a in list or self.tmp: if condition1: print(condi...
jeffery-do/Vizdoombot
refs/heads/master
doom/lib/python3.5/site-packages/theano/tensor/nnet/tests/test_nnet.py
3
from __future__ import print_function import unittest import numpy from nose.plugins.skip import SkipTest from six.moves import xrange import theano from theano import config from theano import tensor as T from theano import tensor from theano import gof from theano.tests import unittest_tools as utt from theano impo...
ryanpetrello/draughtcraft
refs/heads/master
draughtcraft/data/tools/cacheflush.py
1
from pecan.commands.base import BaseCommand BLUE = '\033[94m' ENDS = '\033[0m' def redis_connector(): from pecan import conf from redis import Redis return Redis(**conf.redis) class RedisFlushCommand(BaseCommand): """ Flush the Redis resource cache. """ def run(self, args): sup...
cortedeltimo/SickRage
refs/heads/master
tests/tv_tests.py
11
# coding=UTF-8 # Author: Dennis Lutter <lad1337@gmail.com> # URL: https://sickrage.github.io # # This file is part of SickRage. # # SickRage is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of ...
lssfau/walberla
refs/heads/master
utilities/findMissingIncludeGuards.py
1
#!/usr/bin/env python3 import os error = False for root, dirnames, filenames in os.walk(".."): for filename in filenames: if filename.endswith(".h") and not filename.endswith(".impl.h"): if "extern" not in root: file = os.path.join(root, filename) if "#pragma on...
smueller18/solar-thermal-climate-system
refs/heads/master
consumer/machine-state-prediction/consumer.py
1
#!/usr/bin/env python3 import os import time import logging.config import pickle import pandas as pd from pca import PCAForPandas import kafka_connector.avro_loop_consumer as avro_loop_consumer from kafka_connector.avro_loop_consumer import AvroLoopConsumer from tsfresh.feature_extraction import extract_features fro...
weera00/xbmc
refs/heads/master
tools/Fake Episode Maker/openAnything.py
169
# -*- coding: utf-8 -*- # Copyright (C) 2008-2013 Team XBMC # http://xbmc.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, or (at your option) # any l...
duanhongyi/kakfa
refs/heads/master
setup.py
1
import os from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'README.md')).read() setup( name="kafka", version="0.8.1-3", install_requires=["distribute", "poolbase"], packages=find_packages(), author="duanhongyi", aut...
higgsd/euler
refs/heads/master
py/14.py
1
# 837799 N = 1000000 lut = {1:1} m = 1 mv = 1 for n in xrange(1, N): if lut.has_key(n): continue ch = [n] nx = n while True: if nx % 2 == 0: nx /= 2 else: nx = 3 * nx + 1 if lut.has_key(nx): for x in ch[::-1]: lut[x] = l...
mdaniel/intellij-community
refs/heads/master
python/testData/refactoring/extractmethod/GlobalVarAssignment.after.py
79
x = 0 def foo(): global x bar() def bar(): global x x = 1
samkohn/Geiger-Counter
refs/heads/master
main.py
2
############################### # Python script for analyzing pra data ############################### # Imports # External modules import scipy as sp import matplotlib as ml import matplotlib.pyplot as pp # Our modules import analyzeData as ad def plotCountRatePerTime(data, timeResolution = None): '''Plot the ...
rickerc/neutron_audit
refs/heads/cis-havana-staging
neutron/tests/unit/ml2/test_type_gre.py
1
# Copyright (c) 2013 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
hilaskis/UAV_MissionPlanner
refs/heads/master
Lib/struct.py
247
from _struct import * from _struct import _clearcache from _struct import __doc__
ukncsc/viper
refs/heads/master
viper/modules/peepdf/aespython/key_expander.py
43
#!/usr/bin/env python """ AES Key Expansion. Expands 128, 192, or 256 bit key for use with AES Running this file as __main__ will result in a self-test of the algorithm. Algorithm per NIST FIPS-197 http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf Copyright (c) 2010, Adam Newman http://www.caller9.com/ L...
2014c2g14/c2g14
refs/heads/master
w2/static/Brython2.0.0-20140209-164925/Lib/_pyio.py
103
""" Python implementation of the io module. """ import os import abc import codecs import errno # Import _thread instead of threading to reduce startup cost try: from _thread import allocate_lock as Lock except ImportError: from _dummy_thread import allocate_lock as Lock import io from io import (__all__, SEE...
Foxfanmedium/python_training
refs/heads/master
OnlineCoursera/mail_ru/Python_1/Week_3/1_classes_1.py
1
# num = 13 # print(isinstance(num, int)) # Проверка принядлежит ли Num классу int # print(isinstance(num, float)) # class Human: # pass # class Robot: # """Данный класс позволяет создавать роботов""" # # # print(Robot) # print(dir(Robot)) # class Planet: # pass # planet = Planet() # print(planet) ...
android-ia/platform_external_chromium_org
refs/heads/master
tools/cr/cr/commands/install.py
113
# 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. """A module for the install command.""" import cr class InstallCommand(cr.Command): """The implementation of the install command. This first uses Bui...
effa/flocs
refs/heads/master
common/flow_factors.py
3
from enum import Enum class FlowFactors(Enum): """ Common constants to denote factors affecting flow """ STUDENT_BIAS = 0 TASK_BIAS = 1 LOOPS = 2 CONDITIONS = 3 LOGIC_EXPR = 4 COLORS = 5 TOKENS = 6 PITS = 7 @clas...
devendermishrajio/nova
refs/heads/master
nova/api/openstack/compute/schemas/quota_classes.py
43
# Copyright 2015 NEC 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 # # Unless required ...
LaunchKey/launchkey-python
refs/heads/master
tests/test_entities_directory.py
2
import unittest from launchkey.entities.directory import Directory, DeviceStatus, Device, \ DirectoryUserTOTP class TestDirectoryUserTOTP(unittest.TestCase): def test_input_attributes(self): totp = DirectoryUserTOTP({ "secret": "A Secret", "algorithm": "An Algorithm", ...
glwu/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/xmlrpc/__init__.py
1383
# This directory is a Python package.
rspavel/spack
refs/heads/develop
var/spack/repos/builtin/packages/memcached/package.py
5
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Memcached(AutotoolsPackage): """ Memcached is a high performance multithreaded event-b...
magvugr/AT
refs/heads/master
EntVirtual/lib/python2.7/site-packages/setuptools/command/install_lib.py
454
from distutils.command.install_lib import install_lib as _install_lib import os class install_lib(_install_lib): """Don't add compiled flags to filenames of non-Python files""" def _bytecode_filenames (self, py_filenames): bytecode_files = [] for py_file in py_filenames: if not py_...
0909023/Dev6B_English_Website
refs/heads/master
DjangoWebProject1/DjangoWebProject1/env/Scripts/django-admin.py
1
#!C:\Users\Alllexa\Source\Repos\Dev6B_English_Website\DjangoWebProject1\DjangoWebProject1\env\Scripts\python.exe from django.core import management if __name__ == "__main__": management.execute_from_command_line()
auduny/home-assistant
refs/heads/dev
homeassistant/components/thermoworks_smoke/sensor.py
7
""" Support for getting the state of a Thermoworks Smoke Thermometer. Requires Smoke Gateway Wifi with an internet connection. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.thermoworks_smoke/ """ import logging from requests import RequestExcep...
emencia/emencia-crma
refs/heads/master
crma/admin.py
1
"""Admin for pilot_academy.logs""" # Import from the Standard Library from os.path import join # Import from Django from django.conf import settings from django.conf.urls import patterns, url from django.contrib.admin import ModelAdmin from django.contrib import admin from django import forms from django.http import ...
NeovaHealth/odoo
refs/heads/8.0
addons/base_report_designer/plugin/openerp_report_designer/bin/script/compile_all.py
384
######################################################################### # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gene...
srkukarni/heron
refs/heads/master
integration_test/src/python/local_test_runner/test_scale_up.py
6
# Copyright 2016 Twitter. 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 or agree...
kouk/boto
refs/heads/develop
boto/mashups/__init__.py
782
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # 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, modi...
patmun/pynetdicom
refs/heads/master
netdicom/test/wlmscp.py
2
""" Worklist Manager SCP example. This demonstrates a simple application entity that support a number of Query service classes. For this example to work, you need an SCU sending to this host on specified port. usage: python wlmscp.py """ import sys import datetime import netdicom import dcmtkscu # ca...
kaze/paasmaker
refs/heads/master
paasmaker/util/postgresdaemon.py
2
# # Paasmaker - Platform as a Service # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # import os import re import signal import shutil import tempfile import logging...
krenzlin/bilthoven
refs/heads/master
tests/test_process_functions.py
1
from itertools import izip from numpy import array, array_equal def test_block_iterator(): from bilthoven.process_functions import block_iterator data = range(10) assert array_equal(list(block_iterator(data, 5, 5)), [array([0,1,2,3,4]), array([5,6,7,8,9])]) result_should = [array([0,1,2,3,4,5]), arr...
yuyangit/tornado
refs/heads/master
maint/test/appengine/py27/runtests.py
1
../common/runtests.py
zhuwenping/python-for-android
refs/heads/master
python-build/python-libs/gdata/samples/blogger/BloggerExampleV1.py
133
#!/usr/bin/python # # Copyright (C) 2007 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 ...
ThiagoGarciaAlves/intellij-community
refs/heads/master
python/testData/selectWord/list/before.py
83
x = [1, 2, 3, 4<caret>]
mclois/iteexe
refs/heads/master
twisted/manhole/ui/gtk2manhole.py
14
# -*- Python -*- # $Id: gtk2manhole.py,v 1.9 2003/09/07 19:58:09 acapnotic Exp $ # Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """Manhole client with a GTK v2.x front-end. """ __version__ = '$Revision: 1.9 $'[11:-2] from twisted import copyright from twisted.internet import react...
django-nonrel/django-nonrel
refs/heads/develop
tests/regressiontests/test_client_regress/models.py
21
# -*- coding: utf-8 -*- """ Regression tests for the Test Client, especially the customized assertions. """ import os from django.conf import settings from django.core.exceptions import SuspiciousOperation from django.core.urlresolvers import reverse from django.template import (TemplateDoesNotExist, TemplateSyntaxErr...
Yukarumya/Yukarum-Redfoxes
refs/heads/master
testing/web-platform/tests/service-workers/service-worker/resources/mime-type-worker.py
158
def main(request, response): if 'mime' in request.GET: return [('Content-Type', request.GET['mime'])], "" return [], ""
weaver-viii/h2o-3
refs/heads/master
h2o-py/h2o/expr.py
2
import h2o import math class ExprNode: """ Composable Expressions: This module contains code for the lazy expression DAG. """ def __init__(self,op,*args): self._op=op # unary/binary/prefix op self._children=[ExprNode._arg_to_expr(a) for a in args] # a list of ExprNode instances; the child...
ysung-pivotal/incubator-hawq
refs/heads/master
tools/bin/pythonSrc/PyGreSQL-4.0/setup.py
24
#!/usr/bin/env python # $Id: setup.py,v 1.27 2008/11/21 17:08:17 cito Exp $ """Setup script for PyGreSQL version 4.0 Authors and history: * PyGreSQL written 1997 by D'Arcy J.M. Cain <darcy@druid.net> * based on code written 1995 by Pascal Andre <andre@chimay.via.ecp.fr> * setup script created 2000/04 Mark Alexander <...
pixelrebirth/ProjectMeiva
refs/heads/master
app/__init__.py
27
from flask import Flask app = Flask(__name__) from app import views
bokeh/bokeh
refs/heads/branch-2.4
examples/models/file/graphs.py
1
""" Zachary's Karate Club graph Data file from: http://vlado.fmf.uni-lj.si/pub/networks/data/Ucinet/UciData.htm Reference: Zachary W. (1977). An information flow model for conflict and fission in small groups. Journal of Anthropological Research, 33, 452-473. """ import networkx as nx from bokeh.io import curdoc, sho...
niknow/scipy
refs/heads/master
scipy/_build_utils/__init__.py
96
import numpy as np from ._fortran import * from scipy._lib._version import NumpyVersion # Don't use deprecated Numpy C API. Define this to a fixed version instead of # NPY_API_VERSION in order not to break compilation for released Scipy versions # when Numpy introduces a new deprecation. Use in setup.py:: # # conf...
timpalpant/calibre
refs/heads/master
src/calibre/utils/fonts/win_fonts.py
14
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>' __docformat__ = 'restructuredtext en' ...
jbbskinny/sympy
refs/heads/master
sympy/physics/tests/test_hydrogen.py
83
from sympy import exp, integrate, oo, S, simplify, sqrt, symbols from sympy.core.compatibility import range from sympy.physics.hydrogen import R_nl, E_nl, E_nl_dirac from sympy.utilities.pytest import raises n, r, Z = symbols('n r Z') def feq(a, b, max_relative_error=1e-12, max_absolute_error=1e-12): a = float(a...
mhaberler/machinekit
refs/heads/master
src/emc/usr_intf/axis/scripts/mdi.py
27
#!/usr/bin/env python # This is a component of AXIS, a front-end for LinuxCNC # Copyright 2004, 2005, 2006 Jeff Epler <jepler@unpythonic.net> # # 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...
yitian134/chromium
refs/heads/master
chrome/test/gpu/generate_webgl_conformance_test_list.py
6
#!/usr/bin/env python # 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. """Auto-generates the WebGL conformance test list header file. Parses the WebGL conformance test *.txt file, which contains a list...
arju88nair/projectCulminate
refs/heads/master
venv/lib/python3.5/site-packages/markupsafe/__init__.py
144
# -*- coding: utf-8 -*- """ markupsafe ~~~~~~~~~~ Implements a Markup string. :copyright: (c) 2010 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import re import string from collections import Mapping from markupsafe._compat import text_type, string_types, int_types, \ u...
OpenWinCon/OpenWinNet
refs/heads/master
web-gui/myvenv/lib/python3.4/site-packages/django/utils/cache.py
99
""" This module contains helper functions for controlling caching. It does so by managing the "Vary" header of responses. It includes functions to patch the header of response objects directly and decorators that change functions to do that header-patching themselves. For information on the Vary header, see: http...
kostko/itsy
refs/heads/master
itsy/exceptions.py
1
class DoesNotExist(Exception): pass class MissingVersionMetadata(Exception): pass class MutexNotAcquired(Exception): pass class DocumentNotSaved(Exception): pass class DeleteRestrictedByReference(Exception): pass
fsteggink/stetl
refs/heads/master
tests/test_args.py
3
# testing: to be called by nosetests import os from stetl.etl import ETL from tests.stetl_test_case import StetlTestCase from stetl.main import parse_args class ConfigTest(StetlTestCase): """Basic configuration tests""" def setUp(self): super(ConfigTest, self).setUp() # Initialize Stetl ...
xiaoxq/apollo
refs/heads/master
modules/tools/prediction/multiple_gpu_estimator/mlp_utils.py
3
#!/usr/bin/env python3 ############################################################################### # Modification Copyright 2018 The Apollo 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 ...
saiwing-yeung/scikit-learn
refs/heads/master
examples/cluster/plot_cluster_iris.py
350
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= K-means Clustering ========================================================= The plots display firstly what a K-means algorithm would yield using three clusters. It is then shown what the effect of a bad initializa...
t794104/ansible
refs/heads/devel
lib/ansible/plugins/doc_fragments/onyx.py
44
# -*- coding: utf-8 -*- # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) class ModuleDocFragment(object): # Standard files documentation fragment DOCUMENTATION = r''' options: provider: description: - A dict object containing connection details. ty...
pgmillon/ansible
refs/heads/devel
test/units/modules/network/f5/test_bigip_profile_client_ssl.py
16
# -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # 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 import os import json import pytest import sys if sys.version_info < (2, ...
andresriancho/PyGithub
refs/heads/master
github/Commit.py
1
# -*- coding: utf-8 -*- # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net # This file is part of PyGithub. http://vincent-jacques.net/PyGithub # PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License # as published by the Free Softwar...
khalibartan/Antidote-DM
refs/heads/master
Antidotes DM/youtube_dl/extractor/globo.py
8
# coding: utf-8 from __future__ import unicode_literals import random import math from .common import InfoExtractor from ..compat import ( compat_str, compat_chr, compat_ord, ) from ..utils import ( ExtractorError, float_or_none, int_or_none, str_or_none, ) class GloboIE(InfoExtractor): ...
todaychi/hue
refs/heads/master
desktop/libs/libsentry/src/libsentry/client2.py
7
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
duniter/duniter-python-api
refs/heads/master
duniterpy/api/bma/tx.py
2
""" Copyright 2014-2021 Vincent Texier <vit@free.fr> DuniterPy is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. DuniterPy is distributed in...
berendkleinhaneveld/VTK
refs/heads/master
ThirdParty/Twisted/twisted/test/test_abstract.py
46
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for generic file descriptor based reactor support code. """ from __future__ import division, absolute_import from twisted.trial.unittest import TestCase from twisted.internet.abstract import isIPAddress class AddressTests(TestCase):...
ttuygun/VirusTotal-Dropzone
refs/heads/master
VirusTotal Virus Scan.dzbundle/requests/packages/chardet/mbcharsetprober.py
2923
######################## 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...
fergalmoran/dss
refs/heads/master
spa/management/commands/waveforms.py
1
from optparse import make_option import os from django.core.management.base import NoArgsCommand, BaseCommand from spa.models.mix import Mix from core.tasks import create_waveform_task class Command(BaseCommand): help = "Generate all outstanding waveforms" option_list = BaseCommand.option_list + ( ...
rkokkelk/CouchPotatoServer
refs/heads/master
libs/suds/sax/element.py
176
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will ...
snegirigens/DLND
refs/heads/master
transfer-learning/tensorflow_vgg/utils.py
145
import skimage import skimage.io import skimage.transform import numpy as np # synset = [l.strip() for l in open('synset.txt').readlines()] # returns image of shape [224, 224, 3] # [height, width, depth] def load_image(path): # load image img = skimage.io.imread(path) img = img / 255.0 assert (0 <= ...
junranhe/tf-faster-rcnn
refs/heads/master
lib/model/test.py
1
# -------------------------------------------------------- # Tensorflow Faster R-CNN # Licensed under The MIT License [see LICENSE for details] # Written by Xinlei Chen # -------------------------------------------------------- from __future__ import absolute_import from __future__ import division from __future__ impor...
hsorby/fifa_world_cup_2014
refs/heads/master
languages/it.py
126
# coding: utf8 { '!=': '!=', '!langcode!': 'it', '!langname!': 'Italiano', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" è un\'espressione opzionale come "campo1=\'nuovo valore\'". Non si può fare "update" o "delete" dei risultati di un JOI...
dezelin/scons
refs/heads/master
scons-local/SCons/Tool/jar.py
6
"""SCons.Tool.jar Tool-specific initialization for jar. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2014 The SCons Foundation # # Permission is hereby granted, free of charge, to...
DMLoy/ECommerceBasic
refs/heads/master
lib/python2.7/site-packages/django/core/files/base.py
147
from __future__ import unicode_literals import os from io import BytesIO, StringIO, UnsupportedOperation from django.utils.encoding import smart_text from django.core.files.utils import FileProxyMixin from django.utils import six from django.utils.encoding import force_bytes, python_2_unicode_compatible @python_2_un...
hackerkid/zulip
refs/heads/master
tools/linter_lib/pep8.py
9
from typing import List from zulint.linters import run_command from zulint.printer import colors def check_pep8(files: List[str]) -> bool: if not files: return False return run_command("pep8", next(colors), ["pycodestyle", "--", *files]) != 0
codesters/codesters
refs/heads/master
registration/__init__.py
50
VERSION = (1, 0, 0, 'final', 0) def get_version(): "Returns a PEP 386-compliant version number from VERSION." assert len(VERSION) == 5 assert VERSION[3] in ('alpha', 'beta', 'rc', 'final') # Now build the two parts of the version number: # main = X.Y[.Z] # sub = .devN - for pre-alpha releases...
tobegit3hub/deep_cnn
refs/heads/master
java_predict_client/src/main/proto/tensorflow/contrib/layers/python/ops/sparse_ops_test.py
12
# 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...
philrykoff/vertx-web
refs/heads/master
src/test/sockjs-protocol/venv/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/__init__.py
1429
"""Modules copied from Python 3 standard libraries, for internal use only. Individual classes and functions are found in d2._backport.misc. Intended usage is to always import things missing from 3.1 from that module: the built-in/stdlib objects will be used if found. """
pdf/beets
refs/heads/master
test/test_player.py
15
# This file is part of beets. # Copyright 2013, Adrian Sampson. # # 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, ...
vikatory/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/test/test_cmd_line_script.py
75
# tests command line execution of scripts import contextlib import importlib import importlib.machinery import zipimport import unittest import sys import os import os.path import py_compile import subprocess import textwrap from test import support from test.script_helper import ( make_pkg, make_script, make_zip...