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
sda2b/youtube-dl
youtube_dl/downloader/rtmp.py
95
8353
from __future__ import unicode_literals import os import re import subprocess import time from .common import FileDownloader from ..compat import compat_str from ..utils import ( check_executable, encodeFilename, encodeArgument, get_exe_version, ) def rtmpdump_version(): return get_exe_version( ...
unlicense
matthiascy/panda3d
direct/src/ffi/FFITypes.py
8
44162
""" Type Descriptors Type Descriptors are used for code generation of C++ types. They know everything they need to know about themselves to generate code. They get constructed by and stored in FFIInterrogateDatabase. """ import os import string import FFIConstants import FFIOverload from direct.showbase.PythonUti...
bsd-3-clause
timsnyder/bokeh
bokeh/settings.py
2
13108
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
bsd-3-clause
gtesei/fast-furious
competitions/santander-customer-transaction-prediction/base_light_gbm1.py
1
2556
import lightgbm as lgb import pandas as pd import numpy as np import sys from datetime import datetime from pathlib import Path from sklearn.model_selection import StratifiedKFold from sklearn.model_selection import RepeatedStratifiedKFold path=Path("data/") train=pd.read_csv(path/"train.csv").drop("ID_code",axis=1) ...
mit
rsvip/Django
django/db/backends/mysql/base.py
323
15548
""" MySQL database backend for Django. Requires mysqlclient: https://pypi.python.org/pypi/mysqlclient/ MySQLdb is supported for Python 2 only: http://sourceforge.net/projects/mysql-python """ from __future__ import unicode_literals import datetime import re import sys import warnings from django.conf import settings...
bsd-3-clause
nagyistoce/netzob
src/netzob/Common/Threads/Task.py
1
2501
# -*- coding: utf-8 -*- #+---------------------------------------------------------------------------+ #| 01001110 01100101 01110100 01111010 01101111 01100010 | #| | #| Netzob : Inferring communication protocol...
gpl-3.0
ninjasftw/libertyproxybeat
vendor/github.com/elastic/beats/metricbeat/tests/system/test_redis.py
4
2791
import os import metricbeat from nose.plugins.attrib import attr REDIS_FIELDS = metricbeat.COMMON_FIELDS + ["redis-info"] REDIS_INFO_FIELDS = ["clients", "cluster", "cpu", "keyspace", "memory", "persistence", "replication", "server", "stats"] CPU_FIELDS = ["used_cpu_sys", "used_cpu_sys_children"...
apache-2.0
hanak/artshow-keeper
tests/datafile.py
1
1532
# Artshow Keeper: A support tool for keeping an Artshow running. # Copyright (C) 2014 Ivo Hanak # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your...
gpl-3.0
darjeeling/django
tests/invalid_models_tests/test_deprecated_fields.py
106
1423
from django.core import checks from django.db import models from django.test import SimpleTestCase from django.test.utils import isolate_apps @isolate_apps('invalid_models_tests') class DeprecatedFieldsTests(SimpleTestCase): def test_IPAddressField_deprecated(self): class IPAddressModel(models.Model): ...
bsd-3-clause
GarrettArm/TheDjangoBook
mysite_project/blog/views.py
1
1361
from django.shortcuts import render from django.utils import timezone from django.views import generic from .models import Post class IndexView(generic.ListView): template_name = "blog/post_list.html" context_object_name = "posts" def get_queryset(self): return Post.objects.filter(published_date...
gpl-3.0
Wojtechnology/Muzit
StreetMuse/lib/python2.7/site-packages/tornado/tcpserver.py
74
10693
#!/usr/bin/env python # # Copyright 2011 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...
apache-2.0
HyperBaton/ansible
lib/ansible/modules/network/aci/aci_contract_subject.py
5
10578
#!/usr/bin/python # -*- coding: utf-8 -*- # 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
Great-Li-Xin/PythonDev
Games/Chap8/Zombie Mob.py
1
9550
# MyLibrary.py import sys, time, random, math, pygame from pygame.locals import * # prints text using the supplied font def print_text(font, x, y, text, color=(255, 255, 255)): imgText = font.render(text, True, color) screen = pygame.display.get_surface() # req'd when function moved into MyLibrary scree...
mit
bzero/bitex
libs/tornado/test/stack_context_test.py
9
10772
#!/usr/bin/env python from __future__ import absolute_import, division, print_function, with_statement from tornado import gen from tornado.log import app_log from tornado.stack_context import (StackContext, wrap, NullContext, StackContextInconsistentError, ExceptionStackContext, run...
gpl-3.0
heke123/chromium-crosswalk
third_party/logilab/logilab/astroid/mixins.py
66
4337
# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of astroid. # # astroid 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 #...
bsd-3-clause
johndpope/tensorflow
tensorflow/python/framework/graph_io.py
62
2331
# 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
HLFH/CouchPotatoServer
libs/requests/packages/chardet/sbcharsetprober.py
2927
4793
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
gpl-3.0
taito/xhtml2pdf
test/cookbook.py
146
2140
# -*- coding: utf-8 -*- # Copyright 2010 Dirk Holtwick, holtwick.it # # 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 ...
apache-2.0
nghia-huynh/gem5-stable
src/arch/x86/isa/insts/x87/data_transfer_and_conversion/load_or_store_floating_point.py
65
3563
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bsd-3-clause
oculusstorystudio/kraken
Python/kraken/ui/HAppkit_Editors/editor_widgets/integer_editor.py
1
2518
import sys from kraken.ui.Qt import QtWidgets, QtGui, QtCore from ..fe import FE from ..widget_factory import EditorFactory from ..base_editor import BaseValueEditor class IntegerEditor(BaseValueEditor): def __init__(self, valueController, parent=None): super(IntegerEditor, self).__init__(valueControll...
bsd-3-clause
ychen820/microblog
y/google-cloud-sdk/platform/google_appengine/lib/oauth2client/oauth2client/client.py
10
64839
# Copyright 2014 Google 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 or ...
bsd-3-clause
mavit/ansible
lib/ansible/modules/cloud/google/gcp_compute_route.py
12
16681
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
suqinhuang/tp-qemu
qemu/tests/live_snapshot_base.py
9
2654
import logging from autotest.client import utils from autotest.client.shared import error from virttest import utils_misc from virttest import storage from virttest import data_dir @error.context_aware def run(test, params, env): """ live_snapshot_base test: 1). Boot up guest 2). Create a file on ho...
gpl-2.0
2014c2g3/w16b_test
static/Brython3.1.1-20150328-091302/Lib/VFS_import.py
738
3059
import os from browser import doc #_scripts=doc.createElement('script') #_scripts.src="/src/py_VFS.js" #_scripts.type="text/javascript" #doc.get(tag='head')[0].appendChild(_scripts) VFS=dict(JSObject(__BRYTHON__.py_VFS)) class VFSModuleFinder: def __init__(self, path_entry): print("in VFSModuleFinder") ...
agpl-3.0
rghe/ansible
lib/ansible/modules/storage/purestorage/purefa_pgsnap.py
16
6597
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Simon Dodsley (simon@purestorage.com) # 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',...
gpl-3.0
lizardsystem/flooding-lib
flooding_lib/tools/importtool/admin.py
2
1430
#alphabetical order from flooding_lib.tools.importtool.models import ImportScenario from flooding_lib.tools.importtool.models import ImportScenarioInputField from flooding_lib.tools.importtool.models import InputField from flooding_lib.tools.importtool.models import RORKering from django.contrib import admin ''' cla...
gpl-3.0
pigshell/nhnick
src/qt/qtwebkit/Tools/Scripts/webkitpy/test/skip.py
174
2299
# Copyright (C) 2010 Apple 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 f...
bsd-3-clause
wilvk/ansible
test/units/modules/network/dellos9/test_dellos9_facts.py
46
4627
# (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is dis...
gpl-3.0
Senseg/Py4A
python3-alpha/python3-src/Lib/ctypes/test/test_unicode.py
65
1911
import unittest import ctypes try: ctypes.c_wchar except AttributeError: pass else: import _ctypes_test class UnicodeTestCase(unittest.TestCase): def test_wcslen(self): dll = ctypes.CDLL(_ctypes_test.__file__) wcslen = dll.my_wcslen wcslen.argtypes = [ctypes...
apache-2.0
dvitme/account-financial-tools
account_partner_required/tests/test_account_partner_required.py
39
5325
# -*- encoding: utf-8 -*- ############################################################################## # # Account partner required module for OpenERP # Copyright (C) 2014 Acsone (http://acsone.eu). # @author Stéphane Bidoul <stephane.bidoul@acsone.eu> # # This program is free software: you can redistribu...
agpl-3.0
ghmajx/asuswrt-merlin
release/src/router/samba-3.6.13/lib/dnspython/dns/rdtypes/ANY/NSEC3.py
248
6716
# Copyright (C) 2004-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
gpl-2.0
MasterPlexus/kernel_i8200
tools/perf/scripts/python/check-perf-trace.py
11214
2503
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
gpl-2.0
joanneko/goodbooks
goodbooks/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/gb2312freq.py
3132
36011
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
bsd-3-clause
DucQuang1/py-earth
doc/generate_figures.py
1
1933
import matplotlib as mpl mpl.use('Agg') import numpy from pyearth import Earth from matplotlib import pyplot #========================================================================= # V-Function Example #========================================================================= # Create some fake data numpy.random.se...
bsd-3-clause
davidzchen/tensorflow
tensorflow/python/training/basic_loops.py
25
2433
# 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
noobcoderT/ryu-3.21
ryu/tests/unit/lib/test_rpc.py
9
12035
# Copyright (C) 2013-2015 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2013-2015 YAMAMOTO Takashi <yamamoto at valinux co jp> # # 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 # ...
apache-2.0
coldmind/django
django/dispatch/dispatcher.py
3
11720
import sys import threading import warnings import weakref from django.utils.deprecation import RemovedInDjango21Warning from django.utils.inspect import func_accepts_kwargs from django.utils.six.moves import range if sys.version_info < (3, 4): from .weakref_backports import WeakMethod else: from weakref impo...
bsd-3-clause
ppwwyyxx/tensorflow
tensorflow/python/ops/ragged/ragged_reverse_op_test.py
8
3437
# 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
garrettcap/Bulletproof-Backup
wx/tools/Editra/src/extern/pygments/lexers/dotnet.py
14
14464
# -*- coding: utf-8 -*- """ pygments.lexers.dotnet ~~~~~~~~~~~~~~~~~~~~~~ Lexers for .net languages. :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, DelegatingLexer, bygroups, using, th...
gpl-2.0
mjamesruggiero/tripp
setup.py
1
1394
s!/usr/bin/env python # -*- coding: utf-8 -*- try: from setuptools import setup except ImportError: from distutils.core import setup with open('README.md') as readme_file: readme = readme_file.read() requirements = [ # TODO: put package requirements here ] test_requirements = [ # TODO: put pac...
bsd-3-clause
jart/tensorflow
tensorflow/tools/ci_build/copy_binary.py
26
4203
#!/usr/bin/python # 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 r...
apache-2.0
Sweetgrassbuffalo/ReactionSweeGrass-v2
node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py
1869
1247
# Copyright 2014 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. """A clone of the default copy.deepcopy that doesn't handle cyclic structures or complex types except for dicts and lists. This is because gyp copies so large structur...
gpl-3.0
mihail911/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/axes.py
69
259904
from __future__ import division, generators import math, sys, warnings, datetime, new import numpy as np from numpy import ma import matplotlib rcParams = matplotlib.rcParams import matplotlib.artist as martist import matplotlib.axis as maxis import matplotlib.cbook as cbook import matplotlib.collections as mcoll im...
gpl-3.0
bvesperman/Sector67RaspberryPiAccessControl
space_machines/door.py
1
5509
import logging import time import Queue import threading from Tkinter import * from pystates import StateMachine class DoorState(StateMachine): def CLOSED_LOCKED(self): self.generate_message({"event": self.name + "_CLOSED_LOCKED"}) if self.show_gui: self.v.set("CLOSED_LOCKED") self.log.debug("turn off ...
mit
rmvanhees/pynadc
pynadc/scia/hk.py
1
6316
""" This file is part of pynadc https://github.com/rmvanhees/pynadc Routines to convert Sciamachy house-keeping data from raw counts to physical units. Copyright (c) 2018 SRON - Netherlands Institute for Space Research All Rights Reserved License: BSD-3-Clause """ from datetime import timedelta import numpy as...
bsd-3-clause
robbiet480/home-assistant
tests/util/test_color.py
21
11935
"""Test Home Assistant color util methods.""" import pytest import voluptuous as vol import homeassistant.util.color as color_util GAMUT = color_util.GamutType( color_util.XYPoint(0.704, 0.296), color_util.XYPoint(0.2151, 0.7106), color_util.XYPoint(0.138, 0.08), ) GAMUT_INVALID_1 = color_util.GamutType( ...
apache-2.0
ChristianFrisson/essentia
src/python/essentia/utils.py
10
2902
# Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra # # This file is part of Essentia # # Essentia 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 (FSF), either version 3 of the ...
agpl-3.0
henrylee2cn/tiedot
extra/TiedotPythonClient.py
7
5110
# -*- coding: utf-8 -*- """ Python module to connect to golang tiedot database https://github.com/HouzuoGuo/tiedot http://golang.org/ Depends on python request library: http://requests.readthedocs.org/en/latest/ Courtesy of Mr.Cristian Echeverria - thank you! """ import json import requests #---------...
bsd-2-clause
alrusdi/lettuce
tests/integration/lib/Django-1.2.5/django/contrib/contenttypes/generic.py
44
16570
""" Classes allowing "generic" relations through ContentType and object-id fields. """ from django.core.exceptions import ObjectDoesNotExist from django.db import connection from django.db.models import signals from django.db import models, router from django.db.models.fields.related import RelatedField, Field, ManyTo...
gpl-3.0
40223233/2015cd_midterm
wsgi.py
1
26126
#@+leo-ver=5-thin #@+node:2014fall.20141212095015.1775: * @file wsgi.py # coding=utf-8 # 上面的程式內容編碼必須在程式的第一或者第二行才會有作用 ################# (1) 模組導入區 # 導入 cherrypy 模組, 為了在 OpenShift 平台上使用 cherrypy 模組, 必須透過 setup.py 安裝 #@@language python #@@tabwidth -4 #@+<<declarations>> #@+node:2014fall.20141212095015.1776: ** <<declar...
gpl-2.0
hyperized/ansible
lib/ansible/modules/network/fortios/fortios_user_krb_keytab.py
14
9761
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lic...
gpl-3.0
pbchou/trafficserver
tests/gold_tests/headers/via.test.py
6
4545
''' Test the VIA header. This runs several requests through ATS and extracts the upstream VIA headers. Those are then checked against a gold file to verify the protocol stack based output is correct. ''' # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NO...
apache-2.0
Ghost-script/fedmsg_meta_fedora_infrastructure
fedmsg_meta_fedora_infrastructure/tests/tagger.py
5
15879
# This file is part of fedmsg. # Copyright (C) 2013 Red Hat, Inc. # # fedmsg is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. #...
lgpl-2.1
opentrials/processors
processors/base/writers/fda_application.py
1
1620
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import logging from . import write_organisation from .. import helpers logger = logging.getLogger(__name__) # Module API def write_fda_applica...
mit
sopraux/django-filer
filer/south_migrations/0013_remove_null_file_name.py
22
11402
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): for file_name_null in orm.File.objects.filter(name__isnull=True): file_name_null.name = "" file_...
bsd-3-clause
airqj/ardupilot-raspilot
Tools/autotest/arduplane.py
105
17060
# fly ArduPlane in SIL import util, pexpect, sys, time, math, shutil, os from common import * from pymavlink import mavutil import random # get location of scripts testdir=os.path.dirname(os.path.realpath(__file__)) HOME_LOCATION='-35.362938,149.165085,585,354' WIND="0,180,0.2" # speed,direction,variance homeloc =...
gpl-3.0
jparyani/Mailpile
mailpile/plugins/setup_magic.py
1
40822
import os import random import sys import datetime from urllib import urlencode import mailpile.auth from mailpile.defaults import CONFIG_RULES from mailpile.i18n import ListTranslations, ActivateTranslation, gettext from mailpile.i18n import gettext as _ from mailpile.i18n import ngettext as _n from mailpile.plugins ...
apache-2.0
shawnwanderson/cmput404-project
venv/lib/python2.7/site-packages/django/contrib/auth/__init__.py
387
7508
import inspect import re from django.apps import apps as django_apps from django.conf import settings from django.core.exceptions import ImproperlyConfigured, PermissionDenied from django.middleware.csrf import rotate_token from django.utils.crypto import constant_time_compare from django.utils.module_loading import i...
gpl-3.0
franosincic/edx-platform
common/djangoapps/terrain/stubs/xqueue.py
57
8738
""" Stub implementation of XQueue for acceptance tests. Configuration values: "default" (dict): Default response to be sent to LMS as a grade for a submission "<submission>" (dict): Grade response to return for submissions containing the text <submission> "register_submission_url" (str): URL to send grader...
agpl-3.0
munhanha/mtg-random
djangoappengine/boot.py
1
8121
import logging import os import sys PROJECT_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) DATA_ROOT = os.path.join(PROJECT_DIR, '.gaedata') # Overrides for os.environ env_ext = {'DJANGO_SETTINGS_MODULE': 'settings'} def setup_env(): """Configures app engine environment for command-line apps."...
bsd-3-clause
SamaraCardoso27/eMakeup
backend/venv/lib/python2.7/site-packages/gaepermission/facade.py
8
6693
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from gaebusiness.business import Command from gaebusiness.gaeutil import ModelSearchCommand from gaecookie import facade as cookie_facade from gaegraph.business_base import NodeSearch from gaepermission import inspector from gaepermission....
mit
seann1/portfolio5
.meteor/dev_bundle/python/Lib/test/test_gdbm.py
105
2540
import unittest import os from test.test_support import TESTFN, run_unittest, unlink, import_module gdbm = import_module('gdbm') filename = TESTFN class TestGdbm(unittest.TestCase): def setUp(self): self.g = None def tearDown(self): if self.g is not None: self.g.close() ...
gpl-2.0
anielsen001/scipy
scipy/optimize/_spectral.py
133
7986
""" Spectral Algorithm for Nonlinear Equations """ from __future__ import division, absolute_import, print_function import collections import numpy as np from scipy.optimize import OptimizeResult from scipy.optimize.optimize import _check_unknown_options from .linesearch import _nonmonotone_line_search_cruz, _nonmono...
bsd-3-clause
TheWebMonks/equipo
app/freelancers/viewsets.py
1
4110
from .serializers import serializers from .models import * from django.contrib.auth.models import User, Group from rest_framework import viewsets, permissions, renderers class ProjectViewSet(viewsets.ModelViewSet): """ API endpoint that allows users to be viewed or edited. """ queryset = Project.objec...
apache-2.0
keisuke-umezawa/chainer
chainer/graph_optimizations/static_graph_utilities.py
2
10564
import inspect import chainer def static_code(*dec_args, **dec_kwargs): """Decorator to mark a function for inclusion in the static schedule. This decorator is used to mark a function or method to be included in a static schedule. There are multiple types of static schedules, such as "forward pass s...
mit
xiangel/hue
desktop/core/ext-py/Django-1.6.10/django/contrib/sites/management.py
232
1587
""" Creates the default Site object. """ from django.db.models import signals from django.db import connections from django.db import router from django.contrib.sites.models import Site from django.contrib.sites import models as site_app from django.core.management.color import no_style def create_default_site(app, c...
apache-2.0
karan1276/servo
tests/wpt/web-platform-tests/webdriver/support/keys.py
41
17652
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
mpl-2.0
donspaulding/adspygoogle
examples/adspygoogle/dfp/v201204/custom_field_service/set_line_item_custom_field_value.py
2
4733
#!/usr/bin/python # # Copyright 2012 Google 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 b...
apache-2.0
fengbaicanhe/intellij-community
python/lib/Lib/xml/sax/__init__.py
117
3413
"""Simple API for XML (SAX) implementation for Python. This module provides an implementation of the SAX 2 interface; information about the Java version of the interface can be found at http://www.megginson.com/SAX/. The Python version of the interface is documented at <...>. This package contains the following modu...
apache-2.0
srossross/stable.world
stable_world/managers/base.py
1
1825
from __future__ import unicode_literals import os import click from pipes import quote from .push_file import push_file, pull_file from stable_world.py_helpers import urlparse, urlunparse class BaseManager(object): NAME = None PROGRAM = None @classmethod def enabled(cls): if cls.PROGRAM is ...
bsd-2-clause
adrientetar/semc-msm-2.6.35
tools/perf/scripts/python/sctop.py
895
1936
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
MER-GROUP/intellij-community
python/lib/Lib/site-packages/django/utils/tzinfo.py
313
2511
"Implementation of tzinfo classes for use with datetime.datetime." import time from datetime import timedelta, tzinfo from django.utils.encoding import smart_unicode, smart_str, DEFAULT_LOCALE_ENCODING class FixedOffset(tzinfo): "Fixed offset in minutes east from UTC." def __init__(self, offset): if i...
apache-2.0
avedaee/DIRAC
DataManagementSystem/Service/FileCatalogProxyHandler.py
1
3492
######################################################################## # $HeadURL $ # File: FileCatalogProxyHandler.py ######################################################################## """ :mod: FileCatalogProxyHandler ================================ .. module: FileCatalogProxyHandler :synopsi...
gpl-3.0
fkie-cad/FACT_core
src/test/unit/web_interface/test_app_show_analysis.py
1
2522
from helperFunctions.data_conversion import make_bytes from test.common_helper import TEST_FW, TEST_FW_2, TEST_TEXT_FILE from test.unit.web_interface.base import WebInterfaceTest class TestAppShowAnalysis(WebInterfaceTest): def test_app_show_analysis_get_valid_fw(self): result = self.test_client.get('/an...
gpl-3.0
akfreas/TravisTest
scripts/TestFlightDistribute.py
1
2890
#!/usr/bin/env python import biplist import os import requests import tempfile import sys import git testflight_api_url = "http://testflightapp.com/api/builds.json" def upload_app_to_testflight(archive_path, testflight_api_token, testflight_team_token, testflight_distro_lists=[], notify=True): plist_path = "%s/...
mit
ahmadio/edx-platform
common/test/acceptance/tests/lms/test_lms_courseware.py
41
12670
# -*- coding: utf-8 -*- """ End-to-end tests for the LMS. """ import time from ..helpers import UniqueCourseTest from ...pages.studio.auto_auth import AutoAuthPage from ...pages.lms.create_mode import ModeCreationPage from ...pages.studio.overview import CourseOutlinePage from ...pages.lms.courseware import Courseware...
agpl-3.0
riwu/Simba
Units/MMLAddon/LPInc/Classes/WrapperGen.py
18
6622
#!/bin/env python import sys import re import string import base64 template = base64.b64decode(b'dW5pdCBscCRDbGFzc05hbWU7Ci8vRGVwZW5kczogJERlcGVuZHMKCnskbW9kZSBvYmpmcGN9eyRIK30KeyRJIFNpbWJhLmluY30KCmludGVyZmFjZQoKdXNlcwogIENsYXNzZXMsIFN5c1V0aWxzLCBscGNvbXBpbGVyLCBscHR5cGVzLCBscENsYXNzSGVscGVyOwoKcHJvY2VkdXJlIFJlZ2lzd...
gpl-3.0
gangadharkadam/letzfrappe
frappe/utils/user.py
4
6844
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe, json class User: """ A user object is created at the beginning of every request with details of the use. The global user object is `frappe.user` """ def _...
mit
Southpaw-TACTIC/Team
src/python/Lib/site-packages/win32/lib/winerror.py
14
104439
"""Error related constants for win32 Generated by h2py from winerror.h """ # Few extras added manually... TRUST_E_PROVIDER_UNKNOWN = -2146762751 TRUST_E_ACTION_UNKNOWN = -2146762750 TRUST_E_SUBJECT_FORM_UNKNOWN = -2146762749 TRUST_E_SUBJECT_NOT_TRUSTED = -2146762748 # up to here... FACILITY_WINRM = 51 FAC...
epl-1.0
jhseu/tensorflow
tensorflow/python/kernel_tests/cumulative_logsumexp_test.py
8
4181
# 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
tgroh/incubator-beam
sdks/python/apache_beam/runners/portability/portable_runner.py
2
5648
# # 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
nvoron23/hue
desktop/libs/hadoop/src/hadoop/fs/hadoopfs.py
5
34171
#!/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...
apache-2.0
cyberark-bizdev/ansible
lib/ansible/module_utils/openstack.py
20
6346
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
gpl-3.0
googleapis/googleapis-gen
grafeas/v1/grafeas-v1-py/grafeas/grafeas_v1/types/build.py
1
2488
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # 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...
apache-2.0
diogocs1/comps
web/addons/payment_adyen/controllers/main.py
166
1027
# -*- coding: utf-8 -*- try: import simplejson as json except ImportError: import json import logging import pprint import werkzeug from openerp import http, SUPERUSER_ID from openerp.http import request _logger = logging.getLogger(__name__) class AdyenController(http.Controller): _return_url = '/payme...
apache-2.0
webjunkie/python-social-auth
examples/pyramid_example/example/tests.py
63
1499
import unittest import transaction from pyramid import testing from .models import DBSession class TestMyViewSuccessCondition(unittest.TestCase): def setUp(self): self.config = testing.setUp() from sqlalchemy import create_engine engine = create_engine('sqlite://') from .models i...
bsd-3-clause
Endika/django
django/db/models/sql/query.py
4
91860
""" Create SQL statements for QuerySets. The code in here encapsulates all of the SQL construction so that QuerySets themselves do not have to (and could be backed by things other than SQL databases). The abstraction barrier only works one way: this module has to know all about the internals of models in order to get ...
bsd-3-clause
bunnyitvn/webptn
tests/regressiontests/inline_formsets/tests.py
51
6211
from __future__ import absolute_import, unicode_literals from django.forms.models import inlineformset_factory from django.test import TestCase from django.utils import six from .models import Poet, Poem, School, Parent, Child class DeletionTests(TestCase): def test_deletion(self): PoemFormSet = inline...
bsd-3-clause
40223117cda/w16cdaa
static/Brython3.1.0-20150301-090019/Lib/itertools.py
630
16041
import operator class accumulate: def __init__(self, iterable, func = operator.add): self.it = iter(iterable) self._total = None self.func = func def __iter__(self): return self def __next__(self): if not self._total: self._total = next(self.it)...
gpl-3.0
mglukhikh/intellij-community
python/lib/Lib/site-packages/django/utils/http.py
69
4132
import re import urllib from email.Utils import formatdate from django.utils.encoding import smart_str, force_unicode from django.utils.functional import allow_lazy ETAG_MATCH = re.compile(r'(?:W/)?"((?:\\.|[^"])*)"') def urlquote(url, safe='/'): """ A version of Python's urllib.quote() function that can ope...
apache-2.0
TuKo/brainiak
examples/fcma/classification.py
1
9141
# Copyright 2016 Intel Corporation # # 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
praekelt/vumi-go
go/routers/app_multiplexer/forms.py
1
1271
from django import forms class ApplicationMultiplexerTitleForm(forms.Form): content = forms.CharField( label="Menu title", max_length=100 ) class ApplicationMultiplexerForm(forms.Form): application_label = forms.CharField( label="Application label" ) endpoint_name = forms...
bsd-3-clause
xmnlab/minilab
arch/socket_arch/simple_socket/client.py
1
1045
# Echo client program from __future__ import print_function, division, unicode_literals from random import randint import socket import pickle import sys import platform if platform.system() == 'Linux': sys.path.insert(0, '/var/www/mswim') else: sys.path.insert(0, '/mswim/') from mswim import settings HOST =...
gpl-3.0
e-gob/plataforma-kioscos-autoatencion
scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/modules/cloud/openstack/os_security_group.py
19
4555
#!/usr/bin/python # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # Copyright (c) 2013, Benno Joy <benno@ansible.com> # # This module 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 vers...
bsd-3-clause
Gui13/CouchPotatoServer
libs/subliminal/services/subtitulos.py
105
4640
# -*- coding: utf-8 -*- # Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com> # # This file is part of subliminal. # # subliminal is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 3 of...
gpl-3.0
penkin/python-dockercloud
dockercloud/api/http.py
1
2612
from __future__ import absolute_import import logging from requests import Request, Session from requests import utils from urllib.parse import urljoin import dockercloud from .exceptions import ApiError, AuthError logger = logging.getLogger("python-dockercloud") global_session = Session() def get_session(): ...
apache-2.0
rawdigits/wee-slack
wee_slack.py
1
170611
# -*- coding: utf-8 -*- from __future__ import unicode_literals from collections import OrderedDict from functools import wraps from itertools import islice, count import textwrap import time import json import pickle import sha import os import re import urllib import sys import traceback import collections import ...
mit
bdupharm/sqlalchemy
lib/sqlalchemy/orm/interfaces.py
4
21575
# orm/interfaces.py # Copyright (C) 2005-2016 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ Contains various base classes used throughout the ORM. Defines some key base...
mit
shaded-enmity/dnf
dnf/logging.py
9
5976
# logging.py # DNF Logging Subsystem. # # Copyright (C) 2013 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is d...
gpl-2.0
etherkit/OpenBeacon2
client/win/venv/Lib/site-packages/pip/_internal/vcs/bazaar.py
9
3182
from __future__ import absolute_import import logging import os from pip._vendor.six.moves.urllib import parse as urllib_parse from pip._internal.utils.misc import display_path, path_to_url, rmtree from pip._internal.vcs.versioncontrol import VersionControl, vcs logger = logging.getLogger(__name__) class Bazaar(V...
gpl-3.0