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 |
|---|---|---|---|---|---|---|
from wordsalad import WordSaladMatrixBuilder
import unittest
class TestWordSaladMatrixBuilder(unittest.TestCase):
def setUp(self):
self.builder = WordSaladMatrixBuilder()
def test_count_followers_in_sequence_no_endmarker(self):
seq = [1, 2, 3]
self.builder.count_followers_in_sequence(... | skurmedel/wordsalad | tests/test_matrix.py | Python | mit | 1,110 | 0.004505 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#####################################################################
# Frets on Fire X (FoFiX) #
# Copyright (C) 2006 Sami Kyöstilä #
# 2008 evilynux <evilynux@gmail.com> ... | fofix/fofix | fofix/game/Main.py | Python | gpl-2.0 | 5,400 | 0.000926 |
# -*- coding: utf-8 -*-
"""
Tests for DatetimeArray
"""
import operator
import numpy as np
import pytest
from pandas.core.dtypes.dtypes import DatetimeTZDtype
import pandas as pd
from pandas.core.arrays import DatetimeArray
from pandas.core.arrays.datetimes import sequence_to_dt64ns
import pandas.util.testing as tm
... | GuessWhoSamFoo/pandas | pandas/tests/arrays/test_datetimes.py | Python | bsd-3-clause | 10,666 | 0 |
import numpy
class DifferentialEvolutionAbstract:
amount_of_individuals = None
f = None
p = None
end_method = None
def __init__(self, min_element=-1, max_element=1):
self.min_element = min_element
self.max_element = max_element
self.f = 0.5
self.p = 0.9
se... | QuantumTechDevStudio/RUDNEVGAUSS | archive/solver/DifferentialEvolutionAbstract.py | Python | gpl-3.0 | 1,558 | 0.000666 |
import platform
from datetime import datetime
import pyexcel as pe
from flask import Flask, abort, jsonify, request
from flask_sqlalchemy import SQLAlchemy
import flask_excel as excel
app = Flask(__name__)
data = [[1, 2, 3], [4, 5, 6]]
if platform.python_implementation() == "PyPy":
app.config["SQLALCHEMY_DATAB... | chfw/Flask-Excel | tests/testapp.py | Python | bsd-3-clause | 4,610 | 0 |
import sys, pygame, math, random, time
from Level import *
from Player import *
from Enemy import *
from NPC import *
from Menu import *
from Item import *
pygame.init()
clock = pygame.time.Clock()
width = 1000
height = 700
size = width, height
bgColor = r,b,g = 255,255,255
screen = pygame.display.set_mode(size)
m... | KRHS-GameProgramming-2015/Adlez | Adlez.py | Python | bsd-2-clause | 6,657 | 0.011417 |
from lab import *
from pylab import *
from uncertainties import *
from uncertainties import unumpy
from statistics import *
from scipy.constants import *
import getpass
users={"candi": "C:\\Users\\candi\\Documents\\GitHub\\Lab3.2\\",
"silvanamorreale":"C:\\Users\\silvanamorreale\\Documents\\GitHub\\Lab3.2\\" ,
"Studen... | AleCandido/Lab3.2 | 4_Ottica1/cadmio.py | Python | gpl-2.0 | 2,784 | 0.019044 |
from fabric.api import run
from cbagent.collectors.libstats.decorators import multi_node_task
class SystemStats(object):
def __init__(self, hosts, user, password):
self.hosts = hosts
self.user = user
self.password = password
@multi_node_task
def swap_usage(ip):
output = ... | ronniedada/litmus | collectors/cbagent/collectors/libstats/systemstats.py | Python | apache-2.0 | 869 | 0 |
# 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... | jeffzheng1/tensorflow | tensorflow/contrib/layers/python/layers/feature_column_ops.py | Python | apache-2.0 | 36,030 | 0.004496 |
import glob
import os
import shutil
import sys
import unittest
from test.support import (TESTFN, skip_unless_symlink,
can_symlink, create_empty_file, change_cwd)
class GlobTests(unittest.TestCase):
def norm(self, *parts):
return os.path.normpath(os.path.join(self.tempdir, *part... | kikocorreoso/brython | www/src/Lib/test/test_glob.py | Python | bsd-3-clause | 13,345 | 0.000225 |
from __future__ import unicode_literals, print_function
from nose.tools import assert_equal
import glob
import json
import mf2py
import os.path
import sys
from test_parser import check_unicode
assert_equal.__self__.maxDiff = None
def test_mf2tests():
allfiles = glob.glob(
os.path.join('.', 'testsuite', ... | tommorris/mf2py | test/test_suite.py | Python | mit | 886 | 0.001129 |
# -*- coding: utf-8 -*-
from django.conf import settings
from django.db import models
from django.utils import importlib
from django.utils.translation import ugettext_lazy as _
from django.core.exceptions import ImproperlyConfigured
from django.contrib.auth.models import Group
from django.contrib.sites.models import Si... | SurfasJones/djcmsrc3 | venv/lib/python2.7/site-packages/cms/models/permissionmodels.py | Python | mit | 5,696 | 0.002282 |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import profile_creator
import logging
import page_sets
from telemetry import benchmark
from telemetry.page import page_test
from teleme... | sgraham/nope | tools/perf/profile_creators/small_profile_creator.py | Python | bsd-3-clause | 2,596 | 0.00963 |
#from feedback import FeedbackV4 # removed from WP API
#from feedback import FeedbackV5 # removed from WP API
from article_history import ArticleHistory
from assessment import Assessment
from backlinks import Backlinks
from dom import DOM
from google import GoogleNews
from google import GoogleSearch
from grokse impor... | mahmoud/womp | womp/inputs/__init__.py | Python | gpl-3.0 | 1,255 | 0.001594 |
# coding=utf-8
# Copyright 2018 The DisentanglementLib 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
#
# Un... | google-research/disentanglement_lib | disentanglement_lib/evaluation/metrics/fairness.py | Python | apache-2.0 | 8,341 | 0.007553 |
"""HTTP end-points for the User API. """
import copy
from opaque_keys import InvalidKeyError
from django.conf import settings
from django.contrib.auth.models import User
from django.http import HttpResponse
from django.core.urlresolvers import reverse
from django.core.exceptions import ImproperlyConfigured, NON_FIELD_E... | jbzdak/edx-platform | openedx/core/djangoapps/user_api/views.py | Python | agpl-3.0 | 33,442 | 0.001615 |
import os
import threading
import logging
from yowsup import env
from yowsup.stacks import YowStack, YOWSUP_CORE_LAYERS, YOWSUP_PROTOCOL_LAYERS_FULL
from yowsup.layers import YowLayerEvent
from yowsup.layers.auth import YowAuthenticationProtocolLayer
from yowsup.layers.coder import YowCoderLayer
from yowsup.layers.net... | tax/pywhatsapp | whatsapp.py | Python | bsd-3-clause | 6,224 | 0.003213 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack Foundation
# 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.apach... | eltonkevani/tempest_el_env | tempest/api/compute/volumes/test_volumes_list.py | Python | apache-2.0 | 4,824 | 0 |
#!/usr/bin/python
# Copyright: 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
ANSIBLE_METADATA = {'metadata_version': '1.0',
'status': ['preview'],
... | bearstech/ansible | lib/ansible/modules/cloud/google/gce_instance_template.py | Python | gpl-3.0 | 19,122 | 0.00068 |
# /test/test_linter_acceptance.py
#
# Acceptance tests for polysquarelinter.linter, actually runs
# main() and checks results of various functions.
#
# Disable no-self-use in tests as all test methods must be
# instance methods and we don't necessarily have to use a matcher
# with them.
# pylint:disable=no-self-use
#
#... | polysquare/polysquare-generic-file-linter | test/test_linter_acceptance.py | Python | mit | 11,503 | 0 |
from unittest import TestCase
from plivo import plivoxml
from tests import PlivoXmlTestCase
class SayAsElementTest(TestCase, PlivoXmlTestCase):
def test_set_methods(self):
expected_response = '<Response><Speak><say-as format="application/ssml+xml" interpret-as="spell-out">' \
... | plivo/plivo-python | tests/xml/test_sayAsElement.py | Python | mit | 789 | 0.002535 |
# pylint: disable=E1103
import pytest
from datetime import datetime, date
from numpy.random import randn
from numpy import nan
import numpy as np
import random
import pandas as pd
from pandas.compat import lrange, lzip
from pandas.core.reshape.concat import concat
from pandas.core.reshape.merge import merge, MergeErr... | Winand/pandas | pandas/tests/reshape/test_merge.py | Python | bsd-3-clause | 64,631 | 0.000031 |
# -*- coding: utf-8 -*-
"""
Admin Controllers
"""
module = "admin"
resourcename = request.function
# Options Menu (available in all Functions' Views)
# - can Insert/Delete items from default menus within a function, if required.
s3_menu(module)
# S3 framework functions
# ----------------------------------------... | flavour/porto | controllers/admin.py | Python | mit | 53,568 | 0.006907 |
from django.core.exceptions import ValidationError
from django.db import connection
from django.db.models import (
CharField, ForeignKey, ManyToManyField, PROTECT, BooleanField)
from django.urls import reverse
from django.utils.html import strip_tags
from django.utils.safestring import mark_safe
from django.utils.t... | dezede/dezede | libretto/models/individu.py | Python | bsd-3-clause | 12,969 | 0.000233 |
# Copyright (c) 2017 Fujitsu Limited
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | noironetworks/neutron | neutron/tests/unit/services/logapi/common/test_db_api.py | Python | apache-2.0 | 14,273 | 0 |
# Copyright 2015 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 a... | martinbede/second-sight | tensorflow/examples/tutorials/word2vec/word2vec_basic.py | Python | apache-2.0 | 8,770 | 0.011403 |
# ===============================================================================
# Copyright 2013 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/licens... | USGSDenverPychron/pychron | pychron/mv/degas/degasser.py | Python | apache-2.0 | 12,798 | 0.000391 |
"""
WSGI config for django_db project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_db.settings")
from django.co... | wfarn/scratchpad | django/django_db/django_db/wsgi.py | Python | apache-2.0 | 393 | 0.002545 |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | xzturn/tensorflow | tensorflow/tools/gcs_test/python/gcs_smoke.py | Python | apache-2.0 | 10,461 | 0.013765 |
# Copyright (c) 2012 CNRS
# Author: Florent Lamiraux
#
# This file is part of hpp-corbaserver.
# hpp-corbaserver is free software: you can redistribute it
# and/or modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation, either version
# 3 of the License, or (at... | humanoid-path-planner/hpp-corbaserver | src/hpp/__init__.py | Python | lgpl-3.0 | 1,269 | 0.002364 |
# Dict'O'nator - A dictation plugin for gedit.
# Copyright (C) <2016> <Abhinav Singh>
#
# This file is part of Dict'O'nator.
#
# Dict'O'nator 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 o... | theawless/Dict-O-nator | dictonator/setlog.py | Python | gpl-3.0 | 1,573 | 0.000636 |
# Copyright (C) 2018 Henrique Pereira Coutada Miranda, Alejandro Molina Sanchez, Alexandre Morlet, Fulvio Paleari
#
# All rights reserved.
#
# This file is part of yambopy
#
#
import os
from operator import itemgetter
from collections import OrderedDict
from yambopy import *
#
# by Henrique Miranda.
#
def pack_files_i... | henriquemiranda/yambo-py | yambopy/recipes.py | Python | bsd-3-clause | 20,837 | 0.022172 |
# -*- coding: UTF-8 -*-
#######################################################################
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# @tantrumdev wrote this file. As long as you retain this notice you
# can do whatever you want wit... | repotvsupertuga/tvsupertuga.repository | script.module.streamtvsupertuga/lib/resources/lib/sources/en/moviesleak.py | Python | gpl-2.0 | 6,709 | 0.015502 |
import taichi as ti
from tests import test_utils
@test_utils.test(exclude=[ti.opengl])
def test_ret_write():
@ti.kernel
def func(a: ti.i16) -> ti.f32:
return 3.0
assert func(255) == 3.0
@test_utils.test(exclude=[ti.opengl])
def test_arg_read():
x = ti.field(ti.i32, shape=())
@ti.kernel... | yuanming-hu/taichi | tests/python/test_arg_alignment.py | Python | mit | 418 | 0 |
import logging
from functools import reduce
import nanoget.utils as ut
import pandas as pd
import sys
import pysam
import re
from Bio import SeqIO
import concurrent.futures as cfutures
from itertools import repeat
def process_summary(summaryfile, **kwargs):
"""Extracting information from an albacore summary file.... | wdecoster/nanoget | nanoget/extraction_functions.py | Python | gpl-3.0 | 18,527 | 0.003023 |
from keras.models import Sequential
from keras.layers.core import Flatten, Dense, Dropout
from keras.layers.convolutional import Convolution2D, MaxPooling2D, ZeroPadding2D
from keras.optimizers import SGD
import numpy as np
def VGG_16(weights_path=None):
model = Sequential()
model.add(ZeroPadding2D((1,1),input... | qxcv/joint-regressor | keras/vggnet/vgg16_keras.py | Python | apache-2.0 | 2,604 | 0.014209 |
# Copyright 2017 Nokia
#
# 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... | naveensan1/nuage-openstack-neutron | nuage_neutron/plugins/common/trunk_db.py | Python | apache-2.0 | 3,135 | 0 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*-
# vi: set ft=python sts=4 ts=4 sw=4 noet :
# This file is part of Fail2Ban.
#
# Fail2Ban 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;... | szepeviktor/fail2ban | fail2ban/tests/samplestestcase.py | Python | gpl-2.0 | 5,376 | 0.023251 |
import dbus_async
@asyncio.coroutine
def dbus_hello_client(bus):
# create message
helloWorld = Method("HelloWorld",
path="/remote/object/path",
iface="com.example.Sample",
bus=bus)
# wait reply
result = yield from helloWorld("Anon... | hugosenari/dbus_async | example/low_api_client.py | Python | isc | 1,198 | 0.010017 |
class FileInput:
"""Retrieves the contents of a file and passes them to InputSets."""
def __init__(self,inputSets,filename):
"""
@param inputSets: List of target InputSets
@param filename: Name of file to be scanned for input
"""
with open(filename,'rU') as f:
text = f.read()
for i in inputSets:
... | agold/svgchart | lib/input/FileInput.py | Python | apache-2.0 | 333 | 0.042042 |
#
# Copyright (C) 2012, Martin Zibricky
# Copyright (C) 2011, Hartmut Goebel
# Copyright (C) 2005, Giovanni Bajo
#
# 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 Licen... | supercheetah/diceroller | pyinstaller/PyInstaller/hooks/hook-_tkinter.py | Python | artistic-2.0 | 5,503 | 0.001272 |
import sys
import os
import unittest
import time
from mock import Mock, patch
sys.path.append(os.path.abspath("."))
sys.path.append(os.path.abspath("rpirobot"))
from rpirobot.robot import Robot
class TestRobot(unittest.TestCase):
"""Tests for Robot class."""
def setUp(self):
self.robot = Robot()
... | climbus/RPiRobot | tests/test_robot.py | Python | mit | 10,802 | 0.000833 |
import json
from typing import Tuple
from great_expectations.core.id_dict import IDDict
class MetricConfiguration:
def __init__(
self,
metric_name: str,
metric_domain_kwargs: dict,
metric_value_kwargs: dict = None,
metric_dependencies: dict = None,
):
self._met... | great-expectations/great_expectations | great_expectations/validator/metric_configuration.py | Python | apache-2.0 | 2,379 | 0 |
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 28 17:49:08 2014
@author: chuong nguyen, chuong.v.nguyen@gmail.com
"""
from __future__ import absolute_import, division, print_function
import cv2
import logging
import timestream
import numpy as np
from timestream.parse import ts_parse_date
import docopt
import datetime... | borevitzlab/timestreamlib | scripts/tscli/playTimestream.py | Python | gpl-3.0 | 2,769 | 0.009029 |
#!/usr/bin/env python
'''waypoint command handling'''
import time, os, fnmatch, copy, platform
from pymavlink import mavutil, mavwp
from MAVProxy.modules.lib import mp_module
from MAVProxy.modules.lib import mp_util
if mp_util.has_wxpython:
from MAVProxy.modules.lib.mp_menu import *
class WPModule(mp_module.MPMod... | monkeypants/MAVProxy | MAVProxy/modules/mavproxy_wp.py | Python | gpl-3.0 | 33,902 | 0.003186 |
Package ('libicu', '55.1',
source_dir_name = 'icu/source',
sources = [
'http://download.icu-project.org/files/icu4c/%{version}/icu4c-55_1-src.tgz'
]
)
| BansheeMediaPlayer/bockbuild | packages/libicu.py | Python | mit | 156 | 0.070513 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# HORTON: Helpful Open-source Research TOol for N-fermion systems.
# Copyright (C) 2011-2017 The HORTON Development Team
#
# This file is part of HORTON.
#
# HORTON is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public Licens... | QuantumElephant/horton | scripts/horton-convert.py | Python | gpl-3.0 | 2,641 | 0.009087 |
from .botan import Botan
__all__ = ['Botan']
| rogerscristo/BotFWD | env/lib/python3.6/site-packages/telegram/contrib/__init__.py | Python | mit | 49 | 0 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | AutorestCI/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_peering.py | Python | mit | 4,677 | 0.00171 |
import wx
# Overall menu styles
StyleDefault = 0
StyleXP = 1
Style2007 = 2
StyleVista = 3
# Menu shadows
RightShadow = 1 # Right side shadow
BottomShadow = 2 # Not full bottom shadow
BottomShadowFull = 4 # Full bottom shadow
# Button styles
BU_EXT_XP_STYLE = 1
B... | ktan2020/legacy-automation | win/Lib/site-packages/wx-3.0-msw/wx/lib/agw/fmresources.py | Python | mit | 13,594 | 0.008092 |
from Screens.MessageBox import MessageBox
from Screens.ParentalControlSetup import ProtectedScreen
from Components.config import config
class FactoryReset(MessageBox, ProtectedScreen):
def __init__(self, session):
MessageBox.__init__(self, session, _("Factory reset will restore your receiver to its default configur... | Antonio-Team/enigma2 | lib/python/Screens/FactoryReset.py | Python | gpl-2.0 | 1,088 | 0.020221 |
import math
import logging
from pymoku._instrument import MokuInstrument
from pymoku._instrument import to_reg_unsigned
from pymoku._instrument import from_reg_unsigned
from pymoku._instrument import to_reg_signed
from pymoku._instrument import from_reg_signed
from pymoku._instrument import to_reg_bool
from pymoku._in... | liquidinstruments/pymoku | pymoku/_frequency_response_analyzer.py | Python | mit | 22,648 | 0 |
# 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 RDynamictreecut(RPackage):
"""dynamicTreeCut: Methods for Detection of Clusters in Hierarc... | iulian787/spack | var/spack/repos/builtin/packages/r-dynamictreecut/package.py | Python | lgpl-2.1 | 744 | 0.005376 |
#!/usr/bin/env python
# vim:fileencoding=utf-8
# Find the best reactor
reactorchoices = ["epollreactor", "kqreactor", "cfreactor", "pollreactor", "selectreactor", "posixbase", "default"]
for choice in reactorchoices:
try:
exec("from twisted.internet import %s as bestreactor" % choice)
break
except:
pass
bestre... | mayson/viperpeers | viperpeers.py | Python | gpl-2.0 | 45,342 | 0.047087 |
from __future__ import unicode_literals, print_function
import os
import sys
import subprocess
import json
from ape import feaquencer
from ape import tasks
from .exceptions import ContainerError, ContainerNotFound, ProductNotFound
class Config(object):
APE_ROOT = os.environ['APE_ROOT_DIR']
SOURCE_HEADER = '#... | henzk/ape | ape/container_mode/tasks.py | Python | mit | 12,347 | 0.002349 |
# -*- coding: utf-8 -*-
import pyqtgraph as pg
from pyqtgraph.Qt import QtGui, QtCore
import numpy as np
import csv, gzip, os
from pyqtgraph import Point
class GlassDB:
"""
Database of dispersion coefficients for Schott glasses
+ Corning 7980
"""
def __init__(self, fileName='schott_glasses.csv'):
... | pmaunz/pyqtgraph | examples/optics/pyoptic.py | Python | mit | 18,598 | 0.008229 |
def python_evaluate(text):
return eval(str(text))
def python_print(*values, sep=' '):
joined = sep.join((str(v) for v in values))
print(joined)
def python_list(*args):
return args
def error(text=''):
raise RuntimeError(text) | osspeak/osspeak | osspeak/recognition/actions/library/general.py | Python | mit | 247 | 0.016194 |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
from poster.encode import multipart_encode
from poster.streaminghttp import register_openers
import urllib2,urllib,sys,time
import cookielib,mechanize
import re
DEBUG =0
reload(sys)
sys.setdefaultencoding('utf8') #@UndefinedVariable
register_openers()
headers = {
... | ptphp/PyLib | src/webpy1/webpy1.1/post/post_anju.py | Python | apache-2.0 | 4,425 | 0.018079 |
from JumpScale import j
import JumpScale.grid.gevent
import JumpScale.baselib.key_value_store
import JumpScale.baselib.serializers
from .ZDaemonFactory import ZDaemonFactory
j.base.loader.makeAvailable(j, 'core')
j.core.zdaemon = ZDaemonFactory()
j.base.loader.makeAvailable(j, 'servers')
j.servers.zdaemon = ZDaemon... | Jumpscale/jumpscale6_core | lib/JumpScale/grid/zdaemon/__init__.py | Python | bsd-2-clause | 330 | 0 |
# /* PANDABEGINCOMMENT
# *
# * Authors:
# * Tim Leek tleek@ll.mit.edu
# * Ryan Whelan rwhelan@ll.mit.edu
# * Joshua Hodosh josh.hodosh@ll.mit.edu
# * Michael Zhivich mzhivich@ll.mit.edu
# * Brendan Dolan-Gavitt brendandg@gatech.edu
# *
# * This work is licensed under t... | KernelAnalysisPlatform/kvalgrind | qemu/panda_plugins/syscalls/syscall_parser.py | Python | gpl-3.0 | 16,902 | 0.007159 |
# -*- coding: utf-8 -*-
import re
from time import mktime, strptime
from module.plugins.Account import Account
class DebridItaliaCom(Account):
__name__ = "DebridItaliaCom"
__type__ = "account"
__version__ = "0.11"
__description__ = """Debriditalia.com account plugin"""
__license__ = ... | sebdelsol/pyload | module/plugins/accounts/DebridItaliaCom.py | Python | gpl-3.0 | 1,321 | 0.006813 |
# functions for processing the parsed syntax tree
import sys
import decimal
import string
import logger
# list of standard functions (from <math.h>) that are
# already known to be included in the destination
# NB: this list is fairly minimal -- the actual math.h
# for a contemporary C compiler is likely to include
# m... | buck06191/BayesCMD | bparser/ast.py | Python | gpl-2.0 | 36,960 | 0.011986 |
#!/usr/bin/python
#-*- coding: utf-8 -*-
###########################################################
# © 2011 Daniel 'grindhold' Brendle and Team
#
# This file is part of Skarphed.
#
# Skarphed is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License
# as ... | skarphed/skarphed | admin/src/skarphedadmin/gui/ServerPropertyPage.py | Python | agpl-3.0 | 10,902 | 0.013212 |
import _plotly_utils.basevalidators
class BordercolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="bordercolor", parent_name="ohlc.hoverlabel", **kwargs
):
super(BordercolorValidator, self).__init__(
plotly_name=plotly_name,
pa... | plotly/python-api | packages/python/plotly/plotly/validators/ohlc/hoverlabel/_bordercolor.py | Python | mit | 526 | 0.001901 |
#!/usr/bin/env python
"""
Copyright 2016 ARC Centre of Excellence for Climate Systems Science
author: Scott Wales <scott.wales@unimelb.edu.au>
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
h... | ScottWales/mosrs-setup | mosrs/setup.py | Python | apache-2.0 | 7,573 | 0.009375 |
# Copyright (c) 2001-2015, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public tr... | ballouche/navitia | source/jormungandr/jormungandr/scenarios/journey_filter.py | Python | agpl-3.0 | 15,470 | 0.00362 |
# -*- coding: utf-8 -*-
#
# HSPI documentation build configuration file, created by
# sphinx-quickstart on Sun Feb 26 17:22:42 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All ... | dpmurphy/HSPI | docs/source/conf.py | Python | mit | 5,577 | 0.001614 |
from ..helpers import nativestr
def list_to_dict(aList):
return {nativestr(aList[i][0]): nativestr(aList[i][1]) for i in range(len(aList))}
def parse_range(response):
"""Parse range response. Used by TS.RANGE and TS.REVRANGE."""
return [tuple((r[0], float(r[1]))) for r in response]
def parse_m_range(r... | mozillazg/redis-py-doc | redis/commands/timeseries/utils.py | Python | mit | 1,309 | 0.002292 |
"""The dhcp integration."""
from abc import abstractmethod
from datetime import timedelta
import fnmatch
from ipaddress import ip_address as make_ip_address
import logging
import os
import threading
from aiodiscover import DiscoverHosts
from aiodiscover.discovery import (
HOSTNAME as DISCOVERY_HOSTNAME,
IP_AD... | Danielhiversen/home-assistant | homeassistant/components/dhcp/__init__.py | Python | apache-2.0 | 13,216 | 0.001059 |
# Lint as: python3
"""The abstract robot class."""
import abc
from typing import Optional, Sequence
# Action names for robots operating kinematically.
LINEAR_VELOCITY = "linear_velocity"
ANGULAR_VELOCITY = "angular_velocity"
class RobotBase(metaclass=abc.ABCMeta):
"""The base class for all robots used in the mobi... | nrz/ylikuutio | external/bullet3/examples/pybullet/gym/pybullet_envs/minitaur/robots/robot_base.py | Python | agpl-3.0 | 4,709 | 0.007008 |
import RPi.GPIO as GPIO
import time
INT1=11
INT2=12
INT3=13
INT4=15
GPIO.setmode(GPIO.BOARD)
GPIO.setup(INT1,GPIO.OUT)
GPIO.setup(INT2,GPIO.OUT)
GPIO.setup(INT3,GPIO.OUT)
GPIO.setup(INT4,GPIO.OUT)
GPIO.output(INT1,GPIO.LOW)
GPIO.output(INT2,GPIO.HIGH)
GPIO.output(INT3,False)
GPIO.output(INT4,False)
time.sleep(0.8)
GPIO... | HandsomeYingyan/rpi-speech-recognition-car | contror/BACK.py | Python | agpl-3.0 | 331 | 0.036254 |
# 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... | grengojbo/st2 | st2auth/st2auth/backends/__init__.py | Python | apache-2.0 | 1,972 | 0.001014 |
from arza.types.root import W_Root
from arza.types import space
from arza.types import api
from arza.runtime import error
class W_PList(W_Root):
def __init__(self, head, tail):
self.head = head
self.tail = tail
def __iter__(self):
cur = self
while not is_empty(cur):
... | gloryofrobots/obin | arza/types/plist.py | Python | gpl-2.0 | 11,988 | 0.000167 |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import absolute_import
import os
import re
from py_vulcanize import style_sheet
class HTMLGenerationController(object):
def __init__(sel... | catapult-project/catapult | common/py_vulcanize/py_vulcanize/html_generation_controller.py | Python | bsd-3-clause | 934 | 0.008565 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file './Plugins/VcsPlugins/vcsMercurial/HgBundleDialog.ui'
#
# Created: Tue Nov 18 17:53:57 2014
# by: PyQt5 UI code generator 5.3.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class U... | davy39/eric | Plugins/VcsPlugins/vcsMercurial/Ui_HgBundleDialog.py | Python | gpl-3.0 | 9,093 | 0.002969 |
## www.pubnub.com - PubNub Real-time push service in the cloud.
# coding=utf8
## PubNub Real-time Push APIs and Notifications Framework
## Copyright (c) 2010 Stephen Blum
## http://www.pubnub.com/
## TODO Tests
##
## - wait 20 minutes, send a message, receive and success.
## -
## -
##
##
## -------------------------... | gdassori/python | python-twisted/tests/unit-test-full.py | Python | mit | 7,584 | 0.006337 |
# Created By: Virgil Dupras
# Created On: 2009-04-23
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-... | hsoft/dupeguru | qt/results_model.py | Python | gpl-3.0 | 3,932 | 0.000763 |
# -*- coding: ascii -*-
r"""
:Copyright:
Copyright 2007 - 2015
Andr\xe9 Malo or his licensors, as applicable
:License:
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.... | ndparker/tdi | tdi/tools/htmlform/_adapters.py | Python | apache-2.0 | 4,395 | 0 |
from django.shortcuts import render
from django.contrib.auth.decorators import permission_required
from django.conf import settings
from django.template import RequestContext
from django.template.loader import render_to_string
from wagtail.wagtailadmin import hooks
from wagtail.wagtailcore.models import Page, PageRev... | suziesparkle/wagtail | wagtail/wagtailadmin/views/home.py | Python | bsd-3-clause | 2,933 | 0.003069 |
# This file is part of ArcJail.
#
# ArcJail 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.
#
# ArcJail is distributed in the hope that... | KirillMysnik/ArcJail | srcds/addons/source-python/plugins/arcjail/modules/arcjail/arcjail_user.py | Python | gpl-3.0 | 9,070 | 0.001985 |
from django.contrib import admin
from .models import Link, LinkCategory
from dpb.admin import PageDownAdmin
class LinkAdmin(PageDownAdmin):
list_display = ('title', 'state', 'category', 'website')
list_filter = ('category',)
search_fields = ['title']
admin.site.register(Link, LinkAdmin)
admin.site.regi... | n2o/dpb | links/admin.py | Python | mit | 339 | 0 |
# Copyright 2012 OpenStack Foundation
# 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 requ... | ntymtsiv/tempest | tempest/api/identity/admin/test_users.py | Python | apache-2.0 | 9,689 | 0 |
## $Id: tools.py 23525 2011-05-12 04:11:40Z davea $
import configxml
try:
# use new hashlib if available
from hashlib import md5
except:
import md5
import os, shutil, binascii, filecmp
# from http://www.plope.com/software/uuidgen/view
_urandomfd = None
def urandom(n):
"""urandom(n) -> str
Return ... | asimonov-im/boinc | py/Boinc/tools.py | Python | gpl-3.0 | 2,065 | 0.00678 |
#!/usr/bin/env python
import unittest
from test import test_support
import socket
import urllib
import sys
import os
import mimetools
class URLTimeoutTest(unittest.TestCase):
TIMEOUT = 10.0
def setUp(self):
socket.setdefaulttimeout(self.TIMEOUT)
def tearDown(self):
socket.setdefaulttim... | MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.3/Lib/test/test_urllibnet.py | Python | mit | 5,447 | 0.001652 |
#!/usr/bin/env python
__author__ = 'Mike McCann,Duane Edgington,Danelle Cline'
__copyright__ = '2018'
__license__ = 'GPL v3'
__contact__ = 'duane at mbari.org'
__doc__ = '''
Master loader for all CANON May-June Campaign 2018
Mike McCann, Duane Edgington, Danelle Cline
MBARI 15 May 2018
@var __date__: Date of last s... | danellecline/stoqs | stoqs/loaders/CANON/loadCANON_september2018.py | Python | gpl-3.0 | 20,474 | 0.006936 |
import io
import unittest
import xml.sax
from xml.sax.xmlreader import AttributesImpl
from xml.sax.handler import feature_external_ges
from xml.dom import pulldom
from test.support import findfile
tstfile = findfile("test.xml", subdir="xmltestdata")
# A handy XML snippet, containing attributes, a namespace prefix,... | FFMG/myoddweb.piger | monitor/api/python/Python-3.7.2/Lib/test/test_pulldom.py | Python | gpl-2.0 | 12,628 | 0.000634 |
"""
Helper module for Python version 2.6 and below
- Ordered dictionaries
- Encoding/decoding urls
- Unicode
- Exception handling (except Exception, e)
"""
import base64
from urllib import unquote, quote
try:
from ordereddict import OrderedDict
except:
pass
def modulename():
return 'Helper module for Pyt... | martomo/SublimeTextXdebug | xdebug/helper/helper_26.py | Python | mit | 1,428 | 0.001401 |
from btmux_template_io.item_table import ITEM_TABLE
from btmux_template_io.parsers.ssw.crit_mapping import PHYSICAL_WEAPON_MAP, \
EQUIPMENT_MAP
from . ammo import add_ammo
from . common import add_crits_from_locations
from . weapons import add_weapon
def populate_equipment(xml_root, unit_obj):
"""
Equipm... | gtaylor/btmux_template_io | btmux_template_io/parsers/ssw/populators/equipment.py | Python | bsd-3-clause | 2,429 | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class AccountInfo(models.Model):
user = models.ForeignKey(User)
balance = models.IntegerField()
DISH_NAME_MAX_LENGTH = 20
class Order(models.Model):
offerer ... | sysuccc/QiuDaBao | qiudabao/models.py | Python | gpl-2.0 | 617 | 0.025932 |
# Portions Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2.
# Copyright Mercurial Contributors
#
# This software may be used and distributed according to the terms of the
# GNU General Public License v... | facebookexperimental/eden | eden/scm/edenscm/mercurial/annotate.py | Python | gpl-2.0 | 4,963 | 0.000403 |
#!/usr/bin/env python
# -*- coding: utf-8; tab-width: 4; indent-tabs-mode: t -*-
#
# NetProfile: Authentication routines
# © Copyright 2013-2014 Alex 'Unik' Unigovsky
#
# This file is part of NetProfile.
# NetProfile is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General ... | annndrey/npui-unik | netprofile/netprofile/common/auth.py | Python | agpl-3.0 | 6,265 | 0.025064 |
#!/usr/bin/env python
#
# special_tests.py: testing special and reserved file handling
#
# Subversion is a tool for revision control.
# See http://subversion.tigris.org for more information.
#
# ====================================================================
# Copyright (c) 2000-2007 CollabNet. All rights res... | bdmod/extreme-subversion | BinarySourcce/subversion-1.6.17/subversion/tests/cmdline/special_tests.py | Python | gpl-2.0 | 22,957 | 0.015943 |
import unittest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
class php4dvd_search_film_negative(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Firefox()
self.driver.implicitly_wait(20)
def test_search_negative(self):
driver = self.drive... | ArtemVavilov88/test2-Se-Python-14 | test_search_negative.py | Python | apache-2.0 | 1,089 | 0.003673 |
"""
dqm offline setup:
Sets up CMSSW and the latest code to preduce OfflineDQM plots
Usage:
dqm offline setup
"""
import logging
import os
import string
import hepshell
from hepshell.interpreter import time_function
from l1t_cli.setup import WORKSPACE, INTEGRATION_TAG
LOG = logging.ge... | kreczko/l1t_cli | l1t_cli/commands/dqm/offline/setup/__init__.py | Python | apache-2.0 | 2,339 | 0.002138 |
class PublicClass:
pass
class _PrivateClass:
pass
def public_function():
pass
def _private_function():
pass
| josiah-wolf-oberholtzer/uqbar | tests/fake_package/multi/two.py | Python | mit | 130 | 0 |
# -*- coding: utf-8 -*-
# Copyright (c) 2008 - 2009 Lukas Hetzenecker <LuHe@gmx.at>
from PyQt4.QtCore import *
from PyQt4.QtGui import *
# Matplotlib
try:
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt4 import NavigationToolbar2QT as Navig... | ypid/series60-remote | pc/widget/ContactCanvas.py | Python | gpl-2.0 | 1,696 | 0.019458 |
# core django imports
from django.contrib import admin
# imports from your apps
from .models import Lookout
@admin.register(Lookout)
class LookoutAdmin(admin.ModelAdmin):
list_display = ('id', 'created', 'modified', 'owner', 'isbn')
list_filter = ('created', 'modified', 'owner')
| srct/bookshare | bookshare/lookouts/admin.py | Python | gpl-3.0 | 290 | 0 |
# Copyright 2011 Nicholas Bray
#
# 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... | ncbray/pystream | bin/tests/test_tvl.py | Python | apache-2.0 | 3,771 | 0.024397 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('agency', '0013_auto_20150726_0001'),
]
operations = [
migrations.AlterField(
model_name='feedinfo',
... | renanalencar/hermes | agency/migrations/0014_auto_20150726_1411.py | Python | mit | 468 | 0.002137 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-04-10 07:17
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0001_squashed_0008'),
]
operations = [
migrations.RemoveField(
... | opennode/nodeconductor | waldur_core/core/migrations/0002_remove_organization.py | Python | mit | 398 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.