repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
xinyu7/tornado | tornado/test/concurrent_test.py | 63 | 11014 | #!/usr/bin/env python
#
# Copyright 2012 Facebook
#
# 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 a... | apache-2.0 |
yukisakurai/hhntup | higgstautau/pileup.py | 1 | 6320 | from rootpy.tree.filtering import EventFilter
from externaltools import PileupReweighting
from ROOT import Root
from . import datasets
from . import log; log = log[__name__]
# https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/InDetTrackingPerformanceGuidelines
PU_RESCALE = {
2011: (0.97, 0.01),
2012: (... | gpl-3.0 |
alexandre/quokka | quokka/tests/test_text_utils.py | 12 | 3042 | #!/usr/bin/env python
# coding: utf-8
import unittest
from quokka.utils.text import slugify, abbreviate
class TestSlug(unittest.TestCase):
def test_should_always_return_lowercase_words(self):
self.assertEquals(slugify('ALVAROJUSTEN'), 'alvarojusten')
def test_should_replace_space_with_dash(self):
... | mit |
amisrs/one-eighty | angular_flask/lib/python2.7/site-packages/sqlalchemy/sql/expression.py | 6 | 219350 | # sql/expression.py
# Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Defines the base components of SQL expression trees.
All components are derived ... | mit |
rdo-management/neutron | neutron/plugins/vmware/extensions/vnicindex.py | 22 | 1594 | # Copyright 2015 VMware, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | apache-2.0 |
BT-fgarbely/odoo | addons/purchase/company.py | 383 | 1576 | # -*- 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... | agpl-3.0 |
rismalrv/edx-platform | common/djangoapps/monitoring/signals.py | 172 | 4584 | """
Add receivers for django signals, and feed data into the monitoring system.
If a model has a class attribute 'METRIC_TAGS' that is a list of strings,
those fields will be retrieved from the model instance, and added as tags to
the recorded metrics.
"""
from django.db.models.signals import post_save, post_delete,... | agpl-3.0 |
jinmm1992/moose | framework/contrib/nsiqcppstyle/rules/RULE_3_2_H_do_not_use_underbars_for_cpp_filename.py | 43 | 1450 | """
Do not use unberbars for cpp filename.
Only alphabets, numbers can be used for a cpp filename.
== Vilolation ==
/testdir/test_1.cpp <== Violation. - is used.
/testdir1/_test1.cpp <== Violation. _ is used
== Good ==
testdir/test.cpp
testdir1/test_1.c <== Don't care. it's c file.
"""
from nsiqcp... | lgpl-2.1 |
hasteur/UAABOT | wikipedia.py | 4 | 432713 | # -*- coding: utf-8 -*-
"""
Library to get and put pages on a MediaWiki wiki.
Contents of the library (objects and functions to be used outside)
Classes:
Page(site, title): A page on a MediaWiki site
DataPage(site, title): A Page object for the data repository.
ImagePage(site, title): An image descriptor... | gpl-3.0 |
jwhonce/origin | vendor/k8s.io/kubernetes/cluster/juju/layers/kubernetes-worker/lib/charms/kubernetes/common.py | 365 | 1084 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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 appli... | apache-2.0 |
jonashagstedt/tornado | tornado/util.py | 1 | 12529 | """Miscellaneous utility functions and classes.
This module is used internally by Tornado. It is not necessarily expected
that the functions and classes defined here will be useful to other
applications, but they are documented here in case they are.
The one public-facing part of this module is the `Configurable` cl... | apache-2.0 |
ensemblr/llvm-project-boilerplate | include/llvm/test/CodeGen/SystemZ/Large/branch-range-01.py | 17 | 3201 | # Test normal conditional branches in cases where the sheer number of
# instructions causes some branches to be out of range.
# RUN: python %s | llc -mtriple=s390x-linux-gnu | FileCheck %s
# Construct:
#
# before0:
# conditional branch to after0
# ...
# beforeN:
# conditional branch to after0
# main:
# 0xffd8 ... | mit |
kytos/python-openflow | tests/unit/v0x01/test_controller2switch/test_packet_out.py | 1 | 2854 | """Packet out message tests."""
from pyof.foundation.exceptions import ValidationError
from pyof.v0x01.common.action import ActionOutput
from pyof.v0x01.common.phy_port import Port
from pyof.v0x01.controller2switch.packet_out import PacketOut
from tests.unit.test_struct import TestStruct
class TestPacketOut(TestStruc... | mit |
alexbrasetvik/Piped | contrib/manhole/piped_manhole/providers.py | 1 | 8642 | # Copyright (c) 2011, Found IT A/S and Piped Project Contributors.
# See LICENSE for details.
from twisted.application import internet, service, strports
from twisted.conch import manhole, manhole_ssh, error as conch_error
from twisted.conch.insults import insults
from twisted.conch.ssh import keys
from twisted.cred im... | mit |
aaltay/beam | learning/katas/python/Core Transforms/Flatten/Flatten/tests.py | 7 | 1218 | # 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"); y... | apache-2.0 |
jonasschnelli/bitcoin | contrib/testgen/base58.py | 8 | 3124 | # Copyright (c) 2012-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Bitcoin base58 encoding and decoding.
Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain)
'''
import has... | mit |
Mixser/django | django/template/__init__.py | 198 | 2022 | """
Django's support for templates.
The django.template namespace contains two independent subsystems:
1. Multiple Template Engines: support for pluggable template backends,
built-in backends and backend-independent APIs
2. Django Template Language: Django's own template engine, including its
built-in loaders, ... | bsd-3-clause |
kudrom/genesis2 | genesis2/plugins/install_plugins/provider.py | 1 | 8220 |
class RepositoryManager:
"""
Manages official Genesis plugin repository. ``cfg`` is :class:`genesis.config.Config`
- ``available`` - list(:class:`PluginInfo`), plugins available in the repository
- ``installed`` - list(:class:`PluginInfo`), plugins that are locally installed
- ``upgradable`` - li... | gpl-3.0 |
ToxicFrog/lancow | madcow/include/chardet/big5prober.py | 236 | 1683 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights ... | gpl-3.0 |
crdoconnor/olympia | apps/files/decorators.py | 14 | 3785 | from datetime import datetime
import functools
import commonware.log
from cache_nuggets.lib import Token
from django import http
from django.core.exceptions import ObjectDoesNotExist, PermissionDenied
from django.shortcuts import get_object_or_404
from django.utils.http import http_date
import amo
from access import... | bsd-3-clause |
KiChjang/servo | tests/wpt/web-platform-tests/tools/third_party/html5lib/html5lib/treewalkers/base.py | 156 | 7476 | from __future__ import absolute_import, division, unicode_literals
from xml.dom import Node
from ..constants import namespaces, voidElements, spaceCharacters
__all__ = ["DOCUMENT", "DOCTYPE", "TEXT", "ELEMENT", "COMMENT", "ENTITY", "UNKNOWN",
"TreeWalker", "NonRecursiveTreeWalker"]
DOCUMENT = Node.DOCUMEN... | mpl-2.0 |
dropseedlabs/configyaml | configyaml/config/nodes.py | 1 | 3286 | import re
from .base import AbstractNode
from .dict import DictNode
class WildcardDictNode(DictNode):
"""A dictionary node where nearly any key is valid
The only invalid keys are:
- an actual asterisk '*'
- a key that begins with '_'
"""
def _validate_value(self):
for key... | mit |
korex/korex-shell | gyp/pylib/gyp/sun_tool.py | 314 | 1569 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""These functions are executed via gyp-sun-tool when using the Makefile
generator."""
import fcntl
import os
import struct
import subproces... | mit |
sunlightlabs/openstates | scrapers/ar/bills.py | 2 | 9314 | import re
import csv
import urllib
import datetime
import pytz
from openstates.scrape import Scraper, Bill, VoteEvent
import lxml.html
from .common import get_slug_for_session
TIMEZONE = pytz.timezone("US/Central")
def get_utf_16_ftp_content(url):
# Rough to do this within Scrapelib, as it doesn't allow custom... | gpl-3.0 |
leorochael/odoo | addons/l10n_be_intrastat/l10n_be_intrastat.py | 258 | 7828 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Odoo, Open Source Business Applications
# Copyright (C) 2014-2015 Odoo S.A. <http://www.odoo.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... | agpl-3.0 |
ARG-TLQ/Red-DiscordBot | redbot/vendored/discord/ext/menus/__init__.py | 4 | 40800 | # -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015-2019 Rapptz
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to u... | gpl-3.0 |
thicklizard/cm-otg-patch | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
rghe/ansible | lib/ansible/plugins/action/sros.py | 21 | 3325 | #
# (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... | gpl-3.0 |
40223144/2015cdafinal | static/Brython3.1.1-20150328-091302/Lib/sre_parse.py | 630 | 29657 | #
# Secret Labs' Regular Expression Engine
#
# convert re-style regular expression to sre pattern
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support module for sre"""
# XXX: show string offset and offending ch... | gpl-3.0 |
dlazz/ansible | lib/ansible/cli/playbook.py | 5 | 8433 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# Copyright: (c) 2018, Ansible Project
# 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
import os
import stat
from ansible import c... | gpl-3.0 |
zhengwsh/InplusTrader_Linux | rqalpha/examples/rsi.py | 5 | 2028 | from rqalpha.api import *
import talib
# 在这个方法中编写任何的初始化逻辑。context对象将会在你的算法策略的任何方法之间做传递。
def init(context):
# 选择我们感兴趣的股票
context.s1 = "000001.XSHE"
context.s2 = "601988.XSHG"
context.s3 = "000068.XSHE"
context.stocks = [context.s1, context.s2, context.s3]
context.TIME_PERIOD = 14
context... | mit |
collinjackson/mojo | mojo/python/tests/bindings_structs_unittest.py | 10 | 7740 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import math
import unittest
# pylint: disable=E0611,F0401
import mojo_system
# Generated files
# pylint: disable=F0401
import regression_tests_mojom
import... | bsd-3-clause |
JT5D/Alfred-Popclip-Sublime | Sublime Text 2/Package Control/package_control/downloaders/cert_provider.py | 11 | 7500 | import os
import re
import json
import sublime
from ..console_write import console_write
from ..open_compat import open_compat, read_compat
from ..package_io import read_package_file
from ..cache import get_cache
from ..ca_certs import get_system_ca_bundle_path
from .no_ca_cert_exception import NoCaCertException
from... | gpl-2.0 |
p12tic/zeroclickinfo-fathead | lib/fathead/htmlref/parse.py | 8 | 2977 | # -*- coding: utf-8 -*-
from bs4 import BeautifulSoup
import logging
import cgi
import re
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger()
def replace_all(text, terms):
""" Replaces all terms contained
in a dict """
for _from, _to in terms.items():
text = text.replace(_from, ... | apache-2.0 |
NexusIS/cobbler | cobbler/item_package.py | 15 | 2384 | """
Copyright 2006-2009, MadHatter
Kelsey Hightower <kelsey.hightower@gmail.com>
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... | gpl-2.0 |
smn/django-cache-sweeper | myproject/settings.py | 1 | 3533 | # Django settings for myproject project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
... | bsd-3-clause |
DirtyUnicorns/android_external_chromium_org | third_party/cython/src/Cython/Compiler/TypeSlots.py | 86 | 33972 | #
# Tables describing slots in the CPython type object
# and associated know-how.
#
import Naming
import PyrexTypes
import StringEncoding
invisible = ['__cinit__', '__dealloc__', '__richcmp__',
'__nonzero__', '__bool__']
class Signature(object):
# Method slot signature descriptor.
#
# ... | bsd-3-clause |
avi-psvm-dutta/eSim | src/kicadtoNgspice/KicadtoNgspice.py | 1 | 30713 | #===============================================================================
#
# FILE: kicadtoNgspice.py
#
# USAGE: ---
#
# DESCRIPTION: This define all configuration used in Application.
#
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: F... | gpl-3.0 |
ric2b/Vivaldi-browser | chromium/third_party/blink/web_tests/external/wpt/tools/third_party/pluggy/testing/test_pluginmanager.py | 43 | 8644 | import pytest
import types
from pluggy import (PluginValidationError,
HookCallError, HookimplMarker, HookspecMarker)
hookspec = HookspecMarker("example")
hookimpl = HookimplMarker("example")
def test_plugin_double_register(pm):
pm.register(42, name="abc")
with pytest.raises(ValueError):... | bsd-3-clause |
40223149/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/__init__.py | 603 | 6082 | ## pygame - Python Game Library
## Copyright (C) 2000-2001 Pete Shinners
##
## 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; either
## version 2 of the License, or (... | gpl-3.0 |
ueshin/apache-spark | python/run-tests.py | 15 | 13614 | #!/usr/bin/env python3
#
# 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 "L... | apache-2.0 |
junhuac/MQUIC | src/tools/perf/benchmarks/gpu_times.py | 8 | 2505 | # Copyright 2015 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.
from core import perf_benchmark
from benchmarks import silk_flags
from telemetry import benchmark
from telemetry.timeline import tracing_category_filter
fr... | mit |
trevor/calendarserver | txweb2/dav/test/test_acl.py | 1 | 15231 | ##
# Copyright (c) 2005-2014 Apple Inc. All rights reserved.
#
# 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, mod... | apache-2.0 |
ConnorGBrewster/servo | tests/wpt/web-platform-tests/tools/third_party/pytest/src/_pytest/python_api.py | 32 | 24587 | import math
import sys
import py
from six.moves import zip, filterfalse
from more_itertools.more import always_iterable
from _pytest.compat import isclass
from _pytest.compat import Mapping, Sequence
from _pytest.compat import STRING_TYPES
from _pytest.outcomes import fail
import _pytest._code
BASE_TYPE = (type, S... | mpl-2.0 |
tensorflow/agents | tf_agents/metrics/batched_py_metric_test.py | 1 | 4425 | # coding=utf-8
# Copyright 2020 The TF-Agents 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | apache-2.0 |
supergis/QGIS | python/plugins/processing/algs/grass/GrassAlgorithmProvider.py | 9 | 4599 | # -*- coding: utf-8 -*-
"""
***************************************************************************
GrassAlgorithmProvider.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
****************... | gpl-2.0 |
TeamBliss-Devices/android_kernel_samsung_jflte | build-all.py | 37 | 10510 | #! /usr/bin/env python
# Copyright (c) 2009-2011, The Linux Foundation. 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
# ... | gpl-2.0 |
MediaKraken/MediaKraken_Deployment | source/testing/test_common/test_common_network_iscp.py | 1 | 1193 | """
Copyright (C) 2016 Quinn D Granfor <spootdev@gmail.com>
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
... | gpl-3.0 |
makinacorpus/geonode | src/GeoNodePy/geonode/maps/tests.py | 1 | 47766 | from django.conf import settings
from django.test import TestCase
from django.test.client import Client
from django.contrib.auth.models import User, AnonymousUser, Group
import geonode.maps.models
import geonode.maps.views
from geonode.maps.models import Map, Layer, User
from geonode.maps.utils import get_valid_user,... | gpl-3.0 |
nanuxbe/django-modeltranslation | modeltranslation/management/commands/loaddata.py | 8 | 2572 | from django import VERSION
from django.core.management.commands.loaddata import Command as LoadDataCommand
# Because this command is used (instead of default loaddata), then settings have been imported
# and we can safely import MT modules
from modeltranslation import settings as mt_settings
from modeltranslation.util... | bsd-3-clause |
jnv/asciibooth | asciibooth/__main__.py | 1 | 3498 | from threading import Semaphore
from rx import Observable
from rx.concurrency import Scheduler
from time import sleep
from .input import observe_mouse, observe_keyboard, observe_getch
from . import ascii
from . import screen
from . import config
from . import raster
from . import output
from .statuses import status_gen... | cc0-1.0 |
yunti/cookiecutter-django | {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/users/views.py | 140 | 1445 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.core.urlresolvers import reverse
from django.views.generic import DetailView, ListView, RedirectView, UpdateView
from braces.views import LoginRequiredMixin
from .models import User
class UserDetailView(LoginRequiredMixin,... | bsd-3-clause |
imchipwood/iSOBOT_ESP8266 | iSOBOT_Control/isobot.py | 1 | 14020 | __author__ = "chawood@pdx.edu"
import requests
import ping
import socket
import time
import re
# Code originally pulled from here
# http://web.cecs.pdx.edu/~mperkows/CLASS_479/Projects-2012/Mathias_Sunardi-iSobot_controller_report.pdf
# And subsequently changed entirely for use with ESP8266s over wifi
commands = {
'... | gpl-3.0 |
sdague/home-assistant | homeassistant/components/alexa/auth.py | 19 | 5572 | """Support for Alexa skill auth."""
import asyncio
from datetime import timedelta
import json
import logging
import aiohttp
import async_timeout
from homeassistant.const import CONF_CLIENT_ID, CONF_CLIENT_SECRET, HTTP_OK
from homeassistant.core import callback
from homeassistant.helpers import aiohttp_client
from hom... | apache-2.0 |
apark263/tensorflow | tensorflow/python/kernel_tests/compare_and_bitpack_op_test.py | 7 | 2496 | # 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... | apache-2.0 |
gnuhub/intellij-community | python/lib/Lib/site-packages/django/template/context.py | 78 | 5383 | from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
# Cache of actual callables.
_standard_context_processors = None
# We need the CSRF processor no matter what the user has in their settings,
# because otherwise it is a security vulnerability, and we can't afford t... | apache-2.0 |
buckket/weltklang | lib/rfk/database/base.py | 3 | 14398 | import time
import hashlib
from datetime import timedelta
from passlib.hash import bcrypt
from sqlalchemy import *
from sqlalchemy.orm import relationship, backref, exc
from sqlalchemy.dialects.mysql import INTEGER as Integer
from sqlalchemy.ext.hybrid import hybrid_property, hybrid_method
from sqlalchemy.sql.express... | bsd-3-clause |
raviflipsyde/servo | components/script/dom/bindings/codegen/parser/tests/test_implements.py | 264 | 5961 | # Import the WebIDL module, so we can do isinstance checks and whatnot
import WebIDL
def WebIDLTest(parser, harness):
# Basic functionality
threw = False
try:
parser.parse("""
A implements B;
interface B {
attribute long x;
};
interface ... | mpl-2.0 |
maftieu/CouchPotatoServer | libs/pynma/pynma.py | 73 | 4554 | #!/usr/bin/python
from xml.dom.minidom import parseString
from httplib import HTTPSConnection
from urllib import urlencode
__version__ = "0.1"
API_SERVER = 'nma.usk.bz'
ADD_PATH = '/publicapi/notify'
USER_AGENT="PyNMA/v%s"%__version__
def uniq_preserve(seq): # Dave Kirby
# Order preserving
seen = set()
... | gpl-3.0 |
AbinashBishoyi/python-whatsapp-bot | modules/registration.py | 2 | 4361 | import json
import modules
bot=None
def onclientinfochange():
global bot
clientsinfo=bot.clientsinfo
with open(bot.clientsinfofile,'w') as clientinfofileobj:
json.dump(clientsinfo,clientinfofileobj)
def AI(jid,message,querer,group):
global bot
try:
clientinfo=bot.clientsinfo[jid]
except KeyError:
if b... | mit |
CannonFotter/shadowsocks | tests/test_udp_src.py | 1009 | 2482 | #!/usr/bin/python
import socket
import socks
SERVER_IP = '127.0.0.1'
SERVER_PORT = 1081
if __name__ == '__main__':
# Test 1: same source port IPv4
sock_out = socks.socksocket(socket.AF_INET, socket.SOCK_DGRAM,
socket.SOL_UDP)
sock_out.set_proxy(socks.SOCKS5, SERVER_IP, S... | apache-2.0 |
devlights/try-python | trypython/stdlib/dataclasses_/dataclasses02.py | 1 | 1182 | """
dataclasses モジュールのサンプルです.
fronzen プロパティの指定について
REFERENCESS:: http://bit.ly/2KTZynw
http://bit.ly/2KJCnwk
http://bit.ly/2KHeNA9
http://bit.ly/2KFLGxc
"""
import dataclasses as dc
from trypython.common.commoncls import SampleBase
from trypython.common.commonfunc import pr
... | mit |
rackergs/ansible-modules-extras | notification/slack.py | 61 | 7655 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Ramon de la Fuente <ramon@delafuente.nl>
#
# 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 ... | gpl-3.0 |
algorithm-ninja/territoriali-backend | terry/__main__.py | 1 | 1084 | #!/usr/bin/env python3
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright 2017-2018 - Edoardo Morassutto <edoardo.morassutto@gmail.com>
# Copyright 2017-2018 ... | mpl-2.0 |
Dandandan/wikiprogramming | jsrepl/build/extern/python/closured/lib/python2.7/posixpath.py | 145 | 13182 | """Common operations on Posix pathnames.
Instead of importing this module directly, import os and refer to
this module as os.path. The "os.path" name is an alias for this
module on Posix systems; on other systems (e.g. Mac, Windows),
os.path provides the same operations in a manner specific to that
platform, and is a... | mit |
cgranade/qutip | qutip/tests/test_qubit_evolution.py | 8 | 6429 | # This file is part of QuTiP: Quantum Toolbox in Python.
#
# Copyright (c) 2011 and later, Paul D. Nation and Robert J. Johansson.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
... | bsd-3-clause |
mvdroest/RTLSDR-Scanner | src/cli.py | 1 | 9447 | #
# rtlsdr_scan
#
# http://eartoearoak.com/software/rtlsdr-scanner
#
# Copyright 2012 - 2015 Al Brown
#
# A frequency scanning GUI for the OsmoSDR rtl-sdr library at
# http://sdr.osmocom.org/trac/wiki/rtl-sdr
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gene... | gpl-3.0 |
Serag8/Bachelor | google_appengine/lib/django-1.2/django/core/handlers/base.py | 44 | 9926 | import sys
from django import http
from django.core import signals
from django.utils.encoding import force_unicode
from django.utils.importlib import import_module
class BaseHandler(object):
# Changes that are always applied to a response (in this order).
response_fixes = [
http.fix_location_header,
... | mit |
kingctan/Misago | misago/forums/tests/test_lists.py | 8 | 1362 | from misago.acl.testutils import override_acl
from misago.users.testutils import AuthenticatedUserTestCase
from misago.forums.lists import get_forums_list, get_forum_path
from misago.forums.models import Forum
class ForumsListsTests(AuthenticatedUserTestCase):
def setUp(self):
super(ForumsListsTests, sel... | gpl-2.0 |
nwjs/chromium.src | tools/perf/experimental/representative_perf_test_limit_adjuster/adjust_upper_limits.py | 1 | 6803 | # Copyright 2019 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.
from __future__ import print_function
import json
import os
import sys
import shutil
import subprocess
import tempfile
CHROMIUM_PATH = os.path.join(os.path... | bsd-3-clause |
flavour/cert | static/scripts/tools/sync_setup.py | 3 | 5314 | # Setup Script for Sync:
# - only needed for active sites (sync masters)
# - run after 1st run initialization and after the admin account has been created
# - configure the values below either manually or by config script for the respective instance
#
# Use like:
# (Win32 users prefix the config options with 'set ' & n... | mit |
iohannez/gnuradio | gr-filter/examples/synth_to_chan.py | 7 | 3891 | #!/usr/bin/env python
#
# Copyright 2010,2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your ... | gpl-3.0 |
breisfeld/avoplot | examples/adv_sine_wave.py | 3 | 8650 | import numpy
import matplotlib.pyplot as plt
import math
from avoplot import plugins, series, controls, subplots
from avoplot.gui import widgets
import wx
plugin_is_GPL_compatible = True
class TrigFuncSubplot(subplots.AvoPlotXYSubplot):
def my_init(self):
"""
When defining your own subplot class... | gpl-3.0 |
Sbalbp/DIRAC | RequestManagementSystem/Agent/RequestOperations/ForwardDISET.py | 3 | 2391 | ########################################################################
# $HeadURL $
# File: ForwardDISET.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/03/22 12:40:06
########################################################################
""" :mod: ForwardDISET
==================
.. module: Forwar... | gpl-3.0 |
dnozay/lettuce | tests/integration/lib/Django-1.2.5/django/db/models/fields/subclassing.py | 45 | 4384 | """
Convenience routines for creating non-trivial Field subclasses, as well as
backwards compatibility utilities.
Add SubfieldBase as the __metaclass__ for your Field subclass, implement
to_python() and the other necessary methods and everything will work seamlessly.
"""
from inspect import getargspec
from warnings i... | gpl-3.0 |
migonzalvar/youtube-dl | youtube_dl/extractor/dump.py | 120 | 1036 | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class DumpIE(InfoExtractor):
_VALID_URL = r'^https?://(?:www\.)?dump\.com/(?P<id>[a-zA-Z0-9]+)/'
_TEST = {
'url': 'http://www.dump.com/oneus/',
'md5': 'ad71704d1e67dfd9e81e3e8b42d69d99',
... | unlicense |
webplate/astrini | InputHandler.py | 1 | 1070 | # -*- coding: utf-8-*-
from direct.showbase.DirectObject import DirectObject
import sys, time
class InputHandler(DirectObject):
def __init__(self, world):
self.world = world
#setting it active by default
self.setActive()
def setInactive(self):
# Main Modifier
... | gpl-3.0 |
jss-emr/openerp-7-src | openerp/tests/test_acl.py | 13 | 5091 | import unittest2
from lxml import etree
import openerp
from openerp.tools.misc import mute_logger
import common
# test group that demo user should not have
GROUP_TECHNICAL_FEATURES = 'base.group_no_one'
class TestACL(common.TransactionCase):
def setUp(self):
super(TestACL, self).setUp()
self.re... | agpl-3.0 |
eli-schwartz/Sigil | src/Resource_Files/plugin_launchers/python/opf_parser.py | 1 | 11711 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
# Copyright (c) 2014 Kevin B. Hendricks, John Schember, and Doug Massay
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following ... | gpl-3.0 |
webmasterraj/FogOrNot | flask/lib/python2.7/site-packages/boto/swf/__init__.py | 145 | 1792 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# 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... | gpl-2.0 |
hhorii/cassandra | pylib/cqlshlib/test/ansi_colors.py | 192 | 6073 | # 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... | apache-2.0 |
marcosmodesto/django-testapp | django/django/contrib/gis/tests/geoapp/models.py | 93 | 1686 | from django.contrib.gis.db import models
from django.contrib.gis.tests.utils import mysql, spatialite
# MySQL spatial indices can't handle NULL geometries.
null_flag = not mysql
class Country(models.Model):
name = models.CharField(max_length=30)
mpoly = models.MultiPolygonField() # SRID, by default, is 4326
... | bsd-3-clause |
raymondnijssen/QGIS | python/plugins/processing/preconfigured/PreconfiguredUtils.py | 50 | 1383 | # -*- coding: utf-8 -*-
"""
***************************************************************************
PreconfiguredUtils.py
---------------------
Date : April 2016
Copyright : (C) 2016 by Victor Olaya
Email : volayaf at gmail dot com
*********************... | gpl-2.0 |
danielbonetto/twig_MVC | build/complete_upgrade.py | 3 | 1798 | # Run simpletests as an admin
import mechanize, sys, re
# Get base url from arguments
if len(sys.argv) != 2:
print 'Incorrect number of arguments, expects one'
sys.exit(2)
rooturl = sys.argv[1]
# Run tests
print 'Root url: %s' % rooturl
print 'Open login page'
mech = mechanize.Browser()
mech.open(rooturl+'l... | gpl-3.0 |
blakedewey/nipype | nipype/interfaces/fsl/tests/test_auto_MultiImageMaths.py | 9 | 1430 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.fsl.maths import MultiImageMaths
def test_MultiImageMaths_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict... | bsd-3-clause |
kendazheng/wizcloud2 | wizcloud/wizresource/zapi.py | 1 | 2298 | import time
from pyzabbix import ZabbixAPI
from settings import ZabbixAPI_URL, ZabbixAPI_USER, ZabbixAPI_PASSWD
def getZabbixHistory(key, hostname, lastminutes):
zapi = ZabbixAPI(ZabbixAPI_URL, timeout=5)
zapi.login(ZabbixAPI_USER, ZabbixAPI_PASSWD)
hosts = zapi.host.get(filter={"host": hostname})
if... | apache-2.0 |
miguelparaiso/PracticaOdoo | addons/hr_payroll_account/wizard/__init__.py | 433 | 1116 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
frankvdp/django | tests/schema/fields.py | 68 | 2806 | from functools import partial
from django.db import models
from django.db.models.fields.related import (
RECURSIVE_RELATIONSHIP_CONSTANT, ManyToManyDescriptor, ManyToManyField,
ManyToManyRel, RelatedField, create_many_to_many_intermediary_model,
)
class CustomManyToManyField(RelatedField):
"""
Ticket... | bsd-3-clause |
gsantovena/marathon | tests/shakedown/shakedown/clients/marathon.py | 2 | 25377 | import json
import logging
from six.moves import urllib
from . import dcos_service_url, rpcclient
from .. import util
from ..errors import DCOSException
logger = logging.getLogger(__name__)
def create_client(marathon_service_name='marathon', auth_token=None):
"""Creates a Marathon client with the supplied conf... | apache-2.0 |
lfdesousa/pinject | pinject/initializers_test.py | 2 | 3576 | """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 agreed to in ... | apache-2.0 |
upliftaero/MissionPlanner | Lib/site-packages/scipy/linalg/tests/test_basic.py | 51 | 19160 | #!"C:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\bin\Debug\ipy.exe"
#
# Created by: Pearu Peterson, March 2002
#
""" Test functions for linalg.basic module
"""
"""
Bugs:
1) solve.check_random_sym_complex fails if a is complex
and transpose(a) = conjugate(a) (a is Hermitian).
"""
__u... | gpl-3.0 |
tmerrick1/spack | var/spack/repos/builtin/packages/r-trimcluster/package.py | 5 | 1642 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
michaelaye/vispy | vispy/ext/_bundled/husl.py | 21 | 7663 | """
HUSL colors python implementation.
Source: https://github.com/husl-colors/husl.py
Copyright (c) 2015 Alexei Boronine
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, inclu... | bsd-3-clause |
ryanss/holidays.py | holidays/countries/argentina.py | 2 | 5803 | # -*- coding: utf-8 -*-
# python-holidays
# ---------------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Author: ryanss <ryanssdev@icl... | mit |
ionrock/designate | functionaltests/api/v2/clients/transfer_accepts_client.py | 3 | 2619 | """
Copyright 2015 Rackspace
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
dist... | apache-2.0 |
projectcalico/calico-nova | nova/tests/functional/v3/test_server_metadata.py | 16 | 3356 | # Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# 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... | apache-2.0 |
glovebx/odoo | addons/hr_payroll/res_config.py | 441 | 1294 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
AWhetter/gyp | test/generator-output/gyptest-symlink.py | 41 | 1226 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies building a target when the --generator-output= option is used to put
the build configuration files in a separate directory tree... | bsd-3-clause |
jeffmahoney/crash-python | contrib/lsbtrfs-cmd.py | 1 | 1665 | #!/usr/bin/python3
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
path = "/lib/modules/4.4.20-6.gd2e08c5-default/kernel/fs/btrfs/btrfs.ko"
from crash.types.list import list_for_each_entry
import gdb
import uuid
from crash.commands import CrashCommand
class LSBtrfs(CrashCommand):
"""
doc
"""... | gpl-2.0 |
a-parhom/edx-platform | openedx/core/djangoapps/ccxcon/tests/test_tasks.py | 4 | 1431 | """
Tests for the CCXCon celery tasks
"""
import mock
from django.test import TestCase
from opaque_keys.edx.keys import CourseKey
from openedx.core.djangoapps.ccxcon import api, tasks
class CCXConTaskTestCase(TestCase):
"""
Tests for CCXCon tasks.
"""
shard = 2
@mock.patch('openedx.core.django... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.