repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
guozhongxin/shadowsocks | refs/heads/master | tests/graceful_cli.py | 977 | #!/usr/bin/python
import socks
import time
SERVER_IP = '127.0.0.1'
SERVER_PORT = 8001
if __name__ == '__main__':
s = socks.socksocket()
s.set_proxy(socks.SOCKS5, SERVER_IP, 1081)
s.connect((SERVER_IP, SERVER_PORT))
s.send(b'test')
time.sleep(30)
s.close()
|
ferriman/SSandSP | refs/heads/master | pyxel-test/venv/lib/python3.8/site-packages/pip/_vendor/toml/tz.py | 18 | from datetime import tzinfo, timedelta
class TomlTz(tzinfo):
def __init__(self, toml_offset):
if toml_offset == "Z":
self._raw_offset = "+00:00"
else:
self._raw_offset = toml_offset
self._sign = -1 if self._raw_offset[0] == '-' else 1
self._hours = int(self.... |
ant9000/RIOT | refs/heads/master | tests/pkg_micro-ecc/tests/01-run.py | 21 | #!/usr/bin/env python3
import sys
from testrunner import run
# Use a custom global timeout for slow hardware. On ATmegas clocked at 8MHz
# one test round completes in ~36s
TIMEOUT = 100
def testfunc(child):
child.expect_exact('micro-ecc compiled!')
child.expect(r'Testing (\d+) random private key pairs and ... |
pizzathief/numpy | refs/heads/master | numpy/f2py/cfuncs.py | 3 | #!/usr/bin/env python
"""
C declarations, CPP macros, and C functions for f2py2e.
Only required declarations/macros/functions will be used.
Copyright 1999,2000 Pearu Peterson all rights reserved,
Pearu Peterson <[email protected]>
Permission to use, modify, and distribute this software is given under the
terms of the NumP... |
agiliq/django | refs/heads/master | django/conf/locale/da/formats.py | 315 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i'
DATET... |
dednal/chromium.src | refs/heads/nw12 | build/android/gyp/java_cpp_enum.py | 9 | #!/usr/bin/env python
#
# 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 collections
import re
import optparse
import os
from string import Template
import sys
from util import build_utils
# List o... |
msramalho/pyhparser | refs/heads/master | pyhparser/__init__.py | 1 | import sys
sys.path.append('../')
from pyhparser.pyhparser import *
from pyhparser.grammar import *
from pyhparser.utils import *
from pyhparser.classParser import * |
lilclmrboy/workoutprogram | refs/heads/master | generate_climbing_workout.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Python rewrite of:
# https://code.google.com/p/weightliftingworkout/source/browse/#svn%2Ftrunk%253Fstate%253Dclosed
import sys
import workout
from workout import ExerciseDetail
from workout import Exercise
from workout import Workout
from workout import WorkoutProgram
from... |
morepath/morepath-cookiecutter | refs/heads/master | {{cookiecutter.package_name}}/{{cookiecutter.package_name}}/view.py | 1 | from .app import App
from . import model
{%- if 'REST' in cookiecutter.goal %}
@App.json(model=model.Root)
def view_root(self, request):
return {
'greetings': [
{
'name': greeting.person,
'@id': request.link(greeting)
}
for greeting in ... |
uezo/minette-python | refs/heads/master | minette/scheduler/base.py | 1 | """ Scheduler for periodic tasks """
import traceback
from logging import getLogger
import schedule
import time
from concurrent.futures import ThreadPoolExecutor
class Task:
"""
Base class of tasks
Attributes
----------
config : minette.Config
Configuration
timezone : pytz.timezone
... |
huxianglin/pythonstudy | refs/heads/master | week05-胡湘林/ATM/shop/shop_conf/settings.py | 1 | #!/usr/bin/env python
# encoding:utf-8
# __author__: huxianglin
# date: 2016-09-18
# blog: http://huxianglin.cnblogs.com/ http://xianglinhu.blog.51cto.com/
import os
import logging
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
USER_DATABASE = {
"name":"users",
"path": os.path.join(os... |
Microsoft/PTVS | refs/heads/master | Python/Product/Pyvot/Pyvot/doc/src/conf.py | 7 | # -*- coding: utf-8 -*-
#
# Pyvot documentation build configuration file, created by
# sphinx-quickstart on Thu Sep 29 14:15:10 2011.
#
# 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
# autogenerated file.
#
# All c... |
velikodniy/aiotelegram | refs/heads/master | test/test_types.py | 1 | import unittest
from aiotelegram.types import *
class UserTest(unittest.TestCase):
def test_fromJson_all_fields(self):
user = User.fromJson('{"id": 1, "first_name": "John", "last_name": "Doe", "username": "@johndoe"}')
self.assertEqual(user.id, 1)
self.assertEqual(user.first_name, "John")
... |
rikirenz/inspire-next | refs/heads/master | inspirehep/factory.py | 3 | # -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014-2017 CERN.
#
# INSPIRE 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 ... |
ClearCorp-dev/account-financial-reporting | refs/heads/8.0 | account_financial_report_horizontal/__openerp__.py | 8 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2012 Therp BV (<http://therp.nl>),
# Copyright (C) 2013 Agile Business Group sagl
# (<http://www.agilebg.com>) (<lorenzo.battistini@... |
xbmcmegapack/plugin.video.megapack.dev | refs/heads/master | resources/lib/menus/home_countries_new_caledonia.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This file is part of XBMC Mega Pack Addon.
Copyright (C) 2014 Wolverine ([email protected])
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 Softwar... |
lino-framework/extjs6 | refs/heads/master | tests/__init__.py | 2 | from lino.utils.pythontest import TestCase
from lino_extjs6 import SETUP_INFO
class PackagesTests(TestCase):
def test_01(self):
self.run_packages_test(SETUP_INFO['packages'])
class ProjectsTests(TestCase):
def test_team(self):
self.run_django_manage_test("lino_extjs6/projects/team6")
... |
ClaireAuffredou/pipe2py | refs/heads/master | tests/pypipelines/pipe_e65397e116d7754da0dd23425f1f0af1.py | 6 | # Pipe pipe_e65397e116d7754da0dd23425f1f0af1 generated by pipe2py
from pipe2py import Context
from pipe2py.modules.pipeforever import pipe_forever
from pipe2py.modules.pipeurlbuilder import pipe_urlbuilder
from pipe2py.modules.pipefetch import pipe_fetch
from pipe2py.modules.pipeloop import pipe_loop
from pipe2py.modu... |
joeythesaint/yocto-autobuilder | refs/heads/master | lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/internet/_win32stdio.py | 96 | # -*- test-case-name: twisted.test.test_stdio -*-
"""
Windows-specific implementation of the L{twisted.internet.stdio} interface.
"""
import win32api
import os, msvcrt
from zope.interface import implements
from twisted.internet.interfaces import IHalfCloseableProtocol, ITransport, IAddress
from twisted.internet.int... |
rempferg/espresso | refs/heads/master | testsuite/python/tabulated.py | 4 | #
# Copyright (C) 2013,2014,2015,2016 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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)... |
achauvinhameau/netProbe | refs/heads/master | py-net-probe/config/config.py | 1 | # -*- Mode: Python; python-indent-offset: 4 -*-
#
# Time-stamp: <2017-05-14 18:09:06 alex>
#
#
# --------------------------------------------------------------------
# PiProbe
# Copyright (C) 2016-2017 Alexandre Chauvin Hameau <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# ... |
listamilton/supermilton.repository | refs/heads/supermilton.repository | script.areswizard/requests/packages/chardet/jpcntx.py | 1776 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... |
Microsoft/PTVS | refs/heads/master | Python/Tests/TestData/Grammar/AllErrors.py | 7 | from __future__ import *
from __future__ import braces
from __future__ import unknown
def f(a, x=42, c):
pass
f(a, x=42, c)
f(a, *b, *c)
f(a, **b, **c)
f(a, **abc, x = 42)
@fob
pass
def f(a, (42, c), d):
pass
def f(a, 42, abc):
pass
break
continue
print >> blah,
while True:
try:
pass
... |
friendofrobots/air-toolkit | refs/heads/master | air/air_explorer/views.py | 1 | from django.shortcuts import render_to_response
from django.http import HttpResponse, HttpResponseRedirect
from django.template import RequestContext
from django.db.models import Count, Q
from django.core.paginator import Paginator, InvalidPage, EmptyPage
from django.shortcuts import get_object_or_404, redirect
import ... |
clayz/crazy-quiz-web | refs/heads/master | lib/requests/requests/packages/urllib3/fields.py | 1007 | import email.utils
import mimetypes
from .packages import six
def guess_content_type(filename, default='application/octet-stream'):
"""
Guess the "Content-Type" of a file.
:param filename:
The filename to guess the "Content-Type" of using :mod:`mimetypes`.
:param default:
If no "Cont... |
opencloudinfra/orchestrator | refs/heads/master | venv/Lib/encodings/unicode_escape.py | 852 | """ Python 'unicode-escape' Codec
Written by Marc-Andre Lemburg ([email protected]).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
class Codec(codecs.Codec):
# Note: Binding these as C functions will result in the class not
# converting them to methods. This is inte... |
AOKP/external_chromium_org | refs/heads/kitkat | tools/win/split_link/graph_dependencies.py | 145 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import shutil
import subprocess
import sys
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
def main():
if len(sys.argv) != 2:
print... |
sassoftware/rbuild | refs/heads/master | rbuild_test/unit_test/productstoretest/dirstoretest.py | 1 | #!/usr/bin/python
#
# Copyright (c) SAS Institute 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... |
bpsinc-native/src_tools_gyp | refs/heads/master | test/win/gyptest-cl-pdbname.py | 239 | #!/usr/bin/env python
# Copyright (c) 2013 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.
"""
Make sure pdb is named as expected (shared between .cc files).
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = Tes... |
brianlions/python-nebula | refs/heads/master | nebula/log.py | 1 | #!/usr/bin/env python3
#
# Copyright (c) 2012 Brian Yi ZHANG <brianlions at gmail dot com>
#
# This file is part of pynebula.
#
# pynebula 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 th... |
retooth/morse | refs/heads/master | morse/slots/search.py | 1 | #!/usr/bin/python
# This file is part of Morse.
#
# Morse 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.
#
# Morse ... |
anditto/bitcoin | refs/heads/master | test/functional/wallet_labels.py | 5 | #!/usr/bin/env python3
# Copyright (c) 2016-2020 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 label RPCs.
RPCs tested are:
- getaddressesbylabel
- listaddressgroupings
- setlabel
... |
jasonbot/django | refs/heads/master | tests/migrations/test_migrations_squashed_complex/7_auto.py | 770 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("migrations", "6_auto")]
operations = [
migrations.RunPython(migrations.RunPython.noop)
]
|
guewen/OpenUpgrade | refs/heads/master | addons/product_expiry/__openerp__.py | 61 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... |
refuge-attic/bigcouch | refs/heads/master | couchjs/scons/scons-local-2.0.1/SCons/Tool/MSCommon/vc.py | 53 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without li... |
asen6/amartyasenguptadotcom | refs/heads/master | django/contrib/gis/geos/io.py | 623 | """
Module that holds classes for performing I/O operations on GEOS geometry
objects. Specifically, this has Python implementations of WKB/WKT
reader and writer classes.
"""
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.contrib.gis.geos.prototypes.io import _WKTReader, _WKBReader, WKBWriter, WK... |
csrg-utfsm/acscb | refs/heads/master | LGPL/CommonSoftware/acspy/test/test_Acspy_Nc_CDBProperties.py | 4 | #! /usr/bin/env python
#******************************************************************************
# ALMA - Atacama Large Millimiter Array
# (c) Associated Universities Inc., 2010
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# Licen... |
lfairchild/PmagPy | refs/heads/master | programs/pt_rot.py | 2 | #!/usr/bin/env python
# define some variables
from __future__ import print_function
import sys
import matplotlib
if matplotlib.get_backend() != "TKAgg":
matplotlib.use("TKAgg")
import pmagpy.pmag as pmag
import pmagpy.frp as frp
def main():
"""
NAME
pt_rot.py
DESCRIPTION
rotates pt ac... |
etataurov/pytest | refs/heads/master | testing/test_junitxml.py | 4 | # -*- coding: utf-8 -*-
from xml.dom import minidom
import py
import sys
import os
from _pytest.junitxml import LogXML
import pytest
def runandparse(testdir, *args):
resultpath = testdir.tmpdir.join("junit.xml")
result = testdir.runpytest("--junitxml=%s" % resultpath, *args)
xmldoc = minidom.parse(str(re... |
Justin-Yuan/Image2Music-Generator | refs/heads/master | library/jython2.5.3/Lib/encodings/iso8859_5.py | 593 | """ Python Character Mapping Codec iso8859_5 generated from 'MAPPINGS/ISO8859/8859-5.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors='... |
adaur/SickRage | refs/heads/master | tests/sickrage_tests/providers/nzb_provider_tests.py | 4 | # coding=utf-8
# This file is part of SickRage.
#
# URL: https://SickRage.GitHub.io
# Git: https://github.com/SickRage/SickRage.git
#
# SickRage is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3... |
YathishReddy/Robust_ECN_Signalling_With_Nonces | refs/heads/master | src/tap-bridge/examples/tap-csma-virtual-machine.py | 46 | # -*- Mode: Python; -*-
#
# Copyright 2010 University of Washington
#
# 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;
#
# This program is distributed in the hope that it will be usefu... |
doduytrung/odoo-8.0 | refs/heads/master | openerp/addons/test_access_rights/models.py | 299 | from openerp import fields, models
class SomeObj(models.Model):
_name = 'test_access_right.some_obj'
val = fields.Integer()
|
msebire/intellij-community | refs/heads/master | python/testData/refactoring/makeFunctionTopLevel/recursiveMethod.after.py | 44 | class C:
def __init__(self, foo):
self.foo = foo
def method(foo1, foo):
method(foo1, foo1)
method(C(1).foo, 2)
|
xzYue/odoo | refs/heads/8.0 | openerp/service/model.py | 62 | # -*- coding: utf-8 -*-
from functools import wraps
import logging
from psycopg2 import IntegrityError, OperationalError, errorcodes
import random
import threading
import time
import openerp
from openerp.tools.translate import translate
from openerp.osv.orm import except_orm
from contextlib import contextmanager
imp... |
manti-by/Telonius | refs/heads/master | app/bearing/migrations/0025_bearingiso_value.py | 2 | import logging
from django.db import migrations, models
logger = logging.getLogger()
def update_value(apps, schema_editor):
BearingISO = apps.get_model('bearing', 'BearingISO')
for item in BearingISO.objects.all():
try:
item.value = item.name
item.save()
except Excep... |
nozuono/calibre-webserver | refs/heads/master | src/calibre/gui2/store/config/search/search_widget.py | 9 | # -*- coding: utf-8 -*-
from __future__ import (unicode_literals, division, absolute_import, print_function)
__license__ = 'GPL 3'
__copyright__ = '2011, John Schember <[email protected]>'
__docformat__ = 'restructuredtext en'
from PyQt4.Qt import QWidget
from calibre.gui2 import JSONConfig
from calibre.gui2.sto... |
TuSimple/mxnet | refs/heads/master | example/rcnn/test.py | 41 | # 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... |
LUTAN/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... |
ostree/plaso | refs/heads/master | tests/filters/test_lib.py | 2 | # -*- coding: utf-8 -*-
import unittest
from plaso.filters import interface
class TestEventFilter(interface.FilterObject):
"""Class to define a filter for a test event."""
def CompileFilter(self, unused_filter_expression):
"""Compiles the filter expression.
Args:
filter_expression: string that co... |
AlexPereverzyev/spidy | refs/heads/master | spidy/language/log_node.py | 1 |
''' 'log' statement parsing and evaluation. '''
import syntax
import exp_parser
from spidy.common import *
from nodes import Node
class LogNode(Node):
'''
Logs string to file or *stdout*, ignores empty strings.
Example::
log 'loading next page'
.. note:: The statement log... |
marclaporte/clearskies_core | refs/heads/master | tools/gyp/test/intermediate_dir/gyptest-intermediate-dir.py | 243 | #!/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 that targets have independent INTERMEDIATE_DIRs.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('test.gyp', chdir=... |
square/pants | refs/heads/master | src/python/pants/backend/jvm/tasks/jvm_tool_task_mixin.py | 2 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
from pants.backend.j... |
ntymtsiv/CloudFerry | refs/heads/master | cloudferrylib/os/actions/convert_image_to_file.py | 5 | from fabric.api import run, settings, env
from cloudferrylib.base.action import action
from cloudferrylib.utils import forward_agent
class ConvertImageToFile(action.Action):
def run(self, image_id=None, base_filename=None, **kwargs):
cfg = self.cloud.cloud_config.cloud
with settings(host_string=c... |
gopal1cloud/neutron | refs/heads/master | neutron/plugins/vmware/dhcpmeta_modes.py | 5 | # Copyright 2013 VMware, 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... |
ds-hwang/chromium-crosswalk | refs/heads/master | third_party/closure_linter/closure_linter/not_strict_test.py | 129 | #!/usr/bin/env python
#
# Copyright 2011 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
#... |
tboyce021/home-assistant | refs/heads/dev | homeassistant/components/vera/climate.py | 7 | """Support for Vera thermostats."""
from typing import Any, Callable, List, Optional
import pyvera as veraApi
from homeassistant.components.climate import (
DOMAIN as PLATFORM_DOMAIN,
ENTITY_ID_FORMAT,
ClimateEntity,
)
from homeassistant.components.climate.const import (
FAN_AUTO,
FAN_ON,
HVAC... |
doismellburning/edx-platform | refs/heads/master | openedx/core/djangoapps/content/__init__.py | 118 | """
Setup the signals on startup.
"""
import openedx.core.djangoapps.content.course_structures.signals
|
facebook/fbthrift | refs/heads/master | thrift/lib/py/server/__init__.py | 1 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# 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 ... |
ahamilton55/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/ec2_asg_facts.py | 44 | #!/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 distributed... |
bottompawn/kbengine | refs/heads/master | kbe/src/lib/python/Lib/curses/has_key.py | 195 |
#
# Emulation of has_key() function for platforms that don't use ncurses
#
import _curses
# Table mapping curses keys to the terminfo capability name
_capability_names = {
_curses.KEY_A1: 'ka1',
_curses.KEY_A3: 'ka3',
_curses.KEY_B2: 'kb2',
_curses.KEY_BACKSPACE: 'kbs',
_curses.KEY_BEG: 'kbeg',
... |
etkirsch/legends-of-erukar | refs/heads/master | erukar/system/engine/overland/Sector.py | 1 | from erukar.system.engine import EnvironmentProfile, ErukarObject
from .Location import Location
import operator, re
class Sector(ErukarObject):
def __init__(self, region, economic_seed_fn=None):
self.coordinates = ""
self.environment_profile = EnvironmentProfile()
self.region = region
... |
GregMilway/Exercism | refs/heads/master | python/binary/binary_test.py | 4 | """Tests for the binary exercise
Implementation note:
If the argument to parse_binary isn't a valid binary number the
function should raise a ValueError with a meaningful error message.
"""
import unittest
from binary import parse_binary
class BinaryTests(unittest.TestCase):
def test_binary_1_is_decimal_1(self... |
aipescience/django-daiquiri | refs/heads/master | daiquiri/stats/migrations/0003_data_migration.py | 1 | from __future__ import unicode_literals
from django.db import migrations
def run_data_migration(apps, schema_editor):
QueryJob = apps.get_model('daiquiri_query', 'QueryJob')
Record = apps.get_model('daiquiri_stats', 'Record')
for record in Record.objects.all():
if record.resource_type == 'QUERY_... |
julien78910/CouchPotatoServer | refs/heads/develop | libs/requests/packages/charade/langhebrewmodel.py | 2762 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Simon Montagu
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved... |
zackmore/shadowsocks | refs/heads/master | utils/autoban.py | 1033 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 clowwindy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to u... |
bqbn/addons-server | refs/heads/master | src/olympia/discovery/tests/test_models.py | 1 | from unittest import mock
from django.http import QueryDict
from django.test.utils import override_settings
from olympia import amo
from olympia.amo.tests import addon_factory, TestCase, user_factory
from olympia.discovery.models import DiscoveryItem
class TestDiscoveryItem(TestCase):
def test_heading_multiple_... |
agvergara/Python | refs/heads/master | X-Serv-18.2-Practica2/project/manage.py | 404 | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
lucernae/inasafe | refs/heads/develop | safe/gui/tools/wizard/wizard_strings.py | 8 | # coding=utf-8
"""Wizard Strings."""
from safe.utilities.i18n import tr
__copyright__ = "Copyright 2016, The InaSAFE Project"
__license__ = "GPL version 3"
__email__ = "[email protected]"
__revision__ = '$Format:%H$'
category_question = tr(
'By following the simple steps in this wizard, you can assign '
'keyw... |
syncloud/platform | refs/heads/master | src/test/disks/test_disk.py | 1 | from syncloudlib import logger
from syncloud_platform.disks.lsblk import Disk, Partition
logger.init(console=True)
def test_find_root_partition_some():
disk = Disk('disk', '/dev/sda', 20, [
Partition(10, '/dev/sda1', '/', True, 'ext4', False),
Partition(10, '/dev/sda2', '', True, 'ext4', True)
... |
bcheung92/Paperproject | refs/heads/master | gem5/tests/configs/realview-simple-timing.py | 52 | # Copyright (c) 2012 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... |
eschleicher/flask_shopping_list | refs/heads/master | venv/lib/python3.4/site-packages/setuptools/tests/contexts.py | 73 | import tempfile
import os
import shutil
import sys
import contextlib
import site
from ..compat import StringIO
@contextlib.contextmanager
def tempdir(cd=lambda dir:None, **kwargs):
temp_dir = tempfile.mkdtemp(**kwargs)
orig_dir = os.getcwd()
try:
cd(temp_dir)
yield temp_dir
finally:
... |
Distrotech/intellij-community | refs/heads/master | python/testData/psi/SetLiteral.py | 83 | {1, 2}
{1}
|
acsone/account-analytic | refs/heads/8.0 | stock_analytic/__init__.py | 2 | # -*- coding: utf-8 -*-
# Copyright 2013 Julius Network Solutions
# Copyright 2015 Clear Corp
# Copyright 2016 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import models
|
dincamihai/django-allauth | refs/heads/master | allauth/tests.py | 38 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import requests
from datetime import datetime, date
import django
from django.test import TestCase
from django.db import models
from . import utils
class MockedResponse(object):
def __init__(self, status_code, content, headers=None):
if he... |
EmreAtes/spack | refs/heads/develop | var/spack/repos/builtin/packages/r-mgcv/package.py | 5 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, [email protected], All rights reserved.
# LLNL-CODE-64... |
buptlsl/learn-python3 | refs/heads/master | samples/module/hello.py | 20 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
' a test module '
__author__ = 'Michael Liao'
import sys
def test():
args = sys.argv
if len(args)==1:
print('Hello, world!')
elif len(args)==2:
print('Hello, %s!' % args[1])
else:
print('Too many arguments!')
if __name__=='_... |
joesonw/shadowsocks | refs/heads/master | tests/graceful_cli.py | 977 | #!/usr/bin/python
import socks
import time
SERVER_IP = '127.0.0.1'
SERVER_PORT = 8001
if __name__ == '__main__':
s = socks.socksocket()
s.set_proxy(socks.SOCKS5, SERVER_IP, 1081)
s.connect((SERVER_IP, SERVER_PORT))
s.send(b'test')
time.sleep(30)
s.close()
|
HyperBaton/ansible | refs/heads/devel | lib/ansible/modules/network/cloudengine/ce_bgp_neighbor.py | 13 | #!/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... |
georgemarshall/django | refs/heads/master | django/http/cookie.py | 62 | from http import cookies
# For backwards compatibility in Django 2.1.
SimpleCookie = cookies.SimpleCookie
# Add support for the SameSite attribute (obsolete when PY37 is unsupported).
cookies.Morsel._reserved.setdefault('samesite', 'SameSite')
def parse_cookie(cookie):
"""
Return a dictionary parsed from a ... |
eonpatapon/lollypop | refs/heads/master | src/define.py | 1 | # Copyright (c) 2014-2015 Cedric Bellegarde <[email protected]>
# 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 vers... |
mrimp/N910TUVU1ANIH_kernel | refs/heads/master | 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... |
jaggu303619/asylum | refs/heads/master | openerp/report/pyPdf/filters.py | 13 | # vim: sw=4:expandtab:foldmethod=marker
#
# Copyright (c) 2006, Mathieu Fenniak
# 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 copyrig... |
Djabbz/wakatime | refs/heads/master | wakatime/packages/requests/packages/chardet/hebrewprober.py | 2928 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Shy Shalom
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#... |
nvazquez/Turtlebots | refs/heads/master | plugins/xevents/Xlib/keysymdef/miscellany.py | 14 | XK_BackSpace = 0xFF08
XK_Tab = 0xFF09
XK_Linefeed = 0xFF0A
XK_Clear = 0xFF0B
XK_Return = 0xFF0D
XK_Pause = 0xFF13
XK_Scroll_Lock = 0xFF14
XK_Sys_Req = 0xFF15
XK_Escape = 0xFF1B
XK_Delete = 0xFFFF
XK_Multi_key = 0xFF20
XK_SingleCandidate = 0xFF3C
XK_MultipleCandidate = 0xFF3D
XK_PreviousCandidate = 0xFF3E
XK_Kanji = 0xF... |
Bforartists/scons | refs/heads/master | scons-local/SCons/Warnings.py | 3 | #
# Copyright (c) 2001 - 2014 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge... |
tomasreimers/tensorflow-emscripten | refs/heads/master | tensorflow/contrib/linalg/python/kernel_tests/linear_operator_composition_test.py | 5 | # 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... |
michael-berlin/vitess | refs/heads/master | py/vtproto/vtctldata_pb2.py | 5 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: vtctldata.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _ref... |
CatherineWong/zxing-glass | refs/heads/master | cpp/scons/scons-local-2.0.0.final.0/SCons/Taskmaster.py | 34 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without li... |
campbe13/openhatch | refs/heads/master | vendor/packages/gdata/tests/gdata_tests/sites/live_client_test.py | 41 | #!/usr/bin/python
#
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
ram8647/gcb-mobilecsp | refs/heads/master | appengine_config.py | 1 | # Copyright 2013 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 ... |
tushevorg/namebench | refs/heads/master | libnamebench/conn_quality.py | 173 | # Copyright 2009 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 ... |
chkir/django-cms | refs/heads/develop | cms/south_migrations/0019_public_table_renames.py | 1680 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
try:
from django.contrib.auth import get_user_model
except ImportError: # django < 1.5
from django.contrib.auth.models import User
else:
User = get_user_model()
user_orm_label... |
JensGrabner/mpmath | refs/heads/master | doc/source/plots/coulombg_c.py | 6 | # Irregular Coulomb wave function in the complex plane
cplot(lambda z: coulombg(1,1,z), points=50000)
|
frankiecjunle/yunblog | refs/heads/master | venv/lib/python2.7/site-packages/flask_migrate/templates/flask/env.py | 557 | from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
import logging
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config ... |
JeffHeard/terrapyn_docker | refs/heads/master | pysqlite-2.6.3/doc/includes/sqlite3/shared_cache.py | 49 | from pysqlite2 import dbapi2 as sqlite3
# The shared cache is only available in SQLite versions 3.3.3 or later
# See the SQLite documentaton for details.
sqlite3.enable_shared_cache(True)
|
Karosuo/Linux_tools | refs/heads/master | xls_handlers/xls_sum_venv/lib/python3.6/site-packages/pip/_vendor/msgpack/_version.py | 41 | version = (0, 5, 6)
|
SM-G920P/kernel_samsung_exynos7420 | refs/heads/cm-13.0 | tools/perf/scripts/python/sctop.py | 11180 | # system call top
# (c) 2010, Tom Zanussi <[email protected]>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... |
jabadabadu/cassango | refs/heads/master | cassango/creation.py | 1 | #-*- coding: iso-8859-2 -*-
import sys
import time
from django.conf import settings
from django.core.management import call_command
from django.db.utils import load_backend
from pycassa.types import *
TEST_DATABASE_PREFIX = 'test_'
class CassandraDatabaseCreation(object):
data_types = {
'Au... |
benoitsteiner/tensorflow-xsmm | refs/heads/master | tensorflow/contrib/autograph/converters/builtin_functions.py | 11 | # 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.