repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
lidiamcfreitas/FenixScheduleMaker | refs/heads/master | oldFiles/project-env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py | 2057 | try:
# Python 3.2+
from ssl import CertificateError, match_hostname
except ImportError:
try:
# Backport of the function from a pypi module
from backports.ssl_match_hostname import CertificateError, match_hostname
except ImportError:
# Our vendored copy
from ._implementati... |
jrauch/eventnotifier | refs/heads/master | dn.py | 1 | import time
from Foundation import NSObject, NSAppleScript, NSBundle, NSDistributedNotificationCenter
from AppKit import NSWorkspace, NSWorkspaceDidWakeNotification, NSWorkspaceDidLaunchApplicationNotification, NSWorkspaceDidTerminateApplicationNotification
from PyObjCTools import AppHelper
class NotificationHandler... |
MoroGasper/client | refs/heads/master | client/patch.py | 1 | #!/usr/bin/env python
# encoding: utf-8
"""Copyright (C) 2013 COLDWELL AG
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 option) any later version.
Thi... |
jamiebull1/geomeppy | refs/heads/master | geomeppy/geom/polygons.py | 1 | """Heavy lifting geometry for IDF surfaces."""
from collections import MutableSequence
from itertools import product
from math import atan2, pi
from typing import Any, List, Optional, Tuple, Union # noqa
from eppy.geometry.surface import area
from eppy.idf_msequence import Idf_MSequence # noqa
import numpy as np
fro... |
Mazecreator/tensorflow | refs/heads/master | tensorflow/contrib/learn/python/learn/preprocessing/categorical_vocabulary.py | 63 | # 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... |
liorvh/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/bot/botinfo_unittest.py | 121 | # 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... |
Note-2/android_kernel_samsung_smdk4412 | refs/heads/cm-14.1 | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... |
zorroblue/scikit-learn | refs/heads/master | doc/datasets/conftest.py | 7 | from os.path import exists
from os.path import join
import numpy as np
from sklearn.utils.testing import SkipTest
from sklearn.utils.testing import check_skip_network
from sklearn.datasets import get_data_home
from sklearn.utils.testing import install_mldata_mock
from sklearn.utils.testing import uninstall_mldata_moc... |
sungkim11/mhargadh | refs/heads/master | django/contrib/flatpages/models.py | 410 | from django.db import models
from django.contrib.sites.models import Site
from django.utils.translation import ugettext_lazy as _
class FlatPage(models.Model):
url = models.CharField(_('URL'), max_length=100, db_index=True)
title = models.CharField(_('title'), max_length=200)
content = models.TextField(_(... |
justinfinkle/pydiffexp | refs/heads/master | scripts/mcf10a_analyze_sim_results.py | 1 | import ast
import numpy as np
import pandas as pd
from pydiffexp import get_scores, DEResults
from pydiffexp.analyze import pairwise_corr
from scipy import stats
calc_correlation = True
sim_data = pd.read_csv('intermediate_data/sim_stats_mcf10a_censoredtimes.tsv', sep='\t', index_col=[0, 1, 2], header=[0,1])
dea = pd... |
soellman/copernicus | refs/heads/master | cpc/lib/benchmark/sleep.py | 2 | import logging
import os
import time
import math
from cpc.dataflow import IntValue, FloatValue, StringValue
import cpc.command
from cpc.lib.gromacs import iterate
log=logging.getLogger(__name__)
def sleep(inp):
if (inp.testing()):
return
pers = cpc.dataflow.Persistence(os.path.join(inp.getPersistentD... |
aweisberg/cassandra-dtest | refs/heads/master | tools/data.py | 8 | import time
import logging
from cassandra import ConsistencyLevel
from cassandra.concurrent import execute_concurrent_with_args
from cassandra.query import SimpleStatement
from . import assertions
from dtest import create_cf, DtestTimeoutError
from tools.funcutils import get_rate_limited_function
logger = logging.ge... |
shhui/nova | refs/heads/master | nova/console/rpcapi.py | 12 | # Copyright 2013 Red Hat, 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 agre... |
shinpeimuraoka/ryu | refs/heads/master | ryu/services/protocols/bgp/speaker.py | 9 | # Copyright (C) 2014 Nippon Telegraph and Telephone 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 appli... |
glennlive/gnuradio-wg-grc | refs/heads/master | gr-vocoder/examples/ulaw_audio_loopback.py | 58 | #!/usr/bin/env python
#
# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# ... |
leesavide/pythonista-docs | refs/heads/master | Documentation/matplotlib/mpl_examples/images_contours_and_fields/streamplot_demo_masking.py | 6 | """
Demo of the streamplot function with masking.
This example shows how streamlines created by the streamplot function skips
masked regions and NaN values.
"""
import numpy as np
import matplotlib.pyplot as plt
w = 3
Y, X = np.mgrid[-w:w:100j, -w:w:100j]
U = -1 - X**2 + Y
V = 1 + X - Y**2
speed = np.sqrt(U*U + V*V)
... |
ytjiang/django | refs/heads/master | django/contrib/gis/db/models/sql/aggregates.py | 76 | from django.db.models.sql import aggregates
from django.db.models.sql.aggregates import * # NOQA
__all__ = ['Collect', 'Extent', 'Extent3D', 'MakeLine', 'Union'] + aggregates.__all__
warnings.warn(
"django.contrib.gis.db.models.sql.aggregates is deprecated. Use "
"django.contrib.gis.db.models.aggregates ins... |
qpleple/online-lda-vb | refs/heads/master | mdhoffma/onlineldavb.py | 1 | # onlineldavb.py: Package of functions for fitting Latent Dirichlet
# Allocation (LDA) with online variational Bayes (VB).
#
# Copyright (C) 2010 Matthew D. Hoffman
#
# 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... |
apixandru/intellij-community | refs/heads/master | python/testData/inspections/PyAttributeOutsideInitInspection/truePositive.py | 83 | __author__ = 'ktisha'
class A:
def __init__(self):
self.a = 1
def foo(self):
<weak_warning descr="Instance attribute b defined outside __init__">self.b</weak_warning>= 1
|
saitodisse/zulip | refs/heads/master | zerver/lib/session_user.py | 125 | from __future__ import absolute_import
from django.contrib.auth import SESSION_KEY, get_user_model
def get_session_dict_user(session_dict):
# Compare django.contrib.auth._get_user_session_key
try:
return get_user_model()._meta.pk.to_python(session_dict[SESSION_KEY])
except KeyError:
return... |
mollstam/UnrealPy | refs/heads/master | UnrealPyEmbed/Source/Python/Lib/python27/test/test_typechecks.py | 137 | """Unit tests for __instancecheck__ and __subclasscheck__."""
import unittest
from test import test_support
class ABC(type):
def __instancecheck__(cls, inst):
"""Implement isinstance(inst, cls)."""
return any(cls.__subclasscheck__(c)
for c in set([type(inst), inst.__class__]))... |
chidea/GoPythonDLLWrapper | refs/heads/master | bin/lib/_sitebuiltins.py | 137 | """
The objects used by the site module to add custom builtins.
"""
# Those objects are almost immortal and they keep a reference to their module
# globals. Defining them in the site module would keep too many references
# alive.
# Note this means this module should also avoid keep things alive in its
# globals.
imp... |
fertozudo/umatoo | refs/heads/master | lib/django/middleware/csrf.py | 118 | """
Cross Site Request Forgery Middleware.
This module provides a middleware that implements protection
against request forgeries from other sites.
"""
from __future__ import unicode_literals
import logging
import re
from django.conf import settings
from django.core.urlresolvers import get_callable
from django.utils... |
apechimp/servo | refs/heads/master | tests/wpt/web-platform-tests/webdriver/navigation/forwardToNothing.py | 142 | import os
import sys
import unittest
sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
import base_test
class ForwardToNothingTest(base_test.WebDriverBaseTest):
# Get a static page that must be the same upon refresh
def test_forwardToNothing(self):
self.driver.get(self.webserver.wh... |
arnaud-morvan/QGIS | refs/heads/master | tests/src/python/test_qgssinglesymbolrenderer.py | 17 | # -*- coding: utf-8 -*-
"""
***************************************************************************
test_qgssinglesymbolrenderer.py
---------------------
Date : December 2015
Copyright : (C) 2015 by Matthias Kuhn
Email : matthias at opengis dot ch
*****... |
ferreiro/Python | refs/heads/master | 4_SQL/fifthQuery_Completed.py | 3 |
def fithQuery2(cursor):
#idea find all id of student and for all student search on the aplication tabla and obtain only the carrera
#if the Distincs carrera for each student is more than 2 borra ello
aplications = []
try:
cursor.execute('Select ID FROM Students')
lineList =[] #list of all id of students
for... |
coreyoconnor/NeatX | refs/heads/master | lib/session.py | 3 | #
#
# Copyright (C) 2009 Google 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 2 of the License, or
# (at your option) any later version.
#
# This program is distributed ... |
nhippenmeyer/django | refs/heads/master | django/conf/urls/i18n.py | 310 | import warnings
from django.conf import settings
from django.conf.urls import patterns, url
from django.core.urlresolvers import LocaleRegexURLResolver
from django.utils import six
from django.utils.deprecation import RemovedInDjango110Warning
from django.views.i18n import set_language
def i18n_patterns(prefix, *arg... |
GbalsaC/bitnamiP | refs/heads/master | venv/lib/python2.7/site-packages/south/__init__.py | 2 | """
South - Useable migrations for Django apps
"""
__version__ = "1.0.1"
__authors__ = [
"Andrew Godwin <andrew@aeracode.org>",
"Andy McCurdy <andy@andymccurdy.com>"
]
|
allotria/intellij-community | refs/heads/master | python/testData/resolve/pyToJava/Field.py | 83 | from java.lang import System
System.ou<ref>t |
smalls257/VRvisu | refs/heads/master | Library/External.LCA_RESTRICTED/Languages/CPython/27/Lib/test/test_print.py | 121 | """Test correct operation of the print function.
"""
# In 2.6, this gives us the behavior we want. In 3.0, it has
# no function, but it still must parse correctly.
from __future__ import print_function
import unittest
from test import test_support
from StringIO import StringIO
NotDefined = object()
# A dispatch ... |
etherkit/OpenBeacon2 | refs/heads/master | client/linux-arm/venv/lib/python3.6/site-packages/PyInstaller/hooks/hook-PyQt4.QtGui.py | 4 | #-----------------------------------------------------------------------------
# Copyright (c) 2013-2020, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is in the file COPYING.txt... |
marcsans/cnn-physics-perception | refs/heads/master | phy/lib/python2.7/site-packages/scipy/io/harwell_boeing/setup.py | 128 | #!/usr/bin/env python
from __future__ import division, print_function, absolute_import
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('harwell_boeing',parent_package,top_path)
config.add_data_dir('tests')
return config
i... |
Haikson/django-nginx-uwsgi | refs/heads/master | dnuconfig/__init__.py | 1 | #~*~ coding: utf-8 ~*~
__author__ = 'Kamo Petrosyan' |
ooici/marine-integrations | refs/heads/master | mi/core/unit_test.py | 1 | #! /usr/bin/env python
"""
@file ion/core/unit_test.py
@author Bill French
@brief Base test class for all MI tests. Provides two base classes,
One for pyon tests and one for stand alone MI tests.
We have the stand alone test case for tests that don't require or can't
integrate with the common ION test case.
"""
... |
dol-sen/portage | refs/heads/master | repoman/pym/repoman/metadata.py | 3 | # -*- coding:utf-8 -*-
from __future__ import print_function, unicode_literals
import errno
import logging
import sys
import tempfile
import time
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
# import our initialized portage instance
from repoman._portage import portage... |
adoosii/edx-platform | refs/heads/master | lms/djangoapps/bulk_email/tests/test_err_handling.py | 12 | # -*- coding: utf-8 -*-
"""
Unit tests for handling email sending errors
"""
from itertools import cycle
from celery.states import SUCCESS, RETRY # pylint: disable=no-name-in-module, import-error
from django.conf import settings
from django.core.management import call_command
from django.core.urlresolvers import reve... |
gnowxilef/youtube-dl | refs/heads/master | youtube_dl/extractor/eroprofile.py | 61 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_urllib_parse_urlencode
from ..utils import (
ExtractorError,
unescapeHTML
)
class EroProfileIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?eroprofile\.com/m/videos/view/(?P<id>[^/]+)'
... |
leppa/home-assistant | refs/heads/dev | homeassistant/components/keba/sensor.py | 1 | """Support for KEBA charging station sensors."""
import logging
from homeassistant.const import DEVICE_CLASS_POWER, ENERGY_KILO_WATT_HOUR
from homeassistant.helpers.entity import Entity
from . import DOMAIN
_LOGGER = logging.getLogger(__name__)
async def async_setup_platform(hass, config, async_add_entities, disco... |
malept/gunicorn | refs/heads/master | examples/frameworks/django/testing/testing/apps/someapp/urls.py | 33 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^acsv$', views.acsv),
url(r'^$', views.home),
]
|
openfisca/openfisca-france-data | refs/heads/master | openfisca_france_data/model/common.py | 1 | # -*- coding: utf-8 -*-
from numpy import arange
try:
from openfisca_survey_manager.statshelpers import weighted_quantiles
except ImportError:
weighted_quantiles = None
try:
from openfisca_survey_manager.statshelpers import mark_weighted_percentiles
except ImportError:
mark_weighted_percentiles = N... |
ericholscher/pinax | refs/heads/master | pinax/projects/social_project/tests/smoke_test.py | 8 | ## initially a quick smoke test to see if certain URLs throw exceptions or not
## would have caught a high percentage of recent trunk breakages
## run with ./manage.py runscript tests.smoke_test
def run():
from django.test.client import Client
c = Client()
pages = [
'/',
'/about/',
... |
fausecteam/ctf-gameserver | refs/heads/master | tests/checker/test_integration.py | 1 | import os.path
from unittest import SkipTest
from unittest.mock import patch
import shutil
import sqlite3
import subprocess
import tempfile
import time
from ctf_gameserver.checker.master import MasterLoop
from ctf_gameserver.checker.metrics import DummyQueue
from ctf_gameserver.lib.checkresult import CheckResult
from ... |
ojengwa/grr | refs/heads/master | lib/rdfvalues/stats.py | 4 | #!/usr/bin/env python
"""RDFValue instances related to the statistics collection."""
import math
import threading
from grr.lib import rdfvalue
from grr.lib import utils
from grr.proto import analysis_pb2
from grr.proto import jobs_pb2
class StatsHistogramBin(rdfvalue.RDFProtoStruct):
protobuf = jobs_pb2.StatsHis... |
hotpxl/mxnet | refs/heads/master | tools/caffe_converter/compare_layers.py | 5 | """Test converted models layer by layer
"""
import os
import argparse
import logging
import mxnet as mx
import cv2
import numpy as np
logging.basicConfig(level=logging.INFO)
def read_image(img_path, image_dims=None, mean=None):
"""
Reads an image from file path or URL, optionally resizing to given image dime... |
monikagrabowska/osf.io | refs/heads/develop | tests/test_guids.py | 3 | # -*- coding: utf-8 -*-
import mock
from nose.tools import * # noqa
from tests.base import OsfTestCase
from tests.factories import NodeFactory
from modularodm import Q
from modularodm import fields
from framework.mongo.storage import MongoStorage
from framework.mongo import database
from framework.guid.model impor... |
gnieboer/gnuradio | refs/heads/android | gr-digital/examples/snr_estimators.py | 46 | #!/usr/bin/env python
#
# Copyright 2011-2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your optio... |
jiaphuan/models | refs/heads/master | research/rebar/rebar_train.py | 9 | # Copyright 2017 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 a... |
barachka/odoo | refs/heads/master | addons/sale/wizard/sale_line_invoice.py | 61 | # -*- 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... |
woltage/ansible | refs/heads/devel | lib/ansible/executor/connection_info.py | 4 | # -*- coding: utf-8 -*-
# (c) 2012-2014, Michael DeHaan <michael.dehaan@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 version 3 of the License,... |
ngoix/OCRF | refs/heads/master | sklearn/utils/tests/test_multiclass.py | 34 |
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... |
Chilledheart/googletest | refs/heads/master | googletest/test/gtest_shuffle_test.py | 3023 | #!/usr/bin/env python
#
# Copyright 2009 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... |
openstack/tempest-lib | refs/heads/master | tempest_lib/cmd/check_uuid.py | 1 | #!/usr/bin/env python
# Copyright 2014 Mirantis, 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 a... |
mikedchavez1010/XX-Net | refs/heads/master | python27/1.0/lib/logging/config.py | 61 | # Copyright 2001-2014 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... |
xinwu/horizon | refs/heads/master | openstack_dashboard/dashboards/project/stacks/resource_types/tables.py | 59 | # 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 the... |
KellyChan/Python | refs/heads/master | python/django/elf/elf/src/dream/models.py | 3 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from django.db import models
from django.contrib.auth.models import User
class Dream(models.Model):
user = models.ForeignKey(User)
date = models.DateField(unique=True)
title = models.CharField(max_length=100)
content = models.TextField()
feedback = mode... |
anhstudios/swganh | refs/heads/develop | data/scripts/templates/object/ship/shared_bwing.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Ship()
result.template = "object/ship/shared_bwing.iff"
result.attribute_template_id = -1
result.stfName("","") ... |
jamesliu/mxnet | refs/heads/master | python/mxnet/_cy2/__init__.py | 50 | # 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... |
irin4eto/Bar-Management | refs/heads/master | manager/migrations/0001_initial.py | 4 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Manager'
db.create_table('manager_manager', (
... |
RCoon/CodingBat | refs/heads/master | Python/Logic_2/close_far.py | 1 | # Given three ints, a b c, return True if one of b or c is "close" (differing
# from a by at most 1), while the other is "far", differing from both other
# values by 2 or more. Note: abs(num) computes the absolute value of a number.
# close_far(1, 2, 10) --> True
# close_far(1, 2, 3) --> False
# close_far(4, 1, 3) --... |
MQQiang/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/turtledemo/clock.py | 99 | #!/usr/bin/env python3
# -*- coding: cp1252 -*-
""" turtle-example-suite:
tdemo_clock.py
Enhanced clock-program, showing date
and time
------------------------------------
Press STOP to exit the program!
------------------------------------
"""
from turtle import *
from datetime import datet... |
pixelrebel/st2 | refs/heads/master | st2common/tests/unit/test_logging.py | 4 | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... |
tlatzko/spmcluster | refs/heads/master | .tox/2.6-nocov/lib/python2.6/site-packages/pip/req/req_file.py | 239 | """
Requirements file parsing
"""
from __future__ import absolute_import
import os
import re
import shlex
import optparse
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.six.moves import filterfalse
import pip
from pip.download import get_file_content
from pip.req.req_install import ... |
gentoo/gentoo-keys | refs/heads/master | gkeys-ldap/gkeyldap/__init__.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
__version__ = '0.2'
__license__ = 'GPLv2'
|
lzambella/Qyoutube-dl | refs/heads/master | youtube_dl/extractor/revision3.py | 8 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
int_or_none,
parse_iso8601,
unescapeHTML,
qualities,
)
class Revision3IE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?(?P<domain>(?:revis... |
bilgili/nest-simulator | refs/heads/master | topology/pynest/tests/test_dumping.py | 13 | # -*- coding: utf-8 -*-
#
# test_dumping.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, o... |
lucidbard/NewsBlur | refs/heads/master | vendor/paypal/standard/conf.py | 31 | from django.conf import settings
class PayPalSettingsError(Exception):
"""Raised when settings be bad."""
RECEIVER_EMAIL = settings.PAYPAL_RECEIVER_EMAIL
# API Endpoints.
POSTBACK_ENDPOINT = "https://www.paypal.com/cgi-bin/webscr"
SANDBOX_POSTBACK_ENDPOINT = "https://www.sandbox.paypal.com/cgi-bin/webscr"
# ... |
zhulin2609/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla_unittest.py | 119 | # 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
ZhangXinNan/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/where_op_test.py | 7 | # 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... |
guoxiaoyong/simple-useful | refs/heads/master | cxx_learn/cronx/spider/spider_daily_ftse100.py | 2 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import urllib2;
import re;
import string;
import sys;
from BeautifulSoup import BeautifulSoup
month_num = {
'Jan' : '01',
'Feb' : '02',
'Mar' : '03',
'Apr' : '04',
'May' : '05',
'Jun' : '06',
'Jul' : '07',
'Aug' : '08',
'Sep' : '09',
'Oct' : '10',
'Nov' : ... |
sestrella/ansible | refs/heads/devel | test/units/modules/network/fortios/test_fortios_firewall_ttl_policy.py | 21 | # 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 License, or
# (at your option) any later version.
#
# This program is distributed in the... |
Bismarrck/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/topk_op_test.py | 6 | # 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... |
pedro2d10/SickRage-FR | refs/heads/develop | sickbeard/common.py | 1 | # 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 Fre... |
timm/timmnix | refs/heads/master | pypy3-v5.5.0-linux64/lib_pypy/cffi/_pycparser/ply/yacc.py | 465 | # -----------------------------------------------------------------------------
# ply: yacc.py
#
# Copyright (C) 2001-2011,
# David M. Beazley (Dabeaz LLC)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... |
DroneMapp/powerlibs-aws-sqs-dequeue_to_api | refs/heads/master | tests/test_dequeuer.py | 1 | import pytest
def test_handle_message__patch(dequeuer, update_message):
dequeuer.handle_message(update_message)
method = dequeuer.mocked_requests_module.patch
assert method.call_count == 1
assert update_message.delete.call_count == 1
def test_handle_message__post(dequeuer, create_message):
dequ... |
yongshengwang/hue | refs/heads/master | desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/filter.py | 44 | """
filters.py - misc stuff for handling LDAP filter strings (see RFC2254)
See http://www.python-ldap.org/ for details.
\$Id: filter.py,v 1.8 2010/04/19 17:34:36 stroeder Exp $
Compability:
- Tested with Python 2.0+
"""
from ldap import __version__
def escape_filter_chars(assertion_value,escape_mode=0):
"""
R... |
0x7067/imagevision-bot | refs/heads/master | bot.py | 1 | #!/usr/bin/env python3
import time
import logging
import telebot
from mscomputervision import _mskey
from mscomputervision import msProcessRequest
from translator import *
TOKEN = "" # YOUR BotFather token here
logger = telebot.logger
telebot.logger.setLevel(logging.DEBUG) # Outputs debug messages to console.
bot ... |
csgrad/ns-3-9-ngwmn | refs/heads/master | waf-tools/cflags.py | 17 | import Logs
import Options
import Utils
class CompilerTraits(object):
def get_warnings_flags(self, level):
"""get_warnings_flags(level) -> list of cflags"""
raise NotImplementedError
def get_optimization_flags(self, level):
"""get_optimization_flags(level) -> list of cflags"""
raise NotImplementedError
d... |
t-yanaka/zabbix-report | refs/heads/master | customer_api/sessions/apps.py | 591 | from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class SessionsConfig(AppConfig):
name = 'django.contrib.sessions'
verbose_name = _("Sessions")
|
shams169/pythonProject | refs/heads/master | env/lib/python3.6/site-packages/pip/exceptions.py | 344 | """Exceptions used throughout package"""
from __future__ import absolute_import
from itertools import chain, groupby, repeat
from pip._vendor.six import iteritems
class PipError(Exception):
"""Base pip exception"""
class InstallationError(PipError):
"""General exception during installation"""
class Unin... |
tritoanst/ccxt | refs/heads/master | python/ccxt/huobi.py | 1 | # -*- coding: utf-8 -*-
from ccxt.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
class huobi (Exchange):
def describe(self):
return self.deep_extend(super(huobi, self).describe(), {
'id': 'huobi',
'name': 'Huobi',
'countries': 'CN',
... |
jaromil/faircoin2 | refs/heads/faircoin2 | qa/rpc-tests/merkle_blocks.py | 13 | #!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test merkleblock fetch/validation
#
from test_framework.test_framework import BitcoinTestFramework
f... |
jbhuang0604/CF2 | refs/heads/master | external/matconvnet/utils/import-caffe.py | 4 | #! /usr/bin/python
# file: import-caffe.py
# brief: Caffe importer for DagNN and SimpleNN
# author: Karel Lenc and Andrea Vedaldi
# Requires Google Protobuf for Python and SciPy
import sys
import os
import argparse
import code
import re
import numpy as np
from math import floor, ceil
import numpy
from numpy import ar... |
synconics/odoo | refs/heads/8.0 | addons/payment_authorize/tests/__init__.py | 224 | # -*- coding: utf-8 -*-
from openerp.addons.payment_authorize.tests import test_authorize
|
RealImpactAnalytics/airflow | refs/heads/master | airflow/hooks/base_hook.py | 3 | # -*- coding: utf-8 -*-
#
# 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
#... |
diana-hep/femtocode | refs/heads/master | lang/femtocode/thirdparty/meta/decompiler/__init__.py | 1 | '''
Decompiler module.
This module can decompile arbitrary code objects into a python ast.
'''
from ..decompiler.instructions import make_module, make_function
import _ast
import struct
import time
import sys
import marshal
def decompile_func(func):
'''
Decompile a function into ast.FunctionDef node.
... |
oleksa-pavlenko/gae-django-project-template | refs/heads/master | django/contrib/staticfiles/urls.py | 78 | from django.conf import settings
from django.conf.urls.static import static
urlpatterns = []
def staticfiles_urlpatterns(prefix=None):
"""
Helper function to return a URL pattern for serving static files.
"""
if prefix is None:
prefix = settings.STATIC_URL
return static(prefix, view='djan... |
caseyfw/slack-sounds | refs/heads/master | slackclient/_util.py | 27 | class SearchList(list):
def find(self, name):
items = []
for child in self:
if child.__class__ == self.__class__:
items += child.find(name)
else:
if child == name:
items.append(child)
if len(items) == 1:
... |
mlperf/training_results_v0.7 | refs/heads/master | Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/3rdparty/tvm/python/tvm/tensor_intrin.py | 2 | # 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... |
kxliugang/edx-platform | refs/heads/master | lms/djangoapps/bulk_email/migrations/0009_force_unique_course_ids.py | 114 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding unique constraint on 'CourseAuthorization', fields ['course_id']
db.create_unique('bulk_email_cours... |
mlibrary/image-conversion-and-validation | refs/heads/master | falcom/test/hamcrest/composed_matcher.py | 2 | # Copyright (c) 2017 The Regents of the University of Michigan.
# All Rights Reserved. Licensed according to the terms of the Revised
# BSD License. See LICENSE.txt for details.
from hamcrest.core.base_matcher import BaseMatcher
class ComposedMatcher (BaseMatcher):
def _matches (self, item):
self.failed_m... |
our-city-app/oca-backend | refs/heads/master | src/rogerthat/restapi/build_api/to.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2020 Green Valley NV
#
# 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 l... |
andrewfu0325/gem5-aladdin | refs/heads/ruby | ext/ply/example/BASIC/basinterp.py | 166 | # This file provides the runtime support for running a basic program
# Assumes the program has been parsed using basparse.py
import sys
import math
import random
class BasicInterpreter:
# Initialize the interpreter. prog is a dictionary
# containing (line,statement) mappings
def __init__(self,prog):
... |
bperreault-va/eloworld | refs/heads/master | src/lib/markupsafe/_compat.py | 864 | # -*- coding: utf-8 -*-
"""
markupsafe._compat
~~~~~~~~~~~~~~~~~~
Compatibility module for different Python versions.
:copyright: (c) 2013 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import sys
PY2 = sys.version_info[0] == 2
if not PY2:
text_type = str
string_type... |
mattrobenolt/django | refs/heads/master | tests/save_delete_hooks/models.py | 409 | """
Adding hooks before/after saving and deleting
To execute arbitrary code around ``save()`` and ``delete()``, just subclass
the methods.
"""
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Person(... |
bassio/omicexperiment | refs/heads/master | omicexperiment/util.py | 1 | import hashlib
import pandas as pd
def parse_fasta_labels(fasta_filepath):
with open(fasta_filepath) as f:
for l in f:
l = l.strip()
if l.startswith(">"):
desc = l[1:]
yield desc
def parse_fasta(fasta_filepath):
def _parse_fasta(fasta):
... |
GrandmasterK/XScheduler | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.py | 894 | # -*- coding: utf-8 -*-
"""
requests.exceptions
~~~~~~~~~~~~~~~~~~~
This module contains the set of Requests' exceptions.
"""
from .packages.urllib3.exceptions import HTTPError as BaseHTTPError
class RequestException(IOError):
"""There was an ambiguous exception that occurred while handling your
request.""... |
AWNystrom/BloomML | refs/heads/master | bloom_freqmap.py | 1 | """
the squashed counts are stored. So the lookup should look like
c = 1
while c in bf:
c+= 1
return self.decode(c-1)
the increment should look like
def increment(item, by):
#Get the current quantized count
cur = count(item, decode=True)
to = self.encode(cur+by)
for i in xrange(cur+1, to+1):
bf.add(item+'_... |
NejcZupec/ggrc-core | refs/heads/develop | src/ggrc_basic_permissions/converters/__init__.py | 256 | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
|
batermj/algorithm-challenger | refs/heads/master | code-analysis/programming_anguage/python/source_codes/Python3.5.9/Python-3.5.9/Lib/unittest/test/test_case.py | 2 | import contextlib
import difflib
import pprint
import pickle
import re
import sys
import logging
import warnings
import weakref
import inspect
from copy import deepcopy
from test import support
import unittest
from unittest.test.support import (
TestEquality, TestHashing, LoggingResult, LegacyLoggingResult,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.