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 |
|---|---|---|---|---|---|---|
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# This file is part of qmljs, the QML/JS language support plugin for KDevelop
# Copyright (c) 2014 Denis Steckelmacher <steckdenis@yahoo.fr>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# pub... | mali/kdevelop | languages/qmljs/nodejsmodules/http.py | Python | gpl-2.0 | 3,792 | 0.001582 |
#!/usr/bin/env python
# -*- mode: python; sh-basic-offset: 4; indent-tabs-mode: nil; coding: utf-8 -*-
# vim: tabstop=4 softtabstop=4 expandtab shiftwidth=4 fileencoding=utf-8
import argparse
import sys
import clusto
from clusto import drivers
from clusto import script_helper
from pprint import pprint
import sys
impo... | sanyaade-mobiledev/clusto | src/clusto/commands/attr.py | Python | bsd-3-clause | 5,122 | 0.005076 |
#!/usr/bin/env python
from __future__ import print_function
import errno
import json
import os
import re
import shutil
import string
import sys
import requests
CONFIG_FILE = 'scripts.conf'
EXTENSIONS = ['avi', 'm4v', 'mkv', 'mp4']
SUB_EXTENSIONS = ['idx', 'sub', 'srt']
PATTERN = re.compile('^(.*)(\d{4})\.(.*)', re.I... | h4ck3rm1k3/states-2 | sabnzbd/scripts/movie-mover.py | Python | bsd-3-clause | 5,436 | 0.001472 |
import collections
class fSeq:
def __init__(self, fNumbers):
self.fNumbers = fNumbers
self.seq = self.fSequence()
self.fDecom = self.fDecomposition()
def fSequence(self):
if self.fNumbers == 1:
fSeq = [1]
else:
fSeq = [1, 1]
if self.... | dvoets/fibClock | fSequence.py | Python | gpl-2.0 | 980 | 0.003061 |
#!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
requirements = [ 'pyte', 'docopt' ]
try:
import asyncio
except ImportError:
requirements.append('asyncio')
setup(
name='libpymux',
author='Jonathan Slenders',
version='... | jonathanslenders/libpymux | setup.py | Python | bsd-2-clause | 617 | 0.003241 |
# Copyright 2014 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 ... | nebril/fuel-web | nailgun/nailgun/test/unit/test_attributes_plugin.py | Python | apache-2.0 | 10,481 | 0 |
"""
Lipophilicity dataset loader.
"""
from __future__ import division
from __future__ import unicode_literals
import os
import logging
import deepchem
logger = logging.getLogger(__name__)
def load_lipo(featurizer='ECFP', split='index', reload=True, move_mean=True):
"""Load Lipophilicity datasets."""... | ktaneishi/deepchem | deepchem/molnet/load_function/lipo_datasets.py | Python | mit | 2,563 | 0.012485 |
# coding: utf-8
import datetime
from django.core.management.base import BaseCommand
# from django.template.loader import render_to_string
from django.db.models import Count
from scheduler.models import Need
from shiftmailer.models import Mailer
from shiftmailer.excelexport import GenerateExcelSheet
DATE_FORMAT = '... | FriedrichK/volunteer_planner | shiftmailer/management/commands/mailer.py | Python | agpl-3.0 | 1,636 | 0.001834 |
#!/usr/bin/env python
import rospy
from easy_handeye.handeye_server_robot import HandeyeServerRobot
def main():
rospy.init_node('easy_handeye_calibration_server_robot')
while rospy.get_time() == 0.0:
pass
calibration_namespace=rospy.get_param('~calibration_namespace')
cw = HandeyeServerRob... | marcoesposito1988/easy_handeye | easy_handeye/scripts/robot.py | Python | lgpl-3.0 | 414 | 0.002415 |
#
# ICRAR - International Centre for Radio Astronomy Research
# (c) UWA - The University of Western Australia, 2015
# Copyright by UWA (in the framework of the ICRAR)
# All rights reserved
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser G... | steve-ord/daliuge | daliuge-engine/dlg/manager/composite_manager.py | Python | lgpl-2.1 | 19,989 | 0.002651 |
import os
from unittest import TestCase
from invokust.settings import create_settings
from invokust import LocustLoadTest
from locust import HttpUser, between, task
class WebsiteUser(HttpUser):
wait_time = between(1, 3)
@task()
def get_home_page(self):
"""
Gets /
"""
self.... | FutureSharks/invokust | tests/test_loadtest.py | Python | mit | 866 | 0 |
import collections
import re
import urllib2
url = 'http://shakespeare.mit.edu/hamlet/full.html'
#url = 'https://courseworks.columbia.edu/access/content/group/COMSW3101_002_2015_3/week3/hamlet.html'
req = urllib2.Request(url)
response = urllib2.urlopen(req)
page = response.read()
#lines = page.split('\n')
speech = re... | jackcht/pythonPractice | master/Homework3/hw3q3.py | Python | apache-2.0 | 573 | 0.019197 |
import ConfigParser
import os
class hLog( object ):
"""! @brief raw implementation for configuring output of logger
"""
def __init__( self, logger ):
self.logger = logger
self.logCategories = {}
# load config file
self.load()
def load( self ):
"""! loa... | call-me-jimi/taskmanager | taskmanager/lib/hLog.py | Python | gpl-2.0 | 1,397 | 0.026485 |
#!/usr/bin/env python3
# -*-coding:UTF-8 -*
'''
Flask functions and routes for the trending modules page
'''
import redis
import json
import os
import sys
import flask
from flask import Flask, render_template, jsonify, request, Blueprint, make_response, Response, send_from_directory, redirect, url_for, abort
from... | CIRCL/AIL-framework | var/www/modules/showpaste/Flask_showpaste.py | Python | agpl-3.0 | 19,911 | 0.006278 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from rest_framework import serializers
from maintenance.models import RecreateSlave
from api.maintenance_base import MaintennanceBaseApi
class RecreateSlaveSerializer(serializers.ModelSerializer):
class Meta:
model = Recreate... | globocom/database-as-a-service | dbaas/api/recreate_slave.py | Python | bsd-3-clause | 770 | 0 |
import sys, os
import pickle
import nltk
import paths
from utils import *
def words_to_dict(words):
return dict(zip(words, range(0, len(words))))
nltk.data.path.append(paths.nltk_data_path)
use_wordnet = True
if use_wordnet:
stemmer = nltk.stem.wordnet.WordNetLemmatizer()
stem = stemmer.lemmatize
else... | mgree/tmpl | www/backend/infer.py | Python | mit | 3,314 | 0.016898 |
#-------------------------------------------------------------------------------
# $RCSfile: make_images.py $
# $Source: repos/minimal_app/src/images/make_images.py $
# $Revision: 1.3 $
# $Date: 18-sep-2007 16:35:29 $
#-------------------------------------------------------------------------------
# Author: ... | jorgb/airs | gui/images/anim/make_images.py | Python | gpl-2.0 | 1,181 | 0.011854 |
# This file is part of Scapy
# See http://www.secdev.org/projects/scapy for more informations
# Copyright (C) Santiago Hernandez Ramos <shramos@protonmail.com>
# This program is published under GPLv2 license
from scapy.packet import Packet, bind_layers
from scapy.fields import FieldLenField, BitEnumField, StrLenField... | CodeNameGhost/shiva | thirdparty/scapy/contrib/mqtt.py | Python | mit | 8,943 | 0 |
import optparse
if __name__ == "__main__":
parser = optparse.OptionParser(add_help_option=False)
parser.add_option('-v', '--verbose', action='store_true',
help='increase verbosity')
parser.add_option('-q', '--quiet', action='store_true',
help='decrease verbosity')
parser.add_option... | scottkirkwood/wxoptparse | tests/rsync.py | Python | gpl-2.0 | 4,057 | 0.00986 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
=============
CadcClass TAP plus
=============
"""
from io import BytesIO
from urllib.parse import urlsplit, parse_qs
import os
import sys
from astropy.table import Table as AstroTable
from astropy.io.fits.hdu.hdulist import HDUList
from astropy.io.v... | ceb8/astroquery | astroquery/cadc/tests/test_cadctap.py | Python | bsd-3-clause | 16,419 | 0.000731 |
# cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... | OptoFidelity/cerbero | cerbero/commands/bootstrap.py | Python | lgpl-2.1 | 1,583 | 0.001263 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
__author__ = "naruhodo-ryuichi"
###############GLOBAL CONFIGURATION
# name of xpl host
localVendor = "naruhodo-ryuichi"
# size of receiving buffer in bytes
bufferSize = 1500
| naruhodo-ryuichi/python-xPLpy | xPLpy/xPLConfig.py | Python | agpl-3.0 | 242 | 0.004132 |
#
# title : Interface
#
import os
import time
os.system('clear')
print('#### ULTRA SECRET BOOT CAMP - NIS | ABC | NDSFLT | XEX | ####')
time.sleep(1)
print('Welcome to our organization, Agent 24')
time.sleep(1)
print('For our reccords, please answer truthfully to the following questions')
time.sleep(1)
person = raw_i... | lngauthier/LEAA.6 | python/user_input.py | Python | gpl-2.0 | 707 | 0.015559 |
import json
import pytest
from mock.mock import Mock
from insights.core import filters
from insights.core.dr import SkipComponent
from insights.core.spec_factory import DatasourceProvider
from insights.specs import Specs
from insights.specs.datasources.cloud_init import cloud_cfg, LocalSpecs
CLOUD_CFG = """
users:
... | RedHatInsights/insights-core | insights/tests/datasources/test_cloud_init.py | Python | apache-2.0 | 3,823 | 0.001046 |
# -*- coding: utf-8 -*-
'''
This module implements :class:`AnalogSignalArray`, an array of analog signals.
:class:`AnalogSignalArray` derives from :class:`BaseAnalogSignal`, from
:module:`neo.core.analogsignal`.
:class:`BaseAnalogSignal` inherits from :class:`quantites.Quantity`, which
inherits from :class:`numpy.arr... | npyoung/python-neo | neo/core/analogsignalarray.py | Python | bsd-3-clause | 11,882 | 0.000168 |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import unittest
from pants.build_graph.address import Address
from pants.build... | foursquare/pants | tests/python/pants_test/build_graph/test_build_file_aliases.py | Python | apache-2.0 | 5,509 | 0.00599 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
ROOT_PATH = os.path.abspath( os.path.join(os.path.dirname( __file__ ), ".."))
files = os.listdir(os.path.join(ROOT_PATH, "doc"))
index = []
for fname in sorted(files):
if not fname.endswith(".txt"):
continue
cmd_name = fname[:-4]
with ope... | brianb/mdbtools | api_docx/pre_build.py | Python | gpl-2.0 | 969 | 0.004128 |
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ...testing import assert_equal
from ..misc import CalculateNormalizedMoments
def test_CalculateNormalizedMoments_inputs():
input_map = dict(moment=dict(mandatory=True,
),
timeseries_file=dict(mandatory=True,
),
)
inputs = CalculateNorm... | iglpdc/nipype | nipype/algorithms/tests/test_auto_CalculateNormalizedMoments.py | Python | bsd-3-clause | 863 | 0.005794 |
"""
The `compat` module provides support for backwards compatibility with older
versions of python, and compatibility wrappers around optional packages.
"""
# flake8: noqa
import hmac
import struct
import sys
PY3 = sys.version_info[0] == 3
if PY3:
text_type = str
binary_type = bytes
else:
text_type = un... | Vagab0nd/SiCKRAGE | lib3/jwt/compat.py | Python | gpl-3.0 | 1,624 | 0 |
'''
Created on = '10/28/13"
Author = 'mmunn'
Unit test : EUCA-9959 MalformedPolicyDocument: Policy document should not specify a principal." Should Be Returned
setUp : Install Credentials,
test : create role with MalformedPolicyDocument and make sure an error message is returned ins... | nagyistoce/eutester | testcases/cloud_admin/4-2/euca9959.py | Python | bsd-2-clause | 3,192 | 0.004386 |
# -*- coding: utf-8 -*-
"""The extractor class definitions.
An extractor is a class used to extract information from "raw" data.
"""
import copy
import pysigscan
from dfvfs.helpers import file_system_searcher
from dfvfs.lib import definitions as dfvfs_definitions
from dfvfs.lib import errors as dfvfs_errors
from df... | Onager/plaso | plaso/engine/extractors.py | Python | apache-2.0 | 20,405 | 0.006273 |
import unittest
import sys
import os
import errno
import commands
from xml.dom import minidom
sys.path.append('bin')
from umdinst import wrap
from testsuccessfulcompiledata import getfield, timezonecheck, xmlifystring
from testcapturecompile import programcheck
def createemptyfile(fname):
"""Creates an empty fil... | lorin/umdinst | test/testidentifysourcefiles.py | Python | bsd-3-clause | 1,396 | 0.012178 |
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 28 15:19:03 2015
@author: David Verelst
"""
from __future__ import print_function
import unittest
import numpy as np
import ExampleArray as lib
class TestExample(unittest.TestCase):
def setUp(self):
pass
def do_array_stuff(self, ndata):
x =... | davidovitch/f90wrap | examples/example-arrays/tests.py | Python | gpl-2.0 | 1,524 | 0.002625 |
#! /usr/bin/env python3
""" Cruft checker and hole filler for overrides
@contact: Debian FTPMaster <ftpmaster@debian.org>
@copyright: 2000, 2001, 2002, 2004, 2006 James Troup <james@nocrew.org>
@opyright: 2005 Jeroen van Wolffelaar <jeroen@wolffelaar.nl>
@copyright: 2011 Joerg Jaspert <joerg@debian.org>
@license: ... | Debian/dak | dak/check_overrides.py | Python | gpl-2.0 | 19,666 | 0.004271 |
# -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
# Copyright (C) 2016 Rahul Raturi
# Copyright (C) 2018 Laurent Monin
#
# 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; ... | antlarr/picard | picard/ui/searchdialog/__init__.py | Python | gpl-2.0 | 16,428 | 0.001278 |
"""TestSuite"""
import sys
from . import case
from . import util
__unittest = True
def _call_if_exists(parent, attr):
func = getattr(parent, attr, lambda: None)
func()
class BaseTestSuite(object):
"""A simple test suite that doesn't provide class or module shared fixtures.
"""
_cleanup = True... | Microvellum/Fluid-Designer | win64-vc/2.78/python/lib/unittest/suite.py | Python | gpl-3.0 | 10,478 | 0.000477 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('freebasics', '0006_change_site_url_field_type'),
]
operations = [
migrations.AddField(
model_name='freebasicscon... | praekeltfoundation/mc2-freebasics | freebasics/migrations/0007_freebasicscontroller_postgres_db_url.py | Python | bsd-2-clause | 442 | 0 |
"""Test the Nightscout config flow."""
from aiohttp import ClientConnectionError
from homeassistant import config_entries, data_entry_flow, setup
from homeassistant.components.nightscout.const import DOMAIN
from homeassistant.components.nightscout.utils import hash_from_url
from homeassistant.const import CONF_URL
fr... | tchellomello/home-assistant | tests/components/nightscout/test_config_flow.py | Python | apache-2.0 | 3,995 | 0.000751 |
in1 = """
[aaa]
a = 123
456
789
b =
321
654
987
c =
135
246
999
"""
in2 = """
[cmd]= ok
[cmd] << 40+2
x << 123*2
[cmd]
<<<
x = 42
y = 123
print(x,y)
... print ok
[data] =
1 2 3
4 5 6
7 8 9
[tsv]
head = no
cols = a b c
out >> tab
[insert] << tab
table = mydata
"""
in2 = """
[aaa] <<<
jest
... | mobarski/smash | test/test-parse2.py | Python | mit | 600 | 0.06 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# 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, ... | bernard357/shellbot | examples/todos.py | Python | apache-2.0 | 3,482 | 0 |
# -*- coding: utf-8 -*-
"""
IsCool-e Pynba
~~~~~~~~~~~~~~
:copyright: (c) 2015 by IsCool Entertainment.
:license: MIT, see LICENSE for more details.
"""
from pynba.wsgi import pynba
__all__ = ['pynba']
| IsCoolEntertainment/pynba | src/iscool_e/pynba/globals.py | Python | mit | 221 | 0 |
# coding: utf-8
"""
Copyright 2015 SmartBear Software
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... | jianajavier/pnc-cli | pnc_cli/swagger_client/models/user.py | Python | apache-2.0 | 6,614 | 0.000605 |
# 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... | gunan/tensorflow | tensorflow/python/ops/nccl_ops.py | Python | apache-2.0 | 8,087 | 0.006059 |
#!/usr/bin/python -t
__requires__ = 'TurboGears'
import pkg_resources
pkg_resources.require('CherryPy >= 2.0, < 3.0alpha')
import logging
logging.basicConfig()
import os
import sys
import getopt
import xmlrpclib
import smtplib
from email.Message import Message
import warnings
# Ignore DeprecationWarnings. This allo... | ampotty/fas | scripts/export-bugzilla.py | Python | gpl-2.0 | 5,752 | 0.00452 |
"""HTTP Client for asyncio."""
import asyncio
import base64
import hashlib
import os
import sys
import traceback
import warnings
from multidict import CIMultiDict, MultiDict, MultiDictProxy, istr
from yarl import URL
import aiohttp
from . import hdrs, helpers
from ._ws_impl import WS_KEY, WebSocketParser, WebSocket... | esaezgil/aiohttp | aiohttp/client.py | Python | apache-2.0 | 26,142 | 0.000191 |
#!/s/std/bin/python
import sys, string, os, glob, re, mfgraph
#results_dir = "../results/isca07_final_version"
#results_dir = "/p/multifacet/projects/logtm_eager_lazy/ISCA07_results/old/old-11-7/"
results_dir = "../results/"
#results_dir = "/p/multifacet/projects/shore/HPCA-filters-results/non-smt/"
#results_dir = "/... | dberc/tpzsimul.gems | jgraph/xact_mem.py | Python | gpl-2.0 | 140,056 | 0.019185 |
#!/usr/bin/env python
"""
setup.py for installing F2PY
Usage:
python setup.py install
Copyright 2001-2005 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@cens.ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPRESS... | beiko-lab/gengis | bin/Lib/site-packages/numpy/f2py/setupscons.py | Python | gpl-3.0 | 4,305 | 0.009988 |
from __future__ import absolute_import
from dbm import *
from ..version_info import PY2
if PY2:
from . import dumb, gnu, ndbm
from whichdb import *
from anydbm import *
| EnTeQuAk/dotfiles | sublime-text-3/Packages/isort/pies/dbm/__init__.py | Python | unlicense | 184 | 0 |
#!/usr/bin/env python3
"""
Analyze a evergreen task log page
"""
import argparse
import json
import os
import sys
if __name__ == "__main__" and __package__ is None:
sys.path.append(os.path.dirname(os.path.abspath(os.path.realpath(__file__))))
print(sys.path)
import faultinfo
else:
from . import faultin... | markbenvenuto/buildbaron | analyzer/evg_log_file_analyzer.py | Python | apache-2.0 | 3,551 | 0.002534 |
import string
import csv
import os
from abaqusConstants import *
from part import *
from material import *
from section import *
from assembly import *
from load import *
from mesh import *
from visualization import *
def importEBSD(inpFileName):
while True:
fileName, file_extension = os.path.splitext... | DorianDepriester/mtex2abaqus | MTEX2abaqus/AbaqusImport.py | Python | mit | 2,602 | 0.04804 |
import tkinter
import logging
######################### Utility Functions #########################
def But(w, text='x', command='', side=tkinter.LEFT) :
b = tkinter.Button(w, text=text, command=command)
b.pack(side=side, padx=5, pady=5)
return(b)
def Drop(w, options=['zero', 'one', 'two'], defaul... | pdgilbert/Vcourse | lib/GUIutils.py | Python | gpl-2.0 | 2,664 | 0.033408 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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 ... | rmyers/trove-dashboard | setup.py | Python | apache-2.0 | 673 | 0 |
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the ZMQ API."""
import configparser
import os
import struct
from test_framework.test_framework im... | Exgibichi/statusquo | test/functional/zmq_test.py | Python | mit | 4,305 | 0.002091 |
# This file is part of the sos project: https://github.com/sosreport/sos
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# version 2 of the GNU General Public License.
#
# See the LICENSE file in the source distribution ... | nijinashok/sos | sos/plugins/xfs.py | Python | gpl-2.0 | 1,029 | 0 |
import functools
import warnings
from collections import Mapping, Sequence
from numbers import Number
import numpy as np
import pandas as pd
from . import ops
from . import utils
from . import common
from . import groupby
from . import indexing
from . import alignment
from . import formatting
from .. import conventio... | kjordahl/xray | xray/core/dataset.py | Python | apache-2.0 | 72,806 | 0.00011 |
#!/usr/bin/env python3.8
import os
import sys
import unittest
SCRIPT_DIR = os.path.dirname(
os.path.realpath(os.path.join(os.getcwd(), os.path.expanduser(__file__))))
sys.path.append(
os.path.normpath(os.path.join(SCRIPT_DIR, os.path.pardir, os.path.pardir)))
# pylint: disable=wrong-import-position
from nono... | durante987/nonogram_solver | tests/rules/test_init.py | Python | mit | 3,997 | 0.001251 |
import os, os.path, random, string, time, urllib2
from flask import Flask, flash, request, redirect, url_for, render_template, \
make_response, abort
import ast
from flask_sqlalchemy import SQLAlchemy
from flask_security import Security, SQLAlchemyUserDatastore, login_user, logout_user, \
UserMixin, RoleMixin, ... | DH-Box/dhbox | dhbox.py | Python | gpl-3.0 | 13,293 | 0.002558 |
from twython import Twython
from models import Tweet
import datetime
import traceback
# import time
# first
APP_KEY = ''
APP_SECRET = ''
OAUTH_TOKEN = ''
OAUTH_TOKEN_SECRET = ''
# second
APP_KEY2 = ''
APP_SECRET2 = ''
OAUTH_TOKEN2 = ''
OAUTH_TOKEN_SECRET2 = ''
# third
APP_KEY3 = ''
APP_SECRET3 = ''
OAUTH_TOKEN3 =... | kaflesudip/TweetStats | update_tweets.py | Python | apache-2.0 | 2,656 | 0.00113 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... | omwdunkley/crazyflieROS | src/crazyflieROS/cflib/utils/callbacks.py | Python | gpl-2.0 | 1,843 | 0 |
#!/usr/bin/env python
# Copyright (c) 2010, Antons Rebguns. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, t... | sigproc/robotic_surgery | src/ros/crustcrawler_smart_arm/smart_arm_kinematics/nodes/test_ik_service.py | Python | mit | 3,443 | 0.004066 |
# This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from indico.modules.events.management.views import WPEventManagement
from indico.modules.events.views impo... | pferreir/indico | indico/modules/events/surveys/views.py | Python | mit | 1,351 | 0.00074 |
# Copyright 2013 NEC Corporation. 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 ... | nikolay-fedotov/tempest | tempest/api/compute/admin/test_fixed_ips_negative.py | Python | apache-2.0 | 3,516 | 0 |
#!/usr/bin/python
'''
Epilog wrapper for docker images submission to batch systems
Created on Oct 28, 2015
@author: mariojmdavid@gmail.com
'''
import time
import os
import peUtils
if __name__ == '__main__':
print '==========================================='
print '========================================... | LIP-Computing/pelogw | src/epilw.py | Python | apache-2.0 | 950 | 0 |
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | google/ctfscoreboard | scoreboard/mail.py | Python | apache-2.0 | 4,180 | 0 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
"""
oauthlib.oauth2.rfc6749.parameters
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module contains methods related to `Section 4`_ of the OAuth 2 RFC.
.. _`Section 4`: http://tools.ietf.org/html/rfc6749#section-4
"""
import json
try:
i... | dakiri/splunk-app-twitter | twitter2/bin/oauthlib/oauth2/rfc6749/parameters.py | Python | apache-2.0 | 12,583 | 0.000397 |
"""Imports for Python API.
This file is MACHINE GENERATED! Do not edit.
Generated by: tensorflow/tools/api/generator/create_python_api.py script.
"""
from tensorflow.python.keras import Input
from tensorflow.python.keras import Model
from tensorflow.python.keras import Sequential
from tensorflow.tools.api.generator.ap... | ryfeus/lambda-packs | Keras_tensorflow_nightly/source2.7/tensorflow/tools/api/generator/api/keras/__init__.py | Python | mit | 1,351 | 0.00074 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.contrib import admin
from django.contrib.admin.sites import AdminSite
from django.contrib.contenttypes.generic import (
generic_inlineformset_factory, GenericTabularInline)
from django.form... | vsajip/django | tests/regressiontests/generic_inline_admin/tests.py | Python | bsd-3-clause | 17,051 | 0.002932 |
# coding: utf-8
from django.test import TestCase
from django.contrib.auth.models import User, Permission
from django.utils import timezone
from django.core.urlresolvers import reverse
from django.contrib.auth.models import Group
from utils.tests.common_test_case import CommonTestCase, with_login_user
from discussion.... | giliam/sharbrary | discussion/tests.py | Python | gpl-2.0 | 7,655 | 0.012021 |
# Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | pair-code/lit | lit_nlp/lib/wsgi_serving.py | Python | apache-2.0 | 4,652 | 0.004944 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import test_access_rights
from . import test_automatic_leave_dates
from . import test_allocation_access_rights
from . import test_holidays_flow
from . import test_hr_leave_type
from . import test_accrual_allocatio... | ygol/odoo | addons/hr_holidays/tests/__init__.py | Python | agpl-3.0 | 460 | 0 |
import os
from invoke import task
@task
def test():
os.system('coverage run --source tryagain -m py.test')
os.system('coverage report')
@task
def register(production=False):
target = 'pypi' if production else 'pypitest'
os.system('python3 setup.py register -r %s' % target)
@task
def upload(product... | tfeldmann/tryagain | tasks.py | Python | mit | 450 | 0 |
import unittest
from test import support
import binascii
import random
import sys
from test.support import precisionbigmemtest, _1G, _4G
zlib = support.import_module('zlib')
try:
import mmap
except ImportError:
mmap = None
class ChecksumTestCase(unittest.TestCase):
# checksum test cases
def test_crc... | mancoast/CPythonPyc_test | fail/314_test_zlib.py | Python | gpl-3.0 | 23,273 | 0.001891 |
# -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2017 Sambhav Kothari
# Copyright (C) 2018 Wieland Hoffmann
# Copyright (C) 2018, 2020-2021 Laurent Monin
# Copyright (C) 2019-2022 Philipp Wolfer
#
# This program is free software; you can redistribute it and/or
# modify it und... | metabrainz/picard | test/test_api_helpers.py | Python | gpl-2.0 | 11,729 | 0.001108 |
import random
classes = [
('Barbarian', ['STR', 'CON', 'DEX', 'WIS', 'CHA', 'INT']),
('Bard', ['CHA', 'CON', 'STR', 'DEX', 'WIS', 'INT']),
('Cleric', ['WIS', 'CHA', 'CON', 'DEX', 'INT', 'STR']),
('Druid', ['WIS', 'CON', 'STR', 'DEX', 'INT', 'CHA']),
('Fighter', ['STR', 'CON', 'DEX', 'WIS', 'INT', '... | laisrael/Game-Tools-NPC-Generator | classgen.py | Python | mit | 1,109 | 0.002705 |
# coding: utf-8
import string
import pandas as pd
import pandas.util.testing as tm
import pandas.util._test_decorators as td
import pytest
from numpy.random import randn
import pandas.tools.plotting as plotting
from pandas.tests.plotting.common import TestPlotBase
"""
Test cases for plot functions imported from ... | cython-testbed/pandas | pandas/tests/plotting/test_deprecated.py | Python | bsd-3-clause | 1,513 | 0 |
from lib import actions
__all__ = [
'CreateVlanAction',
]
class CreateVlanAction(actions.BaseAction):
def run(self, **kwargs):
action = kwargs['action']
del kwargs['action']
region = kwargs['region']
del kwargs['region']
network_domain_id = kwargs['network_domain_id']... | armab/st2contrib | packs/dimensiondata/actions/create_vlan.py | Python | apache-2.0 | 826 | 0 |
"""
tcp_message Inline Script Hook API Demonstration
------------------------------------------------
* modifies packets containing "foo" to "bar"
* prints various details for each packet.
example cmdline invocation:
mitmdump -T --host --tcp ".*" -q -s examples/tcp_message.py
"""
from mitmproxy.utils import strutils
... | dwfreed/mitmproxy | examples/complex/tcp_message.py | Python | mit | 917 | 0.001091 |
#!/usr/bin/env python
# =========================================================================
#
# Copyright NumFOCUS
#
# 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:/... | richardbeare/SimpleITK | Examples/Python/CannyEdge.py | Python | apache-2.0 | 1,302 | 0 |
# -*- coding: utf-8 -*-
from .version import __version__ # noqa: F401
from .tts import gTTS, gTTSError
__all__ = ['gTTS', 'gTTSError']
| pndurette/gTTS | gtts/__init__.py | Python | mit | 137 | 0 |
#!/usr/bin/env python
# https://www.codeeval.com/open_challenges/1/
import sys
def solve(X, Y, N):
r = []
for i in range(1, N + 1):
if i % X == 0 and i % Y == 0:
r.append('FB')
elif i % X == 0:
r.append('F')
elif i % Y == 0:
r.append('B')
el... | guozengxin/codeeval | easy/fizzBuzz.py | Python | mit | 537 | 0.001862 |
import time
import json
import tornado.httpclient
http_client = tornado.httpclient.HTTPClient()
class HTTPServiceProxy(object):
def __init__(self, host='localhost', port=6999, cache_timeout=5.0):
self._host = host
self._port = port
self._cache_timeout = cache_timeout
self._cache... | nickbjohnson4224/greyhat-crypto-ctf-2014 | frontend/services.py | Python | mit | 4,564 | 0.004163 |
from django.db.backends.mysql.compiler import SQLCompiler as BaseSQLCompiler
from django.db.backends.mysql.compiler import SQLInsertCompiler, \
SQLDeleteCompiler, SQLUpdateCompiler, SQLAggregateCompiler, \
SQLDateCompiler, SQLDateTimeCompiler
class SQLCompiler(BaseSQLCompiler):
STRAIGHT_INNER = 'STRAIGHT_... | frol/django-mysql-fix | django_mysql_fix/backends/mysql/compiler.py | Python | mit | 5,170 | 0.002901 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-03-03 15:23
from __future__ import unicode_literals
from django.conf import settings
from django.contrib.postgres.search import SearchVector
from django.db import migrations, models
from django.db.models.expressions import Value
def unicode_damnit(data, c... | Inboxen/Inboxen | inboxen/search/migrations/0001_initial.py | Python | agpl-3.0 | 2,198 | 0.002275 |
from __future__ import absolute_import
import logging
from uuid import uuid1
import dockets.queue
import dockets.error_queue
from .base import Queue
class DocketsQueue(Queue):
def __init__(self, redis_client, queue_name, wait_time, timeout):
self.queue = dockets.queue.Queue(redis_client,
... | gamechanger/deferrable | deferrable/queue/dockets.py | Python | mit | 5,390 | 0.002226 |
from distutils.core import setup
from Cython.Build import cythonize
import numpy
setup(
ext_modules = cythonize("af2d.pyx"),
include_dirs=[numpy.get_include()]
)
| bkerster/utilities | cy_af2d/setup.py | Python | gpl-2.0 | 171 | 0.011696 |
__author__ = 'Akshay'
"""
File contains code to Mine reviews and stars from a state reviews.
This is just an additional POC that we had done on YELP for visualising number of 5 star reviews per state on a map.
For each business per state, 5 reviews are taken and the count of the review is kept in the dictionary for e... | akshaykamath/StateReviewTrendAnalysisYelp | StateReviewTrendsPOC.py | Python | mit | 4,899 | 0.002654 |
"""
Sizun
MIT License
(C) 2015 David Rieger
"""
from flask import current_app as app
from .confighandler import ConfigHandler
class SyntaxHandler:
SYNTAXFILES_FOLDER = "config/syntax/"
SYNTAXFILES_APPDX = ".syn"
ELEMENTS_SECTION = "ELEMENTS"
def __init__(self, _settings):
# Instantiate a ... | FrontSide/Sizun | sizun/controllers/syntaxhandler.py | Python | mit | 1,697 | 0.000589 |
# Copyright 2020 The TensorFlow 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 law or agreed to i... | tensorflow/graphics | tensorflow_graphics/projects/points_to_3Dobjects/transforms/transforms.py | Python | apache-2.0 | 12,632 | 0.00855 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 NEC Corporation
# 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... | sajuptpm/neutron-ipam | neutron/tests/unit/_test_extension_portbindings.py | Python | apache-2.0 | 17,806 | 0.000168 |
import httplib
from pyamf import AMF0, AMF3
from pyamf import remoting
from pyamf.remoting.client import RemotingService
height = 1080
def build_amf_request(const, playerID, videoPlayer, publisherID):
env = remoting.Envelope(amfVersion=3)
env.bodies.append(
(
"/1",
remotin... | aplicatii-romanesti/allinclusive-kodi-pi | .kodi/addons/plugin.video.kidsplace/brightcovePlayer.py | Python | apache-2.0 | 1,587 | 0.010082 |
import re
import sys
import pprint
def main(args):
text_path = args[0]
file_content = open(text_path, 'r').read()
link_id_expr = re.compile(r"multiverseid=(\d+)")
matches = link_id_expr.findall(file_content)
print "There were {0} matches in {1}".format(len(matches), text_path)
pprint.pprint(matches)
if __name... | idurkan/mtg-piper | get_land_ids.py | Python | mit | 361 | 0.024931 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@since: 2014-11-28
@author: Javier Garcia
@contact: javier.garcia@bskapital.com
@summary: Update from websources and csv the Master Securities
SQLITE database.
'''
# General imports
import pandas.io.data as web
import pandas as pd
import numpy as ... | JavierGarciaD/athena | mneme/db_updater.py | Python | gpl-3.0 | 8,366 | 0.000478 |
__all__ = ['berry_curvature', 'plot_berry_curvature']
from qutip import (Qobj, tensor, basis, qeye, isherm, sigmax, sigmay, sigmaz)
import numpy as np
try:
import matplotlib.pyplot as plt
except:
pass
def berry_curvature(eigfs):
"""Computes the discretized Berry curvature on the two dimensional grid
... | qutip/qutip | qutip/topology.py | Python | bsd-3-clause | 2,853 | 0.000701 |
# Array-based circular queue implementation.
# Copyright © 2014 Bart Massey
# [This program is licensed under the "MIT License"]
# Please see the file COPYING in the source
# distribution of this software for license terms.
class Queue(object):
def __init__(self, max_size):
self.queue = [None] * (max_size ... | BartMassey/nb-misc | arrayqueue.py | Python | mit | 1,163 | 0.000861 |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
import socket
import requests
def GetIP(target):
timeout = 8
ip=""
valid_responses = ['200', '401', '403', '404', '301', '302']
try:
if str(requests.get('http://' + target,timeout = timeout).status_code) not in valid_responses:
if str(requests.ge... | n4xh4ck5/wh01p | modules/getip/getip.py | Python | gpl-3.0 | 636 | 0.044025 |
# Importing Libraries
import sys
'''
Function that generates the results for all the test cases. Iterates through
the test cases and delegates the work ot getCount
'''
def genResults(cases):
results = []
for case in cases:
results.append(getCount(case))
return results
'''
Function that... | tejasnikumbh/Algorithms | Warmup/AlternatingCharacgters.py | Python | bsd-2-clause | 1,034 | 0.011605 |
# encoding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import unittest
from datetime import timedelta
from decimal import Decimal
from django.conf import settings
from django.test import TestCase
from django.test.utils import override_settings
from django.utils... | antonyr/django-haystack | test_haystack/whoosh_tests/test_whoosh_backend.py | Python | bsd-3-clause | 45,377 | 0.002402 |
# coding: utf-8
import constance
from django.conf import settings
from rest_framework.response import Response
from rest_framework.views import APIView
from kobo.static_lists import COUNTRIES, LANGUAGES, SECTORS
from kobo.apps.hook.constants import SUBMISSION_PLACEHOLDER
class EnvironmentView(APIView):
"""
G... | kobotoolbox/kpi | kpi/views/environment.py | Python | agpl-3.0 | 1,307 | 0.000765 |
# must use python 2
from classy import Class
import matplotlib.pyplot as plt
import numpy as np
import math
max_l = 5000
max_scalars = '5000'
ell = np.array( range(1, max_l+1) )
def getDl( pii1=0.5e-10, pii2=1e-9, pri1=1e-13 ):
# Define your cosmology (what is not specified will be set to CLASS default para... | xzackli/isocurvature_2017 | analysis/plot_isocurvature_spectra_effects/deriv_iso.py | Python | mit | 3,825 | 0.019869 |
from .fitting import *
from .io import *
from .main import *
from .plotting import *
from .psf import *
from .utils import *
from .version import __version__
| kbarbary/cubefit | cubefit/__init__.py | Python | mit | 158 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.