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.defaults import url from . import views urlpatterns = [ url(r'^transaction/(?P<tx_id>[0-9]+)$', views.transaction_view, name='compropago_transaction_state'), url(r'^webhook/$', views.web_hook_view, name='compropago_webhook'), ]
tzicatl/lfs-compropago
lfs_compropago/urls.py
Python
mit
260
"""Support for Gogogate2 garage Doors.""" import logging from pygogogate2 import Gogogate2API as pygogogate2 import voluptuous as vol from homeassistant.components.cover import SUPPORT_CLOSE, SUPPORT_OPEN, CoverDevice from homeassistant.const import ( CONF_IP_ADDRESS, CONF_NAME, CONF_PASSWORD, CONF_US...
leppa/home-assistant
homeassistant/components/gogogate2/cover.py
Python
apache-2.0
3,481
''' Created by auto_sdk on 2015.04.21 ''' from aliyun.api.base import RestApi class Rds20140815ModifyDBDescriptionRequest(RestApi): def __init__(self,domain='rds.aliyuncs.com',port=80): RestApi.__init__(self,domain, port) self.DBDescription = None self.DBInstanceId = None self.DBName = None def ge...
wanghe4096/website
aliyun/api/rest/Rds20140815ModifyDBDescriptionRequest.py
Python
bsd-2-clause
397
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
VioletCoin/VioletCoin
contrib/pyminer/pyminer.py
Python
mit
6,434
from setuptools import setup, find_packages import sys, os version = '0.2' def read(fname): # read the contents of a text file return open(os.path.join(os.path.dirname(__file__), fname)).read() install_requires = [ 'Django>= 1.3' ] setup(name='django-twostepauth', version=version, descriptio...
cognitiva/django-twostepauth
setup.py
Python
bsd-3-clause
1,209
# -*- coding: utf-8 -*- from django.contrib.contenttypes.models import ContentType def get_model(app_model_str): app, model = app_model_str.split(".") model_class = ContentType.objects.get( app_label=app, model=model.lower() ).model_class() return(model_class)
math-a3k/django-ai
django_ai/base/utils.py
Python
lgpl-3.0
296
#!/usr/bin/python # -*- encoding: utf-8; py-indent-offset: 4 -*- # +------------------------------------------------------------------+ # | ____ _ _ __ __ _ __ | # | / ___| |__ ___ ___| | __ | \/ | |/ / | # | | | | '_ \ / _ \/ __| |/ /...
oposs/check_mk_mirror
web/plugins/perfometer/check_mk.py
Python
gpl-2.0
52,956
#!/usr/bin/python # # File: qasm2tex.py # Date: 22-Mar-04 # Author: I. Chuang <ichuang@mit.edu> # # Python program to convert qasm to latex (and optionally generate ps/epsf/pdf) # # Usage: qasm2tex in.qasm # # Outputs: latex file (to stdout) # # Notes: qasm instructions are as follows. Lines begining with '#' # ...
eschmidgall/qasm2circ
original_qasm2circ-v1.4/qasm2tex.py
Python
gpl-2.0
27,389
# Copyright (c) 2013 Bull. # # 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, sof...
paramite/blazar
climate/tests/db/test_api.py
Python
apache-2.0
1,146
# Copyright 2015-present Scikit Flow 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...
shareactorIO/pipeline
source.ml/jupyterhub.ml/notebooks/zz_old/TensorFlow/SkFlow_DEPRECATED/iris.py
Python
apache-2.0
1,182
# -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # 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 os import json import sys from nose.plugins.skip import SkipTest i...
ravibhure/ansible
test/units/modules/network/f5/test_bigip_gtm_facts.py
Python
gpl-3.0
5,694
# Copyright 2021 The Kubeflow Authors # # 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...
kubeflow/pipelines
samples/core/visualization/html.py
Python
apache-2.0
2,218
#!/usr/bin/env python # Copyright (C) 2015 OpenStack, 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...
GoodgameStudios/jenkins-job-builder
jenkins_jobs/parser.py
Python
apache-2.0
13,409
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import StringIO import unittest from telemetry import page as page_module from telemetry.page import page_set from telemetry.results import csv_piv...
guorendong/iridium-browser-ubuntu
tools/telemetry/telemetry/results/csv_pivot_table_output_formatter_unittest.py
Python
bsd-3-clause
3,349
from fabric.api import * import os project_dir = os.path.join(os.path.dirname(sys.argv[0]) def first_setup(): # 1. Make a new virtualenv local("mkvirtualenv xenserver_backup") # pip install packages with prefix('workon xenserver_backup'): local("pip install pytest") def build_windows_dist()...
virantha/xenserver_backup
fabfile.py
Python
apache-2.0
1,582
# coding=utf-8 # Module arial_16 # generated from Arial 12pt name = "Arial 16" start_char = '!' end_char = chr(127) char_height = 16 space_width = 8 gap_width = 2 bitmaps = ( # @0 '!' (1 pixels wide) 0x00, # 0x80, # O 0x80, # O 0x80, # O 0x80, # O 0x80, # O 0x80, # O ...
HudsonWerks/OLED-SSD1306
ssd1306/fonts/arial_16.py
Python
lgpl-3.0
57,268
from asyncio import get_event_loop from sif import Context, Sif from sif_nats import Nats, SifNatsRpc from .deps import GreeterStub nats = Nats() sif = Sif('greeter.server') sif.add_rpc_transport('nats', SifNatsRpc(sif, nats)) greeter = GreeterStub(sif) @greeter.greet.listen async def greet(payload: str, ctx: Cont...
rudineirk/sif
examples/greeter/server.py
Python
mit
492
import argparse import pyjsonrpc from gensim.models.word2vec import Word2Vec W2V_MODEL = None class Word2VecRequestHandler(pyjsonrpc.HttpRequestHandler): """ a simple handler class that implements the 'expand' method """ @pyjsonrpc.rpcmethod def expand(self, word): """ expand the word using the ...
rueycheng/word2vec-expansion-jsonrpc-server
server.py
Python
mit
1,323
# -*- coding: utf-8 -*- """ WSGI config for Darky project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/{{ docs_version }}/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_applicatio...
nijel/darky
wsgi.py
Python
gpl-3.0
421
from MaKaC.common.general import * from MaKaC.webinterface.rh import sessionModif if DEVELOPEMENT: sessionModif = reload( sessionModif ) def index(req, **params): return sessionModif.RHSessionModifTools( req ).process( params ) def delete( req, **params ): return sessionModif.RHSessionDeletion( req ).p...
belokop-an/agenda-tools
code/htdocs/sessionModifTools.py
Python
gpl-2.0
444
# -*- coding: utf-8 -*- # # Copyright 2015 MarkLogic 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...
supriyantomaftuh/python_api
python_api/marklogic/models/host.py
Python
apache-2.0
9,046
# -*- 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...
Johnzero/erp
openerp/addons/document/__init__.py
Python
agpl-3.0
1,227
# -*- coding: utf-8 -*- """Test cases for Russian""" NAME = "TestRussian" TEST_CASES = { 0: 'ноль', 1: 'один', 2: 'два', 3: 'три', 4: 'четыре', 5: 'пять', 6: 'шесть', 7: 'семь', 8: 'восемь', 9: 'девять', 10: 'десять', 11: 'одиннадцать', 12: 'двенадцать', 13: 'тринадцать', 14: 'четырнадцать', 15: 'пятн...
alco/numspell
test/cases_ru.py
Python
mit
7,765
# -*- coding: utf-8 -*- from django.http import HttpResponse, Http404 from django.shortcuts import render, get_object_or_404, redirect from mailinglist.models import MailingList from mailinglist.forms import SubscribeForm def index(request): return HttpResponse('Ahoj Svet.\ Práve ste v ma...
ricco386/zaciname-s-djangom
konferencia/mailinglist/views.py
Python
bsd-3-clause
1,058
''' Created on 2014-5-4 @author: xiajie ''' import numpy as np import prostate def ls(X, Y): #print X #print Y XT = np.transpose(X) M = XT.dot(X) if np.linalg.matrix_rank(M) < len(M): return None beta = np.linalg.inv(M).dot(XT).dot(Y) return beta def augment(data): dlist = dat...
jayshonzs/ESL
LinearRegression/leastsquare.py
Python
mit
1,567
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
AutorestCI/azure-sdk-for-python
azure-mgmt-batchai/azure/mgmt/batchai/models/azure_file_share_reference.py
Python
mit
2,596
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyPygit2(PythonPackage): """Pygit2 is a set of Python bindings to the libgit2 shared libra...
LLNL/spack
var/spack/repos/builtin/packages/py-pygit2/package.py
Python
lgpl-2.1
2,045
# coding=UTF-8 # # Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
googlei18n/glyphsLib
tests/builder/instances_test.py
Python
apache-2.0
3,713
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('info_transportation', '0007_auto_20150226_0932'), ] operations = [ migrations.AlterModelOptions( name='line', ...
ojarva/home-info-display
homedisplay/info_transportation/migrations/0008_auto_20150226_1015.py
Python
bsd-3-clause
2,319
#!/usr/bin/python # # Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
wubr2000/googleads-python-lib
examples/dfp/v201508/line_item_creative_association_service/create_licas.py
Python
apache-2.0
1,879
import webbrowser import tornado.httpserver import tornado.ioloop from mitmproxy import addons from mitmproxy import log from mitmproxy import master from mitmproxy import optmanager from mitmproxy.addons import eventstore from mitmproxy.addons import intercept from mitmproxy.addons import readfile from mitmproxy.addo...
MatthewShao/mitmproxy
mitmproxy/tools/web/master.py
Python
mit
4,995
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys from os import path, getenv from glob import glob import codecs from LatXmlParser import LatXmlParser from NindIdentifiantsClef import NindIdentifiantsClef def usage(): if getenv("PY") != None: script = sys.argv[0].replace(getenv("PY"), '$PY') else: scr...
jys/nind
src/py/amose/Nind_convertitXmlClef.py
Python
lgpl-3.0
5,417
import errno import io import os import shutil from django.core.cache import cache as default_cache, caches from django.core.cache.backends.base import InvalidCacheBackendError from django.core.files import File from django.core.urlresolvers import reverse from django.db import models from django.dispatch import recei...
theonion/betty-cropper
betty/cropper/models.py
Python
mit
18,486
#!/usr/bin/env python import sys from collections import defaultdict VICTORY = [17, 61] bots = defaultdict(list) instr = [x.strip() for x in sys.stdin] while instr: command = instr.pop(0) ops = command.split() if ops[0] == 'value': val, bot = int(ops[1]), ops[-1] bots[bot].append(val) ...
bildzeitung/2016adventofcode
10/1.py
Python
gpl-3.0
1,124
from __future__ import absolute_import, print_function import random import socket import string import sys import time import unittest2 as unittest import warnings import weakref from nose import SkipTest from kombu import Connection from kombu import Exchange, Queue from kombu.five import range if sys.version_inf...
mverrilli/kombu
funtests/transport.py
Python
bsd-3-clause
9,529
# -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 ## ## Copyright (C) 2012 Async Open Source <http://www.async.com.br> ## All rights reserved ## ## 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 Foundati...
andrebellafronte/stoq
stoq/gui/test/test_payable.py
Python
gpl-2.0
9,151
class DiffusiveConductanceTest: def test_bulk_diffusion(self): pass
amdouglas/OpenPNM
test/unit/Physics/models/DiffusiveConductanceTest.py
Python
mit
80
from importlib import _bootstrap from . import util import collections import imp import sys import unittest class PathHookTests(unittest.TestCase): """Test the path hook for extension modules.""" # XXX Should it only succeed for pre-existing directories? # XXX Should it only work for directories contai...
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.1/Lib/importlib/test/extension/test_path_hook.py
Python
mit
757
# # Copyright (c) 2015 Red Hat # Licensed under The MIT License (MIT) # http://opensource.org/licenses/MIT # from django.conf import settings from django.forms import SelectMultiple import django_filters from pdc.apps.common.filters import MultiValueFilter, NullableCharFilter from . import models class RPMFilter(dj...
maxamillion/product-definition-center
pdc/apps/package/filters.py
Python
mit
4,125
import pytest from tests.setup_transaction_tests import chain as s, tester as t, ethereum_utils as u, check_gas, \ get_contract_with_gas_estimation, get_contract def test_basic_repeater(): basic_repeater = """ def repeat(z: num) -> num: x = 0 for i in range(6): x = x + z return(x) """ ...
NedYork/viper
tests/parser/features/iteration/test_repeater.py
Python
mit
1,931
# http://blog.csdn.net/alex_chen_16/article/details/50900416
sniperyen/MyDjango
ace/__init__.py
Python
apache-2.0
60
# -*- coding: ascii -*- r""" :Copyright: Copyright 2013 - 2015 Andr\xe9 Malo or his licensors, as applicable :License: 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....
ndparker/tdi
tdi/tools/template.py
Python
apache-2.0
16,325
# -*- test-case-name: twisted.names.test.test_names -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Authoritative resolvers. """ from __future__ import absolute_import, division import os import time from twisted.names import dns, error, common from twisted.internet import defer from...
Architektor/PySnip
venv/lib/python2.7/site-packages/twisted/names/authority.py
Python
gpl-3.0
14,143
import os import glob import time import json class Sensor(dict): def __init__(self, name): self.readings = {} dict.__init__(self, name=name, readings=self.readings) self.name = name def add_reading(self, loopcount): f = open(self.name, 'r') lines = f.readlines() equals_pos = lines[1].find('t=') if eq...
jjulik/keezer-pi
client/testing/sensortest.py
Python
mit
857
"""Component to allow selecting an option from a list as platforms.""" from __future__ import annotations from dataclasses import dataclass from datetime import timedelta import logging from typing import Any, final import voluptuous as vol from homeassistant.config_entries import ConfigEntry from homeassistant.core...
lukas-hetzenecker/home-assistant
homeassistant/components/select/__init__.py
Python
apache-2.0
3,535
from ...util.linear_functions import ( hellinger_distance, normalized_hellinger_distance, hellinger_distance_prebin) import unittest from unittest import TestCase import numpy class HellingerDistanceTest(TestCase): def test_max(self): a = [2, 2, 2, 2, 2, 2, 2, 2, 9, 9] b = [9, 9, 9, 9,...
arider/riderml
riderml/tests/util/test_linear_functions.py
Python
mit
1,304
# -*- coding: utf-8 -*- # # Ninja documentation build configuration file, created by # sphinx-quickstart on Sun Aug 16 11:40:35 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All...
yuval/ninja
doc/conf.py
Python
apache-2.0
9,097
""" You don't really want to use this module. Try helper.py instead. """ CLEAR = 0 BOLD = 1 DIM = 2 ITALIC = 3 UNDERSCORE = 4 BLINK_SLOW = 5 BLINK_FAST = 6 REVERSE = 7 CONCEALED = 8 FG_BLACK = 30 FG_RED = 31 FG_GREEN = 32 FG_YELLOW = 33 FG_BLUE = 34 FG_MAGENTA = 35 FG_CYAN = 36 FG_WHITE = 37 BG_BL...
hlzz/dotfiles
graphics/VTK-7.0.0/ThirdParty/Twisted/twisted/conch/insults/colors.py
Python
bsd-3-clause
434
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ File: config.py Author: Rob Phoenix Email: rob@robphoenix.com Github: https://github.com/robphoenix Description: Prepare Cisco IOS configs for comparison """ import os import re from collections import namedtuple import diffios class Config(object): """Config p...
bordeltabernacle/diffios
diffios/config.py
Python
mit
4,912
from __future__ import absolute_import import hmac from django.core.urlresolvers import reverse from exam import fixture from hashlib import sha256 from sentry.utils.compat.mock import patch from sentry.models import ProjectOption from sentry.testutils import TestCase from sentry.utils import json class ReleaseWeb...
beeftornado/sentry
tests/sentry/web/frontend/test_release_webhook.py
Python
bsd-3-clause
4,134
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance wi...
cernops/nova
nova/service.py
Python
apache-2.0
14,686
# -*- coding: utf-8; -*- from __future__ import absolute_import, unicode_literals from tests import unittest, mock from tests.factories.docker_client_factory import DockerClientFactory from freight_forwarder.container.config import Config from freight_forwarder.image import Image from freight_forwarder.registry.regis...
fin09pcap/freight_forwarder
tests/unit/image_test.py
Python
mit
11,378
import ddapp import os import sys import argparse import json class DRCArgParser(object): def __init__(self): self._args = None self._parser = None self.strict = False def getArgs(self): if self._args is None: self.parseArgs() return self._args def g...
edowson/director
src/python/ddapp/drcargs.py
Python
bsd-3-clause
5,142
from treebeard._ref import ref from treebeard._rel import rel, up from mock import sentinel def test_ref_converts_to_leaf_value_specified_by_relative_path(example_path): example_path.monkey.here_is_a_reference = "foo.bar.baz" example_path.monkey.lover = sentinel.monkeylover r = ref(rel.here_is_a_refe...
dbew/treebeard
tests/unit/test_ref_and_rel.py
Python
bsd-2-clause
1,450
"""Qsignature: detection of sample mixups. https://sourceforge.net/p/adamajava/wiki/qSignature/ """ import os import shutil import subprocess import lxml import pysam import toolz as tz from bcbio import bam, utils from bcbio.distributed.transaction import file_transaction from bcbio.log import logger from bcbio.pro...
brainstorm/bcbio-nextgen
bcbio/qc/qsignature.py
Python
mit
8,491
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Red Hat, inc # Written by Seth Vidal # based on the mount modules from salt and puppet # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the ...
fti7/ansible-modules-core
system/mount.py
Python
gpl-3.0
10,314
import datetime from django.conf import settings from django.contrib.auth.models import User from LabtrackerCore.Email import EmailSection from Email import NewIssueEmail import models as im import forms import utils from django.core.exceptions import ObjectDoesNotExist class IssueUpdater(object): def __init__(s...
abztrakt/labtracker
IssueTracker/issue.py
Python
apache-2.0
7,685
# 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 (t...
apache/allura
Allura/allura/tests/tscript_error.py
Python
apache-2.0
923
# https://www.khronos.org/collada/ import os import io import re import traceback import copy from collections import OrderedDict import numpy as np from PyEngine3D.Common import logger from PyEngine3D.Utilities import * def convert_float(data, default=0.0): try: return float(data) except: ...
ubuntunux/PyEngine3D
PyEngine3D/ResourceManager/ColladaLoader.py
Python
bsd-2-clause
29,857
#!/usr/bin/env python from distutils.core import setup setup(name='dyneav', version='1.0', description='A little EAV package that lets you create dynamic classes using EAV to store attributes.', author='Jason Goodell', author_email='jgoodell77@gmail.com', packages=['dyneav'], )
jgoodell/dyneav
setup.py
Python
mit
317
from flask.ext.wtf import Form from wtforms.fields import StringField, PasswordField, SubmitField from wtforms.fields.html5 import EmailField from wtforms.ext.sqlalchemy.fields import QuerySelectField from wtforms.validators import InputRequired, DataRequired, Length, Email, EqualTo from wtforms import ValidationError ...
hack4impact/reading-terminal-market
app/admin/forms.py
Python
mit
3,316
#cnn file for tf tutorial #Lukas Odrzywolski from __future__ import absolute_import from __future__ import division from __future__ import print_function #imports import numpy as np import tensorflow as tf tf.logging.set_verbosity(tf.logging.INFO) #application of logic added here def cnn_model_fn(feature, labels...
odrzywolski-lukas/odrzywolskiSprintScripts
python/cnn_mnist.py
Python
mit
3,457
# -*- encoding: utf-8 -*- ''' This module is used to test import scm data module: iris/etl/scm.py ''' import unittest from django.contrib.auth.models import User from iris.core.models import Domain from iris.core.models import DomainRole from iris.etl.scm import from_string, ROLES #pylint: skip-file class DomainT...
117111302/iris
iris/etl/tests/test_import_scm_domain.py
Python
gpl-2.0
6,724
from collections import Counter import numpy as np def run(word_gen, index, window_size, out_file): context = [] pair_counts = Counter() for word in word_gen: context.append(index[word]) if len(context) > window_size * 2 + 1: context.pop(0) pair_counts = _process_context...
williamleif/histwords
representations/cooccurgen.py
Python
apache-2.0
944
#! /usr/bin/env python import numpy as np import scipy as cp import pandas as pd import sklearn as sk import tensorflow as tf print('Hello World!') print('start Python and MachineLearning!') # edit in home
jiangzhiwen/pytest
pytest.py
Python
apache-2.0
211
# -*- coding: utf-8 -*- class AnalyticBeastObject(object): """ main beast analytics class """ def __init__(self, name, beastObject): self.name = name self.beastObject = beastObject self.type = beastObject.beast.__class__.__name__ #OUTPUT variables #gene...
eyeswideopen/beastArena
AnalyticBeastObject.py
Python
gpl-3.0
1,438
"""Lower level API, configuration, and HTTP stuff.""" import six import time from ubersmith.compat import total_ordering, file_type import requests from ubersmith.exceptions import ( RequestError, ResponseError, UpdatingTokenResponse, MaintenanceResponse, ) from ubersmith.utils import ( append_qs,...
jasonkeene/python-ubersmith
ubersmith/api.py
Python
mit
21,356
from django import template from django.utils.text import capfirst register = template.Library() @register.filter def verbose_name(obj, arg): return capfirst(obj._meta.get_field(arg).verbose_name)
sbsdev/daisyproducer
daisyproducer/documents/templatetags/verbose_name.py
Python
agpl-3.0
214
from __future__ import print_function import csv import os import copy import numpy as np import GPy import scipy.io import zipfile import tarfile import datetime import json import re import sys from io import open from .config import * ipython_available=True try: import IPython except ImportError: ipython_av...
befelix/GPy
GPy/util/datasets.py
Python
bsd-3-clause
65,186
import urllib2 url = 'http://spark-public.s3.amazonaws.com/algo2/datasets/jobs.txt' response = urllib2.urlopen(url) data = response.read() data = data.split('\n') data = data[1:-1] data = [x.split(' ') for x in data] data = [ [ float(x[0]),float(x[1]) ] for x in data] # deal with data temp = [[] for x in data] rati...
ayst123/mooc
algorithem2/programming1/b.py
Python
bsd-2-clause
630
from django.db import models from django.core.validators import MinValueValidator, \ MaxValueValidator class Coupon(models.Model): code = models.CharField(max_length=50, unique=True) valid_from = models.DateTimeField() valid_to = models.DateTimeField() discount = mod...
PikaDm/clave-online-shop-template
coupons/models.py
Python
mit
525
''' Created by auto_sdk on 2015.06.23 ''' from aliyun.api.base import RestApi class Ecs20140526ModifyInstanceAttributeRequest(RestApi): def __init__(self,domain='ecs.aliyuncs.com',port=80): RestApi.__init__(self,domain, port) self.Description = None self.HostName = None self.InstanceId = None self.InstanceNa...
francisar/rds_manager
aliyun/api/rest/Ecs20140526ModifyInstanceAttributeRequest.py
Python
mit
440
# -*- coding: utf-8 -*- # # pandas-gbq documentation build configuration file, created by # sphinx-quickstart on Wed Feb 8 10:52:12 2017. # # 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. # ...
RTBHOUSE/pandas-gbq
docs/source/conf.py
Python
bsd-3-clause
10,984
# Copyright 2010 Google 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 writing,...
brianrock/brianrock-ringo
handlers/poll.py
Python
apache-2.0
7,906
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ This module define a WulffShape class to generate the Wulff shape from a lattice, a list of indices and their corresponding surface energies, and the total area and volume of the wulff shape,the weighted su...
czhengsci/pymatgen
pymatgen/analysis/wulff.py
Python
mit
21,287
import unittest import mox import pyclut from pyclut.engine.user_interface import UserInterface class UserInterfaceTestCase(unittest.TestCase): """UserInterface unit test cases""" def setUp(self): self.mox_factory = mox.Mox() self._mock_config = self.mox_factory.CreateMockAnything() def tearDown(self): self....
ericcolleu/pyclutter-widgets
pyclut/engine/test/user_interface_test.py
Python
lgpl-2.1
2,406
#!/usr/bin/env python # -*- coding: utf-8 -*- # tifffile.py # Copyright (c) 2008-2014, Christoph Gohlke # Copyright (c) 2008-2014, The Regents of the University of California # Produced at the Laboratory for Fluorescence Dynamics # All rights reserved. # # Redistribution and use in source and binary forms, with or wit...
Britefury/scikit-image
skimage/external/tifffile/tifffile_local.py
Python
bsd-3-clause
173,368
import fileinput i = 0 for line in fileinput.input(): i += 1 line = line.strip() print("The ", i, " line is: ", line)
jepio/python-magic
stdinput/stdinput.py
Python
gpl-2.0
131
import unittest import json from bitmovin import Bitmovin, Response, S3Input from bitmovin.errors import BitmovinApiError from tests.bitmovin import BitmovinTestCase class S3InputTests(BitmovinTestCase): @classmethod def setUpClass(cls): super().setUpClass() @classmethod def tearDownClass(cl...
bitmovin/bitmovin-python
tests/bitmovin/services/inputs/s3_input_service_tests.py
Python
unlicense
6,168
import socket hostname = socket.gethostname() config = { # This is just a key to tell the fedmsg-hub to initialize us. 'summershum.enabled': True, 'summershum.sqlalchemy.url': 'sqlite:////var/tmp/summershum.sqlite', 'summershum.lookaside': 'http://pkgs.fedoraproject.org/lookaside/pkgs/', 'summershu...
fedora-infra/summershum
fedmsg.d/example-config.py
Python
gpl-2.0
791
# -*- coding: utf-8 -*- """ pyClanSphere.database ~~~~~~~~~~~~~~~~~~~~~ Our layer on top of SQLAlchemy. Simply use the high level :mod:`~pyClanSphere.database.db` module which you can import from the :mod:`pyClanSphere.api` module. :copyright: (c) 2009 - 2010 by the pyClanSphere Team, ...
jokey2k/pyClanSphere
pyClanSphere/database.py
Python
bsd-3-clause
9,011
import copy from itertools import chain from django import forms from django.contrib.postgres.validators import ( ArrayMaxLengthValidator, ArrayMinLengthValidator, ) from django.core.exceptions import ValidationError from django.utils import six from django.utils.safestring import mark_safe from django.utils.trans...
unnikrishnankgs/va
venv/lib/python3.5/site-packages/django/contrib/postgres/forms/array.py
Python
bsd-2-clause
6,758
""" sentry.models.team ~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import, print_function import warnings from django.conf import settings from django.db import connections, IntegrityEr...
jean/sentry
src/sentry/models/team.py
Python
bsd-3-clause
8,526
# vim: tabstop=5 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack LLC. # 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/...
paulmathews/nova
nova/tests/api/openstack/compute/contrib/test_used_limits.py
Python
apache-2.0
4,341
import http.server from threading import Thread import os.path import mimetypes class HTTPHandler: def __init__(self, config): self.config = config handler = HTTPHandler.make_http_handler(self.config['media_dir']) self.httpd = http.server.HTTPServer(('', self.config['media']['port']), hand...
Surye/relaygram
relaygram/http_server.py
Python
mit
1,712
# -*- coding: utf-8 -*- # # 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 ...
KL-WLCR/incubator-airflow
airflow/task/task_runner/base_task_runner.py
Python
apache-2.0
5,924
# -*- coding: utf-8 -*- from sys import argv script,file=argv def print_all(f): print f.read() def rewind(f): f.seek(0) def print_line(count,f): print count,f.readline() currentFile=open(file) print("Print the whole file!") print_all(currentFile) print("Back to start!") rewind(currentFile) print("Print...
Vayne-Lover/Effective
Python/Learn Python The Hard Way/ex20.py
Python
mit
456
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('quotes', '0001_initial'), ] operations = [ migrations.RemoveField( model_name='quote', name='ip', ...
FMF-studenti/backend
fmf/quotes/migrations/0002_remove_quote_ip.py
Python
gpl-2.0
335
def build_models(payment_class): return []
dekoza/django-getpaid
getpaid/backends/transferuj/models.py
Python
mit
47
# Copyright (c) 2019 Salesforce. 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 b...
mahak/neutron
neutron/extensions/rbac_security_groups.py
Python
apache-2.0
897
#!/usr/bin/env python2.3 # -*- coding: utf-8 -*- # # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache Lice...
sparkslabs/kamaelia_
Code/Python/Kamaelia/Kamaelia/Util/TestResult.py
Python
apache-2.0
3,101
# 1 - Import library import pygame import random from pygame.locals import * # 2 - Initialize the game pygame.init() width, height = 153,153 screen=pygame.display.set_mode((width, height)) # 3 - Load images heads = pygame.image.load("head.png") tails = pygame.image.load("tail.png") foo = [heads,tails] player = ra...
Alafazam/simple_projects
pygame/coinFlip/app.py
Python
mit
911
# Copyright 2018 - Nokia # # 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...
openstack/vitrage
vitrage/entity_graph/graph_init.py
Python
apache-2.0
8,349
from chatterbot.adapters import Adapter class OutputAdapter(Adapter): """ A generic class that can be overridden by a subclass to provide extended functionality, such as delivering a response to an API endpoint. """ def process_response(self, statement, session_id=None): """ Overr...
maclogan/VirtualPenPal
chatterbot/output/output_adapter.py
Python
bsd-3-clause
639
from category import * import unittest class TestCategory(): def testMatch(self): path = '/CATEGORY/CLASS/instance/PROTOCOL/METHOD' target = {'category': 'CATEGORY', 'class': 'CLASS', 'file': None, 'dir': 'instance', 'protocol': 'PROTOCOL', ...
phb/squeakfs
unittests/test_category.py
Python
mit
401
registered_handlers = {}
schneck/django-foreignkeysearch
foreignkeysearch/__init__.py
Python
mit
26
# 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...
tensorflow/estimator
tensorflow_estimator/python/estimator/canned/v1/dnn_test_fc_v2_v1.py
Python
apache-2.0
17,722
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Bottle is a fast and simple micro-framework for small web applications. It offers request dispatching (Routes) with URL parameter support, templates, a built-in HTTP Server and adapters for many third party WSGI/HTTP-server and template engines - all in a single file an...
hackersql/sq1map
thirdparty/bottle/bottle.py
Python
gpl-3.0
152,507
from cms.app_base import CMSApp from cms.test_utils.project.sampleapp.menu import SampleAppMenu, StaticMenu3 from cms.apphook_pool import apphook_pool from django.utils.translation import ugettext_lazy as _ class SampleApp(CMSApp): name = _("Sample App") urls = ["cms.test_utils.project.sampleapp.urls"] me...
Venturi/oldcms
env/lib/python2.7/site-packages/cms/test_utils/project/sampleapp/cms_app.py
Python
apache-2.0
1,462
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.Create...
alexvanaxe/socialauthtests
theauth/migrations/0001_initial.py
Python
gpl-2.0
607