repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
azverkan/scons | refs/heads/master | src/engine/SCons/Scanner/IDLTests.py | 3 | #
# __COPYRIGHT__
#
# 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, publish,
# distribute, sublicen... |
Qgap/zulip | refs/heads/master | zilencer/management/commands/populate_db.py | 114 | from __future__ import absolute_import
from django.core.management.base import BaseCommand
from django.utils.timezone import now
from django.contrib.sites.models import Site
from zerver.models import Message, UserProfile, Stream, Recipient, Client, \
Subscription, Huddle, get_huddle, Realm, UserMessage, \
get... |
Southpaw-TACTIC/Team | refs/heads/master | src/python/Tools/Scripts/methfix.py | 12 | #! /usr/bin/env python
# Fix Python source files to avoid using
# def method(self, (arg1, ..., argn)):
# instead of the more rational
# def method(self, arg1, ..., argn):
#
# Command line arguments are files or directories to be processed.
# Directories are searched recursively for files whose name... |
sbalde/edx-platform | refs/heads/master | openedx/core/lib/api/parsers.py | 92 | from rest_framework import parsers
class MergePatchParser(parsers.JSONParser):
"""
Custom parser to be used with the "merge patch" implementation (https://tools.ietf.org/html/rfc7396).
"""
media_type = 'application/merge-patch+json'
|
Curious72/sympy | refs/heads/master | sympy/physics/unitsystems/tests/test_dimensions.py | 92 | # -*- coding: utf-8 -*-
from sympy import sympify
from sympy.physics.unitsystems.dimensions import Dimension
from sympy.utilities.pytest import raises
def test_definition():
length = Dimension(name="length", symbol="L", length=1)
assert length.get('length') == 1
assert length.get('time') is None
as... |
brion/cerbero | refs/heads/osx-fixes | cerbero/packages/wix.py | 23 | # cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... |
eneldoserrata/marcos_openerp | refs/heads/master | addons/account_budget/__init__.py | 444 | # -*- 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... |
payal97/portal | refs/heads/develop | systers_portal/meetup/tests/test_constants.py | 2 | from django.test import TestCase
from meetup.constants import (COMMUNITY_MEMBER, COMMUNITY_MODERATOR, LOCATION_ALREADY_EXISTS_MSG,
SLUG_ALREADY_EXISTS_MSG, NAME_ALREADY_EXISTS_MSG,
LOCATION_ALREADY_EXISTS, SLUG_ALREADY_EXISTS,
NA... |
macauleycheng/AOS_OF_Example | refs/heads/master | 00-table-group-unit-test/15-L3_Mcast_Group/StartScript.py | 31 | #*********************************************************************
#
# (C) Copyright Broadcom Corporation 2013-2014
#
# 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
#
# htt... |
jiajiechen/mxnet | refs/heads/master | python/mxnet/gluon/model_zoo/__init__.py | 61 | # 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... |
jigarkb/CTCI | refs/heads/master | LeetCode/246-E-StrobogrammaticNumber.py | 2 | # A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down).
#
# Write a function to determine if a number is strobogrammatic. The number is represented as a string.
#
# For example, the numbers "69", "88", and "818" are all strobogrammatic.
class Solution(object):
... |
bitcoinplusorg/xbcwalletsource | refs/heads/master | contrib/devtools/clang-format-diff.py | 90 | #!/usr/bin/env python
#
#===- clang-format-diff.py - ClangFormat Diff Reformatter ----*- python -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License.
#
# ===========================================================... |
quinot/ansible | refs/heads/devel | lib/ansible/modules/network/f5/bigip_provision.py | 23 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks 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',
... |
EvanK/ansible | refs/heads/devel | test/units/plugins/connection/test_netconf.py | 44 | #
# (c) 2016 Red Hat 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 is d... |
dimdung/boto | refs/heads/develop | boto/pyami/__init__.py | 396 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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, modi... |
Tuxemon/Tuxemon-Server | refs/heads/master | tuxemon_server/__init__.py | 1 |
class Server(object):
def __init__(self):
pass
|
cute/pyopencc | refs/heads/master | pyopencc/__init__.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from opencc import OpenCC
__doc__ = 'OpenCC Python binding'
__version__ = '0.4.2'
__all__ = ['OpenCC', ]
|
nan86150/ImageFusion | refs/heads/master | lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.py | 527 | # Copyright 2014 Donald Stufft
#
# 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... |
somchaisomph/RPI.GPIO.TH | refs/heads/master | gadgets/navigators/accelerometer.py | 1 | from spi.rpi_spi import rpi_spi_dev
from spi.adc.MCP3208 import MCP3208
class ACCEL_GY61():
# use chip ADXL335
def __init__(self,device=0,x_channel=0,y_channel=1,z_channel=2):
self.spi = rpi_spi_dev(device).spi
self.mcp = None
if self.spi is not None:
self.mcp = MCP3208(self.spi)
self.vrx_channel = x_cha... |
selivan/ansible-modules-core | refs/heads/devel | cloud/amazon/elasticache.py | 16 | #!/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... |
wonder-sk/QGIS | refs/heads/master | python/plugins/processing/algs/lidar/fusion/GridSurfaceCreate.py | 5 | # -*- coding: utf-8 -*-
"""
***************************************************************************
GridSurfaceCreate.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
-----------------... |
JensMunkHansen/sofus | refs/heads/master | fnm/test_calc_hp.py | 1 | import addpaths
import numpy as np
import sys
import swig_fnm as lib
import numpy as np
from scipy.signal import hilbert
from fnm import (rect,linear_array)
from timeit import default_timer as timer
import matplotlib.pyplot as plt
plt.ion()
def create_time_string(seconds):
m, s = divmod(seconds, 60)
h, m = div... |
gotcha/Selenium2Library | refs/heads/master | src/Selenium2Library/locators/__init__.py | 7 | from elementfinder import ElementFinder
from tableelementfinder import TableElementFinder
from windowmanager import WindowManager
from customlocator import CustomLocator
__all__ = [
"ElementFinder",
"TableElementFinder",
"WindowManager",
"CustomLocator"
]
|
DrOctogon/Satchmo | refs/heads/master | satchmo/apps/satchmo_ext/wishlist/urls.py | 5 | """
Urls for wishlists, note that this does not have to get added manually to the urls, it will be added automatically by satchmo core if this app is installed.
"""
from django.conf.urls import *
from livesettings import config_value
import logging
log = logging.getLogger('wishlist.urls')
urlpatterns = patterns('satc... |
mikemow/youtube-dl | refs/heads/master | youtube_dl/extractor/pbs.py | 64 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
determine_ext,
int_or_none,
unified_strdate,
US_RATINGS,
)
class PBSIE(InfoExtractor):
_VALID_URL = r'''(?x)https?://
(?:
# Direct vide... |
linkitspa/l10n-italy | refs/heads/10.0 | l10n_it_fatturapa_pec/tests/test_e_invoice_send.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2018 Simone Rubino - Agile Business Group
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.exceptions import UserError
from .e_invoice_common import EInvoiceCommon
class TestEInvoiceSend(EInvoiceCommon):
def setUp(self):
super(TestEInvoic... |
gmjosack/getotp | refs/heads/master | getotp/version.py | 16 | __version__ = "0.0.3"
|
mutilx9/trackma | refs/heads/master | trackma/engine.py | 1 | # This file is part of wMAL.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the ho... |
andymckay/django | refs/heads/master | django/middleware/locale.py | 104 | "This is the locale selecting middleware that will look at accept headers"
from django.conf import settings
from django.core.urlresolvers import (is_valid_path, get_resolver,
LocaleRegexURLResolver)
from django.http import HttpResponseRedirect
from django.utils.cache import patch_... |
adw0rd/lettuce | refs/heads/master | tests/integration/lib/Django-1.3/django/conf/locale/gl/formats.py | 322 | # -*- 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 = 'd F Y'
TIME_FORMAT = 'H:i:s'
# DATETIME_FORMAT =
YEAR_MONTH_FORMAT = 'F ... |
jhajek/euca2ools | refs/heads/master | euca2ools/commands/ec2/resumeimport.py | 3 | # Copyright 2014 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software in source and binary forms,
# with or without modification, are permitted provided that the following
# conditions are met:
#
# Redistributions of source code must retain the above copyright notice,
# this list of conditions and t... |
agconti/Shopify-Django | refs/heads/master | venv/lib/python2.7/site-packages/django/conf/locale/ar/formats.py | 234 | # -*- 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 = 'g:i:s A'
#... |
alanthai/django-guardian | refs/heads/master | guardian/tests/managers_test.py | 27 | from __future__ import unicode_literals
from django.test import TestCase
from guardian.managers import UserObjectPermissionManager
from guardian.managers import GroupObjectPermissionManager
import mock
class TestManagers(TestCase):
def test_user_manager_assign(self):
manager = UserObjectPermissionManager... |
gauravjns/taiga-back | refs/heads/master | taiga/users/services.py | 1 | # Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.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 F... |
alex-march/micropython | refs/heads/master | tests/basics/string_cr_conversion.py | 113 | # this file has CR line endings to test lexer's conversion of them to LF
# in triple quoted strings
print(repr("""abc
def"""))
|
sserrot/champion_relationships | refs/heads/master | venv/Lib/site-packages/PIL/ImageShow.py | 1 | #
# The Python Imaging Library.
# $Id$
#
# im.show() drivers
#
# History:
# 2008-04-06 fl Created
#
# Copyright (c) Secret Labs AB 2008.
#
# See the README file for information on usage and redistribution.
#
import os
import shutil
import subprocess
import sys
import tempfile
from shlex import quote
from PIL import ... |
WorldViews/Spirals | refs/heads/master | KinPy/KinOSCWatcher.py | 2 |
import os, socket, time
import threading
#import MessageBoard
import traceback
import OSC
OSC_SERVER = None
ALL_JOINTS = {
'HandRight': 'RIGHT_HAND',
'HandLeft': 'LEFT_HAND',
'WristRight': 'RIGHT_WRIST',
'WristLeft': 'LEFT_WRIST',
'ElbowRight': 'RIGHT_ELBOW',
'ElbowLeft': 'LEFT_ELBOW',
'Shoulder... |
NMGRL/pychron | refs/heads/develop | pychron/pyscripts/context_editors/measurement_context_editor.py | 2 | # ===============================================================================
# Copyright 2014 Jake Ross
#
# 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... |
dexy/cashew | refs/heads/master | tests/test_cashew.py | 1 | from cashew.exceptions import InternalCashewException
from cashew.exceptions import UserFeedback
from cashew.plugin import Plugin, PluginMeta
from example.classes2 import Csv
from six import add_metaclass
from six import with_metaclass
import example.classes
class Data(example.classes.Data):
"""
Docstring goes... |
chongtianfeiyu/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/tty.py | 525 | """Terminal utilities."""
# Author: Steen Lumholt.
from termios import *
__all__ = ["setraw", "setcbreak"]
# Indexes for termios list.
IFLAG = 0
OFLAG = 1
CFLAG = 2
LFLAG = 3
ISPEED = 4
OSPEED = 5
CC = 6
def setraw(fd, when=TCSAFLUSH):
"""Put terminal into a raw mode."""
mode = tcgetattr(fd)
mode[IFLAG... |
pixbuffer/django-cms | refs/heads/pixbuffer | cms/test_utils/tmpdir.py | 100 | # -*- coding: utf-8 -*-
from contextlib import contextmanager
from tempfile import mkdtemp
import os
import random
import shutil
import stat
@contextmanager
def temp_dir():
name = make_temp_dir()
yield name
shutil.rmtree(name)
def make_temp_dir():
if os.path.exists('/dev/shm/'):
if os.stat('/... |
hunse/kitti | refs/heads/master | kitti/bp/__init__.py | 2 | from module import interp, stereo
|
pathomx/pathomx | refs/heads/master | pathomx/plugins/multivariate/loader.py | 2 | # -*- coding: utf-8 -*-
from pathomx.plugins import AnalysisPlugin
import pathomx.ui as ui
from pathomx.data import DataDefinition
from pathomx.qt import *
# Dialog box for Metabohunter search options
class PLSDAConfigPanel(ui.ConfigPanel):
def __init__(self, *args, **kwargs):
super(PLSDAConfigPanel, ... |
nabsboss/CouchPotatoServer | refs/heads/develop | libs/git/__init__.py | 121 | # Copyright (c) 2009, Rotem Yaari <vmalloc@gmail.com>
# 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 li... |
akx/shoop | refs/heads/master | shoop/core/utils/tax_numbers.py | 1 | # -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from .vat import VatCannotIdentify... |
handroissuazo/tensorflow | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/html5lib/filters/whitespace.py | 353 | from __future__ import absolute_import, division, unicode_literals
import re
from . import base
from ..constants import rcdataElements, spaceCharacters
spaceCharacters = "".join(spaceCharacters)
SPACES_REGEX = re.compile("[%s]+" % spaceCharacters)
class Filter(base.Filter):
spacePreserveElements = frozenset([... |
daniLOLZ/variaRoba | refs/heads/master | Python/19.py | 1 | import requests
from bs4 import BeautifulSoup
f = open('19.out.txt', 'w')
url = "http://www.vanityfair.com/style/society/2014/06/monica-lewinsky-humiliation-culture"
page = requests.get(url)
sup = BeautifulSoup(page.text, "html.parser")
sections = sup.find_all(class_="content-section")
print(type(secti... |
mgdevereux/unicorn-hat | refs/heads/master | python/ws2812/setup.py | 2 | #!/usr/bin/env python
from setuptools import setup, find_packages, Extension
cpu = open('/proc/cpuinfo','r').read()
define = []
if 'ARMv7' in cpu:
define = [('RPI2',''),('PERI_BASE','0x3F000000')]
_ws2812 = Extension(
'_ws2812',
define_macros = define,
library_dirs=[
'lib/'
],
include_dirs=[
'lib/'
],
... |
LLNL/spack | refs/heads/develop | var/spack/repos/builtin/packages/snphylo/package.py | 5 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Snphylo(Package):
"""A pipeline to generate a phylogenetic tree from huge SNP data"""
... |
pjuren/pyokit | refs/heads/master | src/pyokit/scripts/overlapProfile.py | 1 | #!/usr/bin/python
"""
Date of Creation: 3rd Apr 2010
Description: Script for generating a profile by piling up a set of
regions and counting the number of times another set of
intervals overlap these.
Copyright (C) 2010-2015
Philip J. Uren,
Authors: Philip J. Ur... |
eviljeff/zamboni | refs/heads/master | mkt/constants/comm.py | 3 | from tower import ugettext_lazy as _
# To add a note type:
# - assign it a incremented number (MY_NOTE_TYPE = 42)
# - give it a translation in NOTE_TYPES
# - if adding from mkt/site/log.py, add it to ACTION_MAP
# - add it to REVIEWERS_NOTE_TYPE if it should only be visible to reviewers
# - add the translation to Comm... |
amisrs/one-eighty | refs/heads/master | angular_flask/lib/python2.7/site-packages/werkzeug/exceptions.py | 316 | # -*- coding: utf-8 -*-
"""
werkzeug.exceptions
~~~~~~~~~~~~~~~~~~~
This module implements a number of Python exceptions you can raise from
within your views to trigger a standard non-200 response.
Usage Example
-------------
::
from werkzeug.wrappers import BaseRequest
... |
liangjiaxing/sympy | refs/heads/master | sympy/physics/__init__.py | 117 | """
A module that helps solving problems in physics
"""
from . import units
from .matrices import mgamma, msigma, minkowski_tensor, mdft
|
gabfl/vault | refs/heads/main | src/views/change_key.py | 1 | # Import/export view
import sys
from sqlalchemy.orm import Session
from . import menu, secrets
from .setup import get_key_input
from ..modules.carry import global_scope
from ..lib.Encryption import Encryption
from .users import validation_key_rekey
from ..models.base import Base, get_session, get_engine
from ..model... |
afaheem88/tempest_neutron | refs/heads/master | tempest/api/compute/keypairs/test_keypairs_negative.py | 3 | # Copyright 2012 OpenStack Foundation
# Copyright 2013 IBM Corp
# 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/LICE... |
pombredanne/cobbler-3 | refs/heads/master | cobbler/settings.py | 4 | """
Cobbler app-wide settings
Copyright 2006-2008, Red Hat, Inc and Others
Michael DeHaan <michael.dehaan AT gmail>
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, o... |
mccormickmichael/laurel | refs/heads/master | tests/consul/test_cf_template.py | 1 | import unittest
from scaffold.consul.consul_template import ConsulTemplate
class TestConsulTemplate(unittest.TestCase):
def test_instantiate(self):
# should pass without throwing any exceptions
ConsulTemplate('TestTemplate', 'us-west-2', 'bucket', 'prefix', 'vpc-deadbeef', '10.0.0.0/8', ['subnet... |
mukulsoni/android_kernel_samsung_ms013g | refs/heads/cm-13.0 | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... |
magicrub/MissionPlanner | refs/heads/master | Lib/site-packages/numpy/distutils/unixccompiler.py | 75 | """
unixccompiler - can handle very long argument lists for ar.
"""
import os
from distutils.errors import DistutilsExecError, CompileError
from distutils.unixccompiler import *
from numpy.distutils.ccompiler import replace_method
from numpy.distutils.compat import get_exception
if sys.version_info[0] < 3:
impor... |
isandlaTech/cohorte-3rdparty | refs/heads/master | unidecode/src/main/python/unidecode/x02f.py | 252 | data = (
'[?] ', # 0x00
'[?] ', # 0x01
'[?] ', # 0x02
'[?] ', # 0x03
'[?] ', # 0x04
'[?] ', # 0x05
'[?] ', # 0x06
'[?] ', # 0x07
'[?] ', # 0x08
'[?] ', # 0x09
'[?] ', # 0x0a
'[?] ', # 0x0b
'[?] ', # 0x0c
'[?] ', # 0x0d
'[?] ', # 0x0e
'[?] ', # 0x0f
'[?] ', # 0x10
'[?] ... |
talishte/ctigre | refs/heads/master | env/lib/python2.7/site-packages/bs4/element.py | 82 | import collections
import re
import sys
import warnings
from bs4.dammit import EntitySubstitution
DEFAULT_OUTPUT_ENCODING = "utf-8"
PY3K = (sys.version_info[0] > 2)
whitespace_re = re.compile("\s+")
def _alias(attr):
"""Alias one attribute name to another for backward compatibility"""
@property
def alias... |
kevin-zhaoshuai/zun | refs/heads/master | zun/tests/unit/db/utils.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
# d... |
luisgg/iteexe | refs/heads/master | twisted/web/util.py | 19 | # -*- test-case-name: twisted.web.test.test_web -*-
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
from cStringIO import StringIO
from twisted.python import failure
import html
import resource
import linecache
import string, re
import types
def redirectTo(URL, request):
r... |
patrickstocklin/chattR | refs/heads/master | lib/python2.7/site-packages/django/contrib/humanize/__init__.py | 808 | default_app_config = 'django.contrib.humanize.apps.HumanizeConfig'
|
robertaabreu/FatecJS | refs/heads/master | projetoTeckton/backend/appengine/routes/permission/__init__.py | 599 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
|
pombredanne/Bicho | refs/heads/master | tests/run_tests.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2012 GSyC/LibreSoft, Universidad Rey Juan Carlos
#
# 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, ... |
chenzeyu/demographic_prediction | refs/heads/master | image_classifier_lib.py | 1 | import base64
import csv
import gc
import time
try:
import cPickle as pickle
except:
import pickle
import numpy as np
from numpy import *
from sklearn.decomposition import RandomizedPCA
from sklearn.linear_model import LogisticRegression
from sklearn import cross_validation
from sklearn.metrics import accuracy... |
x303597316/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/django/contrib/formtools/wizard/storage/exceptions.py | 123 | from django.core.exceptions import ImproperlyConfigured
class MissingStorage(ImproperlyConfigured):
pass
class NoFileStorageConfigured(ImproperlyConfigured):
pass
|
sih4sing5hong5/Bleualign | refs/heads/pypi | test/test_by_eval_filter.py | 2 |
import unittest
from command_utils import load_arguments
import os
import bleualign
import io
from bleualign.align import Aligner
from test.utils import Utils
class TestByEvalFilter(unittest.TestCase, Utils):
def setUp(self):
pass
def test_originalFileName(self):
self.main_test('fileNameOptions')
def test_fil... |
40223136/20150616test1 | refs/heads/master | static/Brython3.1.0-20150301-090019/Lib/imp.py | 637 | """This module provides the components needed to build your own __import__
function. Undocumented functions are obsolete.
In most cases it is preferred you consider using the importlib module's
functionality over this module.
"""
# (Probably) need to stay in _imp
from _imp import (lock_held, acquire_lock, release_lo... |
gunan/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/array_ops_test.py | 1 | # 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... |
chepe4pi/sokoban_api | refs/heads/master | sk_skins/tests/tests.py | 1 | from rest_framework import status
from rest_framework.test import APITestCase
from faker import Faker
from sk_map.tests.factories import MapFactory
from django.utils.http import urlencode
import random
faker = Faker()
class SkinTestCase(APITestCase):
url = '/skins/'
fixtures = ['test_admin_user.json', 'base... |
r3tard/BartusBot | refs/heads/master | lib/apitools/scripts/oauth2l.py | 11 | """Command-line utility for fetching/inspecting credentials.
oauth2l (pronounced "oauthtool") is a small utility for fetching
credentials, or inspecting existing credentials. Here we demonstrate
some sample use:
$ oauth2l fetch userinfo.email bigquery compute
Fetched credentials of type:
oauth2client.cl... |
UIKit0/oom | refs/heads/master | share/pybridge/examples/addpartexample.py | 2 | """
//=========================================================
// OOMidi
// OpenOctave Midi and Audio Editor
// (C) Copyright 2009 Mathias Gyllengahm (lunar_shuttle@users.sf.net)
//=========================================================
"""
import Pyro.core
oom=Pyro.core.getProxyForURI('PYRONAME://:Default.oom')... |
postla/OpenNFR-E2 | refs/heads/master | lib/python/Components/Renderer/Pixmap.py | 125 | from Renderer import Renderer
from enigma import ePixmap
class Pixmap(Renderer):
def __init__(self):
Renderer.__init__(self)
GUI_WIDGET = ePixmap
def postWidgetCreate(self, instance):
self.changed((self.CHANGED_DEFAULT,))
def changed(self, what):
if what[0] != self.CHANGED_CLEAR:
if self.source and ha... |
MER-GROUP/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/db/models/loading.py | 308 | "Utilities for loading models and the modules that contain them."
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.datastructures import SortedDict
from django.utils.importlib import import_module
from django.utils.module_loading import module_has_submodule
im... |
resmo/ansible | refs/heads/devel | test/units/modules/network/fortios/test_fortios_firewall_interface_policy6.py | 21 | # Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... |
Lanceolata/code-problems | refs/heads/master | python/leetcode_easy/Question_844_Backspace_String_Compare.py | 1 | #!/usr/bin/python
# coding: utf-8
class Solution(object):
def backspaceCompare(self, S, T):
"""
:type S: str
:type T: str
:rtype: bool
"""
s = self.help(S)
t = self.help(T)
return s == t
def help(self, s):
stack = []
for c in s:
... |
zhangyubaka/Shadowsocks | refs/heads/master | setup.py | 929 | import codecs
from setuptools import setup
with codecs.open('README.rst', encoding='utf-8') as f:
long_description = f.read()
setup(
name="shadowsocks",
version="2.8.2",
license='http://www.apache.org/licenses/LICENSE-2.0',
description="A fast tunnel proxy that help you get through firewalls",
... |
Pafcholini/Beta_TW | refs/heads/master | 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... |
frenchfrywpepper/ansible-modules-extras | refs/heads/devel | network/ipify_facts.py | 67 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
#
# 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 Lice... |
luzheqi1987/nova-annotation | refs/heads/master | nova/tests/unit/cells/test_cells_filters.py | 1 | # Copyright (c) 2012-2013 Rackspace Hosting
# 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
#
# Unles... |
DouglasHeriot/pjproject | refs/heads/master | tests/pjsua/scripts-sendto/320_srtp2_no_crypto.py | 42 | # $Id$
import inc_sip as sip
import inc_sdp as sdp
sdp = \
"""
v=0
o=- 0 0 IN IP4 127.0.0.1
s=tester
c=IN IP4 127.0.0.1
t=0 0
m=audio 4000 RTP/SAVP 0 101
a=rtpmap:0 PCMU/8000
a=sendrecv
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
"""
args = "--null-audio --auto-answer 200 --max-calls 1 --use-srtp 2 --srtp-secur... |
carloscanova/python-odml | refs/heads/master | odml/tools/jsonparser.py | 2 | #!/usr/bin/env python
"""
The JSON import/export module.
This is rudimentary for now, assuming everything is well-formed.
"""
import odml
import json
class OdmlSerializer(object):
"""
converts the odml class hierarchy to dictionaries and lists
"""
def __init__(self, odml_document):
self.doc = o... |
Aptitudetech/ERPNext | refs/heads/master | erpnext/accounts/doctype/account/__init__.py | 37694 | from __future__ import unicode_literals
|
bdh1011/wau | refs/heads/master | venv/lib/python2.7/site-packages/zmq/backend/cffi/error.py | 24 | """zmq error functions"""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
from ._cffi import C, ffi
def strerror(errno):
s = ffi.string(C.zmq_strerror(errno))
if not isinstance(s, str):
# py3
s = s.decode()
return s
zmq_errno = C.zmq_errno
__a... |
jdehrlich/zopkio | refs/heads/master | test/samples/sample_input.py | 4 | # Copyright 2014 LinkedIn Corp.
#
# 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.... |
sanja7s/EEDC | refs/heads/master | src/network/job_nodes_network.py | 1 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
author: sanja7s
---------------
plot the distribution
"""
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
from collections import defaultdict
from matplotlib import colors
from mpl_toolkits.axes_grid import inset_loc... |
umandalroald/drupalpilipinas | refs/heads/master | sites/all/modules/contrib/proj4js/lib/proj4js/tools/closure_ws.py | 423 | #!/usr/bin/python
import httplib, urllib, sys
import time
# Define the parameters for the POST request and encode them in
# a URL-safe format.
def minimize(code):
params = urllib.urlencode([
('js_code', code),
('compilation_level', 'SIMPLE_OPTIMIZATIONS'),
('output_format', 'text'),
... |
lakshmi-kannan/st2 | refs/heads/master | st2common/st2common/models/db/sensor.py | 9 | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... |
android-ia/platform_external_skia | refs/heads/master | gm/rebaseline_server/compare_to_expectations.py | 66 | #!/usr/bin/python
"""
Copyright 2013 Google Inc.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
Repackage expected/actual GM results as needed by our HTML rebaseline viewer.
"""
# System-level imports
import argparse
import fnmatch
import json
import logging
import... |
thnee/ansible | refs/heads/devel | lib/ansible/modules/network/ovs/openvswitch_port.py | 102 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2013, David Stygstra <david.stygstra@gmail.com>
# Portions copyright @ 2015 VMware, 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
ANSI... |
mumuwoyou/vnpy | refs/heads/master | vn.lts/vnltsqry/test/lts_data_type.py | 167 | # encoding: UTF-8
defineDict = {}
typedefDict = {}
#//////////////////////////////////////////////////////////////////////
#@company shanghai liber information Technology Co.,Ltd
#@file SecurityFtdcUserApiDataType.h
#@brief 定义业务数据类型
#//////////////////////////////////////////////////////////////////////
#/////////... |
google-research/google-research | refs/heads/master | mol_dqn/chemgraph/dqn/py/__init__.py | 52 | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# 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 applicab... |
slohse/ansible | refs/heads/devel | test/units/modules/cloud/amazon/test_lambda.py | 57 | #
# (c) 2017 Michael De La Rue
#
# 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... |
glmcdona/meddle | refs/heads/master | examples/example_deviceiocontrol_all/controller.py | 1 | import sys
try:
sys.path.append("\\".join(__file__.split("\\")[0:-1]) + "\\..\\base\\Lib")
except:
print "Failed to add '.\\..\\base\\Lib' to path."
import os
try:
sys.path.append(os.path.join(os.path.dirname(__file__), "..", "base"))
except:
print "Failed to add '.\\..\\base' to path."
import subprocess
import... |
starsirius/mongoengine | refs/heads/master | tests/queryset/modify.py | 28 | import sys
sys.path[0:0] = [""]
import unittest
from mongoengine import connect, Document, IntField
__all__ = ("FindAndModifyTest",)
class Doc(Document):
id = IntField(primary_key=True)
value = IntField()
class FindAndModifyTest(unittest.TestCase):
def setUp(self):
connect(db="mongoenginetes... |
franramirez688/client | refs/heads/develop | dev/hardware/arduino/arduino_port_utils.py | 5 | import time
import serial
from serial.tools import list_ports
from biicode.common.settings.osinfo import OSInfo
from biicode.common.output_stream import Color
import platform
def _detect_arduino_port():
"""Returns a port configuration if founded due some common patterns"""
port_patterns = {"Linux": ["arduino"... |
samdoran/ansible | refs/heads/devel | lib/ansible/modules/cloud/azure/azure_rm_virtualnetwork_facts.py | 68 | #!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.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 Soft... |
Xsichtik/plugin.video.tipsport.elh | refs/heads/master | resources/lib/tipsport_stream_generator.py | 1 | # coding=utf-8
import re
import random
import json
import requests
from . import tipsport_exceptions as Exceptions
from .match import Match
from .utils import log, get_session_id_from_page
from .stream_strategy_factory import StreamStrategyFactory
COMPETITIONS = {
'CZ_TIPSPORT': [u'Česká Tipsport extraliga', u'Tip... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.