text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
# -*- python -*-
# Copyright (C) 2009-2015 Free Software Foundation, 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 versio... | FabianKnapp/nexmon | buildtools/gcc-arm-none-eabi-5_4-2016q2-linux-x86/arm-none-eabi/lib/armv7e-m/softfp/fpv5-sp-d16/libstdc++.a-gdb.py | Python | gpl-3.0 | 2,501 | 0.006397 |
# -*- coding: utf-8 -*-
import sys
import string
from datetime import datetime,timedelta
import calendar
import csv
import re
# ファイルオープン(fpは引数でログファイル,wfpは書き出すcsvファイルを指定)
fp = open(sys.argv[1],'r')
# logがローテートするタイミングが1日の間にある場合,/var/log/kern.logと/var/log/kern.log.1の両方を読み込む必要があるかもしれない
wfp = open('/path/to/program/csv_dat... | High-Hill/bachelor_dap_gw | program/log_formatting.py | Python | mit | 2,502 | 0.008947 |
#!/usr/bin/env python
# encoding: utf-8
"""
views.py
Created by Christophe VAN FRACKEM on 2014/05/25.
Copyright (c) 2014 Tiss'Page. All rights reserved.
"""
__author__ = 'Christophe VAN FRACKEM <contact@tisspage.fr>'
__version__= '0.0.1'
__copyright__ = '© 2014 Tiss\'Page'
from django.shortcuts import render_to_res... | tisspage/resume-website | website/views.py | Python | gpl-3.0 | 2,019 | 0.021351 |
"""Publishing native (typically pickled) objects.
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from traitlets.config import Configurable
from ipykernel.inprocess.socket import SocketABC
from traitlets import Instance, Dict, CBytes
from ipykernel.jsonutil imp... | bdh1011/wau | venv/lib/python2.7/site-packages/ipykernel/datapub.py | Python | mit | 1,761 | 0.003975 |
class Action:
label = ""
selectable = 0
def __init__ (self,label="",s=0):
self.label = label
self.selectable = s
def getLabel (self):
return self.label
def do (self):
tmp = 1
def canSelect (self):
return self.selectable
| tbdale/crystalfontz-lcd-ui | python/Action.py | Python | mit | 289 | 0.020761 |
# -*- coding: utf-8 -*-
import os
import subprocess
import sys
import threading
import time
import signal
from thriftpy.protocol import TBinaryProtocolFactory
from thriftpy.server import TThreadedServer
from thriftpy.thrift import TProcessor
from thriftpy.transport import TServerSocket, TBufferedTransportFactory
from ... | eleme/archer | archer/_server.py | Python | mit | 3,460 | 0 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Follow'
db.create_table('actstream_follow', (
('id', self.gf('django.db.models... | hzlf/openbroadcast | website/apps/actstream/migrations/0001_initial.py | Python | gpl-3.0 | 7,890 | 0.008365 |
__author__ = 'Evtushenko Georgy'
from setuptools import setup, find_packages
setup(
name="metanet",
version="0.1",
description="Free portable library for meta neural network research",
license="GPL3",
packages=['metanet', 'metanet.datasets', 'metanet.networks', 'metanet.networks.nodes', 'metanet.n... | senior-zero/metanet | setup.py | Python | gpl-3.0 | 482 | 0.002075 |
'''tzinfo timezone information for Africa/Asmera.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Asmera(DstTzInfo):
'''Africa/Asmera timezone definition. See datetime.tzinfo for details'''
zone = 'Africa/Asmera'
_ut... | newvem/pytz | pytz/zoneinfo/Africa/Asmera.py | Python | mit | 483 | 0.043478 |
import pytest
class TestTail:
@pytest.mark.complete("tail --", require_longopt=True)
def test_1(self, completion):
assert completion
| algorythmic/bash-completion | test/t/test_tail.py | Python | gpl-2.0 | 151 | 0 |
import gettext
_ = gettext.gettext
from html5lib.constants import voidElements, spaceCharacters
spaceCharacters = u"".join(spaceCharacters)
class TreeWalker(object):
def __init__(self, tree):
self.tree = tree
def __iter__(self):
raise NotImplementedError
def error(self, msg):
ret... | naokits/adminkun_viewer_old | Server/gaeo/html5lib/treewalkers/_base.py | Python | mit | 5,461 | 0.003662 |
#! /usr/bin/env python
# import os
import pygame
import random
from highscore import is_high_score_and_save
# it is better to have an extra variable, than an extremely long line.
player_img_path = 'player.png'
pill_img_path = 'pill.png'
boost_img_path = 'boost.png'
background = pygame.image.load("space.jpg")
# creat... | dojojon/pygame | week5/spawn5.py | Python | mit | 4,613 | 0.000434 |
import logging
import os
from twilio.rest import Client
class TwilioClient(object):
def __init__(self):
self.logger = logging.getLogger("botosan.logger")
self.account_sid = os.environ["TWILIO_SID"]
self.account_token = os.environ["TWILIO_TOKEN"]
self.client = Client(self.account_si... | FredLoh/BotoSan | twilio-mnc-mcc-getter.py | Python | mit | 1,280 | 0.003906 |
__author__ = 'besta'
class BestaPlayer:
def __init__(self, fichier, player):
self.fichier = fichier
self.grille = self.getFirstGrid()
self.best_hit = 0
self.players = player
def getFirstGrid(self):
"""
Implements function to get the first grid.
:retur... | KeserOner/puissance4 | bestaplayer.py | Python | mit | 9,518 | 0.001681 |
# *****************************************************************************
# Copyright (c) 2016 TechBubble Technologies and other Contributors.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distr... | AdamMiltonBarker/TechBubble-Iot-JumpWay-Python-MQTT | src/techbubbleiotjumpwaymqtt/device.py | Python | epl-1.0 | 6,911 | 0.03328 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2015. Tšili Lauri Johannes
#
# 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, either version 3 of the
# License, or (at your ... | tsili/datpy | datpy/time_operations.py | Python | agpl-3.0 | 4,806 | 0 |
#!/usr/bin/python2
# Copyright 2012 Anton Beloglazov
#
# 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 ... | beloglazov/openstack-neat | utils/idle-time-fraction.py | Python | apache-2.0 | 2,317 | 0.003453 |
# pylint:disable=R0201
"""docstring"""
__revision__ = ''
class Interface(object):
"""base class for interfaces"""
class IMachin(Interface):
"""docstring"""
def truc(self):
"""docstring"""
def troc(self, argument):
"""docstring"""
class Correct1(object):
"""docstring"""
__impl... | godfryd/pylint | test/input/func_interfaces.py | Python | gpl-2.0 | 2,062 | 0.00485 |
# 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 https://mozilla.org/MPL/2.0/.
from ..._input_field import InputField
class BoolInput(InputField):
"""Simple input that controls a boolean variab... | zerothi/sisl | sisl/viz/input_fields/basic/bool.py | Python | mpl-2.0 | 1,059 | 0.000944 |
"""
file: Calculate_Jump-ratio.py
author: Michael Entrup b. Epping (michael.entrup@wwu.de)
version: 20170306
info: A script that calculates the Jump-Ratio of two images.
The second image is devided by the first one.
A drift correction is performed. The first image is shiftet t... | m-entrup/EFTEMj | EFTEMj-pyScripts/src/main/resources/scripts/Plugins/EFTEMj/ESI/Calculate_Jump-ratio.py | Python | bsd-2-clause | 3,118 | 0.000962 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('chef_buddy', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='ingredientflavorcompound',
... | chef-buddy/chef-buddy-django | chef_buddy/migrations/0002_ingredientflavorcompound_score.py | Python | mit | 444 | 0 |
from plow.gui.manifest import QtCore, QtGui
from plow.gui.util import formatDateTime, formatDuration
__all__ = [
"Text",
"Number",
"Decimal",
"DateTime",
"PillWidget",
"Checkbox"
]
class FormWidget(QtGui.QWidget):
"""
The base class for all form widgets.
"""
__LOCKED_PIX = None... | chadmv/plow | lib/python/plow/gui/form/fwidgets.py | Python | apache-2.0 | 4,081 | 0.00294 |
import time
from twisted.internet import defer, reactor, protocol
from twisted.python import log
from twisted.enterprise import adbapi
class SideloaderDB(object):
def __init__(self):
self.p = adbapi.ConnectionPool('psycopg2',
database='sideloader',
host='localhost',
use... | praekelt/sideloader2 | sideloader.worker/sideloader/worker/task_db.py | Python | mit | 9,546 | 0.005133 |
# Copyright (c) 2012-2013, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty, Tags
from .validators import integer, positive_integer, network_port, boolean
class AliasTarget(AWSProperty):
props = {
'HostedZoneId': (basestring, Tru... | pas256/troposphere | troposphere/route53.py | Python | bsd-2-clause | 4,197 | 0 |
'''
Created on Mar 18, 2013
@author: Gooch
'''
import unittest
from Pipeline.PipelineSampleData import SampleData
class SampleDataTest(unittest.TestCase):
def setUp(self):
#might not need this, runs before each test
pass
def tearDown(self):
#might not need this, runs after each test
... | kotoroshinoto/Cluster_SimpleJob_Generator | pybin/Test/PipelineSampleDataTest.py | Python | unlicense | 1,017 | 0.019666 |
# python
from distutils.core import setup
setup(
name = 'zplot',
packages = ['zplot'],
version = '1.41',
description = 'A simple graph-creation library',
author = 'Remzi H. Arpaci-Dusseau',
author_email = 'remzi.arpacidusseau@gmail.com',
url = 'https://github.com/z-plot/z-plot',
down... | z-plot/z-plot | setup.py | Python | bsd-3-clause | 472 | 0.055085 |
# (c) 2011, 2012 Georgia Tech Research Corporation
# This source code is released under the New BSD license. Please see
# http://wiki.quantsoftware.org/index.php?title=QSTK_License
# for license details.
#
# Created on October <day>, 2011
#
# @author: Vishal Shekhar
# @contact: mailvishalshekhar@gmail.com
# @summary: ... | grahesh/Stock-Market-Event-Analysis | qstkstudy/stockListGen.py | Python | bsd-3-clause | 1,592 | 0.013819 |
#!/usr/bin/env python
"""Implementation of a router class that does no ACL checks."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from typing import Optional
from grr_response_server import access_control
from grr_response_server.gui import api_call_... | dunkhong/grr | grr/server/grr_response_server/gui/api_call_router_without_checks.py | Python | apache-2.0 | 13,048 | 0.011343 |
import sys, os, os.path
from distutils.core import Extension
from distutils.errors import DistutilsOptionError
from versioninfo import get_base_dir, split_version
try:
from Cython.Distutils import build_ext as build_pyx
import Cython.Compiler.Version
CYTHON_INSTALLED = True
except ImportError:
CYTHON_I... | rajendrakrp/GeoMicroFormat | build/lxml/setupinfo.py | Python | bsd-3-clause | 11,648 | 0.00601 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import json
import cgi
import urllib2
#取得本机外网IP
myip = urllib2.urlopen('http://members.3322.org/dyndns/getip').read()
myip=myip.strip()
#加载SSR JSON文件
f = file("/usr/local/shadowsocksr/mudb.json");
json = json.load(f);
# 接受表达提交的数据
form = cgi.FieldStorage()
# 解析处理提交的数据
g... | zhaifangzhi/1 | www/cgi-bin/show_info.py | Python | gpl-3.0 | 3,348 | 0.034528 |
extension = None
#httpDirectory = None
omlCitation = None | OsirisSPS/osiris-sps | client/data/extensions/5B1D133CA24D2B5B93B675279CB60C9CB7E47502/scripts/globalvars.py | Python | gpl-3.0 | 57 | 0.035088 |
#!/bin/python
# -*- coding: utf-8 -*-
# ####################################################################
# gofed-ng - Golang system
# Copyright (C) 2016 Fridolin Pokorny, fpokorny@redhat.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public Lice... | gofed/gofed-ng | scenarios/golangDepsUpdate.py | Python | gpl-3.0 | 3,711 | 0.004042 |
import copy
import os
import re
import subprocess
from conans.client import tools
from conans.client.build.visual_environment import (VisualStudioBuildEnvironment,
vs_build_type_flags, vs_std_cpp)
from conans.client.tools.oss import cpu_count
from conans.client.tools... | memsharded/conan | conans/client/build/msbuild.py | Python | mit | 12,275 | 0.004236 |
s = input().rstrip()
print(s[:4],s[4:])
| utgw/programming-contest | codefestival/2016/qualA/a.py | Python | mit | 40 | 0.025 |
from unittest import TestCase
import pyb
class TestGPIO (TestCase):
flagInCallback=False
def test_1(self):
flagOk=False
try:
p = pyb.Pin(0) #GPIO0
p.init(pyb.Pin.IN,pyb.Pin.PULL_NONE)
flagOk=True
except:
pass
self.assertEqual(fl... | martinribelotta/micropython | ciaa-nxp/frozen/testing/TestGPIO.py | Python | mit | 3,678 | 0.028276 |
# Derived from keras-rl
import opensim as osim
import numpy as np
import sys
from keras.models import Sequential, Model
from keras.layers import Dense, Activation, Flatten, Input, concatenate
from keras.optimizers import Adam
import numpy as np
from rl.agents import DDPGAgent
from rl.memory import SequentialMemory
f... | stanfordnmbl/osim-rl | examples/legacy/example.py | Python | mit | 4,483 | 0.003346 |
#!/usr/bin/env python
# encoding: utf-8
#
# AuthorDetector
# Copyright (C) 2013 Larroque Stephen
#
# 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 ... | lrq3000/author-detector | authordetector/configparser.py | Python | gpl-3.0 | 7,707 | 0.004801 |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | google/hotel-ads-etl-tool | hotel_ads_beam_utils/hotel_ads_beam_utils/do_fn.py | Python | apache-2.0 | 1,021 | 0.003918 |
#!/usr/bin/env python
import sys
import os.path
import datetime
import subprocess
import time
"""
Run snapstream reader script for several files and out a table of match counts.
Example:
$ python run_on_dates.py eg01china.c 2014-01-01 2014-07-01
"""
def validate(date_string):
try:
datetime.datetime.strpti... | ppham27/snapstream-reader | legacy/run_on_dates.py | Python | mit | 1,762 | 0.008513 |
from cosrlib.document.html import HTMLDocument
import pytest
def _links(html, url=None):
return HTMLDocument(html, url=url).parse().get_hyperlinks()
def test_get_hyperlinks():
links = _links("""<html><head><title>Test title</title></head><body>x</body></html>""")
assert len(links) == 0
links = _lin... | commonsearch/cosr-back | tests/cosrlibtests/document/html/test_hyperlinks.py | Python | apache-2.0 | 4,389 | 0.000456 |
"""
SkCode text align tag definitions code.
"""
from ..etree import TreeNode
class TextAlignBaseTreeNode(TreeNode):
""" Base class for all text alignment tag class. """
# HTML template for rendering
html_render_template = '<p class="text-{text_alignment}">{inner_html}</p>\n'
# Default text alignmen... | TamiaLab/PySkCode | skcode/tags/textalign.py | Python | agpl-3.0 | 1,809 | 0.001106 |
import StringIO
import traceback
from java.lang import StringBuffer #@UnresolvedImport
from java.lang import String #@UnresolvedImport
import java.lang #@UnresolvedImport
import sys
from _pydev_tipper_common import DoFind
try:
False
True
except NameError: # version < 2.3 -- didn't have the True/False builtins... | AMOboxTV/AMOBox.LegoBuild | script.module.pydevd/lib/_pydev_jy_imports_tipper.py | Python | gpl-2.0 | 16,814 | 0.012727 |
import sys, complete
from argparse import ArgumentParser
from config import config
from file import load, save
from hooks import post_add
def add(conf):
parser = ArgumentParser(usage="%(prog)s add arguments")
parser.add_argument("-n", required=True, dest="name", help="password name")
parser.add_argument("-... | lkrotowski/passwdk | src/passwdk/main.py | Python | gpl-3.0 | 2,401 | 0.03082 |
#!/usr/bin/env python
"""Test faster version of sematic similarity"""
from __future__ import print_function
# Computing basic semantic similarities between GO terms
# Adapted from book chapter written by _Alex Warwick Vesztrocy and Christophe Dessimoz_
# How to compute semantic similarity between GO terms.
# First... | tanghaibao/goatools | tests/test_semantic_faster.py | Python | bsd-2-clause | 3,361 | 0.005653 |
class Solution(object):
def count_bits(self, n):
c = (n - ((n >> 1) & 0o33333333333) - ((n >> 2) & 0o11111111111))
return ((c + (c >> 3)) & 0o30707070707) % 63
def countBits(self, num):
"""
:type num: int
:rtype: List[int]
"""
return map(self.count_bits, x... | ckclark/leetcode | py/counting-bits.py | Python | apache-2.0 | 336 | 0.002976 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2016, 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... | hryamzik/ansible | lib/ansible/modules/cloud/cloudstack/cs_host.py | Python | gpl-3.0 | 18,456 | 0.000813 |
# Copyright 2012 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 telemetry import decorators
from telemetry.internal.browser import user_agent
from telemetry.unittest_util import tab_test_case
class MobileUserAgentT... | SaschaMester/delicium | tools/telemetry/telemetry/internal/browser/user_agent_unittest.py | Python | bsd-3-clause | 1,431 | 0.009783 |
from PyQt4.QtGui import *
import pypipe.formats
import pypipe.basefile
from pypipe.core import pipeline
from widgets.combobox import ComboBox
class AddFileDialog(QDialog):
def __init__(self, parent=None):
super(AddFileDialog, self).__init__(parent)
self.formats_combo = ComboBox()
self.fi... | ctlab/pypipe | pypipe-gui/windows/addfiledialog.py | Python | mit | 2,392 | 0 |
"""
Browser set up for acceptance tests.
"""
# pylint: disable=no-member
# pylint: disable=unused-argument
from base64 import encodestring
from json import dumps
from logging import getLogger
import requests
from django.conf import settings
from django.core.management import call_command
from lettuce import after, b... | pepeportela/edx-platform | common/djangoapps/terrain/browser.py | Python | agpl-3.0 | 10,330 | 0.001742 |
import unittest
from katas.kyu_6.help_the_bookseller import stock_list
class StockListTestCase(unittest.TestCase):
def setUp(self):
self.a = ['ABAR 200', 'CDXE 500', 'BKWR 250', 'BTSQ 890', 'DRTY 600']
self.b = ['A', 'B']
def test_equals(self):
self.assertEqual(stock_list(self.a, sel... | the-zebulan/CodeWars | tests/kyu_6_tests/test_help_the_bookseller.py | Python | mit | 518 | 0 |
# -*- coding: utf-8 -*-
"""
Package with support for target classification on image forming sensors.
---
type:
python_module
validation_level:
v00_minimum
protection:
k00_public
copyright:
"Copyright 2016 High Integrity Artificial Intelligence Systems"
license:
"Licensed under the Apache Licens... | wtpayne/hiai | a3_src/h20_capability/sensor/imaging/classify/__init__.py | Python | apache-2.0 | 863 | 0 |
#!/usr/bin/env python
# encoding: utf-8
from __future__ import print_function
import sys
import os.path
import argparse
from . import censuscsv
from . import dbfwriter
def main():
'''Command line util for converting census CSV to DBF'''
parser = argparse.ArgumentParser(description='Convert a US Census csv to d... | fitnr/census2dbf | census2dbf/cli.py | Python | gpl-3.0 | 1,842 | 0.002714 |
import os
import pygame
import sys
import threading, time
from pygame.locals import *
import logging
log = logging.getLogger('pytality.term.pygame')
log.debug("pygame version: %r", pygame.version.ver)
"""
A mapping of special keycodes into representative strings.
Based off the keymap in WConio, but with 'alt... | jtruscott/ld27 | pytality/term_pygame.py | Python | bsd-3-clause | 11,584 | 0.009237 |
'''Defines the Special class for theia.'''
# Provides:
# class Special
# __init__
# lines
import numpy as np
from ..helpers import geometry, settings
from ..helpers.units import deg, cm, pi
from .optic import Optic
class Special(Optic):
'''
Special class.
This class represents general opt... | bandang0/theia | theia/optics/special.py | Python | gpl-3.0 | 4,456 | 0.02895 |
####################################
# Driftwood 2D Game Dev. Suite #
# entitymanager.py #
# Copyright 2014-2017 #
# Michael D. Reiley & Paul Merrill #
####################################
# **********
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of ... | Driftwood2D/Driftwood | src/entitymanager.py | Python | mit | 11,732 | 0.002642 |
# -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import unittest
from django.core.checks import Error, Warning as DjangoWarning
from django.db import connection, models
from django.test import SimpleTestCase, TestCase
from django.test.utils import isolate_apps, override_settings
from django.utils.tim... | filias/django | tests/invalid_models_tests/test_ordinary_fields.py | Python | bsd-3-clause | 19,411 | 0.000515 |
from sha3 import sha3_256
from ethereum.utils import big_endian_to_int
def sha3(seed):
return sha3_256(bytes(seed)).digest()
# colors
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
def DEBUG(*args, **kargs):
print(FAIL + repr(args) + repr(kargs) + ENDC)
colors = ['\033[9%dm' % ... | HydraChain/hydrachain | hydrachain/consensus/utils.py | Python | mit | 750 | 0.004 |
# subrepo.py - sub-repository handling for Mercurial
#
# Copyright 2009-2010 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import errno, os, re, shutil, posixpath, sys
import xml.dom.minidom
import... | jordigh/mercurial-crew | mercurial/subrepo.py | Python | gpl-2.0 | 56,360 | 0.000923 |
#!/usr/bin/env python
'''
Copyright (C) 2020, WAFW00F Developers.
See the LICENSE file for copying permission.
'''
NAME = 'Edgecast (Verizon Digital Media)'
def is_waf(self):
schemes = [
self.matchHeader(('Server', r'^ECD(.+)?')),
self.matchHeader(('Server', r'^ECS(.*)?'))
]
if any(i for ... | EnableSecurity/wafw00f | wafw00f/plugins/edgecast.py | Python | bsd-3-clause | 371 | 0.002695 |
import json
from getJsonData import getJSONData
import os
from datetime import date, datetime
import numpy as np
import stock
import matplotlib.pyplot as plt
dataPath = 'data/SZ#002637.txt'
fileName, fileExtension = os.path.splitext(os.path.basename(dataPath))
jsonPath = os.path.join('data', '{0}.json'.format(fileNa... | m860/data-analysis-with-python | practises/macd.py | Python | mit | 635 | 0 |
import asyncio
import functools
import random
import time
from testing import Client
from testing import default_test_setup
from testing import gen_data
from testing import gen_points
from testing import gen_series
from testing import InsertError
from testing import PoolError
from testing import QueryError
from testing... | transceptor-technology/siridb-server | itest/test_compression.py | Python | mit | 3,689 | 0 |
import re
import lxml.html
from pupa.scrape import Scraper, Organization
class WYCommitteeScraper(Scraper):
members = {}
urls = {
"list": "http://legisweb.state.wy.us/LegbyYear/CommitteeList.aspx?Year=%s",
"detail": "http://legisweb.state.wy.us/LegbyYear/%s",
}
def scrape(self, sessi... | cliftonmcintosh/openstates | openstates/wy/committees.py | Python | gpl-3.0 | 1,983 | 0.003026 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-01-16 10:12
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('patients', '0026_clinician... | muccg/rdrf | rdrf/registry/patients/migrations/0027_auto_20180116_1012.py | Python | agpl-3.0 | 836 | 0 |
"""Package setup for tumblr-block"""
import setuptools
if __name__ == '__main__':
setuptools.setup(
name='tumblr_block',
version='2.0.0',
description=(
'Auto blocking for tumblr'
),
url='https://github.com/Deafjams/tumblr-block',
author='Emma Foster',
... | Deafjams/tumblr-block | setup.py | Python | mit | 804 | 0 |
"""
Tests for CourseDetails
"""
import datetime
import pytest
import ddt
from pytz import UTC
from unittest.mock import patch # lint-amnesty, pylint: disable=wrong-import-order
from django.conf import settings
from xmodule.modulestore import ModuleStoreEnum
from xmodule.data import CertificatesDisplayBehaviors
from... | eduNEXT/edx-platform | openedx/core/djangoapps/models/tests/test_course_details.py | Python | agpl-3.0 | 11,188 | 0.00429 |
#! /usr/bin/env python2
# -*- coding: utf-8 -*-
#======================================================================
#
# playsnd.py - play sound with ctypes + mci
#
# Created by skywind on 2013/12/01
# Last change: 2014/01/26 23:40:20
#
#======================================================================... | skywind3000/collection | script/playmp3.py | Python | mit | 7,109 | 0.036995 |
# -*- coding: utf-8 -*-
import os
import sys
from radio.database import db
def prefsRootPath():
if sys.platform == "darwin":
return os.path.expanduser("~/Library/Application Support/radio")
elif sys.platform.startswith("win"):
return os.path.join(os.environ['APPDATA'], "radio")
el... | hephaestus9/Radio | radio/config/preferences.py | Python | mit | 14,591 | 0.004386 |
from django.test import TestCase
import django_comments as comments
from django_comments_xtd.models import TmpXtdComment
from django_comments_xtd.forms import XtdCommentForm
from django_comments_xtd.tests.models import Article
class GetFormTestCase(TestCase):
def test_get_form(self):
# check function d... | jayfk/django-comments-xtd | django_comments_xtd/tests/forms.py | Python | bsd-2-clause | 1,785 | 0.006162 |
api_token = 'd469c24f-c428-a155-eae6-f8216cff4ace'
ytkanan_token = '6bc600bd-d0aa-369e-be0c-65c6af034183'
ythonest_token = 'f41ef6ea-b8ba-d952-4993-e24b9feeda46'
ytabhinav_token = '712c5c97-15c5-fc76-68c7-2acba12287d0'
yo_rss_token = '17aa580a-2863-db0f-34f1-23657b08dfe6'
dev_key = 'AIzaSyBU9eMQ1xW0NNEGprJIR5wgaQdrTFn_... | kartikluke/yotube | credentials.py | Python | mit | 324 | 0.003086 |
from twisted.plugin import IPlugin
from twisted.words.protocols import irc
from txircd.module_interface import Command, ICommand, IModuleData, ModuleData
from txircd.utils import isValidIdent, trimStringToByteLength
from zope.interface import implementer
from typing import Any, Dict, List, Optional, Tuple
@implementer... | Heufneutje/txircd | txircd/modules/rfc/cmd_user.py | Python | bsd-3-clause | 1,685 | 0.02908 |
import sys
import math
from pimath import *
from PyQt4 import QtCore, QtGui, QtOpenGL
from camera import Camera
import grind
#-----------------------------------------------------------------------------
from rodin import logging
log = logging.get_logger('grind.mangle.gl_widget')
try:
from OpenGL.GL import *
... | mstreatfield/anim-studio-tools | grind/python/util/glWidget.py | Python | gpl-3.0 | 11,356 | 0.006692 |
# Generated by Django 2.0.3 on 2018-05-27 06:40
import django.contrib.postgres.indexes
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('pola', '0005_auto_20171225_1632'),
]
operations = [
migrations.AddIndex(
model_name='query',
... | KlubJagiellonski/pola-backend | pola/migrations/0006_auto_20180527_0840.py | Python | bsd-3-clause | 505 | 0.00198 |
import _plotly_utils.basevalidators
class ShowlegendValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(self, plotly_name="showlegend", parent_name="scattermapbox", **kwargs):
super(ShowlegendValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_... | plotly/plotly.py | packages/python/plotly/plotly/validators/scattermapbox/_showlegend.py | Python | mit | 413 | 0.002421 |
from behave import *
import icecream
def before_all(context):
context.app = icecream.app.test_client()
context.icecream = icecream
icecream.inititalize_redis()
| Cantal0p3/nyu-devops-homework-1 | features/environment.py | Python | apache-2.0 | 173 | 0.00578 |
# Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved.
from __future__ import absolute_import
import os
# Find the best implementation available
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
import caffe_pb2
import flask
import lmdb
import PIL.Image
from... | brainstorm-ai/DIGITS | digits/dataset/images/classification/views.py | Python | bsd-3-clause | 15,470 | 0.0181 |
#-*- coding: utf-8 -*-
from django.forms.models import modelform_factory
from django.contrib import admin
from django.http import HttpResponse
from django.utils import simplejson
from django.views.decorators.csrf import csrf_exempt
from filer import settings as filer_settings
from filer.models import Clipboard, Clipboa... | maykinmedia/django-filer | filer/admin/clipboardadmin.py | Python | bsd-3-clause | 4,562 | 0.002192 |
"""
This module contains tasks that are executed at intervals, and is imported at
the time the server is started. The intervals at which the tasks run
are configurable via :py:mod:`media_nommer.conf.settings`.
All functions prefixed with ``task_`` are task functions that are registered
with the Twisted_ reactor. All f... | duointeractive/media-nommer | media_nommer/ec2nommerd/interval_tasks.py | Python | bsd-3-clause | 3,910 | 0.00665 |
#!/usr/bin/env python3
# coding=utf-8
from Geometry.Vector2 import Vector2
import math
import pygame
def intersecting_rows(rect1, rect2):
"""
@param rect2: pygame.Rect
@param rect1: pygame.Rect
@return: tuple
"""
tile_left = math.floor(rect1.left / rect2.width)
tile_right = math.ceil(rect... | bubbles231/Prototype | Helpers.py | Python | gpl-3.0 | 20,270 | 0.000247 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/creature/npc/droid/crafted/shared_it_o_interrogator_advanced.iff"
result.att... | anhstudios/swganh | data/scripts/templates/object/creature/npc/droid/crafted/shared_it_o_interrogator_advanced.py | Python | mit | 492 | 0.044715 |
# -*- coding: utf-8 -*-
from orator.migrations import Migrator, DatabaseMigrationRepository
from .base_command import BaseCommand
class MigrateCommand(BaseCommand):
"""
Run the database migrations.
migrate
{--d|database= : The database connection to use.}
{--p|path= : The path of migrati... | Hanaasagi/sorator | orator/commands/migrations/migrate_command.py | Python | mit | 2,409 | 0 |
"""
Copyright 2016, 2017 UFPE - Universidade Federal de Pernambuco
Este arquivo é parte do programa Amadeus Sistema de Gestão de Aprendizagem, ou simplesmente Amadeus LMS
O Amadeus LMS é um software livre; você pode redistribui-lo e/ou modifica-lo dentro dos termos da Licença Pública Geral GNU como publicada pela ... | amadeusproject/amadeuslms | h5p/base_plugin/editor/library/editorstorage.py | Python | gpl-2.0 | 3,487 | 0.00694 |
# Copyright 2008 the Melange 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 applicable law or agreed to in wr... | rhyolight/nupic.son | app/soc/models/user.py | Python | apache-2.0 | 5,797 | 0.009488 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2015-12-09 20:19
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency... | svenvandescheur/recordstore | recordstore/core/migrations/0012_auto_20151209_2019.py | Python | mit | 1,594 | 0.003137 |
from __future__ import unicode_literals
from django.apps import AppConfig
class DevelopersConfig(AppConfig):
name = 'developers'
| neldom/qessera | developers/apps.py | Python | mit | 136 | 0 |
"""
HttpError Spider Middleware
See documentation in docs/topics/spider-middleware.rst
"""
import logging
from scrapy.exceptions import IgnoreRequest
logger = logging.getLogger(__name__)
class HttpError(IgnoreRequest):
"""A non-200 response was filtered"""
def __init__(self, response, *args, **kwargs):
... | rolando-contrib/scrapy | scrapy/spidermiddlewares/httperror.py | Python | bsd-3-clause | 1,921 | 0.001562 |
########################################################################
# amara/xpath/locationpaths/predicates.py
"""
A parsed token that represents a predicate list.
"""
from __future__ import absolute_import
from itertools import count, izip
from amara.xpath import datatypes
from amara.xpath.expressions.basics impo... | zepheira/amara | lib/xpath/locationpaths/predicates.py | Python | apache-2.0 | 7,392 | 0.001894 |
#raspberry pi states remote query service
#winxos 2016-6-10
import socket
import time
version="1.0"
port=9000
s=socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
s.setsockopt(socket.SOL_SOCKET,socket.SO_BROADCAST,1)
s.bind(('',port))
if __name__=='__main__':
prin... | winxos/python | smartrpi/ipreport.py | Python | mit | 789 | 0.032953 |
# Copyright 2015 Mirantis 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... | SVilgelm/CloudFerry | cloudferry/lib/os/compute/instances.py | Python | apache-2.0 | 4,200 | 0 |
"""Auto-generated file, do not edit by hand. KI metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_KI = PhoneMetadata(id='KI', country_code=686, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[2458]\\d{4}|3\\d{4,7}|7\\d{7}', possibl... | dongguangming/python-phonenumbers | python/phonenumbers/data/region_KI.py | Python | apache-2.0 | 1,560 | 0.008974 |
# Generated by Django 2.0.5 on 2018-06-05 09:11
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('home', '0014_auto_20170725_1302'),
]
operations = [
migrations.AlterField(
model_name='formfield',
name='field_type'... | UTNkar/moore | src/home/migrations/0015_auto_20180605_1111.py | Python | agpl-3.0 | 775 | 0.00129 |
# -*- coding: utf-8 -*-
# diceware_list -- generate wordlists for diceware
# Copyright (C) 2016-2019. Uli Fouquet
#
# 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 ... | ulif/wordlist-gen | tests/test_libwordlist.py | Python | gpl-3.0 | 27,107 | 0 |
# Copyright (c) 2014 by Ecreall under licence AGPL terms
# available on http://www.gnu.org/licenses/agpl.html
# licence: AGPL
# author: Amen Souissi
from pyramid.view import view_config
from pyramid.httpexceptions import HTTPFound
from dace.util import getSite
from dace.processinstance.core import DEFAULTMAPPING_A... | ecreall/lagendacommun | lac/views/services_processes/import_service/see_service.py | Python | agpl-3.0 | 1,732 | 0.001732 |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import re
import subprocess
import sys
import tarfile
import tempfile
import test_server
import unittest
import zipfile
... | zcbenz/cefode-chromium | native_client_sdk/src/build_tools/tests/sdktools_test.py | Python | bsd-3-clause | 8,659 | 0.005197 |
import requests
"""The available regions"""
REGIONS = {
'US': 'https://us.api.battle.net/wow',
'EU': 'https://eu.api.battle.net/wow',
'KR': 'https://kr.api.battle.net/wow',
'TW': 'https://tw.api.battle.net/wow'
}
"""The available fields for use to get more detailed information for a specific character... | GoblinLedger/wowapi | wowapi/__init__.py | Python | mit | 9,460 | 0.00222 |
# 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... | noironetworks/neutron | neutron/_i18n.py | Python | apache-2.0 | 1,049 | 0 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2009, 2010, 2011 CERN.
##
## Invenio 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 yo... | kaplun/Invenio-OpenAIRE | modules/websubmit/lib/bibdocfile_regression_tests.py | Python | gpl-2.0 | 12,722 | 0.011083 |
from django.core.exceptions import PermissionDenied
def require_permission(user, *args):
for arg in args:
if not user.has_perm(arg):
raise PermissionDenied("Action %s not allowed" % arg) | Lapeth/timeline | Timeline/util/Permissions.py | Python | apache-2.0 | 211 | 0.009479 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Based on AboutClassMethods in the Ruby Koans
#
from runner.koan import *
class AboutClassAttributes(Koan):
class Dog:
pass
def test_objects_are_objects(self):
fido = self.Dog()
self.assertEqual(True, isinstance(fido, object))
def... | gregkorte/Python-Koans | python3/koans/about_class_attributes.py | Python | mit | 4,882 | 0.001639 |
#!/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... | jayceyxc/hue | apps/jobbrowser/src/jobbrowser/apis/workflow_api.py | Python | apache-2.0 | 6,200 | 0.009194 |
from cn import ast,tokenSpec
tokens = tokenSpec.tokens
precedence = (
('left', 'OR', 'AND'),
('left', 'EQ', 'NE', 'LE', 'LT', 'GT', 'GE'),
('left', 'PLUS', 'MINUS'),
('left', 'TIMES', 'DIVIDE'),
('left', 'MOD'),
('right', 'PIPE')
)
def p_program(t):
'program : imports declaration_list... | OrangeShark/senior-project | cn/grammar.py | Python | gpl-3.0 | 8,351 | 0.022393 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.