repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
15
997
alpha_frac
float64
0.25
0.97
autogenerated
bool
1 class
siddharthraja/AI
Sampling - metropolis, gibbs/sampling.py
1
16779
import sys # from importlib import reload if('pbnt/combined' not in sys.path): sys.path.append('pbnt/combined') from exampleinference import inferenceExample from random import randint import numpy as np from Node import BayesNode from Graph import BayesNet from numpy import zeros, float32 import Distribution fro...
mit
2,625,154,690,473,991,000
31.582524
400
0.56374
false
cyberbikepunk/job-spiders
joby/tests/utilities.py
1
2246
""" Utility functions and classes for the test suite. """ from codecs import open from requests import get from scrapy import Request from scrapy.http import HtmlResponse from importlib import import_module from slugify import slugify from os.path import join, exists from joby.settings import TEST_ASSETS_DIR class ...
mit
-4,277,102,437,244,125,000
35.819672
103
0.607302
false
sxjscience/mxnet
tests/python/unittest/test_executor.py
1
6701
# 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 u...
apache-2.0
5,129,683,960,537,776,000
39.36747
84
0.520221
false
klebercode/protocolle
protocolle/core/admin.py
1
1442
# coding: utf-8 from django.contrib import admin from protocolle.core.models import (TipoDocumento, Carater, Natureza, Status, TipoInstituicao, Grupo) class TipoDocumentoAdmin(admin.ModelAdmin): fields = ['nome'] list_per_page = 15 list_display = ['nome'] search_f...
mit
2,028,175,029,469,497,000
24.298246
69
0.668516
false
TACC/DisplayCluster
examples/displaycluster.py
1
2126
#!/usr/bin/python # example launch script for DisplayCluster, executed by startdisplaycluster # this should work for most cases, but can be modified for a particular # installation if necessary import os import xml.etree.ElementTree as ET import subprocess import shlex # get environment variable for the base Display...
bsd-2-clause
8,378,014,200,625,861,000
29.371429
180
0.661806
false
llvtt/mongo-orchestration-1
mongo_orchestration/process.py
1
10692
#!/usr/bin/python # coding=utf-8 # Copyright 2012-2014 MongoDB, 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 appl...
apache-2.0
3,881,842,002,143,383,600
32.835443
120
0.60073
false
hirofumi0810/tensorflow_end2end_speech_recognition
examples/csj/training/train_ctc.py
1
18008
#! /usr/bin/env python # -*- coding: utf-8 -*- """Train the CTC model (CSJ corpus).""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from os.path import join, isfile, abspath import sys import time import tensorflow as tf from setproctitle import setproc...
mit
4,144,911,333,285,178,000
43.424691
114
0.525789
false
bigdig/vnpy
vnpy/app/cta_strategy/ctaTemplatePatch/utility.py
1
2618
# encoding: UTF-8 ''' 本文件包含了CTA引擎中的策略开发用模板。 添加了一些基本的策略属性,变量。不做下单逻辑 ''' from vnpy.app.cta_strategy.base import EngineType from datetime import MINYEAR import logging import numpy as np from datetime import datetime,time,date,timedelta import json,time class DateTimeEncoder(json.JSONEncoder): def default(self, o): ...
mit
9,177,389,331,629,231,000
27.792683
97
0.550847
false
s3rvac/retdec-python
tests/matchers.py
1
1319
# # Project: retdec-python # Copyright: (c) 2015 by Petr Zemek <s3rvac@gmail.com> and contributors # License: MIT, see the LICENSE file for more details # """Matchers for tests.""" import abc class Matcher(metaclass=abc.ABCMeta): """A base class of all matchers.""" @abc.abstractmethod def __eq__(se...
mit
6,625,008,059,489,529,000
23.886792
80
0.579227
false
giacomov/3ML
threeML/utils/bayesian_blocks.py
1
9886
# Author: Giacomo Vianello (giacomov@stanford.edu) import logging import sys import numexpr import numpy as np from threeML.io.progress_bar import progress_bar logging.basicConfig(level=logging.INFO) logger = logging.getLogger("bayesian_blocks") __all__ = ["bayesian_blocks", "bayesian_blocks_not_unique"] def bay...
bsd-3-clause
6,241,699,055,371,695,000
28.248521
124
0.606312
false
WeakGroup/twitter-rec
interface/website/website/settings.py
1
2100
""" Django settings for website project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) im...
gpl-2.0
3,130,661,027,178,072,000
22.595506
71
0.713333
false
dmrtsvetkov/flowercoin
qa/rpc-tests/util.py
1
12418
# Copyright (c) 2014 The Bitcoin Core developers # Copyright (c) 2014-2015 The Flowercoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Helpful routines for regression testing # # Add python-bitcoinrpc to modu...
mit
-610,950,820,509,075,100
35.098837
110
0.631905
false
dims/nova
nova/cells/rpcapi.py
1
28170
# Copyright (c) 2012 Rackspace Hosting # All Rights Reserved. # Copyright 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/license...
apache-2.0
-2,072,031,802,108,248,800
42.674419
79
0.589173
false
line/line-bot-sdk-python
tests/models/serialize_test_case.py
1
2551
# -*- 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
apache-2.0
-5,113,099,517,172,017,000
28.321839
87
0.619757
false
Anber/django-extended-messages
extended_messages/api.py
1
2318
# Slightly modified django.contrib.messages.api from django.contrib.messages import constants from django.contrib.messages.api import get_messages, get_level, set_level, MessageFailure def add_message(request, level, message, extra_tags='', fail_silently=False, sticky=False): """ Attempts to add a message to ...
bsd-3-clause
-7,817,217,899,636,346,000
38.965517
91
0.667386
false
alexm98/dotfiles
spacemacs/elpa/live-py-mode-20170928.2107/report_builder.py
1
9236
import re import sys import traceback class ReportBuilder(object): def __init__(self, message_limit=None): self.messages = [] self.assignments = [] self.message_count = 0 self.message_limit = message_limit self.stack_block = None # (first_line, last_line) numbers, not inde...
gpl-3.0
-5,489,539,064,284,392,000
36.392713
79
0.562906
false
neutrons/Licorne-Py
UI-playground/layerplot.py
1
2806
from __future__ import (absolute_import, division, print_function) from PyQt5 import QtCore, QtWidgets import sys import numpy as np from layer import Layer, MSLD from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.figure import Figure import matplotlib.pyplot as plt import...
gpl-3.0
-8,143,628,558,970,020,000
35.921053
136
0.632217
false
breunigs/livestreamer
src/livestreamer/plugins/filmon.py
1
4083
import re import requests from livestreamer.compat import urlparse from livestreamer.exceptions import PluginError, NoStreamsError from livestreamer.plugin import Plugin from livestreamer.stream import RTMPStream from livestreamer.utils import urlget, urlopen, res_json AJAX_HEADERS = { "Referer": "http://www.film...
bsd-2-clause
1,767,515,076,056,671,200
27.957447
92
0.557188
false
ooici/marine-integrations
mi/dataset/driver/vel3d_l/wfp/test/test_driver.py
1
35134
""" @package mi.dataset.driver.vel3d_l.wfp.test.test_driver @file marine-integrations/mi/dataset/driver/vel3d_l/wfp/driver.py @author Steve Myerson (Raytheon) @brief Test cases for vel3d_l_wfp driver (for both telemetered and recovered data) USAGE: Make tests verbose and provide stdout * From the IDK ...
bsd-2-clause
3,705,683,549,403,056,600
43.217503
106
0.584021
false
cg31/tensorflow
tensorflow/contrib/layers/python/layers/feature_column.py
1
77352
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
4,226,114,984,808,948,700
39.350548
93
0.639518
false
amplifylitco/asiaq
disco_aws_automation/disco_group.py
1
12582
"""Contains DiscoGroup class that is above all other group classes used""" import logging from .base_group import BaseGroup from .disco_autoscale import DiscoAutoscale from .disco_elastigroup import DiscoElastigroup logger = logging.getLogger(__name__) class DiscoGroup(BaseGroup): """Implementation of DiscoGrou...
bsd-2-clause
-5,459,240,590,080,118,000
41.363636
110
0.619774
false
Myoldmopar/EPLaunchLight
test/test_base.py
1
2718
import os import sys import unittest import threading # add the source directory to the path so the unit test framework can find it sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'EPLaunchLite')) try: from FileTypes import FileTypes has_gtk = True except ImportError as e: ...
bsd-3-clause
739,740,589,794,984,200
37.28169
98
0.679176
false
silverfernsys/agentserver
agentserver/utils/log.py
1
1886
import logging from ip import get_ip log_vals = { 'CRITICAL': logging.CRITICAL, 'ERROR': logging.ERROR, 'WARNING': logging.WARNING, 'INFO': logging.INFO, 'DEBUG': logging.DEBUG, 'NOTSET': logging.NOTSET} class LoggingError(Exception): def __init__(self, arg): self.message = 'Log...
bsd-3-clause
-6,249,568,894,713,753,000
30.433333
83
0.590668
false
unintended/Cohen
misc/media_server_observer.py
1
2131
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Licensed under the MIT license # http://opensource.org/licenses/mit-license.php # # Copyright 2009, Benjamin Kampmann <ben.kampmann@gmail.com> # Copyright 2014, Hartmut Goebel <h.goebel@crazy-compilers.com> from twisted.internet import reactor from coherence.base impo...
mit
-1,282,085,470,347,691,800
33.370968
96
0.684186
false
erigones/api_ipf
tests.py
1
6737
from django.test import TestCase from rest_framework import status from eszone_ipf.settings import BASE_DIR, API_VERSION_PREFIX class ConfigFileTestCase(TestCase): url = '/{}/api_ipf/config/'.format(API_VERSION_PREFIX) url_act = ''.join([url, 'activate/']) def test_ipf_form_post(self): title = 't...
bsd-3-clause
5,609,047,805,943,410,000
38.869822
80
0.582604
false
jobovy/gaia_tools
scripts/download_dr2.py
1
3753
# Script to sniff whether DR2 has appeared and grab everything once it appears import os import time from datetime import datetime, timedelta import pytz import subprocess import hashlib _DR2_URL= 'http://cdn.gea.esac.esa.int/Gaia/gdr2/' _MD5_FILENAME= 'MD5SUM.txt' _CEST= pytz.timezone('Europe/Brussels') _TIME_START_...
mit
-5,076,307,777,478,934,000
38.505263
95
0.563816
false
cihologramas/pyueye
ueye/__init__.py
1
1874
#!/usr/bin/env python # -*- coding: UTF-8 -*- # Copyright (c) 2010, Combustion Ingenieros Ltda. # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistribution...
bsd-3-clause
4,809,739,865,831,521,000
54.058824
82
0.714744
false
NickBeeuwsaert/SuperCanvas
doc/bezier_subdivision.py
1
3896
#!/usr/bin/env python lerp = lambda s, e, t: tuple(S + (E-S)*t for S, E in zip(s,e)) t = 0.65 cp0, cp1, cp2, cp3 = ((0, 300), (25, 50), (450, 50), (500,300)) M0 = lerp(cp0, cp1, t) M1 = lerp(cp1, cp2, t) M2 = lerp(cp2, cp3, t) M3 = lerp(M0, M1, t) M4 = lerp(M1, M2, t) M5 = lerp(M3, M4, t) print("""<svg width="100%...
mit
-7,812,529,571,077,760,000
43.272727
176
0.490246
false
gameduell/dask
dask/utils.py
1
30745
from __future__ import absolute_import, division, print_function import codecs import functools import inspect import io import math import os import re import shutil import struct import sys import tempfile from errno import ENOENT from collections import Iterator from contextlib import contextmanager from importlib ...
bsd-3-clause
1,220,396,701,005,305,600
27.97738
98
0.565295
false
sunlightlabs/tcamp
tcamp/reg/migrations/0005_auto__add_field_ticket_checked_in.py
1
12104
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Ticket.checked_in' db.add_column(u'reg_ticket', 'checked_...
bsd-3-clause
6,451,636,792,326,531,000
78.117647
187
0.549901
false
getsentry/raven-aiohttp
tests/test_transport.py
1
4590
import asyncio import logging from unittest import mock import pytest from raven_aiohttp import AioHttpTransport from tests.utils import Logger pytestmark = pytest.mark.asyncio @asyncio.coroutine def test_basic(fake_server, raven_client, wait): server = yield from fake_server() client, transport = raven_c...
bsd-3-clause
-4,564,477,106,730,746,000
24.081967
70
0.64902
false
asteriogonzalez/pytest-study
pytest_study.py
1
6960
""" In situations where we are developing an application or library that will be use to create long computation reports or results, we want to execute the long process only when all the project tests are passed. pytest provide a great support for creating test suits, parallel execution, reports, command line, IDE of C...
mit
-3,178,928,119,728,460,300
33.285714
76
0.614368
false
cortext/crawtext
crawtext/database/database.py
1
4822
#!/usr/bin/env python # -*- coding: utf-8 -*- __name__ == "database" import pymongo import logging import re from datetime import datetime from copy import copy import os, sys class Database(object): '''Database creation''' def __init__(self, database_name, local=False, debug=False): try: ...
mit
3,488,452,641,483,784,000
30.51634
104
0.549564
false
ukBaz/python-bluezero
tests/test_gatt.py
1
3714
"""Automated testing of GATT functionality using unittest.mock.""" import sys import unittest from unittest.mock import MagicMock from unittest.mock import patch import tests.obj_data from bluezero import constants adapter_props = tests.obj_data.full_ubits def mock_get(iface, prop): if iface == 'org.bluez.Device...
mit
-5,795,354,547,365,733,000
39.813187
106
0.594507
false
alexgonzl/TreeMaze
PythonControl/MazeMaster_PyCMDv2.py
1
13920
#!/usr/bin/python3 ### # Master controller for the TreeMaze. It communicates with the arduino through serial port. # Receives data through GPIO inputs and serial. ### import threading from MazeHeader_PyCMDv2 import * PythonControlSet = ['T2','T3a','T3b','T3c','T3d','T3e','T3f','T3g','T3h','T3i','T3j', ...
mit
3,080,016,546,511,445,500
43.903226
112
0.382687
false
gecos-team/gecos-firstboot
firstboot/serverconf/ServerConf.py
1
3755
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- # This file is part of Guadalinex # # This software 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, ...
gpl-2.0
7,633,553,126,649,568,000
30.537815
83
0.607248
false
mwisslead/vfp2py
testbed/conversion.py
1
6505
# Generated from conversion.g4 by ANTLR 4.8 # encoding: utf-8 from antlr4 import * from io import StringIO import sys if sys.version_info[1] > 5: from typing import TextIO else: from typing.io import TextIO def serializedATN(): with StringIO() as buf: buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7...
mit
2,564,314,225,505,550,000
30.57767
103
0.569254
false
darvelo/panel
widgets/net.py
1
2233
from PyQt5 import QtWidgets from PyQt5 import QtCore import os import glob from .chart import Chart def read_file(path): with open(path, 'r') as fh: return fh.read().strip() class NetworkUsageProvider(object): delay = 1 def __init__(self, main_window): self.network_enabled = False ...
mit
-6,281,391,231,829,057,000
38.875
90
0.559337
false
CenterForOpenScience/lookit-api
accounts/serializers.py
1
4065
from rest_framework_json_api import serializers from accounts.models import Child, DemographicData, User from api.serializers import ( PatchedHyperlinkedRelatedField, UuidHyperlinkedModelSerializer, ) from studies.models import Lab class LabSerializer(UuidHyperlinkedModelSerializer): resource_name = "lab...
apache-2.0
6,840,125,021,426,943,000
26.466216
81
0.55449
false
bahamas10/Viridian
AmpacheTools/plugins/template.py
1
1597
#!/usr/bin/env python ### BEGIN LICENSE # Copyright (C) 2010 Dave Eddy <dave@daveeddy.com> # 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 Software Foundation. # # This program is distributed in the hope ...
bsd-3-clause
957,446,448,431,151,500
43.361111
86
0.692549
false
jamestwebber/scipy
scipy/stats/tests/test_binned_statistic.py
1
15125
from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import assert_allclose from pytest import raises as assert_raises from scipy.stats import (binned_statistic, binned_statistic_2d, binned_statistic_dd) from scipy._lib.six import u from .comm...
bsd-3-clause
-4,939,175,757,485,474,000
30.185567
79
0.559008
false
pioneers/PieCentral
shepherd/dawn_server.py
1
2480
import threading import json import time import queue import gevent # pylint: disable=import-error from flask import Flask, render_template # pylint: disable=import-error from flask_socketio import SocketIO, emit, join_room, leave_room, send # pylint: disable=import-error from Utils import * from LCM import * HOST_URL...
apache-2.0
4,071,755,422,820,970,500
41.758621
101
0.659677
false
brenthuisman/phd_tools
graph.spotprofiles.py
1
7377
#!/usr/bin/env python import plot, numpy as np,auger,image,rtplan from scipy.ndimage.filters import gaussian_filter ########################################################################################################### smooth_param = 8.5 #20 mm FWHM volume_offset=-141.59+7.96#spot sources pg29 = image.image('d...
lgpl-3.0
6,576,384,876,859,362,000
41.889535
127
0.6382
false
ronekko/chainer
chainer/distributions/bernoulli.py
1
5543
import chainer from chainer.backends import cuda from chainer import distribution from chainer.functions.activation import sigmoid from chainer.functions.array import broadcast from chainer.functions.array import where from chainer.functions.math import exponential from chainer.functions.math import logarithm_1p from c...
mit
6,518,292,464,861,377,000
29.125
75
0.571712
false
nuagenetworks/vspk-python
vspk/v5_0/nucontainer.py
1
29058
# -*- coding: utf-8 -*- # # Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyrigh...
bsd-3-clause
-6,679,579,384,259,088,000
29.081781
906
0.576055
false
sunze/py_flask
venv/lib/python3.4/site-packages/alembic/environment.py
1
32950
from .operations import Operations from .migration import MigrationContext from . import util class EnvironmentContext(object): """Represent the state made available to an ``env.py`` script. :class:`.EnvironmentContext` is normally instantiated by the commands present in the :mod:`alembic.command` m...
mit
2,376,002,507,410,158,600
38.319809
79
0.615781
false
pli3/pli3-openpli3
bitbake/lib/bb/fetch2/git.py
1
12793
# ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ BitBake 'Fetch' git implementation git fetcher support the SRC_URI with format of: SRC_URI = "git://some.host/somepath;OptionA=xxx;OptionB=xxx;..." Supported SRC_URI options are: - branch The git branch to retrieve from. ...
gpl-2.0
7,850,380,181,073,448,000
37.649547
140
0.59853
false
adybbroe/pygac
pygac/calibration.py
1
27049
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2014-2015, 2019 Pytroll Developers # Author(s): # Martin Raspaud <martin.raspaud@smhi.se> # Abhay Devasthale <abhay.devasthale@smhi.se> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Pub...
gpl-3.0
7,217,521,221,545,139,000
47.47491
82
0.409553
false
sgabe/Enumerator
enumerator/lib/services/ssl.py
1
2170
#!/usr/bin/env python """ The SSL module performs ssl-related enumeration tasks. @author: Gabor Seljan (gabor<at>seljan.hu) @version: 1.0 """ import sys from ..config import Config from ..process_manager import ProcessManager from ..generic_service import GenericService class SslEnumeration(GenericService, ProcessMa...
mit
-6,150,778,650,805,814,000
33.444444
145
0.614747
false
Azure/azure-sdk-for-python
sdk/tables/azure-data-tables/azure/data/tables/_generated/operations/_service_operations.py
1
13459
# 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 ...
mit
-7,503,523,874,916,741,000
49.788679
133
0.653838
false
Ghalko/waterbutler
waterbutler/providers/s3/provider.py
1
10178
import os import asyncio import hashlib from urllib import parse import xmltodict from boto.s3.connection import S3Connection from boto.s3.connection import OrdinaryCallingFormat from boto.s3.connection import SubdomainCallingFormat from waterbutler.core import streams from waterbutler.core import provider from wate...
apache-2.0
-1,311,005,674,001,923,000
34.096552
143
0.609452
false
sckott/pytaxize
pytaxize/ids/ids.py
1
4823
import warnings import sys import itertools from ..col import search from pytaxize.ncbi import ncbi from pytaxize.itis import terms from .gbif_helpers import gbif_query_for_single_name, process_gbif_response from .format_helpers import _make_id from .eol_helpers import ( eol_search_query_for_single_name, proces...
mit
7,925,472,593,893,624,000
28.588957
88
0.477296
false
stephenliu1989/msmbuilder
msmbuilder/tests/test_msm_uncertainty.py
1
3263
from __future__ import print_function import numpy as np from scipy.linalg import eigvals from msmbuilder.cluster import NDGrid from msmbuilder.example_datasets import load_doublewell from msmbuilder.msm import MarkovStateModel, ContinuousTimeMSM from msmbuilder.msm.core import _solve_msm_eigensystem def test_eigen...
lgpl-2.1
6,347,031,682,103,972,000
36.505747
76
0.604658
false
madformuse/client
src/client/_clientwindow.py
1
60723
from functools import partial from client.player import Player from client.updater import fetchClientUpdate from config import Settings import fa from fa.factions import Factions ''' Created on Dec 1, 2011 @author: thygrrr ''' from PyQt4 import QtCore, QtGui, QtNetwork, QtWebKit from PyQt4.QtCore import QDataStream ...
gpl-3.0
-2,850,407,173,679,299,600
36.39101
721
0.630008
false
myemma/EmmaPython
emma/model/message.py
1
2194
"""Audience mailing message models""" from emma import exceptions as ex from emma.model import BaseApiModel class Message(BaseApiModel): """ Encapsulates operations for a :class:`Message` :param mailing: The Mailing which owns this Message :type mailing: :class:`Mailing` :param member_id: The Me...
mit
-8,210,768,294,507,816,000
31.264706
80
0.596627
false
QQuick/Transcrypt
transcrypt/development/automated_tests/transcrypt/dictionaries/__init__.py
1
3596
from org.transcrypt.stubs.browser import __pragma__ __pragma__ ('iconv') # Dictionaries are translated to JavaScript objects, # to achieve JSON-compatible syntax for JavaScript library object initialisation. # Keys that may denote a number are interpreted as such in Transcrypt. # All other keys are interpreted a...
apache-2.0
-3,353,078,020,510,493,000
29.269565
107
0.561179
false
dovf/kitty
tests/test_model_low_level_fields.py
1
36496
# -*- coding: utf-8 -*- # Copyright (C) 2016 Cisco Systems, Inc. and/or its affiliates. All rights reserved. # # This file is part of Kitty. # # Kitty 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 ver...
gpl-2.0
-7,294,158,809,536,484,000
36.702479
155
0.657552
false
localprojects/Civil-Debate-Wall-Kiosk
dev_tools/embed_generator/embedgen.py
1
1047
# Little app to generate AS3 image embed code. # The image will be available from an eponymous static variable, without the file type suffix. # If it's fed a directory, it wil create embed code for every image file in the directory import os, sys imageExtensions = ['.jpg', '.png', '.gif'] def printEmbed(filename): ...
gpl-2.0
-2,185,355,945,077,706,500
32.806452
122
0.659981
false
jsevilleja/letsencrypt
letsencrypt.py
1
1902
#!/usr/bin/env python import argparse import logging import os import certificate import acme import parser def main(): log = logging.getLogger(__name__) log.addHandler(logging.StreamHandler()) log.setLevel(logging.INFO) arg_parser = argparse.ArgumentParser() arg_parser.add_argument("--path", re...
gpl-2.0
6,048,918,412,103,494,000
34.222222
114
0.666141
false
edilio/tobeawebproperty
haweb/apps/core/migrations/0004_auto_20141130_1107.py
1
1265
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import localflavor.us.models class Migration(migrations.Migration): dependencies = [ ('core', '0003_auto_20141130_1044'), ] operations = [ migrations.AlterModelOptions( n...
mit
1,210,994,129,774,920,700
29.119048
95
0.56996
false
op3/hdtv
hdtv/plugins/fitlist.py
1
11488
# -*- coding: utf-8 -*- # HDTV - A ROOT-based spectrum analysis software # Copyright (C) 2006-2009 The HDTV development team (see file AUTHORS) # # This file is part of HDTV. # # HDTV is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # ...
gpl-2.0
5,580,118,264,738,536,000
35.938907
97
0.544829
false
vkris/pyzookeeper
setup.py
1
1265
#!/usr/bin/env python from setuptools import setup, find_packages import os, re PKG='pyzookeeper' VERSIONFILE = os.path.join('pyzookeeper', '_version.py') verstr = "unknown" try: verstrline = open(VERSIONFILE, "rt").read() except EnvironmentError: pass # Okay, there is no version file. else: MVSRE = r"^man...
mit
-3,459,132,697,945,531,000
29.853659
86
0.600791
false
habitam/habitam-core
habitam/ui/license_filter.py
1
2330
''' This file is part of Habitam. Habitam 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 version. Habitam is distributed in the hope that ...
agpl-3.0
4,562,693,984,723,469,300
29.671053
73
0.682403
false
goblinhack/MundusMeus
python/biome_land.py
1
10123
import random import mm import thing import biome_land_do import tp import game def biome_build(self, seed=0): while True: random.seed(self.biome_seed) self.biome_seed += 1 self.biome_seed *= self.biome_seed self.biome = biome_land_do.Biome(chunk=self) if not self.biome...
lgpl-3.0
-2,133,161,764,213,903,600
31.03481
79
0.378149
false
hyperkitty/kittystore
kittystore/storm/schema/patch_8.py
1
1769
# -*- coding: utf-8 -*- from __future__ import absolute_import from .utils import get_db_type SQL = { "sqlite": [""" CREATE TABLE "category" ( id INTEGER NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY (id) );""", 'ALTER TABLE "thread" ADD COLUMN cat...
gpl-3.0
-6,043,101,372,787,932,000
31.163636
102
0.553985
false
zooyalove/pyfax
include/models/DynamicConfig.py
1
2651
import pymongo from . import MongoDB class DynamicConfig(MongoDB): """DynamicConfig class """ def __init__(self): super(MongoDB, self).__init__() self._collection = self._db['dynconfs'] self.dynconf_id = None self.device = None self.callid = None def close(s...
mit
5,169,615,109,688,537,000
26.905263
134
0.540174
false
hahaps/openstack-project-generator
template/<project_name>/cmd/manage.py
1
13477
#!/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 ...
apache-2.0
-5,231,390,574,427,992,000
32.776942
86
0.592936
false
onshape-public/onshape-clients
python/onshape_client/oas/models/bt_default_unit_info.py
1
4695
# coding: utf-8 """ Onshape REST API The Onshape REST API consumed by all clients. # noqa: E501 The version of the OpenAPI document: 1.113 Contact: api-support@onshape.zendesk.com Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import re # noqa: F401 im...
mit
1,394,035,064,264,031,000
31.157534
79
0.570394
false
frqnck/apix-docs
conf.py
1
8291
# -*- coding: utf-8 -*- # # APIx documentation build configuration file, created by # sphinx-quickstart on Wed Mar 12 13:45:25 2014. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All co...
bsd-3-clause
6,634,593,186,116,264,000
31.2607
124
0.705946
false
d-e-s-o/copyright
copyright/src/deso/copyright/range.py
1
3676
# range.py #/*************************************************************************** # * Copyright (C) 2015 Daniel Mueller (deso@posteo.net) * # * * # * This program is free software: you can redistribute it and/or modify...
gpl-3.0
-8,904,273,902,667,896,000
37.291667
79
0.564744
false
rev112/pyope
tests/test_stat.py
1
1903
import itertools import random import pytest from pyope.hgd import HGD from pyope.ope import ValueRange from pyope.stat import sample_uniform def test_uniform(): # Short ranges value = 10 unit_range = ValueRange(value, value) assert sample_uniform(unit_range, []) == value short_range = ValueRange...
mit
4,097,747,294,033,899,500
31.254237
99
0.636889
false
jsafrane/openlmi-storage
test/test_create_vg.py
1
12056
#!/usr/bin/python # -*- Coding:utf-8 -*- # # Copyright (C) 2012 Red Hat, Inc. All rights reserved. # # This library 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 Software Foundation; either # version 2.1 of the License, ...
lgpl-2.1
-4,422,137,888,049,898,500
40.861111
96
0.615544
false
macwis/simplehr
candidates/migrations/0019_auto_20160525_0858.py
1
1799
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-05-25 08:58 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import uuid class Migration(migrations.Migration): dependencies = [ ('candidates', '0018_auto_20160524_1224'), ] ...
gpl-3.0
6,831,259,579,656,450,000
32.314815
138
0.580322
false
vgrem/Office365-REST-Python-Client
tests/sharepoint/test_recycle_bin.py
1
2039
from random import randint from tests.sharepoint.sharepoint_case import SPTestCase from office365.sharepoint.files.file import File from office365.sharepoint.recyclebin.recycleBinItemCollection import RecycleBinItemCollection class TestSharePointRecycleBin(SPTestCase): target_file = None # type: File @cla...
mit
8,758,574,779,512,650,000
38.980392
112
0.687102
false
wcong/ants
ants/crawl/spidermanager.py
1
1832
""" SpiderManager is the class which locates and manages all website-specific spiders """ from zope.interface import implements from ants import signals from ants.utils.interfaces import ISpiderManager from ants.utils.misc import walk_modules from ants.utils.spider import iter_spider_classes class SpiderManager(obj...
bsd-3-clause
8,412,298,830,859,857,000
29.533333
73
0.645742
false
userzimmermann/robotframework-python3
utest/running/test_imports.py
1
2843
import unittest from six.moves import StringIO from robot.running import TestSuite from robot.utils.asserts import assert_equals, assert_raises_with_msg def run(suite, **config): result = suite.run(output=None, log=None, report=None, stdout=StringIO(), stderr=StringIO(), **config) retu...
apache-2.0
-1,786,881,284,123,601,000
36.906667
81
0.588111
false
foone/7gen
code/decompress3dmm.py
1
1907
#!/usr/env python #BMDLVIEW: Views Microsoft 3D Movie Maker models (BMDLs) #Copyright (C) 2004-2015 Foone Turing # #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 ...
gpl-2.0
6,400,433,870,015,829,000
43.348837
240
0.760881
false
exiahuang/SalesforceXyTools
xlsxwriter/workbook.py
1
54782
############################################################################### # # Workbook - A class for writing the Excel XLSX Workbook file. # # Copyright 2013-2016, John McNamara, jmcnamara@cpan.org # # Standard packages. import sys import re import os import operator from warnings import warn from datetime impor...
apache-2.0
-5,126,902,016,835,148,000
32.48533
79
0.534902
false
ric2b/Vivaldi-browser
chromium/third_party/blink/renderer/bindings/scripts/build_web_idl_database.py
1
1272
# Copyright 2019 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. """ Builds Web IDL database. Web IDL database is a Python object that supports a variety of accessors to IDL definitions such as IDL interface and IDL attri...
bsd-3-clause
-5,031,196,945,547,410,000
23.461538
75
0.65173
false
jiadaizhao/LeetCode
0601-0700/0639-Decode Ways II/0639-Decode Ways II.py
1
2404
class Solution: def numDecodings(self, s: str) -> int: MOD = 1000000007 dp = [0] * (1 + len(s)) dp[0] = 1 for i in range(1, len(dp)): if s[i - 1] == '*': dp[i] = dp[i - 1]*9 % MOD elif s[i - 1] != '0': dp[i] = dp[i - 1] ...
mit
-7,319,157,839,342,609,000
32.388889
60
0.253744
false
h-hirokawa/swampdragon
swampdragon/pubsub_providers/channel_utils.py
1
3543
from ..model_tools import string_to_list, get_property from .channel_filters import filter_options, in_compare, term_match_check try: from urllib.parse import quote_plus, unquote_plus except ImportError: from urllib import quote_plus, unquote_plus def make_safe(val): """ Make strings in filters save...
bsd-3-clause
7,975,938,618,541,718,000
28.040984
90
0.619249
false
mcardacci/python_smtp_emailer
app/tests/test_format_view.py
1
1297
import unittest from app import Format class FormatViewMethods(unittest.TestCase): def setUp(self): self.formatter=Format({u'ABC084-S': {u'type': u'Windows 7 Professional', u'installDate': u'2011-08-31 11:07:00.000'}, u'GMC088-POS1': {u'type': u'Windows 7 Professional', u'installDate': u'2011-08-31 11:07:00.000'}}...
mit
5,349,898,510,400,005,000
42.266667
218
0.744025
false
konstantinKim/vd-backend
app/facilities/models.py
1
4354
from marshmallow_jsonapi import Schema, fields from marshmallow import validate from flask.ext.sqlalchemy import SQLAlchemy from sqlalchemy.exc import SQLAlchemyError from app.helper.helper import Calc db = SQLAlchemy(session_options={"autoflush": False}) class CRUD(): def add(self, resource): db.sess...
mit
5,645,028,438,968,486,000
38.944954
376
0.590032
false
Josef-Friedrich/audiorename
audiorename/audiofile.py
1
12041
"""This module contains all functionality on the level of a single audio file. """ from __future__ import print_function from audiorename.meta import Meta, dict_diff from phrydy.utils import as_string from tmep import Functions from tmep import Template import errno import os import phrydy import re import shutil cl...
mit
1,818,951,839,829,924,400
28.123487
79
0.559528
false
alogg/dolfin
test/unit/mesh/python/MeshIterator.py
1
4235
"Unit tests for MeshIterator and subclasses" # Copyright (C) 2006-2011 Anders Logg # # This file is part of DOLFIN. # # DOLFIN 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 Software Foundation, either version 3 of the Li...
gpl-3.0
-2,187,166,778,391,369,200
28.615385
77
0.565525
false
mbeaver502/CyberLawBot
engine.py
1
16014
""" Description: This program implements a simple Twitter bot that tweets information about bills in Congress that are (in)directly related to cyber issues. This bot uses a MySQL database backend to keep track of bills, both posted and unposted (i.e., tweeted and yet to be tweeted, respectively). For th...
apache-2.0
3,652,089,476,477,341,700
36.503513
146
0.554078
false
lakewik/storj-gui-client
UI/qt_interfaces/file_mirrors_ui_new.py
1
11722
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'file_mirrors_list_new.ui' # # Created by: PyQt4 UI code generator 4.11.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _...
mit
2,790,875,658,646,326,300
43.570342
201
0.663197
false
icemoon1987/python_toolkit
mail_office365.py
1
2127
#!/usr/bin/env python #coding: utf-8 import smtplib import email import mimetypes import json from email.MIMEMultipart import MIMEMultipart from email.mime.text import MIMEText mail_host = "" mail_user = "" mail_pwd = "" mail_postfix = "" def sendmail(to_list,subject,content): # translation me...
gpl-3.0
2,149,991,689,210,147,800
24.961538
65
0.588683
false
derek-dalle/olab
matrix.py
1
4107
""" Provide sane Matlab-like functions """ # Import NumPy because we're building on some of its functions. import numpy as _np # Function to give length regardless of the damn type. def numel(x): """ Give number of elements in a variable without being ridiculously dependent on the type. Ever wanted to kn...
lgpl-2.1
3,550,653,919,833,609,700
26.945578
80
0.538593
false
jajgarcia/DoFits
dofit.py
1
3988
#!/usr/bin/python # # dofit.py (Based on fitxsp.py) # # Load data and perform a model fit using PyXspec # # Requires: xspec # Make sure to set: # export VERSIONER_PYTHON_PREFER_32_BIT=yes # (only for heasoft earlier than 6.16) # import sys from xspec import * from optparse import OptionParser import os,os...
gpl-2.0
-6,353,604,172,897,491,000
22.052023
111
0.599549
false
iRapha/140_MD
app/client.py
1
2653
# Credit: https://github.com/pabluk/twitter-application-only-auth/blob/master/application_only_auth/client.py import base64 import json import sys try: # For Python 3.0 and later from urllib.request import urlopen, Request from urllib.error import HTTPError except ImportError: # Fall back to Python 2...
gpl-3.0
7,204,466,494,864,592,000
32.582278
109
0.62533
false
cuttlefishh/emp
code/01-metadata/metadata_template_generator.py
1
4911
#!/usr/bin/env python import click import pandas as pd import re # Hard-coded variables investigation_type = 'metagenome' # Function: return dataframe of environmental package-specific metadata items # A single environmental package (soil) or list can be provided (soil,water). def show_items_of_env_pkg(df_env_pkg, l...
bsd-3-clause
1,272,224,902,334,078,200
61.164557
369
0.707188
false
cpcloud/numba
numba/tests/cache_usecases.py
1
3450
""" This file will be copied to a temporary directory in order to exercise caching compiled Numba functions. See test_dispatcher.py. """ from __future__ import division, print_function, absolute_import import sys import numpy as np from numba import jit, generated_jit, types from numba.tests.ctypes_usecases import...
bsd-2-clause
-3,698,239,837,539,475,500
20.835443
79
0.658551
false
torchbox/django-mailer-2
django_mailer/engine.py
1
8307
""" The "engine room" of django mailer. Methods here actually handle the sending of queued messages. """ from django.utils.encoding import smart_str from django_mailer import constants, models, settings from lockfile import FileLock, AlreadyLocked, LockTimeout from socket import error as SocketError import logging im...
mit
5,162,136,227,422,725,000
34.806034
83
0.642952
false
luci/luci-py
client/third_party/google/auth/aws.py
4
27889
# Copyright 2020 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, ...
apache-2.0
2,968,763,667,629,845,500
38.060224
141
0.635663
false
chrrrles/c3px
app/models/address.py
1
1464
# Copyright (c) 2013 - The C3PX authors. # # This file is part of C3PX. # # C3PX 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 versio...
agpl-3.0
-1,253,687,468,705,276,000
25.142857
71
0.679645
false
stganser/polyite
src/polyite/fitness/scikit_learn/init.py
1
2788
from enum import Enum import csv import math from sklearn import tree from sklearn.ensemble import RandomForestClassifier class LearningAlgorithms(Enum): cart = 0, random_forest = 1 class RandomForestsConfig: def __init__(self, n_tree, max_features): self.n_tree = n_tree self.max_feature...
mit
-2,570,103,128,079,093,000
38.267606
120
0.61944
false
butozerca/fireplace
fireplace/cards/data/buffs.py
1
9369
from fireplace.enums import GameTag # Buff helper def buff(atk=0, health=0): ret = {} if atk: ret[GameTag.ATK] = atk if health: ret[GameTag.HEALTH] = health return ret ### # Game/Brawl set # TB_007e = { GameTag.ATTACK_HEALTH_SWAP: True, } TB_Pilot1 = { GameTag.DEATHRATTLE: True, } ### # Classic set # ...
agpl-3.0
5,784,976,088,777,001,000
12.859467
45
0.659088
false
skluth/sjmanalysis
test.py
1
38623
from ROOT import TFile, gROOT, gPad, TVectorD, TObject from ROOT import TGraphErrors, TH1D, TLegend, TCanvas, TLatex TGraphErrors.__init__._creates= False TH1D.__init__._creates= False TLegend.__init__._creates= False TCanvas.__init__._creates= False TLatex.__init__._creates= False gROOT.LoadMacro( "libAnalysisDict....
gpl-2.0
-873,827,653,957,365,500
39.442932
218
0.590037
false
gem/oq-hazardlib
openquake/hazardlib/tests/geo/surface/base_surface_test.py
1
17539
# The Hazard Library # Copyright (C) 2012-2017 GEM Foundation # # 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 version. #...
agpl-3.0
-7,765,860,766,505,043,000
42.199507
79
0.575688
false