repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
bgris/ODL_bgris | refs/heads/master | lib/python3.5/site-packages/networkx/utils/contextmanagers.py | 63 | from __future__ import absolute_import
from contextlib import contextmanager
__all__ = [
'reversed',
]
@contextmanager
def reversed(G):
"""A context manager for temporarily reversing a directed graph in place.
This is a no-op for undirected graphs.
Parameters
----------
G : graph
A ... |
FEniCS/dolfin | refs/heads/master | demo/undocumented/waveguide/python/demo_waveguide.py | 3 | """ This demo demonstrates the calculation and visualization of a TM
(Transverse Magnetic) cutoff mode of a rectangular waveguide.
For more information regarding waveguides see
http://www.ee.bilkent.edu.tr/~microwave/programs/magnetic/rect/info.htm
See the pdf in the parent folder and the following reference
The Fi... |
runningwolf666/you-get | refs/heads/develop | setup.py | 19 | #!/usr/bin/env python3
PROJ_NAME = 'you-get'
PACKAGE_NAME = 'you_get'
PROJ_METADATA = '%s.json' % PROJ_NAME
import os, json, imp
here = os.path.abspath(os.path.dirname(__file__))
proj_info = json.loads(open(os.path.join(here, PROJ_METADATA), encoding='utf-8').read())
try:
README = open(os.path.join(here, 'README... |
GbalsaC/bitnamiP | refs/heads/master | venv/lib/python2.7/site-packages/dateutil/easter.py | 232 | """
Copyright (c) 2003-2007 Gustavo Niemeyer <gustavo@niemeyer.net>
This module offers extensions to the standard Python
datetime module.
"""
__license__ = "Simplified BSD"
import datetime
__all__ = ["easter", "EASTER_JULIAN", "EASTER_ORTHODOX", "EASTER_WESTERN"]
EASTER_JULIAN = 1
EASTER_ORTHODOX = 2
EASTER_WEST... |
Isendir/brython | refs/heads/master | www/src/Lib/test/test_pstats.py | 175 | import unittest
from test import support
from io import StringIO
import pstats
class AddCallersTestCase(unittest.TestCase):
"""Tests for pstats.add_callers helper."""
def test_combine_results(self):
# pstats.add_callers should combine the call results of both target
# and source by adding th... |
sschepens/pulsar | refs/heads/master | pulsar-functions/instance/src/main/python/python_instance_main.py | 1 | #!/usr/bin/env python
#
# 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
# "... |
nuuuboo/odoo | refs/heads/8.0 | addons/crm_partner_assign/wizard/crm_channel_interested.py | 263 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... |
40223136/w17test1 | refs/heads/master | gear.py | 28 | #@+leo-ver=5-thin
#@+node:office.20150407074720.1: * @file gear.py
#@@language python
#@@tabwidth -4
#@+<<declarations>>
#@+node:office.20150407074720.2: ** <<declarations>> (application)
#@@language python
import cherrypy
import os
import sys
# 這個程式要計算正齒輪的齒面寬, 資料庫連結希望使用 pybean 與 SQLite
# 導入 pybean 模組與所要使用的 Store 及 S... |
nhomar/maintainer-tools | refs/heads/master | tools/config.py | 7 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
import ConfigParser
import os
CREDENTIALS_FILE = 'oca.cfg'
def init_config():
config = ConfigParser.ConfigParser()
config.add_section("GitHub")
config.set("GitHub", "token", "")
config.add_section("odoo")
config.set("... |
trooble/census_plot | refs/heads/master | demo1/bds/admin.py | 1 | # Copyright 2012 Karim Sumun
#
# This file is part of Simple Census Plotter.
#
# Simple Census Plotter 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... |
actmd/selenium | refs/heads/master | py/selenium/webdriver/android/__init__.py | 537 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
johnkeepmoving/oss-ftp | refs/heads/master | python27/win32/Lib/site-packages/urllib3/exceptions.py | 196 | from __future__ import absolute_import
# Base Exceptions
class HTTPError(Exception):
"Base exception used by this module."
pass
class HTTPWarning(Warning):
"Base warning used by this module."
pass
class PoolError(HTTPError):
"Base exception for errors caused within a pool."
def __init__(se... |
paplorinc/intellij-community | refs/heads/master | python/testData/inspections/ChainedComparison9.py | 18 | 0 < x and True and x < 2 |
2014c2g4/w16b_test | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/datetime.py | 628 | """Concrete date/time and related types.
See http://www.iana.org/time-zones/repository/tz-link.html for
time zone and DST data sources.
"""
import time as _time
import math as _math
def _cmp(x, y):
return 0 if x == y else 1 if x > y else -1
MINYEAR = 1
MAXYEAR = 9999
_MAXORDINAL = 3652059 # date.max.toordinal()... |
material-motion/direct | refs/heads/master | models.py | 1 | #
# Copyright 2018 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
scorpilix/Golemtest | refs/heads/develop | golem/interface/client/environments.py | 1 | from golem.core.deferred import sync_wait
from golem.interface.command import group, Argument, command, CommandResult
@group(name="envs", help="Manage environments")
class Environments(object):
name = Argument('name', help="Environment name")
table_headers = ['name', 'supported', 'active', 'performance',
... |
SNoiraud/gramps | refs/heads/master | gramps/gui/editors/displaytabs/eventrefmodel.py | 4 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2009 B. Malengier
#
# 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; eithe... |
puneetgkaur/backup_sugar_sugartoolkit | refs/heads/master | examples/animator.py | 7 | from gi.repository import Gtk
from sugar3.graphics import animator
from sugar3.graphics.icon import Icon
from sugar3.graphics import style
class _Animation(animator.Animation):
def __init__(self, icon, start_size, end_size):
animator.Animation.__init__(self, 0.0, 1.0)
self._icon = icon
s... |
nvoron23/scipy | refs/heads/master | scipy/sparse/lil.py | 56 | """LInked List sparse matrix class
"""
from __future__ import division, print_function, absolute_import
__docformat__ = "restructuredtext en"
__all__ = ['lil_matrix','isspmatrix_lil']
import numpy as np
from .base import spmatrix, isspmatrix
from .sputils import (getdtype, isshape, isscalarlike, IndexMixin,
... |
oceanobservatories/mi-instrument | refs/heads/master | mi/dataset/driver/wavss_a/dcl/wavss_a_dcl_recovered_driver.py | 5 | """
@package mi.dataset.driver.wavss_a.dcl.wavss_a_dcl_telemetered
@file mi/dataset/driver/wavss_a/dcl/wavss_a_dcl_telemetered.py
@author Emily Hahn
@brief A driver for the recovered wavss series a instrument through a DCL
"""
import os
from mi.logging import config
from mi.core.log import get_logger
from mi.dataset... |
Thuva4/Algorithms_Example | refs/heads/master | Edit distance/python/edit_distance.py | 9 | # Helpful tutorial: https://www.youtube.com/watch?v=We3YDTzNXEk
# Useful link: https://en.wikipedia.org/wiki/Edit_distance
def get_edit_distance(s1, s2):
l1 = len(s1) + 1
l2 = len(s2) + 1
edit_table = {}
for i in range(l1):
edit_table[i, 0] = i
for j in range(l2):
edit_table[0, j] ... |
olituks/sentinella | refs/heads/master | collector/library/tornado/httpclient.py | 22 | """Blocking and non-blocking HTTP client interfaces.
This module defines a common interface shared by two implementations,
``simple_httpclient`` and ``curl_httpclient``. Applications may either
instantiate their chosen implementation class directly or use the
`AsyncHTTPClient` class from this module, which selects an... |
liuliwork/django | refs/heads/master | tests/dispatch/tests.py | 346 | import gc
import sys
import time
import unittest
import weakref
from types import TracebackType
from django.dispatch import Signal, receiver
if sys.platform.startswith('java'):
def garbage_collect():
# Some JVM GCs will execute finalizers in a different thread, meaning
# we need to wait for that t... |
ramitalat/odoo | refs/heads/8.0 | addons/hw_posbox_homepage/__init__.py | 1894 | # -*- 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... |
synweap15/pyload | refs/heads/stable | module/plugins/crypter/DuploadOrgFolder.py | 15 | # -*- coding: utf-8 -*-
from module.plugins.internal.DeadCrypter import DeadCrypter, create_getInfo
class DuploadOrgFolder(DeadCrypter):
__name__ = "DuploadOrgFolder"
__type__ = "crypter"
__version__ = "0.03"
__status__ = "testing"
__pattern__ = r'http://(?:www\.)?dupload\.org/folder/\d+'... |
adieu/python-openid | refs/heads/google | openid/extensions/ax.py | 166 | # -*- test-case-name: openid.test.test_ax -*-
"""Implements the OpenID Attribute Exchange specification, version 1.0.
@since: 2.1.0
"""
__all__ = [
'AttributeRequest',
'FetchRequest',
'FetchResponse',
'StoreRequest',
'StoreResponse',
]
from openid import extension
from openid.server.trustroot... |
deathbaba/Alohalytics | refs/heads/master | tests/googletest/test/gtest_throw_on_failure_test.py | 2917 | #!/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... |
noahhsmith/starid | refs/heads/master | libstarid/pybind11-2.2.3/tests/test_operator_overloading.py | 19 | import pytest
from pybind11_tests import operators as m
from pybind11_tests import ConstructorStats
def test_operator_overloading():
v1 = m.Vector2(1, 2)
v2 = m.Vector(3, -1)
assert str(v1) == "[1.000000, 2.000000]"
assert str(v2) == "[3.000000, -1.000000]"
assert str(v1 + v2) == "[4.000000, 1.00... |
orekyuu/intellij-community | refs/heads/master | python/helpers/epydoc/docwriter/xlink.py | 91 | """
A Docutils_ interpreted text role for cross-API reference support.
This module allows a Docutils_ document to refer to elements defined in
external API documentation. It is possible to refer to many external API
from the same document.
Each API documentation is assigned a new interpreted text role: using such
int... |
vchatela/My-Homessistant | refs/heads/master | core/myh_sensors/transmitters.py | 1 | import json
import os
class HF_transmitter:
def __init__(self,plug_id,radio_wiringpi_number):
self.plug_id = plug_id
self.radio_wiringpi_number = radio_wiringpi_number
def turn_on_off_plug(self, new_state):
plug_id = str(self.plug_id)
command = " ".join(
[str(os.pa... |
R-Morgan/python | refs/heads/master | text_processing.py | 1 | # !/usr/bin/env python
# Basic text processing script in python
# Copyright (C) <2014> <J. Arianna Morgan>
#
# 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, o... |
PennPanda/linux | refs/heads/master | tools/perf/scripts/python/futex-contention.py | 1997 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... |
Acidburn0zzz/kythe | refs/heads/master | third_party/googletest/test/gtest_throw_on_failure_test.py | 2917 | #!/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... |
virneo/nupic | refs/heads/master | tests/swarming/nupic/swarming/experiments/input_predicted_field/permutations.py | 38 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
gale320/oppia | refs/heads/develop | core/domain/value_generators_domain_test.py | 34 | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... |
Philippe12/external_chromium_org | refs/heads/kitkat | build/android/pylib/utils/host_path_finder.py | 74 | # 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
from pylib import constants
def GetMostRecentHostPath(file_name):
"""Returns the most recent existing full path for the given file name.
Re... |
googleads/google-ads-python | refs/heads/master | google/ads/googleads/v7/services/services/video_service/__init__.py | 2 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
lgh8820/ansible-test | refs/heads/master | yjy_all_scripts/root/shell/modify_file_size.py | 2 | #! /usr/bin/env python
# -*- coding:utf8 -*-
import MySQLdb as mdb
where_file='/root/shell/aes_ssl_media.txt'
out_sql='/root/shell/patch_file_size.sql'
field_file='/root/shell/aes_file_size.txt'
result_file='/root/shell/result.txt'
conn=mdb.connect("localhost",'root','abcxxx','yjy_xiyizhiyeyishi')
cursor=conn.cursor()
... |
TRex22/hawkthorne-journey | refs/heads/master | scripts/release_markdown.py | 1 | import os
import sys
from datetime import datetime
import argparse
import requests
import jinja2
import json
import time
import subprocess
pulls_url = "https://api.github.com/repos/hawkthorne/hawkthorne-journey/pulls"
issues_url = "https://api.github.com/repos/hawkthorne/hawkthorne-journey/issues"
tag_url = "https://a... |
demonchild2112/travis-test | refs/heads/master | grr/core/grr_response_core/lib/artifact_utils.py | 2 | #!/usr/bin/env python
"""Library for processing of artifacts.
This file contains non-GRR specific pieces of artifact processing and is
intended to end up as an independent library.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import re
from futu... |
onceuponatimeforever/oh-mainline | refs/heads/master | vendor/packages/Django/django/core/xheaders.py | 518 | """
Pages in Django can are served up with custom HTTP headers containing useful
information about those pages -- namely, the content type and object ID.
This module contains utility functions for retrieving and doing interesting
things with these special "X-Headers" (so called because the HTTP spec demands
that custo... |
Zord13appdesa/python-for-android | refs/heads/master | python-modules/twisted/twisted/trial/test/test_deferred.py | 79 | from twisted.internet import defer
from twisted.trial import unittest
from twisted.trial import runner, reporter, util
from twisted.trial.test import detests
class TestSetUp(unittest.TestCase):
def _loadSuite(self, klass):
loader = runner.TestLoader()
r = reporter.TestResult()
s = loader.l... |
ahmetcemturan/SFACT | refs/heads/master | fabmetheus_utilities/geometry_plugins/creation/__init__.py | 225 | #This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module.
import os
import sys
numberOfLevelsDeepInPackageHierarchy = 3
packageFilePath = os.path.abspath(__file__)
for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ):
packageFilePath =... |
nmacri/twitter-bots-smw-2016 | refs/heads/master | scraper/smwbot/spiders/smw.py | 1 | from scrapy.spiders import Spider
from scrapy.selector import Selector
from scrapy.http import Request, Response
from smwbot.items import Event
import json
class SmwSpider(Spider):
name = "smw"
# allowed_domains = ["http://socialmediaweek.org/"]
start_urls = [
"http://socialmediaweek.org/newyor... |
twiest/openshift-tools | refs/heads/stg | scripts/monitoring/cron-send-url-check.py | 6 | #!/usr/bin/env python
'''
Send url checks to Zagg
'''
# vim: expandtab:tabstop=4:shiftwidth=4
#
# Copyright 2018 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
#
# ... |
DecipherOne/Troglodyte | refs/heads/master | Trog Build Dependencies/Python26/Lib/test/test_unicode.py | 2 | # -*- coding: iso-8859-1 -*-
""" Test script for the Unicode implementation.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""#"
import sys, struct, codecs
from test import test_support, string_tests
# Error handling (bad decoder return)
def search_function(e... |
GENIVI/vehicle_signal_manager | refs/heads/master | vsmlib/utils.py | 2 | def parse_signal_num_file(filename):
signal_to_num = {}
vsi_version = -1
try:
with open(filename) as signal_to_num_file:
lines = signal_to_num_file.readlines()
for line in lines:
line_stripped = line.strip()
if vsi_version < 0:
... |
repotvsupertuga/tvsupertuga.repository | refs/heads/master | instal/plugin.video.youtube/resources/lib/youtube/helper/tv.py | 26 | __author__ = 'bromix'
from resources.lib import kodion
from resources.lib.youtube.helper import utils
from resources.lib.kodion.items.video_item import VideoItem
def my_subscriptions_to_items(provider, context, json_data):
result = []
video_id_dict = {}
items = json_data.get('items', [])
for item in... |
PUNCH-Cyber/stoq-plugins-public | refs/heads/master | azure_blob/setup.py | 1 | from setuptools import setup, find_packages
setup(
name="azure_blob",
version="3.0.0",
author="Kiran Pradhan (@kiranpradhan01)",
url="https://github.com/PUNCH-Cyber/stoq-plugins-public",
license="Apache License 2.0",
description="Save results and archive payloads with Azure Blob Storage",
p... |
akosiaris/kafka | refs/heads/debian | system_test/utils/system_test_utils.py | 3 | # 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... |
ZhangBohan/KoalaAPI | refs/heads/master | KoalaAPI/__init__.py | 1 | from flask import Flask
import logging
def create_app():
app = Flask(__name__)
logging.basicConfig(level=logging.DEBUG)
app.logger.debug('creating app')
app.config['SECRET_KEY'] = 'alkjadsf,zxcnv,nmasroiuaewr'
app.config['client_id'] = 'b36fd04ccb202122a5c7'
app.config['client_secret'] = '652... |
AlmostBetterNetwork/podmaster-host | refs/heads/master | sites/migrations/0020_remove_site_custom_css.py | 3 | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-07-19 03:14
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('sites', '0019_auto_20180317_1707'),
]
operations = [
migrations.RemoveField(
... |
urandu/mfl_api | refs/heads/develop | common/tests/test_sequence_field.py | 3 | from django.contrib.auth import get_user_model
from django.test import TestCase
from model_mommy import mommy
from common.fields import SequenceField
from common.models import County
class SequenceFieldTest(TestCase):
def setUp(self):
self.user = mommy.make(get_user_model())
self.test_model = Cou... |
jymannob/CouchPotatoServer | refs/heads/develop | libs/rsa/core.py | 214 | # -*- coding: utf-8 -*-
#
# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
#
# 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
#
# Unl... |
popazerty/dvbapp2-gui | refs/heads/master | lib/python/Components/ParentalControlList.py | 2 | from MenuList import MenuList
from Components.ParentalControl import IMG_WHITESERVICE, IMG_WHITEBOUQUET, IMG_BLACKSERVICE, IMG_BLACKBOUQUET
from Tools.Directories import SCOPE_ACTIVE_SKIN, resolveFilename
from enigma import eListboxPythonMultiContent, gFont, RT_HALIGN_LEFT
from Tools.LoadPixmap import LoadPixmap
#Now... |
sandeepdsouza93/TensorFlow-15712 | refs/heads/master | tensorflow/python/kernel_tests/sparse_ops_test.py | 10 | # 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... |
wittawatj/fsic-test | refs/heads/master | fsic/ex/ex2_prob_params.py | 1 | """Simulation to examine the P(reject) as the parameters for each problem are
varied. What varies will depend on the problem."""
__author__ = 'wittawat'
import fsic.data as data
import fsic.feature as fea
import fsic.indtest as it
import fsic.glo as glo
import fsic.util as util
import fsic.kernel as kernel
import ... |
praemdonck/micropython | refs/heads/master | tests/basics/builtin_ellipsis.py | 99 | # tests that .../Ellipsis exists
print(...)
print(Ellipsis)
print(... == Ellipsis)
|
Acidburn0zzz/servo | refs/heads/master | tests/wpt/web-platform-tests/webdriver/tests/new_session/create_alwaysMatch.py | 22 | # META: timeout=long
import pytest
from .conftest import product, flatten
from tests.support.asserts import assert_success
from tests.new_session.support.create import valid_data
@pytest.mark.parametrize("key,value", flatten(product(*item) for item in valid_data))
def test_valid(new_session, add_browser_capabiliti... |
eunchong/build | refs/heads/master | third_party/cherrypy/_cpcompat.py | 83 | """Compatibility code for using CherryPy with various versions of Python.
CherryPy 3.2 is compatible with Python versions 2.3+. This module provides a
useful abstraction over the differences between Python versions, sometimes by
preferring a newer idiom, sometimes an older one, and sometimes a custom one.
In particul... |
rochacbruno/dynaconf | refs/heads/master | dynaconf/utils/boxing.py | 1 | import inspect
from functools import wraps
from dynaconf.utils import recursively_evaluate_lazy_format
from dynaconf.utils import upperfy
from dynaconf.utils.functional import empty
from dynaconf.vendor.box import Box
def evaluate_lazy_format(f):
"""Marks a method on Dynabox instance to
lazily evaluate LazyF... |
GrinningFerret/android_kernel_lge_msm8226 | refs/heads/mm6.0 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | # Core.py - Python extension for perf script, 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 aut... |
obtuse/ahmia | refs/heads/master | onionbot/setup.py | 5 | from setuptools import setup, find_packages
setup(
name='onionbot',
version='1.0',
packages=find_packages(),
entry_points={'scrapy': ['settings = dirbot.settings']},
)
|
liikGit/MissionPlanner | refs/heads/master | Lib/ConfigParser.py | 50 | """Configuration file parser.
A setup file consists of sections, lead by a "[section]" header,
and followed by "name: value" entries, with continuations and such in
the style of RFC 822.
The option values can contain format strings which refer to other values in
the same section, or values in a special [DEFAUL... |
diogocs1/comps | refs/heads/master | web/openerp/addons/test_impex/tests/test_load.py | 350 | # -*- coding: utf-8 -*-
import json
import pkgutil
import unittest2
import openerp.modules.registry
import openerp
from openerp.tests import common
from openerp.tools.misc import mute_logger
def message(msg, type='error', from_=0, to_=0, record=0, field='value', **kwargs):
return dict(kwargs,
typ... |
frank10704/DF_GCS_W | refs/heads/master | MissionPlanner-master/Lib/site-packages/numpy/core/_internal.py | 53 | #A place for code to be called from C-code
# that implements more complicated stuff.
import re
import sys
import warnings
from numpy.compat import asbytes, bytes
if (sys.byteorder == 'little'):
_nbo = asbytes('<')
else:
_nbo = asbytes('>')
def _makenames_list(adict):
from numpy.core import dtype
al... |
t3ddftw/M3Scout | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
import os
from setuptools import setup
from setuptools import find_packages
setup(
name='m3scout',
version='1.0',
packages=find_packages(exclude=('tests',)),
) |
spbguru/repo1 | refs/heads/master | nupic/frameworks/opf/two_gram_model.py | 15 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
Stanford-Online/edx-platform | refs/heads/master | common/djangoapps/util/milestones_helpers.py | 9 | # pylint: disable=invalid-name
"""
Utility library for working with the edx-milestones app
"""
from django.conf import settings
from django.utils.translation import ugettext as _
from milestones import api as milestones_api
from milestones.exceptions import InvalidMilestoneRelationshipTypeException, InvalidUserExceptio... |
sudheesh001/oh-mainline | refs/heads/master | vendor/packages/scrapy/scrapy/contrib/pipeline/images.py | 16 | """
Images Pipeline
See documentation in topics/images.rst
"""
from __future__ import with_statement
import os
import time
import hashlib
import urlparse
import rfc822
from cStringIO import StringIO
from collections import defaultdict
from twisted.internet import defer, threads
from PIL import Image
from scrapy.xli... |
joequant/zipline | refs/heads/master | zipline/__init__.py | 28 | #
# Copyright 2013 Quantopian, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... |
dkubiak789/OpenUpgrade | refs/heads/8.0 | addons/l10n_hr/__init__.py | 432 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Module: l10n_hr
# Author: Goran Kliska
# mail: goran.kliska(AT)slobodni-programi.hr
# Copyright (C) 2011- Slobodni programi d.o.o., Zagreb
# Contrib... |
stackforge/python-senlinclient | refs/heads/master | senlinclient/tests/unit/v1/test_node.py | 1 | # 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 unde... |
allancarlos123/Solfege-5.0 | refs/heads/master | solfege/exercises/singanswer.py | 2 | # GNU Solfege - free ear training software
# Copyright (C) 2004, 2005, 2007, 2008, 2011 Tom Cato Amundsen
#
# 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
#... |
npalermo10/auto_choice_assay_train-test | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/_collections.py | 484 | from collections import Mapping, MutableMapping
try:
from threading import RLock
except ImportError: # Platform-specific: No threads available
class RLock:
def __enter__(self):
pass
def __exit__(self, exc_type, exc_value, traceback):
pass
try: # Python 2.7+
from ... |
ndingwall/scikit-learn | refs/heads/master | sklearn/cluster/_optics.py | 6 | # -*- coding: utf-8 -*-
"""Ordering Points To Identify the Clustering Structure (OPTICS)
These routines execute the OPTICS algorithm, and implement various
cluster extraction methods of the ordered list.
Authors: Shane Grigsby <refuge@rocktalus.com>
Adrin Jalali <adrinjalali@gmail.com>
Erich Schuber... |
TNT-Samuel/Coding-Projects | refs/heads/master | DNS Server/Source/Lib/site-packages/pip/_vendor/cachecontrol/wrapper.py | 42 | from .adapter import CacheControlAdapter
from .cache import DictCache
def CacheControl(
sess,
cache=None,
cache_etags=True,
serializer=None,
heuristic=None,
controller_class=None,
adapter_class=None,
cacheable_methods=None,
):
cache = cache or DictCache()
adapter_class = adapt... |
rlr/fjord | refs/heads/master | vendor/packages/urllib3/urllib3/filepost.py | 551 | # urllib3/filepost.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import codecs
import mimetypes
from uuid import uuid4
from io import BytesIO
from .packages ... |
40223110/2015cd_0505 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/xml/parsers/__init__.py | 1254 | """Python interfaces to XML parsers.
This package contains one module:
expat -- Python wrapper for James Clark's Expat parser, with namespace
support.
"""
|
awd4/spnss | refs/heads/master | grid_search.py | 1 | import argparse
import numpy as np
import time
import random
import os
import dag
import tree
import spnss.deps as deps
import spnss.network as network
import experiment
def eval_grid_point(learner, name, t, cp, verbosity):
structure = learner
learner = {'dag':dag.run, 'tree':tree.run}[structure]
rs = r... |
kennedyshead/home-assistant | refs/heads/dev | homeassistant/components/hlk_sw16/const.py | 16 | """Constants for HLK-SW16 component."""
DOMAIN = "hlk_sw16"
DEFAULT_NAME = "HLK-SW16"
DEFAULT_PORT = 8080
DEFAULT_RECONNECT_INTERVAL = 10
DEFAULT_KEEP_ALIVE_INTERVAL = 3
CONNECTION_TIMEOUT = 10
|
Triv90/Nova | refs/heads/openstack-ci/fuel/grizzly | nova/api/metadata/__init__.py | 25 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation
#
# 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-... |
ARudiuk/mne-python | refs/heads/master | mne/time_frequency/tfr.py | 1 | """A module which implements the time frequency estimation.
Morlet code inspired by Matlab code from Sheraz Khan & Brainstorm & SPM
"""
# Authors : Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Hari Bharadwaj <hari@nmr.mgh.harvard.edu>
# Clement Moutard <clement.moutard@polytechniq... |
Russell-IO/ansible | refs/heads/devel | test/units/template/test_vars.py | 84 | # (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, or
# (at your option) an... |
KyleAMoore/KanjiNani | refs/heads/master | Android/.buildozer/android/platform/build/build/other_builds/kivy-python3crystax-sdl2/armeabi-v7a/kivy/examples/application/app_with_build.py | 21 | '''
Application example using build() + return
==========================================
An application can be built if you return a widget on build(), or if you set
self.root.
'''
import kivy
kivy.require('1.0.7')
from kivy.app import App
from kivy.uix.button import Button
class TestApp(App):
def build(self... |
mrshelly/openerp71313 | refs/heads/master | openerp/exceptions.py | 76 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... |
AyD2/proyectosEcys | refs/heads/master | Dev/ProyectosEcys/sistema_pe/urls.py | 1 | ''' Modulo encargado del direccionamiento de las url que bienen desde
ProyectoEcys.urls.py'''
from django.conf.urls import patterns, url, include
from dajaxice.core import dajaxice_autodiscover, dajaxice_config
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
import sistema_pe.views
from django.c... |
TFenby/python-mode | refs/heads/develop | pymode/libs/pylama/lint/pylama_pylint/pylint/reporters/__init__.py | 18 | # Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE).
# 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... |
saurabh6790/aimobilize | refs/heads/develop | patches/october_2013/p01_update_delivery_note_prevdocs.py | 30 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
def execute():
webnotes.reload_doc("stock", "doctype", "delivery_note_item")
webnotes.conn.sql("""update `tabDelivery Note Item` s... |
ayoubserti/winpty | refs/heads/master | build-gyp/test/win/gyptest-link-noimportlib.py | 96 | #!/usr/bin/env python
# Copyright (c) 2015 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 that the (custom) NoImportLibrary flag is handled correctly.
"""
import TestGyp
import os
import sys
if sys.platform == 'wi... |
rtucker-mozilla/inventory | refs/heads/master | core/search/utils.py | 2 | from django.db.models import Q
def objects_to_Q(query_set):
"""
Given a sequence (can be empty) containing django ORM objects, calculate a
Q expression what will return those objects.
"""
def combine(q, n):
return q | Q(pk=n.pk)
return reduce(combine, query_set, Q(pk__lt=-1))
|
meejah/crossbarexamples | refs/heads/master | iotcookbook/device/pi/neopixel/client.py | 3 | import time
import random
import Adafruit_ADS1x15
from neopixel import *
LED_COUNT = 8 # Number of LED pixels.
LED_PIN = 12 # GPIO pin connected to the pixels (must support PWM!).
LED_FREQ_HZ = 800000 # LED signal frequency in hertz (usually 800khz)
LED_DMA = 5 # DMA channel to ... |
SujaySKumar/django | refs/heads/master | django/middleware/http.py | 216 | from django.utils.cache import get_conditional_response
from django.utils.http import http_date, parse_http_date_safe
class ConditionalGetMiddleware(object):
"""
Handles conditional GET operations. If the response has an ETag or
Last-Modified header, and the request has If-None-Match or
If-Modified-Si... |
napkindrawing/ansible | refs/heads/devel | lib/ansible/plugins/vars/host_group_vars.py | 19 | # Copyright 2017 RedHat, inc
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible i... |
rdp/legado | refs/heads/master | test/GrampsDb/GrampsDbBase_Test.py | 2 | import unittest
import logging
import os
import tempfile
import shutil
import time
import traceback
import sys
sys.path.append('../../src')
try:
set()
except NameError:
from sets import Set as set
import const
import gen.lib
logger = logging.getLogger('Gramps.GrampsDbBase_Test')
from G... |
widoptimization-willett/feature-extraction | refs/heads/master | scripts/cat_features.py | 1 | import json
import sys
import click
@click.command()
@click.argument('feat1', required=True)
@click.argument('feat2', required=True)
def cli(feat1, feat2):
with open(feat1) as f:
db1 = json.load(f)
with open(feat2) as f:
db2 = json.load(f)
c = {}
for k, v in db1.iteritems():
c[k] = db1[k] + db2[k]
json.du... |
fuselock/odoo | refs/heads/8.0 | openerp/addons/test_new_api/tests/test_onchange.py | 208 | # -*- coding: utf-8 -*-
from openerp.tests import common
class TestOnChange(common.TransactionCase):
def setUp(self):
super(TestOnChange, self).setUp()
self.Discussion = self.env['test_new_api.discussion']
self.Message = self.env['test_new_api.message']
def test_default_get(self):
... |
ericmckean/syzygy | refs/heads/master | syzygy/build/generate_coverage.py | 4 | #!python
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... |
tchellomello/home-assistant | refs/heads/dev | homeassistant/components/lcn/climate.py | 12 | """Support for LCN climate control."""
import pypck
from homeassistant.components.climate import ClimateEntity, const
from homeassistant.const import ATTR_TEMPERATURE, CONF_ADDRESS, CONF_UNIT_OF_MEASUREMENT
from . import LcnDevice
from .const import (
CONF_CONNECTIONS,
CONF_LOCKABLE,
CONF_MAX_TEMP,
C... |
kimjinyong/i2nsf-framework | refs/heads/master | Hackathon-105/revSC/initializeDB.py | 1 | import MySQLdb
mydb = MySQLdb.connect(host="localhost", user="root")
mycur = mydb.cursor()
mycur.execute("DROP DATABASE nsfdb")
mycur.execute("CREATE DATABASE nsfdb")
mycur.execute("USE nsfdb")
mycur.execute("CREATE TABLE nsftable (nname VARCHAR(255), processing VARCHAR(30), outbound VARCHAR(30), inbound VARCHAR(30... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.