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
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.23
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | kubernetes-client/python | kubernetes/client/models/v1_rule_with_operations.py | Python | apache-2.0 | 9,436 | 0 |
# Copyright (c) 2010 by Dan Jacob.
#
# Some 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, this list of conditions and t... | whtsky/parguments | parguments/cli.py | Python | mit | 3,906 | 0 |
#############################################################################
#
# Copyright (C) 2013 Navi-X
#
# This file is part of Navi-X.
#
# Navi-X 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 Fou... | JamesLinEngineer/RKMC | addons/script.navi-x/src/CLogin.py | Python | gpl-2.0 | 3,203 | 0.01561 |
"""
Learning Tools Interoperability (LTI) module.
Resources
---------
Theoretical background and detailed specifications of LTI can be found on:
http://www.imsglobal.org/LTI/v1p1p1/ltiIMGv1p1p1.html
This module is based on the version 1.1.1 of the LTI specifications by the
IMS Global authority. For authenticat... | mtlchun/edx | common/lib/xmodule/xmodule/lti_module.py | Python | agpl-3.0 | 37,531 | 0.002771 |
# -*- coding: utf-8 -*-
"""Utilities for performing merges."""
from . import api
def prepare(data):
"""Restructure/prepare data about merges for output."""
sha = data.get("sha")
commit = data.get("commit")
message = commit.get("message")
tree = commit.get("tree")
tree_sha = tree.get("sha")
... | jtpaasch/simplygithub | simplygithub/internals/merges.py | Python | mit | 1,433 | 0 |
#!/usr/bin/env python
## \file geometry.py
# \brief python package for running geometry analyses
# \author T. Lukaczyk, F. Palacios
# \version 5.0.0 "Raven"
#
# SU2 Original Developers: Dr. Francisco D. Palacios.
# Dr. Thomas D. Economon.
#
# SU2 Developers: Prof. Juan J. Alonso's group at ... | pawhewitt/Dev | SU2_PY/SU2/run/geometry.py | Python | lgpl-2.1 | 3,794 | 0.011861 |
def run_all():
import nose2
nose2.discover(module='pygraphml')
__all__ = [run_all]
| hadim/pygraphml | pygraphml/tests/__init__.py | Python | bsd-3-clause | 93 | 0 |
import re, sys, time, splunk.Intersplunk
import urllib, zlib, base64
import logging, logging.handlers
try:
import xml.etree.cElementTree as xml
except ImportError:
import xml.etree.ElementTree as xml
def setup_logger(LOGGER_NAME,LOGFILE_NAME):
logger = logging.getLogger(LOGGER_NAME)
file_handler ... | bcarroll/splunk_samltools | bin/splunksaml.py | Python | apache-2.0 | 6,313 | 0.011722 |
#!/usr/bin/python3
#
# Copyright (C) 2012 Google 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 notice,
# this list o... | ganeti/ganeti | test/py/ganeti.rapi.testutils_unittest.py | Python | bsd-2-clause | 7,060 | 0.005949 |
a, b = list(map(int, input().split()))
array = []
for i in range(a):
array.append([])
for j in range(b):
if (i+j) % 2:
array[i].append('*')
else:
array[i].append('.')
#for i in range(n):
# for j in range(n):
# if i == j or i == n//2 or j == n//2 or i == n-j-1:
... | lesina/labs2016 | contests_1sem/6-7/E.py | Python | gpl-3.0 | 443 | 0.006772 |
from __future__ import print_function, unicode_literals
from datetime import timedelta
import logging
import os
from django.conf import settings
from django.contrib.auth.models import AnonymousUser, User
from django.core.exceptions import ValidationError
from django.core.files.uploadedfile import SimpleUploadedFile
f... | 1tush/reviewboard | reviewboard/reviews/tests.py | Python | mit | 108,697 | 0.000037 |
import avango
import avango.script
import avango.gua.skelanim
from examples_common.GuaVE import GuaVE
import examples_common.navigator
from avango.gua.skelanim.CharacterControl import CharacterControl
from avango.gua.skelanim.AnimationControl import AnimationConfig
### CAMERA CONTROL VIA XBOX CONTROLLER:
def camera_c... | yaroslav-tarasov/avango | avango-skelanim/examples/skeletal_character_control/main_animation_config.py | Python | lgpl-3.0 | 13,239 | 0.001586 |
__author__ = 'oier'
import json
from flask import Flask, make_response
app = Flask(__name__)
import seaborn as sns
import numpy as np
import pandas as pd
import os
from datetime import datetime
import matplotlib.pyplot as plt
import sys
from matplotlib.figure import Figure
from matplotlib.backends.backend_agg impo... | oiertwo/vampyr | flask/index.py | Python | mit | 1,592 | 0.014447 |
"""
Sql support for multilingual models
"""
| ziima/django-multilingual-ds9 | multilingual/models/sql/__init__.py | Python | mit | 44 | 0 |
# Copyright 2018 OpenStack Foundation
#
# 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 ... | openstack/tacker | tacker/db/migration/alembic_migrations/versions/13ecc2dd6f7f_change_nullable_value_of_path_id.py | Python | apache-2.0 | 1,218 | 0.004926 |
import argparse
from collections import Counter
from itertools import chain
from numpy import save, array
from os import listdir
from os import path
import re
import sys
import dataproc as dp
parser = argparse.ArgumentParser()
parser.add_argument('-d', '--dir', type=str, help='Source directory to conll-data.')
parser... | Copper-Head/the-three-stooges | conll2hdf5.py | Python | mit | 3,576 | 0.004754 |
from .user_permission import *
from .application_permission import *
from .application_permission_relation import *
from .user_group_permission import *
| skyoo/jumpserver | apps/perms/api/application/__init__.py | Python | gpl-2.0 | 153 | 0 |
## Open a serial connection with Arduino.
import time
import serial
ser = serial.Serial("COM9", 9600) # Open serial port that Arduino is using
time.sleep(3) # Wait 3 seconds for Arduino to reset
print ser # Print serial config
print "Sending serial command to OPEN the... | kellogg76/ArduinoTelescopeDustCover | open.py | Python | mit | 507 | 0.003945 |
"""
Parser and evaluator for FormulaResponse and NumericalResponse
Uses pyparsing to parse. Main function as of now is evaluator().
"""
import math
import numbers
import operator
import numpy
import scipy.constants
from pyparsing import (
CaselessLiteral,
Combine,
Forward,
Group,
Literal,
Mat... | proversity-org/edx-platform | common/lib/calc/calc/calc.py | Python | agpl-3.0 | 13,906 | 0.000791 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
################################################################################
# Euler 25
# 1000-digit Fibonacci number
# Author: Eugene Kolo - 2014
# Contact: www.eugenekolo.com
# The Fibonacci sequence is defined by the recurrence relation:
# Fn = Fn−1 + Fn−2, where F1 = ... | eugenekolo/project-euler | euler025.py | Python | mit | 856 | 0.008216 |
# -*- coding: utf-8 -*-
"""
Contains any static and global variables for MythTV Python Bindings
"""
OWN_VERSION = (0,23,1,0)
SCHEMA_VERSION = 1254
MVSCHEMA_VERSION = 1032
NVSCHEMA_VERSION = 1004
PROTO_VERSION = 23056
PROGRAM_FIELDS = 47
BACKEND_SEP = '[]:[]'
| ekristen/mythboxee | mythtv/MythStatic.py | Python | mit | 261 | 0.011494 |
import re
import spotlight
from requests import ConnectionError, HTTPError
class EnglishQuestionParser():
"""
Poor-man's english question parser. Not even close to conclusive, but
appears to construct some decent w|a queries and responses.
__author__ = 'seanfitz'
"""
def __init__(... | JarbasAI/jarbas-core | mycroft/jarbas-skills/LILACS_core/question_parser.py | Python | gpl-3.0 | 5,535 | 0.003433 |
#
# $Id: PDG.py,v 1.5 2009-01-26 03:05:43 ssnyder Exp $
# File: PDG.py
# Created: sss, Mar 2005
# Purpose: Define PDG ID codes.
#
"""
This module contains names for the various PDG particle ID codes.
The names are the same as in EventKernel/PdtPdg.h.
This module also contains a dictionary pdgid_names mapping ID codes
... | mverzett/rootpy | rootpy/extern/hep/pdg.py | Python | gpl-3.0 | 31,391 | 0.00051 |
"""
This module contains classes for data and graph visualization.
For that purpose, there are classes for the creation of simple graph's images,
images with path (critical, shortest, strongest) depiction and giving to a user
the chance to customize images and the way nodes and edges are depicted.
Apart from this, th... | theosotr/netxanal | mvc/controller/visualization.py | Python | apache-2.0 | 21,545 | 0.001439 |
'''
Copyright (c) 2011-2014, Agora Games, LLC All rights reserved.
https://github.com/agoragames/haigha/blob/master/LICENSE.txt
'''
import struct
import sys
from collections import deque
from haigha.reader import Reader
class Frame(object):
'''
Base class for a frame.
'''
# Exceptions
class Fr... | TeamODrKnow/doctor-know | haigha/frames/frame.py | Python | mit | 4,107 | 0.000243 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import calendar
import logging
from flask import Flask, abort, jsonify, render_template, request
from flask.json import JSONEncoder
from flask_compress import Compress
from datetime import datetime
from s2sphere import LatLng
from pogom.utils import get_args
from datetime imp... | pretsell/PokemonGo-Map | pogom/app.py | Python | agpl-3.0 | 19,025 | 0.002628 |
from django.conf.urls import url
from cats.views.cat import (
CatList,
CatDetail
)
from cats.views.breed import (
BreedList,
BreedDetail
)
urlpatterns = [
# Cats URL's
url(r'^cats/$', CatList.as_view(), name='list'),
url(r'^cats/(?P<pk>\d+)/$', CatDetail.as_view(), name='detail'),
# Bre... | OscaRoa/api-cats | cats/urls.py | Python | mit | 475 | 0 |
#!/usr/bin/env python
# -*- python -*-
# ex: set syntax=python:
# 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/.
import sys,socket,os,time,re
port=None
host=None
if ... | adobe-flash/avmplus | build/buildbot/slaves/android/scripts/shell-client-android.py | Python | mpl-2.0 | 1,874 | 0.026147 |
import unittest
import pandas as pd
import nose.tools
from mia.features.blobs import detect_blobs
from mia.features.intensity import detect_intensity
from mia.utils import preprocess_image
from ..test_utils import get_file_path
class IntensityTests(unittest.TestCase):
@classmethod
def setupClass(cls):
... | samueljackson92/major-project | src/tests/regression_tests/intensity_regression_test.py | Python | mit | 780 | 0 |
a = {'b',] | idea4bsd/idea4bsd | python/testData/psi/NotClosedBraceSet.py | Python | apache-2.0 | 10 | 0.2 |
# Standard Library Imports
import configargparse
from datetime import datetime, timedelta
from glob import glob
import json
import logging
from math import radians, sin, cos, atan2, sqrt, degrees
import os
import sys
import re
# 3rd Party Imports
# Local Imports
from . import config
log = logging.getLogger('Utils')
... | xc0ut/PokeAlarm | PokeAlarm/Utils.py | Python | agpl-3.0 | 11,971 | 0.00259 |
from asyncio import AbstractEventLoop
import aiomysql.sa
import asyncpg
from asyncio_extras import async_contextmanager
from cetus.types import (ConnectionType,
MySQLConnectionType,
PostgresConnectionType)
from sqlalchemy.engine.url import URL
DEFAULT_MYSQL_PORT = 330... | lycantropos/cetus | cetus/data_access/connectors.py | Python | mit | 5,800 | 0 |
# Copyright 2014 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 ... | HybridF5/tempest_debug | tempest/api/orchestration/stacks/test_templates_negative.py | Python | apache-2.0 | 1,954 | 0 |
""" Test for too many branches. """
# pylint: disable=using-constant-test
def wrong(): # [too-many-branches]
""" Has too many branches. """
if 1:
pass
elif 1:
pass
elif 1:
pass
elif 1:
pass
elif 1:
pass
elif 1:
pass
try:
... | ruchee/vimrc | vimfiles/bundle/vim-python/submodules/pylint/tests/functional/t/too/too_many_branches.py | Python | mit | 1,099 | 0.00273 |
__author__ = 'noe'
from bhmm.hidden.impl_c.hidden import * | marscher/bhmm | bhmm/hidden/impl_c/__init__.py | Python | lgpl-3.0 | 59 | 0.016949 |
# -*- coding: utf-8 -*-
import access
import util
@auth.requires_login()
def index():
"""Produces a list of the feedback obtained for a given venue,
or for all venues."""
venue_id = request.args(0)
if venue_id == 'all':
q = (db.submission.user == get_user_email())
else:
q = ((db.su... | lucadealfaro/crowdranker | controllers/feedback.py | Python | bsd-3-clause | 10,966 | 0.005471 |
#!/usr/bin/env python3
import unittest
import fileLists
class TestFileLists(unittest.TestCase):
def testOneEntry(self):
l=fileLists.listTableFiles([
'2014.3765.1.1.department.diff.csv',
])
self.assertEqual(len(l),1)
t=l[0]
self.assertEqual(t.stageYear,2014)
self.assertEqual(t.documentNumber,3765)
s... | AntonKhorev/spb-budget-db | 3-db/testFileLists.py | Python | bsd-2-clause | 1,567 | 0.051053 |
"""
Classes to cache and read specific items from github issues in a uniform way
"""
from functools import partial as Partial
import datetime
import time
import shelve
# Requires PyGithub version >= 1.13 for access to raw_data attribute
import github
# Needed to not confuse cached 'None' objects
class Nothing(object... | autotest/virt-test | tools/github/github_issues.py | Python | gpl-2.0 | 29,542 | 0.000609 |
#!/usr/bin/env python
class AllPermutations(object):
def __init__(self, arr):
self.arr = arr
def all_permutations(self):
results = []
used = []
self._all_permutations(self.arr, used, results)
return results
def _all_permutations(self, to_use, used, results):
... | davjohnst/fundamentals | fundamentals/backtracking/all_permutations.py | Python | apache-2.0 | 772 | 0.001295 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
import behave
import os
import parse
from common import *
@behave.step("I use the repository \"{repo}\"")
def step_repo_condition(context, repo):
if "repos" not in context.dnf:
context.dnf["repos"] = []... | kkaarreell/ci-dnf-stack | dnf-behave-tests/features/steps/repo.py | Python | gpl-3.0 | 3,594 | 0.004174 |
import src
import random
class Shocker(src.items.Item):
"""
ingame item used as ressource to build bombs and stuff
should have the habit to explode at inconvienent times
"""
type = "Shocker"
def __init__(self):
"""
set up internal state
"""
super().__init__(di... | MarxMustermann/OfMiceAndMechs | src/itemFolder/military/shocker.py | Python | gpl-3.0 | 1,603 | 0.004991 |
#!/usr/bin/python
import sys
#what is the command
command = sys.argv[1];
source = sys.argv[2];
print "Command: ", command;
print "Source: ", source; | LucidWorks/fusion-seed-app | pipelines.py | Python | mit | 151 | 0.039735 |
from pythonforandroid.recipe import PythonRecipe
class SixRecipe(PythonRecipe):
version = '1.15.0'
url = 'https://pypi.python.org/packages/source/s/six/six-{version}.tar.gz'
depends = ['setuptools']
recipe = SixRecipe()
| PKRoma/python-for-android | pythonforandroid/recipes/six/__init__.py | Python | mit | 236 | 0 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('meals', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='wbw_list',
name='list_i... | joostrijneveld/eetvoudig | meals/migrations/0002_auto_20161006_1640.py | Python | cc0-1.0 | 576 | 0 |
import calendar
from optparse import make_option
import time
from urllib import urlencode
from django.core.management.base import BaseCommand
import jwt
import requests
class Command(BaseCommand):
help = 'Simulate a BlueVia postback to mark a payment as complete.'
option_list = BaseCommand.option_list + (
... | mozilla/zamboni | mkt/purchase/management/commands/post_bluevia_payment.py | Python | bsd-3-clause | 2,183 | 0 |
# THIS FILE IS GENERATED FROM NUMPY SETUP.PY
short_version = '1.7.2'
version = '1.7.2'
full_version = '1.7.2'
git_revision = 'f3ee0735c1c372dfb9e0efcaa6846bd05e53b836'
release = True
if not release:
version = full_version
| beiko-lab/gengis | bin/Lib/site-packages/numpy/version.py | Python | gpl-3.0 | 238 | 0 |
import unittest
from fam.tests.models.test01 import Dog, Cat, Person, JackRussell, Monarch
from fam.mapper import ClassMapper
class MapperTests(unittest.TestCase):
def setUp(self):
self.mapper = ClassMapper([Dog, Cat, Person, JackRussell, Monarch])
def tearDown(self):
pass
def test_... | paulharter/fam | src/fam/tests/test_couchdb/test_mapping.py | Python | mit | 535 | 0.011215 |
#!/usr/bin/env python3
# The MIT License
# Copyright (c) 2016 Estonian Information System Authority (RIA), Population Register Centre (VRK)
#
# 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 ... | ria-ee/X-Road | src/systemtest/op-monitoring/integration/testcases/test_zero_buffer_size.py | Python | mit | 5,787 | 0.003283 |
PLUGIN_INFO = {
"versions": [
{
"plugin_version": 1,
"supported_mod_versions": ["0.6"],
"download_url": "https://www.myteamspeak.com/addons/01a0f828-894c-45b7-a852-937b47ceb1ed"
}
]
}
| jhakonen/wot-teamspeak-mod | test/fute/test_helpers/constants.py | Python | lgpl-2.1 | 199 | 0.040201 |
"""
Main controller.
"""
import json
from Server.Importer import ImportFromModule
class ControllerMain(ImportFromModule("Server.ControllerBase", "ControllerBase")):
"""
Main controller.
"""
def ShowPage(self, uriParameters, postedParameters):
"""
Shows the home page.
"""
... | allembedded/python_web_framework | WebApplication/Controllers/ControllerMain.py | Python | gpl-3.0 | 630 | 0.007937 |
#!/usr/bin/python3
#
# Copyright © 2017 jared <jared@jared-devstation>
#
from pydub import AudioSegment, scipy_effects, effects
import os
import settings, util
# combine two audio samples with a crossfade
def combine_samples(acc, file2, CROSSFADE_DUR=100):
util.debug_print('combining ' + file2)
sample2 = Audi... | techlover10/StochasticSoundscape | src/audio.py | Python | mit | 1,411 | 0.007092 |
# Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | cloudbase/nova-virtualbox | nova/api/openstack/compute/plugins/v3/keypairs.py | Python | apache-2.0 | 7,665 | 0.000261 |
# -*- coding: utf-8 -*-
"""
a24tim.tests.test_models
************************
The model tests for the a24tim app.
:copyright: (c) 2012 by Carl Modén
:licence: AGPL3, see LICENSE for more details.
"""
from datetime import date
import math
import urllib2
from django.test import TestCase
import a24... | carlmod/Analys24h | a24tim/tests/test_models.py | Python | agpl-3.0 | 7,591 | 0.001188 |
from django.conf.urls import url
from core.views import add_feedback
urlpatterns = [
url('^add/core/feedback', name='add_feedback', view=add_feedback),
] | bonnieblueag/farm_log | core/urls.py | Python | gpl-3.0 | 158 | 0.006329 |
import weldnumpy as wn
import numpy as np
def assert_correct(np_a, z):
'''
common part of the check.
'''
shape = []
for s in z.shape:
shape.append(s)
shape = tuple(shape)
np_a = np.reshape(np_a, shape)
for i in range((z.shape[0])):
for j in range(z.shape[1]):
... | rahulpalamuttam/weld | examples/python/nditer/nditer_test.py | Python | bsd-3-clause | 3,542 | 0.006494 |
# -*- Mode: Python; coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
##
## Copyright (C) 2011 Async Open Source <http://www.async.com.br>
## All rights reserved
##
## 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 Sof... | andrebellafronte/stoq | stoq/gui/calendar.py | Python | gpl-2.0 | 17,713 | 0.000847 |
# -*- coding: utf-8 -*-
"""Models for database connection"""
import settings
| vprusso/us_patent_scraper | patent_spider/patent_spider/models.py | Python | gpl-2.0 | 80 | 0.0125 |
# -*- coding: utf-8 -*-
from sympy.matrices import Matrix
from tensor_analysis.arraypy import Arraypy, TensorArray, list2arraypy, list2tensor
from tensor_analysis.tensor_fields import df, grad, curl, diverg, lie_xy, dw, \
lie_w, inner_product, g_tensor, g_wedge
from sympy import symbols, cos, sin
def test_df_var... | AunShiLord/Tensor-analysis | tensor_analysis/tests/test_tensor_fields.py | Python | mit | 17,326 | 0.006065 |
"""
WSGI config for djarzeit project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION``... | peap/djarzeit | djarzeit/wsgi.py | Python | mit | 1,425 | 0.000702 |
from .SCPISignalGenerator import SCPISignalGenerator
from .helper import SignalGenerator, amplitudelimiter
class AgilentN5182A(SCPISignalGenerator, SignalGenerator):
"""Agilent N5182A 100e3, 6e9.
.. figure:: images/SignalGenerator/AgilentN5182A.jpg
"""
def __init__(self, inst):
super().__i... | DavidLutton/EngineeringProject | labtoolkit/SignalGenerator/AgilentN5182A.py | Python | mit | 417 | 0 |
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# 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... | nikhilpanicker/SecureVault | tools/modified/androguard/core/binaries/idapipe.py | Python | gpl-3.0 | 6,602 | 0.010906 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Person.education'
db.add_column('person_person', 'education',
self.gf(... | elin-moco/ffclub | ffclub/person/migrations/0005_auto__add_field_person_education__add_field_person_birthday.py | Python | bsd-3-clause | 5,302 | 0.007922 |
from django.conf.urls import patterns, url
from publicaciones import views
urlpatterns = patterns('',
url(r'^$', views.index, name='index'),
url(r'^(?P<articulo_id>\d+)/$', views.ver_articulo, name='ver_articulo'),
) | rickyrish/rickyblog | build/lib.linux-i686-2.7/publicaciones/urls.py | Python | gpl-2.0 | 226 | 0.00885 |
# Recall is a program for storing bookmarks of different things
# Copyright (C) 2012 Cal Paterson
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# ... | calpaterson/recall | src/recall/people.py | Python | agpl-3.0 | 3,665 | 0.00191 |
# -*- coding: utf-8 -*-
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('appliances', '0007_provider_num_simultaneous_configuring'),
]
operations = [
migrations.AddField(
model_name='appliance',
name='uuid',
... | apagac/cfme_tests | sprout/appliances/migrations/0008_appliance_uuid.py | Python | gpl-2.0 | 493 | 0.002028 |
#
# Copyright (c) 2015 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/scancode-toolkit/
# The ScanCode software is licensed under the Apache License version 2.0.
# Data generated with ScanCode require an acknowledgment.
# ScanCode is a trademark of nexB Inc.
#
# You may not use... | yasharmaster/scancode-toolkit | src/packagedcode/phpcomposer.py | Python | apache-2.0 | 11,144 | 0.001884 |
"""Single slice vgg with normalised scale.
"""
import functools
import lasagne as nn
import numpy as np
import theano
import theano.tensor as T
import data_loader
import deep_learning_layers
import layers
import preprocess
import postprocess
import objectives
import theano_printer
import updates
# Random params
rng ... | 317070/kaggle-heart | configurations/je_ss_smcrps_nrmsc_dropoutput.py | Python | mit | 8,198 | 0.009758 |
__author__ = 'ENG-5 USER'
from numpy import *
import numpy as np
| Geekly/framepy | pump.py | Python | gpl-2.0 | 68 | 0.014706 |
from ..workspace import Block
from twisted.internet import defer
from .variables import lexical_variable
import operator
class logic_null (Block):
def eval (self):
return defer.succeed(None)
class logic_boolean (Block):
def eval (self):
return defer.succeed(self.fields['BOOL'] == 'TRUE')
class logic_negate... | richardingham/octopus | octopus/blocktopus/blocks/logic.py | Python | mit | 2,889 | 0.039114 |
# This is an auto-generated file. Use admin/change-versions to update.
from twisted.python import versions
version = versions.Version(__name__[:__name__.rfind('.')], 0, 6, 0)
| kenorb-contrib/BitTorrent | twisted/web/_version.py | Python | gpl-3.0 | 175 | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'wangx'
import urllib2
from bs4 import BeautifulSoup
import getProvinceList
provinceList = getProvinceList.main()
global coun
coun=[]
def get(net):
result = []
try:
html = urllib2.urlopen(net,timeout=10).read()
except:
html=''
... | ramwin1/environment_spider | weather/getCountryList.py | Python | gpl-2.0 | 1,285 | 0.012451 |
#!/usr/bin/env python
#
# Copyright 2011 Google Inc. All Rights Reserved.
import unittest
from google.appengine.api import files
from google.appengine.ext import db
from mapreduce import control
from mapreduce import model
from mapreduce import output_writers
from mapreduce import test_support
from testlib impor... | bslatkin/8-bits | appengine-mapreduce/python/test/mapreduce/output_writers_end_to_end_test.py | Python | apache-2.0 | 7,023 | 0.004129 |
from synergine.synergy.event.Action import Action
class A(Action):
_depend = []
class B(Action):
_depend = [A]
class C(Action):
_depend = [B]
class D(Action):
_depend = []
class F(Action):
_depend = [C]
class E(Action):
_depend = [B, F]
class G(Action):
_depend = []
class H(Action):
... | buxx/synergine | tests/src/event/test_actions.py | Python | apache-2.0 | 337 | 0.026706 |
import fifo
import random
import time
def insertion_sort(elemToTry):
tab = []
for a in elemToTry:
tab.append(a);
place(tab , len(tab)-1)
return tab
def invertPlace(tableau,indiceOne,indiceTwo):
tableau[indiceTwo], tableau[indiceOne] = tableau[indiceOne],tableau[indiceTw... | tiregram/algo-E3FI | tp4/exo1.py | Python | gpl-3.0 | 1,042 | 0.028791 |
def clean_dict_repr(mw):
"""Produce a repr()-like output of dict mw with ordered keys"""
return '{' + \
', '.join('{k!r}: {v!r}'.format(k=k, v=v) for k, v in
sorted(mw.items())) +\
'}'
| npilon/planterbox | planterbox/util.py | Python | mit | 236 | 0 |
# (C) British Crown Copyright 2013, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any later ve... | kwilliams-mo/iris | lib/iris/fileformats/grib/grib_phenom_translation.py | Python | gpl-3.0 | 12,009 | 0.000167 |
# Ill attempt to research and see the practicality of making a pid tuner
# possibly hard coding and using error
# or maybe using tensor flow
# but just an idea at the moment
| purduerov/XX-Core | rov/movement/controls/PID_Tuner.py | Python | mit | 174 | 0 |
import genologics_sql.utils
from genologics_sql.tables import *
def test_connection():
session=genologics_sql.utils.get_session()
assert(session is not None)
def test_project_query():
session=genologics_sql.utils.get_session()
pj=session.query(Project).limit(1)
assert(pj is not None)
| Galithil/genologics_sql | tests/test_default.py | Python | mit | 308 | 0.019481 |
'''Trains a simple convnet on the MNIST dataset.
Gets to 99.25% test accuracy after 12 epochs
(there is still a lot of margin for parameter tuning).
16 seconds per epoch on a GRID K520 GPU.
'''
from __future__ import print_function
import keras
from keras.datasets import mnist
from keras.models import Sequential
from... | yoshiweb/keras-mnist | keras-mnist/mnist_cnn/mnist_cnn_train.py | Python | mit | 2,369 | 0 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Copyright (c) 2017-2020 Rhilip <rhilipruan@gmail.com>
import time
from flask import Blueprint, request, jsonify, redirect
from app import cache
from .gen import Gen
getinfo_blueprint = Blueprint('infogen', __name__, url_prefix="/movieinfo")
docs_url = "https://github.co... | Rhilip/PT-help-server | modules/infogen/__init__.py | Python | mit | 1,231 | 0.000812 |
#!/usr/bin/python
#
# Copyright (c) 2018 Yuwei Zhou, <yuwzho@microsoft.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | alxgu/ansible | lib/ansible/modules/cloud/azure/azure_rm_servicebusqueue.py | Python | gpl-3.0 | 12,400 | 0.002581 |
"""All constants related to the ZHA component."""
import enum
import logging
from typing import List
import bellows.zigbee.application
from zigpy.config import CONF_DEVICE_PATH # noqa: F401 # pylint: disable=unused-import
import zigpy_cc.zigbee.application
import zigpy_deconz.zigbee.application
import zigpy_xbee.zigb... | partofthething/home-assistant | homeassistant/components/zha/core/const.py | Python | apache-2.0 | 10,279 | 0.000292 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Composition) on 2019-05-07.
# 2019, SMART Health IT.
from . import domainresource
class Composition(domainresource.DomainResource):
""" A set of resources composed into a single coher... | all-of-us/raw-data-repository | rdr_service/lib_fhir/fhirclient_4_0_0/models/composition.py | Python | bsd-3-clause | 13,565 | 0.007667 |
#
# Copyright 2012 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in th... | edwardbadboy/vdsm-ubuntu | tests/fileUtilTests.py | Python | gpl-2.0 | 8,296 | 0 |
from dbt.contracts.graph.parsed import (
HasTestMetadata,
ParsedNode,
ParsedAnalysisNode,
ParsedDataTestNode,
ParsedHookNode,
ParsedModelNode,
ParsedResource,
ParsedRPCNode,
ParsedSchemaTestNode,
ParsedSeedNode,
ParsedSnapshotNode,
ParsedSourceDefinition,
SeedConfig,
... | fishtown-analytics/dbt | core/dbt/contracts/graph/compiled.py | Python | apache-2.0 | 7,700 | 0 |
#!/usr/bin/python
import socket
import os
import time
import shutil
import sys
import re
import datetime
import argparse
# NCMD Libs
import ncmd_print as np
from ncmd_print import MessageLevel as MessageLevel
import ncmd_commands as ncmds
import ncmd_fileops as nfops
MAX_TRANSFER_BYTES=2048
QUIT_CMD = "quit now"
HOS... | nathankrueger/ncmd | ncmd_server.py | Python | gpl-2.0 | 4,429 | 0.031836 |
import knuckle
class GameState(knuckle.State):
def on_keyup(self, e):
pass
def on_keydown(self, e):
if e == 'Escape':
self.window.pop_state()
def on_draw(self):
self.window.clear()
self.batch.draw()
self.window.flip()
def __str__(self):
re... | chris-statzer/knuckle-python | game/game_state.py | Python | mit | 339 | 0 |
# Copyright (c) 2016, the GPyOpt Authors
# Licensed under the BSD 3-clause license (see LICENSE.txt)
from ...models import GPModel
import numpy as np
class CostModel(object):
"""
Class to handle the cost of evaluating the function.
param cost_withGradients: function that returns the cost of evaluating ... | SheffieldML/GPyOpt | GPyOpt/core/task/cost.py | Python | bsd-3-clause | 2,686 | 0.00484 |
# coding=utf-8
#
# Copyright (c) 2011-2015 First Flamingo Enterprise B.V.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | firstflamingo/python_utilities | markup.py | Python | apache-2.0 | 13,400 | 0.007687 |
#!/usr/bin/env python
import os
import csv
import rospy
from std_msgs.msg import Bool
from dbw_mkz_msgs.msg import ThrottleCmd, SteeringCmd, BrakeCmd, SteeringReport
'''
You can use this file to test your DBW code against a bag recorded with a reference implementation.
The bag can be found at https://s3-us-west-1.a... | zegnus/self-driving-car-machine-learning | p13-final-project/ros/src/twist_controller/dbw_test.py | Python | mit | 3,850 | 0.002857 |
from django.test import TestCase
from django.conf import settings
from django.contrib.sites.models import Site
from django.db.models.query import QuerySet
from preferences import preferences
from music.models import TrackContributor, Credit, Track, Album, CreditOption
from music.utils import wikipedia, lastfm
class... | praekelt/jmbo-music | music/tests/__init__.py | Python | bsd-3-clause | 3,379 | 0 |
# -*-python-*-
# GemRB - Infinity Engine Emulator
# Copyright (C) 2003 The GemRB Project
#
# 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) ... | Tomsod/gemrb | gemrb/GUIScripts/pst/MessageWindow.py | Python | gpl-2.0 | 3,926 | 0.033367 |
import ckanext.deadoralive.config as config
import ckanext.deadoralive.tests.helpers as custom_helpers
class TestConfig(custom_helpers.FunctionalTestBaseClass):
def test_that_it_reads_settings_from_config_file(self):
"""Test that non-default config settings in the config file work."""
# These non... | ckan/ckanext-deadoralive | ckanext/deadoralive/tests/test_config.py | Python | agpl-3.0 | 572 | 0 |
# -*- coding: utf-8 -*-
import os
basedir=os.path.abspath(os.path.dirname(__file__))#get basedir of the project
WTF_CSRF_ENABLED = True
SECRET_KEY = 'you-will-guess'
#for database
# SQLALCHEMY_DATABASE_URI = 'mysql:///' + os.path.join(basedir, 'app.db')
SQLALCHEMY_DATABASE_URI = "mysql://username:password@server_ip:... | SpeedMe/leihuang.org | config.py | Python | apache-2.0 | 665 | 0.022556 |
from __future__ import print_function
import readline
import sys
import argparse
from . import crucible, config, config_ui, utils, patch
def main():
parser = argparse.ArgumentParser(description='Create Code Reviews')
parser.add_argument('--setup', action='store_true', help='setup banter configuration')
p... | markdrago/banter | banter/banter.py | Python | mit | 3,421 | 0.004969 |
# -*- coding: utf-8 -*-
"""
uds.data.check
~~~~~~~~~~~~~~
:copyright: Copyright (c) 2015, National Institute of Information and Communications Technology.All rights reserved.
:license: GPL2, see LICENSE for more details.
"""
import re
import datetime
import dateutil.parser
import pytz
import uds.logging
from uds.data... | nict-isp/uds-sdk | uds/data/check.py | Python | gpl-2.0 | 4,491 | 0.004035 |
# -*- coding: utf-8 -*-
"""
Created by chiesa on 18.01.16
Copyright 2015 Alpes Lasers SA, Neuchatel, Switzerland
"""
import json
import subprocess
from tempfile import NamedTemporaryFile
__author__ = 'chiesa'
__copyright__ = "Copyright 2015, Alpes Lasers SA"
def get_entry_points(venv_python_path, project_name):
... | chiesax/sandbox | sandbox/install_project/venv_inspect.py | Python | mit | 1,009 | 0.003964 |
'''
Some helpers
'''
import os
import pwd
import time
import requests
import subprocess
def get_uid(username):
return int(pwd.getpwnam(username).pw_uid)
def file_rights(filepath, mode=None, uid=None, gid=None):
'''
Change file rights
'''
file_handle = os.open(filepath, os.O_RDONLY)
... | cozy/python_cozy_management | cozy_management/helpers.py | Python | lgpl-3.0 | 2,238 | 0.000447 |
# Copyright 2010 WebDriver committers
# Copyright 2010 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 ap... | compstak/selenium | py/selenium/webdriver/remote/command.py | Python | apache-2.0 | 5,188 | 0.000771 |
from rdkit import Chem
from rdkit import rdBase
from rdkit.Chem import rdMolDescriptors as rdMD
from rdkit.Chem import AllChem
from rdkit.Chem.EState import EStateIndices
from rdkit.Chem.EState import AtomTypes
import time
print rdBase.rdkitVersion
print rdBase.boostVersion
def getEState(mol):
return EStat... | rdkit/rdkit | Code/GraphMol/Descriptors/test3D_old.py | Python | bsd-3-clause | 3,537 | 0.035341 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.