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 *
from django.conf import settings
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# django-flags for internationalization
(r'^lang/', include('sampleproject.flags.urls')),
# FOR DEBUG AND TES... | mikewolfli/django-goflow | sampleproject/urls.py | Python | bsd-3-clause | 1,453 |
# 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
# d... | dtroyer/python-openstackclient | openstackclient/tests/functional/image/v2/test_image.py | Python | apache-2.0 | 8,089 |
# coding=utf-8
# python imports
from __future__ import unicode_literals, print_function
class ArdyNoFileError(Exception):
pass
class ArdyNoDirError(Exception):
pass
class ArdyLambdaNotExistsError(Exception):
pass
class ArdyEnvironmentNotExistsError(Exception):
pass
class ArdyAwsError(Exception... | avara1986/ardy | ardy/core/exceptions.py | Python | apache-2.0 | 432 |
import hashlib
import json
import os
import posixpath
import re
from urllib.parse import unquote, urldefrag, urlsplit, urlunsplit
from django.conf import settings
from django.contrib.staticfiles.utils import check_settings, matches_patterns
from django.core.exceptions import ImproperlyConfigured
from django.core.files... | atul-bhouraskar/django | django/contrib/staticfiles/storage.py | Python | bsd-3-clause | 19,243 |
# -*- coding: utf-8 -*-
import os
import time
import re
import urllib
import cookielib
import pycurl
from BeautifulSoup import BeautifulSoup
import logging
from http import http
class vodafone(http):
"""
"""
def __init__(self, config={}):
"""
Setup class, takes in a config for our settings
"""
http.__init_... | d-fens/smspie | smspie/providers/vodafone.py | Python | mit | 4,847 |
#!/usr/bin/python
#coding:utf-8
s = """
--------------------------------------------
- lambda 语法格式
- lambda arg1, arg2, arg3, ... argN : expression using args
--------------------------------------------
"""
print s.decode('utf-8')
f = lambda x,y,z : x+y+z
print f(1,2,3)
L = [
lambda x : x ** 2,
lambda x :... | gensmusic/test | l/python/book/learning-python/c19/p-lambda.py | Python | gpl-2.0 | 813 |
"""
Tests for our mock_open helper
"""
import errno
import logging
import textwrap
import salt.utils.data
import salt.utils.files
import salt.utils.stringutils
from tests.support.mock import mock_open, patch
from tests.support.unit import TestCase
log = logging.getLogger(__name__)
class MockOpenMixin:
def _get... | saltstack/salt | tests/unit/test_mock.py | Python | apache-2.0 | 30,867 |
#!/usr/bin/python
# Copyright 2015 Seth VanHeulen
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is... | mhvuze/mhff | n3ds/arcc.py | Python | gpl-3.0 | 2,015 |
import os
import re
import time
from functools import total_ordering
from http.client import BadStatusLine
from importlib import import_module
from pathlib import Path
from typing import Callable, Dict, Iterable, List, Optional, Union
from urllib.error import HTTPError, URLError
import loguru
import pkg_resources
from... | malkavi/Flexget | flexget/plugin.py | Python | mit | 22,803 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Song.album_art'
db.add_column('djpandora_song', 'album_art', self.gf('django.db.models.fie... | f4nt/djpandora | djpandora/migrations/0012_auto__add_field_song_album_art.py | Python | bsd-3-clause | 6,939 |
import pandas as pd
from . import cytoscapejs as cyjs
def from_dataframe(df, source_col='source', target_col='target', interaction_col='interaction',
name='From DataFrame', edge_attr_cols=[]):
"""
Utility to convert Pandas DataFrame object into Cytoscape.js JSON
:param df:
:param s... | scholer/py2cytoscape | py2cytoscape/util/dataframe.py | Python | mit | 2,033 |
# Copyright 2015 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... | jeffzheng1/tensorflow | tensorflow/contrib/framework/python/ops/variables.py | Python | apache-2.0 | 22,139 |
from __future__ import unicode_literals
import datetime
from django.db import models
from django.utils.translation import ugettext_lazy as _
try:
from django.utils.timezone import now
except ImportError: # Django < 1.4
now = datetime.datetime.now
class Timeline(models.Model):
"A series of milestones wh... | caktus/rapidsms-appointments | appointments/models.py | Python | bsd-3-clause | 4,145 |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | kilon/sverchok | nodes/vector/move.py | Python | gpl-3.0 | 3,946 |
# Authors:
# Petr Viktorin <[email protected]>
#
# Copyright (C) 2013 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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 ... | tbabej/freeipa | ipatests/test_integration/base.py | Python | gpl-3.0 | 2,622 |
# -*- coding: utf-8 -*-
# Copyright 2014 -2017 Alex Comba - Agile Business Group
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import models
| ddico/sale-workflow | sale_line_price_properties_based/__init__.py | Python | agpl-3.0 | 172 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright (c) 2011 Piston Cloud Computing, Inc
# Copyrig... | plumgrid/plumgrid-nova | nova/virt/libvirt/utils.py | Python | apache-2.0 | 20,958 |
def build_partial(text):
length = len(text)
pi = [0 for c in text]
for base in range(1, length):
for i in range(length-base):
if text[base+i] != text[i]:
break
else:
pi[base+i] = max(pi[base+i], i+1)
return pi
def kmp(full, text):
re... | everyevery/programming_study | jmbook/p647_kmp.py | Python | mit | 845 |
# Generic tests that all raw classes should run
from numpy.testing import assert_allclose
def _test_concat(reader, *args):
"""Test concatenation of raw classes that allow not preloading"""
data = None
for preload in (True, False):
raw1 = reader(*args, preload=preload)
raw2 = reader(*args, ... | Odingod/mne-python | mne/io/tests/test_raw.py | Python | bsd-3-clause | 1,182 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
from django.test import RequestFactory, TestCase, override_settings
from bedrock.base.geo import get_country_from_requ... | mozilla/bedrock | bedrock/base/tests/test_geo.py | Python | mpl-2.0 | 2,272 |
# -*- coding: utf-8 -*-
import os
import tarfile
import logging
import subprocess
from pyspark import SparkFiles
"""
Name of the Conda environment to be used for the installation
"""
CONDA_ENV_NAME = None
"""
Location of the Conda environment on the driver node to be used for the installation
"""
CONDA_ENV_LOCATION ... | moutai/sparkonda | sparkonda/sparkonda_utils.py | Python | isc | 5,695 |
"""
This page is in the table of contents.
Plugin to home the tool at beginning of each layer.
The home manual page is at:
http://fabmetheus.crsndoo.com/wiki/index.php/Skeinforge_Home
==Operation==
The default 'Activate Home' checkbox is on. When it is on, the functions described below will work, when it is off, not... | nophead/Skeinforge50plus | skeinforge_application/skeinforge_plugins/craft_plugins/home.py | Python | agpl-3.0 | 8,025 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2015 <+YOU OR YOUR COMPANY+>.
#
# This 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, or (at your option)
# any later version.
#... | ClydeSpace-GroundStation/GroundStation | GNURadio/OOT_Modules/gr-ccsds/python/qa_asm_deframer.py | Python | mit | 2,113 |
"""Subclass of MainFrame, which is generated by wxFormBuilder."""
'''
@summary: Crypter: GUI Class
@author: MLS
'''
# Import libs
import os
import time
import webbrowser
import wx
from pubsub import pub
from threading import Thread, Event
# Import Package Libs
from . import Base
from .GuiAbsBase import EnterDecryptio... | sithis993/Crypter | Crypter/Crypter/Gui.py | Python | gpl-3.0 | 20,282 |
from coded_exceptions import CodedException
class YawfException(CodedException):
pass
class WorkflowNotLoadedError(YawfException):
pass
class WorkflowAlreadyRegisteredError(YawfException):
pass
class OldStateInconsistenceError(YawfException):
pass
class IllegalStateError(YawfException):
pa... | freevoid/yawf | yawf/exceptions.py | Python | mit | 1,413 |
from __future__ import print_function
from BinPy.Combinational.combinational import *
""" Examples for Decoder class """
print ("\n---Initializing the Decoder class--- ")
print ("mux = Decoder(0, 1)")
decoder = Decoder(0, 1)
print ("\n---Output of decoder")
print ("decoder.output()")
print (decoder.output())
print ("\n... | coder006/BinPy | BinPy/examples/Combinational/Decoder.py | Python | bsd-3-clause | 1,425 |
import numpy
import chainer
from chainer import testing
import chainer.training.updaters.multiprocess_parallel_updater as mpu
class SimpleNetRawArray(chainer.Chain):
def __init__(self):
super(SimpleNetRawArray, self).__init__()
with self.init_scope():
self.conv = chainer.links.Convol... | anaruse/chainer | tests/chainer_tests/training_tests/updaters_tests/snippets/raw_array.py | Python | mit | 1,667 |
#!/usr/bin/python -tt
# -*- coding: utf-8 -*-
# (c) 2012, Red Hat, Inc
# Written by Seth Vidal <skvidal at fedoraproject.org>
# (c) 2014, Epic Games, 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 publi... | quinot/ansible-modules-core | packaging/os/yum.py | Python | gpl-3.0 | 38,031 |
from guardian.core import ObjectPermissionChecker
from django.contrib.contenttypes.models import ContentType
from django.db.models import Q
from rest_framework import generics, permissions as drf_permissions
from rest_framework.exceptions import ValidationError, PermissionDenied
from framework.auth.oauth_scopes import... | pattisdr/osf.io | api/collections/views.py | Python | apache-2.0 | 37,373 |
import pickle
import pytest
from features.bases import FeatureSet
def test_pickle_base(fs):
base = pickle.loads(pickle.dumps(fs.FeatureSet.__base__))
assert base is fs.FeatureSet.__base__
def test_pickle_class(fs):
cls = pickle.loads(pickle.dumps(fs.FeatureSet))
assert cls is fs.FeatureSet
def t... | xflr6/features | tests/test_bases.py | Python | mit | 2,657 |
# 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 requ... | waltBB/neutron_read | neutron/tests/unit/test_dhcp_agent.py | Python | apache-2.0 | 69,240 |
#! /usr/bin/env python
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | firebase/firebase-ios-sdk | FirebaseMessaging/ProtoSupport/proto_generator.py | Python | apache-2.0 | 9,000 |
# -*- coding: utf-8 -*-
from django.conf.urls import url
from apps.api.utils import SharedAPIRootRouter
from apps.authentication import views
from apps.authentication.api import views as api_views
urlpatterns = [
url(r'^login/$', views.login, name='auth_login'),
url(r'^logout/$', views.logout, name='auth_log... | dotKom/onlineweb4 | apps/authentication/urls.py | Python | mit | 722 |
# 10. Regular Expression Matching My Submissions QuestionEditorial Solution
# Total Accepted: 81042 Total Submissions: 366383 Difficulty: Hard
# Implement regular expression matching with support for '.' and '*'.
#
# '.' Matches any single character.
# '*' Matches zero or more of the preceding element.
#
# The matchi... | shawncaojob/LC | PY/10_regular_expression_matching.py | Python | gpl-3.0 | 4,618 |
import glob
import subprocess
import os
# Process all snippets in the current directory
for f in glob.glob("pytex_*.py"):
logfilename = f[:-3]+'.log'
logfile = file(logfilename,'w')
# Execute snippet
p = subprocess.Popen(['python',f],stdout=logfile)
p.wait()
logfile = file(logfilename,'r')
outfi... | jgillis/casadi | documentation/users_guide/pytex.py | Python | lgpl-3.0 | 903 |
from urllib.parse import urlparse, parse_qsl
from oic.oic.message import AuthorizationRequest
from pyop.exceptions import InvalidAuthenticationRequest
class TestInvalidAuthenticationRequest:
def test_error_url_should_contain_state_from_authentication_request(self):
authn_params = {'redirect_uri': 'test_... | its-dirg/pyop | tests/pyop/test_exceptions.py | Python | apache-2.0 | 1,033 |
from pylaas_core.abstract.abstract_service import AbstractService
class DummyAdapter(AbstractService):
pass
| Agi-dev/pylaas_core | tests/fixtures/data_sets/service/dummy_adapter/dummy_adapter.py | Python | mit | 114 |
import re
def anti_vowel(text):
newtext = re.sub('[AEIOUaeiou]', '', text)
print newtext
anti_vowel("Hey Look Words!")
anti_vowel("THE QUICK BROWN FOX SLYLY JUMPED OVER THE LAZY DOG") | voiceofrae/Python | antivowel.py | Python | mit | 201 |
from .factory import Factory | qiuxiang/pydoubanfm | doubanfm/server/__init__.py | Python | mit | 28 |
#!/usr/bin/env python2
from argparse import ArgumentParser
from analyzer import best
from config import Config
from plan import Plan
from glob import glob
from json import dump
def single(planfile, configfile):
plan, config = Plan.parse(planfile), Config.parse(configfile)
distplan = best(plan, config)
cos... | enricobacis/pg-distopt | distopt/main.py | Python | mit | 1,810 |
#!/usr/bin/python3
# coding: utf-8
'''
Parse and draw results of item_response_theory.py
'''
from collections import namedtuple
import sys
import matplotlib.pyplot as plt
import numpy as np
import pandas
import pickle
DEFAULT_INPUT_FILENAME = 'images/summary.csv'
class QuestionAndAbilityResult(objec... | zettsu-t/cPlusPlusFriend | scripts/stock_price/item_response_theory_result.py | Python | mit | 2,699 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-03-18 13:32
from __future__ import unicode_literals
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
migration... | rg3915/spark | spark/authentication/migrations/0001_initial.py | Python | mit | 1,081 |
# -*- coding: utf-8 -*-
import os
def strongly_connected_components_path(vertices, edges):
"""
Find the strongly connected components of a directed graph.
Uses a recursive linear-time algorithm described by Gabow [1]_ to find all
strongly connected components of a directed graph.
Parameters
... | NicovincX2/Python-3.5 | Algorithmique/Algorithme/Algorithme de la théorie des graphes/strongly_connected_components_directed_graph.py | Python | gpl-3.0 | 9,068 |
from aiohttp import web
import socketio
sio = socketio.AsyncServer(async_mode='aiohttp')
app = web.Application()
sio.attach(app)
async def background_task():
"""Example of how to send server generated events to clients."""
count = 0
while True:
await sio.sleep(10)
count += 1
awai... | miguelgrinberg/python-socketio | examples/server/aiohttp/app.py | Python | mit | 1,967 |
import collections
import json
import os.path
import unittest
import copy
from datetime import datetime, timedelta
import boto3
import pykube
import mock
import moto
import yaml
import pytz
from autoscaler.cluster import Cluster, ClusterNodeState
from autoscaler.kube import KubePod, KubeNode
import autoscaler.utils a... | gabrieladt/kops-ec2-autoscaler | test/test_cluster.py | Python | mit | 18,964 |
import math,sys
from math import pi
def ieee754 (a):
rep = 0
#sign bit
if (a<0):
rep = 1<<31
a = math.fabs(a)
if (a >= 1):
#exponent
exp = int(math.log(a,2))
rep = rep|((exp+127)<<23)
#mantissa
temp = a / pow(2,exp) - 1
i = 22
while i>=0:
temp = temp * 2
if temp > 1:
rep = rep | (1... | ankitshah009/High-Radix-Adaptive-CORDIC | Testbench Generation code/Testbench Files/test_sin,sinh.py | Python | apache-2.0 | 3,601 |
# Copyright (C) 2014 Ivan Koster
#
# This file is part of SublimeYouCompleteMe.
#
# SublimeYouCompleteMe 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 ... | ivankoster/SublimeYouCompleteMe | plugin/utils.py | Python | gpl-3.0 | 5,373 |
from p2pool.bitcoin import networks
from p2pool.util import math
# CHAIN_LENGTH = number of shares back client keeps
# REAL_CHAIN_LENGTH = maximum number of shares back client uses to compute payout
# REAL_CHAIN_LENGTH must always be <= CHAIN_LENGTH
# REAL_CHAIN_LENGTH must be changed in sync with all other clients
# ... | qubitcoin/QubitCoin-p2pool | p2pool/networks.py | Python | gpl-3.0 | 4,358 |
# Copyright (c) 2014 https://github.com/maru/
def Merge(A, size1, size2, begin, end):
B = A[begin : begin+size1]
C = A[begin+size1 :end]
num_inv = 0
j = 0
k = 0
for i in xrange(begin, end):
if j < size1 and (k >= size2 or B[j] <= C[k]):
A[i] = B[j]
j += 1
... | maru/algo-wallhack | algo1/prog1/prog1.py | Python | mit | 2,480 |
from copy import deepcopy
from werkzeug.datastructures import MultiDict
DEFAULT_FIELDS = ['title', 'name', 'extension', 'collection',
'id', 'updated_at', 'slug', 'source_url', 'source',
'summary']
QUERY_FIELDS = ['title', 'source_url', 'summary', 'extension', 'mime_type',
... | nightsh/aleph | aleph/search/queries.py | Python | mit | 5,648 |
def end_other(a,b):
x = len(a)
y = len(b)
if x < y:
if b[-x:] == a:
return True
if y < x:
if a[-y:] == b:
return True
return False
# if x < y and b[-x:] == a:
# return True
#elif y < x and a[-y:] == b:
# return True
#return False
pr... | yadavpooja/practice | level1/end_other.py | Python | gpl-3.0 | 417 |
import density_sim as ds
molecule_name = 'dmso'
num = 200
steps = 500000
ff_mod = True
ds.caseFromPDB(molecule_name, num, steps, ff_mod)
| choderalab/density | dmso/dmso_density_ffmod.py | Python | gpl-2.0 | 139 |
'''
The MIT License (MIT)
Copyright (c) 2015 Dan Gunter
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, p... | dgunter/scapytojson | examples/basic_sniff.py | Python | mit | 1,348 |
import operator
import numpy as np
from shared import config
from shared.indexes import Index
from shared import functions
class ReadDataFile:
def __init__(self, _type, first_n_items=20, echo=True):
self._dict = dict()
f = open(config.task_dataset_path + _type + '.txt', 'r')
lines = f.rea... | matifq/eve | src/sorting_relevant_items_first_task.py | Python | mit | 18,189 |
''' Data model and factory implementations that are backed by Amazon Web Service's DynamoDB2 NoSQL database '''
from boto.dynamodb2.table import Table
from time import strftime, strptime
from smcity.misc.errors import CreateError, ReadError
from smcity.misc.logger import Logger
from smcity.models.data import Data, Da... | ChaseSnapshot/smcity | smcity/models/aws/aws_data.py | Python | unlicense | 6,158 |
# Authors: Rob Zinkov, Mathieu Blondel
# License: BSD 3 clause
from ..utils.validation import _deprecate_positional_args
from ._stochastic_gradient import BaseSGDClassifier
from ._stochastic_gradient import BaseSGDRegressor
from ._stochastic_gradient import DEFAULT_EPSILON
class PassiveAggressiveClassifier(BaseSGDCl... | bnaul/scikit-learn | sklearn/linear_model/_passive_aggressive.py | Python | bsd-3-clause | 17,377 |
#!/usr/bin/env python
# coding=utf-8
from django.contrib import admin
from common.models import *
RegisterClass = (
CoursePlan,
Course,
SelectCourse,
Score,
PracticeClassPractice,
Homework,
HomeworkSubmit,
SmallClassPractice,
)
for item in RegisterClass:
admin.site.register(item)
| EducationAdministrationSystem/EducationSystem | common/admin.py | Python | agpl-3.0 | 320 |
# -*- coding: utf-8 -*-
"""drive_pot_fr
Drive the landlab potentiality flow routing component.
Created on Wed Mar 4 2015
@author: danhobley
"""
from __future__ import print_function
from landlab import RasterModelGrid, ModelParameterDictionary
from landlab.plot.imshow import imshow_node_grid
import numpy as np
from... | decvalts/landlab | landlab/components/potentiality_flowrouting/examples/drive_pot_fr_coupled2.py | Python | mit | 3,187 |
'''
James D. Zoll
4/2/2013
Purpose: Defines URL rules for the RSS application
License: This is a public work.
'''
# Library Imports
from django.conf.urls import patterns, url
# Setup the list views and generic views.
urlpatterns = patterns('rss.views',
url(r'^$', 'index'),
... | Zerack/zoll.me | rss/urls.py | Python | mit | 406 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#-----------------------------------------------------------
# basic linTML RPC client
#-----------------------------------------------------------
import tml
import tml.core
import tml.command
import sys
PY3 = sys.version > '3'
PY2 = sys.version < '3'
def progress_handler... | tml21/libtml-python | examples/introduction-01/tml_rpc_client_01.py | Python | lgpl-2.1 | 1,085 |
import os
fd=open("start.sh","w+")
path =os.getcwd()
f=[]
for file1 in os.listdir(path+"/JVcode/Scripts/ForClassification"):
if file1.endswith(".tab.scores"):
f.append(file1[:-11])
path=path[:-10]
print path
for i in os.listdir(path+"uploads"):
if i.endswith(".pdf"):
if i[:-4] not in f:
... | ramaganapathy1/AMuDA-Ir-back-end | production/intial.py | Python | mit | 510 |
#coding=utf8
'''
Created on 2012-9-19
@author: senon
'''
from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('content.views',
url(r'^content_following/', 'getFriendsProfile', {'page':'following'}),
url(r'^personal/(?P<profile_id>\S+)/', 'personal_index'),
#目录页
url(r'^... | xlk521/cloudguantou | content/urls.py | Python | bsd-3-clause | 786 |
# generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []
PROJECT_NAME = "simulation"
PROJECT_SPACE_DIR = "/hom... | TobiasLundby/UAST | Module6/build/simulation/catkin_generated/pkg.develspace.context.pc.py | Python | bsd-3-clause | 377 |
# Copyright 2014, Rackspace, US, 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 to in w... | dan1/horizon-proto | openstack_dashboard/api/rest/keystone.py | Python | apache-2.0 | 18,340 |
import unittest
from robotide.editor.tags import TagsDisplay
from controller.controller_creator import testcase_controller as tc
from robot.utils.asserts import assert_equals
from robotide.controller.tags import Tag
class _PartialTagsDisplay(TagsDisplay):
def __init__(self, controller):
self._tag_boxes = ... | caio2k/RIDE | utest/editor/test_tags.py | Python | apache-2.0 | 1,948 |
"""Core PixyWerk functionality."""
from .utils import response, sanitize_path
import mimetypes
mimetypes.init()
import os
import re
from jinja2 import Environment, FileSystemLoader
import time
import logging
log = logging.getLogger('pixywerk.werk')
MARKDOWN_SUPPORT = False
BBCODE_SUPPORT = False
SCSS_SUPPORT = False... | chaomodus/pixywerk | pixywerk/werk.py | Python | mit | 12,479 |
MAX_BUFFER = 65535
| jumpojoy/netmiko | netmiko/netmiko_globals.py | Python | mit | 20 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('pokepy', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='pokemon',
name='abilitie... | locolan/pokepy | pokepy/migrations/0002_auto_20150503_0002.py | Python | mit | 1,743 |
from twisted.trial import unittest
from opennsa import constants as cnt, error, nsa, provreg
class TestProviderRegistry(unittest.TestCase):
def setUp(self):
self.pr = provreg.ProviderRegistry( { cnt.CS2_SERVICE_TYPE : lambda x : x } )
def testGetProvider(self):
agent = nsa.NetworkService... | NORDUnet/opennsa | test/test_provreg.py | Python | bsd-3-clause | 2,519 |
# Generated by Django 2.0.4 on 2018-04-12 15:10
from django.db import migrations, models
import django.db.models.deletion
import wagtail.core.fields
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0040_page_draft_title'),
('tests', '0029_auto_20180215_1950'),
]
... | kaedroho/wagtail | wagtail/tests/testapp/migrations/0030_formclassadditionalfieldpage.py | Python | bsd-3-clause | 911 |
# -*- coding: utf-8 -*-
# python-holidays
# ---------------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Authors: dr-prodigy <maurizio.... | dr-prodigy/python-holidays | holidays/countries/burundi.py | Python | mit | 3,935 |
# -*- coding: utf-8 -*-
from __future__ import print_function
# Form implementation generated from reading ui file 'InputChannelTemplate.ui'
#
# Created: Sun Feb 22 13:29:16 2015
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
... | meganbkratz/acq4 | acq4/devices/DAQGeneric/InputChannelTemplate.py | Python | mit | 3,321 |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Canal para VePelis
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os, sys
from core imp... | Zanzibar82/pelisalacarta | python/main-classic/channels/vepelis.py | Python | gpl-3.0 | 18,218 |
from __future__ import unicode_literals
import os
import re
from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from django.core.management import call_command
from django.db import connection, connections
from django.test import TestCase, skipUnlessDBFeature
from django.test.utils import mod... | hackerbot/DjangoDev | tests/gis_tests/inspectapp/tests.py | Python | bsd-3-clause | 7,892 |
import tensorflow as tf
class BaseGraph:
"""
A generic computation graph class, with only two constraints are
1. The requirements for net instance passed in:
- net should have method of define_net
- net should have method of get_placeholders
2. Losses can only be calculated w... | KleinYuan/cnn | core/base_graph.py | Python | mit | 2,591 |
"""
Minimal server for serving the index page and some static javascript files.
"""
import sys
import os
import yaml
from flask import Flask, Response, request, render_template
# Our App declaring the location of the static files
app = Flask(__name__, static_url_path='', static_folder='public')
# Mainly used to chec... | Tehnix/cred-web | server.py | Python | bsd-3-clause | 1,474 |
# -*- coding: utf-8 -*-
'''Setup script of DelogX.'''
import os
from setuptools import setup, find_packages
def find_package_data():
'''Get data files of DelogX.'''
cwd = os.getcwd()
path = os.path.dirname(os.path.realpath(__file__))
path = os.path.join(path, 'DelogX')
data_list = lis... | deluxghost/DelogX | setup.py | Python | lgpl-3.0 | 2,401 |
'''
'''
# 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");... | SolidWallOfCode/trafficserver | tests/gold_tests/next_hop/zzz_strategies_peer2/zzz_strategies_peer2.test.py | Python | apache-2.0 | 6,471 |
"""
This module provides a class for principal components analysis (PCA).
PCA is an orthonormal, linear transform (i.e., a rotation) that maps the
data to a new coordinate system such that the maximal variability of the
data lies on the first coordinate (or the first principal component), the
second greatest variabili... | yarikoptic/NiPy-OLD | nipy/modalities/fmri/pca.py | Python | bsd-3-clause | 7,770 |
#!/usr/bin/python
"""
Step file creator/editor.
:copyright: Red Hat Inc 2009
:author: [email protected] (Michael Goldish)
@version: "20090401"
"""
import pygtk
import gtk
import os
import glob
import shutil
import sys
import logging
import ppm_utils
pygtk.require('2.0')
# General utilities
def corner_and_size_cl... | ypu/virt-test | virttest/step_editor.py | Python | gpl-2.0 | 50,742 |
from pathlib import Path
from PySide2 import QtCore
import FreeCADGui as Gui
from db import ostanha
class CivilToolsSettings:
def GetResources(self):
menu_text = QtCore.QT_TRANSLATE_NOOP(
"civil_settings",
"Settings")
tooltip = QtCore.QT_TRANSLATE_NOOP(
"c... | ebrahimraeyat/civilTools | gui_civiltools/gui_civiltools_settings.py | Python | gpl-3.0 | 990 |
#! /usr/bin/env python
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Wen Shan Chang
#
# 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... | wschang/RunCmd | tests/test_runcmd.py | Python | mit | 8,021 |
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Copyright (c) 2014-2017 The Flowercoin Core developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Helpful routines for regression testing
#
# Add python-bitcoi... | dmrtsvetkov/flowercoin | qa/rpc-tests/test_framework/util.py | Python | mit | 21,676 |
# Copyright: (c) 2018, Pluribus Networks
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn... | tersmitten/ansible | test/units/modules/network/netvisor/test_pn_user.py | Python | gpl-3.0 | 2,973 |
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
# Examples:
# url(r'^$', 'lesson04.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
]
| cmoynier/lesson04 | lesson04/urls.py | Python | gpl-2.0 | 256 |
#!/usr/bin/env python
# Test whether a connection is denied if it provides just a username when it
# needs a username and password.
import subprocess
import socket
import time
import inspect, os, sys
# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder
cmd_subfolder = os.path.realpat... | telefonicaid/fiware-IoTAgent-Cplusplus | third_party/mosquitto-1.4.4/test/broker/01-connect-uname-no-password-denied.py | Python | agpl-3.0 | 987 |
#!/usr/bin/env python
# vim: sw=4:ts=4:sts=4:fdm=indent:fdl=0:
# -*- coding: UTF8 -*-
#
# A module to handle the playback of module music using mikmod.
# Copyright (C) 2012 Josiah Gordon <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General ... | zepto/musio | utils/mikmod_test/mikmod_file.clang2py.py | Python | gpl-3.0 | 10,161 |
def foo(self):
x = 1
y = 2
<caret>
z = 3 | idea4bsd/idea4bsd | python/testData/copyPaste/multiLine/IndentInnerFunction2.dst.py | Python | apache-2.0 | 55 |
from pytz import utc
from datetime import datetime, timedelta
from model.Persistent import Persistent, quote
class Test_persistent( object ):
def setUp( self ):
self.object_id = "17"
self.obj = Persistent( self.object_id )
self.delta = timedelta( seconds = 1 )
def test_create( self ):
assert self... | osborne6/luminotes | model/test/Test_persistent.py | Python | gpl-3.0 | 2,240 |
"""
Django settings for forge_tool_access project.
Generated by 'django-admin startproject' using Django 1.10.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
... | ForgeGreensboro/forge-tool-control-api | forge_tool_access/settings.py | Python | gpl-3.0 | 3,320 |
from __future__ import unicode_literals
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.test.utils import override_settings
from django.urls import reverse
from paypal.standard.ipn.models import PayPalIPN
from paypal.standard.ipn.signals import valid_ipn_received
from .tes... | spookylukey/django-paypal | paypal/standard/ipn/tests/test_admin.py | Python | mit | 2,128 |
import _plotly_utils.basevalidators
class NameValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self, plotly_name="name", parent_name="layout.updatemenu.button", **kwargs
):
super(NameValidator, self).__init__(
plotly_name=plotly_name,
parent_name=p... | plotly/plotly.py | packages/python/plotly/plotly/validators/layout/updatemenu/button/_name.py | Python | mit | 423 |
'''
Created on 26 juil. 2017
@author: worm
'''
from django.urls.base import reverse
from snapshotServer.tests.views.Test_Views import TestViews
import json
from snapshotServer.models import Snapshot
import pickle
from snapshotServer.controllers.PictureComparator import Pixel
class Test_StatusView(TestViews):
... | bhecquet/seleniumRobot-server | snapshotServer/tests/views/test_StatusView.py | Python | apache-2.0 | 2,723 |
"""Custom collapsible pane."""
import wx
import wx.lib.agw.pycollapsiblepane as pycollapse
import wx.lib.buttons as buttons
from .. import data
class CollapsiblePane(pycollapse.PyCollapsiblePane):
"""Custom collapsible pane."""
def __init__(
self, parent, id=wx.ID_ANY, label="", pos=wx.DefaultPositio... | facelessuser/Rummage | rummage/lib/gui/controls/collapsible_pane.py | Python | mit | 3,315 |
# -*- coding: utf-8 -*-
# Copyright 2017 Stein & Gabelgaard ApS
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import api, fields, models, _
class CamposMunicipality(models.Model):
_inherit = 'campos.municipality'
product_attribute_id = fields.Many2one('product.attribute.value... | sl2017/campos | campos_fee/models/campos_municipality.py | Python | agpl-3.0 | 322 |
# coding: utf-8
"""
Wavefront REST API Documentation
<p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the W... | wavefrontHQ/python-client | wavefront_api_client/models/response_container_paged_integration.py | Python | apache-2.0 | 4,833 |
from __future__ import print_function
import os
import re
import sys
import json
import warnings
import requests
from tqdm import tqdm
from utils import LogUtil
from ioutils import read_lines
from tika_parser import TikaParser
from collections import OrderedDict
# Always printing matching warnings
warnings.filterwarn... | USCDataScience/parser-indexer-py | src/parserindexer/ads_parser.py | Python | apache-2.0 | 9,870 |
import re
import logging
import datetime
import objectpath
from indra.statements import *
logger = logging.getLogger(__name__)
class EidosProcessor(object):
"""This processor extracts INDRA Statements from Eidos JSON-LD output.
Parameters
----------
json_dict : dict
A JSON dictionary contain... | pvtodorov/indra | indra/sources/eidos/processor.py | Python | bsd-2-clause | 16,649 |
#!/usr/bin/env python
import sys
import numpy as np
import json
import matplotlib.pyplot as plt
import matplotlib.animation as animation
def main():
json_data = open('moldy_argon.json')
data = json.load(json_data)
json_data.close()
num_t_steps = len(data)
num_atoms = data[0]['atoms']['num... | tommyogden/moldy-argon | plot/plot_moldy_argon.py | Python | mit | 1,728 |
from django.conf.urls import patterns, include, url
urlpatterns = patterns('jumpserver.views',
# Examples:
url(r'^$', 'index', name='index'),
# url(r'^api/user/$', 'api_user'),
url(r'^skin_config/$', 'skin_config', name='skin_config'),
url(r'^login/$', 'Login', name='login'),
url(r'^logout/$',... | llych/wenwo | jumpserver/urls.py | Python | gpl-2.0 | 952 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.