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 |
|---|---|---|---|---|---|---|
# 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 ... | SUSE/azure-sdk-for-python | azure-mgmt-cdn/azure/mgmt/cdn/models/sso_uri.py | Python | mit | 893 | 0 |
import math
class GeoLocation:
'''
Class representing a coordinate on a sphere, most likely Earth.
This class is based from the code smaple in this paper:
http://janmatuschek.de/LatitudeLongitudeBoundingCoordinates
The owner of that website, Jan Philip Matuschek, is the full ow... | RDCEP/hybrid-dile-server | lib/utils/geolocation.py | Python | apache-2.0 | 5,668 | 0.010233 |
import pytest
from cplpy import run_test, prepare_config
import subprocess as sp
import os
import glob
class cd:
"""Context manager for changing the current working directory"""
def __init__(self, newPath):
self.newPath = os.path.expanduser(newPath)
def __enter__(self):
self.savedPath = os... | Crompulence/cpl-library | test/valgrind/test_valgrind.py | Python | gpl-3.0 | 3,969 | 0.006551 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
import datetime
import random
import re
import sqlalchemy as sa
import structlo... | mozilla/build-relengapi | relengapi/blueprints/tooltool/__init__.py | Python | mpl-2.0 | 14,685 | 0.000885 |
###############################################################################
## File : b64decode.py
## Description: Base64 decode a supplied list of strings
## :
## Created_On : Wed Sep 26 12:33:16 2012
## Created_By : Rich Smith (rich@kyr.us)
## Modified_On: Tue Jan 29 16:42:41 2013
## Modi... | kyrus/PyMyo | modules/b64decode/command.py | Python | bsd-3-clause | 886 | 0.021445 |
import maya.cmds;mc = maya.cmds
import pymel.core;pm = pymel.core
from pytaya.core.general import listForNone
from pytd.util.logutils import logMsg
from pytd.util.sysutils import grouper
def fileNodesFromObjects(oObjList):
return fileNodesFromShaders(shadersFromObjects(oObjList))
def fileNodesFromShaders(oMatL... | sebcourtois/pypeline-tool-devkit | pytaya/core/rendering.py | Python | gpl-3.0 | 12,494 | 0.006163 |
#!/usr/bin/python
import os
import json
def main():
print("Sample Post Script")
files = json.loads(os.environ.get('MH_FILES'))
for filename in files:
print(filename)
if __name__ == "__main__":
main()
| Collisionc/sickbeard_mp4_automator | post_process/sample.py | Python | mit | 214 | 0.028037 |
from kompromatron.core import app
from kompromatron.views.base import base
# app.register_blueprint(entities)
# app.register_blueprint(relations)
#app.register_blueprint(base)
| pudo/kompromatron | kompromatron/web.py | Python | mit | 177 | 0.00565 |
import os
import platform
import subprocess
import datetime as dt
import time
import calendar
import sys
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# General Parameters - Tools - Proxy Network - Output Directory
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Path declaratio... | HoboSci/OBIS-Capelin | 1Loop_on_date_python_script.py | Python | mit | 18,420 | 0.014327 |
from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
from trainer.models import Language
class AddWordForm(forms.Form):
language = forms.ModelChoiceField(queryset=Language.objects.all())
word = forms.CharField(required=True)
class Create... | chrigu6/vocabulary | vocabulary/trainer/forms.py | Python | gpl-3.0 | 1,356 | 0.0059 |
import logging
from flask import (
Flask,
request,
Response
)
import requests
app = Flask(__name__)
@app.route('/<path:url>', methods=['GET', 'POST', 'PUT', 'PATCH'])
def proxy(url):
# extract the request info and change its destination
# how to deal with socketio
if url == "socket.io/":
... | sillygod/my-travel-in-learning-python | proxy.py | Python | gpl-2.0 | 1,022 | 0.004892 |
"""
WSGI config for SysuLesson 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.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SE... | chenzeyuczy/keba | src/SysuLesson/wsgi.py | Python | gpl-2.0 | 397 | 0 |
from django.contrib import admin
'''from tester.models import Club,Member,Signup,Event
class admin_club(admin.ModelAdmin):
list_display=["club_name"]
class admin_event(admin.ModelAdmin):
list_display=["event_name"]
class admin_student(admin.ModelAdmin):
list_display=["usn","name"]
class admin_membe... | anirudhagar13/PES-Portal | pes_portal/club/admin.py | Python | apache-2.0 | 548 | 0.010949 |
# ----------------------------------------------------------------------
# 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... | syl20bnr/nupic | nupic/research/TP.py | Python | gpl-3.0 | 132,910 | 0.00793 |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | CiscoSystems/avos | openstack_dashboard/dashboards/identity/users/tests.py | Python | apache-2.0 | 26,197 | 0 |
import subprocess as sp
def matches(text):
return text.startswith('#')
def process(text):
text = text[1:]
result = sp.check_output(text, shell=True).decode('utf-8').rstrip().replace('\\n', '\n')
return result
| maateen/TextSuggestBangla | textsuggest/processors/command.py | Python | gpl-3.0 | 219 | 0.031963 |
import os
import sys
from direct.showbase.ShowBase import ShowBase
import panda3d.core as p3d
import blenderpanda
import inputmapper
from nitrogen import gamestates
if hasattr(sys, 'frozen'):
APP_ROOT_DIR = os.path.dirname(sys.executable)
else:
APP_ROOT_DIR = os.path.dirname(__file__)
if not APP_ROOT_DIR:
... | Moguri/prototype-nitrogen | game/main.py | Python | apache-2.0 | 1,902 | 0.001577 |
# Copyright (c) 2014 Katsuya Noguchi
#
# 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, dis... | DavidHHShao/slack | tests/unit/http_client/test_raise_error.py | Python | mit | 3,437 | 0.005237 |
from __future__ import division
import state
import time
import csv
import random
import sys
POPULATION_SIZE = 100
MAX_COLLISION = 28
VALID_ARGS = "emg"
class FitnessListener():
def __init__(self, qtd=0):
self._qtd = qtd
def log(self):
self._qtd += 1
def retrive_qtd(self):
ret... | miguelarauj1o/8-Queens | eightqueens/__main__.py | Python | mit | 6,082 | 0.010209 |
"""!event [num]: Displays the next upcoming H@B event."""
__match__ = r"!event( .*)"
| kvchen/keffbot-py | plugins/event.py | Python | mit | 87 | 0.011494 |
# This doesn't work- not updated with eventmaster.py updates
# TODO: Fix This :)
# Import Libraries
import eventmaster
import time
import random
import sys
import unittest
import sys
class InputsTestCase(unittest.TestCase):
def setUp(self):
self.s3 = E2S3.E2S3Switcher()
self.s3.set_verbose(0)
... | kyelewisstgc/EventMaster-Python | tests/test_unit.py | Python | mit | 1,220 | 0.007377 |
#!/usr/bin/python
import psycopg2
import sys
import pprint
import geocoder
def printProgress(iteration, total, prefix='', suffix='', decimals=2, barLength=100):
filledLength = int(round(barLength * iteration / float(total)))
percents = round(100.00 * (iteration / float(total)), decimals)
bar = '#' * fill... | lepklin/twitter-db-ui | removeDouble.py | Python | mit | 1,784 | 0.019619 |
"""Functions for downloading and reading MNIST data."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import gzip
import os
import urllib
import numpy
from six.moves import xrange # pylint: disable=redefined-builtin
SOURCE_URL = 'http://yann.lecun.com/exdb... | saraghav/blue-box | TensorFlow/input_data.py | Python | apache-2.0 | 5,847 | 0.015735 |
# Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""This module contains a class for handling request queries."""
# flake8: noqa
import collections
import datetime
import functools
import operator
import flask
import sqlalchemy as sa
from sqlalchemy.orm... | j0gurt/ggrc-core | src/ggrc/converters/query_helper.py | Python | apache-2.0 | 33,268 | 0.006523 |
class BinaryTree:
def __init__(self,rootObj):
self.key = rootObj
self.leftChild = None
self.rightChild = None
def insertLeft(self,newNode):
if self.leftChild == None:
self.leftChild = BinaryTree(newNode)
else:
t = BinaryTree(newNode)
t.leftChild = self.leftChild
self.leftChild = t
def insertR... | BaReinhard/Hacktoberfest-Data-Structure-and-Algorithms | data_structures/binary_tree/python/binary_tree.py | Python | gpl-3.0 | 694 | 0.048991 |
from sys import version, exit
from setuptools import setup
requirements = open("requirements.txt").read().split()
with open("README.md") as f:
long_description = f.read()
setup(
name = 'bagcat',
version = '0.0.6',
url = 'https://github.com/umd-mith/bagcat/',
author = 'Ed Summers',
author_emai... | umd-mith/bagcat | setup.py | Python | mit | 647 | 0.027821 |
"""
tests.test_component_demo
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests demo component.
"""
import unittest
import homeassistant.core as ha
import homeassistant.components.automation as automation
import homeassistant.components.automation.event as event
from homeassistant.const import CONF_PLATFORM, ATTR_ENTITY_ID
class T... | Nzaga/home-assistant | tests/components/automation/test_init.py | Python | mit | 2,584 | 0 |
from typing import List
class Solution:
def findMin(self, nums: List[int]) -> int:
first = nums[0]
# Iterate until the next number is less than current.
for num in nums:
if num < first:
return num
return first
| AustinTSchaffer/DailyProgrammer | LeetCode/FindMinimumInRotatedSortedArray2/app.py | Python | mit | 277 | 0.00361 |
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file... | Francis-Liu/animated-broccoli | nova/db/sqlalchemy/api.py | Python | apache-2.0 | 240,590 | 0.001176 |
#!/usr/bin/env python
import os.path
import unittest
import pep8
SRC_PATH = os.path.dirname(os.path.dirname(__file__))
EXCLUDE = ['.svn', 'CVS', '.bzr', '.hg', '.git',
'Paste-1.7.5.1-py2.6.egg', 'PasteDeploy-1.5.0-py2.6.egg', 'data']
class AdhocracyStyleGuide(pep8.StyleGuide):
def ignore_code(self, ... | SysTheron/adhocracy | src/adhocracy/tests/test_pep8.py | Python | agpl-3.0 | 2,111 | 0 |
"""Weighted Quick Union Algorithm takes steps to avoid tall trees."""
from AlgsSedgewickWayne.BaseComp import BaseComp
class WeightedQuickUnionUF(BaseComp):
""" UNION FIND: Weighted Quick-union [lazy approach] to avoid tall trees."""
def __init__(self, N): # $ = N
"""Initialize union-find data structure ... | dvklopfenstein/PrincetonAlgorithms | py/AlgsSedgewickWayne/WeightedQuickUnionUF.py | Python | gpl-2.0 | 16,078 | 0.003483 |
from pychess.Utils.const import *
class Rating ():
def __init__(self, ratingtype, elo, deviation=DEVIATION_NONE, wins=0,
losses=0, draws=0, bestElo=0, bestTime=0):
self.type = ratingtype
for v in (elo, deviation, wins, losses, draws, bestElo, bestTime):
assert v == None... | btrent/knave | pychess/Utils/Rating.py | Python | gpl-3.0 | 2,135 | 0.007026 |
from flask import Flask, request, abort
import json
import ndb_util
import model
from google.appengine.api import users
from google.appengine.ext import ndb
from flask_restful import Resource
#TODO auth stuff
class OrganizationApi(Resource):
def get(self, id=None):
id = str(id)
if id is None:
... | jtovar2/demo_app | backend/resources/org_api.py | Python | mit | 2,570 | 0.003113 |
#
# Advene: Annotate Digital Videos, Exchange on the NEt
# Copyright (C) 2008-2017 Olivier Aubert <contact@olivieraubert.net>
#
# Advene 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 ... | oaubert/advene | lib/advene/gui/edit/transcribe.py | Python | gpl-2.0 | 51,178 | 0.007386 |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from projects.models import Project
class Necessity(models.Model):
"""
Item or service that an organization regularly needs
"""
name = models.CharField(verbose_name=_('Name'), max_length=20)
satisfied = models.Bo... | MauricioAlmeida/maoaberta | maoaberta/organizations/models.py | Python | gpl-2.0 | 2,083 | 0.00096 |
import cgi
from urllib import urlencode
from Rss_channel import Rss_channel
from Rss_item import Rss_item
class Updates_rss( Rss_channel ):
def __init__(
self,
recent_notes,
notebook_id,
notebook_name,
https_url,
):
if notebook_name == u"Luminotes":
notebook_path = u"/"
elif note... | osborne6/luminotes | view/Updates_rss.py | Python | gpl-3.0 | 1,836 | 0.03976 |
import tensorflow as tf
"""tf.pow(x,y,name=None)
功能:计算x各元素的y次方。
输入:x,y为张量,可以为`float32`, `float64`, `int32`, `int64`,`complex64`,`complex128`类型。"""
x = tf.constant([[2, 3, 5], [2, 3, 5]], tf.float64)
y = tf.constant([[2, 3, 4]], tf.float64)
z = tf.pow(x, y)
sess = tf.Session()
print(sess.run(z))
sess.close()
"""[[ ... | Asurada2015/TFAPI_translation | math_ops_basicoperation/tf_pow.py | Python | apache-2.0 | 416 | 0.002747 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Érudit.org documentation build configuration file, created by
# sphinx-quickstart on Mon Dec 14 17:16:39 2015.
#
# 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
#... | erudit/zenon | docs/conf.py | Python | gpl-3.0 | 9,700 | 0.005984 |
from .readtime import *
| mikitex70/pelican-plugins | readtime/__init__.py | Python | agpl-3.0 | 24 | 0 |
from __future__ import unicode_literals
from reviewboard.hostingsvcs.tests.testcases import ServiceTests
class RedmineTests(ServiceTests):
"""Unit tests for the Redmine hosting service."""
service_name = 'redmine'
fixtures = ['test_scmtools']
def test_service_support(self):
"""Testing the R... | davidt/reviewboard | reviewboard/hostingsvcs/tests/test_redmine.py | Python | mit | 899 | 0 |
#!/usr/bin/env python
import unittest
from tests.logic_t.layer.LogicLayer.util import generate_ll
class SearchTest(unittest.TestCase):
def setUp(self):
self.ll = generate_ll()
self.pl = self.ll.pl
self.admin = self.pl.create_user('name@example.org', None, True)
self.pl.add(self.a... | izrik/tudor | tests/logic_t/layer/LogicLayer/test_search.py | Python | gpl-2.0 | 2,413 | 0 |
import inspect
import os
import re
import sys
import csv
import sqlalchemy.orm.exc
from sqlalchemy.orm.session import make_transient
from sqlalchemy import and_, Boolean, Date, func, Integer, Numeric
from datetime import date
from decimal import Decimal
import model
def db_import_file(engine, table_class, fname, col_o... | mmikitka/usdanutrient | usdanutrient/importservice.py | Python | gpl-3.0 | 15,884 | 0.003463 |
from .maxrects import MaxRectsBssf
import operator
import itertools
import collections
import decimal
# Float to Decimal helper
def float2dec(ft, decimal_digits):
"""
Convert float (or int) to Decimal (rounding up) with the
requested number of decimal digits.
Arguments:
ft (float, int): Numb... | secnot/rectpack | rectpack/packer.py | Python | apache-2.0 | 17,585 | 0.006028 |
#
#
# File to test behaviour of the Golgi Cell.
#
# To execute this type of file, type '..\..\..\nC.bat -python XXX.py' (Windows)
# or '../../../nC.sh -python XXX.py' (Linux/Mac). Note: you may have to update the
# NC_HOME and NC_MAX_MEMORY variables in nC.bat/nC.sh
#
# Author: Padraig Gleeson
#
# ... | pgleeson/TestArea | models/Cerebellum/pythonScripts/Test_SingleGranule.py | Python | gpl-2.0 | 2,965 | 0.018887 |
# -*- coding: utf-8 -*-
from flask_restful import reqparse
from app.mod_profiles.validators.generic_validators import is_valid_id
# Parser general
parser = reqparse.RequestParser()
parser.add_argument('username', type=str, required=True)
parser.add_argument('email', type=str, required=True)
parser.add_argument('pas... | lightning-round/salud-api | app/mod_profiles/common/parsers/user.py | Python | gpl-2.0 | 615 | 0 |
"""Models for SQLAlchemy.
This file contains the original models definitions before schema tracking was
implemented. It is used to test the schema migration logic.
"""
import json
from datetime import datetime
import logging
from sqlalchemy import (Boolean, Column, DateTime, ForeignKey, Index, Integer,
... | kyvinh/home-assistant | tests/components/recorder/models_original.py | Python | apache-2.0 | 5,545 | 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... | airbnb/airflow | tests/utils/test_python_virtualenv.py | Python | apache-2.0 | 2,580 | 0.003101 |
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
#... | MostlyOpen/odoo_addons | myo_person_mng/models/person_mng.py | Python | agpl-3.0 | 3,872 | 0.00155 |
#!/usr/bin/env python
"""
This script accepts .csv pipeline output and gives a .ps file with a basic tree structure
"""
__author__ = "Paul Donovan"
__maintainer__ = "Paul Donovan"
__email__ = "pauldonovandonegal@gmail.com"
import sys
import argparse
from ete3 import NCBITaxa
#Display help and usage
parser = argpar... | GiantSpaceRobot/FindFungi | FindFungi-v0.23/CSV-to-Tree.py | Python | mit | 2,781 | 0.024811 |
# 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)
import os
import sys
from spack import *
class Vtk(CMakePackage):
"""The Visualization Toolkit (VTK) is an open-sou... | rspavel/spack | var/spack/repos/builtin/packages/vtk/package.py | Python | lgpl-2.1 | 12,385 | 0.000888 |
"""Utility functions for plots."""
from functools import wraps
from os.path import join as pjoin
import matplotlib.pyplot as plt
###################################################################################################
########################################################################################... | voytekresearch/neurodsp | neurodsp/plts/utils.py | Python | apache-2.0 | 1,740 | 0.002299 |
#!/usr/bin/python
# gen_numerics.py: generate numerics.h
import numerics
print """/*
quIRC - simple terminal-based IRC client
Copyright (C) 2010-13 Edward Cree
See quirc.c for license information
numeric: IRC numeric replies
*/
/***
This file is generated by gen_numerics.py from masters in numerics.py.
Do not... | ec429/quIRC | gen_numerics.py | Python | gpl-3.0 | 1,245 | 0.011245 |
import django_filters
from rest_framework import filters
class CaseInsensitiveBooleanFilter(django_filters.Filter):
# The default django_filters boolean filter *only* accepts True and False
# which is problematic when dealing with non-Python clients. This allows
# the lower case variants, as well as 0 and... | mozilla/normandy | normandy/base/api/filters.py | Python | mpl-2.0 | 1,421 | 0 |
"""
WSGI config for mysite 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.8/howto/deployment/wsgi/
"""
import os, sys
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_S... | evewspace/eve-wspace | evewspace/wsgi.py | Python | apache-2.0 | 397 | 0.002519 |
# Copyright (C) 2011 Brad Misik
#
# 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, distribu... | temugen/pipil | pipil.py | Python | mit | 10,540 | 0.017268 |
import datetime
from django.test import TestCase
from django.utils import timezone
from schedule.models import Event, Rule, Calendar
from schedule.utils import EventListManager
class TestEventListManager(TestCase):
def setUp(self):
weekly = Rule.objects.create(frequency="WEEKLY")
daily = Rule.ob... | GrahamDigital/django-scheduler | tests/test_utils.py | Python | bsd-3-clause | 2,204 | 0.003176 |
import re
import time
import readline
import os
# CONVERT shell colors to the same curses palette
SHELL_COLORS = {
"wr": '\033[1;37;41m', # white on red
"wo": '\033[1;37;43m', # white on orange
"wm": '\033[1;37;45m', # white on magenta
"wb": '\033[1;37;46m', # white on blue
"bw": '\033[1;37;40m', #... | khughitt/ete | ete_dev/tools/utils.py | Python | gpl-3.0 | 6,239 | 0.010258 |
from __future__ import unicode_literals
import frappe
from frappe import _
from erpnext.setup.setup_wizard.operations.install_fixtures import add_market_segments
def execute():
frappe.reload_doc('crm', 'doctype', 'market_segment')
frappe.local.lang = frappe.db.get_default("lang") or 'en'
add_market_segments() | Zlash65/erpnext | erpnext/patches/v11_0/add_market_segments.py | Python | gpl-3.0 | 317 | 0.018927 |
import tkinter as tk
from tkinter import ttk
import pkinter as pk
root = tk.Tk()
menu = tk.Menu(root, type="menubar")
filemenu = tk.Menu(menu)
filemenu.add_command(label="New")
filemenu.add_command(label="Save")
menu.add_cascade(label="File", menu=filemenu)
helpmenu = tk.Menu(menu)
helpmenu.add_checkbutton(label="Abo... | DeflatedPickle/pkinter | pkinter_test.py | Python | mit | 6,451 | 0.00093 |
# ----------------------------------------------------------------------------
# Copyright 2014 Nervana Systems 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.o... | misko/neon | neon/data/video.py | Python | apache-2.0 | 865 | 0 |
import json
import os
import re
import tempfile
from typing import List
import pytest
from plenum.common.signer_did import DidSigner
from indy_client.test.agent.acme import ACME_ID, ACME_SEED
from indy_client.test.agent.acme import ACME_VERKEY
from indy_client.test.agent.faber import FABER_ID, FABER_VERKEY, FABER_SEED... | TechWritingWhiz/indy-node | indy_client/test/cli/conftest.py | Python | apache-2.0 | 46,041 | 0.000673 |
from __future__ import print_function, division, absolute_import
# Copyright (c) 2016 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNES... | Lorquas/subscription-manager | src/rhsmlib/dbus/util.py | Python | gpl-2.0 | 2,488 | 0.001608 |
# Copyright (c) 2016, Daniele Venzano
#
# 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 w... | DistributedSystemsGroup/zoe | zoe_master/metrics/kairosdb.py | Python | apache-2.0 | 4,088 | 0.001223 |
from django.contrib import admin
from cobra.core.loading import get_model
| lyoniionly/django-cobra | src/cobra/apps/summary/admin.py | Python | apache-2.0 | 76 | 0.013158 |
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# 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, eithe... | mablae/weblate | weblate/trans/tests/test_suggestions.py | Python | gpl-3.0 | 7,857 | 0 |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distrib... | srgblnch/LinacGUI | ctli/widgets/actionform.py | Python | gpl-3.0 | 2,316 | 0.000864 |
# Copyright © 2018 Red Hat, Inc.
#
# This file is part of Bodhi.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# T... | Conan-Kudo/bodhi | bodhi/tests/server/views/__init__.py | Python | gpl-2.0 | 817 | 0.001225 |
import numpy as np
import theano
import theano.tensor as T
from theano_utils import sharedX, floatX, intX
def uniform(shape, scale=0.05):
return sharedX(np.random.uniform(low=-scale, high=scale, size=shape))
def normal(shape, scale=0.05):
return sharedX(np.random.randn(*shape) * scale)
def orthogonal(shape... | zxsted/Passage | passage/inits.py | Python | mit | 701 | 0.007133 |
try:
from DevelopmentConfig import NasConf
print("Loaded DevelopementConf file")
except ImportError:
from Config import NasConf
print("Loaded Conf file")
from ConfigParser import config_parser_class_tests, ConfigParser
from Partition import partition_class_tests
from Disk import disk_class_tests
__aut... | mrozo/PyNas | PyNAS.py | Python | bsd-3-clause | 839 | 0.001192 |
from django.conf.urls import patterns, url
from .views import EmailAlternativeView
urlpatterns = patterns(
'',
url(r'^email_alternative/(?P<pk>\d+)/$',
EmailAlternativeView.as_view(),
name='email_alternative'),
) | bigmassa/django_mail_save | mail_save/urls.py | Python | mit | 238 | 0.004202 |
import re
import unicodedata
from django.core.urlresolvers import reverse
from django.core.exceptions import ObjectDoesNotExist
# List of words you're not allowed to use as a slug
RESERVED_KEYWORDS = [
"account",
"add_to_network",
"cache",
"configuration",
"content",
"comment",
"create",
... | numericube/twistranet | twistranet/twistapp/lib/slugify.py | Python | agpl-3.0 | 1,520 | 0.006579 |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google-research/augmix | imagenet.py | Python | apache-2.0 | 15,187 | 0.008692 |
import asyncio
import ctypes
import os
import time
import unittest
import sys
clib = ctypes.CDLL('libc.so.6', use_errno=True)
class timespec(ctypes.Structure):
_fields_ = [('tv_sec', ctypes.c_long),
('tv_nsec', ctypes.c_long)]
class itimerspec(ctypes.Structure):
_fields_ = [('it_interval',... | asvetlov/europython2015 | timerfd.py | Python | apache-2.0 | 2,878 | 0.001042 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# 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 req... | chunfengh/seq2seq | bin/tools/generate_toy_data.py | Python | apache-2.0 | 5,150 | 0.00913 |
""" Unit tests for ``wheezy.templates.engine.Engine``.
"""
import unittest
class EngineTestCase(unittest.TestCase):
""" Test the ``Engine``.
"""
def setUp(self):
from wheezy.template.engine import Engine
from wheezy.template.loader import DictLoader
self.engine = Engine(
... | ezotrank/wheezy.template | src/wheezy/template/tests/test_engine.py | Python | mit | 1,081 | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright © 2009 Progiciels Bourbeau-Pinard inc.
# François Pinard <pinard@iro.umontreal.ca>, 2009.
# 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 Foundatio... | pinard/TweeTabs | TweeTabs/Tab.py | Python | gpl-2.0 | 14,849 | 0.001617 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: messagepath/v1/visibility_rules.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf imp... | tomer8007/kik-bot-api-unofficial | kik_unofficial/protobuf/messagepath/v1/visibility_rules_pb2.py | Python | mit | 5,997 | 0.00617 |
# 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 may ... | Azure/azure-sdk-for-python | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_01_15/models/_web_site_management_client_enums.py | Python | mit | 26,652 | 0.005516 |
# tf_unet 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.
#
# tf_unet is distributed in the hope that it will be useful,
# but WITHOUT... | jakeret/tf_unet | scripts/ultrasound_launcher.py | Python | gpl-3.0 | 3,744 | 0.005342 |
# -*- coding: utf-8 -*-
"""
Messaging Module - Controllers
"""
if not settings.has_module(c):
raise HTTP(404, body="Module disabled: %s" % c)
# -----------------------------------------------------------------------------
def index():
""" Module's Home Page """
module_name = settings.modules[c].get(... | flavour/eden | controllers/msg.py | Python | mit | 87,816 | 0.011604 |
from __future__ import division
import copy
import new
import math
import multiprocessing as mp
import time
import timeit
import shutil
import json as ujson
from tempfile import mkdtemp
import copy_reg
import numpy as np
import os
import os.path
from megaradrp.core.recipe import MegaraBaseRecipe
from numina.core im... | Pica4x6/megaradrp | megaradrp/recipes/calibration/weights.py | Python | gpl-3.0 | 15,527 | 0.002061 |
# Copyright 2013 Rackspace Hosting
#
# 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 ... | rmyers/clouddb-rpc | dashboard/stashboard/content/databases/views.py | Python | apache-2.0 | 19,542 | 0 |
# Copyright (C) 2013-2015 MetaMorph Software, Inc
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this data, including any software or models in source or binary
# form, as well as any drawings, specifications, and documentation
# (collectively "the Data"), to deal in the Data ... | pombredanne/metamorphosys-desktop | metamorphosys/META/src/CADAssembler/ExtractACM-XMLfromCreoModels/testExtractACM.py | Python | mit | 4,969 | 0.00322 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import urlparse
from scrapy import log
from scrapy.http import Request
from base.base_wolf import Base_Wolf
class Wolf(Base_Wolf):
def __init__(self, *args, **kwargs):
super(Wolf, self).__init__(*args, **kwargs)
self.name = 'henbt'
... | pczhaoyun/wolf | wolf/spiders/wolves/henbt.py | Python | apache-2.0 | 1,085 | 0.004608 |
#!/usr/bin/env python
#!-*- coding:utf-8 -*-
def read(filename):
dic=[]
with open(filename,'r') as fp:
while True:
lines = fp.readlines(10000)
if not lines :
break
for line in lines:
#line = line.strip('\n')
dic.append(... | momomoxiaoxi/security | Scripts/Check.py | Python | apache-2.0 | 574 | 0.019164 |
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
import super... | superdesk/superdesk-core | content_api/packages/__init__.py | Python | agpl-3.0 | 721 | 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 use ... | pixelrebel/st2 | st2actions/tests/unit/test_paramiko_remote_script_runner.py | Python | apache-2.0 | 5,199 | 0.0025 |
# This file is part of the myhdl library, a Python package for using
# Python as a Hardware Description Language.
#
# Copyright (C) 2003-2008 Jan Decaluwe
#
# The myhdl library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License as
# published by t... | jck/myhdl | myhdl/_instance.py | Python | lgpl-2.1 | 3,952 | 0.000253 |
#!/usr/bin/env python
#__author__ = 'Andrew'
from acomms import micromodem, unifiedlog
import logging
from time import sleep
import argparse
if __name__ == '__main__':
ap = argparse.ArgumentParser(description ='Connect to a MM for testing purposes')
ap.add_argument("logpath", help="Location ... | whoi-acomms/pyacomms | bin/console_logger.py | Python | lgpl-3.0 | 941 | 0.014878 |
# -*- coding: utf-8 -*-
#
# complexity 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
# autogenerated file.
#
# ... | CptLemming/django-json-patch | docs/conf.py | Python | bsd-3-clause | 8,191 | 0.007447 |
#!/usr/bin/env python
'''
Use threads and Netmiko to connect to each of the devices. Execute
'show version' on each device. Record the amount of time required to do this.
'''
import threading
from datetime import datetime
from netmiko import ConnectHandler
from my_devices import device_list as devices
def show_version... | ktbyers/pynet-ons-mar17 | threads_procs/threads_show_ver.py | Python | apache-2.0 | 1,188 | 0.003367 |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : Omero RT
Description : Omero plugin
Date : August 15, 2010
copyright : (C) 2010 by Giuseppe Sucameli (Faunalia)
email : sucameli@faunalia.i... | faunalia/rt_geosisma_offline | Utils.py | Python | gpl-3.0 | 8,122 | 0.034105 |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
parse_duration,
parse_iso8601,
)
class HuajiaoIE(InfoExtractor):
IE_DESC = '花椒直播'
_VALID_URL = r'https?://(?:www\.)?huajiao\.com/l/(?P<id>[0-9]+)'
_TEST = {
'url': 'http://www.h... | epitron/youtube-dl | youtube_dl/extractor/huajiao.py | Python | unlicense | 1,850 | 0 |
import _plotly_utils.basevalidators
class A0Validator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="a0", parent_name="carpet", **kwargs):
super(A0Validator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=kwar... | plotly/plotly.py | packages/python/plotly/plotly/validators/carpet/_a0.py | Python | mit | 380 | 0 |
from ... import BaseProvider
class Provider(BaseProvider):
"""
Provider for Philippine IDs that are related to social security
There is no unified social security program in the Philippines. Instead, the Philippines has a messy collection of
social programs and IDs that, when put together, serves as ... | danhuss/faker | faker/providers/ssn/en_PH/__init__.py | Python | mit | 2,596 | 0.005008 |
# -*- coding: utf-8 -*-
# This file is meant to test that we can also load rules from __init__.py files, this was an issue with pypy before.
from gitlint.rules import CommitRule
class InitFileRule(CommitRule):
name = "my-init-cömmit-rule"
id = "UC1"
options_spec = []
def validate(self, _commit):
... | jorisroovers/gitlint | gitlint-core/gitlint/tests/samples/user_rules/parent_package/__init__.py | Python | mit | 336 | 0.002985 |
import errno
import fnmatch
import json
import os
import re
import subprocess
import sys
MODULE_XML_START = """<?xml version="1.0" encoding="UTF-8"?>
<module type="%(type)s" version="4">"""
MODULE_XML_END = """
</module>
"""
ANDROID_FACET = """
<component name="FacetManager">
<facet type="android" name="Andro... | thinkernel/buck | src/com/facebook/buck/command/intellij.py | Python | apache-2.0 | 15,347 | 0.008927 |
# Generated by Django 2.0.2 on 2018-03-13 02:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cc', '0003_auto_20180228_1145'),
]
operations = [
migrations.AlterField(
model_name='creditcard',
name='tail_no',
... | largetalk/tenbagger | capital/reactor/cc/migrations/0004_auto_20180313_1052.py | Python | mit | 386 | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""extends the standard Python gettext classes
allows multiple simultaneous domains... (makes multiple sessions with different languages easier too)"""
# Copyright 2002, 2003 St James Software
#
# This file is part of jToolkit.
#
# jToolkit is free software; you can redi... | cc-archive/jtoolkit | jToolkit/localize.py | Python | gpl-2.0 | 6,307 | 0.015538 |
import sys
import cv2
import helper as hp
class MSP():
name = "MSP"
def __init__(self):
self.__patterns_num = []
self.__patterns_sym = []
self.__labels_num = []
self.__labels_sym = []
msp_num, msp_sym = "msp/num", "msp/sym"
self.__load_num_patterns(msp_num)
... | capital-boss/plate-recognition | msp.py | Python | apache-2.0 | 1,393 | 0.002872 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.