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 |
|---|---|---|---|---|---|---|
def __virtual__():
return True
def execute(*args, **kwargs):
# we use the dunder to assert the loader is provided minionmods
return __salt__["test.arg"]("test.arg fired")
| saltstack/salt | tests/integration/files/file/base/_executors/arg.py | Python | apache-2.0 | 185 | 0 |
from functools import wraps
def context(*context_funcs):
""" Decorator to inject additional arguments taken by :param context_funcs:
>>> data = {1: "user1", 2: "user2"}
>>> @context(
... lambda r, i: data.get(i),
... )
... def some_view(request, user_id, username):
... print(usern... | hirokiky/wraptools | wraptools/context.py | Python | mit | 630 | 0 |
# -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals, with_statement
from django.core.ex... | arth-co/shoop | shoop/front/views/payment.py | Python | agpl-3.0 | 2,387 | 0.002933 |
from twilio.rest import TwilioRestClient
# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "AC433e7b0bec93dc5996e4fb80b1e56eec"
auth_token = "9cc9267fe09dab362d3be160f711a09d"
client = TwilioRestClient(account_sid, auth_token)
message = client.sms.messages.create(body="Jenny please?! I lo... | spicyramen/sipLocator | tools/testSmS.py | Python | gpl-2.0 | 471 | 0.012739 |
#!/usr/bin/env python
# ******************************************************
# Copyright 2004: Commonwealth of Australia.
#
# Developed by the Computer Network Vulnerability Team,
# Information Security Group.
# Department of Defence.
#
# Michael Cohen <scudette@users.sourceforge.net>
#
# ****************************... | backupManager/pyflag | src/pyflag/TEXTUI.py | Python | gpl-2.0 | 8,684 | 0.019691 |
#!/usr/bin/python
# vi: ts=4 expandtab
#
# Copyright (C) 2012 Canonical Ltd.
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
#
# Author: Scott Moser <scott.moser@canonical.com>
# Author: Juerg Haefliger <juerg.haefliger@hp.com>
#
# This program is free software: you can redistribute it and... | oourfali/cloud-init-fedora | cloudinit/netinfo.py | Python | gpl-3.0 | 3,816 | 0.000786 |
def extractMionline657939096WordpressCom(item):
'''
Parser for 'mionline657939096.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'transla... | fake-name/ReadableWebProxy | WebMirror/management/rss_parser_funcs/feed_parse_extractMionline657939096WordpressCom.py | Python | bsd-3-clause | 574 | 0.033101 |
import os,os.path,shutil
import numpy as np
import pickle
import dmdd
import dmdd_efficiencies as eff
def check_min_mass(element='fluorine', Qmin=1., v_esc=544., v_lag=220., mx_guess=1.):
experiment = dmdd.Experiment('test',element,Qmin, 40.,100., eff.efficiency_unit)
res = experiment.find_min_mass(v_esc=v_e... | veragluscevic/dmdd | dmdd/tests/test.py | Python | mit | 8,718 | 0.016059 |
try:
from unittest.mock import patch
except ImportError:
from mock import patch
from logger.inspector import Inspector
from unittest import TestCase
class MockCollection(object):
def __init__(self, website_id, collection_id, website_acron_in_filename):
self.website_id = website_id
self.c... | scieloorg/Logger | tests/test_inspector.py | Python | bsd-2-clause | 2,902 | 0 |
##
# Copyright (C) 2014, 2015 Matt Molyneaux
#
# This file is part of CimCity.
#
# CimCity 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 versi... | xray7224/CimCity | cim/items/civics.py | Python | gpl-3.0 | 1,199 | 0.000834 |
'''Autogenerated by get_gl_extensions script, do not edit!'''
from OpenGL import platform as _p
from OpenGL.GL import glget
EXTENSION_NAME = 'GL_AMD_shader_stencil_export'
def glInitShaderStencilExportAMD():
'''Return boolean indicating whether this extension is available'''
from OpenGL import extensions
... | frederica07/Dragon_Programming_Process | PyOpenGL-3.0.2/OpenGL/raw/GL/AMD/shader_stencil_export.py | Python | bsd-2-clause | 372 | 0.008065 |
#!/usr/bin/python
"""Simple shallow test of the CASTEP interface"""
import os
import shutil
import tempfile
import traceback
from ase.test import NotAvailable
# check if CASTEP_COMMAND is set a environment variable
if not os.environ.has_key('CASTEP_COMMAND'):
print("WARNING: Environment variable CASTEP_COMMAND ... | JConwayAWT/PGSS14CC | lib/python/multimetallics/ase/test/castep/castep_interface.py | Python | gpl-2.0 | 3,656 | 0.003829 |
import unittest
import lockserver_daemon as lockserver
class TheTestCase(unittest.TestCase):
def setUp(self):
# Reset the lockserver's global variables between each test.
lockserver.init_globals()
def testUserAndNodeLockContention_one(self):
# Start three sessions.
sess = []
sess.append(lo... | sburnett/seattle | seattlegeni/lockserver/tests/unit/ut_lockserverunit_user_and_node_locks.py | Python | mit | 6,231 | 0.002889 |
# Storage of the scope map
# The purpose of this setup is that the OAuth scope of any app can be stored
# in a single field. This way, we can easily add more scopes later.
# We have a BigIntegerField to work with, which means 64 bits of storage.
# This translates into 64 types of scope, each of which can be checked wit... | uclapi/uclapi | backend/uclapi/oauth/scoping.py | Python | mit | 4,517 | 0 |
"""
Django settings for stompy project.
Generated by 'django-admin startproject' using Django 1.9.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
# ... | jaredkerim/stompy | app/settings.py | Python | mit | 3,293 | 0.001215 |
#!/usr/bin/env python
# PYTHON_ARGCOMPLETE_OK
"""Verify the current Shippable run has the required number of jobs."""
from __future__ import absolute_import, print_function
# noinspection PyCompatibility
import argparse
import errno
import os
import sys
from lib.http import (
HttpClient,
)
from lib.util import ... | archf/ansible | test/runner/shippable.py | Python | gpl-3.0 | 2,577 | 0.000776 |
# -*- coding:utf-8 -*-
#
# Copyright (c) 2017 mooncake. All Rights Reserved
####
# @brief
# @author Eric Yue ( hi.moonlight@gmail.com )
# @version 0.0.1
from distutils.core import setup
V = "0.7"
setup(
name = 'mooncake_utils',
packages = ['mooncake_utils'],
version = V,
description = 'just a useful utils fo... | ericyue/mooncake_utils | setup.py | Python | apache-2.0 | 646 | 0.041796 |
# -*- coding: utf-8 -*-
# Resource object code
#
# Created: Wed Mar 20 13:39:06 2013
# by: The Resource Compiler for PyQt (Qt v4.8.4)
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore
qt_resource_data = "\
\x00\x00\x3a\x7c\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x... | Distrotech/PyQt-x11 | examples/graphicsview/dragdroprobot/dragdroprobot_rc2.py | Python | gpl-2.0 | 62,689 | 0.00008 |
import configparser
import json
from os.path import join
import discord
import requests
from discord.ext import commands
import ereputils
# Config reader
config = configparser.ConfigParser()
config.read("config.ini")
# API Key
apiKey = config["DEFAULT"]["api_key"]
apiVersion = config["DEFAULT"]["api_version"]
cla... | Curlybear/Socrates | battle.py | Python | gpl-3.0 | 23,254 | 0.001978 |
#! /usr/bin/env python
import argparse
import operator
import os
import sys
from collections import namedtuple
from functools import lru_cache
from functools import reduce
from pathlib import Path
from typing import Any
from typing import Dict
from typing import List
import addict
import arrow
import googleapiclient.e... | ipwnponies/youtube-sort-playlist | playlist_updates.py | Python | unlicense | 13,622 | 0.002936 |
#!venv/bin/python
from flask import Flask, render_template, request, Response
import os
import time
import subprocess
app = Flask(__name__, template_folder='.', static_folder='.')
@app.route('/')
def root():
time_in_secs = os.path.getmtime('pyth.py')
time_in_python = time.gmtime(time_in_secs)
formatted_t... | gcq/pyth | server.py | Python | mit | 2,516 | 0.006757 |
"""
Tests API features applicable to the `shelflist` app.
"""
import pytest
import ujson
import jsonpatch
from datetime import datetime
from shelflist.exporters import ItemsToSolr
from shelflist.search_indexes import ShelflistItemIndex
from shelflist.serializers import ShelflistItemSerializer
# FIXTURES AND TEST DAT... | unt-libraries/catalog-api | django/sierra/shelflist/tests/test_api.py | Python | bsd-3-clause | 37,869 | 0.003116 |
# (c) 2009-2011 Martin Wendt and contributors; see WsgiDAV http://wsgidav.googlecode.com/
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""
Wrapper for ``run_server``, that restarts the server when source code is
modified.
"""
import os
import sys
from subprocess import P... | jhgoebbert/cvl-fabric-launcher | wsgidav/server/run_reloading_server.py | Python | gpl-3.0 | 1,415 | 0.013428 |
# -*- coding: utf-8 -*-
# Resource object code
#
# Created: Sun May 12 18:04:51 2013
# by: The Resource Compiler for PyQt (Qt v5.0.2)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x03\x54\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\... | DevinDewitt/pyqt5 | examples/mainwindows/sdi/sdi_rc.py | Python | gpl-3.0 | 36,524 | 0.000137 |
import unittest
import tempfile
import os
import openglider
import openglider.plots
import openglider.plots.glider
from common import TestCase
TEMPDIR = tempfile.gettempdir()
class TestPlots(TestCase):
def setUp(self, complete=True):
self.glider_2d = self.import_glider_2d()
self.glider_3d = sel... | hiaselhans/OpenGlider | tests/test_patterns.py | Python | gpl-3.0 | 1,407 | 0.003554 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Run GMAP/GSNAP commands. GMAP/GSNAP manual:
<http://research-pub.gene.com/gmap/src/README>
"""
import os.path as op
import sys
import logging
from jcvi.formats.sam import get_prefix
from jcvi.apps.base import OptionParser, ActionDispatcher, need_update, sh, \
... | sgordon007/jcvi_062915 | apps/gmap.py | Python | bsd-2-clause | 5,206 | 0.000192 |
from django.core.serializers import json
from django.http import HttpResponseNotFound, HttpResponse
from django.views.generic import View
from rest_test_data.models import Simple
from rest_test_data.views import BaseTestDataRestView
from nose.tools import assert_equal, assert_is_instance
from mock import Mock, patch
... | hogarthww/django-rest-test-data | rest_test_data/tests/test_base.py | Python | gpl-2.0 | 4,061 | 0 |
# coding=utf-8
# Copyright 2017 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 sys
from pex.pex_bootstrapper import get_pex_info
from pants.util.cont... | foursquare/pants | tests/python/pants_test/backend/python/tasks/test_python_run_integration.py | Python | apache-2.0 | 8,737 | 0.008699 |
import theano
from theano import tensor as T
w = thenao.shared(W_values)
bvis = theano.shared(bvis_values)
bhid = theano.shared(bhid_values)
trng = T.shared_randomstreams.RandomStreams(1234)
def OneStep(vsample) :
hmean = T.nnet.sigmoid(theano.dot(vsample, W) + bhid)
hsample = trng.binomial(size=hmean.shape... | Og192/Python | theano/Loop/loopForShareVariable.py | Python | gpl-2.0 | 683 | 0.014641 |
# 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... | sasha-gitg/python-aiplatform | .sample_configs/param_handlers/create_hyperparameter_tuning_job_python_package_sample.py | Python | apache-2.0 | 3,158 | 0.0019 |
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2018, Arm Limited and contributors.
#
# 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
#
# ... | ARM-software/lisa | lisa/tests/base.py | Python | apache-2.0 | 77,167 | 0.001089 |
from django.contrib import admin
from edc_registration.models import RegisteredSubject
from edc_locator.admin import BaseLocatorModelAdmin
from ..forms import SubjectLocatorForm
from ..models import SubjectLocator
class SubjectLocatorAdmin(BaseLocatorModelAdmin):
form = SubjectLocatorForm
fields = (
... | botswana-harvard/bcvp | bcvp/bcvp_subject/admin/subject_locator_admin.py | Python | gpl-2.0 | 1,944 | 0.002058 |
#!/usr/bin/env python3
# coding=utf-8
__author__ = 'chenfengyuan'
import tornado.gen
import re
import tornado.log
import tornado.ioloop
import tornado.options
import youku
import sys
import os
import utils
import tqdm
import math
import decimal
import tornado.httpclient
import shutil
import argparse
def main():
p... | chenfengyuan/download-youku-video | main.py | Python | mit | 2,621 | 0.002289 |
#!flask/bin/python
from migrate.versioning import api
from config import SQLALCHEMY_DATABASE_URI
from config import SQLALCHEMY_MIGRATE_REPO
from app import db
import os.path
db.create_all()
if not os.path.exists(SQLALCHEMY_MIGRATE_REPO):
api.create(SQLALCHEMY_MIGRATE_REPO, 'database repository')
api.version_control(S... | rkk09c/Flask_Boilerplate | db_create.py | Python | mit | 484 | 0.008264 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2021 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" This package contains the qibuild actions. """
from __future__ import absolute_import
from __future__ import unicode_li... | aldebaran/qibuild | python/qibuild/actions/__init__.py | Python | bsd-3-clause | 365 | 0.00274 |
#! /usr/bin/env python
# -*- coding=utf-8 -*-
def addDigits(num):
while(1):
sum= 0
for i in xrange(len(str(num))):
sum+= int(str(num)[i])
if len(str(sum))== 1:
return sum
else:
num= sum
| ccqpein/Arithmetic-Exercises | Add-Digits/add_digits.py | Python | apache-2.0 | 260 | 0.015385 |
'''Module for the messages pageset'''
from murmeli.pages.base import PageSet
from murmeli.pagetemplate import PageTemplate
from murmeli import dbutils
from murmeli.contactmgr import ContactManager
from murmeli.messageutils import MessageTree
from murmeli import inbox
class MessagesPageSet(PageSet):
'''Messages p... | activityworkshop/Murmeli | murmeli/pages/messages.py | Python | gpl-2.0 | 4,728 | 0.005076 |
#-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... | jaggu303619/asylum | openerp/addons/l10n_in_hr_payroll/report/report_payslip_details.py | Python | agpl-3.0 | 1,644 | 0.00365 |
"""
UNIT 2: Logic Puzzle
You will write code to solve the following logic puzzle:
1. The person who arrived on Wednesday bought the laptop.
2. The programmer is not Wilkes.
3. Of the programmer and the person who bought the droid,
one is Wilkes and the other is Hamming.
4. The writer is not Minsky.
5. Neither Knu... | feredean/cs313 | notes/7_puzzle.py | Python | mit | 2,458 | 0.004882 |
#!/usr/bin/python
import sys
import os
from numpy import *
from scipy import stats
if len(sys.argv) >= 4 :
ref_filename = sys.argv[1]
tag_filename =sys.argv[2]
Npt = int(sys.argv[3])
Nbin = int(sys.argv[4])
else:
print("usage: ~/3seq/bin/exp_len_density.py multiexon_refFlat.txt_positive_known_inta... | jason-weirather/IDP-fusion-release-1 | bin/Bfile.py | Python | apache-2.0 | 4,958 | 0.015934 |
# -*- coding: utf-8 -*-
"""Util functions for different things. For example: format time or bytesize correct."""
from flask import request, Response
from functools import wraps
from jinja2.filters import FILTERS
import os
import maraschino
from maraschino import app, logger
from maraschino.models import Setting, XbmcS... | N3MIS15/maraschino-webcam | maraschino/tools.py | Python | mit | 8,552 | 0.00573 |
import os
from blessings import Terminal
class Cursor(object):
"""Common methods for cursor manipulation
:type term: NoneType|blessings.Terminal
:param term: Terminal instance; if not given, will be created by the class
"""
def __init__(self, term=None):
self.term = Terminal() if term ... | hfaran/progressive | progressive/cursor.py | Python | mit | 1,718 | 0 |
from mpc.settings import CATEGORY
from django import forms
class UploadPhotoForm(forms.Form):
photo_file = forms.FileField(label='Select a file')
photo_category = forms.ChoiceField(choices=CATEGORY)
| venetay/Photo-Competition | attachments/forms.py | Python | mit | 212 | 0.009434 |
# Copyright 2017 Google 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, s... | cschnei3/forseti-security | tests/scanner/audit/data/__init__.py | Python | apache-2.0 | 610 | 0 |
"""Pets now have a description
Revision ID: 0c431867c679
Revises: 5b1bdc1f3125
Create Date: 2016-11-07 18:36:25.912155
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '0c431867c679'
down_revision = '5b1bdc1f3125'
branch_labels = None
depends_on = None
def upgr... | asif-mahmud/Pyramid-Apps | pethouse/alembic/versions/0c431867c679_pets_now_have_a_description.py | Python | gpl-2.0 | 659 | 0.007587 |
from __future__ import unicode_literals
from netmiko.f5.f5_ltm_ssh import F5LtmSSH
__all__ = ['F5LtmSSH']
| michaelrosejr/pyaos6 | netmiko/f5/__init__.py | Python | mit | 107 | 0 |
"""Support for Hass.io."""
from __future__ import annotations
import asyncio
from datetime import timedelta
import logging
import os
from typing import Any, NamedTuple
import voluptuous as vol
from homeassistant.auth.const import GROUP_ID_ADMIN
from homeassistant.components import panel_custom, persistent_notificati... | rohitranjan1991/home-assistant | homeassistant/components/hassio/__init__.py | Python | mit | 23,541 | 0.000935 |
import astropy.cosmology as co
aa=co.Planck15
import astropy.io.fits as fits
import matplotlib
import matplotlib
matplotlib.rcParams['agg.path.chunksize'] = 2000000
matplotlib.rcParams.update({'font.size': 12})
matplotlib.use('Agg')
import matplotlib.pyplot as p
import numpy as n
import os
import sys
# global cosmo ... | JohanComparat/pySU | spm/bin_SMF/smf_plot.py | Python | cc0-1.0 | 15,194 | 0.025536 |
#!/dlmp/sandbox/cgslIS/rohan/Python-2.7.11/python
"""
setting up logging
"""
import logging
import time
import datetime
def main(filename):
logger = configure_logger(filename)
def configure_logger(filename):
"""
setting up logging
"""
logger = logging.getLogger(filename)
logger.setLevel(lo... | rohandavidg/CONCORD-VCF | bin/do_logging.py | Python | mit | 668 | 0.001497 |
import luigi
from preprocess_data import ScaleDirectorFeatureValues, ScaleTeacherFeatureValues
from split_data import SplitAvgSchoolData, SplitOutstandingSchoolData
class AllDataTasks(luigi.WrapperTask):
def requires(self):
return SplitAvgSchoolData(), SplitOutstandingSchoolData(), ScaleTeacherFeatureVal... | ffmmjj/desafio-dados-2016 | data_preparation_pipeline/run_all_data_tasks.py | Python | apache-2.0 | 356 | 0.005618 |
import multiprocessing
import logging
class Experimenter(object):
"""
Coordinated, parallel execution of Experiments with logging.
"""
def __init__(self, log_name, experiments, cpu_limit=2**16):
"""
:param experiments: A list of pypuf.experiments.experiment.base.Experiment
:pa... | nicostephan/pypuf | pypuf/experiments/experimenter.py | Python | gpl-3.0 | 1,942 | 0.00206 |
#! /usr/bin/python
from WN_exp import *
from WN_evaluation import *
if theano.config.floatX == 'float32':
sys.stderr.write("""WARNING: Detected floatX=float32 in the configuration.
This might result in NaN in embeddings after several epochs.
""")
launch(op='TransE', dataset='WN', simfn='L1', ndim=20, nhid=20, mar... | while519/SME | WN/WN_TransE.py | Python | bsd-3-clause | 604 | 0.006623 |
from __future__ import unicode_literals
from django.contrib.auth.models import (
AbstractBaseUser, BaseUserManager, PermissionsMixin)
from django.db import models
from django.forms.models import model_to_dict
from django.utils import timezone
from django.utils.encoding import python_2_unicode_compatible
from djang... | car3oon/saleor | saleor/userprofile/models.py | Python | bsd-3-clause | 5,495 | 0.000182 |
from flask import Blueprint, g, current_app, request, Response, jsonify, copy_current_request_context
import json
import functools
import sys
import traceback
import logging
from redis import Redis
from time import sleep
from uuid import uuid4
from io import StringIO
from datetime import datetime
from pyox.apps.tracke... | alexmilowski/python-hadoop-rest-api | pyox/apps/tracker/api.py | Python | apache-2.0 | 22,821 | 0.034836 |
""" Settings for proj """
from .base import *
try:
from .local import *
except ImportError as exc:
exc.args = tuple(
['%s (did you rename settings/local-dist.py?)' % exc.args[0]])
raise exc
| damsonn/django-docker-compose | proj/settings/__init__.py | Python | mit | 211 | 0 |
#!/usr/bin/python
# Copyright (c) 2015, BROCADE COMMUNICATIONS SYSTEMS, INC
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright n... | gaberger/pybvc | samples/sampleopenflow/demos/demo8.py | Python | bsd-3-clause | 7,431 | 0.004979 |
__author__ = "Alex Baranov"
from inequalities import chernikov as c
from permutations import *
import numpy as np
def find_minimum(goal_func,
constraints_system,
combinatorial_set,
add_constraints=True,
series_count=3,
e... | stonelake/pyoptimization | pyopt/discrete/randomsearch.py | Python | apache-2.0 | 6,894 | 0.002756 |
#from flask import Flask, request, Response
import argparse
import ConfigParser
import flask
import logging
import os
import shutil
import sys
import tempfile
import time
import senbonzakura.backend.core as core
import senbonzakura.cache.cache as cache
import senbonzakura.database.db as db
import senbonzakura.backend.... | ffledgling/Senbonzakura | senbonzakura/frontend/api.py | Python | mpl-2.0 | 10,807 | 0.006107 |
import os.path
import sys
import re
import warnings
import cx_Oracle
from django.db import connection, models
from django.db.backends.util import truncate_name
from django.core.management.color import no_style
from django.db.models.fields import NOT_PROVIDED
from django.db.utils import DatabaseError
# I... | edisonlz/fruit | web_project/base/site-packages/south/db/oracle.py | Python | apache-2.0 | 12,431 | 0.005712 |
"""
Definition of views.
"""
from app.models import Choice, Poll
from datetime import datetime
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.http import HttpRequest, HttpResponseRedirect
from django.shortcuts import get_object_or_404, render
from dja... | DinoV/PTVS | Python/Templates/Samples/ProjectTemplates/Python/Samples/PollsDjango/app/views.py | Python | apache-2.0 | 3,472 | 0.004032 |
from __future__ import absolute_import
from werkzeug.exceptions import ServiceUnavailable, NotFound
from r5d4.flask_redis import get_conf_db
def publish_transaction(channel, tr_type, payload):
conf_db = get_conf_db()
if tr_type not in ["insert", "delete"]:
raise ValueError("Unknown transaction type", ... | practo/r5d4 | r5d4/publisher.py | Python | mit | 1,023 | 0 |
#!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from setup.installer import VMInstaller
from setup import Command
class Linux32(VM... | ashang/calibre | setup/installer/linux/__init__.py | Python | gpl-3.0 | 792 | 0.006313 |
#!/usr/bin/env python
import rospy
import os
import roslib
roslib.load_manifest("denso_pendant_publisher")
roslib.load_manifest("actionlib_msgs")
import denso_pendant_publisher.msg
import std_msgs.msg
import actionlib_msgs.msg
rospy.init_node("moveit_canceler")
g_runnable = True
g_prev_status = None
def pendantC... | mikewrock/phd_backup_full | src/wrock/vs060/scripts/moveit_canceler.py | Python | apache-2.0 | 1,094 | 0.008227 |
# This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | belokop/indico_bare | indico/modules/events/timetable/controllers/legacy.py | Python | gpl-3.0 | 26,827 | 0.0041 |
#!/usr/bin/env python
#
# ESP8266 ROM Bootloader Utility
# https://github.com/themadinventor/esptool
#
# Copyright (C) 2014 Fredrik Ahlberg
#
# 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; eith... | DarkLotus/OakCore | tools/esptool.py | Python | lgpl-2.1 | 28,767 | 0.011506 |
from test_admin import * | FrankSalad/django-memcache-status | memcache_status/tests/__init__.py | Python | bsd-3-clause | 24 | 0.041667 |
# -*- coding: utf-8 -*-
from nose.tools import assert_equals, assert_raises_regexp, assert_raises
from diylang.parser import unparse, find_matching_paren
from diylang.types import DiyLangError
"""
This module contains a few tests for the code provided for part 1.
All tests here should already pass, and should be of ... | joelchelliah/diy-lisp | tests/test_provided_code.py | Python | bsd-3-clause | 2,580 | 0.001163 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | arhik/nupic | examples/opf/experiments/spatial_classification/scalar_1/description.py | Python | agpl-3.0 | 2,144 | 0.004664 |
# -*- coding: utf-8 -*-
from DataBase import *
from Professor import *
from Aluno import *
from Cadastro import *
class Login:
def logInAluno(self, username, senha):
connect.execute('SELECT * FROM alunos WHERE nome="%s" AND senha="%s"' % (username, senha))
row = connect.fetchone()
if row is... | elielprado/ESOF | Programa em Python/Esof Python/Login.py | Python | gpl-3.0 | 3,192 | 0.001255 |
from flask import Flask, jsonify, request
from btree import Tree
from asteval_wrapper import Script
# Startup stuff
app = Flask(__name__)
app.config.from_object('config')
# Jinja initialization to use PyJade
app.jinja_env.add_extension('pyjade.ext.jinja.PyJadeExtension')
# Global jinja functions
app.jinja_env.global... | Snuggert/moda | project/app/__init__.py | Python | mit | 1,446 | 0.000692 |
import unittest
from op_test_util import OpTestMeta
from gradient_checker import GradientChecker, create_op
import numpy as np
from paddle.v2.framework.op import Operator
class IdentityTest(unittest.TestCase):
__metaclass__ = OpTestMeta
def setUp(self):
self.type = "identity"
self.inputs = {'... | lispc/Paddle | python/paddle/v2/framework/tests/test_scale_and_identity_op.py | Python | apache-2.0 | 1,273 | 0 |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | lhfei/spark-in-action | spark-3.x/src/main/python/mllib/pca_rowmatrix_example.py | Python | apache-2.0 | 1,712 | 0.000584 |
import os
from setuptools import setup
README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='cpdir',
version='0.1',
packages=['sellrobots'... | Enyruas/Kitux | setup.py | Python | apache-2.0 | 2,354 | 0.012319 |
from scapy.all import *
from termcolor import colored
def pkthandler(pkt):
try:
ip = pkt[IP]
except IndexError:
pass
try:
src = ip.src
dst = ip.dst
except UnboundLocalError:
pass
if pkt.haslayer(DNS):
dns = pkt[DNS]
query = dns[DNSQR]
qtype = dnsqtypes.g... | Dylan-halls/Network-Exploitation-Toolkit | Unpacking/DNS.py | Python | mit | 1,603 | 0.027449 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The migrate command-line tool."""
import sys
import inspect
import logging
from optparse import OptionParser, BadOptionError
from migrate.versioning import api, exceptions
from migrate.versioning.config import *
from migrate.versioning.util import asbool
alias = dic... | evensonbryan/yocto-autobuilder | lib/python2.7/site-packages/sqlalchemy_migrate-0.6-py2.6.egg/migrate/versioning/shell.py | Python | gpl-2.0 | 6,390 | 0.001721 |
import torch
class RBFCovariance(torch.autograd.Function):
@staticmethod
def forward(ctx, x1, x2, lengthscale, sq_dist_func):
if any(ctx.needs_input_grad[:2]):
raise RuntimeError("RBFCovariance cannot compute gradients with " "respect to x1 and x2")
if lengthscale.size(-1) > 1:
... | jrg365/gpytorch | gpytorch/functions/rbf_covariance.py | Python | mit | 1,186 | 0.004216 |
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 9 15:39:28 2014
@author: ibackus
"""
import numpy as np
import pynbody
SimArray = pynbody.array.SimArray
import isaac
import subprocess
import os
import glob
import time
def v_xy(f, param, changbin=None, nr=50, min_per_bin=100):
"""
Attempts to calculate the... | dflemin3/ICgen | backup03/calc_velocity.py | Python | mit | 6,220 | 0.01254 |
# coding=utf-8
# Copyright 2018 The Tensor2Tensor 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... | mlperf/training_results_v0.5 | v0.5.0/google/research_v3.32/gnmt-tpuv3-32/code/gnmt/model/t2t/tensor2tensor/bin/t2t_trainer_test.py | Python | apache-2.0 | 1,357 | 0.002948 |
#!/usr/bin/env python
# File created on 29 May 2011
from __future__ import division
__author__ = "Greg Caporaso"
__copyright__ = "Copyright 2011, The QIIME project"
__credits__ = ["Greg Caporaso", "Jose Antonio Navas Molina"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Greg Caporaso"
__email__ = "g... | josenavas/qiime | scripts/count_seqs.py | Python | gpl-2.0 | 3,211 | 0.001246 |
import sys
import windrosebin
for x in sys.argv:
print x
print type(sys.argv)
windrosebin.allocate()
windrosebin.check(sys.argv[1],sys.argv[2],len(sys.argv))
windrosebin.calc(sys.argv[1],sys.argv[3],len(sys.argv))
windrosebin.printLines() | jonguan/cmpe275-proj1-windrose | run_reduce.py | Python | mit | 242 | 0.020661 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# pywim documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# 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
# autog... | xmnlab/pywim | docs/conf.py | Python | mit | 8,369 | 0.005377 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# This file is part of Cockpit.
#
# Copyright (C) 2015 Red Hat, Inc.
#
# Cockpit 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 2.1 of the Lice... | dperpeet/cockpit | test/verify/storagelib.py | Python | lgpl-2.1 | 12,449 | 0.002089 |
# Copyright 2017 AT&T Intellectual Property. All other 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... | att-comdev/drydock | drydock_provisioner/cli/task/actions.py | Python | apache-2.0 | 5,257 | 0.000761 |
#!/usr/bin/env python3
import docker
def pull_ncapture():
d_client = docker.from_env()
d_client.images.pull('cyberreboot/vent-ncapture', tag='master')
if __name__ == '__main__': # pragma: no cover
pull_ncapture()
| Jeff-Wang93/vent | vent/core/network_tap/ncontrol/prestart.py | Python | apache-2.0 | 230 | 0 |
from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.utils.six.moves.urllib.parse import urlparse
from wagtail.wagtailcore.models import Page
class BadRequestError(Exception):
pass
def get_base_url(request=None):
base_url = getattr(settings, 'WAGTAILAPI_BAS... | chrxr/wagtail | wagtail/contrib/wagtailapi/utils.py | Python | bsd-3-clause | 807 | 0.001239 |
#! /usr/bin/python
""" Runs an OpenFOAM solver and captures the output. Extracts information
about the linear solvers (initial residual) and outputs it in a "Fluentish"
way (one line per timestep).Called:
compactOutput.py interFoam . damBreak
"""
import re,sys
from PyFoam.LogAnalysis.LogLineAnalyzer import LogLineA... | mortbauer/openfoam-extend-Breeder-other-scripting-PyFoam | examples/compactOutput.py | Python | gpl-2.0 | 1,329 | 0.017306 |
# 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... | aldian/tensorflow | tensorflow/python/keras/engine/training_v1.py | Python | apache-2.0 | 138,190 | 0.005065 |
# -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from django.db.models import Count
... | taedori81/shoop | shoop/admin/modules/contacts/views/list.py | Python | agpl-3.0 | 2,134 | 0.001406 |
import nibabel as nb
from nipype.utils.filemanip import split_filename
sxfmout = nb.load('/scr/schweiz1/Data/results/sxfmout/_session_session1/_subject_id_9630905/_fwhm_0/_hemi_lh/lh.afni_corr_rest_roi_dtype_tshift_detrended_regfilt_gms_filt.fsaverage4.nii').get_data()
##from mask_surface import MaskSurface
data = nb... | NeuroanatomyAndConnectivity/pipelines | src/clustering/clustering/create_input_surface.py | Python | mit | 833 | 0.010804 |
#!/usr/bin/python
# -*- coding: iso-8859-15 -*-
#
# Copyright (c) 2007 Mike (mosburger) Desjardins <desjardinsmike@gmail.com>
# Please do not email the above person for support. The
# email address is only there for license/copyright purposes.
#
# This is the preferences dialog for a calendar applet for Avant W... | p12tic/awn-extras | applets/maintained/calendar/calendarprefs.py | Python | gpl-2.0 | 9,376 | 0.00288 |
{
'name' : 'Product status at website shop',
'version' : '1.0.1',
'author' : 'IT-Projects LLC, Ivan Yelizariev',
'license': 'GPL-3',
'category' : 'Sale',
'website' : 'https://yelizariev.github.io',
'depends' : ['website_sale', 'stock'],
'data':[
'website_sale_stock_status_views.x... | Endika/website-addons | website_sale_stock_status/__openerp__.py | Python | lgpl-3.0 | 408 | 0.017157 |
# coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
from .._ffi import FFIEngineError, register_ffi
from .._types import str_cls
from ..errors import LibraryNotFoundError
try:
import cffi
except (ImportError):
raise FFIEngineError('Error importing cffi')
__all... | igor-rangel7l/igorrangel.repository | plugin.video.SportsDevil/service/oscrypto/_win/_kernel32_cffi.py | Python | gpl-2.0 | 1,029 | 0.000972 |
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/stable/config
# -- Path setup ------------------------------------------------------------... | rienafairefr/pynYNAB | docs/conf.py | Python | mit | 4,876 | 0.000205 |
#!/usr/bin/env python
#
# Copyright 2015 Mobolic
#
# 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 a... | rogerthat-platform/rogerthat-backend | src/facebook/version.py | Python | apache-2.0 | 625 | 0 |
import sys
import urllib2
import HTMLParser
import xml.etree.ElementTree as ET
from logging import getLogger
class Rss(object):
"""A class for handling RSS feeds"""
def __init__(self,url=None):
if not url:
self.url = ''
self.articles = ''
else:
self.url = url
... | rad08d/rssreader_flask | flask_rss/rssapp/rss.py | Python | apache-2.0 | 4,065 | 0.005412 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
# License: GNU General Public License v3. See license.txt
import webnotes
def execute():
webnotes.reload_doc("core", "doctype", "docfield")
webnotes.reload_doc("support", "doctype", "support_ticket")
# customer issue resolved_by should be Profile
if webnote... | gangadhar-kadam/sapphire_app | patches/january_2013/update_closed_on.py | Python | agpl-3.0 | 1,386 | 0.034632 |
#!/usr/bin/env python3
#Author: Stefan Toman
if __name__ == '__main__':
n = int(input())
a = set(map(int, input().split()))
m = int(input())
b = set(map(int, input().split()))
print(len(a-b))
| stoman/CompetitiveProgramming | problems/pythonsetdifference/submissions/accepted/stefan.py | Python | mit | 214 | 0.004673 |
# Copyright (c) 2008 Mikael Lind
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distrib... | Astrophilic/Algorithms_Example | AStarSearch/python/astar.py | Python | apache-2.0 | 5,569 | 0 |
class ZXSpectrumMameDriver:
pass
| FrodeSolheim/fs-uae-launcher | fsgamesys/platforms/zxspectrum/zxspectrummamedriver.py | Python | gpl-2.0 | 37 | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2019 Satpy developers
#
# This file is part of satpy.
#
# satpy 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... | pytroll/satpy | satpy/tests/reader_tests/test_safe_sar_l2_ocn.py | Python | gpl-3.0 | 3,887 | 0.002058 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.