repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
xiaohan2012/chowmein
refs/heads/master
chowmein/label_topic.py
1
import argparse import lda import numpy as np from sklearn.feature_extraction.text import (CountVectorizer as WordCountVectorizer) from chowmein.text import LabelCountVectorizer from chowmein.label_finder import BigramLabelFinder from chowmein.label_ranker import LabelRanke...
cytec/SickRage
refs/heads/master
sickbeard/nzbSplitter.py
7
# coding=utf-8 # Author: Nic Wolfe <nic@wolfeden.ca> # URL: https://SickRage.GitHub.io # Git: https://github.com/SickRage/SickRage.git # # 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...
hargup/sympy
refs/heads/master
sympy/vector/tests/test_vector.py
27
from sympy.simplify import simplify, trigsimp from sympy import pi, sqrt, symbols, ImmutableMatrix as Matrix, \ sin, cos, Function, Integral, Derivative, diff, integrate from sympy.vector.vector import Vector, BaseVector, VectorAdd, \ VectorMul, VectorZero from sympy.vector.coordsysrect import CoordSysCartesi...
pranavtendolkr/horizon
refs/heads/master
openstack_dashboard/dashboards/project/loadbalancers/tests.py
23
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
jbzdak/edx-platform
refs/heads/master
lms/djangoapps/course_api/blocks/transformers/tests/test_student_view.py
32
""" Tests for StudentViewTransformer. """ # pylint: disable=protected-access from openedx.core.lib.block_cache.block_structure_factory import BlockStructureFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.factories import ToyCourseFactory from ..student_vi...
rohitwaghchaure/erpnext_develop
refs/heads/develop
erpnext/selling/doctype/sales_order_item/__init__.py
37694
from __future__ import unicode_literals
gdreich/geonode
refs/heads/master
geonode/documents/enumerations.py
23
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # 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 ...
damdam-s/OpenUpgrade
refs/heads/8.0
addons/purchase/migrations/8.0.1.1/pre-migration.py
13
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2014 Therp BV # # 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 Free Software Fo...
gwpy/gwsumm
refs/heads/master
gwsumm/tests/test_tabs.py
1
# -*- coding: utf-8 -*- # Copyright (C) Duncan Macleod (2013) # # This file is part of GWSumm. # # GWSumm 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) ...
MattMulhern/OpenMamaCassandra
refs/heads/master
site_scons/custom_builders.py
14
#!/usr/bin/python # -*- coding: utf-8 -*- import os from logger import Logger from SCons.Script import * from custom_utils import * # This is currently just used in windows, though should be reused # for linux. Well the idea at least. It can be called something else # then imported in the linux class and added there s...
kenshay/ImageScripter
refs/heads/master
ProgramData/SystemFiles/Python/Lib/site-packages/numpy/distutils/command/build_py.py
264
from __future__ import division, absolute_import, print_function from distutils.command.build_py import build_py as old_build_py from numpy.distutils.misc_util import is_string class build_py(old_build_py): def run(self): build_src = self.get_finalized_command('build_src') if build_src.py_modules...
raimon49/fabric
refs/heads/master
tests/support/nested_aliases.py
40
import flat_aliases as nested
rishig/zulip
refs/heads/master
scripts/lib/setup_path_on_import.py
1
""" Use libraries from a virtualenv (by modifying sys.path) in production. """ import os import sys BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) venv = os.path.join(BASE_DIR, "zulip-py3-venv") if sys.prefix != venv: activate_this = os.path.join(venv, "bin", "activate_th...
krafczyk/root
refs/heads/master
bindings/pyroot/ROOT.py
3
from __future__ import generators # @(#)root/pyroot:$Id$ # Author: Wim Lavrijsen (WLavrijsen@lbl.gov) # Created: 02/20/03 # Last: 03/25/15 """PyROOT user module. o) install lazy ROOT class/variable lookup as appropriate o) feed gSystem and gInterpreter for display updates o) add readline completion (if supported b...
bsipocz/statsmodels
refs/heads/master
docs/source/plots/graphics_month_plot.py
28
import statsmodels.api as sm import pandas as pd dta = sm.datasets.elnino.load_pandas().data dta['YEAR'] = dta.YEAR.astype(int).astype(str) dta = dta.set_index('YEAR').T.unstack() dates = map(lambda x : pd.datetools.parse('1 '+' '.join(x)), dta.index.values) dta.index = pd.Datet...
soapy/soapy
refs/heads/master
soapy/pyqtgraph/opengl/items/GLGridItem.py
43
import numpy as np from OpenGL.GL import * from .. GLGraphicsItem import GLGraphicsItem from ... import QtGui __all__ = ['GLGridItem'] class GLGridItem(GLGraphicsItem): """ **Bases:** :class:`GLGraphicsItem <pyqtgraph.opengl.GLGraphicsItem>` Displays a wire-grame grid. """ def __init__...
tuxfux-hlp-notes/python-batches
refs/heads/master
archieves/batch-62/modules/mysheets/lib/python2.7/site-packages/pip/_vendor/distlib/markers.py
1261
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2013 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # """Parser for the environment markers micro-language defined in PEP 345.""" import ast import os import sys import platform from .compa...
ljean/coop_cms
refs/heads/master
coop_cms/apps/newsletters/models.py
1
# -*- coding: utf-8 -*- """models""" from datetime import datetime import uuid from django.conf import settings from django.contrib.sites.models import Site from django.db import models from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from coop_cms.models import Newsletter c...
QuantScientist/Deep-Learning-Boot-Camp
refs/heads/master
Kaggle-PyTorch/PyTorch-Ensembler/nnmodels/wideresnet.py
1
# import math # import torch # import torch.nn as nn # import torch.nn.functional as F # # # class BasicBlock(nn.Module): # def __init__(self, in_planes, out_planes, stride, dropRate=0.0): # super(BasicBlock, self).__init__() # self.bn1 = nn.BatchNorm2d(in_planes) # self.relu1 = nn.ReLU(inpl...
zhukaixy/kbengine
refs/heads/master
kbe/src/lib/python/Lib/test/test_json/test_decode.py
79
import decimal from io import StringIO, BytesIO from collections import OrderedDict from test.test_json import PyTest, CTest class TestDecode: def test_decimal(self): rval = self.loads('1.1', parse_float=decimal.Decimal) self.assertTrue(isinstance(rval, decimal.Decimal)) self.assertEqual(r...
ClovisIRex/Snake-django
refs/heads/master
env/lib/python3.6/site-packages/pylint/test/input/func_w0401_package/thing1.py
20
"""The first thing.""" __revision__ = None THING1 = "I am thing1"
olivierdalang/QGIS
refs/heads/master
python/plugins/processing/preconfigured/PreconfiguredAlgorithm.py
30
# -*- coding: utf-8 -*- """ *************************************************************************** PreconfiguredAlgorithm.py --------------------- Date : April 2016 Copyright : (C) 2016 by Victor Olaya Email : volayaf at gmail dot com *****************...
blueboxgroup/horizon
refs/heads/master
openstack_dashboard/api/rest/neutron.py
34
# # (c) Copyright 2015 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
Tatsh/youtube-dl
refs/heads/master
youtube_dl/extractor/thestar.py
75
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor class TheStarIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?thestar\.com/(?:[^/]+/)*(?P<id>.+)\.html' _TEST = { 'url': 'http://www.thestar.com/life/2016/02/01/mankind-why-this-woman-started-a-men-s-skincar...
vikasraunak/mptcp-1
refs/heads/development
src/wimax/test/examples-to-run.py
200
#! /usr/bin/env python ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- # A list of C++ examples to run in order to ensure that they remain # buildable and runnable over time. Each tuple in the list contains # # (example_name, do_run, do_valgrind_run). # # See test.py for more i...
TalShafir/ansible
refs/heads/devel
lib/ansible/modules/network/cloudengine/ce_config.py
43
#!/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...
forbidden-ali/LaZagne
refs/heads/master
Windows/src/LaZagne/softwares/browsers/ie.py
11
import win32con, win32api, win32cred import struct, hashlib, os, base64 from ctypes import * from ctypes.wintypes import DWORD from config.constant import * from config.write_output import print_output, print_debug from config.header import Header from config.moduleInfo import ModuleInfo memcpy = cdll.msvcrt.memcpy Lo...
SLU-Capstone/Recover
refs/heads/master
recover/forms/AddPatientForm.py
1
from wtforms import Form, StringField, validators from wtforms.fields.html5 import EmailField class AddPatientForm(Form): """ Form to add a patient to invite to our system. The physician will enter to patient's first and last name, as well as an email for our system to contact them with. """ f...
teltek/edx-platform
refs/heads/master
lms/__init__.py
54
""" Celery needs to be loaded when the cms modules are so that task registration and discovery can work correctly. """ from __future__ import absolute_import # We monkey patch Kombu's entrypoints listing because scanning through this # accounts for the majority of LMS/Studio startup time for tests, and we don't # use ...
geigerj/api-client-staging
refs/heads/master
generated/python/gapic-google-cloud-vision-v1/google/cloud/__init__.py
13048
__import__('pkg_resources').declare_namespace(__name__)
IllusionRom-deprecated/android_platform_tools_idea
refs/heads/master
python/lib/Lib/site-packages/django/contrib/gis/geometry/backend/geos.py
311
from django.contrib.gis.geos import \ GEOSGeometry as Geometry, \ GEOSException as GeometryException
sbusso/rethinkdb
refs/heads/next
external/v8_3.30.33.16/build/gyp/test/subdirectory/gyptest-subdir-all.py
185
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies building a subsidiary dependent target from a .gyp file in a subdirectory, without specifying an explicit output build director...
odoomrp/odoomrp-wip
refs/heads/8.0
mrp_configurable_timing/__init__.py
99
# -*- encoding: utf-8 -*- ############################################################################## # # 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 Free Software Foundation, either version 3 of the...
graphql-python/graphql-epoxy
refs/heads/master
epoxy/utils/no_implementation_registration.py
1
from contextlib import contextmanager from graphql.core.type import definition @contextmanager def no_implementation_registration(): old_definition = definition.add_impl_to_interfaces definition.add_impl_to_interfaces = lambda type: None try: yield finally: definition.add_impl_to_inte...
olivierdalang/QGIS
refs/heads/master
tests/src/python/test_qgslayertree.py
29
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsLayerTree. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. """ __au...
jjx02230808/project0223
refs/heads/master
sklearn/setup.py
19
import os from os.path import join import warnings def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration from numpy.distutils.system_info import get_info, BlasNotFoundError import numpy libraries = [] if os.name == 'posix': libraries.appe...
tersmitten/ansible
refs/heads/devel
test/units/plugins/cliconf/test_nos.py
68
# # (c) 2018 Extreme Networks 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. # # Ans...
bastings/neuralmonkey
refs/heads/master
neuralmonkey/nn/utils.py
1
""" This module provides utility functions used across the package. """ import tensorflow as tf def dropout(variable: tf.Tensor, keep_prob: float, train_mode: tf.Tensor) -> tf.Tensor: """Performs dropout on a variable, depending on mode. Arguments: variable: The variable to be...
pyload/pyload
refs/heads/develop
src/pyload/plugins/downloaders/FastixRu.py
2
# -*- coding: utf-8 -*- import json from ..base.multi_downloader import MultiDownloader class FastixRu(MultiDownloader): __name__ = "FastixRu" __type__ = "downloader" __version__ = "0.22" __status__ = "testing" __pattern__ = r"http://(?:www\.)?fastix\.(ru|it)/file/\w{24}" __config__ = [ ...
leonardowolf/bookfree
refs/heads/master
flask/lib/python3.5/site-packages/flask/_compat.py
176
# -*- coding: utf-8 -*- """ flask._compat ~~~~~~~~~~~~~ Some py2/py3 compatibility support based on a stripped down version of six so we don't have to depend on a specific version of it. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import sys PY...
qpic/qpic
refs/heads/master
docs/conf.py
2
#!/usr/bin/env python # -*- coding: utf-8 -*- # # qpic documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autoge...
marty331/jakesclock
refs/heads/master
flask/lib/python2.7/site-packages/pip/models/__init__.py
918
from pip.models.index import Index, PyPI __all__ = ["Index", "PyPI"]
ZachLiuGIS/django-allauth
refs/heads/master
allauth/socialaccount/providers/evernote/views.py
66
from __future__ import absolute_import from datetime import datetime from allauth.socialaccount import app_settings from allauth.socialaccount.providers.oauth.views import (OAuthAdapter, OAuthCallbackView, ...
tony/kivy
refs/heads/master
kivy/tests/test_clipboard.py
16
import unittest class ClipboardTestCase(unittest.TestCase): def setUp(self): from kivy.core.clipboard import Clipboard self._clippy = Clipboard clippy_types = Clipboard.get_types() cliptype = clippy_types[0] if 'UTF8_STRING' in clippy_types: cliptype = 'UTF8_ST...
flychensc/orange
refs/heads/master
backend/admin.py
13848
from django.contrib import admin # Register your models here.
azureplus/swftools-1
refs/heads/master
wx/lib/wordwrap.py
10
#---------------------------------------------------------------------- # Name: wx.lib.wordwrap # Purpose: Contains a function to aid in word-wrapping some text # # Author: Robin Dunn # # Created: 15-Oct-2006 # RCS-ID: $Id: wordwrap.py 54718 2008-07-19 18:57:26Z RD $ # Copyright: (c) 2006 by ...
mcltn/ansible-modules-extras
refs/heads/devel
monitoring/honeybadger_deployment.py
46
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2014 Benjamin Curtis <benjamin.curtis@gmail.com> # # 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 versi...
chiragjogi/odoo
refs/heads/8.0
addons/auth_signup/res_config.py
445
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
tmpgit/intellij-community
refs/heads/master
python/testData/inspections/ReplacePrintEnd_after.py
80
print(var, end=' ')
wertarbyte/gitosis
refs/heads/master
gitosis/test/test_gitdaemon.py
25
from nose.tools import eq_ as eq import os from ConfigParser import RawConfigParser from gitosis import gitdaemon from gitosis.test.util import maketemp, writeFile def exported(path): assert os.path.isdir(path) p = gitdaemon.export_ok_path(path) return os.path.exists(p) def test_git_daemon_export_ok_rep...
Jeff-Tian/mybnb
refs/heads/master
Python27/Lib/test/tracedmodules/__init__.py
20
"""This package contains modules that help testing the trace.py module. Note that the exact location of functions in these modules is important, as trace.py takes the real line numbers into account. """
puruckertom/ubertool
refs/heads/master
ubertool/foxsurplus/foxsurplus_exe.py
2
import numpy as np import os.path import pandas as pd import sys #find parent directory and import base (travis) parentddir = os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)) sys.path.append(parentddir) from base.uber_model import UberModel, ModelSharedInputs #print(sys.path) #print(os.path) c...
borgr/ucca
refs/heads/master
scenes/get_targets.py
1
"""Identifies and categorizes words according to Dixon's verb list.""" import pickle import sys from scenes import scenes def main(): dbfile = sys.argv[1] with open(dbfile, 'rb') as f: passages = pickle.load(f) nouns = set() for p in passages: sc = scenes.extract_possible_scenes(p)...
crysehillmes/android_kernel_samsung_klimtlte
refs/heads/cm-12.0
tools/perf/scripts/python/syscall-counts.py
11181
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
MartinHjelmare/home-assistant
refs/heads/dev
homeassistant/components/anel_pwrctrl/switch.py
7
"""Support for ANEL PwrCtrl switches.""" import logging import socket from datetime import timedelta import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.components.switch import (SwitchDevice, PLATFORM_SCHEMA) from homeassistant.const import (CONF_HOST, CONF_PASSWORD, CONF...
mikepea/fullerite
refs/heads/master
src/diamond/collectors/monit/monit.py
23
# coding=utf-8 """ Collect the monit stats and report on cpu/memory for monitored processes #### Dependencies * monit serving up /_status """ import urllib2 import base64 from xml.dom.minidom import parseString import diamond.collector class MonitCollector(diamond.collector.Collector): def get_default_co...
tvibliani/odoo
refs/heads/8.0
addons/account/report/account_partner_ledger.py
236
# -*- 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...
psawaya/Mental-Ginger
refs/heads/master
django/contrib/gis/db/backends/postgis/adapter.py
311
""" This object provides quoting for GEOS geometries into PostgreSQL/PostGIS. """ from psycopg2 import Binary from psycopg2.extensions import ISQLQuote class PostGISAdapter(object): def __init__(self, geom): "Initializes on the geometry." # Getting the WKB (in string form, to allow easy pickling ...
loxal/zcash
refs/heads/zc.v0.11.2.latest
qa/rpc-tests/test_framework/netutil.py
328
#!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Linux network utilities import sys import socket import fcntl import struct import array import os import bi...
PeterRyder/HackRPI
refs/heads/master
HackRPI/ConnHackEd/admin.py
13848
from django.contrib import admin # Register your models here.
gameduell/dask
refs/heads/master
dask/array/image.py
6
from __future__ import absolute_import, division, print_function from glob import glob import os try: from skimage.io import imread as sk_imread except ImportError: pass from .core import Array from ..base import tokenize def add_leading_dimension(x): return x[None, ...] def imread(filename, imread=N...
sknolin/pcp
refs/heads/master
pcplib/fastwalk.py
4
# Copyright (c) Genome Research Ltd 2014 # Author Guy Coates <gmpc@sanger.ac.uk> # This program is released under the GNU Public License V2 or later (GPLV2+) import os import readdir import stat import safestat def fastwalk (sourcedir, onerror=None, topdown=True): """Improved version of os.walk: generates a tuple ...
Gaia3D/QGIS
refs/heads/master
python/ext-libs/jinja2/environment.py
614
# -*- coding: utf-8 -*- """ jinja2.environment ~~~~~~~~~~~~~~~~~~ Provides a class that holds runtime and parsing time options. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import os import sys from jinja2 import nodes from jinja2.defaults import BLOCK_S...
FilipMalczak/corpy
refs/heads/master
src/unittest/python/injection_tests__.py
1
import unittest from corpy.injection import * from testing_utils import reported def simple_injection(): inject("simple_injection_val", 1) def two_level_injection_nested(): inject("two_level_injection_val", 1, offset=1) def two_level_injection(): two_level_injection_nested() def skipped_frame_inject...
globau/servo
refs/heads/master
tests/wpt/css-tests/tools/py/py/_code/_py2traceback.py
275
# copied from python-2.7.3's traceback.py # CHANGES: # - some_str is replaced, trying to create unicode strings # import types def format_exception_only(etype, value): """Format the exception part of a traceback. The arguments are the exception type and value such as given by sys.last_type and sys.last_va...
pandeyop/rally
refs/heads/master
tests/unit/benchmark/processing/test_utils.py
2
# Copyright 2014: Mirantis 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...
ghtmtt/QGIS
refs/heads/master
python/PyQt/PyQt5/QtGui.py
45
# -*- coding: utf-8 -*- """ *************************************************************************** QtGui.py --------------------- Date : November 2015 Copyright : (C) 2015 by Matthias Kuhn Email : matthias at opengis dot ch ****************************...
SlimRemix/android_external_chromium_org
refs/heads/lp5.1
tools/profile_chrome/trace_packager.py
48
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import gzip import json import os import shutil import sys import zipfile from profile_chrome import util from pylib import constants sys.path.append(os.p...
saurabh6790/medsynaptic-app
refs/heads/develop
stock/doctype/landed_cost_wizard/__init__.py
37694
from __future__ import unicode_literals
lingkong7/vertx-web
refs/heads/master
vertx-web/src/test/sockjs-protocol/venv/lib/python2.7/site-packages/pip/_vendor/requests/status_codes.py
695
# -*- coding: utf-8 -*- from .structures import LookupDict _codes = { # Informational. 100: ('continue',), 101: ('switching_protocols',), 102: ('processing',), 103: ('checkpoint',), 122: ('uri_too_long', 'request_uri_too_long'), 200: ('ok', 'okay', 'all_ok', 'all_okay', 'all_good', '\\o/'...
dlcwshi/p2pool-feathercoin
refs/heads/master
p2pool/util/forest.py
281
''' forest data structure ''' import itertools from p2pool.util import skiplist, variable class TrackerSkipList(skiplist.SkipList): def __init__(self, tracker): skiplist.SkipList.__init__(self) self.tracker = tracker self.tracker.removed.watch_weakref(self, lambda self, item: se...
GoogleCloudPlatform/professional-services
refs/heads/main
tools/ml-auto-eda/ml_eda/reporting/template.py
1
# Copyright 2019 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 ...
apark263/tensorflow
refs/heads/master
tensorflow/contrib/distribute/python/moving_averages_test.py
6
# 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...
J861449197/edx-platform
refs/heads/master
common/djangoapps/track/views/tests/test_views.py
69
# pylint: disable=missing-docstring,maybe-no-member from mock import patch, sentinel from django.contrib.auth.models import User from django.test.client import RequestFactory from django.test.utils import override_settings from track import views from track.middleware import TrackMiddleware from track.tests import E...
rishilification/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py
118
# 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 ...
bcorwin/twilio-python
refs/heads/master
tests/task_router/test_task_router_worker_capability.py
5
import time import unittest from twilio import jwt from twilio.task_router import TaskRouterWorkerCapability class TaskRouterWorkerCapabilityTest(unittest.TestCase): def check_policy(self, method, url, policy): self.assertEqual(url, policy['url']) self.assertEqual(method, policy['method']) ...
ettm2012/MissionPlanner
refs/heads/master
Lib/site-packages/scipy/special/docs/cephestest.py
51
#!"C:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\bin\Debug\ipy.exe" import scipy.special.cephes as cephes val = 0.8 val2 = 0.3 names = dir(cephes) for k in names[4:]: exec("fun = cephes."+k) try: print k + "(%f,%f) = " % (val2,val) print " %f" % fun(val2,val) ...
ragupta-git/ImcSdk
refs/heads/master
imcsdk/mometa/lsboot/LsbootDevPrecision.py
1
"""This module contains the general information for LsbootDevPrecision ManagedObject.""" from ...imcmo import ManagedObject from ...imccoremeta import MoPropertyMeta, MoMeta from ...imcmeta import VersionMeta class LsbootDevPrecisionConsts: CONFIGURED_BOOT_MODE_LEGACY = "Legacy" CONFIGURED_BOOT_MODE_NONE = "...
Hasimir/pyjs
refs/heads/master
examples/misc/djangotasks/urls.py
13
from django.conf.urls.defaults import * from django.conf import settings urlpatterns = patterns('', (r'^services/$', 'todo.views.service'), (r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC}), )
HarborYuan/cashier
refs/heads/master
env/Lib/types.py
27
""" Define names for built-in types that aren't directly accessible as a builtin. """ import sys # Iterators in Python aren't a matter of type but of protocol. A large # and changing number of builtin types implement *some* flavor of # iterator. Don't check the type! Use hasattr to check for both # "__iter__" and "...
eg-novelt/qgis-versioning
refs/heads/master
test.py
2
#!/usr/bin/python # coding=UTF-8 ''' To run this script from the current directory where this file resides : - set the PYTHONPATH environment variable : 'export PYTHONPATH=$PWD' All files must be in the 'test' directory and end with the string '_test.py' ''' import os import sys from subprocess import Popen, PIPE ...
badi/pyshc
refs/heads/master
pyshc/sh_test.py
1
from sh import Sh, CalledProcessError import unittest class TestSh(unittest.TestCase): def test_default(self): "Default usage should work" sh = Sh('ls') out = sh() self.assertIsInstance(out, str) def test_error_raises(self): "Error on subprocess should raise exception...
tecwebjoao/TecWeb-TF-2T-B-SI
refs/heads/master
venv/Lib/site-packages/setuptools/extern/__init__.py
213
from pkg_resources.extern import VendorImporter names = 'six', VendorImporter(__name__, names, 'pkg_resources._vendor').install()
ultima51x/shelltag
refs/heads/master
test/functions.py
1
# Copyright 2010 David Hwang # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # """ These are some helper functions for tests. """ import shutil import os import os.path front = "....
ivanbusthomi/inasafe
refs/heads/develop
show_help.py
1
#!/usr/bin/python """A helper to open the help documentation as a standalone dialog. Tim Sutton, 2016 """ from safe.test.qgis_app import qgis_app from safe.gui.tools.help_dialog import HelpDialog from safe.gui.tools.help import definitions_help APP, IFACE = qgis_app() dialog = HelpDialog( IFACE.mainWindow(), ...
pschmitt/home-assistant
refs/heads/dev
homeassistant/components/airly/const.py
5
"""Constants for Airly integration.""" ATTR_API_ADVICE = "ADVICE" ATTR_API_CAQI = "CAQI" ATTR_API_CAQI_DESCRIPTION = "DESCRIPTION" ATTR_API_CAQI_LEVEL = "LEVEL" ATTR_API_HUMIDITY = "HUMIDITY" ATTR_API_PM1 = "PM1" ATTR_API_PM10 = "PM10" ATTR_API_PM10_LIMIT = "PM10_LIMIT" ATTR_API_PM10_PERCENT = "PM10_PERCENT" ATTR_API_P...
dls-controls/pymalcolm
refs/heads/master
tests/test_modules/test_ADCore/test_hdfwriterpart.py
1
import os import shutil from xml.etree import ElementTree import cothread from mock import MagicMock, call from scanpointgenerator import CompoundGenerator, LineGenerator, SpiralGenerator from malcolm.core import Context, Future, Process from malcolm.modules.ADCore.blocks import hdf_writer_block from malcolm.modules....
yinquan529/platform-external-chromium-trace
refs/heads/master
trace-viewer/third_party/closure_linter/closure_linter/checker.py
135
#!/usr/bin/env python # # Copyright 2007 The Closure Linter 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 #...
giorgiop/scikit-learn
refs/heads/master
sklearn/utils/tests/test_multiclass.py
58
from __future__ import division import numpy as np import scipy.sparse as sp from itertools import product from sklearn.externals.six.moves import xrange from sklearn.externals.six import iteritems from scipy.sparse import issparse from scipy.sparse import csc_matrix from scipy.sparse import csr_matrix from scipy.sp...
mortada/tensorflow
refs/heads/master
tensorflow/contrib/distributions/python/ops/conditional_transformed_distribution.py
48
# 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...
micropython/micropython-esp32
refs/heads/esp32
tests/basics/tuple_count.py
118
a = (1, 2, 3) a = a + a + a b = (0, 0, a, 0, a, 0) print(a.count(2)) print(b.count(a))
talishte/ctigre
refs/heads/master
env/lib/python2.7/site-packages/django/core/files/move.py
112
""" Move a file in the safest way possible:: >>> from django.core.files.move import file_move_safe >>> file_move_safe("/tmp/old_file", "/tmp/new_file") """ import os from django.core.files import locks try: from shutil import copystat except ImportError: import stat def copystat(src, dst): ...
350dotorg/Django
refs/heads/master
tests/modeltests/get_or_create/tests.py
39
from datetime import date from django.db import IntegrityError from django.test import TransactionTestCase from models import Person, ManualPrimaryKeyTest class GetOrCreateTests(TransactionTestCase): def test_get_or_create(self): p = Person.objects.create( first_name='John', last_name='Lenno...
hmendozap/auto-sklearn
refs/heads/master
autosklearn/metrics/util.py
1
# -*- encoding: utf-8 -*- from __future__ import print_function import numpy as np import scipy as sp from autosklearn.constants import MULTICLASS_CLASSIFICATION, \ BINARY_CLASSIFICATION def sanitize_array(array): """ Replace NaN and Inf (there should not be any!) :param array: :return: """ ...
uannight/reposan
refs/heads/master
plugin.video.tvalacarta/channels/oncetvmex.py
2
# -*- coding: utf-8 -*- #------------------------------------------------------------ # tvalacarta - XBMC Plugin # Canal para Once 11 (mx) # http://blog.tvalacarta.info/plugin-xbmc/tvalacarta/ #------------------------------------------------------------ import os import sys import urlparse,re import urllib...
ewitz/PhotoHaus
refs/heads/master
app/main/errors.py
45
from flask import render_template from . import main @main.app_errorhandler(403) def forbidden(e): return render_template('403.html'), 403 @main.app_errorhandler(404) def page_not_found(e): return render_template('404.html'), 404 @main.app_errorhandler(500) def internal_server_error(e): return render_...
mlperf/training_results_v0.7
refs/heads/master
Fujitsu/benchmarks/ssd/implementations/implementation_closed/bind_launch.py
3
import sys import subprocess import os import socket from argparse import ArgumentParser, REMAINDER import torch def parse_args(): """ Helper function parsing the command line options @retval ArgumentParser """ parser = ArgumentParser(description="PyTorch distributed training launch " ...
uberamd/NGECore2
refs/heads/master
scripts/object/tangible/collection/rebel_assault_left_bicep.py
85615
import sys def setup(core, object): return
anderson7ru/bienestarues
refs/heads/master
generalapp/apps.py
1
from django.apps import AppConfig class GeneralappConfig(AppConfig): name = 'generalapp'
daspecster/google-cloud-python
refs/heads/master
vision/google/cloud/vision/batch.py
4
# Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...