repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
amisrs/one-eighty | refs/heads/master | angular_flask/lib/python2.7/site-packages/packaging/requirements.py | 140 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import string
import re
from pyparsing import stringStart, stringEnd, ori... |
SECURED-FP7/secured-webgui | refs/heads/master | webContent/psarClient.py | 1 | #!/usr/bin/python
from requests import get, put, delete, patch, post
import urllib
from keystoneclient.v2_0 import client
import argparse,json, os
'''
Client for the PSAR API. All methods return a Response object.
TO-DO: Currently only tested without authentication.
'''
class Client:
def __init__(self,base_url)... |
bgxavier/nova | refs/heads/master | nova/virt/disk/vfs/__init__.py | 129 | # Copyright 2012 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... |
flgiordano/netcash | refs/heads/master | +/google-cloud-sdk/lib/surface/sql/ssl_certs/list.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 ag... |
chrissmejia/SpreadLabs | refs/heads/master | clients/asap_to/tests.py | 15 | """
SpreadLabs - Social media suite
Copyright (C) 2015 Christopher Mejia Montoya - me@chrissmejia.com - chrissmejia.com
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, eit... |
hazrpg/calibre | refs/heads/master | src/calibre/utils/imghdr.py | 14 | """Recognize image file formats based on their first few bytes."""
__all__ = ["what"]
# -------------------------#
# Recognize image headers #
# -------------------------#
def what(file, h=None):
if h is None:
if isinstance(file, basestring):
f = open(file, 'rb')
h = f.read(150)
... |
kanagasabapathi/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/ctypes/test/test_checkretval.py | 137 | import unittest
from ctypes import *
class CHECKED(c_int):
def _check_retval_(value):
# Receives a CHECKED instance.
return str(value.value)
_check_retval_ = staticmethod(_check_retval_)
class Test(unittest.TestCase):
def test_checkretval(self):
import _ctypes_test
dll =... |
h3biomed/ansible | refs/heads/h3 | lib/ansible/modules/network/junos/junos_l2_interface.py | 26 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
# 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 = {'metadata_version': '1.1',
... |
jart/tensorflow | refs/heads/master | tensorflow/contrib/autograph/pyct/compiler.py | 1 | # 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... |
yorkerlin/shogun | refs/heads/develop | examples/undocumented/python_modular/distance_normsquared_modular.py | 26 | #!/usr/bin/env python
traindat = '../data/fm_train_real.dat'
testdat = '../data/fm_test_real.dat'
parameter_list = [[traindat,testdat],[traindat,testdat]]
def distance_normsquared_modular (train_fname=traindat,test_fname=testdat):
from modshogun import RealFeatures, EuclideanDistance, CSVFile
feats_train=RealFeatu... |
mcbrune/delphixpy_automation | refs/heads/master | v1_8_0/dx_provision_vdb.py | 3 | #!/usr/bin/env python
#Adam Bowen - Apr 2016
#This script provisions a vdb or dSource
# Updated by Corey Brune Aug 2016
# --- Create vFiles VDB
#requirements
#pip install docopt delphixpy
#The below doc follows the POSIX compliant standards and allows us to use
#this doc to also define our arguments for the script.
... |
kklmn/xrt | refs/heads/master | examples/withRaycing/01_SynchrotronSources/MAX-IV-IDs-Flux.py | 1 | # -*- coding: utf-8 -*-
import os, sys; sys.path.append(os.path.join('..', '..', '..')) # analysis:ignore
#import matplotlib as mpl
import copy
import numpy as np
import matplotlib.pyplot as plt
try:
import xlwt
except ImportError:
xlwt = None
import xrt.backends.raycing.sources as rs
from xrt.backends.rayci... |
brack3t/kenny-loggings | refs/heads/master | loggings/constants.py | 1 | ACTION_CREATE = 1
ACTION_UPDATE = 2
ACTION_DELETE = 3
|
Big-B702/python-for-android | refs/heads/master | python3-alpha/python3-src/Tools/scripts/parseentities.py | 46 | #!/usr/bin/env python3
""" Utility for parsing HTML entity definitions available from:
http://www.w3.org/ as e.g.
http://www.w3.org/TR/REC-html40/HTMLlat1.ent
Input is read from stdin, output is written to stdout in form of a
Python snippet defining a dictionary "entitydefs" mapping literal
en... |
projectcalico/calico-nova | refs/heads/calico-readme | nova/api/openstack/compute/contrib/virtual_interfaces.py | 10 | # Copyright (C) 2011 Midokura KK
# 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 ... |
Laurawly/tvm-1 | refs/heads/master | python/tvm/ir/container.py | 1 | # 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... |
nickos556/pandas-qt | refs/heads/master | tests/test_DataFrameModel.py | 3 | # -*- coding: utf-8 -*-
import random
from pandasqt.compat import Qt, QtCore, QtGui
import pytest
import pytestqt
import decimal
import numpy
import pandas
from pandasqt.models.DataFrameModel import DataFrameModel, DATAFRAME_ROLE
from pandasqt.models.DataSearch import DataSearch
from pandasqt.models.SupportedDtype... |
justacec/bokeh | refs/heads/master | bokeh/charts/builder.py | 2 | """This is the Bokeh charts interface. It gives you a high level API to build
complex plot is a simple way.
This is the Builder class, a minimal prototype class to build more chart
types on top of it.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2014, Contin... |
dpgeorge/micropython | refs/heads/master | tests/extmod/ujson_load.py | 15 | try:
from uio import StringIO
import ujson as json
except:
try:
from io import StringIO
import json
except ImportError:
print("SKIP")
raise SystemExit
print(json.load(StringIO("null")))
print(json.load(StringIO('"abc\\u0064e"')))
print(json.load(StringIO("[false, true, 1... |
dimroc/tensorflow-mnist-tutorial | refs/heads/master | lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/dataframe/transforms/boolean_mask.py | 94 | # 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... |
hcsturix74/django | refs/heads/master | tests/signals/models.py | 445 | """
Testing signals before/after saving and deleting.
"""
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Person(models.Model):
first_name = models.CharField(max_length=20)
last_name = models... |
hmoco/waterbutler | refs/heads/develop | waterbutler/providers/__init__.py | 321 | __import__("pkg_resources").declare_namespace(__name__)
|
hdinsight/hue | refs/heads/master | apps/useradmin/src/useradmin/management/commands/import_ldap_user.py | 34 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
zahodi/ansible | refs/heads/devel | lib/ansible/modules/network/f5/bigip_sys_db.py | 32 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016 F5 Networks Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# ... |
KasperPRasmussen/bokeh | refs/heads/master | examples/models/custom.py | 3 | from __future__ import print_function
from bokeh.core.properties import String
from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.models.callbacks import Callback
from bokeh.models.glyphs import Circle
from bokeh.models import Plot, DataRange1d, LinearAxis, ColumnDataSource, PanTool, Whee... |
QBI-Software/Tracking | refs/heads/master | trackerplots/trackerSPT.py | 2 | #!/usr/bin/python3
"""
QBI Meunier Tracker APP: Custom Tracker plots
*******************************************************************************
Copyright (C) 2015 QBI Software, The University of Queensland
This program is free software; you can redistribute it and/or modify
it under the terms... |
rsunder10/PopularityBased-SearchEngine | refs/heads/master | lib/python3.4/site-packages/django/views/decorators/debug.py | 712 | import functools
from django.http import HttpRequest
def sensitive_variables(*variables):
"""
Indicates which variables used in the decorated function are sensitive, so
that those variables can later be treated in a special way, for example
by hiding them when logging unhandled exceptions.
Two f... |
rotofly/odoo | refs/heads/master | addons/mrp/wizard/change_production_qty.py | 245 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
molotof/infernal-twin | refs/heads/master | build/reportlab/src/reportlab/lib/rl_accel.py | 34 | #this is the interface module that imports all from the C extension _rl_accel
_c_funcs = {}
_py_funcs = {}
### NOTE! FP_STR SHOULD PROBABLY ALWAYS DO A PYTHON STR() CONVERSION ON ARGS
### IN CASE THEY ARE "LAZY OBJECTS". ACCELLERATOR DOESN'T DO THIS (YET)
__all__ = list(filter(None,'''
fp_str
unicode2... |
Ivoz/pip | refs/heads/develop | pip/_vendor/colorama/__init__.py | 450 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
from .initialise import init, deinit, reinit
from .ansi import Fore, Back, Style
from .ansitowin32 import AnsiToWin32
VERSION = '0.2.7'
|
YuxuanLing/trunk | refs/heads/master | trunk/code/study/python/Fluent-Python-example-code/attic/control/guido/guido0.py | 1 | """
Exemplo adaptado da mensagem do Guido van Rossum em:
https://groups.google.com/forum/#!msg/python-tulip/bmphRrryuFk/aB45sEJUomYJ
http://bit.ly/yieldfrom
>>> principal(ger1())
OK
42
Visualização no PythonTutor: http://goo.gl/FQWq2F
"""
def ger1():
val = yield 'OK'
print(val)
... |
madslonnberg/blog | refs/heads/master | node_modules/pygmentize-bundled/vendor/pygments/scripts/find_error.py | 117 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Lexing error finder
~~~~~~~~~~~~~~~~~~~
For the source files given on the command line, display
the text where Error tokens are being generated, along
with some context.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:licens... |
tedi3231/openerp | refs/heads/master | openerp/pooler.py | 61 | # -*- coding: utf-8 -*-
##############################################################################
#
# 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... |
kosgroup/odoo | refs/heads/10.0 | addons/calendar/models/__init__.py | 23 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import ir_attachment
import ir_http
import res_partner
import mail_message
import calendar
|
anntzer/scikit-learn | refs/heads/main | sklearn/covariance/tests/test_robust_covariance.py | 16 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Virgile Fritsch <virgile.fritsch@inria.fr>
#
# License: BSD 3 clause
import itertools
import numpy as np
from sklearn.utils._testing import assert_array_almost_equal
from sklearn.utils._testi... |
ric2b/Vivaldi-browser | refs/heads/master | chromium/chrome/PRESUBMIT.py | 4 | # Copyright (c) 2011 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.
"""Presubmit script for changes affecting chrome/
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the... |
jamesfolberth/jupyterhub_AWS_deployment | refs/heads/master | notebooks/data8_notebooks/project1/tests/q22.py | 4 | test = {
'name': 'Question',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
>>> income_raw.labels == income_by_zipcode.labels
True
""",
'hidden': False,
'locked': False
},
],
'scored': True,
'setup': '',
... |
tkanemoto/kombu | refs/heads/master | examples/complete_send.py | 31 | """
Example producer that sends a single message and exits.
You can use `complete_receive.py` to receive the message sent.
"""
from kombu import Connection, Producer, Exchange, Queue
#: By default messages sent to exchanges are persistent (delivery_mode=2),
#: and queues and exchanges are durable.
exchange = Exchan... |
farseerri/git_code | refs/heads/master | tests/system/suite_tools/tst_codepasting/test.py | 2 | #############################################################################
##
## Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
## Contact: http://www.qt-project.org/legal
##
## This file is part of Qt Creator.
##
## Commercial License Usage
## Licensees holding valid commercial Qt licenses may use this f... |
neerajvashistha/pa-dude | refs/heads/master | lib/python2.7/site-packages/sphinx/pycode/pgen2/grammar.py | 7 | # Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""This module defines the data structures used to represent a grammar.
These are a bit arcane because they are derived from the data
structures used by Python's 'pgen' parser generator.
There's also ... |
camptocamp/ngo-addons-backport | refs/heads/master | openerp/tools/sql.py | 455 | # -*- coding: utf-8 -*-
##############################################################################
#
# 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... |
WangDequan/kaggle-ndsb | refs/heads/master | configurations/bagging_03_convroll4_big_wd_maxout512.py | 6 | import numpy as np
import theano
import theano.tensor as T
import lasagne as nn
import data
import load
import nn_plankton
import dihedral
import dihedral_fast
import tmp_dnn
import tta
validation_split_path = "splits/bagging_split_3.pkl"
patch_size = (95, 95)
augmentation_params = {
'zoom_range': (1 / 1.6,... |
nccgroup/umap2 | refs/heads/master | umap2/apps/base.py | 1 | '''
Umap2 applications should subclass the Umap2App.
'''
import sys
import os
import importlib
import logging
import docopt
from serial import Serial, PARITY_NONE
from umap2.phy.facedancer.max342x_phy import Max342xPhy
from umap2.phy.gadgetfs.gadgetfs_phy import GadgetFsPhy
from umap2.utils.ulogger import set_default_... |
sstocker46/pyrobotlab | refs/heads/master | toSort/inMoovTalkMovement.py | 5 | from time import sleep
inMoov = Runtime.createAndStart("inMoov", "InMoov")
inMoov.initialize("left","atmega1280","COM7")
inMoov.initialize("right","uno","COM8")
inMoov.initializeHead("left")
inMoov.eye.setCameraIndex(1)
inMoov.tracking.calibrate()
inMoov.systemCheck()
def heard():
data = msg_ear_recognized.data[0]... |
oudalab/phyllo | refs/heads/master | phyllo/extractors/mayDB.py | 1 | import sqlite3
import urllib
import re
from urllib.request import urlopen
from bs4 import BeautifulSoup, NavigableString
from phyllo.phyllo_logger import logger
import nltk
from itertools import cycle
nltk.download('punkt')
from nltk import sent_tokenize
s1=[]
def parseRes2(soup, title, url, cur, author, date, collec... |
izonder/intellij-community | refs/heads/master | python/testData/inspections/importFromModule/foo/bar_after.py | 83 | from importFromModule.foo import baz
baz.quux() |
Jamlum/pytomo | refs/heads/master | pytomo/cdfplot_new.py | 2 | #!/usr/bin/env python
"Module to plot cdf from data or file. Can be called directly."
from __future__ import division, print_function
#from optparse import OptionParser
import sys
# AO 201221010 (due to error in win) =>
try:
import numpy as np
except ImportError:
np = None
# in case of non-interactive usage
#... |
miguelpalacio/python-for-android | refs/heads/master | python-build/python-libs/gdata/build/lib/atom/http.py | 136 | #!/usr/bin/python
#
# Copyright (C) 2008 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 ... |
xiangel/hue | refs/heads/master | apps/zookeeper/src/zookeeper/__init__.py | 1198 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
k-j-m/Pyxon | refs/heads/master | pyxon/decode2.py | 1 | # Dict of the form:
# {cls: {name:(fn, inv_fn)}}
# cls: class that has been written with @cprop annotations
# name: class attribute name
# fn: function to turn json data into the corresponding attribute type
# inv_fn: inverse of fn
class_props = {}
# Dict of the form:
# {AbstractClass:specifier_property}
# Abst... |
blitzmann/Pyfa | refs/heads/master | gui/builtinViewColumns/capacitorUse.py | 2 | # =============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of pyfa.
#
# pyfa 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 ... |
eXcomm/cjdns | refs/heads/master | node_build/dependencies/libuv/build/gyp/test/win/gyptest-link-large-pdb.py | 218 | #!/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 msvs_large_pdb works correctly.
"""
import TestGyp
import struct
import sys
CHDIR = 'large-pdb'
def CheckImageAndPdb(tes... |
goliveirab/odoo | refs/heads/8.0 | addons/l10n_ar/__openerp__.py | 260 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Cubic ERP - Teradata SAC (<http://cubicerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the... |
christophlsa/odoo | refs/heads/8.0 | 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()
|
skidzen/grit-i18n | refs/heads/master | grit/gather/policy_json_unittest.py | 60 | #!/usr/bin/env python
# Copyright (c) 2011 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.
'''Unit tests for grit.gather.policy_json'''
import os
import re
import sys
if __name__ == '__main__':
sys.path.append(os.path.j... |
dario61081/koalixcrm | refs/heads/master | koalixcrm/crm/migrations/0049_auto_20181014_2258.py | 2 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2018-10-12 20:56
from __future__ import unicode_literals
from django.db import migrations
def reverse_func(apps, schema_editor):
return 1
def backup_identifiers(apps, schema_editor):
Position = apps.get_model("crm", "Position")
CustomerGroupTransfo... |
aequitas/CouchPotato | refs/heads/master | library/mako/template.py | 13 | # template.py
# Copyright (C) 2006, 2007, 2008, 2009, 2010 Michael Bayer
# mike_mp@zzzcomputing.com
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Provides the Template class, a facade for parsing, generating and executing
template strings... |
oceanobservatories/mi-instrument | refs/heads/master | mi/dataset/driver/ctdbp_p/ctdbp_p_recovered_driver.py | 7 | #!/usr/bin/env python
"""
@package mi.dataset.driver.ctdbp_p
@file mi-dataset/mi/dataset/driver/ctdbp_p/ctdbp_p_recovered_driver.py
@author Jeff Roy, Rene Gelinas
@brief Driver for the ctdbp_p instrument (Recovered Data)
Release notes:
Initial Release
"""
from mi.dataset.dataset_driver import SimpleDatasetDriver
fr... |
warner83/micropython | refs/heads/master | tests/pyb/led.py | 48 | import pyb
from pyb import LED
for i in range(4):
print(LED(i+1))
for i in range(4):
LED(i+1).on()
pyb.delay(10)
for i in range(4):
LED(i+1).off()
pyb.delay(10)
for i in range(4):
LED(i+1).toggle()
pyb.delay(10)
for i in range(4):
LED(i+1).intensity(0)
for i in range(256):
LED(4).intensity(i)... |
xindaya/bazel | refs/heads/master | third_party/py/gflags/tests/gflags_unittest.py | 100 | #!/usr/bin/env python
# Copyright (c) 2007, 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 l... |
huard/scipy-work | refs/heads/master | scipy/special/tests/test_basic.py | 1 | #this program corresponds to special.py
### Means test is not done yet
#E Means test is giving error (E)
#F Means test is failing (F)
#EF Means test is giving error and Failing
#! Means test is segfaulting
#8 Means test runs forever
### test_besselpoly
### test_jnjnp_zeros
### test_mathieu_a
### test_mat... |
wpoely86/easybuild-framework | refs/heads/develop | easybuild/toolchains/intelcuda.py | 1 | ##
# Copyright 2013-2016 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... |
Celedhrim/persomov | refs/heads/master | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/tvp.py | 18 | from __future__ import unicode_literals
from .common import InfoExtractor
class TvpIE(InfoExtractor):
IE_NAME = 'tvp.pl'
_VALID_URL = r'https?://www\.tvp\.pl/.*?wideo/(?P<date>\d+)/(?P<id>\d+)'
_TEST = {
'url': 'http://www.tvp.pl/warszawa/magazyny/campusnews/wideo/31102013/12878238',
'md... |
uranusjr/django | refs/heads/master | django/db/backends/utils.py | 5 | import datetime
import decimal
import functools
import hashlib
import logging
from time import time
from django.conf import settings
from django.db.utils import NotSupportedError
from django.utils.encoding import force_bytes
from django.utils.timezone import utc
logger = logging.getLogger('django.db.backends')
clas... |
MER-GROUP/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/conf/locale/th/formats.py | 433 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# 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 = 'G:i:s'
DATETIME_FORMAT = 'j F Y, G:i:s'
YEAR_MONTH_... |
ericfc/django | refs/heads/master | tests/admin_scripts/app_raising_warning/models.py | 391 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core import checks
from django.db import models
class ModelRaisingMessages(models.Model):
@classmethod
def check(self, **kwargs):
return [
checks.Warning(
'A warning',
hint=None,
... |
hackcyprus/jobber | refs/heads/master | jobber/script.py | 1 | """
jobber.script
~~~~~~~~~~~~~
Script utilities.
"""
import sys
from jobber.factory import create_app
from jobber.database import db
def run(main, *args):
"""Runs the script in an application context and manages the session cycle.
:param main: A function to run.
:param *args: Positional arguments to t... |
sarojaerabelli/HVGS | refs/heads/master | CareerTinderServer/CareerTinder/migrations/0007_merge_20160918_0247.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-18 06:47
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('CareerTinder', '0005_relations_status'),
('CareerTinder', '0006_auto_20160918_0224'),
]
... |
low-sky/spectral-cube | refs/heads/master | spectral_cube/__init__.py | 4 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from ._astropy_init import __version__, test
from pkg_resources import get_distribution, DistributionNotFound
from .spectral_cube import (SpectralCube, VaryingResolutionSpectralCube)
from .dask_spectral_cube import (DaskSpectralCube, DaskVaryingResoluti... |
zhantyzgz/polaris | refs/heads/master | run.py | 1 | from core import bot
bot.start()
|
vlukes/sfepy | refs/heads/work | sfepy/discrete/common/extmods/setup.py | 4 | #!/usr/bin/env python
def configuration(parent_package='', top_path=None):
import os.path as op
from numpy.distutils.misc_util import Configuration
from sfepy import Config
site_config = Config()
system = site_config.system()
os_flag = {'posix' : 0, 'windows' : 1}[system]
auto_dir = op.d... |
openplans/planbox | refs/heads/staging | src/custom_domains/middleware.py | 4 | from django.conf import settings
from django.http import Http404
from custom_domains.models import DomainMapping, DefaultDomainMapping
class CustomDomainResolvingMiddleware(object):
def process_request(self, request):
# Get the domain. If it's one of our explicitly known domains, then
# proceed as... |
daviwesley/Empire | refs/heads/master | lib/modules/situational_awareness/network/sharefinder.py | 10 | from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Invoke-ShareFinder',
'Author': ['@harmj0y'],
'Description': ('Finds shares on machines in the domain.'),
'Background' : True,
'Outpu... |
ualikhansars/Gwent | refs/heads/master | lib/python2.7/site-packages/django/http/utils.py | 372 | """
Functions that modify an HTTP request or response in some way.
"""
# This group of functions are run as part of the response handling, after
# everything else, including all response middleware. Think of them as
# "compulsory response middleware". Be careful about what goes here, because
# it's a little fiddly to ... |
OliverCole/ZeroNet | refs/heads/master | plugins/PeerDb/PeerDbPlugin.py | 1 | import time
import sqlite3
import random
import atexit
import gevent
from Plugin import PluginManager
@PluginManager.registerTo("ContentDb")
class ContentDbPlugin(object):
def __init__(self, *args, **kwargs):
atexit.register(self.saveAllPeers)
super(ContentDbPlugin, self).__init__(*args, **kwargs... |
carlmw/oscar-wager | refs/heads/master | django/db/backends/mysql/creation.py | 311 | from django.db.backends.creation import BaseDatabaseCreation
class DatabaseCreation(BaseDatabaseCreation):
# This dictionary maps Field objects to their associated MySQL column
# types, as strings. Column-type strings can contain format strings; they'll
# be interpolated against the values of Field.__dict_... |
zygmuntz/pybrain | refs/heads/master | examples/rl/environments/cartpole/cart_reinf.py | 30 | #!/usr/bin/env python
#########################################################################
# Reinforcement Learning with REINFORCE on the CartPoleEnvironment
#
# Requirements: pylab (for plotting only). If not available, comment the
# last 3 lines out
##############################################################... |
sh4t/Sick-Beard | refs/heads/development | bs4/builder/_html5lib.py | 423 | __all__ = [
'HTML5TreeBuilder',
]
import warnings
from bs4.builder import (
PERMISSIVE,
HTML,
HTML_5,
HTMLTreeBuilder,
)
from bs4.element import NamespacedAttribute
import html5lib
from html5lib.constants import namespaces
from bs4.element import (
Comment,
Doctype,
NavigableStr... |
CSC301H-Fall2013/JuakStore | refs/heads/master | site-packages/django/contrib/gis/sitemaps/kml.py | 482 | from django.core import urlresolvers
from django.contrib.sitemaps import Sitemap
from django.contrib.gis.db.models.fields import GeometryField
from django.db import models
class KMLSitemap(Sitemap):
"""
A minimal hook to produce KML sitemaps.
"""
geo_format = 'kml'
def __init__(self, locations=Non... |
duhzecca/cinder | refs/heads/master | cinder/volume/drivers/lenovo/lenovo_fc.py | 14 | # Copyright 2014 Objectif Libre
# Copyright 2015 DotHill Systems
#
# 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
#
# U... |
white-lab/pyproteome | refs/heads/master | pyproteome/motifs/neighborhood.py | 1 |
from matplotlib import pyplot as plt
from scipy import stats
from . import motif, plogo
def enriched_neighborhood(
data,
f,
residues,
nmer_length=7,
count_cutoff=2,
mods=None,
):
'''
Calculates the hypergeometric enrichment value for the number of
adjacent residues within a given... |
andela-ifageyinbo/django | refs/heads/master | tests/auth_tests/settings.py | 331 | import os
from django.utils._os import upath
AUTH_MIDDLEWARE_CLASSES = [
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
]
AUTH_TEMPLATES = [{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(os.path... |
bioasp/meneco | refs/heads/master | meneco/__init__.py | 1 | # Copyright (c) 2012, Sven Thiele <sthiele78@gmail.com>
#
# This file is part of meneco.
#
# meneco 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 la... |
amuzhou/imbox | refs/heads/master | imbox/utils.py | 4 | from __future__ import unicode_literals
from six import PY3
import logging
logger = logging.getLogger(__name__)
if PY3:
def str_encode(value='', encoding=None, errors='strict'):
logger.debug("Encode str {} with and errors {}".format(value, encoding, errors))
return str(value, encoding, errors)
... |
brianjgeiger/osf.io | refs/heads/develop | scripts/analytics/institution_summary.py | 15 | import django
django.setup()
import pytz
import logging
from dateutil.parser import parse
from datetime import datetime, timedelta
from django.db.models import Q
from django.utils import timezone
from framework.encryption import ensure_bytes
from osf.models import Institution
from website.app import init_app
from sc... |
ryanahall/django | refs/heads/master | django/contrib/redirects/apps.py | 590 | from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class RedirectsConfig(AppConfig):
name = 'django.contrib.redirects'
verbose_name = _("Redirects")
|
richardfrey86/progress-bars-assignment | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py | 2710 | # 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.
"""Visual Studio user preferences file writer."""
import os
import re
import socket # for gethostname
import gyp.common
import gyp.easy_xml as easy_xml
#------... |
ghostrong/py-leveldb | refs/heads/master | test/test.py | 42 | #!/usr/bin/python
# Copyright (c) Arni Mar Jonsson.
# See LICENSE for details.
import sys, string, unittest, itertools
class TestLevelDB(unittest.TestCase):
def setUp(self):
# import local leveldb
import leveldb as _leveldb
self.leveldb = _leveldb
dir(self.leveldb)
# Python2/3 compat
if ... |
taohungyang/cloud-custodian | refs/heads/master | tests/test_elasticache.py | 1 | # Copyright 2016-2017 Capital One Services, 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 agreed ... |
nhomar/odoo-mirror | refs/heads/8.0 | doc/_themes/odoodoc/github.py | 34 | import inspect
import importlib
import os.path
from urlparse import urlunsplit
import sphinx
def setup(app):
app.add_config_value('github_user', None, 'env')
app.add_config_value('github_project', None, 'env')
app.connect('html-page-context', add_doc_link)
def linkcode_resolve(domain, info):
"... |
ZetDude/KALEVBOT | refs/heads/master | cogs/fun.py | 1 | """Fun commands that don't do anything really productive
night, thank, shipname, shipcount, ship, hug, pecan, fortune"""
# -*- coding: utf-8 -*-
import pickle
import random
import sqlite3 as lite
import subprocess
import discord
from discord.ext import commands
from lib import shipname_module as improved_shipname, ... |
maartenq/ansible | refs/heads/devel | lib/ansible/modules/cloud/vmware/vca_fw.py | 104 | #!/usr/bin/python
# Copyright: (c) 2015, VMware, Inc. All Rights Reserved.
# 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 = {'metadata_version': '1.1',
... |
upsuper/servo | refs/heads/master | tests/wpt/web-platform-tests/service-workers/service-worker/resources/import-scripts-version.py | 48 | import datetime
import time
epoch = datetime.datetime(1970, 1, 1)
def main(req, res):
# Artificially delay response time in order to ensure uniqueness of
# computed value
time.sleep(0.1)
now = (datetime.datetime.now() - epoch).total_seconds()
return ([
('Cache-Control', 'no-cache, must-r... |
cyberark-bizdev/ansible | refs/heads/devel | test/units/modules/monitoring/test_circonus_annotation.py | 57 | # -*- coding: utf-8 -*-
import io
import json
import re
import uuid
from urllib3.response import HTTPResponse
from ansible.compat.tests.mock import patch
from ansible.module_utils import basic
from ansible.module_utils._text import to_bytes
from ansible.modules.monitoring import circonus_annotation
from units.modules... |
Orochimarufan/youtube-dl | refs/heads/master | youtube_dl/extractor/douyutv.py | 51 | # coding: utf-8
from __future__ import unicode_literals
import time
import hashlib
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
unescapeHTML,
unified_strdate,
urljoin,
)
class DouyuTVIE(InfoExtractor):
IE_DESC = '斗鱼'
_VALID_URL = r'https?://(?:www\.)?douy... |
adhoc-dev/purchase-workflow | refs/heads/8.0 | purchase_requisition_bid_selection/tests/__init__.py | 20 | # -*- coding: utf-8 -*-
from . import test_cancel_purchase_requisition
from . import test_generate_po
from . import test_purchase_requisition_line
|
kerneltask/micropython | refs/heads/master | examples/bluetooth/ble_temperature_central.py | 2 | # This example finds and connects to a BLE temperature sensor (e.g. the one in ble_temperature.py).
import bluetooth
import random
import struct
import time
import micropython
from ble_advertising import decode_services, decode_name
from micropython import const
_IRQ_CENTRAL_CONNECT = const(1)
_IRQ_CENTRAL_DISCONNE... |
ORTI3D/ORTI3D_code | refs/heads/master | iliblast/Opgeo.py | 1 | # -*- coding: utf-8 -*-
"""
Created on Wed Aug 26 21:52:19 2015
@author: olive
"""
from geometry import *
import os
class Opgeo:
def __init__(self, core):
self.core = core
def buildMesh(self,nlay=1):
if self.core.dicval['OpgeoFlow']['domn.1'][0]==0:
nx,ny,xv,yv = get... |
dtaht/ns-3-dev | refs/heads/master | src/core/examples/sample-rng-plot.py | 188 | # -*- Mode:Python; -*-
# /*
# * 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 useful,
# * but WITHOUT ANY WARRA... |
chaosmaker/pyload | refs/heads/stable | module/lib/thrift/server/TNonblockingServer.py | 83 | #
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.