code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-07-03 18:14
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("ui", "0003_add_videofile"),
]
operations = [
... | mitodl/odl-video-service | ui/migrations/0004_add_videothumbnail.py | Python | bsd-3-clause | 1,453 |
from __future__ import print_function
import os
import numpy as np
import tempfile
import fitsio
from django.db import models
from django.db import transaction
import settings
from astrometry.util.util import *
import logging
log = logging.getLogger('enhance_models')
class EnhanceVersion(models.Model):
name ... | olebole/astrometry.net | net/enhance_models.py | Python | bsd-3-clause | 7,569 |
# -*- coding: utf-8 -*-
#
# Expyfun documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 11 10:45:48 2010.
#
# 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.
#
# A... | LABSN/expyfun | doc/conf.py | Python | bsd-3-clause | 10,519 |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright 2015-2018 by Exopy Authors, see AUTHORS for more details.
#
# Distributed under the terms of the BSD license.
#
# The full license is in the file LICENCE, distributed with this software.
# ---------------... | Ecpy/ecpy | exopy/instruments/user.py | Python | bsd-3-clause | 1,868 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# 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 configuration values have a default; values that are commented out
# serve to show the... | ihmeuw/vivarium | docs/source/conf.py | Python | bsd-3-clause | 7,710 |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "LinearTrend", cycle_length = 5, transform = "Quantization", sigma = 0.0, exog_count = 100, ar_order = 12); | antoinecarme/pyaf | tests/artificial/transf_Quantization/trend_LinearTrend/cycle_5/ar_12/test_artificial_1024_Quantization_LinearTrend_5_12_100.py | Python | bsd-3-clause | 272 |
#!/usr/bin/env python
from _xfconf import *
| cr33dog/pyxfce | xfconf/xfconf.py | Python | bsd-3-clause | 46 |
#!/usr/bin/env python
""" This is a draft modification of the RRT algorithm for the sepcial case
that sampling the goal region is computationally expensive """
import random
import numpy
import time
import math
import logging
import copy
from rtree import index
class SampleData:
def __init__(self, config, d... | kth-ros-pkg/hfts_grasp_planner | src/hfts_grasp_planner/rrt.py | Python | bsd-3-clause | 28,198 |
#! /usr/bin/python
# -*- coding: utf-8 -*-
# import funkcí z jiného adresáře
import sys
import os.path
from loguru import logger
path_to_script = os.path.dirname(os.path.abspath(__file__))
# sys.path.append(os.path.join(path_to_script, "../experiments/"))
# sys.path.append(os.path.join(path_to_script, "../extern/sed3... | mjirik/lisa | tests/texture_features_experiments_test.py | Python | bsd-3-clause | 3,114 |
"""
=====================================================
:mod:`onebot.plugins.execute` Run commands on connect
=====================================================
Run commands on connect
Config:
=======
.. code-block: ini
[bot]
includes=
onebot.plugins.execute
[onebot.plugins.execute]
comma... | thomwiggers/onebot | onebot/plugins/execute.py | Python | bsd-3-clause | 1,513 |
"""
Plankton dataset wrapper for semi-supervised networks.
"""
__authors__ = "Jesse Livezey"
import numpy as N
np = N
import cPickle, h5py, os
from theano.compat.six.moves import xrange
from pylearn2.datasets import semi_supervised, dense_design_matrix
from pylearn2.utils.rng import make_np_rng
from pylearn2.utils imp... | JesseLivezey/plankton | pylearn2/datasets/semi_plankton.py | Python | bsd-3-clause | 3,794 |
#------------------------------------------------------------------------------
# Copyright (c) 2013, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-------------------------------------------------... | ContinuumIO/ashiba | enaml/enaml/qt/q_resource_helpers.py | Python | bsd-3-clause | 4,734 |
from django.db.models.manager import Manager
from django.template import Context, Node, Variable
from django.template.loader import get_template
class BaseModelBlockNode (Node):
def __init__(self, thing, resolved=True):
"""
thing -- The thing (probably a model instance or a list of model
... | mjumbewu/django-model-filters | model_filters/templatetags/model_nodes.py | Python | bsd-3-clause | 4,549 |
# !usr/bin/env python2
# -*- coding: utf-8 -*-
#
# Licensed under a 3-clause BSD license.
#
# @Author: Brian Cherinka
# @Date: 2017-05-19 17:00:49
# @Last modified by: Brian Cherinka
# @Last Modified time: 2017-07-30 19:23:16
from __future__ import print_function, division, absolute_import
from tests.api.conftest ... | sdss/marvin | tests/api/test_modelcube.py | Python | bsd-3-clause | 2,893 |
# -*- coding: utf-8 -*-
import unittest
import os
from mongoengine import connect
from mongrey.storage.mongo import models
from mongrey.utils import get_db_config
from mongrey import cache
from ...base import BaseTestCase
def drop_all():
models.User.drop_collection()
models.GreylistMetric.drop_collection()... | radical-software/mongrey | mongrey/tests/storage/mongo/base.py | Python | bsd-3-clause | 1,182 |
import os
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
def _get_setting(name, default):
attr = f'VERIFIED_EMAIL_{name}'
return os.environ.get(attr, getattr(settings, attr, default))
CACHE_PREFIX = _get_setting('CACHE_PREFIX', 'verified_email_field_')
CODE_LENGTH ... | misli/django-verified-email-field | verified_email_field/settings.py | Python | bsd-3-clause | 902 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
import random
import sys
from couchdb import client
from couchdb import ServerError
class TempDatab... | laroque/couchdb-python3 | couchdb/tests/testutil.py | Python | bsd-3-clause | 1,378 |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
from dependency_manager import base_config
from dependency_manager import exceptions
DEFAULT_TYPE = 'default'
class DependencyManager(object):... | SummerLW/Perf-Insight-Report | dependency_manager/dependency_manager/manager.py | Python | bsd-3-clause | 7,128 |
from grey import *
from selem import *
from ccomp import label
| GaelVaroquaux/scikits.image | scikits/image/morphology/__init__.py | Python | bsd-3-clause | 63 |
"""
Tests API features applicable to the `shelflist` app.
"""
import pytest
import ujson
import jsonpatch
from datetime import datetime
from shelflist.exporters import ItemsToSolr
from shelflist.search_indexes import ShelflistItemIndex
from shelflist.serializers import ShelflistItemSerializer
# FIXTURES AND TEST DAT... | unt-libraries/catalog-api | django/sierra/shelflist/tests/test_api.py | Python | bsd-3-clause | 37,869 |
# -*- coding: utf-8 -*-
from django.db import models
from entropy.mixins import GenericMixin
class Attribute(GenericMixin):
'''Generic Attribute'''
name = models.SlugField(max_length=256)
value = models.CharField(max_length=2048)
class Meta:
ordering = ('name',)
verbose_name = 'Custo... | publica-io/django-attrs | attrs/models.py | Python | bsd-3-clause | 484 |
"""
managers.py
.. moduleauthor:: Ulrich Felzmann <ulrich.felzmann@versi.edu.au>
"""
from datetime import datetime
from django.db import models
from django.db.models import Q
from django.core.exceptions import PermissionDenied
from django.contrib.auth.models import User, Group
from tardis.tardis_portal.auth.local... | steveandroulakis/mytardis | tardis/tardis_portal/managers.py | Python | bsd-3-clause | 12,213 |
# coding: utf-8
from summa.director import director
from summa.scene import Scene
import pyglet
class TimedScene(Scene):
def __init__(self, *children):
super(TimedScene, self).__init__(*children)
self._dt = 0
self._maxtime = 20
self._next_scene = None
self._changetype = 0
... | shackra/thomas-aquinas | tests/customstuff.py | Python | bsd-3-clause | 1,159 |
"""
Base Mixin Class for Dynamic Attributes
"""
from sqlalchemy.ext import declarative
import re
FIRST_PASS = re.compile(r'(.)([A-Z][a-z]+)')
LAST_PASS = re.compile(r'([a-z0-9])([A-Z])')
class MapperMixin(object):
__columns__ = []
__primary_key__ = None
__tablename__ = None
@declarative.declared_a... | gmr/apiary | apiary/mappers/mixin.py | Python | bsd-3-clause | 723 |
from haystack import indexes
from photolib.models import Photo
class PhotoIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
alt = indexes.CharField(model_attr='alt', indexed=False)
uuid = indexes.CharField(model_attr='uuid', indexed=False)
thumb... | sunlightlabs/horseradish | photolib/search_indexes.py | Python | bsd-3-clause | 592 |
from __future__ import print_function
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.multiprocessing as mp
from train import train
# Training settings
parser = argparse.ArgumentParser(description='PyTorch MNIST Example')
parser.add_argument('--batch-size', type=int, de... | bmccann/examples | mnist_hogwild/main.py | Python | bsd-3-clause | 2,352 |
import re
import six
from six.moves import filter
from six.moves import map
import django
from django import forms
from django.core.files.uploadedfile import InMemoryUploadedFile
from django.forms.util import flatatt
from django.forms.widgets import FileInput
from django.template import Context
from django.template.lo... | marcoantoniooliveira/labweb | oscar/forms/widgets.py | Python | bsd-3-clause | 7,781 |
from __future__ import absolute_import, division, unicode_literals
import argparse
import json
import locale
import sys
from api_stats import setup_logging, logger
from api_stats.utils import PY3, iteritems
def print_tree(keys, level=0):
"""Print keys in a nested dictionary structure.
"""
for k, v in so... | remram44/api_stats | api_stats/list.py | Python | bsd-3-clause | 1,785 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
from django.contrib.auth.models import AbstractUser
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy... | smillerpy/timeline | timeline/users/models.py | Python | bsd-3-clause | 701 |
#!/usr/bin/env vpython3
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Using colorama.Fore/Back/Style members
# pylint: disable=no-member
from __future__ import print_function
import argparse
import c... | ric2b/Vivaldi-browser | chromium/build/android/apk_operations.py | Python | bsd-3-clause | 73,936 |
#!/usr/bin/env python
#
# Copyright (c) 2018, The OpenThread Authors.
# 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
# notic... | erja-gp/openthread | tools/harness-automation/cases/reed_5_7_2.py | Python | bsd-3-clause | 1,872 |
from django.conf.urls import url, include
from rest_framework import routers
from api import views
router = routers.DefaultRouter(trailing_slash=True)
router.register(
r'sysusers', views.DjangoUserViewSet, base_name="sysusers")
router.register(
r'sysgroups', views.DjangoGroupViewSet, base_name="sysgroups")
rou... | geosoco/reddit_coding | api/urls.py | Python | bsd-3-clause | 1,309 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
human_curl.core
~~~~~~~~~~~~~~~
Heart of human_curl library
:copyright: Copyright 2011 - 2012 by Alexandr Lispython (alex@obout.ru).
:license: BSD, see LICENSE for more details.
"""
import time
from os.path import exists as file_exists
from logging import getLogger... | andrewleech/script.module.human_curl | lib/human_curl/core.py | Python | bsd-3-clause | 30,880 |
"""
General settings and implementation of the single-pole cart system dynamics.
"""
from math import cos, pi, sin
import random
class CartPole(object):
gravity = 9.8 # acceleration due to gravity, positive is downward, m/sec^2
mcart = 1.0 # cart mass in kg
mpole = 0.1 # pole mass in kg
lpole = 0.... | CodeReclaimers/neat-python | examples/single-pole-balancing/cart_pole.py | Python | bsd-3-clause | 3,335 |
import django
from django.utils.six.moves.urllib import parse
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth.models import User
from django.contrib.auth import signals as auth_signals, REDIRECT_FIELD_NAME
from django.contrib.auth.forms import AuthenticationForm
from django.test import Tr... | PaesslerAG/django-act-as-auth | tests/testapp/tests.py | Python | bsd-3-clause | 17,168 |
#!/usr/bin/env python
# Copyright (c) 2011 Stanford University
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND ... | taschik/ramcloud-load-manager | scripts/recoverymetrics.py | Python | isc | 32,500 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from layer import NeuralLayer
import theano
import theano.tensor as T
class Softmax3D(NeuralLayer):
def __init__(self):
super(Softmax3D, self).__init__("softmax")
def compute_tensor(self, x):
shape = x.shape
x = x.reshape((-1, shape[-1]))... | zomux/deepy | deepy/layers/softmax3d.py | Python | mit | 409 |
# Copyright (C) 2015 – 2021 Noa-Emil Nissinen (4shadoww)
from core.hakkuframework import *
import os
import signal
from time import sleep
import logging
import scapy.all as scapy
from core import colors
conf = {
"name": "network_kill",
"version": "1.0",
"shortdesc": "blocks communication between router an... | 4shadoww/usploit | modules/network_kill.py | Python | mit | 1,182 |
from .i2pcontrol import *
| majestrate/i2p-tools | i2pcontrol/i2pcontrol/__init__.py | Python | mit | 26 |
from test import test_support
import time
import unittest
class TimeTestCase(unittest.TestCase):
def setUp(self):
self.t = time.time()
def test_missing_module_attribute(self):
self.assertEqual(time.clock.__module__, 'time')
self.assertEqual(time.time.__module__, 'time')
def test... | EnviroCentre/jython-upgrade | jython/lib/test/test_time.py | Python | mit | 10,491 |
# -*- coding: utf-8 -*-
import importlib
import json
import os
def has_installed(dependency):
try:
importlib.import_module(dependency)
return True
except ImportError:
return False
def is_tox_env(env):
if 'VIRTUAL_ENV' in os.environ:
return env in os.environ['VIRTUAL_ENV']... | python-thumbnails/python-thumbnails | tests/utils.py | Python | mit | 814 |
#!/usr/bin/env python
# SOM-related pre- and post-processing!
import sys
import time
import optparse
import general
import hyper
import numpy
import pickle
import pdb
import metrn
import modencode
import scipy
import random
import os
from scipy import stats
from scipy.stats.stats import pearsonr
from quantile import ... | claraya/meTRN | python/mapNeurons.py | Python | mit | 76,400 |
#! /usr/bin/env python
#
# Copyright (c) 2011 SEOmoz
#
# 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, mer... | pombredanne/downpour | downpour/PoliteFetcher.py | Python | mit | 17,878 |
# -*- 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):
# Changing field 'Post.link'
db.alter_column(u'social_post', 'link', self.gf('django.db.models.fields.URLFi... | pavlenko-volodymyr/codingmood | codemood/social/migrations/0004_auto__chg_field_post_link.py | Python | mit | 4,577 |
import pytest
import klondike
def test_popis_rubem_nahoru():
karta = 13, 'Pi', False
assert klondike.popis_karty(karta) == '[???]'
def test_popis_srdcova_kralovna():
karta = 12, 'Sr', True
assert klondike.popis_karty(karta) in ['[Q ♥]', '[Q S]']
def test_otoc_kralovnu():
karta = 12, 'Sr', True... | PyLadiesCZ/pyladies.cz | original/v1/s007-cards/klondike/test_popis_karty.py | Python | mit | 1,114 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from holmes.search_providers import SearchProvider
from holmes.models.review import Review
from tornado.concurrent import return_future
class NoExternalSearchProvider(SearchProvider):
def __init__(self, config, db, authnz_wrapper=None, io_loop=None):
self.db... | marcelometal/holmes-api | holmes/search_providers/noexternal.py | Python | mit | 2,143 |
"""
WSGI config for habemusCurriculum 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.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJ... | crack-mx/habemoscurriculum | habemusCurriculum/habemusCurriculum/wsgi.py | Python | mit | 411 |
from __future__ import relative_imports
from . import ALL_ACTIONS, ALL_VIEWS, RoleConfigurationError
class RoleMeta(object):
"""Metaclass to register role classes."""
registry = []
def __new__(cls, name, bases, dct):
"""Register all roles created in the system."""
role_cls = super(RoleMe... | jeffschenck/rest-roles | rest_roles/roles.py | Python | mit | 5,031 |
# -*-coding:utf-8 -*-
import re
import json
from bs4 import BeautifulSoup
from page_parse import status
from decorators.decorator import parse_decorator
from db.models import UserRelation
from utils.filters import url_filter
from db.user_relation import save_relations
def get_userid(html):
return status.get_useri... | xtuyaowu/jtyd_python_spider | page_parse/user/public.py | Python | mit | 6,454 |
# Built-in
import os
import warnings
# Common
import numpy as np
# #############################################################################
# Triangular meshes
# #############################################################################
def tri_checkformat_NodesFaces(nodes, indfaces, ids=... | Didou09/tofu | tofu/imas2tofu/_comp_mesh.py | Python | mit | 6,909 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (c) 2012, Rui Carmo
Description: Docstring utility functions
License: MIT (see LICENSE.md for details)
"""
import os, sys, logging
import inspect
from bottle import app
log = logging.getLogger()
def docs():
"""Gather all docstrings related to routes an... | Velmont/digital-signage-server | lib/utils/dockit.py | Python | mit | 943 |
def process(target, other):
result = [[] for ch in target]
ret = []
for xi, xv in enumerate(target):
for yi, yv in enumerate(other):
if xv != yv:
result[xi].append(0)
elif 0 == xi or 0 == yi:
result[xi].append(1)
else:
... | everyevery/programming_study | lgecodejam/2014-mar/c/c.py | Python | mit | 1,284 |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | samedder/azure-cli | src/command_modules/azure-cli-eventgrid/azure/cli/command_modules/eventgrid/sdk/models/event_subscriptions_list_result.py | Python | mit | 1,156 |
#!/usr/bin/env python
"""A module to interact with the course list"""
from __future__ import with_statement
DEFAULT_CONFIG_FILE_LIST = '/etc/vmchecker/config.list'
class CourseList(object):
"""A class to interact with the course list"""
def __init__(self, config_file_list=DEFAULT_CONFIG_FILE_LIST):
... | calin-iorgulescu/vmchecker | vmchecker/courselist.py | Python | mit | 1,577 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Weapon()
result.template = "object/weapon/melee/sword/crafted_saber/shared_sword_lightsaber_one_handed_s12_gen1.if... | obi-two/Rebelion | data/scripts/templates/object/weapon/melee/sword/crafted_saber/shared_sword_lightsaber_one_handed_s12_gen1.py | Python | mit | 497 |
import tensorflow as tf
from tensorflow.python.keras.layers import Conv2D, Conv2DTranspose, Conv3D, Dense, Reshape
tfgan = tf.contrib.gan
def basic_generator(noise):
"""Simple generator to produce MNIST images.
Args:
noise: A single Tensor representing noise.
Returns:
A generated image... | bgroveben/python3_machine_learning_projects | learn_kaggle/deep_learning/packages/learntools/gans/generators.py | Python | mit | 2,657 |
#! /usr/bin/env python
"""
based on https://github.com/tomchristie/django-rest-framework/blob/master/runtests.py
"""
from __future__ import print_function
import pytest
import sys
import os
import subprocess
PYTEST_ARGS = {
'default': ['tests'],
'fast': ['tests', '-q'],
}
FLAKE8_ARGS = ['rest_framework_frie... | FutureMind/drf-friendly-errors | runtests.py | Python | mit | 2,452 |
from __future__ import absolute_import
import wx
from wx.lib.pubsub import pub
from .file_picker import FilePicker
from .fits_header_dialog import FITSHeaderDialog
from .image_process_action import ImageProcessAction
import numpy as np
import os
import glob
import sys
import time
import threading
from .ztv_wx_lib impor... | henryroe/ztv | ztv/source_panel.py | Python | mit | 29,058 |
#!/usr/bin/env python3
from http.server import HTTPServer, CGIHTTPRequestHandler
port = 8000
httpd = HTTPServer(('', port), CGIHTTPRequestHandler)
print("Starting simple_httpd on port: " + str(httpd.server_port))
httpd.serve_forever()
| fthuin/artificial-intelligence | assignment3/Code/zipremise/SimpleHTTPServer.py | Python | mit | 238 |
import re
import shutil
import time
import os
import os.path
from pyquery.pyquery import PyQuery
import requests
import requests.utils
from WhatManager2.settings import MEDIA_ROOT
from bibliotik import manage_bibliotik
from bibliotik.models import BibliotikTorrent, BibliotikFulltext
from bibliotik.settings import BIB... | MADindustries/WhatManager2 | bibliotik/utils.py | Python | mit | 7,895 |
import csv
from django.contrib import messages
from django.shortcuts import HttpResponseRedirect, resolve_url, HttpResponse
from django.views.generic import FormView, ListView
from lmgtfy.forms import MainForm
from lmgtfy.helpers import search_bing, check_valid_tld
from lmgtfy.models import Domain, DomainSearch, Doma... | opendata/lmgtdfy | lmgtfy/views.py | Python | mit | 4,151 |
from setuptools import setup
setup(
name='quotequail',
version='0.2.3',
url='http://github.com/closeio/quotequail',
license='MIT',
author='Thomas Steinacher',
author_email='engineering@close.io',
maintainer='Thomas Steinacher',
maintainer_email='engineering@close.io',
description='A... | elasticsales/quotequail | setup.py | Python | mit | 1,101 |
# Copyright (c) 2013-2016 Molly White
#
# 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,
# di... | quanticle/GorillaBot | gorillabot/plugins/settings.py | Python | mit | 5,087 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/community_crafting/component/shared_reinforced_wall_module.... | obi-two/Rebelion | data/scripts/templates/object/draft_schematic/community_crafting/component/shared_reinforced_wall_module.py | Python | mit | 480 |
import theano
theano.test()
| 1iyiwei/pyml | code/ch13/theano_test.py | Python | mit | 29 |
"""This list is composed from 100 most frequently occuring words in Marathi corpus in CLTK.
"""
STOP_LIST =["न",
"तरी",
"तो",
"हें",
"तें",
"कां",
"आणि",
"जें",
"जे",
"मग",
"ते",
"मी",
... | TylerKirby/cltk | cltk/stop/marathi/stops.py | Python | mit | 2,693 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Building()
result.template = "object/building/poi/shared_lok_nymshenchman_medium.iff"
result.attribute_template_i... | anhstudios/swganh | data/scripts/templates/object/building/poi/shared_lok_nymshenchman_medium.py | Python | mit | 454 |
"""Attempt to install all datasets into all database management systems
This module, when run, attempts to install datasets from all Retriever scripts
in the /scripts folder (except for those listed in IGNORE), for each engine in
ENGINE_LIST() from __init__.py. In other words, it runs trys to install using
all possibl... | davharris/retriever | try_install_all.py | Python | mit | 1,795 |
__author__ = 'dimitris'
import os
# Flask Configuration
basedir = os.path.abspath(os.path.dirname(__file__))
SECRET_KEY = 'knaskndfknasdfiaosifoaignaosdnfoasodfnaodgnas'
PREFERRED_URL_SCHEME = 'https'
#SqlAlchemy Configuration
DB_NAME = 'puzzles.db'
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, DB_N... | gdimitris/ChessPuzzlerBackend | Application/app_configuration.py | Python | mit | 368 |
from .app import Sofi
| tryexceptpass/sofi | sofi/app/__init__.py | Python | mit | 23 |
R = [x for x in range(97, 123) if chr(x) not in 'tfpeqwzgnib']
b = 0x56, 0x2B, 0x0F, 0xC5
number = 0
for x0 in R:
for x1 in R:
for x3 in R:
_00 = b[0] ^ x0
_11 = b[1] | x1
Y0 = _00 ^ _11
Y1 = b[3] ^ _11
Y3 = b[2] & (_00 & x3)
... | phantom-root/tasks | hashes/300_homemade_hash/other/botanlq/calc_script.py | Python | mit | 814 |
import psycopg2
import unittest
import sys
class LDropTablesTest(unittest.TestCase):
def setUp(self):
conn = psycopg2.connect("dbname=teste user=postgres")
conn.set_isolation_level(0) # set autocommit
self.cur = conn.cursor()
def tearDown(self):
self.c... | UFCGProjects/sig | src/tests/DropTablesTest.py | Python | mit | 1,528 |
#!/Volumes/SSDATA/www/greenpointtrees/greenpointtrees/bin/python
"""PILdriver, an image-processing calculator using PIL.
An instance of class PILDriver is essentially a software stack machine
(Polish-notation interpreter) for sequencing PIL image
transformations. The state of the instance is the interpreter stack.
T... | canhhs91/greenpointtrees | greenpointtrees/bin/pildriver.py | Python | mit | 15,643 |
from django.conf import settings
USE_HTTPS = bool(getattr(settings, 'SOCIALREGISTRATION_USE_HTTPS', False))
class Client(object):
"""
Base class for OAuth/OpenID clients. Subclasses must implement all the
methods.
"""
def is_https(self):
"""
Check if the site is using HTTPS. ... | Soovox/django-socialregistration | socialregistration/clients/__init__.py | Python | mit | 1,878 |
import execnet
gw = execnet.makegateway("popen//python=python2")
channel = gw.remote_exec("""
import numpy
array = numpy.array([1,2,3])
while 1:
x = channel.receive()
if x is None:
break
array = numpy.append(array, x)
channel.send(repr(array))
""")
for x in range(10)... | RonnyPfannschmidt/execnet-test | doc/example/py3topy2.py | Python | mit | 387 |
from pyjaco.decorator import JavaScript, JSVar
@JavaScript()
@JSVar("window", "alert")
def StartGoL():
window.gol = GoL()
@JavaScript()
class GoL(object):
@JSVar("document", "Math", "setInterval", "self.canvas")
def __init__(self):
self.width = 75
self.height = 75
self.canvas = do... | buchuki/pyjaco | examples/gol.py | Python | mit | 2,870 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Building()
result.template = "object/building/poi/base/shared_base_poi_medium.iff"
result.attribute_template_id =... | anhstudios/swganh | data/scripts/templates/object/building/poi/base/shared_base_poi_medium.py | Python | mit | 451 |
import json
from django.http import HttpResponse
from django.utils.cache import add_never_cache_headers
class ApiResponse(HttpResponse):
"""JSON-encoded API response
I've arbitrarily decided that the API uses JSON responses. To ease the
encoding process and to ensure that the correct Content-Type is se... | Kromey/akwriters | api/utils.py | Python | mit | 1,500 |
"""
Test suite for module.
Holds constants and methods shared among multiple tests.
See submodules for individual tests.
"""
import os
import shutil
PARAM_LIST = {
'pre_min': 100,
'pre_max': 101,
'Pre': 10,
'pim_min': -101,
'pim_max': -100,
'Pim': 14,
'T': 16,
'I': 20,
}
OUTPUT_DIR ... | kidmose/python-course | mandelbrot/tests/__init__.py | Python | mit | 674 |
# using False as a conditional
@micropython.viper
def f():
x = False
if x:
pass
else:
print("not x", x)
f()
# using True as a conditional
@micropython.viper
def f():
x = True
if x:
print("x", x)
f()
# using an int as a conditional
@micropython.viper
def g():
y = 1
i... | pozetroninc/micropython | tests/micropython/viper_cond.py | Python | mit | 497 |
#-*- coding: utf-8 -*-
import phonenumbers
from django.conf import settings
from django.core import validators
from django.utils.six import string_types
from phonenumbers.phonenumberutil import NumberParseException
class PhoneNumber(phonenumbers.phonenumber.PhoneNumber):
"""
A extended version of phonenumbers... | CloudNcodeInc/django-phonenumber-field | phonenumber_field/phonenumber.py | Python | mit | 3,532 |
# -*- coding: utf-8 -*-
"""
tools
=====
Functions that USERS will possibly want access to.
"""
from __future__ import absolute_import
import json
import warnings
import six
import re
import os
from plotly import exceptions, optional_imports
from plotly.files import PLOTLY_DIR
DEFAULT_PLOTLY_COLORS = [
"rgb(3... | plotly/python-api | packages/python/plotly/plotly/tools.py | Python | mit | 25,137 |
from __future__ import print_function
from future import standard_library
standard_library.install_aliases()
from builtins import str
import json, requests
import os, errno
import urllib.request, urllib.parse, urllib.error
def mkdir_p(path):
try:
os.makedirs(path)
except OSError as exc: # Python >2.5
... | chrisfilo/NeuroVault | scripts/prepare_sdr_package.py | Python | mit | 1,853 |
# 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-devtestlabs/azure/mgmt/devtestlabs/models/shared_public_ip_address_configuration_fragment.py | Python | mit | 1,084 |
# -*- coding: utf-8 -*-
############################ Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | danielecook/gist-alfred | github/Permissions.py | Python | mit | 3,634 |
#!/usr/bin/python
###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way wit... | Southpaw-TACTIC/TACTIC | src/pyasm/application/maya/maya_builder_exec.py | Python | epl-1.0 | 2,188 |
import flask
import keras
import numpy as np
import os
from keras.models import load_model
from PIL import Image
from flask import Flask, request
from jinja2 import Template
app = Flask(__name__)
model = load_model('smile.h5')
model._make_predict_function()
def predict_image(image):
image = image.convert(mode="... | lukas/ml-class | examples/keras-smile/smile-server-1.py | Python | gpl-2.0 | 1,356 |
# Generated by Django 2.2.13 on 2020-09-07 08:40
import assets.models.node
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
... | skyoo/jumpserver | apps/perms/migrations/0013_rebuildusertreetask_usergrantedmappingnode.py | Python | gpl-2.0 | 2,942 |
# -*- coding: utf-8 -*-
import sys
import time
import json
import datetime
import scrapy
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request
import robot
from robot.items import RobotItem
from robot.models.base import Base
from robot.settings import logger
class EladiedSinaComCnItem(RobotIt... | li282886931/apistore | robot/robot/news/eladies_sina_com_cn.py | Python | gpl-2.0 | 2,757 |
#!/usr/bin/pythonTest
# -*- coding: utf-8 -*-
#
# Web functions Zip
#
# 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.
#
... | netvigator/myPyPacks | pyPacks/Web/Zip.py | Python | gpl-2.0 | 10,718 |
from django.db.models.sql.aggregates import *
class IfnullSum(Aggregate):
sql_function = 'SUM'
sql_template = 'IFNULL(%(function)s(%(field)s),0)' | hawkerpl/k2 | utils/django/db/models/sql/aggregates.py | Python | gpl-2.0 | 154 |
'''
DICT OF ITEMS IN CONFIG WHICH AFFECT THIS KODI SETTING
kodi_setting_id: {
KODI_ITEM:
{
config_get_patterns: [ LIST OF DICTS WITH AN IDENTIFY REGEX AND AN EXTRACT REGEX
IDENTIFY REGEX'S ARE THERE TO SPECIFICALLY FIND THE LINES
EXTRACT REGEXES ARE THERE TO GET THE SPECIFIC SETTING VALUE
... | hevvieevvie/osmc | package/mediacenter-addon-osmc/src/script.module.osmcsetting.pi/resources/lib/OSMC_REparser.py | Python | gpl-2.0 | 38,080 |
# Copyright (C) 2010-2012 Cuckoo Sandbox Developers.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
import os
from lib.common.abstracts import Package
from lib.api.process import Process
from lib.common.paths import PATHS
class Exe(Package):
... | donfucius/malwasm | cuckoo/analyzer/windows/modules/packages/malwasm.py | Python | gpl-2.0 | 1,806 |
#!/usr/bin/env python
import subprocess as sp
from runtest import TestBase
XDIR='xxx'
YDIR='yyy'
class TestCase(TestBase):
def __init__(self):
TestBase.__init__(self, 'diff', """
#
# uftrace diff
# [0] base: xxx (from uftrace record -d yyy -F main tests/t-diff 1 )
# [1] diff: yyy (from uftrace rec... | namhyung/uftrace | tests/t159_report_diff_policy2.py | Python | gpl-2.0 | 2,877 |
import numpy as np
import os,sys
from scipy import optimize
import matplotlib.pyplot as plt
import matplotlib.dates as pltdates
from astropy.io import ascii
from datetime import datetime
#This script will fit a power law to the moving source synchrotron spectrum
#The new data location
#if sys.platform == 'darwin': B... | kkozarev/mwacme | src/fit_powerlaw_spectra_normalized.py | Python | gpl-2.0 | 4,350 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2008 Zsolt Foldvari
#
# 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) ... | arunkgupta/gramps | gramps/gui/widgets/validatedcomboentry.py | Python | gpl-2.0 | 8,370 |
#!/usr/bin/env python
"""
@file netstats.py
@author Daniel Krajzewicz
@author Michael Behrisch
@date 2008-08-13
@version $Id: netstats.py 14425 2013-08-16 20:11:47Z behrisch $
Prints some information about a given network
SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
Copyright (C) 2009-2013 DLR... | cathyyul/sumo-0.18 | tools/net/netstats.py | Python | gpl-3.0 | 1,975 |
# coding=utf-8
import logging
import rarfile
import os
from subliminal.exceptions import ConfigurationError
from subliminal.providers.legendastv import LegendasTVSubtitle as _LegendasTVSubtitle, \
LegendasTVProvider as _LegendasTVProvider, Episode, Movie, guess_matches, guessit, sanitize, region, type_map, \
r... | dantebarba/docker-media-server | plex/Sub-Zero.bundle/Contents/Libraries/Shared/subliminal_patch/providers/legendastv.py | Python | gpl-3.0 | 10,819 |
#!/usr/bin/env python
"""
the goal of this file is to provide a lib of joint probability transformation.
During the transformation, the marginal distribution is unchanged.
now only consider the 2-d case.
"""
def joint_prob_trans(A, d):
"""
- A is the reference joint distribution,
- d is the degree of the ch... | hbhzwj/imalse | util/joint_pdf.py | Python | gpl-3.0 | 1,876 |
#!/usr/bin/python
'''
Created on Sep 18, 2009
@author: sgallagh
'''
import unittest
import os
from stat import *
import sys
srcdir = os.getenv('srcdir')
if srcdir:
sys.path.append("./src/config")
srcdir = srcdir + "/src/config"
else:
srcdir = "."
import SSSDConfig
class SSSDConfigTestValid(unittest.Tes... | yelley/sssd | src/config/SSSDConfigTest.py | Python | gpl-3.0 | 71,503 |