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 |
|---|---|---|---|---|---|
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.conf import settings
from django.contrib import admin
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'isucdc2.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/... | ISEAGE-ISU/cdc2-2015-www | isucdc2/urls.py | Python | mit | 469 |
#!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
'''The main GUI'''
import collections, os, sys, textwrap, time, gc, errno
from Que... | hazrpg/calibre | src/calibre/gui2/ui.py | Python | gpl-3.0 | 39,371 |
# Copyright 2014-2016 Ivan Kravets <me@ikravets.com>
#
# 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... | ZachMassia/platformio | platformio/telemetry.py | Python | apache-2.0 | 10,093 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
"""The Tornado web framework.
核心模块, 参考示例使用代码:
- 重要模块:
- tornado.web
- tornado.ioloop # 根据示例,可知入口在此.参看: ioloop.py
- tornado.httpserver
The Tornado web framework looks a bit like web.py (http://webpy.org/) or
Google's webapp (http://cod... | hhstore/tornado-annotated | src/tornado-1.0.0/tornado/web.py | Python | mit | 66,814 |
class CheckerResults:
def __init__(self, entries, invalidParentEntries):
self._entries = entries
self._invalidParentEntries = invalidParentEntries
@property
def entries(self):
return self._entries
@property
def invalidParentEntries(self):
return sel... | justincc/firefox-bookmarks-integrity-check | src/fbic/checker.py | Python | apache-2.0 | 985 |
"""Provide an authentication layer for Home Assistant."""
import asyncio
from collections import OrderedDict
from datetime import timedelta
import logging
from typing import Any, Dict, List, Optional, Tuple, cast
import jwt
from homeassistant import data_entry_flow
from homeassistant.auth.const import ACCESS_TOKEN_EX... | tchellomello/home-assistant | homeassistant/auth/__init__.py | Python | apache-2.0 | 17,537 |
__author__ = 'Daniel Lindsley'
__version__ = '1.1'
| toastdriven/django-rsvp | rsvp/__init__.py | Python | mit | 51 |
#!/usr/bin/env python
#
# Copyright 2016 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Generate Android.bp for Skia from GN configuration.
from __future__ import print_function
import os
import pprint
import string
import subprocess
import tempf... | google/skia | gn/gn_to_bp.py | Python | bsd-3-clause | 23,280 |
# -*- encoding: utf-8 -*-
__author__ = 'wangss'
# 数据处理脚本
import xlrd
def sqlExcute():
file1 = open("E://111.sql")
file2 = open("E://222.sql")
re = []
for i in file2:
# print i.decode('gbk')
if i.find("values") > -1:
re.append(i.split("values")[1].split(",")[0][3:-1])
fo... | alenX/PythonStuff | SqlDeal.py | Python | gpl-3.0 | 1,668 |
import matplotlib
matplotlib.use('Agg')
import matplotlib.pylab as plt
import matplotlib.colors as mat_col
from matplotlib.colors import LinearSegmentedColormap
import scipy
import scipy.cluster.hierarchy as sch
from scipy.cluster.hierarchy import set_link_color_palette
import numpy as np
import pandas as pd
import sea... | sthyme/ZFSchizophrenia | BehaviorAnalysis/Alternative_Analyses/SSMDanalysis_basedonDatasetsS1andS2/mayywheatmap_ssmd.py | Python | mit | 6,646 |
# Copyright 2016 ZTE Corporation.
#
# 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 ... | open-o/nfvo | lcm/lcm/ns/sfcs/sfc_instance.py | Python | apache-2.0 | 3,786 |
import datetime
import imghdr
import posixpath
import tempfile
from urllib.parse import urlparse
import requests
from django.apps import apps
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.exceptions import ValidationError
from django.core.files.images import ImageFile
f... | liqd/a4-meinberlin | meinberlin/apps/bplan/serializers.py | Python | agpl-3.0 | 8,225 |
#!/usr/bin/python
# Copyright (C) 2014 Reece H. Dunn
#
# This file is part of libclangpy.
#
# libclangpy 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) ... | rhdunn/libclangpy | tests.py | Python | gpl-3.0 | 54,828 |
from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from django.conf import settings
from django.conf.urls.static import static
from video_manager import views
urlpatterns = [url(r'^$', views.IndexView.as_view(), name='index'),
url(r'^(?P<pk>\d+)/$', views.Details... | iago-suarez/ancoweb-TFG | src/video_manager/urls.py | Python | apache-2.0 | 777 |
# -*- coding: utf-8 -*-
"""Finitely Presented Groups and its algorithms. """
from __future__ import print_function, division
from sympy.core.basic import Basic
from sympy.core import Symbol, Mod
from sympy.printing.defaults import DefaultPrinting
from sympy.utilities import public
from sympy.utilities.iterables import... | wxgeo/geophar | wxgeometrie/sympy/combinatorics/fp_groups.py | Python | gpl-2.0 | 44,822 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# rtstock documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# aut... | condereis/realtime-stock | docs/conf.py | Python | mit | 8,475 |
#! /usr/bin/env python
"""Script for modified the /etc/X11/xorg.conf file for sharing the desktop via
VNC server
"""
__author__ = "Greg Brissey"
__version__ = "$Revision: 1.0 $"
__date__ = "$Date: 2009/08/11 11:57:19 $"
__license__ = "Python"
#
# Read the /etc/X11/xorg.conf and create a new xorg.conf
# Done in... | OpenVnmrJ/OpenVnmrJ | src/scripts/modxorg.py | Python | apache-2.0 | 15,887 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2007 Brian G. Matherly
# Copyright (C) 2010 Jakim Friant
# Copyright (C) 2011 Tim G L Lyons
#
# 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 Fr... | SNoiraud/gramps | gramps/gen/plug/report/_bibliography.py | Python | gpl-2.0 | 11,017 |
import re
from .utils import validator
@validator
def card_number(value):
"""
Return whether or not given value is a valid card number.
This validator is based on Luhn algorithm.
.. luhn:
https://github.com/mmcloughlin/luhn
Examples::
>>> card_number('4242424242424242')
... | kvesteri/validators | validators/card.py | Python | mit | 4,383 |
from autoprotocol.util import make_dottable_dict
from autoprotocol import Unit
def glycerol_storage(protocol,params):
params = make_dottable_dict(params)
for g in params["samples"]:
container = protocol.ref(g["label"], cont_type="micro-1.5", storage = "cold_80")
protocol.provision("rs17rrhqpsxy... | bmiles/transcriptic_public_protocols | miles_public_protocols/glycerol_storage.py | Python | mit | 570 |
import logging
import requests
from flask import redirect, url_for, Blueprint, flash, request, session
from flask_login import login_user
from flask_oauthlib.client import OAuth
from sqlalchemy.orm.exc import NoResultFound
from redash import models, settings
from redash.authentication.org_resolving import current_org
... | stefanseifert/redash | redash/authentication/google_oauth.py | Python | bsd-2-clause | 4,261 |
"""Configure number in a device through MQTT topic."""
from __future__ import annotations
import functools
import logging
import voluptuous as vol
from homeassistant.components import number
from homeassistant.components.number import (
DEFAULT_MAX_VALUE,
DEFAULT_MIN_VALUE,
DEFAULT_STEP,
NumberEntity... | mezz64/home-assistant | homeassistant/components/mqtt/number.py | Python | apache-2.0 | 8,495 |
"""
test setting *parts* of objects both positionally and label based
TOD: these should be split among the indexer tests
"""
import pytest
from warnings import catch_warnings
import numpy as np
import pandas as pd
from pandas import Series, DataFrame, Panel, Index, date_range
from pandas.util import testing as tm
... | NixaSoftware/CVis | venv/lib/python2.7/site-packages/pandas/tests/indexing/test_partial.py | Python | apache-2.0 | 23,301 |
from django.conf import settings
from django.conf.urls import url, include
from django.conf.urls.static import static
from django.contrib import admin
from test_app import views
from simple_review.views import post_review
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^detail-test/(?P<pk>\w+)$', views.... | RamezIssac/simple-review | src/tests/tests/urls.py | Python | mit | 493 |
#!/usr/bin/env python
import argparse
import os
from pathlib import Path
import yaml
import ray
from ray.tune.config_parser import make_parser
from ray.tune.progress_reporter import CLIReporter, JupyterNotebookReporter
from ray.tune.result import DEFAULT_RESULTS_DIR
from ray.tune.resources import resources_to_json
fr... | ray-project/ray | rllib/train.py | Python | apache-2.0 | 9,901 |
import unittest
from emoji_data_python import EmojiChar
class EmojiCharTestCase(unittest.TestCase):
def setUp(self):
self.emoji = EmojiChar({
"name": "WHITE UP POINTING INDEX",
"unified": "261D",
"variations": [
"261D-FE0F"
],
"d... | alexmick/emoji-data-python | tests/test_emoji_char.py | Python | mit | 3,008 |
"""
media types
"""
from __future__ import print_function
from xnb_parse.file_formats.wav import write_wav
from xnb_parse.file_formats.xml_utils import ET
from xnb_parse.xna_types.xna_primitive import Enum
class SoundEffect(object):
def __init__(self, sound_format, sound_data, loop_start, loop_length, duration,... | fesh0r/xnb_parse | xnb_parse/xna_types/xna_media.py | Python | mit | 3,201 |
try:
import simplejson as json
except ImportError:
import json
import datetime
from flask import request
from werkzeug.exceptions import NotFound
from flask_peewee.utils import check_password
from flask_peewee.utils import get_object_or_404
from flask_peewee.utils import make_password
from flask_peewee.tests... | ariakerstein/twitterFlaskClone | project/lib/python2.7/site-packages/flask_peewee/tests/utils.py | Python | mit | 1,750 |
from math import copysign
from Util.geometry import wrap_to_pi
import numpy as np
from time import time
from collections import deque
class PID:
def __init__(self, kp: float, ki: float, kd: float, *,
deadzone: float=0.0,
signed_error: bool=False,
anti_windup: b... | RoboCupULaval/StrategyIA | Engine/Controller/Regulators/PID.py | Python | mit | 1,874 |
# -*- coding: utf-8 -*-
from django.core import urlresolvers
from django.conf import settings
from django.utils import translation
def reverse(viewname, urlconf=None, args=[], kwargs={}, prefix=None):
locale = kwargs.pop('locale', translation.get_language())
path = django_reverse(viewname, urlconf, args, kwar... | kron4eg/django-localize | localize/models.py | Python | bsd-3-clause | 576 |
#!/usr/bin/env python
# -*- coding : Utf-8 -*-
# Les listes
#-----------------------------------------------------------------------------
L = ['Valérie', 43, 'Christian', 41, 'Adèle', 12,
'Lise', 11, 'Garance', 9]
print(L[1:-1])
L[3:3] = ['Boudin blanc'] # insère un/plusieurs élément(s)
L[3] = 'Boudin blanc' # r... | ValerieMauduit/InitBook | Chapter1/listes_comprehension.py | Python | gpl-3.0 | 1,030 |
from list_tests import * | opendoor/django-comlink | comlink/tests/__init__.py | Python | agpl-3.0 | 25 |
"""
High-level QEMU test utility functions.
This module is meant to reduce code size by performing common test procedures.
Generally, code here should look like test code.
More specifically:
- Functions in this module should raise exceptions if things go wrong
- Functions in this module typically use function... | igord-daynix/virt-test | virttest/utils_test/qemu.py | Python | gpl-2.0 | 52,890 |
##
##
## Apache License
## Version 2.0, January 2004
## http://www.apache.org/licenses/
##
## TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
##
## 1. Definitions.
##
## "License" shall mean the terms and conditions for use, reproduction,
## and distribution as defined by Sections 1 through 9 of... | openpreserve/fuzzy-expert-system | es.py | Python | apache-2.0 | 64,869 |
# !/usr/bin/env python
#
# Hornet - SSH Honeypot
#
# Copyright (C) 2015 Aniket Panse <aniketpanse@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or... | czardoz/hornet | hornet/tests/commands/test_ssh.py | Python | gpl-3.0 | 6,905 |
import h5py # HDF5 support
import os
import glob
import numpy as n
from scipy.interpolate import interp1d
import sys
from astropy.cosmology import FlatLambdaCDM
import astropy.units as u
cosmoMD = FlatLambdaCDM(H0=67.77*u.km/u.s/u.Mpc, Om0=0.307115, Ob0=0.048206)
#status = 'create'
status = 'update'
path_to_lc = s... | JohanComparat/pyEmerge | bin_cluster/lc_add_clusters.py | Python | unlicense | 1,223 |
from eve import Eve
app = Eve()
if __name__ == '__main__':
app.run()
| newmediadenver/evegenie | run.py | Python | mit | 75 |
#============================================================================================================
# CWE-120: Buffer Copy without Checking Size of Input
#
# Vuln Info: A trivial way to cause this vulnerability is using the gets() function which is not secure.
# Ex:
# bytes_received = gets(input); ... | cetfor/PaperMachete | queries/cwe_120_v1.py | Python | mit | 2,076 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2011-2015 Slack
#
# 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
... | Slack06/yadg | descgen/tasks.py | Python | mit | 1,273 |
import urllib
try:
import json as simplejson
except ImportError:
try:
import simplejson
except ImportError:
from django.utils import simplejson
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.test.client import Client, RequestFactory
from d... | jdavidagudelo/django-social-auth-corrected | social_auth/tests/client.py | Python | bsd-3-clause | 5,129 |
#version 1:
from re import search
import rospy
from std_msgs.msg import String
from sys import exit
pub = rospy.Publisher('control_action', String);#,queue_size=10);
state = ""
def callback(data):
global state
state = data.data
def initialize_handshake(HOST, PORT): # setup socket and start the connection t... | slremy/testingpubsub | myBallPlate/rosclient.py | Python | mit | 1,166 |
raise NotImplementedError("htmlentitydefs is not yet implemented in Skulpt")
| ArcherSys/ArcherSys | skulpt/src/lib/htmlentitydefs.py | Python | mit | 77 |
# -*- coding: utf-8 -*-
import unittest
class FunctionalTestCase(unittest.TestCase):
@unittest.skip
def test(self):
# TODO: create S3 bucket
# TODO: create CloudFront distribution
# TODO: assign S3 bucket to CloutFront distribution
#
# TODO: put_object to created S3 b... | gjo/cloudfrontsigner | cloudfrontsigner/tests/test_functional.py | Python | bsd-3-clause | 492 |
from lcapy import Circuit
cct = Circuit("""
V 1 0 step 10; down
L 1 2 1e-3; right, size=1.2
C 2 3 1e-4; right, size=1.2
R 3 0_1 1; down
W 0 0_1; right
""")
import numpy as np
t = np.linspace(0, 0.01, 1000)
vr = cct.R.v.evaluate(t)
from matplotlib.pyplot import subplots, savefig
fig, ax = subplots(1)
ax.plot(t, vr, li... | mph-/lcapy | doc/examples/netlists/circuit-VRLC2-vr.py | Python | lgpl-2.1 | 442 |
# Copyright 2012 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 requi... | rickerc/nova_audit | nova/tests/network/test_neutronv2.py | Python | apache-2.0 | 88,310 |
"""
Test running features in a freshly created Django application.
"""
import os
import shutil
import subprocess
import unittest
from tests.util import in_temporary_directory, run_scenario
def find_file(name):
"""
Find a file with the specified name somewhere in the current directory.
"""
for dirpa... | koterpillar/aloe_django | tests/integration/test_stock_app.py | Python | gpl-3.0 | 3,049 |
"""
Wrapper functions mimicking behavior of scipy.stats.truncnorm methods
"""
import truncated_normal.truncated_normal as truncnorm
import ctypes
import numpy as np
def pdf(x, a, b, loc=0., scale=1.):
a = loc + a * scale
b = loc + b * scale
if isinstance(x, (int, float)):
return truncnorm.truncated_normal_ab_pd... | ROB-Seismology/oq-hazardlib | openquake/hazardlib/c_speedups/truncnorm.py | Python | agpl-3.0 | 2,006 |
# Copyright 2016 Canonical Limited.
#
# 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 writi... | konono/equlipse | openstack-install/charm/trusty/charm-keystone/charmhelpers/contrib/hardening/host/checks/pam.py | Python | mit | 4,042 |
from vnc.models import *
import paramiko
def test():
print "start "
s=server.objects.all()
print s
for i in s:
print i.servername
#test()
def updateserver():
ser=server.objects.all()
for i in ser:
vncnum,se=runcmd2(i.serverusername,i.serverpassword,i.servername,"ps -ef | grep Xvnc |grep -v grep |wc| awk '{p... | ylzmax/vncmanager | vnc/t.py | Python | gpl-3.0 | 996 |
# =============================================================================
# Federal University of Rio Grande do Sul (UFRGS)
# Connectionist Artificial Intelligence Laboratory (LIAC)
# Renato de Pontes Pereira - rppereira@inf.ufrgs.br
# =============================================================================
... | renatopp/psi-robotics | psi/core/components/replay_robot.py | Python | mit | 6,151 |
import turtle
userinput = int(input("How many triangles within triangles do you want? Enter an integer from 1 to 6!"))
def drawTriangle(points,color,myTurtle):
myTurtle.fillcolor(color)
myTurtle.up()
myTurtle.goto(points[0][0],points[0][1])
myTurtle.down()
myTurtle.begin_fill()
myTurtle.goto(poi... | sjamcsclub/ROOM-B-CS-Club-Materials | Turtle Lesson/triangle.py | Python | gpl-3.0 | 1,474 |
from pytba.util import team_wrap
class Event:
"""Class representing a single FRC Event with associated data.
Attributes (see https://www.thebluealliance.com/apidocs#models for more information):
key (str): A string of the event's key, usually the year followed by the event code.
i... | Ninjakow/TrueSkill | lib/pytba/models.py | Python | gpl-3.0 | 7,506 |
from builtins import range
from builtins import object
import rdflib
import os
import collections
import requests
from dataurl import DataURLStorage
from werkzeug.utils import secure_filename
import tempfile
from depot.io.utils import FileIntent
from depot.manager import DepotManager
from datetime import datetime
im... | tetherless-world/satoru | whyis/nanopub/nanopublication.py | Python | apache-2.0 | 3,459 |
from blogfetch import BlogFetch
from gspreadsheet import DB
| TXTPEN/blog-fetch | blogfetch/__init__.py | Python | bsd-3-clause | 60 |
# coding=utf-8
'''
Created on 2013-7-22
拍书操作
@author: gudh
'''
import win32api,win32con,win32gui
import time
import Image,ImageGrab
import os, traceback
import bookconfig,bookorm
def move(loc):
'''移动鼠标'''
win32api.SetCursorPos(loc)
def click(left=True):
'''单击鼠标'''
if left:
d = win32con.MOUSEE... | Yhzhtk/bookcatch | bookshot.py | Python | gpl-2.0 | 7,589 |
#################################################################################################
# Programmer: Chase Johnson #
# Date: 10/20/17 #
# File Name: ExtractingNut... | zkhan4123/hackISU | ExtractingNutrition.py | Python | mit | 2,391 |
# tests/base.py
from flask_testing import TestCase
from app import create_app
from app.models import User, db
app = create_app()
class BaseTestCase(TestCase):
def create_app(self):
app.config.from_object('app.config.TestingConfig')
return app
def setUp(self):
db.create_all()
... | paris3200/flask-inventory | tests/base.py | Python | mit | 510 |
__author__ = 'we32zac'
from pyEOM.datasets import Dataset as DatasetAbs
class Dataset(DatasetAbs):
shortname = 'MYD13A3'
platform = 'Aqua'
collection = '005'
rastertype = 'Tile'
timeInterval = 'P1M'
host = 'http://e4ftl01.cr.usgs.gov'
dir = '/MODIS_Composites/MOLA/MYD13A3.00... | jonas-eberle/pyEOM | pyEOM/datasets/predefined/MODIS/MYD13A3.py | Python | mit | 3,773 |
# Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# 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 applicabl... | froyobin/ironic | ironic/drivers/modules/ilo/common.py | Python | apache-2.0 | 16,198 |
# setup.py
from setuptools import setup
setup(
name='rllab',
version='0.1.0',
packages=['rllab'],
)
| brain-research/mirage-rl-qprop | setup.py | Python | mit | 113 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name='Sulley',
download_url='https://github.com/OpenRCE/sulley',
packages=['requests', 'sulley', 'sulley.legos', 'sulley.pgraph', 'sulley.utils',
... | jtpereyda/sulley | setup.py | Python | gpl-2.0 | 883 |
# -*- coding: utf-8 -*-
from .context import textprocessor
import unittest
class DeleteDigitsTestSuite(unittest.TestCase):
"""Test cases for Delete Punctuation Signs"""
def test_clean_string(self):
"""Test clean string"""
string = "this is a clean string"
expected = "this is a clean... | Cenorius/practica-final-verificacion | tests/test_caps.py | Python | gpl-3.0 | 1,598 |
"""Testing code for the tupa.features package, unit-testing only."""
import os
from collections import OrderedDict
import pytest
from ucca import textutil
from tupa.action import Actions
from tupa.features.dense_features import DenseFeatureExtractor
from tupa.features.sparse_features import SparseFeatureExtractor
fro... | danielhers/tupa | tests/test_features.py | Python | gpl-3.0 | 5,494 |
"""Compatibility fixes for older version of python, numpy and scipy
If you add content to this file, please give the version of the package
at which the fixe is no longer needed.
"""
# Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# ... | lesteve/scikit-learn | sklearn/utils/fixes.py | Python | bsd-3-clause | 9,201 |
#!/bin/env python3
import argparse
import esprima
import json
import os
import re
import sys
def get_req_body_elems(obj, elems):
if obj.type == 'FunctionExpression':
get_req_body_elems(obj.body, elems)
elif obj.type == 'BlockStatement':
for s in obj.body:
get_req_body_elems(s, ele... | libreboard/libreboard | openapi/generate_openapi.py | Python | mit | 32,085 |
import glob
import json
import os
from collections import OrderedDict
from functools import lru_cache, wraps
from itertools import chain
from mwapi import Session
from html import escape
import uglipyjs
from flask import current_app, request
from ..i18n import i18n
from ..util.wikimedia import host_from_dbname
from .... | wiki-ai/wikilabels | wikilabels/wsgi/util.py | Python | mit | 5,467 |
# -*- coding: utf-8 -*-
#
# django-vote documentation build configuration file, created by
# sphinx-quickstart on Mon Jul 7 17:06:24 2014.
#
# 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.
#... | hwbuluo/django-vote | docs/conf.py | Python | bsd-2-clause | 8,957 |
import cherrypy
from model.Note import Note
from model.Notebook import Notebook
from model.User import User
from Test_controller import Test_controller
class Test_root( Test_controller ):
def setUp( self ):
Test_controller.setUp( self )
self.notebook = Notebook.create( self.database.next_id( Notebook ), u"... | osborne6/luminotes | controller/test/Test_root.py | Python | gpl-3.0 | 16,962 |
'''
Created on 2015年12月1日
https://leetcode.com/problems/flatten-binary-tree-to-linked-list/
@author: Darren
'''
class BTNode(object):
def __init__(self,value):
self.left=None
self.right=None
self.value=value
def __repr__(self):
return str(self.value)
class Solution(object):
... | darrencheng0817/AlgorithmLearning | Python/interview/practiceTwice/BinaryTree2LinkedList.py | Python | mit | 814 |
# -*- coding: utf-8 -*-
# Copyright (c) 2018 Alexander Ezquevo <alexander@acysos.com>
# Copyright (c) 2018 Ignacio Ibeas Izquierdo <ignacio@acysos.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields
class res_company(models.Model):
_inherit = 'res.company'
pay... | acysos/odoo-addons | account_payroll_import_base/models/company.py | Python | agpl-3.0 | 616 |
from __future__ import print_function, absolute_import
from .pip import Pip
from .pip3 import Pip3
from .pip_pypy import PipPypy
from .apt import Apt
from .bower import Bower
from .npm import Npm
from .npmg import NpmG
from .yarn import Yarn
from .yarng import YarnG
from .tsd import Tsd
from .typings import Typings
fr... | Captricity/cappa | cappa/factory.py | Python | mit | 1,186 |
import xml.etree.ElementTree as ET
# #############
# XML related helper functions
def nspace(element_name, mask=False):
name_space = '''http://www.collada.org/2005/11/COLLADASchema'''
if mask:
return '{{' + name_space + '}}' + element_name
else:
return '{' + name_space + '}' + element_nam... | grungypolygon/posertools-daesupplement | GrungyPolygon/collada.py | Python | apache-2.0 | 7,974 |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | aselle/tensorflow | tensorflow/contrib/gan/python/estimator/python/gan_estimator_impl.py | Python | apache-2.0 | 13,972 |
import unittest
from troposphere import Ref
from troposphere.cloudformation import WaitCondition, WaitConditionHandle
from troposphere.policies import CreationPolicy, ResourceSignal
class TestWaitCondition(unittest.TestCase):
def test_CreationPolicy(self):
w = WaitCondition(
"mycondition",
... | pas256/troposphere | tests/test_cloudformation.py | Python | bsd-2-clause | 1,087 |
# Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from django.conf import settings
from memcached_clients import RestclientPymemcacheClient
class IDCardPhotoCache(RestclientPymemcacheClient):
def get_cache_expiration_time(self, service, url, status=None):
if 'pws' == ... | uw-it-aca/course-roster-lti | course_roster/cache.py | Python | apache-2.0 | 399 |
# -*- coding: utf-8 -*-
class Constraint(object):
"""
A Constraint check if all vars into list_vars validate a specific function
Basic Constraint use a user-defined function
"""
def __init__(self, list_vars, function=None):
self.list_vars = list_vars
self.coeff_count = 1
s... | marienfressinaud/AI_Puzzle-Solver | PuzzleSolver/LocalSearchGames/constraints.py | Python | mit | 1,430 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class WebsiteConfigSettings(models.TransientModel):
_name = 'website.config.settings'
_inherit = 'res.config.settings'
def _default_website(self):
return self.env['... | kosgroup/odoo | addons/website/models/res_config.py | Python | gpl-3.0 | 2,870 |
import legume
import time
import random
from openps.shared.message import ServerMessage
from openps.shared.message import ServerCommand
from openps.shared.message import PlayerMessage
class ServerRoom:
def __init__(self):
self.peers = []
class Server:
PORT = 29050
def __init__(self):
self.peersState... | Bramas/OpenPS | Server.py | Python | gpl-3.0 | 3,789 |
import sys
import datetime
import csv
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from django.utils import timezone
from radio.models import *
from django.db.utils import IntegrityError
class Command(BaseCommand):
help = 'Import talkgroup info'
def add_a... | ScanOC/trunk-player | radio/management/commands/import_talkgroups.py | Python | mit | 5,097 |
from math import *
from simplesvg import *
from copy import copy
################## A #####################
class Turtle:
def __init__(self, filename, size=(200, 200), startx=0, starty=0):
self.x = startx
self.y = starty
self.alfa = 0
self.pts = [(self.x, self.y)]
self.dwg = make_drawing(filename=filename, ... | j3rgus/assignments | math toys/hw3.py | Python | gpl-3.0 | 2,896 |
import json
import logging
from functools import lru_cache
import pyvat
from django.conf import settings
from django.contrib import auth
from django.core import exceptions as django_exceptions
from django.core.validators import RegexValidator
from django.db import models as django_models
from django.db import transact... | opennode/waldur-mastermind | src/waldur_core/structure/serializers.py | Python | mit | 47,633 |
import click
from alembic import command as alembic_command
from alembic.util import CommandError
from boiler.cli.colors import *
from boiler.feature.orm import db
from boiler import bootstrap
def get_config():
"""
Prepare and return alembic config
These configurations used to live in alembic config init... | projectshift/shift-boiler | boiler/cli/db.py | Python | mit | 8,383 |
__author__ = 'JunSong<songjun54cm@gmail.com>'
from BasicEvaluator import BasicEvaluator
import numpy as np
class CategoricalEvaluator(BasicEvaluator):
def __init__(self):
super(CategoricalEvaluator, self).__init__()
def categorical_accuracy(self, gth, pred):
return np.mean(np.equal(np.argmax(... | songjun54cm/ml_idiot | evaluator/CategoricalEvaluator.py | Python | gpl-3.0 | 391 |
# $Id$
#
# Copyright (C) 2004-2008 greg Landrum and Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
from __future__ impor... | adalke/rdkit | rdkit/Chem/Pharm3D/UnitTestEmbed.py | Python | bsd-3-clause | 10,229 |
from __future__ import absolute_import
input_name = '../examples/linear_elasticity/linear_elastic_up.py'
output_name = 'test_linear_elastic_up.vtk'
from tests_basic import TestInput
class Test( TestInput ):
pass
| rc/sfepy | tests/test_input_linear_elastic_up.py | Python | bsd-3-clause | 217 |
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | jvrsantacruz/XlsxWriter | xlsxwriter/test/comparison/test_chart_chartarea02.py | Python | bsd-2-clause | 1,825 |
import os
sub import_value(var_name):
return os.environ[var_name]
| Pcolar/OCR-Parser | _scripts/import_shell_values.py | Python | mit | 70 |
# Requires sci-kit learn and matplotlib
import matplotlib.pyplot as pyplot
from sklearn import datasets
from sklearn import svm
digits = datasets.load_digits()
#Gamma breaks when greater than 0.01. Maintains high accuracy at 0.001
clf = svm.SVC(gamma=0.001, C=100)
x,y = digits.data[:-1], digits.target[:-1]
clf.fit... | FrizzBolt/machine-learning-sandbox | num-prediction.py | Python | mit | 537 |
# -*- coding: utf-8 -*-
#
# SelfTest/Hash/common.py: Common code for Crypto.SelfTest.Hash
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedicat... | ktan2020/legacy-automation | win/Lib/site-packages/Crypto/SelfTest/Cipher/common.py | Python | mit | 16,599 |
"""Russian-specific forms helpers."""
from __future__ import unicode_literals
import re
from django.forms.fields import RegexField, Select
from django.utils.translation import ugettext_lazy as _
from .ru_regions import RU_COUNTY_CHOICES, RU_REGIONS_CHOICES
phone_digits_re = re.compile(r'^(?:[78]-?)?(\d{3})[-\.]?(\d... | thor/django-localflavor | localflavor/ru/forms.py | Python | bsd-3-clause | 2,285 |
# -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
pipe2py.twisted.collections
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provides methods for creating asynchronous pipe2py pipes
"""
from pipe2py.modules.pipeforever import asyncPipeForever
from pipe2py.lib.collections import PyPipe
class AsyncPipe(PyPipe):
"""... | klyap/pipe2py | pipe2py/twisted/collections.py | Python | gpl-2.0 | 901 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2012-2015 Nigel Small
#
# 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 ... | nigelsmall/httpstream | setup.py | Python | apache-2.0 | 1,865 |
# System built-in modules
import time
from datetime import datetime
import sys
import os
from multiprocessing import Pool
# Project dependency modules
import pandas as pd
pd.set_option('mode.chained_assignment', None) # block warnings due to DataFrame value assignment
import lasagne
# Project modules
sys.path.append('... | zaxliu/deepnap | experiments/kdd-exps/experiment_message_2016-6-12_G5_BUF2_AR1_b35_legacy.py | Python | bsd-3-clause | 4,374 |
# -*- coding: utf8 -*-
__version__ = "$Revision$ $Date$"
__author__ = "Guillaume Bour <guillaume@bour.cc>"
__license__ = """
Copyright (C) 2010-2011, Guillaume Bour <guillaume@bour.cc>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License a... | gbour/Strawberry | strawberry/tag.py | Python | agpl-3.0 | 3,892 |
import random
import threading
import uuid
import socket
import pexpect
from pandaharvester.harvestercore import core_utils
# logger
baseLogger = core_utils.setup_logger('ssh_tunnel_pool')
# Pool of SSH tunnels
class SshTunnelPool(object):
# constructor
def __init__(self):
self.lock = threading.Lo... | dougbenjamin/panda-harvester | pandaharvester/harvestermiddleware/ssh_tunnel_pool.py | Python | apache-2.0 | 6,619 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from thepaper.util import judge_news_crawl
__author__ = 'yinzishao'
import re
import scrapy
from bs4 import BeautifulSoup
import logging
from thepaper.items import NewsItem
import json
logger = logging.getLogger("CyzoneSpider")
from thepaper.settings import *
class CyzoneSp... | kll334477/NewsScrapy | thepaper/thepaper/spiders/cyzone_spider.py | Python | lgpl-3.0 | 6,723 |
"""Initial revision
Revision ID: d322f7ece4cd
Revises:
Create Date: 2017-09-25 14:27:15.990400
"""
# revision identifiers, used by Alembic.
revision = 'd322f7ece4cd'
down_revision = None
branch_labels = ('tickets',)
depends_on = '16be1c0cddd0'
from alembic import op
import sqlalchemy as sa
from sqlalchemy import F... | unikmhz/npui | netprofile_tickets/migrations/d322f7ece4cd_initial_revision.py | Python | agpl-3.0 | 30,296 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-09-16 10:46
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('organization_network', '0010_personactivity_weeks'),
]
... | Ircam-Web/mezzanine-organization | organization/network/migrations/0011_auto_20160916_1246.py | Python | agpl-3.0 | 800 |
# Based on cage v1.1.4
# http://www.alcyone.com/software/cage/
# Copyright (C) 2002-2006 Erik Max Francis <max@alcyone.com>
# GPL License
class Topology:
"""Encaptulation of the shape and dimentionality of a cellular automata"""
def get(self, address):
raise NotImplementedError
def se... | wichovw/tca-gt | server/tca/cellaut.py | Python | mit | 2,703 |
from couchpotato.core.downloaders.base import Downloader, ReleaseDownloadList
from couchpotato.core.helpers.encoding import tryUrlencode, ss, sp
from couchpotato.core.helpers.variable import cleanHost, mergeDicts
from couchpotato.core.logger import CPLog
from couchpotato.environment import Env
from datetime import time... | hamiltont/CouchPotatoServer | couchpotato/core/downloaders/sabnzbd/main.py | Python | gpl-3.0 | 6,237 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.