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
DEBUG = True TEMPLATE_DEBUG = DEBUG DATABASES = { "default": { # Ends with "postgresql_psycopg2", "mysql", "sqlite3" or "oracle". "ENGINE": "django.db.backends.sqlite3", # DB name or path to database file if using sqlite3. "NAME": "dev.db", # Not used with sqlite3. ...
orlenko/bccf
src/bccf/local_settings_sample.py
Python
unlicense
572
import sys import json ''' take a file and unwrap the contents to a dictionary. write the key=value terms out. The program is intended to be caled from a bash program to export the key=value pairs as environemnt variables ''' def main(argv): a = open(argv[0], 'r') b = a.readlines()[0].strip() data = jso...
kylemvz/nbhub
nopleats/readData.py
Python
apache-2.0
494
remote_server_ips = ('127.0.0.1', '127.0.0.1') remote_server_ports = (8005, 8006) assigned_server_index = 1 # in real system, client is distributed by a load balancing server in general; here I just simulate the balancing policy. process_id = 4 client_addr = ('127.0.0.1', 7004) poisson_lambda = 5 simu_len = 60 get_s...
SuperMass/distOS-lab3
src/integrated/client4/client_config.py
Python
gpl-3.0
334
#!/usr/bin/python import os, sys from emu_parse_output import * from compute_route_quality import * sys.path.append ('./emulation') # Global variables VALIDITY_GNUPLOT = './rapidnet/route-quality/validity.gnuplot' STRETCH_GNUPLOT = './rapidnet/route-quality/stretch.gnuplot' # dir: The directory where to find the out...
AliZafar120/NetworkStimulatorSPl3
rapidnet/route-quality/emu_route_quality.py
Python
gpl-2.0
3,159
# PLY package # Author: David Beazley (dave@dabeaz.com) # ----------------------------------------------------------------------------- # ply: yacc.py # # Copyright (C) 2001-2011, # David M. Beazley (Dabeaz LLC) # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification...
Teamxrtc/webrtc-streaming-node
third_party/webrtc/src/chromium/src/third_party/ply/__init__.py
Python
mit
1,797
from core.utils import * from pytg.receiver import Receiver from pytg.sender import Sender from pytg.utils import coroutine import json tgreceiver = Receiver(host="localhost", port=config.keys.tg_cli_port) tgsender = Sender(host="localhost", port=config.keys.tg_cli_port) # Telegram-CLI bindings def peer(chat_id): ...
zhantyzgz/polaris
core/wrapper/tg.py
Python
gpl-2.0
8,398
import pytest from pyethereum import tester, blocks mul2_code = \ ''' def double(v): return(v*2) ''' filename = "mul2_qwertyuioplkjhgfdsa.se" returnten_code = \ ''' extern mul2: [double] x = create("%s") return(x.double(5)) ''' % filename def test_returnten(): s = tester.state() open(filename...
joelcan/tools-eth-contract-dev
pyethereum/tests/test_serialization.py
Python
mit
521
#!/usr/bin/env python # Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may ...
Nexenta/cinder
cinder/cmd/manage.py
Python
apache-2.0
25,926
import numpy as np from numpy.linalg import norm from math import copysign class HyperEdge: @staticmethod def edge(allEdges, name, face, angle=0): if angle is None: angle = 0 if allEdges is not None: for e in allEdges: if e.name == name: e.join(face, angle=angle) ...
PRECISE/ROSLab
resources/mechanics_lib/api/graphs/hyperedge.py
Python
apache-2.0
2,917
from django.conf.urls import patterns, url urlpatterns = patterns( '', url(r'^$', 'whatify.views.index'), url(r'^search/(.+)$', 'whatify.views.search'), url(r'^torrent_groups/(\d+)$', 'whatify.views.get_torrent_group'), url(r'^torrent_groups/(\d+)/download$', 'whatify.views.download_torrent_group')...
grandmasterchef/WhatManager2
whatify/urls.py
Python
mit
531
import tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['Fisher'] , ['PolyTrend'] , ['Seasonal_Hour'] , ['SVR'] );
antoinecarme/pyaf
tests/model_control/detailed/transf_Fisher/model_control_one_enabled_Fisher_PolyTrend_Seasonal_Hour_SVR.py
Python
bsd-3-clause
153
#!/usr/bin/env python # -*- coding: utf-8 -*- # Compilation Prerequisite import distutils.version import encodings.ascii import encodings.idna import encodings.unicode_escape import tornado.websocket import tori.db.driver.mongodriver # Runtime Requirements import sys from tori.application import Application from tor...
shiroyuki/tama
server.py
Python
mit
786
from __future__ import print_function from math import pi from bokeh.client import push_session from bokeh.document import Document from bokeh.models.glyphs import Line, Quad from bokeh.models import ( Plot, ColumnDataSource, DataRange1d, FactorRange, LinearAxis, CategoricalAxis, Grid, Legend, SingleInter...
azjps/bokeh
examples/models/population_server.py
Python
bsd-3-clause
4,476
# imports/modules import os import random import json import collections from PIL import Image # Convert (r, g, b) into #rrggbb color def getRGBstring( (r, g, b) ): s = "#" s = s + format(r, '02x') s = s + format(g, '02x') s = s + format(b, '02x') return s def getFreqData(img): w, h = img.size pixels = ...
CS205IL-sp15/workbook
demo_colorFreq_endOfLecture/py/compute.py
Python
mit
1,013
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import urllib from urllib.request import Request import hmac import hashlib import base64 import datetime import sys if len(sys.argv) < 4: print('bad syntax, usage: {script_name} host bname oname') exit() host, bname, oname = sys.argv[1], sys.argv[2], sys.argv[3...
IvanJobs/play
ceph/s3/delete_object.py
Python
mit
1,734
import os import os.path from tornado.escape import xhtml_escape from pygments import highlight, util as pyg_util from pygments.lexers import get_lexer_for_filename from pygments.formatters import HtmlFormatter def preview(path, filesize, mimetype): major,minor = mimetype.split('/',1) if major not in mime_handler...
perimosocordiae/whish
backend/preview.py
Python
mit
1,990
# -*- coding: utf-8 -*- """ equip.analysis.ast ~~~~~~~~~~~~~~~~~~ Minimal, high-level AST for the Python bytecode. :copyright: (c) 2014 by Romain Gaucher (@rgaucher) :license: Apache 2, see LICENSE for more details. """ from .stmt import Statement from .expr import Expression
neuroo/equip
equip/analysis/ast/__init__.py
Python
apache-2.0
289
import unittest from django.test import TestCase from .test_backends import BackendTests class TestDBBackend(BackendTests, TestCase): backend_path = 'wagtail.wagtailsearch.backends.db.DBSearch' @unittest.expectedFailure def test_callable_indexed_field(self): super(TestDBBackend, self).test_call...
jorge-marques/wagtail
wagtail/wagtailsearch/tests/test_db_backend.py
Python
bsd-3-clause
341
""" Stories for Fimfarchive. """ # # Fimfarchive, preserves stories from Fimfiction. # Copyright (C) 2018 Joakim Soderlund # # 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 o...
JockeTF/fimfarchive
fimfarchive/stories.py
Python
gpl-3.0
3,919
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- ### BEGIN LICENSE # Copyright (C) 2012 Ralf Klammer <milkbread@freenet.de> # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published # by the Free Soft...
milkbread/MapRoj
maproj_lib/Builder.py
Python
gpl-3.0
11,391
import sqlite3 import discord_logging log = discord_logging.init_logging() import static from database import Database from classes.subscription import Subscription new_db = Database() new_db.session.query(Subscription).delete(synchronize_session='fetch') valid_authors = set() authors_file_read = open("valid_author...
Watchful1/RedditSubsBot
scripts/migrate_subscriptions.py
Python
mit
2,043
from __future__ import unicode_literals from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib import admin from .views import ProductDetailView, ProductListView, ProductVariationListView, CategoryListView, CategoryDetailView#, pdf_view...
maistrovas/Internet-Store
Internet_store/products/urls.py
Python
mit
840
import hashlib import http.server import json import os import re import shutil import socketserver import subprocess from itertools import chain from multiprocessing import Process from shutil import rmtree, which from subprocess import check_call import requests from pkgpanda.exceptions import FetchError, Validatio...
xinxian0458/dcos
pkgpanda/util.py
Python
apache-2.0
8,247
from .directory_subnav_definition import ( create_directory_subnav, delete_directory_subnav ) from .event_subnav_definition import ( create_events_subnav, delete_events_subnav ) from .home_subnav_definition import ( create_home_subnav, delete_home_subnav ) from .judging_subnav_definition import ...
masschallenge/django-accelerator
accelerator/sitetree_navigation/sub_navigation/__init__.py
Python
mit
676
#!/usr/bin/env python from flask import Config from database import NodeDB import graphPlotter def generate_graph(time_limit=60*60*3): nodes, edges = load_graph_from_db(time_limit) print '%d nodes, %d edges' % (len(nodes), len(edges)) graph = graphPlotter.position_nodes(nodes, edges) json = graphPlot...
zielmicha/fc00.org
web/updateGraph.py
Python
gpl-3.0
721
class Edge: def __init__(self, h1, h2, bw): #source node self.h1 = h1 #sink node self.h2 = h2 #bandwidth on this link self.bw = bw
AndreaLombardo90/SDN-Controller
edge.py
Python
apache-2.0
162
############################################################################### # Name: ed_menu.py # # Purpose: Editra's Menubar and Menu related classes # # Author: Cody Precord <cprecord@editra.org> ...
ktan2020/legacy-automation
win/Lib/site-packages/wx-3.0-msw/wx/tools/Editra/src/ed_menu.py
Python
mit
51,531
from evolib.formats.IteratorObjects import FastaAlignment class FastaFormat(FastaAlignment): """ Example usage: >>> from evolib.SequenceFormats import FastaFormat Example 1: >>> fileObject = open('example.fsa', 'r') >>> F = FastaFormat(fileObject) Example...
padraicc/Evolib
evolib/SequenceFormats.py
Python
mit
446
import asyncio from datetime import datetime from typing import List, Optional import aiohttp from asyncpg.pool import Pool from . import db, parsers from .extern import nhl from .query import EventQuery, GameQuery, PlayerQuery, TeamQuery MAX_TEAM_ID = 101 async def _get_pool(pool: Pool = None) -> Pool: if poo...
aaront/puckdb
puckdb/fetch.py
Python
apache-2.0
4,522
# -*- coding: utf-8 -*- # Copyright (C) 2010 Holoscópio Tecnologia # Author: Luciana Fujii Pontello <luciana@holoscopio.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 2 of...
lucasa/landell-fgdp
sltv/ui/core.py
Python
gpl-2.0
9,116
""" FableGenerator -- DO NOT EDIT THIS FILE -- -- EDIT FABLEME/UTILS.PY AND COPY THAT ONE -- utils.py """ import os import logging import time import datetime CHROME_DATE_FORMAT = '%Y-%m-%d' IE10_DATE_FORMAT = '%m/%d/%Y' OUTPUT_PATH = "output/" RESOURCES_PATH = "resources/" class BasicU...
guildenstern70/fablegenerator
fablegenerator/fableme/utils.py
Python
mit
3,462
__author__ = 'nathan' import json import pysolr import config import models import unicodedata def main(): from sqlalchemy.orm import sessionmaker if hasattr(config, "solr") and config.solr == "lib_prod": blake_object_solr = pysolr.Solr('http://webapp.lib.unc.edu:8200/solr/blake/blake_object') ...
blakearchive/archive
blakearchive/solrimport.py
Python
gpl-2.0
4,341
from django.http import JsonResponse class JSENDSuccess(JsonResponse): def __init__(self, status_code, data={}): super(JSENDSuccess, self).__init__(status=status_code, data={'status': 'success', 'data': data}) class JSENDFail(JsonResponse): def __init__(self, status_code, data={}): super(JSE...
sangwonl/stage34
webapp/api/helpers/http/jsend.py
Python
mit
721
import unittest from vFense.core._constants import * from vFense.core.user._constants import * from vFense.core.user.users import * from vFense.core.group.groups import * from vFense.core.group._constants import * from vFense.core.customer.customers import * from vFense.core.customer._constants import * from vFense.co...
dtklein/vFense
tp/src/core/tests/users_groups_and_customers_test.py
Python
lgpl-3.0
6,128
# -*- coding: utf-8 -*- # This module is a port of the Textblob Averaged Perceptron Tagger # Author: Matthew Honnibal <honnibal+gh@gmail.com>, # Long Duong <longdt219@gmail.com> (NLTK port) # URL: <https://github.com/sloria/textblob-aptagger> # <http://nltk.org/> # Copyright 2013 Matthew Honnibal #...
adazey/Muzez
libs/nltk/tag/perceptron.py
Python
gpl-3.0
11,552
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import APPLE = 'apple' GOOGLE_PLAY = 'google_play' AMAZON_APPSTORE = 'amazon_appstore' WINDOWS_STORE = 'windows_store'
mobify/python-appfigures
appfigures/stores.py
Python
mit
194
# Copyright 2013 VMware, Inc. # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
noironetworks/neutron
neutron/extensions/l3_ext_gw_mode.py
Python
apache-2.0
820
from collections import namedtuple from contextlib import closing from functools import partial DONE = 0 QUERY = 1 EXECUTE = 2 # can insert, but won't report insert id INSERT = 3 RECURSE = 4 # recursive generator def db_result(*val, **named): assert len(val) == 0 or len(name...
echaozh/python-dbtxn
db_txn.py
Python
mit
2,858
#------------------------------------------------------------------------------- # This file is part of PyMad. # # Copyright (c) 2011, CERN. 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...
pymad/cpymad
src/cern/cpymad/_couch.py
Python
apache-2.0
3,001
import os import sys import datetime from django.template.loader import add_to_builtins # Django settings for methodmint project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( ('Martin Fitzpatrick', 'mfitzp@abl.es'), ) MANAGERS = ADMINS # When calling via command line copy in SITE_ID from env # (linux) use e...
mfitzp/django-golifescience
settings.py
Python
bsd-3-clause
7,963
#!/usr/bin/env python # -*- coding: utf-8 -*-import sys import re import os import time,datetime from decimal import * import mimetypes from cStringIO import StringIO import oauth2 import logging from xml.sax import saxutils import webapp2 as webapp #from google.appengine.ext import webapp from dja...
co-meeting/crowy
src/controller/utils.py
Python
mit
8,884
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('editorial', '0049_auto_20171116_1526'), ] operations = [ migrations.AlterField( model_name='facet', ...
ProjectFacet/facet
project/editorial/migrations/0050_auto_20171117_1716.py
Python
mit
437
# Copyright (C) 2014 Nippon Telegraph and Telephone 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 appli...
ool2016-seclab/quarantineSystem
ryu/services/protocols/bgp/utils/bgp.py
Python
mit
5,129
from django.conf import settings from django.contrib.auth.models import User from rest_framework import authentication from rest_framework import filters from rest_framework import generics from rest_framework import permissions from rest_framework import status from rest_framework import viewsets from rest_framework.e...
carsongee/edx-platform
common/djangoapps/user_api/views.py
Python
agpl-3.0
3,368
import os from . import model from . import routes from . import views MODELS = [model.AddonS3UserSettings, model.AddonS3NodeSettings] USER_SETTINGS_MODEL = model.AddonS3UserSettings NODE_SETTINGS_MODEL = model.AddonS3NodeSettings ROUTES = [routes.settings_routes] SHORT_NAME = 's3' FULL_NAME = 'Amazon S3' OWNERS ...
njantrania/osf.io
website/addons/s3/__init__.py
Python
apache-2.0
881
import datetime import pdb import unittest class TransactionId2(object): def __init__(self, sale_date=None, apn=None): assert sale_date is not None, sale_date assert apn is not None, apn assert isinstance(sale_date, datetime.date), sale_date assert isinstance(apn, long), apn ...
rlowrance/re-avm
TransactionId2.py
Python
bsd-3-clause
3,449
import logging from autotest.client.shared import error @error.context_aware def run(test, params, env): """ KVM virtio viostor heavy random write load: 1) Log into a guest 2) Install Crystal Disk Mark [1] 3) Start Crystal Disk Mark with heavy write load :param test: QEMU test object :pa...
ypu/tp-qemu
qemu/tests/win_disk_write.py
Python
gpl-2.0
1,545
# Licensed to Tomaz Muraus under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # Tomaz muraus licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in...
Wadodo/wadodo-crawlers
wadodo_crawlers/wadodo_crawlers/spiders/base.py
Python
apache-2.0
1,102
# -*- coding: utf-8 -*- # © 2016 Oihane Crucelaegui - AvanzOSC # © 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com> # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp import api, fields, models, _ from openerp.tools.float_utils import float_compare class PurchaseOrder(models.Model): _in...
Eficent/odoomrp-wip
purchase_product_variants/models/purchase_order.py
Python
agpl-3.0
5,997
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-01-17 15:27 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('flows', '0082_install_indexes'), ] operations = [ ...
pulilab/rapidpro
temba/flows/migrations/0083_flowpathrecentstep.py
Python
agpl-3.0
1,150
import bpy op = bpy.context.active_operator op.x_eq = '1.2*(1 -v/(2*pi))*cos(3*v)*(1 + cos(u)) + 3*cos(3*v)' op.y_eq = '9*v/(2*pi) + 1.2*(1 - v/(2*pi))*sin(u)' op.z_eq = '1.2*(1 -v/(2*pi))*sin(3*v)*(1 + cos(u)) + 3*sin(3*v)' op.range_u_min = 0.0 op.range_u_max = 6.2831854820251465 op.range_u_step = 32 op.wrap_u = Fals...
Microvellum/Fluid-Designer
win64-vc/2.78/Python/bin/2.78/scripts/addons/presets/operator/mesh.primitive_xyz_function_surface/snake.py
Python
gpl-3.0
533
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
yugangw-msft/azure-cli
src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_access_restriction_commands.py
Python
mit
20,734
class Solution: # @param digits, a list of integer digits # @return a list of integer digits def plusOne(self, digits): result=[] length = len(digits) if length ==0: return result plus = 0 p = False n = digits.pop() length -= 1 n...
shootsoft/practice
LeetCode/python/061-090/066-plus-one/plus1.py
Python
apache-2.0
825
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ("twitter", "0003_auto_20150730_1112"), ] operations = [ migrations.AlterField( model_name="user", nam...
philgyford/django-ditto
ditto/twitter/migrations/0004_auto_20150730_1116.py
Python
mit
1,640
# -*- coding: utf-8 -*- # # Configuration file for the Sphinx documentation builder. # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/stable/config # -- Path setup ------------------------------------------------------------...
airbnb/knowledge-repo
docs/conf.py
Python
apache-2.0
5,149
# Copyright 2019 - Nokia 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 o...
openstack/vitrage
vitrage/notifier/plugins/zaqar/__init__.py
Python
apache-2.0
1,004
##Ladder 'name', 'game', 'size' ##Events': [ ] ##'Players': { 'name': elo} ## ##Event {'date': x, 'Base': { }, 'size': x, 'Sets': [ ]} ##Set = {'P1': 's', 'P2': 's', 'Matches': [ ] ##Match = [WINNER, char1, char2, Stage] ## ##PlayerIDS ##{'name': id} ## ##Players {'PIDs': { }, 'Data': [ ]} ##Data: {'last':...
JPShaya/ladder
ladderweb.py
Python
mit
8,779
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
bealdav/OpenUpgrade
addons/hr_recruitment/hr_recruitment.py
Python
agpl-3.0
33,759
import pytest from cfme import test_requirements from cfme.infrastructure.provider import InfraProvider from cfme.markers.env_markers.provider import ONE from cfme.utils.appliance.implementations.ui import navigate_to from cfme.utils.blockers import BZ from cfme.utils.update import update pytestmark = [ test_requ...
anurag03/integration_tests
cfme/tests/infrastructure/test_infra_tag_filters_combination.py
Python
gpl-2.0
2,510
""" Tests for `kolibri.utils.cli` module. """ from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import copy import logging import os from functools import wraps import pytest from mock import patch import kolibri from kolibri.core.deviceadmin.tests.t...
DXCanas/kolibri
kolibri/utils/tests/test_cli.py
Python
mit
9,291
#!/usr/bin/python # -*- coding: utf-8 -*- from derpconf.config import Config # NOQA Config.define('OAUTH_LATENCY', 100, 'Login route latency in MS. 0 to none.', 'General') Config.define('TOKEN_LATENCY', 100, 'Token route latency in MS. 0 to none.', 'General') Config.define('USERDATA_LATENCY', 100, 'User Data route l...
heynemann/fakebook
fakebook/config/__init__.py
Python
mit
469
# Copyright 2007 Casey Durfee # Copyright 2007 Gabriel Farrell # # This file is part of Kochief. # # Kochief 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 opti...
edsu/lochief
kochief/cataloging/urls.py
Python
gpl-3.0
894
# coding=utf-8 from __future__ import absolute_import __author__ = 'mazesoul' import struct from datetime import datetime from pyfdfs.enums import IP_ADDRESS_SIZE, FDFS_STORAGE_ID_MAX_SIZE, FDFS_DOMAIN_NAME_MAX_SIZE, \ FDFS_VERSION_SIZE, FDFS_SPACE_SIZE_BASE_INDEX, FDFS_GROUP_NAME_MAX_LEN class BaseAttr(object...
Forrest-Liu/pyfdfs
pyfdfs/structs.py
Python
gpl-2.0
12,010
import json import time import requests URL_HEAD = 'http://0.0.0.0:8001' def create_entry(word, language, pos, definition, def_language): resp = requests.post( URL_HEAD + '/entry/%s/create' % language, json=json.dumps({ 'definitions': [{ 'definition': definition, ...
radomd92/botjagwar
test_utils/live_test.py
Python
mit
672
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function, unicode_literals import os from itertools import chain from setuptools import find_packages, setup from celery_redis_sentinel import __author__, __version__ def read(fname): with open(os.path.join(os.path.dirname(__file__), fna...
dealertrack/celery-redis-sentinel
setup.py
Python
mit
2,408
# 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. """Provides functions for parsing and outputting Zulu time.""" import datetime import pytz from infra_libs.time_functions import timestamp def parse_zul...
endlessm/chromium-browser
tools/swarming_client/third_party/infra_libs/time_functions/zulu.py
Python
bsd-3-clause
1,411
# -*- coding: utf-8 -*- from multiprocessing import RawValue, RawArray, Semaphore, Lock import ctypes import numpy as np import tensorflow as tf class SharedCounter(object): def __init__(self, initval=0): self.val = RawValue('i', initval) self.last_step_update_target = RawValue('i', init...
steveKapturowski/tensorflow-rl
utils/shared_memory.py
Python
apache-2.0
2,714
from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() setup( name='rmate', version='1....
sclukey/rmate-python
setup.py
Python
mit
1,337
# Copyright (C) 2011 Jason Anderson # # # This file is part of PseudoTV. # # PseudoTV 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....
Jasonra/XBMC-PseudoTV
resources/lib/parsers/AVIParser.py
Python
gpl-3.0
7,403
# Created By: Virgil Dupras # Created On: 2005/12/16 # Copyright 2010 Hardcoded Software (http://www.hardcoded.net) # This software is licensed under the "BSD" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.hardcoded.net/licenses...
jmtchllrx/pyMuse
src/hsaudiotag/tests/ogg_test.py
Python
mit
4,081
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np __all__ = ['jackknife_resampling', 'jackknife_stats'] __doctest_requires__ = {'jackknife_stats': ['scipy']} def jackknife_resampling(data): """Performs jackknife resampling on numpy arrays. Jackknife resampling is a techniqu...
larrybradley/astropy
astropy/stats/jackknife.py
Python
bsd-3-clause
5,913
# encoding: utf-8 # module PyKDE4.kdeui # from /usr/lib/python3/dist-packages/PyKDE4/kdeui.cpython-34m-x86_64-linux-gnu.so # by generator 1.135 # no doc # imports import PyKDE4.kdecore as __PyKDE4_kdecore import PyQt4.QtCore as __PyQt4_QtCore import PyQt4.QtGui as __PyQt4_QtGui import PyQt4.QtSvg as __PyQt4_QtSvg cl...
ProfessorX/Config
.PyCharm30/system/python_stubs/-1247971765/PyKDE4/kdeui/KDescendantsProxyModel.py
Python
gpl-2.0
2,147
# Copyright (c) 2013 Red Hat, 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 writ...
openstack/zaqar
zaqar/storage/mongodb/topic_messages.py
Python
apache-2.0
40,290
# -*- coding: utf-8 -*- # Copyright (c) 2012 theo crevon # # See the file LICENSE for copying permission. version = (0, "5c") __title__ = "py-elevator" __author__ = "Oleiade" __license__ = "MIT" __version__ = '.'.join(map(str, version)) from .client import Elevator from .batch import WriteBatch
oleiade/py-elevator
pyelevator/__init__.py
Python
mit
301
# -*- coding: utf-8 -*- vim:encoding=utf-8: # vim: tabstop=4:shiftwidth=4:softtabstop=4:expandtab # Copyright (C) 2010-2014 GRNET S.A. # # 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 v...
irregulator/ganetimgr
accounts/management/commands/idle_accounts.py
Python
gpl-3.0
2,811
# Read a full line of input from stdin and save it to our dynamically typed variable, input_string. inputString = input() # Print a string literal saying "Hello, World." to stdout. print ('Hello, World.') print (inputString) # TODO: Write a line of code here that prints the contents of input_string to stdout.
vipmunot/HackerRank
30 Days of Code/Day0 - Hello World.py
Python
mit
311
#-*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
ksrajkumar/openerp-6.1
openerp/addons/project_issue/project_issue.py
Python
agpl-3.0
23,930
# coding: utf-8 __author__ = 'Junki Ishida' from ._compat import str_types, int_types, int_or_float_types, raise_with_inner, PY2 from .exceptions import FormatError from decimal import Decimal from datetime import datetime, date try: import dateutil.parser except ImportError: pass def str_to_str(value): ...
gomafutofu/mbserializer
mbserializer/converters.py
Python
mit
4,218
# cobra.flux_analysis.reaction.py # functions for analyzing / creating objective functions from ..core.Reaction import Reaction from six import iteritems def assess(model, reaction, flux_coefficient_cutoff=0.001): """Assesses the capacity of the model to produce the precursors for the reaction and absorb the ...
aebrahim/cobrapy
cobra/flux_analysis/reaction.py
Python
lgpl-2.1
7,333
# -*- coding: utf8 -*- from __future__ import unicode_literals from django.contrib.auth.models import AbstractUser from django.db import models from datetime import datetime from utils.common_utils import * # Create your models here. class UserProfile(AbstractUser): nickname = models.CharField(max_length=60, ve...
unknowfly/npa-bbs
NpaForum/apps/users/models.py
Python
mit
1,981
#!/usr/bin/env python # -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE is free software; you can redistribute it and/or # modify it under the terms of the GNU ...
drolando/SoftDev
tests/fife_test/tests/MultiPathfinderTest.py
Python
lgpl-2.1
7,856
""" Prepare Sparse Matrix for Sparse Affinity Propagation Clustering (SAP) """ # Authors: Huojun Cao <bioinfocao at gmail.com> # License: BSD 3 clause import numpy as np import pandas as pd import sparseAP_cy # cython for calculation ####################################################################################...
bioinfocao/pysapc
pysapc/sparseMatrixPrepare.py
Python
bsd-3-clause
8,514
import os, sys, time from subprocess import check_call import pj.api from pyxc.util import parentOf EXAMPLES_ROOT = parentOf(parentOf(os.path.abspath(__file__))) PATH = [ '%s/colorflash/js' % EXAMPLES_ROOT, '%s/mylib/js' % EXAMPLES_ROOT, ] def main(): check_call(['mkdir', '-p', 'build']) ...
andrewschaaf/pyxc-pj
pj-examples/colorflash/make.py
Python
mit
1,046
# -*- encoding: utf-8 -*- ################################################################################ # # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # ...
CLVsol/odoo_addons
clv_file/wkf/clv_file_wkf.py
Python
agpl-3.0
2,759
import os from django.conf.urls.defaults import * urlpatterns = patterns('debately.views', (r'^debates/challenge/(\d+)', 'challenge_debate'), (r'^debates/create/$', 'create_debate'), (r'^debates/(\d+)$', 'debate'), (r'^entries/(\d+)/comment/', 'create_comment'), (r'^messages$', 'usermessages'), ...
SnacksOnAPlane/debately
urls.py
Python
bsd-3-clause
399
import pandas as pd import os def process_order_data_dir(needed_map_dir): if not os.path.isdir(needed_map_dir) or not os.path.exists(needed_map_dir): raise IOError("ERROR: " + needed_map_dir + " not existed or its not a dir") print("change order sheet... in " + needed_map_dir) for file in os.listdi...
Heipiao/didi_competition
operate_order_sheet.py
Python
mit
1,067
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp.osv import osv class invoice(osv.osv...
maljac/odoo-addons
account_clean_cancelled_invoice_number/account_invoice.py
Python
agpl-3.0
609
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2008 Zuza Software Foundation # # This file is part of translate. # # translate 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 t...
bluemini/kuma
vendor/packages/translate/lang/ml.py
Python
mpl-2.0
1,024
from ebu_tt_live.documents import EBUTT3Document, EBUTTAuthorsGroupControlRequest, EBUTT3DocumentSequence from ebu_tt_live.node import SimpleConsumer from ebu_tt_live.carriage import IConsumerCarriage from ebu_tt_live.errors import UnexpectedSequenceIdentifierError from mock import MagicMock from unittest import TestC...
bbc/ebu-tt-live-toolkit
ebu_tt_live/node/test/test_consumer_unit.py
Python
bsd-3-clause
2,719
#!/usr/bin/env python from numarray import * import sys from PyQt4.Qwt3D import * from PyQt4.Qt import * # enable all tracing options of the SIP generated bindings (requires -r option) if False: import sip sip.settracemask(0x3f) def matrix2d(nx, ny, minx, maxx, miny, maxy, function): """Return a data m...
PyQwt/PyQwt3D
qt4examples/TestNumarray.py
Python
gpl-2.0
2,972
import unittest from aula4.pilha import Pilha, PilhaVaziaErro def esta_balanceada(expressao): """ Função que calcula se expressão possui parenteses, colchetes e chaves balanceados O Aluno deverá informar a complexidade de tempo e espaço da função Deverá ser usada como estrutura de dados apenas a pilh...
jpaDeveloper/estrutura-de-dados
estrutura-de-dados-master/Exercicios/balanciamento.py
Python
mit
2,776
# Copyright 2013-2016 DataStax, 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 writi...
vipjml/python-driver
tests/integration/standard/test_udts.py
Python
apache-2.0
31,540
#!/usr/bin/python2 # -*- coding: utf-8 -*- # home # # # vim:fileencoding=utf-8:sw=4:et -*- coding: utf-8 -*- # # 测试 pyalgotrade 回测 # import _index from energy.libs.MongoStock import Feed from energy.libs.eAlgoLib import eAlgoLib as eal from pyalgotrade import strategy from pyalgotrade import bar from pyalgotrade.tec...
vyouzhis/energy
epyalgo/pyAlgoWMA.py
Python
apache-2.0
3,057
import collections import yaml class Group(collections.OrderedDict): __slots__ = ('start_mark',) class ConfigLoader(yaml.Loader): """Config loader with yaml tags""" def construct_yaml_map(self, node): data = Group() data.start_mark = node.start_mark yield data value = se...
tailhook/coyaml
coyaml/load.py
Python
mit
4,518
#!/usr/bin/env python #--coding:utf-8-- import socket s = socket.socket(socket.AF_INET,socket.SOCK_STREAM) #建立连接 s.connect(("127.0.0.1",9999)) #接收欢迎消息 print(s.recv(1024)) for data in ["Michael","Tracy","Sarah"]: #发送数据 s.send(data) print(s.recv(1024)) s.send("exit") s.close()
niehuawen/python
opstcpclient.py
Python
agpl-3.0
316
""" Assignment 1 Coursera 2013 - Introduction to Data Science Computes the ten most frequently occurring hash tags from a tweet file. Example: $ python top_ten.py output.txt gameinsight 77.0 TFBJP 65.0 RT 53.0 5DebilidadesMias 51.0 ... """ import sys import json from collections import Counter def get_top_ten(tweet...
elyase/twitter-sentiment
top_ten.py
Python
mit
798
"""Common operations on Posix pathnames. Instead of importing this module directly, import os and refer to this module as os.path. The "os.path" name is an alias for this module on Posix systems; on other systems (e.g. Mac, Windows), os.path provides the same operations in a manner specific to that platform, and is a...
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.0/Lib/posixpath.py
Python
mit
13,199
#!/usr/bin/python import sys import shutil import os import fileinput import time if len(sys.argv) < 3: print 'arg 1 = Unity folder name' print 'arg 2 = Unity project path' print 'arg 3 = Unity package path' print 'Example:' print 'python buildTarget.py Unity <TapGearProjectPath> <UnityPackagePat...
Grantoo/FuelTapGear-Sample-Unity
scripts/importPackage.py
Python
mit
1,102
## Automatically adapted for numpy.oldnumeric Mar 26, 2007 by alter_code1.py ## ## Biskit, a toolkit for the manipulation of macromolecular structures ## Copyright (C) 2004-2012 Raik Gruenberg & Johan Leckner ## ## This program is free software; you can redistribute it and/or ## modify it under the terms of the GNU Ge...
ostrokach/biskit
Biskit/Mod/Analyse.py
Python
gpl-3.0
22,678
from distutils.core import setup PACKAGE = "inmembrane" DESCRIPTION = "A bioinformatic pipeline for proteome annotation \ to predict if a protein is exposed on the surface of a bacteria." AUTHOR = "Andrew Perry & Bosco Ho" AUTHOR_EMAIL = "ajperry@pansapiens.com" URL = "http://github.com/boscoh/inmembrane" # Must be a ...
boscoh/inmembrane
setup.py
Python
bsd-2-clause
1,904