repo_name stringlengths 5 92 | path stringlengths 4 221 | copies stringclasses 19
values | size stringlengths 4 6 | content stringlengths 766 896k | 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 32 997 | alpha_frac float64 0.25 0.96 | autogenerated bool 1
class | ratio float64 1.5 13.6 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
FilipeMaia/arrayfire-python | arrayfire/array.py | 1 | 30063 | #######################################################
# Copyright (c) 2015, ArrayFire
# All rights reserved.
#
# This file is distributed under 3-clause BSD license.
# The complete license agreement can be obtained at:
# http://arrayfire.com/licenses/BSD-3-Clause
######################################################... | bsd-3-clause | -5,315,669,486,786,941,000 | 27.30791 | 100 | 0.520939 | false | 3.725279 | false | false | false |
ethansshaw/stellavitrum | ScienceFairProcess.py | 1 | 10349 | #!/usr/bin/env python
"""
Written by Ethan Shaw
"""
from astropy.io import fits
import sys, png, math, os
colors = ['red', 'green', 'blue']
# Build x_axis_len rows, each containing y_axis_len columns
# access with PNG_data[row][column]
def buildMatrix(x_axis_len, y_axis_len, greyscale=True):
# set up empty list (mat... | mit | 1,193,926,610,286,185,000 | 30.081081 | 109 | 0.689439 | false | 2.839232 | false | false | false |
sbelskie/symplicity | Symplicity/local_settings.py | 1 | 2695 | """
Django settings for Symplicity 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 os
import dj_database_url
# Build paths inside the... | apache-2.0 | 5,726,592,050,074,065,000 | 24.683168 | 77 | 0.687199 | false | 3.294621 | false | false | false |
oldm/OldMan | oldman/schema/hydra.py | 1 | 1520 | from uuid import uuid4
from rdflib import URIRef, RDF, RDFS
from oldman.vocabulary import OLDM_CORRESPONDING_CLASS
class HydraSchemaAdapter(object):
"""Updates some Hydra patterns in the schema graph:
- hydra:Link: create a hydra:Class, subclass of the link range that support the same operations
"... | bsd-3-clause | -5,559,144,035,788,686,000 | 35.190476 | 105 | 0.646053 | false | 3.653846 | false | false | false |
blackshirt/dompetku | dompetku/handler/services.py | 1 | 3750 | #!/usr/bin/env python
#
# Copyright @2014 blackshirtmuslim@yahoo.com
# Licensed: see Python license
"""Module to handle json services."""
import datetime
import json
import peewee
import tornado.web
import tornado.escape
from dompetku.handler import base
from dompetku.utils import jsonify
from dompetku.model import ... | bsd-2-clause | -4,487,325,386,750,957,000 | 29.241935 | 92 | 0.524267 | false | 4.002134 | false | false | false |
spel-uchile/SUCHAI-Flight-Software | sandbox/log_parser.py | 1 | 1956 | import re
import argparse
import pandas as pd
# General expressions
re_error = re.compile(r'\[ERROR\]\[(\d+)\]\[(\w+)\](.+)')
re_warning = re.compile(r'\[WARN \]\[(\d+)\]\[(\w+)\](.+)')
re_info = re.compile(r'\[INFO \]\[(\d+)\]\[(\w+)\](.+)')
re_debug = re.compile(r'\[DEBUG\]\[(\d+)\]\[(\w+)\](.+)')
re_verbose = re.co... | gpl-3.0 | 7,759,135,881,385,060,000 | 30.548387 | 83 | 0.599182 | false | 3.233058 | false | false | false |
pombreda/ruffus | ruffus/test/test_verbosity.py | 1 | 8627 | #!/usr/bin/env python
from __future__ import print_function
"""
test_verbosity.py
"""
temp_dir = "test_verbosity/"
import unittest
import os
import sys
# add grandparent to search path for testing
grandparent_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))
sys.path.insert(0, grandpar... | mit | 8,074,170,189,742,017,000 | 44.405263 | 144 | 0.534833 | false | 3.688328 | true | false | false |
ewilazarus/snnm | snnm.py | 1 | 2886 | #!/usr/bin/python
"""
snnm
~~~~
This module contains the source code for `snnm`
Snnm is an utility tool created to fetch synonyms for a given expression from
the web and print them to the console.
"""
import bs4
import click
import requests
BASE_URL = 'http://www.thesaurus.com/browse/'
def _fetch_html(expression):... | mit | -3,771,467,267,364,749,000 | 24.767857 | 79 | 0.592862 | false | 3.6075 | false | false | false |
vmalloc/gossip | gossip/utils.py | 2 | 2484 | import itertools
from .exceptions import CannotResolveDependencies
from .helpers import DONT_CARE, FIRST
def topological_sort_registrations(registrations, unconstrained_priority=DONT_CARE):
graph = _build_dependency_graph(registrations, unconstrained_priority=unconstrained_priority)
returned_indices = _topolo... | bsd-3-clause | 8,597,037,287,050,342,000 | 36.636364 | 99 | 0.612721 | false | 4.388693 | false | false | false |
philanthropy-u/edx-platform | openedx/core/djangoapps/user_authn/views/tests/test_login.py | 1 | 29762 | # coding:utf-8
"""
Tests for student activation and login
"""
import json
import unicodedata
import unittest
import ddt
import six
from django.conf import settings
from django.contrib.auth.models import User
from django.core import mail
from django.core.cache import cache
from django.http import HttpResponse, HttpResp... | agpl-3.0 | -3,259,418,563,379,477,500 | 44.621538 | 118 | 0.643859 | false | 3.836223 | true | false | false |
bruteforce1/cryptopals | set2/ch10/implement_aes_cbc.py | 1 | 2510 | #!/usr/bin/python3
"""
CBC mode is a block cipher mode that allows us to encrypt irregularly-
sized messages, despite the fact that a block cipher natively only
transforms individual blocks.
In CBC mode, each ciphertext block is added to the next plaintext block
before the next call to the cipher core.
The first... | mit | 5,468,502,557,935,550,000 | 34.352113 | 77 | 0.61753 | false | 3.808801 | false | false | false |
charanpald/features | features/test/PrimalCCATest.py | 1 | 3226 |
import unittest
import numpy
import scipy.linalg
from features.PrimalCCA import PrimalCCA
from features.KernelCCA import KernelCCA
from kernel.LinearKernel import LinearKernel
import logging
class PrimalCCATest(unittest.TestCase):
def setUp(self):
numpy.seterr(all='ignore')
pass
def test... | gpl-3.0 | -873,620,248,228,570,200 | 27.298246 | 85 | 0.579045 | false | 3.060721 | true | false | false |
myt00seven/svrg | cifar/alexnet_lasagne/lasagne-googlenet-master/googlenet/layers/bn.py | 1 | 4243 | import numpy as np
import theano.tensor as T
import theano
from lasagne import init # from .. import init
from lasagne import nonlinearities # from .. import nonlinearities
from lasagne.layers.base import Layer # from .base import Layer
__all__ = [
"BNLayer",
]
class BNLayer(Layer):
"""
lasagne.layers... | mit | 4,750,715,369,948,741,000 | 40.194175 | 191 | 0.634928 | false | 3.638937 | false | false | false |
qrsforever/workspace | python/learn/thinkstats/rankit.py | 1 | 1807 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""This file contains code for use with "Think Stats",
by Allen B. Downey, available from greenteapress.com
Copyright 2010 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
import random
import thinkstats
import myplot
import matplotlib.pyplot as p... | mit | 151,881,123,661,949,600 | 21.308642 | 75 | 0.614278 | false | 3.461686 | false | false | false |
baliga-lab/weeder_patched | python/seqtools.py | 1 | 3069 | HAMMING_MAX = 9999
def read_sequences_from_fasta_string(fasta_string):
"""reads the sequences contained in a FASTA string"""
lines = fasta_string.split('\n')
sequences = []
seqbuffer = ""
seqname = None
for line in lines:
line = line.strip()
if line.startswith('>'):
... | gpl-3.0 | -7,517,009,544,331,105,000 | 24.789916 | 62 | 0.525904 | false | 3.675449 | false | false | false |
mohanprasath/Course-Work | data_analysis/uh_data_analysis_with_python/hy-data-analysis-with-python-spring-2020/part03-e05_correlation/test/test_correlation.py | 1 | 2795 | #!/usr/bin/env python3
import unittest
from unittest.mock import patch
from tmc import points
from tmc.utils import load, get_out
module_name="src.correlation"
correlations = load(module_name, "correlations")
lengths = load(module_name, "lengths")
def patch_name(m, d):
import importlib
parts=d.split(".")
... | gpl-3.0 | -656,753,270,546,592,900 | 33.085366 | 105 | 0.563148 | false | 3.813097 | true | false | false |
NeoRazorX/ubuntufaq | public.py | 1 | 15820 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of ubuntufaq
# Copyright (C) 2011 Carlos Garcia Gomez neorazorx@gmail.com
#
# 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 Foun... | agpl-3.0 | -7,409,657,376,595,017,000 | 43.784703 | 179 | 0.49864 | false | 3.704077 | false | false | false |
DataDog/integrations-core | openstack_controller/tests/common.py | 1 | 14615 | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import datetime
import os
CHECK_NAME = 'openstack'
FIXTURES_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'fixtures')
ALL_IDS = ['server-1', 'server-2', 'other-1', 'other-2']
EXCLUDED_NETWORK... | bsd-3-clause | 3,778,650,173,125,150,700 | 37.159269 | 119 | 0.515156 | false | 3.039725 | true | false | false |
asimshankar/tensorflow | tensorflow/python/saved_model/save.py | 1 | 34278 | # Copyright 2018 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 | -1,015,136,350,667,706,800 | 45.010738 | 162 | 0.722212 | false | 4.222989 | false | false | false |
stephane-caron/ijhr-2016 | pymanoid/cone.py | 1 | 2305 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 Stephane Caron <stephane.caron@normalesup.org>
#
# This file is part of pymanoid.
#
# pymanoid 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
# Foundatio... | gpl-3.0 | 8,395,834,680,207,245,000 | 25.802326 | 79 | 0.625163 | false | 3.153215 | false | false | false |
cs98jrb/Trinity | mysite/events/forms/booking.py | 1 | 2961 | __author__ = 'james'
from django.utils.translation import ugettext as _
from django import forms
from django.core.exceptions import ValidationError
from django.contrib.auth.models import User
from django.contrib.auth import login, authenticate
from events.models import Booking
from orders.models import Order, OrderIt... | gpl-2.0 | -287,810,376,454,806,340 | 28.039216 | 72 | 0.570078 | false | 4.367257 | false | false | false |
Midnighter/pyorganism | setup.py | 1 | 2511 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
==================
PyOrganism Package
==================
:Authors:
Moritz Emanuel Beber
:Date:
2012-05-22
:Copyright:
Copyright(c) 2012 Jacobs University of Bremen. All rights reserved.
:File:
setup.py
"""
import sys
from os.path import join
from s... | bsd-3-clause | 7,473,944,302,607,792,000 | 29.621951 | 94 | 0.562724 | false | 3.966825 | false | false | false |
abice-sbr/adaptsearch | blastalign.py | 1 | 4394 | import string, re
# Written by Robert Belshaw (School of Biomedical & Healthcare Sciences, University of Plymouth) & Aris Katzourakis (Department of Zoology, University of Oxford)
# For more information and to cite see Belshaw, R & Katzourakis, A (2005) BlastAlign: a program that uses blast to align problematic nucleo... | gpl-3.0 | 5,974,816,698,575,030,000 | 28.891156 | 181 | 0.69117 | false | 2.913793 | false | false | false |
chrismamil/chowda | test/test_chowda.py | 1 | 2201 | import unittest
import os
import chowda.parsing as parse
import datetime
import pandas as pd
from chowda.load import load_file
DATA_DIR = os.path.join(os.path.dirname(__file__), "data")
TEST_FILE = "CTL1 wk3 exp1 RAW data.txt"
TEST_1 = os.path.join(DATA_DIR, TEST_FILE)
class TestChowda(unittest.TestCase):
def s... | mit | -1,276,954,630,114,679,000 | 35.081967 | 73 | 0.613358 | false | 3.510367 | true | false | false |
CDKGlobal/cd-performance-promotion | cd_perf_promotion/engines/comparisonengine.py | 1 | 19434 | import json
import operator
class ComparisonEngine:
"""
Queries the performance tools' APIs and determines if the build passes
the target requirements.
"""
def check_health_severity(self, violation):
"""
Fails the build if the defined severity is found in the health rule
vi... | mit | -1,119,515,072,854,985,200 | 64.877966 | 229 | 0.591129 | false | 4.58241 | true | false | false |
Frky/scat | src/shell/memory/addrtable.py | 1 | 1331 | #-*- coding: utf-8 -*-
class AddrTable(object):
TABLE_SIZE = 10000
def __init__(self, dic=False):
self.__addr = list()
self.__dic = dic
for i in xrange(AddrTable.TABLE_SIZE):
if self.__dic:
self.__addr.append(dict())
else:
self._... | mit | -7,471,110,895,551,581,000 | 26.163265 | 50 | 0.486852 | false | 3.996997 | false | false | false |
BenjaminSchubert/web-polls | backend/errors/http.py | 1 | 1737 | """
This module contains a collection of commonly encountered HTTP exceptions.
This allows all these http exceptions to be treated in the same way and simplifies the return of errors to the user.
"""
from errors import ErrorMessage
__author__ = "Benjamin Schubert <ben.c.schubert@gmail.com>"
class BaseHTTPExceptio... | mit | -7,086,277,074,543,223,000 | 27.95 | 116 | 0.639033 | false | 4.320896 | false | false | false |
ralbayaty/KaggleRetina | testing/censureHistCalc.py | 1 | 4517 | from skimage.feature import CENSURE
from skimage.color import rgb2gray
import matplotlib.pyplot as plt
import numpy as np
import cv2
import sys
from PIL import Image, ImageDraw
def draw_keypoints(img, kp, scale):
draw = ImageDraw.Draw(img)
# Draw a maximum of 300 keypoints
for i in range(min(len(scale),300... | gpl-2.0 | 159,560,390,159,278,880 | 36.032787 | 102 | 0.629179 | false | 3.210377 | false | false | false |
qiou/Dev | python/edf.py | 1 | 4511 | #=========================================================================
# Dependencies / Libraries
#=========================================================================
import time
import serial
import MySQLdb
import subprocess
from time import sleep
import datetime
#============================================... | gpl-2.0 | 3,979,199,428,035,871,000 | 35.379032 | 265 | 0.441809 | false | 3.617482 | false | false | false |
rithms/hearthstone | xml_to_json.py | 1 | 4835 | #!/usr/bin/env python
from bs4 import BeautifulSoup
import glob
import json
#############################################
# Convert Hearthstone card data XML to JSON #
#############################################
__author__ = "Taylor Caldwell - http://github.com/rithms"
__copyright__ = "Copyright 2015, Taylor Caldw... | mit | 7,331,306,430,884,571,000 | 20.20614 | 67 | 0.588211 | false | 2.512994 | false | false | false |
bodedev/prospera | plataforma/management/commands/atualizar_saldos.py | 1 | 2085 | # -*- coding: utf-8 -*-
from django.conf import settings
from django.core.management.base import BaseCommand
from plataforma.constants import ETHER_DIVISOR
from plataforma.models import Saldo
import requests
def buscar_saldo(carteira):
try:
r = requests.get("https://api.etherscan.io/api?module=account&a... | mit | -6,934,085,334,793,678,000 | 44.326087 | 226 | 0.632134 | false | 3.434926 | false | false | false |
jas0n1ee/SonyCameraAPI | takePicture.py | 1 | 1212 | #!/usr/bin/env python
from sonyAPI2 import API2
import cv2
import urllib2
import numpy as np
import time
import struct
api = API2()
api.update_api_list()
try:
result = api.do('getAvailableCameraFunction')
current = result['result'][0]
availavle = result['result'][1]
if current != "Remote Shooting":
... | apache-2.0 | 5,010,609,995,021,559,000 | 23.734694 | 59 | 0.640264 | false | 3.338843 | false | true | false |
junhe/chopper | src/MWpyFS/Monitor.py | 1 | 44187 | # Chopper is a diagnostic tool that explores file systems for unexpected
# behaviors. For more details, see paper Reducing File System Tail
# Latencies With Chopper (http://research.cs.wisc.edu/adsl/Publications/).
#
# Please send bug reports and questions to jhe@cs.wisc.edu.
#
# Written by Jun He at University of Wis... | gpl-2.0 | 4,359,682,231,986,908,700 | 33.280062 | 95 | 0.512707 | false | 3.906206 | false | false | false |
isaachenrion/jets | src/proteins/train/validation.py | 1 | 1461 | import logging
import time
import torch
from src.data_ops.wrapping import unwrap
from ..loss import loss
def half_and_half(a,b):
a = torch.stack([torch.triu(x) for x in a], 0)
b = torch.stack([torch.tril(x, diagonal=-1) for x in b], 0)
return a + b
def validation(model, data_loader):
t_valid = time... | bsd-3-clause | -3,322,496,645,558,040,600 | 23.762712 | 94 | 0.578371 | false | 3.069328 | false | false | false |
byteface/sing | core/PyPal.py | 1 | 16532 | """
PyPal.py
@author: byteface
"""
class PyPal(object):
"""
PyPal is the heart for all pypals :)
"""
# TODO - tell command to pass messages to other pypals. non conflicting. saves having to quit out of current one
# TODO - list commands
# TODO - learn from. quick command to copy commands between ... | gpl-2.0 | 2,327,574,827,839,849,000 | 27.259829 | 163 | 0.67578 | false | 3.362897 | false | false | false |
gfyoung/numpy | numpy/lib/twodim_base.py | 2 | 27180 | """ Basic functions for manipulating 2d arrays
"""
from __future__ import division, absolute_import, print_function
import functools
from numpy.core.numeric import (
absolute, asanyarray, arange, zeros, greater_equal, multiply, ones,
asarray, where, int8, int16, int32, int64, empty, promote_types, diagonal,
... | bsd-3-clause | -2,810,006,162,861,620,700 | 26.289157 | 79 | 0.551214 | false | 3.448363 | false | false | false |
greyshell/Pen-Test | leetcode/factorial.py | 1 | 1129 | #!/usr/bin/python
# author: greyshell
"""
[+] problem description
=======================
find the factorial of a number
1) recursive two_sum
2) tail recursive two_sum
[+] reference
=============
TBD
"""
def tail_recursion_driver(n):
"""
tail recursive two_sum
:param n: int
:return: int
"""
... | mit | 5,056,837,605,008,551,000 | 18.135593 | 111 | 0.581045 | false | 3.528125 | false | false | false |
timothyclemansinsea/smc | src/k8s/smc-hub/control.py | 1 | 9152 | #!/usr/bin/env python3
"""
Hub management script
"""
import os, shutil, sys, tempfile
join = os.path.join
# Boilerplate to ensure we are in the directory fo this path and make the util module available.
SCRIPT_PATH = os.path.split(os.path.realpath(__file__))[0]
sys.path.insert(0, os.path.abspath(os.path.join(SCRIPT_... | gpl-3.0 | -8,445,299,926,647,956,000 | 46.419689 | 275 | 0.633086 | false | 3.521354 | false | false | false |
Yuecai/com-yuecai-dream | src/nodelay/forms.py | 1 | 9690 | # coding=utf-8
#########################################################################
# File Name: forms.py
# Original Author: 段凯强
# Mail: duankq@ios.ac.cn
# Created Time: 2013-12-26
# Update:
#########################################################################
################################################... | bsd-3-clause | 8,940,460,477,779,460,000 | 33.025362 | 105 | 0.577787 | false | 3.504104 | false | false | false |
quantopian/zipline | zipline/data/in_memory_daily_bars.py | 1 | 5363 | from six import iteritems
import numpy as np
import pandas as pd
from pandas import NaT
from trading_calendars import TradingCalendar
from zipline.data.bar_reader import OHLCV, NoDataOnDate, NoDataForSid
from zipline.data.session_bars import CurrencyAwareSessionBarReader
from zipline.utils.input_validation import ex... | apache-2.0 | -1,749,134,559,772,530,400 | 30.547059 | 78 | 0.611039 | false | 4.222835 | false | false | false |
suizokukan/dchars-fe | kshortcuts.py | 1 | 2929 | #!./python_link
# -*- coding: utf-8 -*-
################################################################################
# DChars-FE Copyright (C) 2008 Xavier Faure
# Contact: faure dot epistulam dot mihi dot scripsisti at orange dot fr
#
# This file is part of DChars-FE.
# DChars-FE is free software: you c... | gpl-3.0 | -7,099,916,806,350,500,000 | 38.527027 | 82 | 0.454701 | false | 4.695024 | false | false | false |
akniffe1/fsf | fsf-server/daemon.py | 1 | 3798 | #!/usr/bin/env python
#
# All credit for this class goes to Sander Marechal, 2009-05-31
# Reference: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/
#
#
import sys, os, time, atexit
from signal import SIGTERM
class Daemon:
"""
A generic daemon class.
Usage: subclass the Daemon... | apache-2.0 | 6,438,743,217,424,489,000 | 27.343284 | 110 | 0.511848 | false | 3.931677 | false | false | false |
immanetize/nikola | nikola/filters.py | 1 | 7187 | # -*- coding: utf-8 -*-
# Copyright © 2012-2015 Roberto Alsina and others.
# 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 t... | mit | -9,010,117,883,076,772,000 | 31.369369 | 198 | 0.660868 | false | 3.594797 | false | false | false |
Arzaroth/python_rapidxml | tests/test_basic.py | 1 | 5638 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# File: simple.py
# by Arzaroth Lekva
# arzaroth@arzaroth.com
#
import os
import rapidxml
def test_unparse(init_rapidxml):
assert init_rapidxml.unparse() == ('<root><test attr1="one" attr2="two" attr3="three"/>'
'<test2><node i... | mit | 6,300,679,868,644,704,000 | 44.104 | 108 | 0.595956 | false | 3.130483 | true | false | false |
OpenNetworkingFoundation/PIF-Open-Intermediate-Representation | pif_ir/bir/tests/test_common.py | 1 | 1166 | # single BIRStruct description
yaml_eth_struct_dict = {
'type' : 'struct',
'fields' : [
{'dst' : 48},
{'src' : 48},
{'type_' : 16}
]
}
yaml_udp_struct_dict = {
'type' : 'struct',
'fields' : [
{'sport' : 16},
{'dport' : 16},
{'len' : 16},
{'c... | apache-2.0 | -2,003,529,813,339,534,800 | 17.21875 | 37 | 0.465695 | false | 2.823245 | false | true | false |
specter119/custodian | custodian/feff/handlers.py | 1 | 4398 | # coding: utf-8
from __future__ import unicode_literals, division
from custodian.custodian import ErrorHandler
import re
from custodian.utils import backup
from pymatgen.io.feff.sets import FEFFDictSet
from custodian.feff.interpreter import FeffModder
import logging
""" This module implements specific error handler f... | mit | -3,734,159,296,317,997,000 | 35.65 | 99 | 0.555707 | false | 3.775107 | false | false | false |
ActiveState/code | recipes/Python/271607_fiber_scheduler/recipe-271607.py | 1 | 5269 | import sys, select, time, socket, traceback
class SEND:
def __init__( self, sock, timeout ):
self.fileno = sock.fileno()
self.expire = time.time() + timeout
def __str__( self ):
return 'SEND(%i,%s)' % ( self.fileno, time.strftime( '%H:%M:%S', time.localtime( self.expire ) ) )
class RECV:
def ... | mit | -389,809,782,214,965,100 | 23.281106 | 132 | 0.571076 | false | 3.621306 | false | false | false |
DeanThompson/pyelong | pyelong/request.py | 1 | 6017 | # -*- coding: utf-8 -*-
import hashlib
import json
import time
import urllib
import requests
from requests import RequestException, ConnectionError, Timeout
from tornado import gen
from tornado.httpclient import AsyncHTTPClient
from .api import ApiSpec
from .exceptions import ElongException, ElongAPIError, \
Ret... | mit | -2,665,918,147,271,490,000 | 35.466667 | 78 | 0.553266 | false | 4.172677 | true | false | false |
lordmos/blink | Source/bindings/scripts/unstable/idl_compiler.py | 1 | 5668 | #!/usr/bin/python
# Copyright (C) 2013 Google 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 c... | mit | 4,028,016,241,521,882,600 | 42.937984 | 163 | 0.728652 | false | 3.971969 | false | false | false |
zhlinh/leetcode | 0173.Binary Search Tree Iterator/test.py | 1 | 1230 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from solution import TreeNode
from solution import BSTIterator
def constructOne(s):
s = s.strip()
if s == '#':
return None
else:
return TreeNode(int(s))
def createTree(tree):
q = []
tree = tree.split(",")
root = constructOne(tree[0... | apache-2.0 | -6,259,950,088,596,226,000 | 20.206897 | 43 | 0.523577 | false | 3.245383 | false | false | false |
spl0k/supysonic | tests/base/test_cache.py | 1 | 8007 | # This file is part of Supysonic.
# Supysonic is a Python implementation of the Subsonic server API.
#
# Copyright (C) 2018 Alban 'spl0k' Féron
# 2018-2019 Carey 'pR0Ps' Metcalfe
#
# Distributed under terms of the GNU AGPLv3 license.
import os
import unittest
import shutil
import time
import tempfile
fr... | agpl-3.0 | 539,294,049,317,192,400 | 28.112727 | 67 | 0.569323 | false | 3.558222 | true | false | false |
cpn18/track-chart | desktop/gps_smoothing.py | 1 | 1313 | import sys
import json
import math
THRESHOLD = 10
data = []
with open(sys.argv[1], "r") as f:
used = count = 0
for line in f:
if line[0] == "#":
continue
items = line.split()
if items[1] == "TPV":
obj = json.loads(" ".join(items[2:-1]))
obj['used'] =... | gpl-3.0 | -8,348,637,999,380,964,000 | 29.534884 | 150 | 0.476009 | false | 3.241975 | false | false | false |
kgori/treeCl | treeCl/parutils.py | 1 | 9550 | from abc import ABCMeta, abstractmethod
from .constants import PARALLEL_PROFILE
from .utils import setup_progressbar, grouper, flatten_list
import logging
import multiprocessing
import sys
logger = logging.getLogger(__name__)
__author__ = 'kgori'
"""
Introduced this workaround for a bug in multiprocessing where
error... | mit | 559,474,478,483,958,140 | 32.745583 | 118 | 0.638325 | false | 3.926809 | false | false | false |
anbangr/trusted-juju | juju/unit/tests/test_charm.py | 1 | 5922 | from functools import partial
import os
import shutil
from twisted.internet.defer import inlineCallbacks, returnValue, succeed, fail
from twisted.web.error import Error
from twisted.web.client import downloadPage
from juju.charm import get_charm_from_path
from juju.charm.bundle import CharmBundle
from juju.charm.publ... | agpl-3.0 | -8,211,216,513,305,947,000 | 34.461078 | 78 | 0.651807 | false | 3.733922 | true | false | false |
bcantoni/ccm | ccmlib/dse_node.py | 1 | 22234 | # ccm node
from __future__ import absolute_import, with_statement
import os
import re
import shutil
import signal
import stat
import subprocess
import time
import yaml
from six import iteritems, print_
from ccmlib import common, extension, repository
from ccmlib.node import (Node, NodeError, ToolError,
... | apache-2.0 | -8,702,722,111,606,709,000 | 46.105932 | 232 | 0.580777 | false | 3.44073 | true | false | false |
Microvellum/Fluid-Designer | win64-vc/2.78/Python/bin/2.78/scripts/addons_contrib/mesh_extra_tools/pkhg_faces.py | 1 | 32230 | bl_info = {
"name": "PKHG faces",
"author": " PKHG ",
"version": (0, 0, 5),
"blender": (2, 7, 1),
"location": "View3D > Tools > PKHG (tab)",
"description": "Faces selected will become added faces of different style",
"warning": "not yet finished",
"wiki_url": "",
"category": "Mesh",
... | gpl-3.0 | -9,101,845,059,198,115,000 | 42.85034 | 278 | 0.57403 | false | 3.667501 | false | false | false |
laissezfarrell/rl-bitcurator-scripts | python/accession-reporter.py | 1 | 3754 | #!/usr/bin/env python3
#Script (in progress) to report high-level folder information for offices transferring records to the University Archives.
#Dependencies: argparse, pathlib, python3.6 or above, csv, datetime
#Assumptions:
# 1.
import argparse, csv, datetime
from pathlib import Path, PurePath
from datetime imp... | gpl-3.0 | -5,533,678,024,818,261,000 | 43.690476 | 368 | 0.660629 | false | 3.894191 | false | false | false |
alirizakeles/zato | code/zato-server/src/zato/server/service/internal/security/openstack.py | 1 | 6547 | # -*- coding: utf-8 -*-
"""
Copyright (C) 2013 Dariusz Suchojad <dsuch at zato.io>
Licensed under LGPLv3, see LICENSE.txt for terms and conditions.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
# stdlib
from contextlib import closing
from traceback import format_exc
from uui... | gpl-3.0 | -7,917,064,679,736,714,000 | 36.626437 | 116 | 0.607148 | false | 4.312912 | false | false | false |
10239847509238470925387z/tmp123 | app.py | 1 | 2195 | #!/usr/bin/env python
import urllib
import json
import os
import constants
import accounts
from flask import Flask
from flask import request
from flask import make_response
# Flask app should start in global layout
app = Flask(__name__)
PERSON = constants.TEST_1
@app.route('/webhook', methods=['POST'])
def webhook... | apache-2.0 | -4,790,441,292,185,734,000 | 26.098765 | 144 | 0.625513 | false | 3.540323 | false | false | false |
Lind-Project/native_client | src/trusted/validator_arm/validation-report.py | 1 | 3575 | #!/usr/bin/python2
#
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
import sys
import textwrap
from subprocess import Popen, PIPE
_OBJDUMP = 'arm-linux-gnueabi-objdump'
def _objdump(binary, ... | bsd-3-clause | 2,495,468,691,190,867,000 | 36.631579 | 80 | 0.59021 | false | 3.685567 | false | false | false |
core-code/LibVT | Dependencies/Core3D/Preprocessing/generateOctreeFromObj.py | 1 | 10849 | #!/usr/bin/env python
#
# generateOctreeFromObj.py
# Core3D
#
# Created by Julian Mayer on 16.11.07.
# Copyright (c) 2010 A. Julian Mayer
#
# 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 wit... | mit | 7,716,171,793,022,086,000 | 49.696262 | 462 | 0.660337 | false | 2.678765 | false | false | false |
Effective-Quadratures/Effective-Quadratures | equadratures/scalers.py | 1 | 7167 | """
Classes to scale data.
Some of these classes are called internally by other modules, but they can also be used independently as a pre-processing stage.
Scalers can fit to one set of data, and used to transform other data sets with the same number of dimensions.
Examples
--------
Fitting scaler implicitly during... | lgpl-2.1 | 3,159,541,299,082,102,300 | 31.425339 | 128 | 0.571588 | false | 3.773565 | true | false | false |
cloudconductor/cloud_conductor_gui | gui_app/views/applicationDeployViews.py | 1 | 8093 | # -*- coding: utf-8 -*-
from django.shortcuts import render, redirect, render_to_response
import ast
from ..forms import selecttForm
from ..forms import applicationForm
from ..utils import ApplicationUtil
from ..utils import ApplicationHistoryUtil
from ..utils import EnvironmentUtil
from ..utils import StringUtil
from ... | apache-2.0 | 7,722,206,676,188,103,000 | 34.034632 | 78 | 0.561596 | false | 4.503617 | false | false | false |
dan-cristian/haiot | gpio/io_common/__init__.py | 1 | 3453 | from common import Constant
from storage.model import m
from main.logger_helper import L
import abc
from common import utils
# update in db (without propagatting the change by default)
def update_custom_relay(pin_code, pin_value, notify=False, ignore_missing=False):
relay = m.ZoneCustomRelay.find_one({m.ZoneCust... | gpl-2.0 | 1,524,281,052,770,179,800 | 25.775194 | 99 | 0.609036 | false | 3.638567 | false | false | false |
pimoroni/unicorn-hat-hd | examples/show-png.py | 1 | 1382 | #!/usr/bin/env python
import time
from sys import exit
try:
from PIL import Image
except ImportError:
exit('This script requires the pillow module\nInstall with: sudo pip install pillow')
import unicornhathd
print("""Unicorn HAT HD: Show a PNG image!
This basic example shows use of the Python Pillow libra... | mit | -8,984,369,968,961,083,000 | 24.592593 | 89 | 0.583213 | false | 3.30622 | false | false | false |
stuartlangridge/raspi-recorder | listener_daemon.py | 1 | 2508 | import threading, time, subprocess
from bluetooth import *
server_sock=BluetoothSocket( RFCOMM )
server_sock.bind(("",PORT_ANY))
server_sock.listen(1)
port = server_sock.getsockname()[1]
uuid = "c3091f5f-7e2f-4908-b628-18231dfb5034"
advertise_service( server_sock, "PiRecorder",
service_id = uuid,
... | mit | 294,923,898,243,346,560 | 33.356164 | 88 | 0.570175 | false | 3.582857 | false | false | false |
Azure/azure-sdk-for-python | sdk/communication/azure-communication-sms/azure/communication/sms/_models/_models.py | 1 | 2064 | # 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 | 8,139,079,774,969,169,000 | 37.943396 | 94 | 0.593508 | false | 4.212245 | false | false | false |
twoolie/ProjectNarwhal | narwhal/core/profile/admin.py | 1 | 1124 | # -*- coding: utf-8 -*-
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from sorl.thumbnail.admin import AdminImageMixin
from treebeard.admin import TreeAdmin
from models import Profile
class ProfileAdmin(AdminImageMixin, admin.ModelAdmin):
search_fields = ('user__userna... | gpl-3.0 | 3,874,579,077,347,851,300 | 31.114286 | 65 | 0.508007 | false | 3.849315 | false | false | false |
cappatar/knesset-data-pipelines | datapackage_pipelines_knesset/members/processors/load_members.py | 1 | 1419 | from datapackage_pipelines_knesset.common.base_processors.add_resource import AddResourceBaseProcessor
# only loads members with the following positionId:
SUPPORTED_POSITION_IDS = [43, 61]
class Processor(AddResourceBaseProcessor):
def _get_schema(self, resource_descriptor):
return resource_descriptor.ge... | mit | -2,604,610,188,792,806,400 | 40.735294 | 102 | 0.613813 | false | 3.898352 | false | false | false |
valentinmetraux/hierophis | hierophis/maths/statistics/basic.py | 1 | 2080 | #!/usr/bin/env python
# -*- coding: utf 8 -*-
"""
Utility functions.
:copyright: 2015 Agile Geoscience
:license: Apache 2.0
"""
import numpy as np
import scipy.signal
def rms(a):
"""
Calculates the RMS of an array.
:param a: An array.
:returns: The RMS of the array.
"""
return np.sqrt(np.s... | apache-2.0 | -7,067,858,668,146,052,000 | 23.77381 | 68 | 0.533173 | false | 3.338684 | false | false | false |
all-of-us/raw-data-repository | tests/api_tests/test_ppi_data_check_api.py | 1 | 2788 | from rdr_service.model.code import CodeType
from tests.helpers.unittest_base import BaseTestCase
class CheckPpiDataApiTest(BaseTestCase):
def setUp(self):
super(CheckPpiDataApiTest, self).setUp(with_consent_codes=True)
self.participant_summary = self.data_generator.create_database_participant_sum... | bsd-3-clause | -8,436,569,744,233,131,000 | 45.466667 | 116 | 0.638451 | false | 4.173653 | true | false | false |
wooga/airflow | airflow/example_dags/example_nested_branch_dag.py | 1 | 2019 | #
# 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... | apache-2.0 | -1,070,214,598,085,398,900 | 47.071429 | 104 | 0.740961 | false | 3.631295 | false | false | false |
mojolab/LivingData | lib/livdatops.py | 1 | 1153 | import pandas
def getColRenameDict(mergersheet,sheet):
colrenamedict={}
originalcolnames=mergersheet[sheet].fillna("NA")
newcolnames=mergersheet[mergersheet.columns[0]]
for i in range(0,len(originalcolnames)):
colrenamedict[originalcolnames[i]]=newcolnames[i]
# if originalcolnames[i]!="NA":
# colrenamedict[... | apache-2.0 | -1,906,478,291,639,418,000 | 30.162162 | 55 | 0.774501 | false | 2.987047 | false | false | false |
CSC-IT-Center-for-Science/pouta-blueprints | pebbles/views/authorize_instances.py | 1 | 3153 | from flask import abort, request, Response, Blueprint
import datetime
import logging
import re
from pebbles.models import InstanceToken
from pebbles.server import restful
authorize_instances = Blueprint('authorize_instances', __name__)
class AuthorizeInstancesView(restful.Resource):
def get(self):
toke... | mit | 2,302,791,649,978,159,000 | 49.047619 | 161 | 0.64732 | false | 4.121569 | false | false | false |
weiqiangdragonite/blog_tmp | python/baidu/myip.py | 1 | 1085 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# http://ip.taobao.com/instructions.php
import socket
#
common_headers = \
"Host: ip.taobao.com\r\n" + \
"Connection: Keep-Alive\r\n" + \
"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n" + \
"User-Agent: Mozilla/5.0 (X11; Lin... | gpl-2.0 | -721,930,583,678,637,200 | 21.93617 | 133 | 0.563603 | false | 2.51049 | false | false | false |
dhanababum/accessdb | accessdb/utils.py | 1 | 8395 | # -*- coding: utf-8 -*-
# Copyright 2017 Dhana Babu
#
# 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,640,736,085,775,844,000 | 31.921569 | 79 | 0.534485 | false | 3.901022 | false | false | false |
jimsize/PySolFC | pysollib/games/harp.py | 1 | 13061 | #!/usr/bin/env python
# -*- mode: python; coding: utf-8; -*-
# ---------------------------------------------------------------------------##
#
# Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer
# Copyright (C) 2003 Mt. Hood Playing Card Co.
# Copyright (C) 2005-2009 Skomoroh
#
# This program is free softwa... | gpl-3.0 | 6,819,752,331,048,072,000 | 34.3 | 79 | 0.537861 | false | 3.414641 | false | false | false |
etherkit/OpenBeacon2 | client/linux-arm/venv/lib/python3.6/site-packages/PyInstaller/hooks/hook-gi.repository.GdkPixbuf.py | 1 | 6760 | #-----------------------------------------------------------------------------
# Copyright (c) 2005-2020, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is in the file COPYING.txt... | gpl-3.0 | -3,919,858,749,350,087,700 | 39.969697 | 79 | 0.569822 | false | 4.222361 | false | false | false |
all-of-us/raw-data-repository | rdr_service/alembic/versions/72365b7c0037_add_gender_identity_enums.py | 1 | 1232 | """add gender identity enums
Revision ID: 72365b7c0037
Revises: 9c957ce496bf
Create Date: 2019-06-05 08:56:34.278852
"""
import model.utils
import sqlalchemy as sa
from alembic import op
from rdr_service.participant_enums import GenderIdentity
# revision identifiers, used by Alembic.
revision = "72365b7c0037"
down_... | bsd-3-clause | 7,862,067,207,526,346,000 | 23.64 | 119 | 0.685065 | false | 3.602339 | false | false | false |
joshfriend/memegen | tests/test_routes_templates.py | 1 | 2217 | # pylint: disable=unused-variable
# pylint: disable=misplaced-comparison-constant
from .conftest import load
def describe_get():
def when_default_text(client):
response = client.get("/templates/iw")
assert 200 == response.status_code
assert dict(
name="Insanity Wolf",
... | mit | -5,729,464,290,669,171,000 | 31.602941 | 99 | 0.626071 | false | 3.770408 | false | false | false |
JIC-CSB/dtoolcore | docs/source/conf.py | 1 | 5148 | # -*- coding: utf-8 -*-
#
# 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 configuration values have a default; values that are commented out
# serve to show the default.
# If extensi... | mit | 835,693,816,536,538,400 | 30.012048 | 79 | 0.673271 | false | 3.833209 | false | false | false |
praekelt/vumi-go | go/billing/migrations/0009_auto__chg_field_messagecost_tag_pool__add_index_messagecost_message_di.py | 1 | 10898 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'MessageCost.tag_pool'
db.alter_column(u'billing_messagecost', 'tag_pool_id', self.gf('dja... | bsd-3-clause | -5,296,161,936,349,393,000 | 75.216783 | 188 | 0.569279 | false | 3.626622 | false | false | false |
cajone/pychess | lib/pychess/System/TaskQueue.py | 1 | 2187 | # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/475160
# Was accepted into Python 2.5, but earlier versions still have
# to do stuff manually
import threading
from pychess.compat import Queue
def TaskQueue():
if hasattr(Queue, "task_done"):
return Queue()
return _TaskQueue()
class _TaskQu... | gpl-3.0 | 3,400,890,274,600,280,000 | 33.171875 | 79 | 0.622771 | false | 4.263158 | false | false | false |
deter-project/magi | magi/messaging/transportTCP.py | 1 | 2821 |
import socket
import logging
import time
from asyncore import dispatcher
from transport import Transport
import transportStream
from magimessage import DefaultCodec
log = logging.getLogger(__name__)
class TCPServer(Transport):
""" Simple TCP Server that returns new TCP clients as 'messages' """
def __init__(self,... | gpl-2.0 | -4,412,502,271,619,851,000 | 25.613208 | 95 | 0.698688 | false | 3.26883 | false | false | false |
drtuxwang/system-config | bin/battery.py | 1 | 3916 | #!/usr/bin/env python3
"""
Monitor laptop battery
"""
import argparse
import signal
import sys
from typing import List
import power_mod
class Options:
"""
Options class
"""
def __init__(self) -> None:
self._args: argparse.Namespace = None
self.parse(sys.argv)
def get_summary_fl... | gpl-2.0 | -5,714,600,251,821,818,000 | 26.384615 | 79 | 0.470123 | false | 3.904287 | false | false | false |
karllessard/tensorflow | tensorflow/python/keras/layers/preprocessing/text_vectorization.py | 1 | 29394 | # Copyright 2019 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 | 7,755,867,636,308,005,000 | 44.082822 | 101 | 0.666667 | false | 3.958255 | true | false | false |
entropyx/callme | callme/proxy.py | 1 | 9608 | # Copyright (c) 2009-2014, Christian Haintz
# 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 ... | bsd-3-clause | 4,423,005,917,173,876,700 | 38.216327 | 128 | 0.600125 | false | 4.508681 | false | false | false |
etamponi/resilient-protocol | resilient/ensemble.py | 1 | 6786 | import hashlib
import numpy
from sklearn.base import BaseEstimator, ClassifierMixin, clone
from sklearn.tree.tree import DecisionTreeClassifier
from sklearn.utils.fixes import unique
from sklearn import preprocessing
from sklearn.utils.random import check_random_state
from resilient.logger import Logger
from resilien... | gpl-2.0 | 4,599,996,119,543,902,700 | 37.338983 | 77 | 0.600796 | false | 4.110236 | false | false | false |
andrewschaaf/pj-closure | js/goog/array.py | 1 | 3829 | #<pre>Copyright 2006 The Closure Library 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 ... | apache-2.0 | -2,837,759,687,464,881,000 | 25.226027 | 76 | 0.628362 | false | 3.255952 | false | false | false |
ilastik/ilastik-0.5 | ilastik/modules/unsupervised_decomposition/core/unsupervisedMgr.py | 1 | 7290 | from ilastik.core.baseModuleMgr import BaseModuleDataItemMgr, BaseModuleMgr
import numpy
import traceback, sys
from ilastik.core import jobMachine
from PyQt4 import QtCore
import os
import algorithms
from ilastik.core.volume import DataAccessor
from ilastik.core.overlayMgr import OverlayItem
""" Import all algorithm ... | bsd-2-clause | -7,100,022,085,646,028,000 | 48.598639 | 213 | 0.610288 | false | 4.074902 | false | false | false |
Jason-Gew/Python_modules | authenticate.py | 1 | 2754 | #!/usr/bin/env python
#
# authenticate.py module is create by Jason/Ge Wu
# Purpose to fast set up and verify username & password
# for system or software access.
from getpass import getpass # Disable password display on console
import base64 # If necessary, use more advanced encryption such as AES, MD5
e... | gpl-3.0 | 333,663,628,608,991,300 | 28.94382 | 84 | 0.603849 | false | 3.263033 | false | false | false |
uclouvain/osis | base/migrations/0054_scoresencoding.py | 1 | 2269 | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-05-02 15:06
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('base', '0053_auto_20160529_2355'),
]
operations = [
migrations.RunSQL(
"""... | agpl-3.0 | 3,287,373,462,270,548,000 | 39.517857 | 172 | 0.654473 | false | 3.839255 | false | false | false |
314r/joliebulle | joliebulle/view/base.py | 1 | 1815 | #joliebulle 3.6
#Copyright (C) 2010-2016 Pierre Tavares
#Copyright (C) 2012-2015 joliebulle's authors
#See AUTHORS file.
#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 Li... | gpl-3.0 | 553,826,155,992,883,500 | 32.018182 | 76 | 0.770799 | false | 3.264388 | false | false | false |
shawncaojob/LC | QUESTIONS/44_wildcard_matching.py | 1 | 1859 | # 44. Wildcard Matching My Submissions QuestionEditorial Solution
# Total Accepted: 59032 Total Submissions: 333961 Difficulty: Hard
# Implement wildcard pattern matching with support for '?' and '*'.
#
# '?' Matches any single character.
# '*' Matches any sequence of characters (including the empty sequence).
#
# Th... | gpl-3.0 | -199,543,660,837,520,030 | 30.508475 | 94 | 0.507262 | false | 3.150847 | false | false | false |
caioariede/pyq | sizzle/match.py | 1 | 3323 | from .selector import Selector
class MatchEngine(object):
pseudo_fns = {}
selector_class = Selector
def __init__(self):
self.register_pseudo('not', self.pseudo_not)
self.register_pseudo('has', self.pseudo_has)
def register_pseudo(self, name, fn):
self.pseudo_fns[name] = fn
... | mit | 5,607,412,709,546,960,000 | 30.951923 | 79 | 0.563948 | false | 4.227735 | false | false | false |
beyoungwoo/C_glibc_Sample | _Algorithm/ProjectEuler_python/euler_42.py | 1 | 2038 | #!/usr/bin/python -Wall
# -*- coding: utf-8 -*-
"""
<div id="content">
<div style="text-align:center;" class="print"><img src="images/print_page_logo.png" alt="projecteuler.net" style="border:none;" /></div>
<h2>Coded triangle numbers</h2><div id="problem_info" class="info"><h3>Problem 42</h3><span>Published on Friday,... | gpl-3.0 | -5,037,118,179,064,823,000 | 37.45283 | 309 | 0.626104 | false | 2.903134 | false | false | false |
Squishymedia/feedingdb | src/feeddb/feed/migrations/0058_muscleowl_emg_sono.py | 1 | 40048 | # -*- 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 'SonoSensor.muscle'
db.add_column(u'feed_sonosensor', 'mus... | gpl-3.0 | -4,522,338,344,012,879,000 | 81.40535 | 195 | 0.546519 | false | 3.521632 | false | false | false |
alphagov/notifications-api | migrations/versions/0321_drop_postage_constraints.py | 1 | 2423 | """
Revision ID: 0321_drop_postage_constraints
Revises: 0320_optimise_notifications
Create Date: 2020-06-08 11:48:53.315768
"""
import os
from alembic import op
revision = '0321_drop_postage_constraints'
down_revision = '0320_optimise_notifications'
environment = os.environ['NOTIFY_ENVIRONMENT']
def upgrade():
... | mit | 3,433,414,074,737,906,700 | 34.115942 | 118 | 0.574907 | false | 4.723197 | false | false | false |
jayc0b0/Projects | Python/Security/caesarCypher.py | 1 | 1545 | # Jacob Orner (jayc0b0)
# Caesar Cypher script
def main():
# Declare variables and take input
global alphabet
alphabet = ['a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l',
'm', 'n', 'o', 'p', 'q', 'r',
's', 't', 'u', 'v', 'w', 'x',
... | mit | 5,803,349,331,164,338,000 | 26.105263 | 81 | 0.552104 | false | 3.669834 | false | false | false |
chrispitzer/toucan-sam | toucansam/core/models.py | 1 | 5910 | import re
from urlparse import urlparse, parse_qs
from datetime import timedelta
from django.core.urlresolvers import reverse
from django.core.validators import MinValueValidator, MaxValueValidator
from django.db import models
from django.utils.safestring import mark_safe
from durationfield.db.models.fields.duration im... | gpl-2.0 | 8,150,954,551,318,501,000 | 34.39521 | 101 | 0.558545 | false | 3.998647 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.