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
gurneyalex/stock-logistics-warehouse
stock_lot_valuation/__openerp__.py
1
1902
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public Licen...
agpl-3.0
2,132,936,463,356,650,500
35.576923
78
0.614616
false
cshoe/PynamoDB
pynamodb/constants.py
1
6979
""" Pynamodb constants """ # Operations BATCH_WRITE_ITEM = 'BatchWriteItem' DESCRIBE_TABLE = 'DescribeTable' BATCH_GET_ITEM = 'BatchGetItem' CREATE_TABLE = 'CreateTable' UPDATE_TABLE = 'UpdateTable' DELETE_TABLE = 'DeleteTable' LIST_TABLES = 'ListTables' UPDATE_ITEM = 'UpdateItem' DELETE_ITEM = 'DeleteItem' GET_ITEM =...
mit
5,136,472,739,059,773,000
29.880531
147
0.739934
false
damianolombardo/PlexFix
setup.py
1
8679
# -*- coding: utf-8 -*- from __future__ import print_function import os import sys import imp import subprocess ## Python 2.6 subprocess.check_output compatibility. Thanks Greg Hewgill! if 'check_output' not in dir(subprocess): def check_output(cmd_args, *args, **kwargs): proc = subprocess.Popen( ...
mit
-6,284,461,350,626,118,000
30.107527
113
0.655605
false
ICromwell/OCaSimTest
18 - No Screening.py
1
3415
# -*- coding: utf-8 -*- """ This simulates the development of a de novo OPL, cancer, or death from old age @author: icromwell """ import random t_OPL_StageOne = random.normalvariate(800,100) # Time to developing stage I oral cancer given OPL+ status t_OPL_NED = random.normalvariate(800,100) ...
gpl-3.0
2,836,444,580,478,216,000
45.458333
126
0.588873
false
mathead/askhome
test/test_smarthome.py
1
12570
import pytest from askhome import Smarthome, Appliance from askhome.exceptions import TargetOfflineError @pytest.fixture def discover_response(): return { 'header': { 'messageId': '6d6d6e14-8aee-473e-8c24-0d31ff9c17a2', 'name': 'DiscoverAppliancesResponse', 'namespace'...
mit
7,081,858,936,450,068,000
28.78673
84
0.514081
false
animekita/selvbetjening
selvbetjening/core/events/options/typemanager.py
1
2840
from selvbetjening.core.events.models.options import AutoSelectChoiceOption, DiscountOption from selvbetjening.core.events.options.widgets import BooleanWidget, TextWidget, ChoiceWidget, AutoSelectBooleanWidget, AutoSelectChoiceWidget, DiscountWidget from selvbetjening.core.events.options.scope import SCOPE from selvb...
mit
5,923,400,757,978,187,000
27.41
158
0.688732
false
adamginsburg/APEX_CMZ_H2CO
reduction/parameter_grid_explore_2014.py
1
7257
import socket import itertools import inspect import os import time import spectral_cube from astropy import units as u from astropy.io import fits dirpath = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) if 'eso-macbook' in socket.gethostname(): execfile(os.path.join(dirpath,'run_pipe...
bsd-3-clause
4,390,230,165,334,398,500
36.02551
126
0.645032
false
twisteroidambassador/pluggabletransportadapter
ptadapter/relays.py
1
1740
import asyncio from . import contexts from . import log BUF_SIZE = 2**13 _logger = log.pkg_logger.getChild('relay') async def _relay_data_side( reader: asyncio.StreamReader, writer: asyncio.StreamWriter, ) -> None: """Pass data and EOF from reader to writer.""" while True: buf = awa...
gpl-3.0
-6,079,174,031,356,856,000
29.526316
78
0.581609
false
thePortus/arakhne
arakhne/corpus/files/csv_file.py
1
3622
import csv import sys from arakhne.settings import Defaults from . import BaseFile class CSVFile(BaseFile): filetype = 'csv' settings = Defaults.FILES_CSV def __init__(self, corpus, settings): # Maxing CSV field size limit to enable large file loading super().__init__(corpus=corpus, sett...
mit
3,465,646,467,718,646,300
36.729167
77
0.536444
false
openwns/wrowser
openwns/wrowser/playgroundPlugins/SimulationCampaign/simcontrol.py
1
23950
#! /usr/bin/env python ############################################################################### # This file is part of openWNS (open Wireless Network Simulator) # _____________________________________________________________________________ # # Copyright (C) 2004-2007 # Chair of Communication Networks (ComNets) ...
gpl-2.0
8,166,062,740,908,402,000
41.691622
201
0.566889
false
robbiet480/home-assistant
homeassistant/components/emulated_hue/__init__.py
1
10301
"""Support for local control of entities by emulating a Philips Hue bridge.""" import logging from aiohttp import web import voluptuous as vol from homeassistant import util from homeassistant.components.http import real_ip from homeassistant.const import EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP from homea...
apache-2.0
-5,663,267,490,079,466,000
32.229032
88
0.629453
false
google-research/google-research
cola/data.py
1
3891
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
apache-2.0
-2,514,193,117,541,961,000
33.433628
79
0.657672
false
lmazuel/azure-sdk-for-python
azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/encryption_settings.py
1
1941
# 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 ...
mit
-1,433,115,403,300,824,600
43.113636
98
0.655848
false
laffra/auger
auger/generator/generator.py
1
1029
from __future__ import print_function import os import sys file_to_module_name = dict() def init_module_names(): modules = [item for item in sys.modules.items()] file_to_module_name.update(dict( (getattr(mod, '__file__').replace('.pyc', '.py'), name) for name, mod in modules if hasatt...
mit
-6,273,444,806,085,714,000
26.078947
76
0.638484
false
tellapart/taba
src/taba/server/storage/mapping_storage.py
1
4443
# Copyright 2014 TellApart, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
apache-2.0
-3,012,093,875,975,386,600
27.120253
79
0.653387
false
uclouvain/OSIS-Louvain
education_group/api/views/group_element_year.py
1
3601
############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core ...
agpl-3.0
5,969,703,544,294,927,000
39.449438
107
0.694444
false
pet-finder/pet-finder
app/view.py
1
6044
#!/usr/bin/python2.5 # 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 ...
apache-2.0
6,600,649,657,870,641,000
38.763158
79
0.584381
false
leppa/home-assistant
homeassistant/components/homekit/type_lights.py
1
8939
"""Class to hold all light accessories.""" import logging from pyhap.const import CATEGORY_LIGHTBULB from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_BRIGHTNESS_PCT, ATTR_COLOR_TEMP, ATTR_HS_COLOR, ATTR_MAX_MIREDS, ATTR_MIN_MIREDS, DOMAIN, SUPPORT_BRIGHTNESS, SUPP...
apache-2.0
6,853,187,842,230,649,000
38.034934
89
0.579036
false
nelhage/taktician
python/tak/train/corpus.py
1
3196
import tak.ptn import tak.proto import attr import os import struct import grpc import numpy as np import tensorflow as tf def xread(fh, n): b = fh.read(n) if len(b) == 0: raise EOFError if len(b) != n: raise IOError("incomplete read ({0}/{1} at off={2})".format( len(b), n, fh.tell())) return...
mit
491,422,879,414,073,660
24.98374
81
0.598248
false
ggzzzzzzz/TestSSR
merge_json.py
1
1112
#!/usr/bin/python # coding=UTF-8 # # usage: ./merge_json.py 1.json 2.json 3.json .. import os import json, codecs para_count=len(os.sys.argv) d=dict() d['configs']=[] serverandport=[] if para_count > 1: for i in range(1,para_count,1): if os.path.exists(os.sys.argv[i]) and os.sys.argv[i].sp...
gpl-3.0
1,079,533,520,537,659,400
32.8125
86
0.544065
false
katakumpo/nicedjango
tests/utils.py
1
2073
from __future__ import print_function, unicode_literals from operator import attrgetter from django.db.models.loading import get_app, get_models from nicedjango._compat import exclude, unicode from nicedjango.graph.utils import sort_nodes from nicedjango.serializers.compact_python import Serializer from nicedjango.ut...
mit
-807,899,905,067,998,800
28.197183
91
0.626146
false
mattjvincent/file2db
docs/conf.py
1
8399
#!/usr/bin/env python # -*- coding: utf-8 -*- # # file2db documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # 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 # aut...
bsd-3-clause
7,454,828,518,686,248,000
29.541818
76
0.704489
false
codedecde/ImageQA
Src/TheanoModel/Code/demo.py
1
3301
#!/usr/bin/env python import datetime import os import sys import log import logging import argparse import math import pickle from optimization_weight import * from wbw_theano import * from data_provision_att_vqa import * from data_processing_vqa import * from configurations import get_configurations def AnswerQuest...
mit
-6,485,338,328,350,895,000
41.87013
140
0.662527
false
ssharpjr/taskbuster-boilerplate
functional_tests/test_allauth.py
1
2313
# -*- coding: utf-8 -*- from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.common.exceptions import TimeoutException from django.core.urlresolvers import revers...
mit
-4,072,114,593,278,623,000
36.306452
73
0.663208
false
silkypanda/pynched
getData/AmazonProduct.py
1
14454
class AmazonProduct(LXMLWrapper): """A wrapper class for an Amazon product. """ def __init__(self, item, aws_associate_tag, api, *args, **kwargs): """Initialize an Amazon Product Proxy. :param item: Lxml Item element. """ super(AmazonProduct, self).__init__(item)...
apache-2.0
-8,527,705,772,347,754,000
28.320487
86
0.542964
false
hsoft/moneyguru
core/tests/gui/account_pie_chart_test.py
1
11975
# Copyright 2019 Virgil Dupras # # This software is licensed under the "GPLv3" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.gnu.org/licenses/gpl-3.0.html from datetime import date from ..testutil import eq_, with_app from ..bas...
gpl-3.0
-7,534,911,255,200,027,000
34.324484
102
0.596827
false
ddurieux/alignak
test/test_resultmodulation.py
1
3687
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2015-2015: Alignak team, see AUTHORS.txt file for contributors # # This file is part of Alignak. # # Alignak 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 So...
agpl-3.0
8,602,782,851,541,387,000
37.395833
107
0.692349
false
guykisel/robotframework-faker
robotframework-faker/FakerLibrary/keywords.py
1
2202
""" This is a very thin wrapper for faker. You can access all of faker's usual methods via FakerLibrary calls in Robot Framework. """ # pylint: disable=no-value-for-parameter,unused-argument,useless-object-inheritance import ast import faker.factory import faker.generator import wrapt def _str_to_data(string): ...
mit
5,442,933,571,237,922,000
26.873418
105
0.600817
false
akretion/odoo
odoo/service/server.py
1
52623
#----------------------------------------------------------- # Threaded, Gevent and Prefork Servers #----------------------------------------------------------- import datetime import errno import logging import os import os.path import platform import random import select import signal import socket import subprocess ...
agpl-3.0
-8,934,247,668,539,307,000
40.305338
126
0.577428
false
uclouvain/osis
education_group/views/group/general_information_update.py
1
2313
############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core ...
agpl-3.0
-2,497,438,322,074,282,000
40.285714
104
0.667388
false
PerformLine/python-performline-client
performline/cli.py
1
4799
# Copyright (c) 2016, PerformLine, Inc. # 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 copyright # notice, this list of conditio...
bsd-3-clause
1,451,907,435,498,720,500
35.633588
81
0.628464
false
rishita/mxnet
python/mxnet/__init__.py
1
1496
#!/usr/bin/env python # coding: utf-8 """MXNet: a concise, fast and flexible framework for deep learning.""" from __future__ import absolute_import from .context import Context, current_context, cpu, gpu from .base import MXNetError from . import base from . import contrib from . import ndarray from . import name # us...
apache-2.0
-5,653,142,848,948,809,000
23.129032
70
0.752674
false
emdodds/DictLearner
DictLearner.py
1
16189
# -*- coding: utf-8 -*- """ Created on Thu Aug 20 12:01:18 2015 @author: Eric Dodds Abstract dictionary learner. Includes gradient descent on MSE energy function as a default learning method. """ import numpy as np import pickle # the try/except block avoids an issue with the cluster try: import matp...
mit
-8,776,482,560,978,126,000
39.940415
82
0.567175
false
chrisspen/burlap
burlap/aws.py
1
4703
from __future__ import print_function import os from burlap import Satchel from burlap.constants import * from burlap.decorators import task class EC2MonitorSatchel(Satchel): """ Wraps the EC2 monitor script provided by Amazon: http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/mon-s...
mit
-8,316,019,227,484,014,000
28.955414
132
0.596428
false
DesertBus/txircd
txircd/modules/samode.py
1
1985
from twisted.words.protocols import irc from txircd.modbase import Command class SamodeCommand(Command): def onUse(self, user, data): if "targetchan" in data: cdata = data["targetchan"] modesSet = cdata.setMode(None, data["modes"], data["params"], user.prefix()) user.sen...
bsd-3-clause
6,756,576,759,296,020,000
36.471698
122
0.531486
false
CalHinshaw/hexapod
util.py
1
2246
from math import cos, sin, pi import numpy as np def to_rad(angle): return angle * 0.0174532925 def to_deg(angle): return angle * 57.2957795 def add(a, b): return tuple(x+y for x, y in zip(a, b)) def sub(a, b): return tuple(x-y for x,y in zip(a,b)) def scale(scalar, v): return t...
epl-1.0
-473,075,805,075,068,500
25.116279
80
0.484417
false
zsjohny/jumpserver
apps/assets/views/domain.py
1
5042
# -*- coding: utf-8 -*- # from django.views.generic import ( TemplateView, CreateView, UpdateView, DeleteView, DetailView ) from django.views.generic.detail import SingleObjectMixin from django.utils.translation import ugettext_lazy as _ from django.urls import reverse_lazy, reverse from common.permissions import...
gpl-2.0
4,419,450,522,517,363,700
30.123457
79
0.635264
false
vdloo/raptiformica
tests/unit/raptiformica/actions/slave/test_assimilate_machine.py
1
1726
from raptiformica.actions.slave import assimilate_machine from tests.testcase import TestCase class TestAssimilateMachine(TestCase): def setUp(self): self.log = self.set_up_patch('raptiformica.actions.slave.log') self.download_artifacts = self.set_up_patch('raptiformica.actions.slave.download_arti...
mit
7,814,503,902,199,450,000
39.139535
100
0.679027
false
arista-eosplus/pyeapi
pyeapi/api/vrrp.py
1
61008
# # Copyright (c) 2015, Arista Networks, Inc. # 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 copyright notice, # this list of condit...
bsd-3-clause
6,761,345,706,931,598,000
39.862693
79
0.536061
false
gerardroche/sublime_color_scheme_unit
tests/test_generate_assertions.py
1
2663
from textwrap import dedent from unittest import TestCase from ColorSchemeUnit.lib.generator import _build_assertions class TestGenerateAssertions(TestCase): def test_generate_assertions(self): self.assertEquals(dedent(""" ^ a """).strip(), _build_assertions(['a'], '', '')) self...
bsd-3-clause
-8,312,658,899,899,956,000
27.329787
95
0.41795
false
lixianjian/tools_backend
parameters/views.py
1
6409
#coding=utf-8 #全局变量设置 from django.http import HttpResponse,HttpResponseForbidden,HttpResponseServerError from django.views.decorators.csrf import csrf_exempt from django.template import loader, RequestContext from django.conf import settings #import sys #import os import traceback as tb #import datetime #im...
epl-1.0
-5,694,978,652,910,430,000
32.882022
108
0.580126
false
baroquebobcat/pants
tests/python/pants_test/util/test_osutil.py
1
1440
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import logging from...
apache-2.0
-6,469,295,263,861,356,000
37.918919
95
0.6875
false
nexdatas/recselector
test/TestMGSetUp.py
1
5166
#!/usr/bin/env python # This file is part of nexdatas - Tango Server for NeXus data writer # # Copyright (C) 2012-2014 DESY, Jan Kotanski <jkotan@mail.desy.de> # # nexdatas 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-3.0
-4,938,994,872,754,152,000
30.693252
78
0.540263
false
sassoftware/mint
mint/rest/api/images.py
1
1715
# # Copyright (c) SAS Institute Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
apache-2.0
-386,421,493,903,430,400
30.181818
74
0.675802
false
shdowofdeath/rally
rally/plugins/openstack/wrappers/network.py
1
13943
# Copyright 2014: Mirantis 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...
apache-2.0
809,447,455,847,712,500
34.032663
78
0.582228
false
cpcloud/PyTables
tables/tests/test_nestedtypes.py
1
52114
# -*- coding: utf-8 -*- ######################################################################## # # License: BSD # Created: 2005-05-18 # Author: Francesc Alted - faltet@pytables.org # Author: Ivan Vilata - ivan@selidor.net # # $Id$ # ######################################################################## """Test mo...
bsd-3-clause
8,369,143,331,818,652,000
33.285526
111
0.564321
false
tanghaibao/goatools
goatools/godag/obo_optional_attributes.py
1
9557
"""Manage optional GO-DAG attributes.""" __copyright__ = "Copyright (C) 2015-present, DV Klopfenstein, H Tang, All rights reserved." __author__ = "DV Klopfenstein" import re import collections as cx class OboOptionalAttrs: """Manage optional GO-DAG attributes.""" optional_exp = set(['def', 'defn', 'synonym...
bsd-2-clause
-1,903,504,645,009,664,500
37.381526
97
0.57246
false
ecreall/lagendacommun
lac/web_services/import_entities.py
1
17511
# Copyright (c) 2016 by Ecreall under licence AGPL terms # available on http://www.gnu.org/licenses/agpl.html # licence: AGPL # author: Amen Souissi, Sophie Jazwiecki import colander import json import urllib import transaction from persistent.list import PersistentList from pyramid.view import view_config from pyra...
agpl-3.0
5,886,629,999,985,584,000
34.304435
94
0.595112
false
amirkdv/biseqt
experiments/blot_stats.py
1
31822
import numpy as np from matplotlib import pyplot as plt from matplotlib import gridspec from itertools import product from scipy.ndimage.filters import gaussian_filter1d import sys import logging from biseqt.blot import WordBlot, find_peaks, band_radius from biseqt.sequence import Alphabet from biseqt.stochastics imp...
bsd-3-clause
4,470,350,873,487,483,000
41.656836
79
0.561058
false
wax8280/web2kindle
main.py
1
5103
# !/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Vincent<vincent8280@outlook.com> # http://wax8280.github.io # Created on 2017/10/11 12:30 import click import multiprocessing import web2kindle.script.guoke_scientific import web2kindle.script.zhihu_dail...
mit
-4,217,319,424,848,223,700
33.47973
111
0.687439
false
stefanseefeld/numba
numba/targets/codegen.py
1
20232
from __future__ import print_function, division, absolute_import import functools import locale import weakref import llvmlite.llvmpy.core as lc import llvmlite.llvmpy.passes as lp import llvmlite.binding as ll import llvmlite.ir as llvmir from numba import config, utils from numba.runtime.atomicops import remove_re...
bsd-2-clause
-8,729,384,321,049,508,000
32.496689
87
0.58452
false
william-richard/moto
moto/logs/responses.py
1
7491
from moto.core.responses import BaseResponse from .models import logs_backends import json # See http://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/Welcome.html class LogsResponse(BaseResponse): @property def logs_backend(self): return logs_backends[self.region] @property d...
apache-2.0
-3,817,439,936,542,415,000
34.169014
104
0.598318
false
Princeton-CDH/winthrop-django
winthrop/books/models.py
1
8200
from django.db import models from django.contrib.contenttypes.fields import GenericRelation from django.urls import reverse from django.utils.safestring import mark_safe from djiffy.models import Manifest from winthrop.common.models import Named, Notable, DateRange from winthrop.places.models import Place from winthro...
apache-2.0
7,285,286,906,633,182,000
34.964912
89
0.668293
false
epage/nixnet-python
tests/test_frames.py
1
17470
from __future__ import absolute_import from __future__ import division from __future__ import print_function import time import mock # type: ignore import pytest # type: ignore import nixnet from nixnet import _frames from nixnet import constants from nixnet import errors from nixnet import types def raise_code...
mit
-3,440,613,121,823,330,000
35.934461
148
0.655982
false
melmothx/jsonbot
jsb/plugs/common/imdb.py
1
2532
## jsb imports from jsb.lib.commands import cmnds from jsb.utils.url import geturl2, striphtml, decode_html_entities from jsb.imports import getjson from urllib import quote import logging import re def do_imdb_api_query(query): url = "http://www.deanclatworthy.com/imdb/?" + query logging.warn(url) result...
mit
-4,098,470,247,257,875,000
29.142857
312
0.584123
false
miarmak/CloudFerry
cloud/cloud.py
1
4023
# Copyright (c) 2014 Mirantis 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, so...
apache-2.0
1,343,101,120,892,547,600
39.636364
121
0.591101
false
laochangxin/doubanMining
doubanMining/doubanMining/spider/ProxyCrawler.py
1
2907
from bs4 import BeautifulSoup import urllib2 import httplib import threading class ProxyCrawler(object): """@Brief: Crawl proxy host&port from a proxy providing web""" def run(self): of = open('./data/proxy.txt' , 'w') user_agent = 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Tri...
gpl-2.0
-5,077,874,072,480,369,000
34.876543
93
0.521515
false
eahneahn/free
djangoproject/social_auth/migrations/0001_initial.py
1
8277
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from django.conf import settings USER_MODEL = getattr(settings, 'SOCIAL_AUTH_USER_MODEL', None) or \ getattr(settings, 'AUTH_USER_MODEL', None) or \ 'auth.User' ...
agpl-3.0
-5,563,063,639,572,120,000
60.311111
182
0.581974
false
vernonrj/dognames
dognames.py
1
1141
"""Create random dog names""" import random from functools import reduce from dog_list import DOGS def word_iter(words): """iterate on words""" word = [] for char in words: if char in ' \n\t': if word: yield ''.join(word) word = [] else: ...
gpl-2.0
-2,208,824,892,482,656,300
24.355556
72
0.606486
false
napalm-automation/napalm-yang
napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/opaque_lsa/router_information/tlvs/tlv/segment_routing_sid_label_range/tlvs/tlv/state/__init__.py
1
29717
# -*- coding: utf-8 -*- from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListTy...
apache-2.0
4,667,460,565,431,424,000
43.353731
967
0.518962
false
siddhartha-chandra/i_cake_python
32.py
1
1576
# You created a game that is more popular than Angry Birds. # Each round, players receive a score between 0 and 100, which you use to rank them from highest to lowest. So far you're using an algorithm that sorts in O(n\lg{n})O(nlgn) time, but players are complaining that their rankings aren't updated fast enough. You n...
gpl-3.0
-6,689,949,833,234,319,000
42.611111
291
0.716561
false
theyosh/TerrariumPI
contrib/toggle_switch.py
1
3601
#!/usr/bin/env python import sys import requests import time # Run this script as: # without parameters, it will toggle the power state and leave in manual mode # with paramterer on or off, it will toggle to the selected state and leave in manual mode # with parameter on or off and a numeric value, will toggle the swi...
gpl-3.0
-8,097,306,127,394,977,000
42.926829
176
0.694529
false
nakagami/CyMySQL
cymysql/charset.py
1
9806
def encoding_by_charset(charset): if charset in ('utf8mb4', 'utf8mb3'): return 'utf8' return charset class Charset(object): def __init__(self, id, name, collation, is_default): self.id, self.name, self.collation = id, name, collation self.is_default = is_default == 'Yes' class C...
mit
-8,882,876,964,885,631,000
51.159574
73
0.64899
false
manuvarkey/cmbautomiser
cmbautomiser/openpyxl/chart/chartspace.py
1
7902
from __future__ import absolute_import # Copyright (c) 2010-2018 openpyxl """ Enclosing chart object. The various chart types are actually child objects. Will probably need to call this indirectly """ from openpyxl.compat import unicode from openpyxl.descriptors.serialisable import Serialisable from openpyxl.descrip...
gpl-3.0
7,107,741,808,673,289,000
28.485075
89
0.606302
false
leosartaj/PyChat
PyChat/server/startserver.py
1
1346
#!/usr/bin/env python2 ## # PyChat # https://github.com/leosartaj/PyChat.git # # Copyright (c) 2014 Sartaj Singh # Licensed under the MIT license. ## """ Helper functions for starting a server """ # Twisted Imports from twisted.internet import reactor from twisted.internet.error import CannotListenError # factory/p...
mit
-1,021,957,207,768,436,000
25.92
67
0.729569
false
eirism/PU-66
tests/test_basics.py
1
7082
def get_socketio_args(response): return response['args'][0] def get_question_group(response): return get_socketio_args(response)['question'][1] def test_init(app, session, client, client_socketio): """Tests that the app is initialized correctly (no errors)""" pass def check_status_code(client, end...
mit
871,301,886,120,704,000
44.690323
91
0.622423
false
Diaoul/Dobby
dobby/models/scenario.py
1
1793
# Copyright 2011 Antoine Bertin <diaoulael@gmail.com> # # This file is part of Dobby. # # Dobby is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ...
lgpl-3.0
4,736,567,790,910,257,000
42.731707
116
0.736754
false
weidnerm/solar_data_monitor
Subfact_ina219.py
1
9219
#!/usr/bin/python import time import smbus #from Adafruit_I2C import Adafruit_I2C import Adafruit_GPIO.I2C as I2C # =========================================================================== # INA219 Class # =========================================================================== class INA219: i2c = None # ===...
mit
-8,543,372,143,050,764,000
44.865672
98
0.526196
false
mlcommons/inference
language/bert/pytorch_SUT.py
1
3800
# coding=utf-8 # Copyright 2021 Arm Limited and affiliates. # Copyright (c) 2020 NVIDIA CORPORATION. All rights reserved. # Copyright 2018 The Google AI Language Team 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...
apache-2.0
6,249,434,711,940,474,000
41.696629
128
0.663158
false
ganga-devs/ganga
ganga/GangaCore/Core/GangaRepository/migrate.py
1
6165
# import ganga import os import time import pickle import pymongo from GangaCore.Core.GangaRepository.VStreamer import from_file from GangaCore.Core.GangaRepository.DStreamer import ( EmptyGangaObject, index_from_database, index_to_database, object_from_database, object_to_database ) from GangaCore....
gpl-2.0
-1,133,834,777,365,368,600
36.822086
91
0.631955
false
astrophysicist87/iEBE-Plumberg
EBE-Node/plot_scripts/plot_HBT_GF_w_v_wo_res.py
1
4575
#!/usr/bin/env python from numpy import * from pylab import * import matplotlib.pyplot as plt from scipy import interpolate from scipy.interpolate import griddata from matplotlib.patches import Ellipse import sys, os mpl.rcParams['pdf.fonttype'] = 42 ### command-line arguments thermalFileToPlot = sys.argv[1] resonan...
gpl-3.0
-8,798,006,646,072,858,000
36.809917
109
0.634536
false
Azure/azure-sdk-for-python
sdk/network/azure-mgmt-network/setup.py
1
3043
#!/usr/bin/env python #------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. #----------------------------------------------------------------...
mit
-1,181,227,971,356,520,700
32.811111
91
0.594808
false
bdang2012/taiga-back-casting
tests/integration/test_fan_projects.py
1
4150
# Copyright (C) 2015 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2015 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2015 David Barragán <bameda@dbarragan.com> # Copyright (C) 2015 Anler Hernández <hello@anler.me> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
6,383,946,463,279,321,000
32.715447
74
0.706776
false
sansna/_vimrc
tmpl/tmpl.py
1
1709
#!/usr/bin/env python # -*- coding: UTF-8 -*- # Author: <<name>> # Date : <<date>> #import os #import sys #sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "../../"))) import time import datetime # App Config # XXX: https://stackoverflow.com/questions/3536620/how-to-change-a-module-variable-f...
lgpl-3.0
-3,771,430,218,197,499,000
30.648148
102
0.712112
false
windsorschmidt/tzar-bomba
tzar-bomba.py
1
5618
#!/bin/env python3 # # Copyright 2016 Windsor Schmidt <windsor.schmidt@gmail.com> # # License: MIT License. Let me know if you find this useful. # # This is intended to be called by EESchema's BOM generation tool as a plugin. # The "Command line" field of the plugin dialog should look something like: # # /path/to/tzar-...
mit
6,792,083,821,482,979,000
37.479452
79
0.6068
false
juanscelyg/GRMI_underwater_drone
agente_sim.py
1
2291
''' Code to connect AWS and the VREP simulation @version 0.1 @author Juan Cely <juanscelyg@gmail.com> Research Group of Robots and Intelligent Machines Date: August/2017 ''' try: import GRMI_MUR.AWS.AWS_updater as AWS_updater import GRMI_MUR.Arm.arm_parts as Arm_parts import GRMI_MUR.Simulate.arm as vrep_arm import...
mit
1,314,220,789,398,521,900
32.202899
78
0.63684
false
bit2pixel/twitcher
twitcher/settings.py
1
2628
""" Django settings for twitcher project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ import configparser import os from os.path import dirname, join config =...
mit
200,715,909,646,093,950
23.333333
84
0.716895
false
kareem2048/HCI-Lap
HCI/Gesture Recognizer/Python/Main.py
1
3351
from DTW import * import cv2 import numpy as np recognizer = DTWRecognizer() #Using Laser ''' cap = cv2.VideoCapture(0) points = np.array([], np.int32) name = "Draw a gesture" flag = False score = 0 while True: ret, frame = cap.read() #frame = cv2.flip(frame, 1) hsv = cv2.cvtColor(frame,...
apache-2.0
3,247,513,180,038,737,400
30.852941
140
0.537153
false
50wu/gpdb
gpMgmt/bin/gppylib/db/test/unit/test_unit_dbconn.py
7
3405
#!/usr/bin/env python3 # # Copyright (c) Greenplum Inc 2008. All Rights Reserved. # """ Unittesting for dbconn module """ import unittest from gppylib.db.dbconn import * class TestDbURL(unittest.TestCase): """UnitTest class for DbURL class""" def setUp(self): self._environ = dict(os.environ) ...
apache-2.0
-2,372,771,568,950,028,000
25.811024
57
0.555947
false
rlhelinski/scripts
python/raspicam-fetch.py
1
1203
#!/usr/bin/python import logging logging.basicConfig(level=logging.INFO) from ftplib import FTP import os ftp = FTP('10.0.0.6') while not ftp.login(): os.sleep(5) #ftp.cwd('/media/...') for d in ftp.nlst(): if os.path.isdir(d): logging.info('Already have directory %s' % d) if False: ...
gpl-3.0
-184,588,770,723,941,220
31.513514
94
0.573566
false
dstrockis/outlook-autocategories
lib/azure/storage/queue/_deserialization.py
1
5227
#------------------------------------------------------------------------- # Copyright (c) Microsoft. 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://w...
apache-2.0
-3,297,498,918,854,638,600
33.80137
112
0.62756
false
arjandepooter/codejam
2014/round_1b/the_bored_traveling_salesman/solution.py
1
2745
''' graph = { "a" : ["c"], "b" : ["c", "e"], "c" : ["a", "b", "d", "e"], "d" : ["c"], "e" : ["c", "b"], "f" : [] } ''' import copy def is_connected(graph): if graph=={}: return True seen = set([next(graph.iterkeys())]) tocheck = seen.copy() ...
mit
2,888,111,401,630,539,000
31.294118
74
0.519854
false
lifemapper/core
LmCompute/tools/multi/occurrence_sorter.py
1
1695
"""Sorts a CSV file on the group field """ import argparse import csv from operator import itemgetter from LmCommon.common.lmconstants import ENCODING # ............................................................................. def sort_file_on_field(input_filename, output_filename, group_position): """Sorts a...
gpl-3.0
-1,143,413,869,647,763,600
31.596154
79
0.560472
false
algui91/grado_informatica_criptografia
P2/streamciphers/ej4.py
1
1289
# -*- coding: utf-8 -*- """ Created on Thu Apr 30 09:48:53 2015 @author: Alejandro Alcalde (elbauldelprogramador.com) """ from ej2 import LFSR def geffe(coef1, s1, coef2, s2, coef3, s3, l): l1 = LFSR(coef1, s1, l) l2 = LFSR(coef2, s2, l) l3 = LFSR(coef3, s3, l) r = [] for i, j, k in zip(l1,l2...
gpl-3.0
5,513,804,138,624,247,000
17.955882
61
0.472459
false
morrisonlevi/FrameworkBenchmarks
dart-stream/setup.py
1
2738
import subprocess import sys import setup_util import os def start(args, logfile, errfile): setup_util.replace_text('dart-stream/postgresql.yaml', 'host: .*', 'host: ' + args.database_host) setup_util.replace_text('dart-stream/mongodb.yaml', 'host: .*', 'host: ' + args.database_host) try: # # install dar...
bsd-3-clause
4,693,466,373,655,429,000
35.506667
190
0.61176
false
JoepBC/urwish
urwish.py
1
16696
#!/usr/bin/env python3 ############################################################### # Urwish lib by Joep Bos-Coenraad (github.com/JoepBC) # An easy wrapper for making linear console forms using \ # the Urwid library, www.urwid.org ############################################################### import urwid impor...
gpl-3.0
5,136,615,076,578,287,000
36.519101
213
0.709751
false
pittjl/PyFr
pyfr-run.py
1
1728
# -*- coding: utf-8 -*- import argparse import frhost def cmd_line_parse(): parser = argparse.ArgumentParser() parser.add_argument('-a', '--address', help="target host ip address", required=True) parser.add_argument('-w', '--webport', help="target web servi...
mit
7,891,724,667,984,925,000
35
80
0.642361
false
KnechtRootrechtCH/Mimir
content/Mods/XVM/XVM_Base/res_mods_content/mods/xfw_packages/xvm_main/python/topclans.py
1
2348
""" XVM (c) https://modxvm.com 2013-2020 """ import config from logger import * # PUBLIC def getClanInfo(clanAbbrev): global _clansInfo if _clansInfo is None: return None rankWGM = None rankWSH = None topWGM = _clansInfo.getTopWGMClanInfo(clanAbbrev) if topWGM is not None: if ...
mit
-2,595,296,232,771,151,400
30.72973
128
0.616695
false
wlitheng/gocd2gmail2slack
gocd2gmail2slack/slack.py
1
3798
import json import requests from cfg.config import ( CI_STAGES, DEPLOY_STAGES, VERSION_CONTROL_TYPE ) def send_to_slack(body, webhook_url): requests.post(webhook_url, data=json.dumps(body)) def message_builder(gocd_details, changeset, dashboard_url): if VERSION_CONTROL_TYPE == 'GIT': ...
mit
7,111,678,147,622,747,000
30.633333
93
0.521865
false
cryptocoinexplorer/Open-Source-CCE-4.0
dbload.py
1
15221
#!/usr/bin/env python # -*- coding: utf-8 -*- # # dbload.py # # Copyright 2015 Hartland PC LLC # # This file is part of the of the database loader for CCE 4.0 (open source version). # # This package is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publis...
gpl-3.0
7,149,457,617,349,150,000
41.997175
154
0.573484
false
amalagon/TE_class
TE_class.py
1
1222
import numpy as np from scipy.special import jn, jvp, jn_zeros from scipy.integrate import quad import matlibplot.pyplot as plt class TE(object): def __init__(self,l,m,n,R,L): self.l = l self.m = m self.n = n k1 = jn_zeros(m,l)/R k3 = n*np.pi/L def E_r(self, r, th...
mit
-3,437,810,034,897,210,400
22.980392
85
0.513912
false
Ultimaker/Cura
cura/API/Account.py
1
11853
# Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from datetime import datetime from typing import Optional, Dict, TYPE_CHECKING, Callable from PyQt5.QtCore import QObject, pyqtSignal, pyqtSlot, pyqtProperty, QTimer, Q_ENUMS from UM.Logger import Logger from UM.Message im...
lgpl-3.0
3,168,149,567,613,053,400
38.378738
145
0.655868
false
earcanal/dotprobe
size.py
1
1063
#!/usr/bin/python # calculate the number of pixels for a stimulus # fixed: viewer distance, vertical resolution, visual angle # argv[1] = vertical screen height (cm) from math import atan2, degrees import sys if sys.argv[1]: h = float(sys.argv[1]) else: h = 21.5 # Dell laptop h = 20.6 # M...
cc0-1.0
501,923,433,665,035,500
32.21875
95
0.658514
false
gwind/YWeb
yweb/apps/auth/models.py
1
14564
# coding: utf-8 import os import random import json import datetime import time import logging from hashlib import sha256, sha1 from sqlalchemy import Column, Integer, String, \ Sequence, DateTime, Table, ForeignKey, Boolean, Text from sqlalchemy.orm import relationship, backref import yweb.utils.ydatetime from ...
mit
-2,655,842,268,060,451,300
24.030631
86
0.563346
false
inspirehep/invenio-formatter
invenio_formatter/template_context_functions/tfn_get_back_to_search_links.py
1
2074
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2013, 2015 CERN. # # Invenio 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...
gpl-2.0
9,196,461,224,380,242,000
31.920635
74
0.682257
false
guoxuesong/deepstacks
deepstacks/framework/visual_action.py
1
10507
#!/usr/bin/env python # coding:utf-8 # vi:tabstop=4:shiftwidth=4:expandtab:sts=4 import theano import lasagne import numpy as np import cv2 import main #from .main import batch_iterator_train,batch_iterator_test from .main import register_training_callbacks, register_model_handler from ..utils.curry import curry floa...
mit
493,716,393,059,293,700
31.630435
188
0.556486
false
rafaduran/django-pluggable-registration
registration/models.py
1
11723
import datetime import random import re from django.conf import settings from django.db import models from django.template.loader import render_to_string from django.utils.hashcompat import sha_constructor from django.utils.translation import ugettext_lazy as _ from django.core.mail import EmailMultiAlternatives from ...
bsd-3-clause
2,870,410,196,924,253,700
39.424138
83
0.618442
false
briend/mypaint
gui/layerprops.py
1
17077
# This file is part of MyPaint. # Copyright (C) 2017 by the MyPaint Development Team. # # 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...
gpl-2.0
4,685,672,151,787,558,000
30.50738
84
0.593078
false
KarlParkinson/Graphs
Graph.py
1
2909
""" {description} Copyright (C) {2014} {Karl Parkinson} This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. ...
gpl-2.0
-5,222,031,627,790,246,000
29.946809
89
0.614644
false
js850/pele
pele/optimize/_fire.py
1
7347
''' Created on 30 Apr 2012 @author: ruehle ''' import numpy as np import math import logging from pele.optimize import Result __all__ = ["Fire"] _logger = logging.getLogger("pele.optimize") class Fire(object): ''' The FIRE optimization algorithm Parameters ---------- coords : array th...
gpl-3.0
-1,265,201,723,714,130,000
31.653333
97
0.553151
false