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
import datetime import hashlib import os import re import urllib.request import binascii from bs4 import BeautifulSoup BASEURL = "http://www.theguardian.com/books/series/the-100-best-novels" def setup(base): """ Set up target URLs and create our initial BeautifulSoup object. :param base: a URL, e.g. ht...
hammerheadlemon/hundredgreatest
hundredgreatest.py
Python
gpl-3.0
7,580
# Copyright (c) 2015 OpenStack Foundation # # 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 ...
cloudbase/neutron
neutron/agent/l3/dvr_edge_router.py
Python
apache-2.0
10,649
#!/usr/bin/env python __author__ = 'Mike McCann,Duane Edgington,Reiko Michisaki' __copyright__ = '2013' __license__ = 'GPL v3' __contact__ = 'mccann at mbari.org' __doc__ = ''' Master loader for all Worden's CN13ID Western Flyer cruise in October 2013 CN13ID: CANON 2013 Interdisciplinary Mike McCann MBARI 23 ...
stoqs/stoqs
stoqs/loaders/CANON/loadCN13ID_october2013.py
Python
gpl-3.0
11,697
# Copyright (c) 2018 PaddlePaddle 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 app...
lcy-seso/Paddle
python/paddle/fluid/tests/unittests/test_iou_similarity_op.py
Python
apache-2.0
1,829
# encoding: utf-8 """ inet/parser.py Created by Thomas Mangin on 2015-06-04. Copyright (c) 2009-2015 Exa Networks. All rights reserved. """ from struct import pack from exabgp.protocol.ip import IP from exabgp.protocol.ip import IPSelf from exabgp.protocol.family import AFI # from exabgp.protocol.family import SAFI ...
benagricola/exabgp
lib/exabgp/configuration/static/parser.py
Python
bsd-3-clause
15,891
import numpy as np import scipy as sp from scipy import misc #import pyximport; pyximport.install() #import resample_cython import resample_cython import pylab as pl l = misc.lena()[::2, ::2]/1. l.shape = l.shape + (1,) l = l.astype('float32') #a = np.random.randn(5, 3, 4).astype('float32') l = np.tile(l, 96) print l...
nsf-ri-ubicv/sthor
sthor/operation/old_resample/resample_cython_demo.py
Python
bsd-3-clause
705
from setuptools import setup, find_packages setup( name='Calculator', version='0.1', packages=find_packages(), package_data={}, scripts=[ 'bin/calculator.py', ], )
ImWalkinHere/Calculator
setup.py
Python
lgpl-2.1
197
# encoding: utf-8 import json import logging from .miscutils import loads, dumps from .Transport import Transport from .config import config import requests # HTTP requests from .miscutils import httpget from .Errors import IPFSException class TransportIPFS(Transport): """ Subclass of Transport. Implement...
ArchiveLabs/dweb_gateway
python/TransportIPFS.py
Python
agpl-3.0
7,482
# Copyright 2013, Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can # be found in the LICENSE file. # DEPRECATED module, just one hardcoded function left, so vtrouting.py # is not changed yet. Will be cleaned up soon. from vtdb import keyrange_constants def get_s...
yaoshengzhe/vitess
py/vtdb/topology.py
Python
bsd-3-clause
402
#!/usr/bin/env python # -*- coding: ISO-8859-1 -*- # generated by wxGlade 0.3.5.1 on Wed Dec 01 12:41:42 2004 import wx class MainFrame(wx.Frame): def __init__(self, *args, **kwds): # begin wxGlade: MainFrame.__init__ kwds["style"] = wx.DEFAULT_FRAME_STYLE wx.Frame.__init__(self,...
petri/mp3recorder
wxRecorder.py
Python
gpl-3.0
6,708
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license """NewsML G2...
hlmnrmr/superdesk-core
superdesk/publish/formatters/newsml_g2_formatter.py
Python
agpl-3.0
23,163
from django.db import models from django.utils.translation import ugettext_lazy as _ import reversion from vertex.models import AbstractDatedModel __author__ = 'Jonathan Senecal <jonathan@zap.coop>' @reversion.register class ContactGroup(AbstractDatedModel): """ContactGroup model.""" name = models.CharFiel...
zapcoop/vertex
vertex_api/contacts/models/contactgroup.py
Python
agpl-3.0
837
""" This is some of the code behind 'cobbler sync'. Copyright 2006-2009, Red Hat, Inc and Others Michael DeHaan <michael.dehaan AT gmail> John Eckersberg <jeckersb@redhat.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 ...
kflavin/cobbler
cobbler/modules/manage_bind.py
Python
gpl-2.0
21,298
import numpy as np from lib.layer_utils import * """ Classes """ class TestRNN(object): def __init__(self, input_dim, hidden_dim, cell_type='rnn', dtype=np.float32, seed=None): self.params = {} self.grads = {} if cell_type in 'rnn': self.rnn = VanillaRNN(input_dim, hidden_dim)...
saketkc/hatex
2017_Fall/CSCI-599/Assignment02/lib/rnn.py
Python
mit
4,912
import logging from argparse import ArgumentParser from typing import Any, List, Optional from django.db import connection from zerver.lib.fix_unreads import fix from zerver.lib.management import ZulipBaseCommand, CommandError from zerver.models import Realm, UserProfile logging.getLogger('zulip.fix_unreads').setLe...
rishig/zulip
zerver/management/commands/fix_unreads.py
Python
apache-2.0
2,019
#imports the library shapefile to allow the shapefile operations ########################################################################## # # QGIS-meshing plugins. # # Copyright (C) 2012-2013 Imperial College London and others. # # Please see the AUTHORS file in the main source directory for a # full list ...
adamcandy/QGIS-Meshing
extras/shape/convertToShpFile.py
Python
lgpl-2.1
2,140
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.core import validators from django.db import models, migrations from django.utils import timezone class Migration(migrations.Migration): dependencies = [ ('contenttypes', '__first__'), ] operations = [ migration...
simbha/mAngE-Gin
lib/django/contrib/auth/migrations/0001_initial.py
Python
mit
4,002
# -*- coding: utf-8 -*- """Unit-test of module 'backend' in 'msbackup' package.""" import os import filecmp import shutil import subprocess import tempfile import unittest from msbackup.backend import File from test.mock import TextFile try: import configparser except ImportError: from six.moves import conf...
Aleksei-Badyaev/msbackup
test/test_backend.py
Python
mit
3,279
#!/usr/bin/env python # -*- coding: utf-8 -*- from PyQt4 import QtGui from gen.ui_component_view import Ui_ComponentView class ComponentView(QtGui.QMainWindow): def __init__(self, parent, comp): super(ComponentView, self).__init__(parent) self.comp = comp self.build_ui() def build_ui...
autonimo/autonimo
autonimo/views/component_view.py
Python
gpl-3.0
465
#!/usr/bin/env python # coding=utf-8 from __future__ import division, print_function, unicode_literals __all__ = ("__version__", "__author__", "__author_email__", "__url__") __version__ = "0.6.3" __author__ = 'Klaus Greff' __author_email__ = 'qwlouse@gmail.com' __url__ = "https://github.com/IDSIA/sacred"
kudkudak/sacred
sacred/__about__.py
Python
mit
311
from distutils.core import setup import jsbuild files = ['templates/*'] setup(name='JSBuild', version=".".join( map(str, jsbuild.__version__) ), description='JSBuild is a command-line utility that provides building CommonJS modules and packages for web', license='MIT', author=jsbuild.__author__, a...
azer/jsbuild
setup.py
Python
mit
904
from envs.common import * BROWSER = "firefox" DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'circle_test', 'USER': 'ubuntu', 'PASSWORD': '', 'HOST': '', 'PORT': '', } }
hobson/totalgood
totalgood/envs/ci.py
Python
mit
267
# Copyright 2022 The Flax 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 wri...
google/flax
examples/ppo/configs/default.py
Python
apache-2.0
1,954
#vim:set fileencoding=utf-8: # # apt-listchanges - Show changelog entries between the installed versions # of a set of packages and the versions contained in # corresponding .deb files # # Copyright (C) 2000-2006 Matt Zimmerman <mdz@debian.org> # Copyright (C) 2006 ...
2ndy/RaspIM
usr/share/apt-listchanges/DebianFiles.py
Python
gpl-2.0
8,582
class Solution(object): def numDecodings(self, s): """ :type s: str :rtype: int """ # @awice e0, e1, e2 = 1, 0, 0 for c in s: if c == '*': f0 = 9 * e0 + 9 * e1 + 6 * e2 f1 = f2 = e0 else: ...
zqfan/leetcode
algorithms/639. Decode Ways II/solution.py
Python
gpl-3.0
503
# # 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"); you may not us...
big-pegasus/spark
python/pyspark/shell.py
Python
apache-2.0
3,308
from django.db import models from django.contrib.auth.models import User from django.utils.translation import ugettext_lazy as _ from django.conf import settings from django.db.models.signals import post_save class Profile(models.Model): user = models.ForeignKey(User, unique=True, verbose_name=_('user'), related_...
thoas/i386
src/milkshape/application/internals/profiles/models.py
Python
mit
2,996
#!/usr/bin/env python """Implementations of various collections.""" import cStringIO import itertools import struct import logging from grr.lib import aff4 from grr.lib import config_lib from grr.lib import data_store from grr.lib import rdfvalue from grr.lib import registry from grr.lib import stats from grr.lib ...
ksmaheshkumar/grr
lib/aff4_objects/collections.py
Python
apache-2.0
27,653
from decimal import Decimal from django.conf import settings from django.utils.safestring import mark_safe def format(number, decimal_sep, decimal_pos=None, grouping=0, thousand_sep='', force_grouping=False, use_l10n=None): """ Get a number (as a number or string), and return it as a string, u...
frankvdp/django
django/utils/numberformat.py
Python
bsd-3-clause
2,515
# -*- coding: utf-8 -*- ############################################################################## # # Author: Pedro Manuel Baeza Romero # Copyright 2013 Servicios Tecnológicos Avanzados # Financed by AB Internet (http://www.abinternet.co.uk/) # # This program is free software: you can redistribute it a...
rschnapka/bank-statement-reconcile
account_statement_ofx_import/__openerp__.py
Python
agpl-3.0
1,802
import urllib from sqlalchemy import Boolean from sqlalchemy import Column from sqlalchemy import Integer from sqlalchemy import String from sqlalchemy import UniqueConstraint from sqlalchemy import event from sqlalchemy.orm import validates from sqlalchemy.ext.hybrid import hybrid_property from flaskwallet import Ba...
nkuttler/flaskwallet
walletapp/models.py
Python
bsd-3-clause
2,089
""" Autopsy Forensic Browser Copyright 2016-2020 Basis Technology Corp. Contact: carrier <at> sleuthkit <dot> org 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...
wschaeferB/autopsy
InternalPythonModules/android/contact.py
Python
apache-2.0
8,662
#!/usr/bin/env python # Copyright 2016 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. """A script to recover devices in a known bad state.""" import argparse import logging import os import psutil import signal import sy...
cricketclubucd/davisdragons
platform-tools/systrace/catapult/devil/devil/android/tools/device_recovery.py
Python
mit
7,578
from __future__ import print_function import os import sys import time from .utils import running_under_virtualenv from .color import * from .exceptions import MoultCommandError from .compat import str_ from . import __version__ __all__ = ('enable_debug', 'output', 'error', 'wrap', 'print_module') enable_debug = ...
tweekmonster/moult
moult/printer.py
Python
mit
5,854
#!/usr/bin/python2 # -*- coding: utf-8 -*- import os import jsontree import simplejson as json from collections import OrderedDict import common import logging from config import config from plugins import plugins class Decoder(object): """Decoders of binary packets from wireless node""" def __init__(sel...
roblad/sensmon
sensnode/decoder.py
Python
mit
2,661
import numpy as np import cudarray as ca from .base import PickleMixin _FLT_MIN = np.finfo(ca.float_).tiny class Loss(PickleMixin): # abll: I suspect that this interface is not ideal. It would be more # elegant if Loss only provided loss() and grad(). However, where should # we place the logic from fpro...
lre/deeppy
deeppy/loss.py
Python
mit
3,134
######################################################################## # File name: list_adhoc_commands.py # This file is part of: aioxmpp # # LICENSE # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Softw...
horazont/aioxmpp
examples/list_adhoc_commands.py
Python
lgpl-3.0
1,964
# -*- coding: utf-8 -*- """ Tools for IO coder: * Creating RecordingChannel and making links with AnalogSignals and SPikeTrains """ try: from collections.abc import MutableSequence except ImportError: from collections import MutableSequence import numpy as np from neo.core import (AnalogSignal, Block, ...
rgerkin/python-neo
neo/io/tools.py
Python
bsd-3-clause
5,011
# -*- coding: latin1 -*- ################################################################################################ # # import matplotlib.pyplot as plt import matplotlib.mlab as mlab import pylab import numpy as np import plotly import plotly.plotly as py import plotly.graph_objs as go import pandas as pd import...
amaurywalbert/twitter
statistics/graphics.py
Python
gpl-3.0
2,761
#!/usr/bin/python ### setup logging before all imports (before any logging is done as to prevent a default root logger) import CC_logging import logging import sys import os import glob from pycqed.instrument_drivers.library.Transport import IPTransport from pycqed.instrument_drivers.physical_instruments.QuTech.CC i...
DiCarloLab-Delft/PycQED_py3
examples/CC_examples/CC_run.py
Python
mit
1,177
import os from enigma import eEPGCache, getBestPlayableServiceReference, \ eServiceReference, iRecordableService, quitMainloop, eActionMap, setPreferredTuner from Components.config import config from Components.UsageConfig import defaultMoviePath from Components.SystemInfo import SystemInfo from Components.TimerSanit...
kajgan/e2
RecordTimer.py
Python
gpl-2.0
43,762
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
Lekensteyn/buildbot
worker/buildbot_worker/scripts/start.py
Python
gpl-2.0
5,407
import logging import re import pymel.core as pm import pymetanode as meta from . import colors from . import joints from . import links from . import nodes from .vendor.mayacoretools import preservedSelection LOG = logging.getLogger(__name__) MIRROR_METACLASS = 'pulse_mirror' MIRROR_THRESHOLD = 0.0001 class Mirr...
bohdon/maya-pulse
src/pulse/scripts/pulse/sym.py
Python
mit
40,745
import json import pytest from flask import url_for from flexmock import flexmock from tests.factories import DealGroupFactory, ProductTypeFactory from diilikone.models import Deal, User from diilikone.services import email @pytest.mark.usefixtures('request_ctx', 'database') class DealsPOSTTestCase(object): @py...
wappulehti-apy/diilikone-api
tests/views/test_deals.py
Python
mit
3,559
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2013 Nick Hall # # 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...
pmghalvorsen/gramps_branch
gramps/gen/filters/rules/family/_hastwins.py
Python
gpl-2.0
2,365
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import re from setuptools import find_packages, setup def get_version(filename): with open(filename) as fh: metadata = dict(re.findall(r'__([a-z]+)__ = \'([^\']+)\'', fh.read())) return metadata['version'] wi...
naglis/pyisaf
setup.py
Python
bsd-3-clause
1,574
# 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 may ...
Azure/azure-sdk-for-python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_load_balancer_load_balancing_rules_operations.py
Python
mit
8,806
def char2num(s): return {'0':0,'1':1,'2':2,'3':3,'4':4,'5':5,'6':6,'7':7,'8':8,'9':9,}[s] def kevin_num(x,y): return x*10+y print char2num('1') print map(char2num, '2123') print reduce(kevin_num, map(char2num, '1234'))
kevinhikali/ml_kevin
py_demo/reduce.py
Python
gpl-3.0
232
from uuid import uuid4 from os.path import dirname, join from contextlib import contextmanager import json from dateutil.parser import parse as parse_datetime def load_cities(filename): with open(filename) as file: cities = json.load(file) return cities cities = load_cities(join(dirname(__file__...
mapzen/data-pages
App/data.py
Python
mit
1,947
#Boa:Frame:menu_input_penduduk import wx import wx.lib.buttons import kk_sementara def create(parent): return menu_input_penduduk(parent) [wxID_MENU_INPUT_PENDUDUK, wxID_MENU_INPUT_PENDUDUKBUTTON_INPUT, ] = [wx.NewId() for _init_ctrls in range(2)] class menu_input_penduduk(wx.Frame): def _init_ctrls(self, ...
GedheFoundation/sidesa2.0
menu_pilihan_penduduk.py
Python
gpl-2.0
1,217
# -*- coding: utf-8 -*- """ Created on Fri Jan 8 17:13:29 2016 用imshow()函数绘制硅原子图像 @author: nightwing """ from numpy import loadtxt import matplotlib.pyplot as plt data = loadtxt("stm.txt", float) plt.imshow(data, origin="lower") plt.colorbar() plt.gray() plt.show()
WuShichao/computational-physics
Graphs/density plots/silicon.py
Python
gpl-3.0
288
from __future__ import unicode_literals from django_evolution.mutations import AddField from django.db import models MUTATIONS = [ AddField('Group', 'invite_only', models.BooleanField, initial=False), ]
custode/reviewboard
reviewboard/reviews/evolutions/group_invite_only.py
Python
mit
210
# coding=utf-8 """ Send metrics to a [OpenTSDB](http://opentsdb.net/) server. [OpenTSDB](http://opentsdb.net/) is a distributed, scalable Time Series Database (TSDB) written on top of [HBase](http://hbase.org/). OpenTSDB was written to address a common need: store, index and serve metrics collected from comput...
gg7/diamond
src/diamond/handler/tsdb.py
Python
mit
13,125
"""mainsite URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-b...
iraquitan/political-advisor
web/mainsite/urls.py
Python
gpl-3.0
811
#!/usr/local/bin/python import sys, time, math, datetime class Inplace: def __init__(self, title="", stream=sys.stderr): self.stream, self.title = stream, title self.last = 0 def tick(self, s): if not self.stream: return w = "\r%s%s"%(self.title, s) self.las...
butterworth1492/Visualizing-Cavity-Viruses
scurve/scurve/progress.py
Python
bsd-2-clause
2,636
from plugins.SHomePlugin import SHomePlugin import logging import sqlite3 import os class MemoryPlugin(SHomePlugin): def __init__(self, params): self._filename = params['filename'] if 'filename' in params else 'memory.db' try: if self._filename not in os.listdir('.'): ...
Cirreth/shome
plugins/memory/MemoryPlugin.py
Python
mit
1,741
#!/usr/bin/env python # # 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 # "...
lavjain/incubator-hawq
src/test/unit/find_mock_objs.py
Python
apache-2.0
3,831
import serial class SerialConnection: """RS-232 connection to the Agilent power supply""" def __init__(self, port='/dev/usb/ttyUSB0', baudrate=9600, parity=serial.PARITY_NONE, bytesize=serial.EIGHTBITS): """Initialize the connection""" self.serial = serial.Serial(port=port, baudrate=baudrate, parity=parity...
delaere/aaptos
SerialConnection.py
Python
gpl-2.0
1,127
# coding: utf8 # navertrans.py # 1/22/2015 jichi # # Japanese and multilingual: http://livedoor-translate.naver.jp # Korean only: http://translate.naver.com # # Example: # API: http://translate.naver.com/translate.dic # Post data: query=hello&srcLang=en&tarLang=ko&highlight=1&hurigana=1 # # Only limited language pairs ...
Dangetsu/vnr
Frameworks/Sakura/py/libs/naver/navertrans.py
Python
gpl-3.0
7,403
# -*- coding: utf-8 -*- import re import time import random import string import sqlite3 import logging import tablib from contextlib import contextmanager from cookbot.colorops import origin_dist class NotFound(Exception): pass class CookDB(object): def __init__(self, **opts): self.db = sqlite3.co...
pjwerneck/cookbot
cookbot/db.py
Python
mit
2,155
# -*- encoding: utf-8 -*- # Django settings for EnceFAL project. import os from conf import * ADMINS = ( # ('Nilovna Bascunan-Vasquez', 'contact@nilovna.com'), ) MANAGERS = ADMINS # Local time zone for this installation. Choices can be found here: # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name # alth...
nilovna/EnceFAL
project/settings.py
Python
gpl-3.0
3,241
# -*- coding: utf-8 -*- """ werkzeug.serving ~~~~~~~~~~~~~~~~ There are many ways to serve a WSGI application. While you're developing it you usually don't want a full blown webserver like Apache but a simple standalone one. From Python 2.5 onwards there is the `wsgiref`_ server in the standa...
nateprewitt/werkzeug
werkzeug/serving.py
Python
bsd-3-clause
25,464
#!/usr/bin/env python # coding: utf-8 # pylint: disable=global-statement """This module runs dev_appserver.py, creates virtualenv, performs requirements check, creates necessary directories """ from distutils import spawn import argparse import os import platform import shutil import sys #############################...
wodore/wodore-ng
run.py
Python
mit
9,196
#! /usr/bin/env python #----------------------------------------------------------------------------- # Copyright (c) 2013, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distr...
bl4ckdu5t/registron
pyinstaller.py
Python
mit
555
# (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com> # (c) 2013, Javier Candeira <javier@candeira.com> # (c) 2013, Maykel Moya <mmoya@speedyrails.com> # # 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...
gentledevil/ansible
lib/ansible/plugins/lookup/password.py
Python
gpl-3.0
5,268
""" ========================================================================== Fitting an Elastic Net with a precomputed Gram Matrix and Weighted Samples ========================================================================== The following example shows how to precompute the gram matrix while using weighted samples...
manhhomienbienthuy/scikit-learn
examples/linear_model/plot_elastic_net_precomputed_gram_matrix_with_weighted_samples.py
Python
bsd-3-clause
2,016
import logging import math logger = logging.getLogger(__name__) # Calculate orientation and distances based on two locations # https://www.movable-type.co.uk/scripts/latlong.html # Earth's radius in meters earth_radius = 6371e3 # Stationary radius in meters stationary_radius = 10 def calculate_orientation(locati...
EMSTrack/WebServerAndClient
emstrack/latlon.py
Python
bsd-3-clause
1,963
import logging import hashlib from django.conf import settings from django.core.cache import get_cache from django.db import IntegrityError from django.template.response import TemplateResponse from django.utils.encoding import DjangoUnicodeDecodeError from django.utils.html import strip_spaces_between_tags as minify...
torchbox/django-nginx-memcache
nginx_memcache/cache.py
Python
bsd-3-clause
7,182
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
ncliam/serverpos
openerp/addons/mail/tests/test_mail_features.py
Python
agpl-3.0
59,265
from .image_loader import Database_loader from .image_loader import Test_loader from .model import Model from .baseline_histograms import train_classifier from .construct_DB import construct_DB
NicoRahm/CGvsPhoto
CGvsPhoto/__init__.py
Python
mit
193
# -*- coding: utf-8 -*- import unittest class Game(object): def __init__(self): self.rolls = [] def roll(self, pins): self.rolls.append(pins) def score(self): score = 0 frame_index = 0 for i in range(0, 10): if self._is_strike(frame_index): ...
Alex-Diez/python-tdd-katas
old-katas/bowling-kata/day-1.py
Python
mit
2,276
""" Django settings for girlsgoit project. Generated by 'django-admin startproject' using Django 1.11.3. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import ...
girlsgoit/GirlsGoIT
girlsgoit/settings/local.py
Python
mit
3,228
# package information. INFO = dict( name = "geopy.jp", description = "Geocoding library for Python.", author = "Green Latte", author_email = "k.takeuchi@warrantee.co.jp", license = "MIT License", url = "https://github.com/green-latte/geopy.jp", classifiers = [ "Programming La...
green-latte/geopy.jp
info.py
Python
mit
401
#!/usr/bin/python3 # -*- coding: utf-8 -*- # # Copyright © 2015 Mattia Rizzolo <mattia@mapreri.org> # Licensed under GPL-2 # # Depends: python3 python-apt python3-yaml # # Import the content of the notes.git repository into the reproducible database from reproducible_common import * import os import apt import yaml i...
lamby/jenkins.debian.net
bin/reproducible_notes.py
Python
gpl-2.0
6,312
# -*- coding: utf-8 -*- # Copyright 2016 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 # # Un...
karllessard/tensorflow
tensorflow/python/keras/preprocessing/text_test.py
Python
apache-2.0
5,110
#!/usr/local/bin/python3 """ created_by: Aninda Manocha created_date: 3/5/2015 last_modified_by: Keshav Patel last_modified_date: 3/6/2015 """ import constants import utils import json from sql.session import Session from sql.user import User #Format of session #requestType: addSession #token: "strin...
NCSSM-CS/CSAssess
controller/addSession.py
Python
mit
655
# -*- coding: utf-8 -*- # Copyright(C) 2012-2014 Romain Bignon # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your...
sputnick-dev/weboob
modules/bred/dispobank/browser.py
Python
agpl-3.0
4,311
import math import pygame def update_image_rect(image, rect): image_rect = image.get_rect() image_rect.x = rect.x image_rect.y = rect.y def distance_between_rects(rect1, rect2): (r1_center_x, r1_center_y) = rect1.center (r2_center_x, r2_center_y) = rect2.center x_squared = (r2_center_x - r1_ce...
Daihiro/ldjam37
ld37/common/utils/libutils.py
Python
mit
1,884
import gpx_utils def test_get_name(): assert gpx_utils.get_name({ 'name': u'El Nomo', 'name:en': u'The Name' }) == u'The Name', 'Wrong name from english-name' assert gpx_utils.get_name({ 'name': u'El Nomo', 'name:no': u'Navnet' }) == u'El Nomo', 'Wrong name from local-n...
Skippern/gpxupload
gpx/test_gpx_utils.py
Python
gpl-3.0
498
import os import json from flask import g from flask import Flask from flask import jsonify from flask import request from flask import url_for from flask import redirect from flask import Response from flask import render_template import loader from tachyon import bridge HTTP_NOT_ACCEPTABLE = 406 HTTP_UNPROCESSABL...
neontribe-ansible/neontower
neontower/app.py
Python
mit
9,112
from setuptools import setup, find_packages requires = [ 'geojson', 'bottle', 'pyparsing==1.5.7', 'networkx', 'waitress', 'flup' ] setup(name='metro4all', version='0.0', description='metro4all', classifiers=[ "Programming Language :: Python", "Framework :: Pyl...
nextgis/metro4all
web/setup.py
Python
gpl-2.0
715
# -*- coding: utf-8 -*- # Copyright 2013 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 require...
CapOM/ChromiumGStreamerBackend
tools/telemetry/third_party/gsutilz/gslib/tests/testcase/integration_testcase.py
Python
bsd-3-clause
18,649
from django.db import models from django.db import migrations from django.conf import settings import django.utils.timezone import mptt.fields import tagging.fields import zinnia.settings import zinnia.models_bases.entry class Migration(migrations.Migration): dependencies = [ ('auth', '0001_initial'), ...
jnfsmile/zinnia
zinnia/migrations/0001_initial.py
Python
bsd-3-clause
8,435
#!/usr/bin/env python """ This module tries to retrieve as much platform-identifying data as possible. It makes this information available via function APIs. If called from the command line, it prints the platform information concatenated as single string to stdout. The output format is useable as par...
pniedzielski/fb-hackathon-2013-11-21
src/repl.it/jsrepl/extern/python/unclosured/lib/python2.7/platform.py
Python
agpl-3.0
52,280
import urllib.request import urllib.parse import json content=input("请输入需要翻译的内容:") url = 'http://fanyi.youdao.com/translate?smartresult=dict&smartresult=rule&smartresult=ugc&sessionFrom=dict2.index' #第一种方法,在申请Request的时候,将Head传入 ''' head = {} head['User-Agent'] = 'Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:...
yuwei0927/python
Python提交Post表单.py
Python
gpl-3.0
1,158
# -*- coding: utf-8 -*- """Qurawl Main""" #### from __future__ import absolute_import from __future__ import unicode_literals import itertools as it import random as rand import difflib as diff #### import common.debugit as debugit import qurawl.regparse as rp from qurawl.level import * from qurawl.items import * ...
yipyip/Qurawl
qurawl/qurawl.py
Python
mit
5,127
import _plotly_utils.basevalidators class ColorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__( self, plotly_name="color", parent_name="treemap.marker.line", **kwargs ): super(ColorValidator, self).__init__( plotly_name=plotly_name, parent_name=pare...
plotly/plotly.py
packages/python/plotly/plotly/validators/treemap/marker/line/_color.py
Python
mit
467
# Copyright 2019 The TensorFlow Probability 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 o...
tensorflow/probability
tensorflow_probability/python/internal/backend/meta/gen_linear_operators.py
Python
apache-2.0
10,085
"""Chebyshev Rational Approximation Method module Implements two different forms of CRAM for use in openmc.deplete. """ import numbers import numpy as np import scipy.sparse as sp import scipy.sparse.linalg as sla from openmc.checkvalue import check_type, check_length from .abc import DepSystemSolver __all__ = ["C...
mit-crpg/openmc
openmc/deplete/cram.py
Python
mit
6,739
from django.shortcuts import render from django.http import HttpResponse from rest_framework import generics from .models import * from .serializers import * class ListCreateProject(generics.ListCreateAPIView): queryset = Project.objects.all() serializer_class = ProjectSerializer
vinayraghavan/timetracker
tracker_api/views.py
Python
apache-2.0
291
# evolve.params # Evolution Parameters # # Author: Benjamin Bengfort <benjamin@bengfort.com> # Created: Tue May 06 14:02:22 2014 -0400 # # Copyright (C) 2014 Bengfort.com # For license information, see LICENSE.txt # # ID: params.py [] benjamin@bengfort.com $ """ Evolution Parameters """ ###########################...
mclumd/swarm-simulator
evolve/params.py
Python
mit
1,288
# -*- coding: utf-8 -*- # Copyright (C) 2014-present Taiga Agile LLC # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later ver...
taigaio/taiga-back
taiga/projects/likes/models.py
Python
agpl-3.0
1,883
import os import re import subprocess import tempfile import time import sys from ray.autoscaler._private.cli_logger import cli_logger, cf CONN_REFUSED_PATIENCE = 30 # how long to wait for sshd to run _redirect_output = False # Whether to log command output to a temporary file _allow_interactive = True # whether ...
pcmoritz/ray-1
python/ray/autoscaler/_private/subprocess_output_util.py
Python
apache-2.0
15,391
# Copyright 2013 Huawei Technologies Co.,LTD. # # 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...
queria/my-tempest
tempest/api/compute/admin/test_hosts_negative.py
Python
apache-2.0
6,476
''' generic functions ''' def myfunc( x:int ): print( x * 100 ) def myfunc( x:string ): print( x + 'world' ) def main(): myfunc( 10 ) myfunc( 'hello' )
rootfs/Rusthon
regtests/c++/generics.py
Python
bsd-3-clause
159
from django.core.management.base import BaseCommand def module_to_dict(module, omittable=lambda k: k.startswith('_')): """Convert a module namespace to a Python dictionary.""" return {k: repr(v) for k, v in module.__dict__.items() if not omittable(k)} class Command(BaseCommand): help = """Displays diffe...
camilonova/django
django/core/management/commands/diffsettings.py
Python
bsd-3-clause
1,955
import pyglet class Colors( object ): colors = ['black','orange','red','yellow','cyan','magenta','green','blue', 'black', # don't remove 'rotate','scale','liquid','waves','twirl','lens', 'black' ] # don't remove BLACK,ORANGE,RED,YELLOW,CYAN,MAGENTA,GREE...
shadowmint/nwidget
lib/cocos2d-0.5.5/samples/tetrico/colors.py
Python
apache-2.0
592
# Copyright 2015 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 or agreed to in writing, s...
dhermes/google-cloud-python
dns/tests/unit/test__http.py
Python
apache-2.0
2,719
#!/usr/bin/python # # This file is part of django-socialize project. # # Copyright (C) 2011-2020 William Oliveira de Lagos <william.lagos@icloud.com> # # Socialize is free software: you can redistribute it and/or modify # it under the terms of the Lesser GNU General Public License as published by # the Free Software Fo...
efforia/django-socialize
socialize/providers/google.py
Python
lgpl-3.0
3,560
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('messaging', '0003_musicianmusicianconversation_initializer'), ] operations = [ migrations.AlterModelOptions( nam...
lancekrogers/music-network
cleff/messaging/migrations/0004_auto_20150801_2121.py
Python
apache-2.0
1,040