repo_name
stringlengths
6
61
path
stringlengths
4
230
copies
stringlengths
1
3
size
stringlengths
4
6
text
stringlengths
1.01k
850k
license
stringclasses
15 values
hash
int64
-9,220,477,234,079,998,000
9,219,060,020B
line_mean
float64
11.6
96.6
line_max
int64
32
939
alpha_frac
float64
0.26
0.9
autogenerated
bool
1 class
ratio
float64
1.62
6.1
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
pedroluislopez/candidaturas
candidatos/migrations/0001_initial.py
1
1696
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Candidato', fields=[ ('id', models.AutoField(ve...
gpl-3.0
-897,410,396,831,920,000
48.882353
114
0.599057
false
3.631692
false
false
false
muchu1983/findfine
findfine_crawler/crawlerForGYG.py
2
15857
# -*- coding: utf-8 -*- """ Copyright (C) 2016, MuChu Hsu Contributed by Muchu Hsu (muchu1983@gmail.com) This file is part of BSD license <https://opensource.org/licenses/BSD-3-Clause> """ import os import time import logging import re import random import datetime import urllib.parse from selenium import webdriver fr...
bsd-3-clause
-8,451,980,319,109,748,000
49.605263
170
0.640837
false
3.405579
false
false
false
LarryHillyer/PoolHost
PoolHost/env/Lib/site-packages/django/core/handlers/base.py
96
10769
from __future__ import unicode_literals import logging import sys import types import warnings from django.conf import settings from django.core import signals from django.core.exceptions import ImproperlyConfigured, MiddlewareNotUsed from django.db import connections, transaction from django.urls import get_resolver...
gpl-3.0
-3,024,721,698,968,874,500
42.076
107
0.597734
false
5.015836
false
false
false
wkcn/mobula
tests/test_ops/test_mul.py
1
1768
import mobula as M import mobula.layers as L import numpy as np def test_multiply(): N, C, H, W = 2,3,4,5 a = np.random.random((N, C, H, W)) b = np.random.random((N, C, H, W)) [la, lb] = L.Data([a,b]) w = la * lb w.reshape() assert w.Y.shape == a.shape w.forward() w.dY = np.random.r...
mit
4,058,628,900,790,961,700
29.482759
58
0.567873
false
2.392422
false
false
false
alej0varas/django-o2o_tagging
o2o_tagging/tests/tests_views.py
1
4834
from django.contrib.contenttypes.models import ContentType from django.core.urlresolvers import reverse from django.test import TestCase # from mock import call from mock_django.http import MockHttpRequest from mock_django.signals import mock_signal_receiver from ..models import O2OTag from ..signals import o2o_tags_...
gpl-3.0
-1,036,438,399,070,563,200
37.365079
87
0.636947
false
3.637321
true
false
false
almccon/mapgardening
blankspot_stats.py
1
1366
#! /usr/bin/env python """ Calculate statistics for each study area, and prints results to stdout. All it prints is the number of blankspots, the number of v1 nodes, and the number of total nodes. Since I am no longer storing the blankspot information in the hist_point table itself, these stats are no longer very inf...
mit
-1,744,390,772,079,783,700
26.34
105
0.686676
false
3.585302
false
false
false
theodric/nsclock
dev/oled/nsoled1.py
1
8141
#!/usr/bin/env python # -*- coding: utf-8 -*- #https://github.com/theodric/nsclock #theodric 20170717 import os import sys import time import requests import xmltodict import argparse from collections import OrderedDict from demo_opts import get_device from luma.core.legacy import show_message from luma.core.legacy....
lgpl-3.0
-7,173,653,490,440,075,000
47.171598
178
0.512959
false
4.37453
false
false
false
jiakai-lian/XcodeProjectAutoConfigurator
xcode_auto_configurator.py
1
2710
#The MIT License (MIT) # #Copyright (c) 2015 Jiakai Lian # #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal #in the Software without restriction, including without limitation the rights #to use, copy, modify, mer...
mit
-900,034,453,004,515,700
31.662651
79
0.726568
false
3.967789
true
false
false
jannon/django-allauth-api
src/allauth_api/account/rest_framework/adapter.py
1
7198
from email.mime.image import MIMEImage from email.utils import make_msgid from django import forms from django.utils.translation import ugettext_lazy as _ from django.template.loader import render_to_string from django.template import TemplateDoesNotExist from django.core.exceptions import ImproperlyConfigured from dj...
bsd-2-clause
1,554,501,400,920,103,400
40.367816
123
0.620033
false
4.281975
false
false
false
liguangyulgy/cupQrSys
common/redis.py
1
4521
__author__ = 'LiGuangyu' import aioredis import asyncio,functools from concurrent.futures import CancelledError import logging;logging.basicConfig(level=logging.INFO) from common.comm import singleton import time def handler(loop, context): ''' 本来打算在eventloop上注册异常处理函数,但是没玩明白,后续研究 ''' print('in exceptio...
gpl-3.0
1,745,043,486,204,156,400
28.143836
141
0.583314
false
3.371632
false
false
false
ashutrix03/inteygrate_flaskapp-master
build/lib/yowsup/layers/protocol_groups/layer.py
18
6769
from yowsup.layers import YowLayer, YowLayerEvent, YowProtocolLayer from yowsup.layers.protocol_iq.protocolentities import ErrorIqProtocolEntity from yowsup.layers.protocol_iq.protocolentities.iq_result import ResultIqProtocolEntity from .protocolentities import * import logging logger = logging.getLogger(__name__) c...
gpl-3.0
968,199,711,413,080,400
48.050725
105
0.724332
false
4.386909
false
false
false
substructural/deep-random-fields
modules/report.py
1
13358
#=================================================================================================== # report #--------------------------------------------------------------------------------------------------- import inspect import os import os.path import numpy import labels import output from results import Im...
gpl-3.0
-5,500,868,599,115,104,000
26.656315
100
0.542896
false
4.041755
false
false
false
farzadghanei/distutilazy
distutilazy/clean.py
1
7976
""" distutilazy.clean ----------------- command classes to help clean temporary files :license: MIT. For more details see LICENSE file or https://opensource.org/licenses/MIT """ from __future__ import absolute_import import os from shutil import rmtree from distutils import log from distutils.core import Command fro...
mit
-5,143,906,356,079,670,000
29.559387
79
0.57836
false
4.29973
false
false
false
IMIO/django-fixmystreet
django_fixmystreet/middleware/smtpforward.py
2
4934
#-*- coding: utf-8 -*- """SMTP email backend class.""" import smtplib import ssl import threading from django.conf import settings from django.core.mail.backends.base import BaseEmailBackend from django.core.mail.utils import DNS_NAME from django.core.mail.message import sanitize_address from django.utils.encoding im...
agpl-3.0
2,438,398,094,984,649,700
38.063492
218
0.577001
false
4.265165
false
false
false
HPAC/TTC
ttc/transpose.py
1
24710
# This script generates high-performance C/C++ code for any given multi-dimensional transposition. # # Tensor-Contraction Compiler (TTC), copyright (C) 2015 Paul Springer (springer@aices.rwth-aachen.de) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Publ...
gpl-3.0
-5,242,585,203,455,404,000
41.824957
284
0.522177
false
3.664541
false
false
false
bmyerz/log2sqlite
projects/radish_paper/tpch_radish_experiments.py
1
3558
from grappa import GrappaExperiment, MPIRunGrappaExperiment """ A place to keep a bunch of example experiments. Feel free to use this script while developing experiments. But, when saving things for reproducibility, put each of your final experiments in a separate file """ # tpch tpch_sampa = GrappaExperiment({ ...
mit
1,643,706,453,897,373,200
35.306122
98
0.360596
false
3.975419
false
false
false
nismod/energy_demand
energy_demand/assumptions/fuel_shares.py
1
13596
"""All fuel shares of the base year for the different technologies are defined in this file. """ from energy_demand.initalisations import helpers def assign_by_fuel_tech_p( enduses, sectors, fueltypes, fueltypes_nr ): """Assigning fuel share per enduse for different technologies...
mit
-7,506,671,172,259,957,000
36.238356
129
0.576074
false
2.838171
false
false
false
drougge/wwwwellpapp
image.py
1
1071
#!/usr/bin/env python from os.path import exists from os import stat from time import strftime, gmtime, time from bottle import get, abort, response from common import init from wellpapp import RawWrapper, raw_exts def fmttime(t): return strftime("%a, %d %b %Y %H:%M:%S GMT", gmtime(t)) def serve(fn, ext): if not ...
mit
-7,243,784,597,464,014,000
23.906977
64
0.643324
false
2.496503
false
false
false
MewX/Psiphon3-for-Linux
pyclient/psi_api.py
1
11970
#!/usr/bin/python # # Copyright (c) 2012, Psiphon Inc. # All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later v...
gpl-2.0
6,429,732,307,235,011,000
40.5625
171
0.620718
false
4.103531
true
false
false
bitkeeper/python-opcua
opcua/server/address_space.py
1
27000
from threading import RLock import logging from datetime import datetime import collections import shelve try: import cPickle as pickle except: import pickle from opcua import ua from opcua.server.users import User class AttributeValue(object): def __init__(self, value): self.value = value ...
lgpl-3.0
-2,830,200,730,932,796,400
40.925466
165
0.619704
false
4.096495
false
false
false
guh/guh-cli
nymea/timedescriptor.py
1
11990
# -*- coding: UTF-8 -*- # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Copyright (C) 2016 - 2018 Simon Stuerz <simon.stuerz@guh.io> # # ...
gpl-2.0
-7,164,972,957,974,699,000
43.738806
153
0.525855
false
4.375912
false
false
false
ghtmtt/QGIS
python/plugins/db_manager/db_plugins/info_model.py
33
18079
# -*- coding: utf-8 -*- """ /*************************************************************************** Name : DB Manager Description : Database manager plugin for QGIS Date : May 23, 2011 copyright : (C) 2011 by Giuseppe Sucameli email : brush.tyler@...
gpl-2.0
-6,618,836,119,215,804,000
37.963362
156
0.57387
false
4.481656
false
false
false
JorgeDeLosSantos/nusa
nusa/io.py
1
2320
# *********************************** # Author: Pedro Jorge De Los Santos # E-mail: delossantosmfq@gmail.com # Blog: numython.github.io # License: MIT License # *********************************** """ The purpose of this module is to provide tools to build a model automatically from text files with coordinat...
mit
-7,657,294,035,896,943,000
25.976744
67
0.570259
false
3.253857
false
false
false
mlorant/webcrawler
robot/pagerank.py
1
5684
# -*- coding: utf-8 -*- # Part of this file is produced by: # Copyright (c) 2010 Pedro Matiello <pmatiello@gmail.com> # Juarez Bochi <jbochi@gmail.com> # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # files (th...
gpl-3.0
-816,333,319,626,065,700
29.403315
104
0.580049
false
3.917298
false
false
false
andela-ooshodi/codango-debug
codango/account/views.py
1
10668
from django.http import HttpResponse, Http404 from django.shortcuts import render, redirect from django.views.generic import View, TemplateView from django.contrib import messages from django.contrib.auth import authenticate, login from django.template.context_processors import csrf from django.contrib.auth.models impo...
mit
-8,443,781,310,264,066,000
35.786207
79
0.559618
false
4.732919
false
false
false
kjagoo/wger_stark
wger/gym/forms.py
2
3478
# -*- coding: utf-8 -*- # This file is part of wger Workout Manager. # # wger Workout Manager 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 ...
agpl-3.0
7,061,158,757,622,213,000
36.804348
100
0.589419
false
4.570302
false
false
false
CaptFrank/NetworkDeviceMonitor
NetworkMonitor/Base/Resource.py
1
2937
""" :Resource: ========== : This is the managed resource between processes. Resources such as queues, locks and data are housed here to allow for synchronization to occur. : :copyright: (c) 9/30/2015 by gammaRay. :license: BSD, see LICENSE for more details. Author: ga...
gpl-2.0
4,229,579,164,839,813,600
19.829787
77
0.470548
false
4.456753
false
false
false
apavlenko/vmf
cmake-clean.py
2
3100
#!/usr/bin/env python """ Clean cmake generated files. """ import optparse import os import shutil import subprocess import sys # Do not cleanup anything in these subdirectories. PRUNE_DIRS = [".svn", ".git", "CVS"] def make_clean(directory): """Run 'make clean' in directory. Arguments: - `directory`:...
apache-2.0
-3,668,471,455,453,956,600
25.724138
70
0.57871
false
4.229195
false
false
false
franklingu/leetcode-solutions
questions/design-search-autocomplete-system/Solution.py
1
1350
""" None """ from collections import defaultdict class TrieNode: def __init__(self): self.children = {} self.words = defaultdict(int) class AutocompleteSystem: def __init__(self, sentences: List[str], times: List[int]): self.ss = '' self.root = TrieNode() for sente...
mit
195,136,025,544,930,530
24.980769
99
0.527407
false
3.824363
false
false
false
richarddunks/ll84
ll84_proc.py
1
3453
#!/usr/bin/python # -*- coding: utf-8 -*- """ A script to process data from LL84 energy and water use benchmarking from http://www.nyc.gov/html/gbee/html/plan/ll84_scores.shtml Manually removed column 29 "OwnerName", column 62 "HistDist, and column 63 "Landmark" due to formatting errors that caused the file to be par...
gpl-2.0
8,096,575,113,988,458,000
15.447619
118
0.692152
false
2.43169
false
false
false
Endika/c2c-rd-addons
account_financial_report_chricar/wizard/wizard_general_ledger_report.py
5
7759
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # Copyright (c) 2009 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Res...
agpl-3.0
-3,547,208,066,806,900,700
42.836158
188
0.566826
false
3.757385
false
false
false
andela/codango
codango/community/tests/test_models.py
1
2484
from django.core.exceptions import ObjectDoesNotExist from django.test import TestCase from community.models import AddOn, Community from factories import AddOnFactory, CommunityFactory, UserFactory class AddonModelTestSuite(TestCase): def setUp(self): self.addon = AddOnFactory.build() self.commu...
mit
-36,654,392,462,678,070
36.074627
72
0.674316
false
3.798165
true
false
false
zfkl/analyses-de-donn-es
sendToVisuClient.py
1
1596
""" Allows to handle websockets, maintains clients list send json to web browser """ import tornado.ioloop import tornado.web import tornado.websocket from tornado.options import define, options, parse_command_line define("port", default=443, help="run on the given port", type=int) # we gonna store clients in dicti...
gpl-3.0
7,353,359,219,174,872,000
24.741935
67
0.640351
false
3.864407
false
false
false
vagonbar/GNUnetwork
gwn/gwnevents/gwnevent_dc.py
1
2850
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of GNUWiNetwork, # Copyright (C) 2014 by # Pablo Belzarena, Gabriel Gomez Sena, Victor Gonzalez Barbone, # Facultad de Ingenieria, Universidad de la Republica, Uruguay. # # GNUWiNetwork is free software: you can redistribute it ...
gpl-3.0
-2,478,899,628,620,671,500
36.5
158
0.614035
false
3.177258
true
false
false
ocadotechnology/django-nuit
example_project/demo/views.py
1
1347
from django.shortcuts import render from nuit.views import SearchableListView from .models import Publisher from .forms import PublisherForm from django.contrib import messages from django.contrib.auth.decorators import permission_required class MyListView(SearchableListView): model = Publisher template_name =...
apache-2.0
8,994,372,609,238,851,000
35.405405
77
0.709725
false
3.700549
false
false
false
hammerlab/mhctools
mhctools/netmhc3.py
1
1756
# Copyright (c) 2015-2017. Mount Sinai School of Medicine # # 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 applicabl...
apache-2.0
-303,155,215,597,512,100
38.909091
74
0.646355
false
4.074246
false
false
false
damoguyan8844/fabric-bolt
fabric_bolt/web_hooks/views.py
10
2284
import datetime from django.http import HttpResponseRedirect from django.db.models.aggregates import Count from django.contrib import messages from django.views.generic import CreateView, UpdateView, DetailView, DeleteView from django.core.urlresolvers import reverse_lazy, reverse from django_tables2 import Request...
mit
-2,128,097,468,239,109,400
25.252874
102
0.69352
false
4.064057
false
false
false
MeGotsThis/BotGotsThis
lib/cache/_bttv_api.py
1
3085
import asyncio import json from typing import Awaitable, Dict, List, Optional, Tuple # noqa: F401 from ._abc import AbcCacheStore from ..api import bttv class BetterTwitchTvApisMixin(AbcCacheStore): def _bttvGlobalEmoteKey(self) -> str: return 'emote:bttv' async def bttv_load_global_emotes(self, *,...
gpl-3.0
-1,112,745,212,235,990,500
37.08642
79
0.585737
false
3.450783
false
false
false
spacecowboy/jkutils
jkutils/misc.py
1
7628
""" Functions which do not sort well under another name. Will all be imported by __init__.py to package level. """ from __future__ import division import numpy as np import pandas as pd def split_dataframe_class_columns(df, upper_lim=5, lower_lim=3, int_only=True): ''' Splits columns of a dataframe where row...
gpl-2.0
-533,927,163,518,691,100
31.459574
112
0.597929
false
3.789369
true
false
false
rickyrem/garrulous-api
model/Users.py
1
6046
# Garrulous API # Authors: Michael Pierre and Richard Meyers """ Copyright (C) 2015 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later ver...
apache-2.0
-2,604,886,100,791,911,000
34.781065
182
0.565002
false
4.172533
false
false
false
FBTUG/DevZone
FBTUG_Commander/dialog_PeripheralSetting.py
1
6164
import Tkinter import tkMessageBox import tkFont #from Tkinter import * import tkSimpleDialog class PeripheralSetting(tkSimpleDialog.Dialog): # ######################################## def __init__(self, master, arg_PinList=[('',0)]): print 'init' strFont= 'Arial' self.__myfont12 = tkFo...
mit
-6,206,398,729,244,919,000
43.992701
205
0.542343
false
3.581639
false
false
false
whelan957/leetcode
python3/LinkedList/leetcode876. Middle of the Linked List.py
1
1168
# Given a non-empty, singly linked list with head node head, return a middle node of linked list. # If there are two middle nodes, return the second middle node. # Example 1: # Input: [1,2,3,4,5] # Output: Node 3 from this list (Serialization: [3,4,5]) # The returned node has value 3. (The judge's serialization ...
gpl-3.0
-9,035,342,479,006,186,000
27.487805
97
0.633562
false
3.081794
false
false
false
foobarbazblarg/stayclean
stayclean-2020-december/venv/lib/python3.8/site-packages/pip/_internal/utils/temp_dir.py
5
8845
from __future__ import absolute_import import errno import itertools import logging import os.path import tempfile from contextlib import contextmanager from pip._vendor.contextlib2 import ExitStack from pip._vendor.six import ensure_text from pip._internal.utils.compat import WINDOWS from pip._internal.utils.misc i...
mit
1,267,157,679,403,959,000
30.144366
79
0.596269
false
4.433584
false
false
false
adfernandes/pcp
build/ci/release-bintray.py
1
7751
#!/usr/bin/env python3 # pylint: disable=too-many-arguments import sys import os import argparse import yaml import requests PACKAGE_LICENSES = ['GPL-2.0'] PACKAGE_VCS_URL = 'https://github.com/performancecopilot/pcp' class TimeoutHTTPAdapter(requests.adapters.HTTPAdapter): """ https://findwork.dev/blog/adva...
lgpl-2.1
8,498,716,302,200,754,000
38.146465
117
0.599278
false
3.930527
false
false
false
Openlights/firemix
patterns/stripes.py
1
4028
# This file is part of Firemix. # # Copyright 2013-2020 Jonathan Evans <jon@craftyjon.com> # # Firemix 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...
gpl-3.0
-1,271,171,592,617,550,000
41.851064
141
0.654419
false
3.44568
false
false
false
shub0/algorithm-data-structure
python/generate_parenthesis.py
1
1205
#! /usr/bin/python ''' Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: "((()))", "(()())", "(())()", "()(())", "()()()" ''' class Solution: def validParenthesis(self, string): check = 0 for char ...
bsd-3-clause
813,236,506,331,725,800
28.390244
103
0.493776
false
3.95082
false
false
false
lexnederbragt/inverted_repeats
clip_inverted_repeats.py
1
7738
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <codecell> # Some Illumina reads from ancient DNA samples were found to contain an inverted repeat # with a different sequence inbetween # in other words, the first x bases of a read are the reverse complement of the last x bases # This script is meant to clip the ...
unlicense
329,393,044,782,642,940
37.884422
151
0.651848
false
3.417845
true
false
false
tarvitz/django-unity-asset-server-http-client
duashttp/router.py
1
1729
# coding: utf-8 from django.conf import settings from django.core.exceptions import ImproperlyConfigured DUAS_ENABLE_DB_WRITE = getattr(settings, 'DUAS_ENABLE_DB_WRITE', False) DUAS_DB_ROUTE_PREFIX = getattr(settings, 'DUAS_DB_ROUTE_PREFIX', 'unity_asset_server') class UnityAssetServe...
mit
-6,610,124,107,798,775,000
31.018519
84
0.567958
false
3.920635
false
false
false
jaraco/hgtools
hgtools/tests/test_git.py
1
1226
import os import pytest from hgtools import managers from hgtools.managers import cmd from hgtools.managers import subprocess def test_subprocess_manager_invalid_when_exe_missing(): """ If the hg executable dosen't exist, the manager should report False for .is_valid(). """ non_existent_exe = '/...
mit
-2,926,431,106,773,995,500
26.863636
69
0.632137
false
3.37741
true
false
false
googleads/google-ads-python
google/ads/googleads/v7/enums/types/batch_job_status.py
1
1129
# -*- coding: utf-8 -*- # 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...
apache-2.0
-4,685,226,113,718,705,000
28.710526
74
0.689105
false
3.947552
false
false
false
oelson/LittreParser
parse.py
1
17906
#-*- coding: utf-8 -*- __all__ = ["parser", "entry"] from textwrap import TextWrapper import xml.etree.ElementTree as ET from unidecode import unidecode from LittreParser.error import EntryNotFound def _xml2dict(root): """ Convert an XML node to a dictionnary. Recursive. """ out = [] for ch...
gpl-2.0
-451,669,834,033,869,900
31.054054
107
0.515346
false
3.64176
false
false
false
openEduConnect/eduextractor
eduextractor/sis/powerschool/powerschool_exporter.py
1
1716
import pandas as pd from ...config import _load_secrets import sqlalchemy import os from tqdm import tqdm class PowerSchoolSQLInterface: """A class, representing a interface to the Powerschool frontend which most teachers/students/admins have access to. """ def __init__(self, secrets=None): i...
mit
-6,560,301,399,092,877,000
34.020408
72
0.515734
false
4.247525
false
false
false
ysabel31/Python
Dialogues/dialogues/migrations/versions/3528db092ec4_.py
1
2683
"""empty message Revision ID: 3528db092ec4 Revises: Create Date: 2017-10-22 17:53:34.149039 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '3528db092ec4' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands auto gene...
mit
-6,968,749,891,703,271,000
34.302632
73
0.654491
false
3.430946
false
false
false
python-20161108/temp
wanghn/python_js/ids/ids_health.py
2
5614
#!/usr/bin/env python # -*- coding: utf-8 -*- # __author__ = "wanghn" import httplib import socket import time import os import ConfigParser import json import urllib2 import re def monitorwebapp(ip_result): webcip_state = {} timenow = time.strftime( "%Y-%m-%d %H:%M:%S", time.localtime( time.time( ) ) ) ...
gpl-3.0
8,447,014,818,641,653,000
34.764331
111
0.579622
false
3.446286
false
false
false
clstoulouse/motu-client-python
src/python/motu_utils/utils_stream.py
1
2638
#! /usr/bin/env python # -*- coding: utf-8 -*- # # Python motu client # # Motu, a high efficient, robust and Standard compliant Web Server for Geographic # Data Dissemination. # # http://cls-motu.sourceforge.net/ # # (C) Copyright 2009-2010, by CLS (Collecte Localisation Satellites) - # http://www.cls.fr - and Co...
lgpl-3.0
5,978,035,052,498,620,000
37.246377
94
0.650114
false
4.009119
false
false
false
yshalenyk/openprocurement.ocds.export
openprocurement/ocds/export/contrib/client.py
2
2609
import requests import requests.adapters import requests.exceptions from gevent.pool import Pool import logging logger = logging.getLogger(__name__) VERSION = 'X-Revision-N' VERSION_HASH = 'X-Revision-Hash' PREV_VERSION = 'X-Revision-Hash' class APIClient(object): def __init__(self, api_key, api_host, api_vers...
apache-2.0
4,707,716,879,600,359,000
36.271429
93
0.57225
false
3.888227
false
false
false
yosinski/python-mirametrix-network-client
calibClient.py
1
1305
#! /usr/bin/env python import sys from socket import * from time import sleep from helper import getLocalIP ''' Research code... may not work ''' def main(): if len(sys.argv) > 1: HOST = sys.argv[1] else: HOST = getLocalIP() PORT = 4242 BUFSIZ = 1024 ADDR = (HOST, PORT) ...
gpl-3.0
-4,517,076,597,275,788,000
21.118644
86
0.602299
false
2.965909
false
false
false
jtacoma/geometriki
geometriki/controllers/error.py
1
2494
# This file is part of geometriki. # # geometriki 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. # # geometriki is distributed ...
agpl-3.0
-8,312,929,771,086,351,000
36.787879
72
0.69567
false
4.129139
false
false
false
Spirals-Team/librepair
src/scripts/patched_builds.py
1
4289
""" This is a script to create a txt-file from every build repairnator has patched with the following info: Build URL Commit URL All patches along with the name of the tool that generated them Requirements: selenium webdriver for python pymongo geckodriver (for linux most likely) To use: Fill in the constants below w...
agpl-3.0
-5,967,810,801,157,670,000
28.57931
107
0.62672
false
3.72309
false
false
false
kilico/KBotCartero
KComEmilio.py
1
13308
# This python file uses the following encoding: utf-8 import random import os import re import imaplib import smtplib import email import email.errors from email.mime.text import MIMEText from email.mime.application import MIMEApplication from email.mime.multipart import MIMEMultipart import ConfigParser class K...
gpl-3.0
1,054,293,651,292,944,900
34.63807
81
0.494095
false
3.534432
false
false
false
florensacc/snn4hrl
bonus_evaluators/grid_bonus_evaluator.py
1
17262
import numpy as np import gc import os.path as osp from rllab.misc import logger from rllab.misc import tensor_utils import collections from functools import reduce import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt from sandbox.snn4hrl.bonus_evaluators.base import BonusEvaluator class GridBonus...
mit
-7,675,450,768,337,061,000
51.468085
161
0.550805
false
3.478839
false
false
false
modlinltd/ModelAdmin-Mixins
modeladmin_utils/mixins/limited_inlines.py
2
1256
from django.conf import settings from django.forms.models import BaseInlineFormSet class LimitedInlineFormset(BaseInlineFormSet): """ A specialized subclass of BaseInlineFormSet which limits the queryset to a maximum (specified in settings: default to 15). """ limiting_inlines = True def get_...
mit
2,485,422,627,217,576,000
34.885714
73
0.650478
false
4.331034
false
false
false
degoldschmidt/pytrack-analysis
scripts/run_posttracking.py
1
18972
import argparse import subprocess, os import os.path as op import numpy as np import pandas as pd import matplotlib.pyplot as plt from pytrack_analysis import Multibench from pytrack_analysis.dataio import VideoRawData from pytrack_analysis.profile import get_profile, get_scriptname, show_profile from pytrack_analysis...
gpl-3.0
-8,736,967,817,184,372,000
48.535248
197
0.531467
false
3.110674
false
false
false
liuzzfnst/tp-libvirt
libvirt/tests/src/virsh_cmd/pool/virsh_find_storage_pool_sources_as.py
6
3322
import logging import os from virttest import virsh, utils_test, utils_misc from autotest.client import utils, lv_utils from autotest.client.shared import error def run(test, params, env): """ Test command: virsh find-storage-pool-sources-as 1. Prepare env to provide source storage: 1). For 'netfs...
gpl-2.0
-5,908,163,533,441,761,000
36.325843
78
0.569235
false
3.926714
true
false
false
iwanders/gps_track_pod
gpspod/debug.py
1
5513
#!/usr/bin/env python3 # The MIT License (MIT) # # Copyright (c) 2016 Ivor Wanders # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rig...
mit
-6,124,315,373,774,978,000
31.815476
79
0.583711
false
3.86335
false
false
false
mread/buck
src/com/facebook/buck/parser/buck.py
1
15641
from __future__ import with_statement import __future__ import copy import fnmatch import functools import glob as glob_module import imp import inspect import itertools import json from pathlib import Path import optparse import os import os.path import re import sys # When build files are executed, the functions i...
apache-2.0
680,049,148,045,231,000
32.709052
90
0.630778
false
4.238753
false
false
false
big-max/ansible
playbooks/deploy/callback_plugins/callback.py
1
7031
import os import time import json import datetime import pdb import ConfigParser from pymongo import MongoClient from ansible.plugins.callback import CallbackBase from websocket import create_connection,WebSocket #coding=utf8 def get_conf(cls,key): cf=ConfigParser.ConfigParser() cf.read('/opt/tornado/conf/app....
gpl-3.0
8,567,472,610,853,746,000
38.723164
170
0.602759
false
3.455037
false
false
false
eduNEXT/edunext-ecommerce
ecommerce/extensions/voucher/tests/test_utils.py
1
33039
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import uuid import ddt import httpretty from django.core.exceptions import ValidationError from django.db import IntegrityError from django.test import override_settings from django.utils.translation import ugettext_lazy as _ from factor...
agpl-3.0
-5,427,811,836,126,914,000
42.231675
119
0.640619
false
3.857627
true
false
false
CONSOLNY/rglk
first_app/admin.py
1
2963
from django import forms from django.contrib import admin from django.contrib.auth.models import Group from django.contrib.auth.admin import UserAdmin as BaseUserAdmin from django.contrib.auth.forms import ReadOnlyPasswordHashField from first_app.models import * # Register your models here. class CellAdmin(admin.Model...
mit
-6,099,835,934,507,987,000
35.580247
103
0.697604
false
3.736444
false
false
false
janbrohl/SimpleTAL
tests/TALESTests/VariablePathTest.py
1
4398
#!/usr/bn/python # -*- coding: iso-8859-1 -*- # Copyright (c) 2016, Jan Brohl <janbrohl@t-online.de> # All rights reserved. # See LICENSE.txt # Copyright (c) 2004 Colin Stewart (http://www.owlfish.com/) # All rights reserved. # # Redistribution and use in source and binary forms, with or without # ...
bsd-3-clause
1,952,199,184,770,537,700
37.243478
108
0.644156
false
3.944395
true
false
false
MediffRobotics/DeepRobotics
DeepLearnMaterials/tutorials/tensorflowTUT/tf15_tensorboard/full_code.py
1
2777
# View more python learning tutorial on my Youtube and Youku channel!!! # Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg # Youku video tutorial: http://i.youku.com/pythontutorial """ Please note, this code is only for python 3+. If you are using python 2+, please modify the code acco...
gpl-3.0
-4,064,351,649,322,628,600
37.583333
109
0.652143
false
3.255569
false
false
false
namecoin/namecoin-core
test/functional/p2p_addr_relay.py
7
8564
#!/usr/bin/env python3 # Copyright (c) 2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ Test addr relay """ from test_framework.messages import ( CAddress, NODE_NETWORK, NODE_WITNESS...
mit
8,815,426,499,682,522,000
39.396226
136
0.64269
false
3.549109
true
false
false
sadig/DC2
components/dc2-appserver/dc2/appserver/rpcmethods/macaddresses.py
1
4532
# -*- coding: utf-8 -*- ############################################################################### # # (DC)² - DataCenter Deployment Control # Copyright (C) 2010, 2011, 2012, 2013, 2014 Stephan Adig <sh@sourcecode.de> # This program is free software; you can redistribute it and/or modify # it under th...
gpl-2.0
4,016,057,753,600,655,400
36.438017
80
0.639073
false
3.656174
false
false
false
charmoniumQ/Surprise
examples/load_custom_dataset_predefined_folds.py
1
1136
""" This module descibes how to load a custom dataset when folds (for cross-validation) are predefined by train and test files. As a custom dataset we will actually use the movielens-100k dataset, but act as if it were not built-in. """ from __future__ import (absolute_import, division, print_function, ...
bsd-3-clause
-2,546,405,243,802,962,000
30.555556
79
0.715669
false
3.21813
true
false
false
liminspace/django-mjml
testprj/tests_tcpserver.py
1
1892
# coding=utf-8 from __future__ import absolute_import from django.test import TestCase from mjml import settings as mjml_settings from testprj.tools import safe_change_mjml_settings, MJMLServers, MJMLFixtures, render_tpl class TestMJMLTCPServer(MJMLFixtures, MJMLServers, TestCase): SERVER_TYPE = 'tcpserver' _...
mit
-7,038,980,208,716,193,000
33.722222
102
0.596267
false
3.598848
true
false
false
david672orford/pykarta
pykarta/server/app.py
1
2461
#! /usr/bin/python3 # pykarta/server/app.py # Server for use by PyKarta applications. # Provides geocoding and vector map tiles. # Last modified: 17 October 2019 import re, os try: import pykarta except ImportError: # During testing we may run this script from its own directory import sys sys.path.insert(1, "../....
gpl-2.0
-7,287,627,514,957,235,000
30.551282
91
0.687525
false
2.861628
false
false
false
Varbin/EEH
_vendor/ldap3/extend/novell/partition_entry_count.py
1
2031
""" """ # Created on 2014.08.05 # # Author: Giovanni Cannata # # Copyright 2014, 2015, 2016, 2017 Giovanni Cannata # # This file is part of ldap3. # # ldap3 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 Foundati...
bsd-2-clause
-3,472,395,893,567,100,000
34.631579
88
0.702117
false
3.839319
false
false
false
YaleDHLab/lab-workshops
machine-learning/helpers.py
1
7948
from mpl_toolkits.mplot3d import Axes3D from matplotlib.colors import ListedColormap import numpy as np import matplotlib.pyplot as plt import warnings # quiet scipy future warnings warnings.filterwarnings('ignore') # decision boundary grid colors grid_colors = ListedColormap([ '#ff8585', '#6db4f3', ]) # decisio...
mit
-3,475,078,968,114,607,000
35.296804
96
0.646955
false
3.074662
false
false
false
little-dude/simple-ostinato
simple_ostinato/constants.py
1
2116
""" This module containts constants that are for internal use only. """ from . import utils from ostinato.core import ost_pb class _Protocols(utils.Enum): """ Enum for the available protocols """ # Layer 1 protocols MAC = ost_pb.Protocol.kMacFieldNumber # Layer 2 protocol...
gpl-3.0
-705,805,642,238,411,100
41.32
70
0.600189
false
3.485997
false
false
false
mattkenney/feedsquish
update.py
1
2664
#!/usr/bin/env python # # Copyright 2012 Matt Kenney # # This file is part of Feedsquish. # # Feedsquish 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 opti...
agpl-3.0
-5,369,418,050,483,782,000
31.888889
101
0.642267
false
3.614654
false
false
false
pythonindia/wye
wye/reports/views.py
1
8745
import datetime import csv from django.contrib.auth.decorators import login_required from django.shortcuts import render from django.http import HttpResponse from django.contrib.auth.models import User from django_pandas.io import read_frame, pd # from wye.base.constants import WorkshopStatus from wye.workshops.models ...
mit
-7,042,324,506,256,734,000
37.355263
81
0.594282
false
3.4348
false
false
false
rabrahm/ceres
coralie/coraliepipe.py
1
59702
import sys import matplotlib matplotlib.use("Agg") base = '../' sys.path.append(base+"utils/Continuum") sys.path.append(base+"utils/Correlation") sys.path.append(base+"utils/GLOBALutils") sys.path.append(base+"utils/OptExtract") baryc_dir= base+'utils/SSEphem/' sys.path.append(baryc_dir) ephemeris='DEc403' import ...
mit
-7,693,740,892,673,060,000
44.228788
181
0.55308
false
2.856282
false
false
false
xiedidan/luna-data-pre-processing
segment.py
1
1351
# -*- coding:utf-8 -*- import sys sys.path.append("../luna-data-pre-processing") import os from glob import glob from tqdm import tqdm from multiprocessing import Pool from NoduleSerializer import NoduleSerializer import lung_segmentation # create lung mask class Segment(object): # constructor def __init__...
gpl-3.0
1,400,560,257,404,363,800
26.571429
90
0.655811
false
3.661247
false
false
false
lgrahl/threema-msgapi-sdk-python
tests/test_cli.py
1
9981
import subprocess import pytest from threema.gateway import ReceptionCapability from threema.gateway import __version__ as _version from threema.gateway import feature_level from threema.gateway.key import Key class TestCLI: @pytest.mark.asyncio async def test_invalid_command(self, cli): with pytest...
mit
-2,318,817,066,822,805,000
40.868644
89
0.629289
false
3.531451
true
false
false
litedesk/litedesk-webserver-provision
src/authentication/views.py
1
2430
#!/usr/bin/env python #-*- coding: utf-8 -*- # Copyright 2014, Deutsche Telekom AG - Laboratories (T-Labs) # # 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/licen...
apache-2.0
-473,156,678,292,000,500
32.75
84
0.695062
false
4.090909
false
false
false
wuqize/FluentPython
chapter1/vector.py
1
1735
#coding=utf-8 from math import hypot class Vector: """自定义二维向量""" def __init__(self, x=0, y=0): self.x = x self.y = y def __repr__(self): """ repr 就是通过 __repr__ 这个特殊方法来得到一个对象的字符串表示形式的。 __repr__ 和 __str__ 的区别在于, 后者是在 str() 函数被使用, ...
lgpl-3.0
8,450,293,533,702,580,000
22.811321
55
0.466297
false
1.916413
false
false
false
CaymanUnterborn/burnman
tests/test_solidsolution.py
3
9813
from __future__ import absolute_import import unittest import os import sys import warnings sys.path.insert(1, os.path.abspath('..')) import numpy as np import burnman from burnman.mineral import Mineral from burnman.processchemistry import dictionarize_formula, formula_mass from util import BurnManTest class forste...
gpl-2.0
-5,718,570,812,787,262,000
32.377551
112
0.558749
false
2.90928
true
false
false
blaze/dask
dask/bag/text.py
1
5183
import io import os from functools import partial from tlz import concat from ..bytes import open_files, read_bytes from ..delayed import delayed from ..utils import parse_bytes, system_encoding from .core import from_delayed delayed = delayed(pure=True) def read_text( urlpath, blocksize=None, compress...
bsd-3-clause
-3,570,770,384,754,851,300
31.39375
87
0.599074
false
4.055556
true
false
false
akmetainfo/opencorpora
anaphora/export_groups.py
2
7308
#!/usr/bin/env python2 # -*- coding: utf-8 -*- import sys sys.path.append('/corpus/python') from Annotation import AnnotationEditor CONFIG_PATH = "/corpus/config.ini" STR_NONE = 'NONE' STR_ALL = 'ALL' def choose_annotators(dbh, only_moderated): moderators = {} if only_moderated: dbh.execute(""" ...
gpl-2.0
262,133,076,401,282,620
35.358209
182
0.568008
false
3.591155
false
false
false
hfutsuchao/Python2.6
premierClick/premierCityCount.py
1
1505
#coding:utf-8 import GJDB db = GJDB.GJDB() db.rp() db.selectDB('house_report') #dts = [] dts = ['2013_01','2013_02','2013_03','2014_01','2014_02','2014_03'] result1 = open('result1.txt','w') result2 = open('result2.txt','w') for dt in dts: print dt sql1 = 'SELECT AccountCityId, FROM_UNIXTIME(Re...
gpl-2.0
7,618,124,902,688,000,000
66.5
465
0.665116
false
2.396497
false
false
false
CristianCantoro/wikipedia-tags-in-osm
wikipedia_coords_downloader.py
2
9374
#! /usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2016 Simone F. <groppo8@gmail.com> # # This file is part of wikipedia-tags-in-osm. # wikipedia-tags-in-osm 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 Foun...
gpl-3.0
-9,216,762,979,593,107,000
41.026906
81
0.525928
false
4.187668
false
false
false
andycavatorta/oratio
Roles/avl-input-1/main.py
1
5600
""" inputs: 4 cap sensors on I2C 3 rotary encoders on SPI output topics: pitch_key_event - integer from 0 to 47 voice_key_1_position - float from 0.0 to 1.0 voice_key_2_position - float from 0.0 to 1.0 voice_key_3_position - float from 0.0 to 1.0 """ import Adafruit_MPR121.MPR121 as MPR121...
mit
574,097,868,440,619,140
33.567901
96
0.615714
false
3.478261
false
false
false
zstanecic/NVDARemote
addon/globalPlugins/remoteClient/local_machine.py
1
2755
import os import wx from . import input import api import nvwave import tones import speech import ctypes import braille import inputCore import versionInfo import logging logger = logging.getLogger('local_machine') def setSpeechCancelledToFalse(): """ This function updates the state of speech so...
gpl-2.0
4,050,571,339,939,729,000
27.308511
133
0.716152
false
3.233568
false
false
false
HiTechIronMan/openfda
openfda/parallel/outputs.py
1
3765
import cPickle import multiprocessing import os import logging import subprocess import types import leveldb import simplejson as json logger = logging.getLogger('mapreduce') class MROutput(object): suffix = 'db' class Writer(object): def __init__(self, filename, **kw): self.filename = filename d...
cc0-1.0
6,950,219,569,277,280,000
27.522727
92
0.643559
false
3.410326
false
false
false
peterayeni/rapidsms
rapidsms/backends/vumi/tests.py
1
9379
import json from mock import patch from django.test import TestCase from django.core.urlresolvers import reverse from rapidsms.backends.vumi.outgoing import VumiBackend from rapidsms.backends.vumi.forms import VumiForm from rapidsms.tests.harness import RapidTest, CreateDataMixin class VumiFormTest(TestCase): ...
bsd-3-clause
-7,346,952,051,807,796,000
43.240566
94
0.572449
false
3.954047
true
false
false
jfining/mincss
run.py
1
2337
#!/usr/bin/env python from __future__ import print_function import os import sys import time # make sure it's running the mincss here and not anything installed sys.path.insert(0, os.path.dirname(__file__)) from mincss.processor import Processor def run(args): options = {'debug': args.verbose} if args.phant...
bsd-3-clause
4,892,649,772,427,431,000
29.350649
67
0.575524
false
3.567939
false
false
false
abramhindle/UnnaturalCodeFork
python/testdata/launchpad/lib/lp/bugs/browser/bugcomment.py
1
12906
# Copyright 2006-2012 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Bug comment browser view classes.""" __metaclass__ = type __all__ = [ 'BugComment', 'BugCommentBoxExpandedReplyView', 'BugCommentBoxView', 'BugCommentBread...
agpl-3.0
-239,312,751,276,880,060
33.233422
78
0.641872
false
4.325067
false
false
false
phlax/pootle
pootle/apps/pootle_score/migrations/0002_set_user_scores.py
6
3384
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2017-01-02 07:04 from __future__ import unicode_literals from django.db import migrations from django.db.models import functions, Case, IntegerField, Sum, When class TranslationActionCodes(object): NEW = 0 # 'TA' unit translated EDITED = 1 # 'TE' unit...
gpl-3.0
-4,285,922,003,002,522,000
38.788235
78
0.55825
false
4.380829
false
false
false
arbenson/tensor-sc
scripts/dir3cycles.py
2
1281
import sys import numpy as np import snap # Enumerate all of the directed 3 cycles in a graph. symmetrize = True def EnumerateDir3Cycles(G, name): ''' Count all directed 3 cycles in the graph. Returns an array of dictionaries counts such that counts[w][v] is the number of 3-cycles involving the edge w -...
bsd-2-clause
-7,635,492,846,843,102,000
29.5
72
0.460578
false
3.767647
false
false
false
prrvchr/USBTerminal
USB/InitGui.py
1
3558
# -*- coding: utf-8 -*- #*************************************************************************** #* * #* Copyright (c) 2015 Pierre Vacher <prrvchr@gmail.com> * #* ...
gpl-2.0
1,791,434,675,139,694,800
41.357143
89
0.426082
false
4.481108
false
false
false