repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
chshu/openthread | refs/heads/master | tests/scripts/thread-cert/Cert_7_1_01_BorderRouterAsLeader.py | 2 | #!/usr/bin/env python3
#
# Copyright (c) 2016, The OpenThread Authors.
# 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
# ... |
davidzchen/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/string_lower_op_test.py | 24 | # -*- coding: utf-8 -*-
# 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
#
# Un... |
unnikrishnankgs/va | refs/heads/master | venv/lib/python3.5/site-packages/django/db/backends/oracle/features.py | 37 | from django.db.backends.base.features import BaseDatabaseFeatures
from django.db.utils import InterfaceError
try:
import pytz
except ImportError:
pytz = None
class DatabaseFeatures(BaseDatabaseFeatures):
empty_fetchmany_value = ()
interprets_empty_strings_as_nulls = True
uses_savepoints = True
... |
MichaelAquilina/numpy | refs/heads/master | numpy/f2py/__init__.py | 64 | #!/usr/bin/env python
"""Fortran to Python Interface Generator.
"""
from __future__ import division, absolute_import, print_function
__all__ = ['run_main', 'compile', 'f2py_testing']
import sys
from . import f2py2e
from . import f2py_testing
from . import diagnose
run_main = f2py2e.run_main
main = f2py2e.main
de... |
furious-luke/django-autoajax | refs/heads/master | autoajax/forms/forms.py | 1 | import simplejson as json
from importlib import import_module
from django import forms
from django.http import Http404
from django.utils.html import escapejs
from django.utils.translation import ugettext_lazy as _
from django_ajax.decorators import ajax
from .widgets import *
__all__ = ['AutoAjaxField', 'DependentMode... |
rackerlabs/horizon | refs/heads/master | horizon/test/test_dashboards/cats/models.py | 979 | """
Stub file to work around django bug: https://code.djangoproject.com/ticket/7198
"""
|
MrYsLab/PyMata | refs/heads/master | examples/digital_analog_io/callback_buttonLed_toggle.py | 1 | #!/usr/bin/env python
"""
Copyright (c) 2015-2017 Alan Yorinks All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
Version 3 as published by the Free Software Foundation; either
or (at your option) any later version.... |
sangh/LaserShow | refs/heads/master | pyglet-hg/experimental/buffer/bars.py | 28 | #!/usr/bin/python
# $Id:$
import random
import sys
from pyglet.gl import *
from pyglet import clock
from pyglet import font
from pyglet import graphics
from pyglet import window
BARS = 100
if len(sys.argv) > 1:
BARS = int(sys.argv[1])
MIN_BAR_LENGTH = 4
MAX_BAR_LENGTH = 100
BAR_SEGMENT_HEIGHT = 10
UPDATE_PERIOD... |
lsgunth/rapidsms | refs/heads/develop | rapidsms/tests/translation/tests.py | 7 | from django.test.utils import override_settings
from rapidsms.models import Connection
from rapidsms.tests.harness import RapidTest
from rapidsms.tests.translation import app
from rapidsms.utils import translation as trans_helpers
class TranslationTestMixin(object):
def setUp(self):
super(TranslationTest... |
pavelchristof/gomoku-ai | refs/heads/master | tensorflow/python/training/tensorboard_logging.py | 165 | # 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... |
oldmantaiter/disco | refs/heads/develop | tests/test_tempfail.py | 11 | import threading
from disco.test import TestCase, TestJob, FailedReply
class TempFailJob(TestJob):
@staticmethod
def map(e, params):
yield int(e) * 10, ''
class TempFailTestCase(TestCase):
input = range(50)
def serve(self, path):
self.lock.acquire()
if path in self.fail:
... |
PythonSanSebastian/conference | refs/heads/master | conference/utils/dump-assopy-talks.py | 8 | #!/usr/bin/python
# -*- coding: utf-8 -*-
HOST = 'localhost'
DBNAME = 'assopy09'
USER = 'assopy'
PASSWORD = 'assopy'
SPEAKER_IMG = '/home/assopy/genro/data/sites/assopy09/data/speakers'
import sys
import psycopg2
from xml.etree import cElementTree as ET
import os.path
import zipfile
_speakers = []
def list_talk():
... |
taotie12010/bigfour | refs/heads/master | common/lib/xmodule/xmodule/modulestore/tests/test_asides.py | 92 | """
Tests for Asides
"""
from xblock.core import XBlockAside
from xblock.fields import Scope, String
from xblock.fragment import Fragment
from unittest import TestCase
from xmodule.modulestore.tests.test_cross_modulestore_import_export import XmlModulestoreBuilder
from mock import patch
class AsideTestType(XBlockAsid... |
jeffbinder/adamsmith | refs/heads/master | count-subheadings.py | 1 | # Output the number of subheadings matching a given pattern
import pickle
import re
index = pickle.load(open('index.pkl'))
nsubheadings = 0
nmatching_subheadings = 0
for heading in index:
subheadings = set()
for subheading, n in index[heading]:
subheadings.add(subheading)
for subheading in subhea... |
40423116/2016fallcadp_hw | refs/heads/gh-pages | course/pelican.py | 39 | # https://github.com/getpelican/pelican
# 為何要使用 Pelican? 如何使用 Pelican?
# 為何要使用 Leo Editor? 如何使用 Leo Editor?
# 為何要使用 Python? 如何使用 Python?
# 為何要使用 Brython? 如何使用 Brython?
# 為何要使用 Brython-Server? 如何使用 Brython-Server?
# 為何要使用 CMSimfly? 如何使用 CMSimfly?
# 為何要使用 Pygrouf? 如何使用 Pygrouf?
# 機械設計工程師在選擇一項工具時, 必須自問, 為何要使用這項工具? 如何使用這項工... |
jhugon/astroobsplanner | refs/heads/master | astroobsplanner/makealtplot.py | 1 | #!/usr/bin/env python2
# vim: set fileencoding=utf-8
from skyfield.api import load, Topos
from skyfield.starlib import Star
from skyfield import almanac
from matplotlib.dates import HourLocator, DateFormatter
def find_twilight(location,t_timescale_nights_local_list):
planets = load("de421.bsp")
topo = Topos(l... |
abhishek-ch/hue | refs/heads/master | desktop/core/ext-py/tablib-0.10.0/test_tablib.py | 29 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for Tablib."""
import json
import unittest
import sys
import os
import tablib
from tablib.compat import markup, unicode, is_py3
class TablibTestCase(unittest.TestCase):
"""Tablib test cases."""
def setUp(self):
"""Create simple data set with ... |
parker20121/joshua-mt | refs/heads/master | joshua-web/manage.py | 1 | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Joshua.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
jarodwilson/atomic-reactor | refs/heads/master | atomic_reactor/plugins/pre_check_and_set_rebuild.py | 3 | """
Copyright (c) 2015 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import unicode_literals
from osbs.api import OSBS
from osbs.conf import Configuration
from osbs.exceptions import OsbsRespon... |
bregman-arie/ansible | refs/heads/devel | contrib/inventory/ec2.py | 22 | #!/usr/bin/env python
'''
EC2 external inventory script
=================================
Generates inventory that Ansible can understand by making API request to
AWS EC2 using the Boto library.
NOTE: This script assumes Ansible is being executed where the environment
variables needed for Boto have already been set:... |
lucab/security_monkey | refs/heads/master | security_monkey/common/sts_connect.py | 1 | # Copyright 2014 Netflix, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
djgagne/hagelslag | refs/heads/master | hagelslag/data/GribModelGrid.py | 1 | #!/usr/bin/env python
import pandas as pd
import pygrib
import numpy as np
from os.path import exists
import datetime
from netCDF4 import Dataset
class GribModelGrid(object):
"""
Base class for reading 2D model output grids from grib2 files.
Given a list of file names, loads the values of a single variabl... |
eXpl0it3r/streamzap | refs/heads/master | streamzap/segmentinfo.py | 1 | class SegmentInfo(object):
def __init__(self, timestamp='N/A', session='N/A', service='N/A', protocol='N/A', bitrate='N/A',
width='N/A', height='N/A', framerate='N/A', segmenturl='N/A', segmentsize='N/A', itag='N/A'):
self.timestamp = timestamp
self.session = session
se... |
ceko/django-form-architect | refs/heads/master | django_form_architect/settings.py | 1 | from django_form_architect import WidgetDescriptor
from django.conf import settings
from os.path import join
import models
import forms
DEFAULT_JS_FOLDER = join(settings.STATIC_URL, 'django_form_architect/js/')
DEFAULT_BUILDER_TEMPLATE_FOLDER = 'django_form_architect/widgets/builder/'
BUILTIN_WIDGETS = {
... |
toontownfunserver/Panda3D-1.9.0 | refs/heads/master | python/Lib/sunaudio.py | 286 | """Interpret sun audio headers."""
from warnings import warnpy3k
warnpy3k("the sunaudio module has been removed in Python 3.0; "
"use the sunau module instead", stacklevel=2)
del warnpy3k
MAGIC = '.snd'
class error(Exception):
pass
def get_long_be(s):
"""Convert a 4-char value to integer."""
r... |
jkarnows/scikit-learn | refs/heads/master | sklearn/decomposition/tests/test_truncated_svd.py | 240 | """Test truncated SVD transformer."""
import numpy as np
import scipy.sparse as sp
from sklearn.decomposition import TruncatedSVD
from sklearn.utils import check_random_state
from sklearn.utils.testing import (assert_array_almost_equal, assert_equal,
assert_raises, assert_greater,
... |
DistrictDataLabs/minimum-entropy | refs/heads/master | users/mixins.py | 1 | # users.mixins
# Authentication Mixins
#
# Author: Benjamin Bengfort <benjamin@bengfort.com>
# Created: Fri May 16 15:40:50 2014 -0400
#
# Copyright (C) 2016 District Data Labs
# For license information, see LICENSE.txt
#
# ID: mixins.py [70aac9d] benjamin@bengfort.com $
"""
Authentication Mixins
"""
#############... |
petrleocompel/gnome15 | refs/heads/master | src/gnome15/util/g15pythonlang.py | 8 | # Gnome15 - Suite of tools for the Logitech G series keyboards and headsets
# Copyright (C) 2010 Brett Smith <tanktarta@blueyonder.co.uk>
# Copyright (C) 2013 Nuno Araujo <nuno.araujo@russo79.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Publi... |
rynomster/django | refs/heads/master | tests/str/tests.py | 58 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from unittest import skipIf
from django.db import models
from django.test import TestCase
from django.test.utils import isolate_apps
from django.utils import six
from .models import Article, InternationalArticle
class SimpleTests(TestC... |
martinbuc/missionplanner | refs/heads/master | Lib/wsgiref/handlers.py | 53 | """Base classes for server/gateway implementations"""
from types import StringType
from util import FileWrapper, guess_scheme, is_hop_by_hop
from headers import Headers
import sys, os, time
__all__ = ['BaseHandler', 'SimpleHandler', 'BaseCGIHandler', 'CGIHandler']
try:
dict
except NameError:
de... |
dsokoler/StockAnalytics | refs/heads/master | Database.py | 1 |
#TODO: finish retrieval in range methods
import sqlite3, sys, configparser
importError = False;
try:
import pandas as pd
except ImportError:
print("Database.py unable to find Pandas module");
importError = True;
try:
import requests
except ImportError:
print("Database.py unable to find Requests module");
impo... |
40223110/2015cd_0505 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/unittest/test/testmock/testmagicmethods.py | 737 | import unittest
import inspect
import sys
from unittest.mock import Mock, MagicMock, _magics
class TestMockingMagicMethods(unittest.TestCase):
def test_deleting_magic_methods(self):
mock = Mock()
self.assertFalse(hasattr(mock, '__getitem__'))
mock.__getitem__ = Mock()
self.asser... |
PepperPD/edx-pepper-platform | refs/heads/master | lms/djangoapps/django_comment_client/forum/urls.py | 1 | from django.conf.urls.defaults import url, patterns
urlpatterns = patterns('django_comment_client.forum.views', # nopep8
url(r'users/(?P<user_id>\w+)/followed$', 'followed_threads', name='followed_threads'),
url(r'users/(?P<user_id>\w+)$', 'user_profile', name='user_profile'),
url(r'^(?P<discussion_id>[\w\... |
nikraina/google-python-exercises | refs/heads/master | basic/string1.py | 1 | #!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Basic string exercises
# Fill in the code for the functions below. main() is already se... |
keyru/hdl-make | refs/heads/develop | hdlmake/tools/isim/isim.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 - 2015 CERN
# Author: Pawel Szostek (pawel.szostek@cern.ch)
# Modified to allow ISim simulation by Lucas Russo (lucas.russo@lnls.br)
# Modified to allow ISim simulation by Adrian Byszuk (adrian.byszuk@lnls.br)
# Multi-tool support by Javier D. Garcia-Lash... |
SujaySKumar/django | refs/heads/master | tests/auth_tests/test_handlers.py | 328 | from __future__ import unicode_literals
from django.contrib.auth.handlers.modwsgi import (
check_password, groups_for_user,
)
from django.contrib.auth.models import Group, User
from django.contrib.auth.tests.custom_user import CustomUser
from django.test import TransactionTestCase, override_settings
# This must ... |
verygreen/ti-omap-encore-kernel | refs/heads/encore-2.6.35 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 802 | # Core.py - Python extension for perf trace, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def auto... |
chundi/uwsgi | refs/heads/master | examples/bootstrap.py | 34 | import sys
import uwsgi
print("i am the bootstrap for uwsgi.SymbolsImporter")
sys.meta_path.insert(0, uwsgi.SymbolsImporter())
|
Jc2k/libcloud | refs/heads/trunk | docs/examples/compute/create_cloudstack_node_keypair_secgroup.py | 64 | from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
ACCESS_ID = 'your access id'
SECRET_KEY = 'your secret key'
HOST = 'hostname or ip address of your management server'
PATH = 'path to the api endpoint, e.g: /client/api'
SIZE_ID = 'id of the computer offering you want to use... |
cchurch/ansible | refs/heads/devel | lib/ansible/modules/cloud/vmware/vmware_dvs_portgroup_facts.py | 2 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.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 = {
'metad... |
trulywireless/pjsip | refs/heads/master | tests/pjsua/scripts-pesq/200_codec_g722.py | 59 | # $Id: 200_codec_g722.py 2063 2008-06-26 18:52:16Z nanang $
#
from inc_cfg import *
ADD_PARAM = ""
if (HAS_SND_DEV == 0):
ADD_PARAM += "--null-audio"
# Call with G722 codec
test_param = TestParam(
"PESQ codec G722",
[
InstanceParam("UA1", ADD_PARAM + " --max-calls=1 --add-codec g722 --clock-rate 16000 --play... |
assad2012/ggplot | refs/heads/master | ggplot/tests/test_geom_linerange.py | 12 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
from . import get_assert_same_ggplot, cleanup
assert_same_ggplot = get_assert_same_ggplot(__file__)
from ggplot import *
import numpy as np
import pandas as pd
def _build_testing_df():
rst = np.random.R... |
hugs/django | refs/heads/master | django/contrib/gis/gdal/libgdal.py | 3 | import os, sys
from ctypes import c_char_p, CDLL
from ctypes.util import find_library
from django.contrib.gis.gdal.error import OGRException
# Custom library path set?
try:
from django.conf import settings
lib_path = settings.GDAL_LIBRARY_PATH
except (AttributeError, EnvironmentError, ImportError):
lib_pat... |
jendap/tensorflow | refs/heads/master | tensorflow/contrib/gan/python/eval/python/classifier_metrics_impl.py | 3 | # 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 required by applica... |
mrrrgn/olympia | refs/heads/master | apps/search/utils.py | 21 | import re
from versions.compare import version_re
def floor_version(s):
result = s
if result:
s = s.replace('.x', '.0').replace('.*', '.0').replace('*', '.0')
match = re.match(version_re, s)
if match:
major, minor = match.groups()[:2]
major, minor = int(major),... |
ofer43211/unisubs | refs/heads/staging | apps/teams/migrations/0006_auto__add_field_teamvideo_all_languages__chg_field_teamvideo_thumbnail.py | 5 | # encoding: 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 field 'TeamVideo.all_languages'
db.add_column('teams_teamvideo', 'all_languages', self.gf('dj... |
mattclark/osf.io | refs/heads/develop | addons/mendeley/tests/test_models.py | 16 | # -*- coding: utf-8 -*-
import mock
import pytest
import unittest
from mendeley.exception import MendeleyApiException
from addons.base.tests.models import (
CitationAddonProviderTestSuiteMixin,
OAuthAddonUserSettingTestSuiteMixin,
OAuthCitationsNodeSettingsTestSuiteMixin,
)
from addons.base.tests.utils im... |
errordeveloper/ecs-delivery | refs/heads/master | app-code/hit-counter-app/app.py | 1 | from flask import Flask
from redis import Redis
import os
app = Flask(__name__)
redis = Redis(host='redis', port=6379)
@app.route('/')
def hello():
redis.incr('hits')
return 'Hello World! I have been accessed %i times.\n' % int(redis.get('hits'))
if __name__ == "__main__":
app.run(host="0.0.0.0", port=50... |
roxyboy/nbviewer | refs/heads/master | nbviewer/handlers.py | 3 | #-----------------------------------------------------------------------------
# Copyright (C) 2013 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#-----------------------------------------------------... |
docker-flink/official-images | refs/heads/master | test/tests/python-pip-requests-ssl/container.py | 12 | import subprocess, sys
subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'requests'])
import requests
r = requests.get('https://google.com')
assert(r.status_code == 200)
|
JohnCEarls/AUREA | refs/heads/master | src/AUREA/learner/__init__.py | 4 | """
Copyright (C) 2011 N.D. Price Lab
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 License, or
(at your option) any later version.
This program is distributed in th... |
SerenityS/android_kernel_samsung_a8elte | refs/heads/cm-12.1 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py | 4653 | # EventClass.py
#
# This is a library defining some events types classes, which could
# be used by other scripts to analyzing the perf samples.
#
# Currently there are just a few classes defined for examples,
# PerfEvent is the base class for all perf event sample, PebsEvent
# is a HW base Intel x86 PEBS event, and use... |
IllusionRom-deprecated/android_platform_tools_idea | refs/heads/master | python/lib/Lib/htmlentitydefs.py | 390 | """HTML character entity references."""
# maps the HTML entity name to the Unicode codepoint
name2codepoint = {
'AElig': 0x00c6, # latin capital letter AE = latin capital ligature AE, U+00C6 ISOlat1
'Aacute': 0x00c1, # latin capital letter A with acute, U+00C1 ISOlat1
'Acirc': 0x00c2, # latin capit... |
antoviaque/edx-platform | refs/heads/master | lms/djangoapps/mobile_api/users/urls.py | 45 | """
URLs for user API
"""
from django.conf.urls import patterns, url
from django.conf import settings
from .views import UserDetail, UserCourseEnrollmentsList, UserCourseStatus
urlpatterns = patterns(
'mobile_api.users.views',
url('^' + settings.USERNAME_PATTERN + '$', UserDetail.as_view(), name='user-detail... |
alexis-via/xivo-provd-plugins | refs/heads/master | plugins/xivo-cisco-spa/pap2t-5.1.6/entry.py | 4 | # -*- coding: utf-8 -*-
# Copyright (C) 2014 Avencall
#
# 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 progra... |
visualputty/Landing-Lights | refs/heads/master | django/contrib/gis/admin/__init__.py | 637 | # Getting the normal admin routines, classes, and `site` instance.
from django.contrib.admin import autodiscover, site, AdminSite, ModelAdmin, StackedInline, TabularInline, HORIZONTAL, VERTICAL
# Geographic admin options classes and widgets.
from django.contrib.gis.admin.options import GeoModelAdmin
from django.contri... |
hortonworks/hortonworks-sandbox | refs/heads/master | desktop/core/ext-py/ctypes-1.0.2/ctypes/test/test_macholib.py | 15 | import os
import sys
import unittest
# Bob Ippolito:
"""
Ok.. the code to find the filename for __getattr__ should look
something like:
import os
from macholib.dyld import dyld_find
def find_lib(name):
possible = ['lib'+name+'.dylib', name+'.dylib',
name+'.framework/'+name]
for dylib in possible:
... |
pypa/pip | refs/heads/main | tests/lib/certs.py | 4 | from datetime import datetime, timedelta
from typing import Tuple
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes, serialization
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.x509.oid import NameOID
... |
eriol/circuits | refs/heads/master | circuits/net/__init__.py | 5 | """Networking Components
This package contains components that implement network sockets and
protocols for implementing client and server network applications.
"""
|
keysona/python | refs/heads/master | Jimmy66/0002/0002.py | 34 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import mysql.connector
#从文件中读取信息
def file_read(filename):
with open(filename,'r') as f:
lines = f.readlines()
for n in range(0,200):
lines[n] = lines[n].strip()
return lines
#存入数据库
def mysql_write():
lines = file_read('result.txt')
conn = mysql.connector.connec... |
av8ramit/tensorflow | refs/heads/master | tensorflow/tools/test/system_info.py | 170 | # 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... |
yumingfei/virt-manager | refs/heads/master | virtconv/diskcfg.py | 4 | #
# Copyright 2013 Red Hat, Inc.
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# 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 versio... |
dsirius/CloudBot | refs/heads/BBM-Bot | cloudbot/util/http.py | 30 | # convenience wrapper for urllib2 & friends
import http.cookiejar
import json
import urllib.request
import urllib.parse
import urllib.error
import urllib.request
import urllib.error
import urllib.parse
import urllib.parse
# noinspection PyUnresolvedReferences
from urllib.parse import quote, quote_plus as _quote_plus
... |
ville-k/tensorflow | refs/heads/master | tensorflow/contrib/keras/python/keras/utils/__init__.py | 39 | # 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... |
montoyjh/pymatgen | refs/heads/master | pymatgen/alchemy/materials.py | 3 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import os
import re
import json
import datetime
from copy import deepcopy
from monty.json import MontyDecoder, jsanitize
from pymatgen.core.structure import Structure
from pymatgen.io.cif import CifParser
fr... |
keichan100yen/ode-ext | refs/heads/master | boost/libs/python/test/docstring.py | 20 | # Copyright David Abrahams & Ralf W. Grosse-Kunsteve 2004-2006.
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
'''
>>> from docstring_ext import *
>>> def selected_doc(obj, *args):
... doc = obj.__doc__.splitlines... |
cmbiwer/pycbc | refs/heads/master | pycbc/inference/sampler/base_multitemper.py | 6 | # Copyright (C) 2018 Collin Capano
# 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 t... |
onejob6800/minibm | refs/heads/master | bitmessage/helper_sql.py | 15 | import threading
import Queue
sqlSubmitQueue = Queue.Queue() #SQLITE3 is so thread-unsafe that they won't even let you call it from different threads using your own locks. SQL objects can only be called from one thread.
sqlReturnQueue = Queue.Queue()
sqlLock = threading.Lock()
def sqlQuery(sqlStatement, *args):
s... |
cin/spark | refs/heads/master | python/pyspark/mllib/__init__.py | 123 | #
# 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... |
damoguyan8844/fabric-bolt | refs/heads/master | fabric_bolt/core/themes.py | 10 | PLAIN = 'bootstrap.min.css'
CERULEAN = 'cerulean.min.css'
COSMO = 'cosmo.min.css'
CYBORG = 'cyborg.min.css'
DARKLY = 'darkly.min.css'
FLATLY = 'flatly.min.css'
JOURNAL = 'journal.min.css'
LUMEN = 'lumen.min.css'
PAPER = 'paper.min.css'
READABLE = 'readable.min.css'
SANDSTONE = 'sandstone.min.css'
SIMPLEX = 'simplex.min... |
kronenpj/python-for-android | refs/heads/master | pythonforandroid/recipes/msgpack-python/__init__.py | 5 | from pythonforandroid.recipe import CythonRecipe
class MsgPackRecipe(CythonRecipe):
version = '0.4.7'
url = 'https://pypi.python.org/packages/source/m/msgpack-python/msgpack-python-{version}.tar.gz'
depends = ["setuptools"]
call_hostpython_via_targetpython = False
recipe = MsgPackRecipe()
|
mathspace/django | refs/heads/master | django/db/backends/mysql/operations.py | 49 | from __future__ import unicode_literals
import uuid
from django.conf import settings
from django.db.backends.base.operations import BaseDatabaseOperations
from django.utils import six, timezone
from django.utils.encoding import force_text
class DatabaseOperations(BaseDatabaseOperations):
compiler_module = "djan... |
keedio/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/tests/middleware_exceptions/tests.py | 63 | import sys
from django.conf import settings
from django.core.signals import got_request_exception
from django.http import HttpResponse
from django.template.response import TemplateResponse
from django.template import Template
from django.test import TestCase
class TestException(Exception):
pass
# A middleware ba... |
jriehl/numba | refs/heads/master | numba/pycc/compiler.py | 1 | # -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import
import logging
import os
import sys
from llvmlite import ir
from llvmlite.binding import Linkage
import llvmlite.llvmpy.core as lc
from numba import cgutils
from numba.utils import IS_PY3
from . import llvm_types as lt
from numb... |
mdaniel/intellij-community | refs/heads/master | python/helpers/tests/generator3_tests/data/SkeletonGeneration/cache_skeleton_reused_when_sdk_skeleton_is_outdated/after/sdk_skeletons/mod.py | 120 | # encoding: utf-8
# module mod
# from mod.py
# by generator 0.2
# no doc
# no imports
# no functions
# no classes
|
SPxiaomin/NodeJs_Practice | refs/heads/master | Express4_3/nodejs-demo/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/styles/native.py | 135 | # -*- coding: utf-8 -*-
"""
pygments.styles.native
~~~~~~~~~~~~~~~~~~~~~~
pygments version of my "native" vim theme.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, ... |
KirtoXX/Security_Camera | refs/heads/master | ssd_mobilenet/object_detection/builders/image_resizer_builder_test.py | 21 | # 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 required by applica... |
bokzor/guimovie | refs/heads/master | node_modules/nw-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py | 899 | # 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.
import collections
import os
import gyp
import gyp.common
import gyp.msvs_emulation
import json
import sys
generator_supports_multiple_toolsets = True
generator_... |
hgl888/chromium-crosswalk | refs/heads/master | tools/win/split_link/check_installed.py | 146 | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
def IsAvailable():
_winreg = None
if sys.platform == 'win32':
import _winreg
elif sys.platform == 'cygwin':
try:
... |
Shiroy/servo | refs/heads/master | tests/wpt/web-platform-tests/old-tests/webdriver/element_state/selected_test.py | 141 | import os
import sys
import unittest
sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
import base_test
class GetElementSelectedTest(base_test.WebDriverBaseTest):
def test_selected_1(self):
self.driver.get(self.webserver.where_is("element_state/res/element-selected.html"))
elem... |
aurelijusb/arangodb | refs/heads/devel | 3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_print.py | 51 | """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
import sys
if sys.version_info[0] == 3:
# 3.x
from io impor... |
jagguli/intellij-community | refs/heads/master | python/testData/refactoring/extractsuperclass/importNotBrokenManyFiles/source_module.after.py | 320 | from dest_module import NewParent
class MyClass(NewParent):
pass |
xvillaneau/YAFC | refs/heads/master | setup.py | 1 |
import setuptools
setuptools.setup(
name="YAFC",
version="0.1",
description="Basic (an somewhat restricted) calculator for Factorio",
author="Xavier Villaneau",
author_email="xvillaneau@gmail.com",
license="MIT",
packages=["yafc"],
install_requires=['pyYAML'],
setup_requires=['pyte... |
IronLanguages/ironpython3 | refs/heads/master | Tests/test_python26.py | 1 | # Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information.
import io
import os
import sys
import unittest
from iptest import is_cli, long, run_test, skipUnlessIronPython
... |
GISeHealth/qgis-versioning | refs/heads/master | test/posgres_working_copy_test.py | 3 | #!/usr/bin/python
import versioning_base
import psycopg2
import os
import shutil
def prtTab( cur, tab ):
print "--- ",tab," ---"
pcur.execute("SELECT pid, trunk_rev_begin, trunk_rev_end, trunk_parent, trunk_child, length FROM "+tab)
for r in pcur.fetchall():
t = []
for i in r: t.append(str(... |
moble/sympy | refs/heads/master | sympy/utilities/codegen.py | 30 | """
module for generating C, C++, Fortran77, Fortran90 and Octave/Matlab routines
that evaluate sympy expressions. This module is work in progress. Only the
milestones with a '+' character in the list below have been completed.
--- How is sympy.utilities.codegen different from sympy.printing.ccode? ---
We considere... |
lebrush/RIOT | refs/heads/master | dist/tools/pyterm/testbeds/__init__.py | 138 | __all__ = ["testbeds"]
|
OTAkeys/RIOT | refs/heads/master | dist/tools/dhcpv6-pd_ia/pkg/pacman.py | 14 | # -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright (C) 2020 Freie Universität Berlin
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
import subprocess
from .base import Installer
__author__ =... |
dherault/Coursera_algorithms | refs/heads/master | homework/prim_MST.py | 1 | #!/usr/bin/python3.5
def pick_cost(edge):
return edge[2]
def prim_MST():
# input_file_name = 'prim_MST_test_result_is_7.txt'
input_file_name = 'prim_MST_input.txt'
T = []
E = []
V = set()
with open(input_file_name) as f:
for line in f:
edge = [int(x) for x in line.rstrip().split(' ')]
... |
SickGear/SickGear | refs/heads/master | sickbeard/traktChecker.py | 2 | # Author: Frank Fenton
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickGear.
#
# SickGear 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 ... |
XiaosongWei/blink-crosswalk | refs/heads/master | LayoutTests/http/tests/websocket/reserved-bits_wsh.py | 45 | import re
from mod_pywebsocket import common
from mod_pywebsocket import stream
from mod_pywebsocket.extensions import DeflateFrameExtensionProcessor
bit = 0
def _get_deflate_frame_extension_processor(request):
for extension_processor in request.ws_extension_processors:
if isinstance(extension_processor,... |
SmBe19/RedditBots | refs/heads/master | EvoCreoBot/EvoCreoBot.py | 1 | # -*- coding: utf-8 -*-
"""
A bot that posts a link to a wiki (for /r/evocreo)
Written by /u/SmBe19
"""
import praw
import re
import time
import OAuth2Util
# ### USER CONFIGURATION ### #
# The bot's useragent. It should contain a short description of what it does and your username. e.g. "RSS Bot by /u/SmBe19"
USERA... |
edfungus/Crouton-Python-Example | refs/heads/master | env/lib/python2.7/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 ... |
BirkbeckCTP/janeway | refs/heads/master | src/install/apps.py | 1 | __copyright__ = "Copyright 2017 Birkbeck, University of London"
__author__ = "Martin Paul Eve & Andy Byers"
__license__ = "AGPL v3"
__maintainer__ = "Birkbeck Centre for Technology and Publishing"
from django.apps import AppConfig
class InstallConfig(AppConfig):
name = 'install'
|
dvliman/jaikuengine | refs/heads/master | .google_appengine/google/appengine/api/search/stub/document_matcher.py | 2 | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
RaoUmer/django | refs/heads/master | tests/modeltests/m2m_signals/tests.py | 150 | """
Testing signals emitted on changing m2m relations.
"""
from .models import Person
from django.db import models
from django.test import TestCase
from .models import Part, Car, SportsCar, Person
class ManyToManySignalsTest(TestCase):
def m2m_changed_signal_receiver(self, signal, sender, **kwargs):
me... |
Srisai85/scikit-learn | refs/heads/master | sklearn/covariance/tests/test_graph_lasso.py | 272 | """ Test the graph_lasso module.
"""
import sys
import numpy as np
from scipy import linalg
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_array_less
from sklearn.covariance import (graph_lasso, GraphLasso, GraphLassoCV,
empirical_... |
Clinical-Genomics/taboo | refs/heads/master | genotype/__main__.py | 1 | """
genotype.__main__
~~~~~~~~~~~~~~~~~~~~~
__
____ ____ ____ _____/ |_ ___.__.______ ____
/ ___\_/ __ \ / \ / _ \ __< | |\____ \_/ __ \
/ /_/ > ___/| | ( <_> ) | \___ || |_> > ___/
\___ / \___ >___| /\____/|__| / ____|| __/ \___ >
/_____/ \/ ... |
forkbong/qutebrowser | refs/heads/master | qutebrowser/api/config.py | 1 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2018-2021 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... |
mbillingr/SCoT | refs/heads/master | scot/tests/test_varica.py | 4 | # Released under The MIT License (MIT)
# http://opensource.org/licenses/MIT
# Copyright (c) 2013-2015 SCoT Development Team
import unittest
from importlib import import_module
import numpy as np
from numpy.testing import assert_allclose
import scot
from scot import varica, datatools
from scot.var import VAR
class ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.