code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
# ------------------------------------------------------------
# pelisalacarta 4
# Copyright 2015 tvalacarta@gmail.com
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#
# Distributed under the terms of GNU General Public License v3 (GPLv3)
# http://www.gnu.org/licenses/gpl-3.0.html
# -... | ChopChopKodi/pelisalacarta | python/main-classic/core/servertools.py | Python | gpl-3.0 | 15,219 |
# -*- coding: UTF-8 -*-
import os
import json
import logging
import time
import copy
import tornado
from sqlalchemy.orm import query,aliased
from sqlalchemy import and_,or_,desc,asc
from sqlalchemy import func
from sqlalchemy.orm.exc import NoResultFound
import async
import static_config
import database
import config... | uhp/uhp | uhpweb/controller/admin.py | Python | gpl-2.0 | 39,163 |
# -*- coding: utf-8 -*-
#
# Aleph documentation build configuration file, created by
# sphinx-quickstart on Fri Dec 2 16:22:48 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... | gazeti/aleph | docs/conf.py | Python | mit | 10,610 |
# -*- coding: utf-8 -*-
"""This module contains a function for simplifying tasks in
finite-domain representation (SASTask). Usage:
simplify.filter_unreachable_propositions(sas_task)
simplifies `sas_task` in-place. If simplification detects that the
task is unsolvable, the function raises `simplify.Impossible`. I... | miquelramirez/LAPKT-public | external/fd/simplify.py | Python | gpl-3.0 | 20,227 |
# 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 req... | gaolichuang/py-essential | essential/fileutils.py | Python | apache-2.0 | 3,825 |
import warnings
import itertools
from contextlib import contextmanager
from distutils.version import LooseVersion
import numpy as np
import matplotlib as mpl
from matplotlib import transforms
from .. import utils
from .. import _py3k_compat as py3k
class Renderer(object):
@staticmethod
def ax_zoomable(ax):
... | plotly/python-api | packages/python/plotly/plotly/matplotlylib/mplexporter/renderers/base.py | Python | mit | 14,613 |
# -*- coding: utf-8 -*-
{
'name': "cnpe_meeting",
'summary': """
CNPE meeting schdule and meeting room booking tools.
For tsc only""",
'description': """
CNPE meeting schdule and meeting room booking tools.
- create meeting room.
- meeting room booking.
- me... | MackZxh/cnpe_meeting | __openerp__.py | Python | agpl-3.0 | 1,077 |
def add_newline_segment(powerline):
powerline.append("\n", Color.RESET, Color.RESET, separator='')
| tswsl1989/powerline-shell | segments/newline.py | Python | mit | 103 |
import facebook
import math
import requests
from pprint import pprint
from MyData import *
VeryBigNum = math.pow(10,10)
graph = facebook.GraphAPI(access_token=access_token,version='2.6')
#pprint(graph.get_connections(id='me',connection_name='feed'))
# For all photos uploaded by user
#pprint(graph.get_connections(id... | viveksb007/PythonScripts | FacebookGraphAPI.py | Python | gpl-3.0 | 2,196 |
#####################################################################################
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# Unless a separate license agreement exists between you and Crossbar.io GmbH (e.g.
# you have purchased a commercial license), the license terms below apply.
#
# Should you enter ... | NinjaMSP/crossbar | crossbar/router/auth/anonymous.py | Python | agpl-3.0 | 3,914 |
# Make directory a Python package.
| Donkyhotay/MoonPy | zope/app/testing/__init__.py | Python | gpl-3.0 | 35 |
from distutils.core import setup
setup(name='pyslight',
packages=['pyslight'],
author='Daniel Ruschel Dutra',
license='GPLv3',
description='Set of functions to work with Starlight')
| danielrd6/pyslight | setup.py | Python | gpl-3.0 | 207 |
#!/usr/bin/env python
import glob
import numpy as np
import mygis
from bunch import Bunch
# icar[:,4:,1:])*10-wrf[:,:-6,:-4]
def load_wrf(filename, preciponly=False):
"""docstring for load_wrf"""
precip=mygis.read_nc(filename,"RAINNC").data
try:
precip+=mygis.read_nc(filename,"I_RAINNC").data*100... | NCAR/icar | helpers/wrf/load_comparison.py | Python | mit | 3,192 |
from django.shortcuts import render
from django.http import HttpResponse
from .models import UserFile, Errors
import md5
# Create your views here.
def index(request):
return render(request, 'xmlchecker/index.html')
def check(request):
obj = UserFile.objects.create(xml_text=str(request.POST.items()[2][1].encode('utf-... | Szboy/OCN-XMLChecker | xmlchecker/views.py | Python | gpl-2.0 | 488 |
#Some functions to help analysing DUT-8
import numpy as np
import sys
from ase import Atoms, neighborlist
import os
import pickle
def buildNL(mol, path='./', radii=None, save=True):
#create nl
if radii is None:
radii = {}
radii[ 'H'] = 0.30
radii[ 'C'] = 0.77
radii[ 'N'] = 0.70
... | patrickmelix/Python4ChemistryTools | moffunctions.py | Python | mit | 5,110 |
from lettuce import world
from salad.logger import logger
from splinter.exceptions import ElementDoesNotExist
ELEMENT_FINDERS = {
'named "(.*)"': "find_by_name",
'with(?: the)? id "(.*)"': "find_by_id",
'with(?: the)? css selector "(.*)"': "find_by_css",
'with(?: the)? xpath selector': "find_by_xpath",... | adw0rd/salad-py3 | salad/steps/browser/finders.py | Python | bsd-3-clause | 2,258 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import os.path
__dir__ = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.dirname(__dir__))
import omnicxx
from omnicxx import GetTagsMgr
from omnicxx import CodeComplete
def _ToList(compl_items):
li = []
for item in compl... | fanhed/omnicxx | test/main.py | Python | gpl-2.0 | 2,547 |
# Copyright (C) 2010, 2011 Apple 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 of conditions and... | annulen/qtwebkit-snapshots | Source/WebKit2/Scripts/webkit/parser.py | Python | lgpl-2.1 | 5,618 |
class Coupon:
def __init__(self, coupon_name, date, number_of_coupons):
self.coupon_name = coupon_name
self.date = date
self.number_of_coupons = number_of_coupons | IlyaSiz/python_training | model/coupon.py | Python | gpl-3.0 | 191 |
"""Change custom form terms to text.
Revision ID: 68423db114cd
Revises: 7135c4a2339e
Create Date: 2018-09-19 21:29:08.800064
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, relationship
# revision identifiers, used by... | viaict/viaduct | migrations/versions/2018_09_19_68423db114cd_change_custom_form_terms_to_text.py | Python | mit | 961 |
from __future__ import print_function
# Time: O(n)
# Space: O(1)
#
# Given a linked list, swap every two adjacent nodes and return its head.
#
# For example,
# Given 1->2->3->4, you should return the list as 2->1->4->3.
#
# Your algorithm should use only constant space.
# You may not modify the values in the list, onl... | kamyu104/LeetCode | Python/swap-nodes-in-pairs.py | Python | mit | 1,255 |
#!/usr/bin/env python
# Entry file for search article with user's key word.
import sys
import json
import cgi
from article_engin import get_articles
from connect_database import getDatabase
fs = cgi.FieldStorage()
sys.stdout.write("Content-Type: application/json")
sys.stdout.write("\n")
sys.stdout.write("\n")
result = ... | leaot/Huffpost-Articles-in-Twitter-Trends | Python/user_articles_entry.py | Python | mit | 946 |
# -*- coding: utf-8 -*-
#!/usr/bin/env python
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import sight_reading
version = sight_reading.__version__
setup(
name='Sight Reading',
version=version,
author='',
author_email='vincentny... | v-for-vincent/sight-reading | setup.py | Python | bsd-3-clause | 529 |
import tables
import numpy as np
from utils.coords import local2eq
print("IC86")
deg5 = np.radians(5.)
pull = lambda X: (79. - 86.7 * X + 38.45 * X**2 - 8.673 * X**3
+ 1.056 * X**4 - 0.0658 * X**5 + 0.00165 * X**6)
hdf = tables.openFile("./PrunedDataUpgoing.hd5")
f = hdf.root
data = f.SplineMPEPa... | thejevans/pointSourceAnalysis | oldConvertH5.py | Python | gpl-3.0 | 2,280 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import json
import os
import re
import unittest
from django.contrib.admin import AdminSite, ModelAdmin
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
from django.contrib.admin.models import ADDITION, DELETION, LogEntry
from... | sgzsh269/django | tests/admin_views/tests.py | Python | bsd-3-clause | 281,730 |
from __future__ import print_function, division, absolute_import
from .fbresnet import fbresnet152
from .cafferesnet import cafferesnet101
from .bninception import bninception
from .resnext import resnext101_32x4d
from .resnext import resnext101_64x4d
from .inceptionv4 import inceptionv4
from .inceptionresnetv2 im... | Cadene/pretrained-models.pytorch | pretrainedmodels/models/__init__.py | Python | bsd-3-clause | 1,735 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
__author__ = 'Daniel Greenfeld'
__email__ = 'danny@eventbrite.com'
__version__ = '3.2.1'
from .client import Eventbrite # noqa
from .utils import EVENTBRITE_API_URL # noqa
| apranav19/eventbrite-sdk-python | eventbrite/__init__.py | Python | apache-2.0 | 241 |
#
# (c) 2018 Extreme Networks Inc.
#
# This file is part of Ansible
#
# Ansible 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.
#
# Ans... | hryamzik/ansible | test/units/modules/network/exos/test_exos_command.py | Python | gpl-3.0 | 4,593 |
# -*- coding: utf-8 -*-
# Copyright 2019 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import (
djbc_kite_lap_pemasukan_hasil_produksi,
djbc_kite_lap_pemasukan_hasil_produksi_subkon,
djbc_kite_lap_pemasukan_hasil_produksi_union,
)
| open-synergy/opnsynid-l10n-indonesia | l10n_id_djbc_kite_lap_pemasukan_hasil_produksi/reports/__init__.py | Python | agpl-3.0 | 291 |
# -*- coding: utf-8 -*-
import datetime
from django.conf import settings
DATAPURGE_GRACEFULLY = getattr(settings, "DATAPURGE_GRACEFULLY", False)
DATAPURGE_GRACE_STEP = getattr(settings, "DATAPURGE_GRACE_STEP", 100)
DATAPURGE_GRACE_WAIT = getattr(settings, "DATAPURGE_GRACE_WAIT", datetime.timedelta(seconds=0.3))
DATAP... | swistakm/django-datapurge | datapurge/settings.py | Python | bsd-3-clause | 375 |
# Load libraries
import sys
# Load modules
from modules.can_access import can_access
from modules.check_post_action import check_post_action
from modules.has_password_field import has_password_field
from modules.html_has_same_domain import html_has_same_domain
from modules.is_masquerading import is_masquerading
from m... | mjkim610/phishing-detection | phishing_detection/process_data.py | Python | bsd-2-clause | 4,040 |
#!/usr/bin/env python
import sys
from gsp import GSP
from nautilusbb import Nautilusbb
from util import argmax_index
class Highend(Nautilusbb):
"""Balanced bidding agent"""
TOTALROUNDS = 48
RANGE= 6
def __init__(self, id, value, budget):
super(Highend, self).__init__(id,value, budget)
... | kandluis/balancedBidding | pset5_code/highend.py | Python | apache-2.0 | 854 |
# Define a procedure, sum3, that takes three
# inputs, and returns the sum of the three
# input numbers.
def sum3(aa, bb, cc):
return aa + bb + cc
#print sum3(1,2,3)
#>>> 6
#print sum3(93,53,70)
#>>> 216
| ezralalonde/cloaked-octo-sansa | 02/qu/02.py | Python | bsd-2-clause | 211 |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
from setuptools import setup
setup(
name = "mdx_alerts",
version = "0.1.0",
py_modules = ["mdx_alerts"],
install_requires = ['Markdown>=2.2.0'],
author = "Saevon",
author_email = "dot.saevon@gmail.com",
description = "Markdown alerts extension",
... | Saevon/mdx_alerts | setup.py | Python | mit | 877 |
from django.shortcuts import render
from django.views import generic
from django.http import HttpResponse, HttpResponseRedirect
# from django.views.decorators.csrf import csrf_exempt
import time
import json
import codecs
class IndexViews(generic.View):
templates_file = 'turanga.html'
def get(self, request)... | CooloiStudio/Report_deskxd_com | turanga/views.py | Python | mit | 1,263 |
#!env python
import os
import sys
sys.path.append(
os.path.join(
os.environ.get( "SPLUNK_HOME", "/opt/splunk/6.1.3" ),
"etc/apps/framework/contrib/splunk-sdk-python/1.3.0",
)
)
from collections import Counter, OrderedDict
from math import log
from nltk import tokenize
import execnet
import json
from splunkl... | nlproc/splunkml | bin/mcpredict.py | Python | apache-2.0 | 2,357 |
# -*- coding: utf-8 -*-
import logging
try:
from cStringIO import StringIO # NOQA
except ImportError:
from io import StringIO # NOQA
try:
import importlib # NOQA
except ImportError:
from django.utils import importlib # NOQA
from django.core.management import call_command
from django.test import T... | WillisXChen/django-oscar | oscar/lib/python2.7/site-packages/django_extensions/tests/management_command.py | Python | bsd-3-clause | 1,869 |
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
from git.test.lib import *
from git.exc import *
from git.objects.submodule.base import Submodule
from git.objects.submodule.root import RootModule, RootUpdateProgress
from git.util import to_... | GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/git/test/test_submodule.py | Python | agpl-3.0 | 20,323 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc. <http://www.redhat.com>
# This file is part of GlusterFS.
#
# This file is licensed to you under your choice of the GNU Lesser
# General Public License, version 3 or any later version (LGPLv3 or
# later), or the GNU General Public License, version 2 (GPL... | chawlanikhil24/glustercli-python | gluster/cli/heal.py | Python | gpl-2.0 | 2,950 |
# -*- coding: utf8 -*-
from django.db import models
class Person(models.Model):
""" an actual singular human being """
name = models.CharField(blank=True, max_length=100)
email = models.EmailField()
def __unicode__(self):
return self.name
class Group(models.Model):
""" a music group ... | jose-flores/django-ajax-selects | example/example/models.py | Python | gpl-3.0 | 2,142 |
# Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | lakshmi-kannan/st2 | st2common/st2common/models/db/auth.py | Python | apache-2.0 | 3,508 |
from sqlalchemy import create_engine
from sqlalchemy import Column, ForeignKey, ColumnDefault
from sqlalchemy import Integer, String, Date, Boolean, Unicode, Float
from sqlalchemy.ext.declarative import declarative_base
from amir.database import get_declarative_base
Base = get_declarative_base()
## \defgroup DataBase... | AhmadHamzeei/Amir-Accounting | amir/database/CustGroups.py | Python | gpl-3.0 | 856 |
import json
from functools import wraps
from django.http import HttpResponse
class SimpleAjaxResult(object):
"""
A generic structure for returning API results intended for
server-side rendered AJAX calls.
"""
SUCCESS = 0
FAILURE = 1
def __init__(self, **kwargs):
... | jsquire/Portfolio | src/scripts/python/ajax_rpc.py | Python | mit | 2,209 |
import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate()
mobil... | ProjectSWGCore/NGECore2 | scripts/mobiles/dathomir/female_kwi.py | Python | lgpl-3.0 | 1,352 |
# Copyright 2012-2013 John Sullivan
# Copyright 2012-2013 Other contributers as noted in the CONTRIBUTERS file
#
# This file is part of Galah.
#
# Galah 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, e... | tugluck/galah | galah/base/utility.py | Python | agpl-3.0 | 967 |
#!/usr/bin/python
import sys
import os
import pprint
import struct
# Change path so we find Xlib
sys.path.insert(1, os.path.join(sys.path[0], '..'))
def dummy_buffer(str, x, y = sys.maxint):
return str[x:y]
__builtins__.buffer = dummy_buffer
from Xlib.protocol import display, request, rq, event
from Xlib impo... | alexer/python-xlib | utils/parsexbug.py | Python | gpl-2.0 | 7,194 |
import sys
import unittest
from pyplink.tests import test_suite as pyplink_test_suite
result = unittest.TextTestRunner().run(pyplink_test_suite)
sys.exit(0 if result.wasSuccessful() else 1)
| lemieuxl/pyplink | conda_recipe/run_test.py | Python | mit | 195 |
import json
from sdcclient._common import _SdcCommon
def policy_action_stop():
return {
"type": "POLICY_ACTION_STOP",
}
def policy_action_capture(file_name, secs_before=5, secs_after=15, filter=""):
return {
"afterEventNs": secs_after * 1_000_000_000,
"beforeEventNs": secs_befor... | draios/python-sdc-client | sdcclient/secure/_policy_v2.py | Python | mit | 14,933 |
# extracted from Louie, http://pylouie.org/
#
# Copyright (c) 2006 Patrick K. O'Brien, Mike C. Fletcher,
# Matthew R. Scott
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions ... | jek/flatland | flatland/util/_saferef.py | Python | mit | 8,766 |
from __future__ import division
import base64
import gc
import json
import os
import random
import sys
import time
import signal
import traceback
import urlparse
if '--iocp' in sys.argv:
from twisted.internet import iocpreactor
iocpreactor.install()
from twisted.internet import defer, reactor, protocol, tcp
f... | FreicoinAlliance/p2pool | p2pool/main.py | Python | gpl-3.0 | 30,436 |
#encoding: utf-8
import curses
import curses.panel
import struct
import sys
import termios
import weakref
#For more complex method of getting the size of screen
try:
import fcntl
except ImportError:
# Win32 platforms do not have fcntl
pass
from .container import Container
class Workspace(Container):
... | SavinaRoja/gruepy | gruepy/workspace.py | Python | gpl-3.0 | 4,617 |
#
# Copyright 2016 University of Oxford
#
# 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 i... | jeromekelleher/htsget | htsget/protocol.py | Python | apache-2.0 | 5,386 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Inventory', '0008_itemvendormodel_movementhistorymodel'),
]
operations = [
migrations.AddField(
model_name='move... | alexharmenta/Inventationery | Inventationery/apps/Inventory/migrations/0009_movementhistorymodel_item.py | Python | bsd-3-clause | 509 |
#!/Python27/python
import cgi, cgitb
form = cgi.FieldStorage()
if form.getvalue('subject'):
subject = form.getvalue('subject')
else:
subject = "Not set"
print("Content-type:text/html\r\n\r\n")
print("<html>")
print("<head>")
print("<title>Radio for CGI Program</title>")
print("</head>")
print("<body>... | 5610110083/Safety-in-residential-project | cgi-bin/exam/Example14_5.py | Python | apache-2.0 | 411 |
# Pyomniar
# Copyright 2011 Chris Kelly
# See LICENSE for details.
import httplib
import urllib
import time
import re
from pyomniar.error import OmniarError
from pyomniar.utils import convert_to_utf8_str
re_path_template = re.compile('{\w+}')
def bind_api(**config):
class APIMethod(object):
path = con... | ckelly/pyomniar | pyomniar/binder.py | Python | mit | 5,295 |
from go.vumitools.tests.helpers import djangotest_imports
with djangotest_imports(globals()):
from go.apps.tests.view_helpers import AppViewsHelper
from go.base.tests.helpers import GoDjangoTestCase
class TestStaticReplyViews(GoDjangoTestCase):
def setUp(self):
self.app_helper = self.add_helper(A... | praekelt/vumi-go | go/apps/static_reply/tests/test_views.py | Python | bsd-3-clause | 2,084 |
#!/usr/bin/env python
# Copyright (c) 2018 Piero Dalle Pezze
#
# 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, mod... | pdp10/sbpipe | sbpipe/pl/create/__init__.py | Python | mit | 1,119 |
#!/usr/bin/env python
## if you wish to work with tensorflow v1 then ask it to emulate version 2 behavior
#import tensorflow.compat.v2 as tf
#tf.enable_v2_behavior()
#print(tf.__version__)
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import csv
import joblib
import tim... | ajrichards/bayesian-examples | deep-learning/cnn-fashion-mnist.py | Python | bsd-3-clause | 5,587 |
#!/usr/bin/env python
import pexpect
import unittest
import PexpectTestCase
import time
import os
class TestCtrlChars(PexpectTestCase.PexpectTestCase):
def test_control_chars (self):
"""FIXME: Python unicode was too hard to figure out, so
this tests only the true ASCII characters. This is lame
... | serialx/pexpect-u | pexpect/tests/test_ctrl_chars.py | Python | mit | 2,864 |
# This file is part of Gem.
#
# Gem 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.
#
# Gem is distributed in the hope that it wi... | kaye64/gem | content/player.py | Python | gpl-3.0 | 838 |
import numpy as np
from mdtraj.testing import eq
from sklearn.base import clone
from sklearn.metrics import adjusted_rand_score
from msmbuilder.cluster import LandmarkAgglomerative
random = np.random.RandomState(2)
def test_1():
x = [random.randn(10, 2), random.randn(10, 2)]
n_clusters = 2
model1 = Lan... | stephenliu1989/msmbuilder | msmbuilder/tests/test_agglomerative.py | Python | lgpl-2.1 | 1,925 |
import bge
import math
pos = 1
def main():
global pos
pos += 1
# print(dir(object))
#cont = bge.logic.getCurrentController()
#own = cont.owner
#move = cont.actuators["move"]
#cont.activate(move)
#move.dLoc=[0,0.001,0]
scene = bge.logic.getCurrentScene()
object ... | sstocker46/pyrobotlab | home/GroG/crazy.py | Python | apache-2.0 | 1,320 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('history', '0003_auto_20150914_1609'),
]
operations = [
migrations.AddField(
model_name='event',
name... | ctrl-alt-delete/portafolio | history/migrations/0004_auto_20150914_1618.py | Python | mit | 961 |
from .common import Benchmark
import numpy as np
UNARY_UFUNCS = [obj for obj in np.core.umath.__dict__.values() if
isinstance(obj, np.ufunc)]
UNARY_OBJECT_UFUNCS = [uf for uf in UNARY_UFUNCS if "O->O" in uf.types]
UNARY_OBJECT_UFUNCS.remove(getattr(np, 'invert'))
stride = [1, 2, 4]
stride_out = [1, 2, 4]
dty... | numpy/numpy | benchmarks/benchmarks/bench_ufunc_strides.py | Python | bsd-3-clause | 6,500 |
"""
Content negotiation deals with selecting an appropriate renderer given the
incoming request. Typically this will be based on the request's Accept header.
"""
from __future__ import unicode_literals
from django.http import Http404
from rest_framework import HTTP_HEADER_ENCODING, exceptions
from rest_framework.set... | OpenWinCon/OpenWinNet | web-gui/myvenv/lib/python3.4/site-packages/rest_framework/negotiation.py | Python | apache-2.0 | 4,084 |
from sys import argv
graphite_server="ec2-54-242-170-176.compute-1.amazonaws.com"
if len(argv) > 2:
graphite_server = argv[1]
import urllib2
def fetchone(query):
response = urllib2.urlopen("http://%s/render?format=raw&target=%s" % (graphite_server, query))
html = response.read().replace("None,", "").... | pbailis/hat-vldb2014-code | prototype-database-code/scripts/fetch_stats_from_graphite.py | Python | apache-2.0 | 2,804 |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.build_gra... | landism/pants | src/python/pants/backend/graph_info/tasks/minimal_cover.py | Python | apache-2.0 | 1,380 |
import mock
import pytest
from addons.wiki.models import WikiVersion
from django.core.exceptions import ValidationError
from django.utils import timezone
from framework.auth.core import Auth
from framework.exceptions import PermissionsError
from nose.tools import assert_raises
from osf.models import Node, Registration... | mfraezz/osf.io | osf_tests/test_registrations.py | Python | apache-2.0 | 37,104 |
from .base import *
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
DEBUG = False
# TODO: Separate SECRET_KEY for production! | emmceemoore/ospi-website | project/settings/production.py | Python | mit | 215 |
# Copyright (C) 2010-2019 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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 v... | psci2195/espresso-ffans | samples/visualization_cellsystem.py | Python | gpl-3.0 | 2,111 |
#!/usr/bin/python
import portage, os, sys
kw=portage.settings["ACCEPT_KEYWORDS"].split()
root=portage.settings["ROOT"]
outfile=os.path.join(root,"/etc/portage/make.profile/parent")
oldlink=os.path.join(root,"/etc/make.profile")
if not os.path.lexists(oldlink) and os.path.exists(outfile):
print("System appears upgraded... | apinsard/funtoo-overlay | sys-apps/portage/files/pygrade.py | Python | gpl-2.0 | 1,424 |
import unittest
import unittest.mock
import pyramid.testing
class AccountControllerTests(unittest.TestCase):
def test_register_validation_valid(self):
# 3 A's of test: Arrange, Act, then Assert
# Arrange
from nflpool.viewmodels.register_viewmodel import RegisterViewModel
data = {... | prcutler/nflpool | tests/services/test_account_service.py | Python | mit | 2,875 |
"""
WSGI config for techfest 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``... | sheeshmohsin/techfest_starter | techfest/techfest/wsgi.py | Python | mit | 1,425 |
import os
import toolz as tz
from collections import namedtuple
from bcbio import utils
from bcbio.pipeline import datadict as dd
from bcbio.pipeline import config_utils
from bcbio.log import logger
from bcbio.distributed.transaction import file_transaction
from bcbio.provenance import do
from bcbio import bam
from bc... | vladsaveliev/bcbio-nextgen | bcbio/chipseq/atac.py | Python | mit | 10,313 |
# 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, software
# distributed under the... | Ayrx/cryptography_polarssl | cryptography_polarssl/__about__.py | Python | apache-2.0 | 1,201 |
#!/usr/bin/python2
'''
This example explores the 'input' function in python2
which is different from the 'input' function in python3.
Notes:
- 'input' in python2 does an 'eval' on the input from
the console.
- this makes this function inherently unsafe.
- this also make it unpredictable (try to put a float,
or a doub... | nonZero/demos-python | src/examples/short/console/python2_input.py | Python | gpl-3.0 | 557 |
class deciderType:
"""DeciderType class"""
# class template for all future specific "deciders" to implement
def __init__(self): # class constructor
import log
self.myLog = log.Log('decider.log')
self.myLog.add('DeciderType initialized')
self.decid... | austinmroczek/pauser | deciderType.py | Python | mit | 7,295 |
'''
Check for primality for both decimal inputs and binary inputs
'''
lst = [2, 4, 6, 7, 9, 13, 17, 99, 127, 139]
print lst
prime = []
def is_composite(n) :
for i in range(2, n/2 + 1) :
if n % i == 0 :
return True
return False
for n in lst :
if is_composite(n) :
continue
e... | srinivasanmit/all-in-all | puzzles/isprime.py | Python | gpl-3.0 | 548 |
dictionary = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12,
'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23,
'y': 24, 'z': 25, ' ': 26, '?': 27, '.': 28}
CONST_SIZE = 29
def get_m... | hacktoberfest17/programming | encryption_algorithms/python/Hill_Cipher_Encryption_Decryption.py | Python | gpl-3.0 | 5,908 |
import re
from django import forms
from django.shortcuts import redirect
from django.core.urlresolvers import reverse
from django.forms import formsets, ValidationError
from django.views.generic import TemplateView
from django.utils.datastructures import SortedDict
from django.utils.decorators import classonlymethod
... | lamby/live-studio | contrib/django/contrib/formtools/wizard/views.py | Python | agpl-3.0 | 26,571 |
"""Imports for Python API.
This file is MACHINE GENERATED! Do not edit.
Generated by: tensorflow/tools/api/generator/create_python_api.py script.
"""
from tensorflow.python.keras._impl.keras.estimator import model_to_estimator | ryfeus/lambda-packs | Keras_tensorflow_nightly/source2.7/tensorflow/tools/api/generator/api/keras/estimator/__init__.py | Python | mit | 227 |
"""
MagPy
GFZ input filter
supports Kp values from the qlyymm.tab
Written by Roman Leonhardt October 2012
- contains test, read and write function for hour data
ToDo: Filter for minute data
"""
from __future__ import print_function
from magpy.stream import *
def isGFZKP(filename):
"""
Checks whether a file ... | geomagpy/magpy | magpy/lib/format_gfz.py | Python | bsd-3-clause | 4,709 |
# Import required modules
import os
# Import custom modules
import app
import input
import output
import ballot
import keys
import crypto
# Create a new ballot
def initaliseBallot():
# Get the name of the ballot
title = raw_input("Title of the ballot: ")
# Get the description of the ballot
descripti... | mrsamuelbarnes/Blockchain-Ballot | commands.py | Python | mit | 8,768 |
# Copyright (c) 2015 Ansible, Inc.
# All Rights Reserved.
# Python
import base64
import json
import yaml
import logging
import os
import re
import subprocess
import stat
import sys
import urllib
import urlparse
import threading
import contextlib
import tempfile
import six
import psutil
from functools import reduce, wr... | wwitzel3/awx | awx/main/utils/common.py | Python | apache-2.0 | 41,179 |
from django import template
from datetime import date, timedelta
register = template.Library()
@register.filter
def get_item(dictionary, key):
return dictionary.get(key) if key in dictionary else 0
| sasasaftic/owatam | analysis/templatetags/app_filters.py | Python | mit | 206 |
# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | daspecster/google-cloud-python | spanner/unit_tests/test_transaction.py | Python | apache-2.0 | 14,733 |
"""
Copyright 2020 Google LLC
Copyright 2020 PerfectVIPs 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 t... | lowRISC/ibex | vendor/google_riscv-dv/pygen/pygen_src/isa/riscv_b_instr.py | Python | apache-2.0 | 7,835 |
import pytest
from charitybot2.persistence.heartbeat_sqlite_repository import HeartbeatSQLiteRepository, NonExistentHeartbeatSource
heartbeat_repository = HeartbeatSQLiteRepository(debug=True)
heartbeat_repository.store_heartbeat(source='test_source', state='test_state', timestamp=1)
def teardown_module():
hear... | purrcat259/charitybot2 | tests/integration/test_heartbeat_sqlite_repository.py | Python | gpl-3.0 | 1,394 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Libbeato(AutotoolsPackage):
"""libbeato is a C library containing routines for various use... | rspavel/spack | var/spack/repos/builtin/packages/libbeato/package.py | Python | lgpl-2.1 | 605 |
# coding=utf-8
# Copyright (c) 2015 EMC 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
#
#... | emc-openstack/storops | storops/vnx/resource/snap.py | Python | apache-2.0 | 4,028 |
import base64
import hashlib
import re
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.models import User
from django.db.models import Q
from mozilla_django_oidc.auth import OIDCAuthenticationBackend
from mozillians.users.models import ExternalAccount
def calculate_use... | fxa90id/mozillians | mozillians/common/authbackend.py | Python | bsd-3-clause | 2,405 |
import tabulate
import technic.solder.cli.command
class ModpackCommand(technic.solder.cli.command.Command):
name = 'modpack'
command_help = 'Get information about modpacks'
def setup(self, parser):
subparsers = parser.add_subparsers()
self.add_subcommand(subparsers, ListModpacksCommand())
self.add_... | durandj/technic-solder-client | technic/solder/cli/commands/modpacks.py | Python | mit | 1,585 |
# -*- coding: utf-8 -*-
import ast
import base64
import csv
import glob
import itertools
import logging
import operator
import datetime
import hashlib
import os
import re
import simplejson
import time
import urllib
import urllib2
import urlparse
import xmlrpclib
import zlib
from xml.etree import ElementTree
from cStri... | aricchen/openHR | openerp/addons/web/controllers/main.py | Python | agpl-3.0 | 68,469 |
# 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 u... | zhreshold/mxnet | tests/python/unittest/test_engine_import.py | Python | apache-2.0 | 1,215 |
"""
LLDB Formatters for LLVM data types.
Load into LLDB with 'command script import /path/to/lldbDataFormatters.py'
"""
def __lldb_init_module(debugger, internal_dict):
debugger.HandleCommand('type category define -e llvm -l c++')
debugger.HandleCommand('type synthetic add -w llvm '
... | chubbymaggie/asap | utils/lldbDataFormatters.py | Python | bsd-2-clause | 2,056 |
import os
import sys
import numpy as np
import nibabel as nb
import matplotlib.pyplot as plt
from glob import glob as gg
from os.path import join as opj
from os.path import basename as opb
from nilearn.image import smooth_img
from nilearn.plotting import plot_roi
from nilearn.plotting.find_cuts import find_cut_slices
f... | WhitakerLab/BrainsForPublication | scripts/plot_glassbrain_slices.py | Python | mit | 7,791 |
from distutils.version import StrictVersion
import datetime
import hashlib
import os
import random
import re
import socket
import shutil
import time
import sys
import seesaw
from seesaw.config import realize, NumberConfigValue
from seesaw.externalprocess import WgetDownload, ExternalProcess
from seesaw.item import Ite... | ArchiveTeam/madden-giferator-grab | pipeline.py | Python | unlicense | 10,105 |
# 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/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/_monitor_management_client.py | Python | mit | 4,036 |
import os
try:
import thread
except ImportError:
import threading
import subprocess
import functools
import sublime
import time
class AsyncProcess(object):
def __init__(self, cmd, listener):
self.cmd = cmd
self.listener = listener
#print("DEBUG_EXEC: " + str(self.cmd))
self... | fbzhong/sublime-jslint | asyncprocess.py | Python | bsd-3-clause | 2,165 |
#!/usr/bin/env python
#
# Copyright 2014 Quantopian, 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 ... | DVegaCapital/zipline | zipline/examples/dual_ema_talib.py | Python | apache-2.0 | 3,247 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.