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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
zak-k/iris | lib/iris/fileformats/pp.py | 1 | 89450 | # (C) British Crown Copyright 2010 - 2016, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | gpl-3.0 | 3,401,959,726,195,242,500 | 34.216535 | 79 | 0.55488 | false | 3.972378 | false | false | false |
kgaipal/workspace | test-code/json.py | 1 | 9566 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Requirements: python packages: websocket-client
# Installation: pip install websocket-client
# https://pypi.python.org/pypi/websocket-client/
class StateTableRecord:
def __init__(self, recordId):
self.recordId = recordId
self.fields = {} # map... | gpl-3.0 | -3,622,807,888,267,472,400 | 32.215278 | 78 | 0.523625 | false | 4.229001 | false | false | false |
MrYsLab/python_banyan | projects/OneGPIO/arduino_uno/arduino_gateway.py | 1 | 22028 | """
Copyright (c) 2018-2019 Alan Yorinks All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
Version 3 as published by the Free Software Foundation; either
or (at your option) any later version.
This library is dist... | agpl-3.0 | 5,566,145,373,664,180,000 | 39.913858 | 114 | 0.597171 | false | 3.904217 | false | false | false |
dwbro1/SS-Reporter | rpiGPIOActuator.py | 1 | 1544 | """
Purpose: Changes the state of the configured pin on command
"""
import sys
import time
import RPi.GPIO as GPIO
class rpiGPIOActuator:
"""Represents an actuator connected to a GPIO pin"""
def __init__(self, connection, logger, params):
"""Sets the output and changes its state when it receives a c... | apache-2.0 | -3,478,561,868,706,700,300 | 35.761905 | 157 | 0.620466 | false | 3.650118 | false | false | false |
chrismcginlay/crazy-koala | word_search.py | 1 | 2311 | # -*- coding: utf-8 -*-
"""
Created on Tue Jun 28 09:55:21 2016
@author: chrismcginlay
"""
grid = [
list("SYNTAXQWERT"),
list("GHFPOSTKDSK"),
list("LKJHCVNBVYR"),
list("CCCBIWUISKT"),
list("LKTSOPSHDER"),
list("XZPOSTSEIGU"),
]
for row in grid:
row.insert(0,"*")
row.append("*")
width ... | gpl-3.0 | -3,462,465,035,189,730,000 | 29.012987 | 74 | 0.566421 | false | 2.53956 | false | false | false |
ferdkuh/rlkart | src/main.py | 1 | 1996 | # create timestep counter N and network
# create environments and learner agents
# main loop:
# for t in range(0, max_episode_size):
# get a_t[], v_t[] from network for the state of each agent:
# convert a_t to a single action index
#
# parallel for i in range(0, num_agents)
# new_state, reward = perform a_t[... | gpl-3.0 | -3,481,168,514,002,871,000 | 25.972973 | 90 | 0.700401 | false | 2.979104 | false | false | false |
jriehl/numba | numba/targets/hashing.py | 1 | 23337 | """
Hash implementations for Numba types
"""
from __future__ import print_function, absolute_import, division
import math
import numpy as np
import sys
import ctypes
from collections import namedtuple
import llvmlite.binding as ll
import llvmlite.llvmpy.core as lc
from llvmlite import ir
from numba.extending import ... | bsd-2-clause | 3,617,599,016,980,870,000 | 34.305598 | 119 | 0.577624 | false | 3.269403 | false | false | false |
ShipleyCollege/ViPteam1 | ExtractAndAnalyzeCode/ExtractNodes.py | 1 | 2439 | import os
import glob
import BuildNode
#INPUT_FILENAME = "../Sample Blueprint code/SimpleMoveToActor-Network - Code.txt";
#INPUT_FILENAME = "../Sample Blueprint code/SpawnObjectsWithForLoop - Code.txt";
#INPUT_FILENAME = "../Sample Blueprint code/SpawnRoundTargetPoint - Code.txt";
#INPUT_FILENAME = "../Sample Bluepri... | gpl-3.0 | 5,190,332,986,550,599,000 | 28.385542 | 84 | 0.696597 | false | 3.175781 | false | false | false |
ucb-bar/bar-crawl-web | flower/utils/tasks.py | 1 | 2717 | from __future__ import absolute_import
import datetime
import time
from celery.events.state import Task
from .search import satisfies_search_terms
def iter_tasks(events, limit=None, type=None, worker=None, state=None,
sort_by=None, received_start=None, received_end=None,
started_start... | bsd-3-clause | 4,780,227,939,877,630,000 | 34.285714 | 127 | 0.591829 | false | 3.89255 | false | false | false |
megaprojectske/megaprojects.co.ke | megaprojects/articles/migrations/0002_auto__add_field_image_reviewed__add_field_article_reviewed.py | 1 | 7695 | # -*- 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):
# Adding field 'Image.reviewed'
db.add_column(u'articles_image', 'reviewed',
self.gf('... | apache-2.0 | 464,978,031,842,884,700 | 68.324324 | 187 | 0.548538 | false | 3.688878 | false | false | false |
adezfouli/savigp | GP/grad_checker.py | 1 | 2303 | __author__ = 'AT'
from DerApproximator import get_d1
from numpy import concatenate
from texttable import Texttable
class GradChecker:
""" A class for checking gradients. """
def __init__(self):
pass
@staticmethod
def check(f, f_grad, x0, name, verbose=False):
"""
Checks wheth... | apache-2.0 | -3,464,575,333,593,513,000 | 31 | 111 | 0.520625 | false | 3.910017 | false | false | false |
tensorflow/federated | tensorflow_federated/python/core/backends/mapreduce/forms.py | 1 | 16487 | # Copyright 2019, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 | 4,678,343,868,907,108,000 | 39.212195 | 80 | 0.691029 | false | 4.11969 | false | false | false |
azam-a/gocd2gmail2slack | gocd2gmail2slack/integrations.py | 1 | 1445 |
import gmail as Gm
import messages as Msg
import slack
from cfg.config import (
WEBHOOK_URL,
GOCD_DASHBOARD_URL,
)
def main():
try:
service, labels, messages_details = initialize()
process(service, labels, messages_details)
except:
pass
def initialize():
service = Gm.ge... | mit | 4,342,497,860,027,901,400 | 26.264151 | 74 | 0.559862 | false | 3.753247 | false | false | false |
MahjongRepository/tenhou-python-bot | project/game/ai/helpers/defence.py | 1 | 16886 | from typing import Optional
class TileDanger:
IMPOSSIBLE_WAIT = {
"value": 0,
"description": "Impossible wait",
}
SAFE_AGAINST_THREATENING_HAND = {
"value": 0,
"description": "Tile can't be used by analyzed threat",
}
# honor tiles
HONOR_THIRD = {
"valu... | mit | 5,193,180,897,741,196,000 | 29.261649 | 107 | 0.574973 | false | 3.204783 | false | false | false |
iamsteadman/bambu-urlshortener | bambu_urlshortener/migrations/0001_initial.py | 1 | 1644 | # -*- 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):
# Adding model 'ShortURL'
db.create_table('urlshortener_shorturl', (
(u'id', self.gf('django.db.... | apache-2.0 | -556,862,470,174,253,000 | 42.289474 | 109 | 0.600365 | false | 3.573913 | false | false | false |
YannThorimbert/ThorPy-1.4.3 | thorpy/elements/slidersetter.py | 1 | 4792 | from thorpy.elements.ghost import Ghost
from thorpy.elements.slider import _SliderXSetter
from thorpy.elements.element import Element
from thorpy.miscgui import functions, style, painterstyle
from thorpy.miscgui import storage
class SliderXSetter(Ghost):
"""Set of text, slider and value"""
def __init__(self,... | mit | -7,415,068,993,223,257,000 | 36.732283 | 88 | 0.603923 | false | 3.568131 | false | false | false |
AunShiLord/sympy | sympy/physics/tests/test_pring.py | 4 | 1072 | from sympy.physics.pring import wavefunction, energy
from sympy import pi, integrate, sqrt, exp, simplify, I
from sympy.abc import m, x, r
from sympy.physics.quantum.constants import hbar
def test_wavefunction():
Psi = {
0: (1/sqrt(2 * pi)),
1: (1/sqrt(2 * pi)) * exp(I * x),
2: (1/sqrt(2 *... | bsd-3-clause | -7,457,749,085,143,069,000 | 27.972973 | 77 | 0.528918 | false | 2.873995 | true | false | false |
olebole/astrometry.net | net/sdss_image.py | 1 | 4000 | from __future__ import print_function
import math
import os
import urllib
if __name__ == '__main__':
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'astrometry.net.settings'
from astrometry.net.log import *
from astrometry.net.tmpfile import *
from astrometry.net import settings
def plot_sdss_image(wcsfn, ... | bsd-3-clause | -633,198,197,810,560,600 | 32.333333 | 107 | 0.59475 | false | 3.051106 | false | false | false |
galaxor/Nodewatcher | nodewatcher/web/nodes/management/commands/preparedb.py | 1 | 6030 | import subprocess
import time
import optparse
import os.path
import traceback
from django.conf import settings
from django.core import management
from django.core import serializers
from django.core.management import base as management_base
from django.core.management import color as management_color
from django.db im... | agpl-3.0 | -1,226,115,389,493,172,000 | 34.680473 | 119 | 0.656053 | false | 4.276596 | false | false | false |
rmst/chi | examples/experimental/bdpg_chains2.py | 1 | 3857 | """ Bayesian Determinisitc Policy Gradient evaluated on th
didactic "chain" environment
"""
import tensorflow as tf
from gym import Wrapper
from tensorflow.python.layers.utils import smart_cond
from tensorflow.python.ops.variable_scope import get_local_variable
import chi
from chi import Experiment
from chi import ex... | mit | -7,825,289,444,006,958,000 | 30.104839 | 129 | 0.635468 | false | 3.068417 | false | false | false |
phrack/ShootOFF-legacy | training_protocols/shoot_dont_shoot/__init__.py | 1 | 6290 | # Copyright (c) 2015 phrack. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import random
import threading
from training_protocols.ITrainingProtocol import ITrainingProtocol
class ShootDontShoot(ITrainingProtocol):
def __init__(self, mai... | bsd-3-clause | 5,913,113,314,758,436,000 | 42.082192 | 122 | 0.619237 | false | 3.755224 | false | false | false |
yiannist/ganeti | lib/server/noded.py | 1 | 42846 | #
#
# Copyright (C) 2006, 2007, 2010, 2011, 2012, 2014 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:
#
# 1. Redistributions of source code must retain the above copyright notice,
... | bsd-2-clause | -8,683,240,034,905,567,000 | 28.346575 | 80 | 0.66697 | false | 4.023099 | false | false | false |
prefetchnta/questlab | bin/x64bin/python/37/Lib/xmlrpc/server.py | 1 | 37658 | r"""XML-RPC Servers.
This module can be used to create simple XML-RPC servers
by creating a server and either installing functions, a
class instance, or by extending the SimpleXMLRPCServer
class.
It can also be used to handle XML-RPC requests in a CGI
environment using CGIXMLRPCRequestHandler.
The Doc* cla... | lgpl-2.1 | -9,123,508,251,613,869,000 | 35.923464 | 92 | 0.571831 | false | 4.644549 | false | false | false |
ZoomerAnalytics/catalyst | catalyst/json_dbapi/__init__.py | 1 | 2214 | import json, datetime, os
from .sqlparser import parse
def Date(year, month, day):
raise NotImplementedError()
def Timestamp(hour, minute, second):
raise NotImplementedError()
def Timestamp(year, month, day, hour, minute, second):
raise NotImplementedError()
def DateFromTicks(ticks):
raise NotI... | mit | -2,250,958,578,212,698,600 | 17.771186 | 67 | 0.64318 | false | 4.257692 | false | false | false |
semitki/semitki | api/sonetworks/migrations/0006_auto_20170216_2125.py | 1 | 1630 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-16 21:25
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('sonetworks', '0005_auto_20170202_2319'),
]
operati... | mit | 490,810,210,341,913,500 | 30.960784 | 118 | 0.586503 | false | 4.289474 | false | false | false |
btaylor66/SREAchievements | sreachievementswebapp/models/person.py | 1 | 1194 | """Database model for a person
"""
import collections
import operator
import json
from sreachievementswebapp.dbmodels import db
from sqlalchemy.ext.hybrid import hybrid_property
m2m_person_achievement = db.Table(
'm2m_person_achievement',
db.Column('achievement_id', db.Integer, db.ForeignKey('achievement.i... | gpl-3.0 | -3,030,146,035,369,877,000 | 28.85 | 101 | 0.685092 | false | 3.316667 | false | false | false |
Ensembles/ert | python/python/ert/job_queue/job_status_type_enum.py | 1 | 2741 | # Copyright (C) 2013 Statoil ASA, Norway.
#
# The file 'job_status_type_enum.py' is part of ERT - Ensemble based Reservoir Tool.
#
# ERT 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 o... | gpl-3.0 | 5,301,143,350,003,913,000 | 52.745098 | 152 | 0.721634 | false | 3.33455 | false | false | false |
ollej/shoutbridge | src/plugins/GoldQuest.py | 1 | 17185 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
The MIT License
Copyright (c) 2011 Olle Johansson
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 ... | mit | -5,522,686,286,455,691,000 | 30.354015 | 142 | 0.545396 | false | 3.76468 | false | false | false |
merriam/techtree | bin/check_version.py | 1 | 7249 | #!/usr/bin/env python3
"""
A little program to check if there are later versions of packages I rely upon.
This may grow into a full fledged service, but not today.
"""
import subprocess
import re
import sys
class Program:
"""A known program that can be checked to see the installed version
number matches the... | mit | -293,875,068,873,349,600 | 36.559585 | 86 | 0.599117 | false | 4.130484 | false | false | false |
hanx11/psmonitor | bottle_example.py | 1 | 1289 | from bottle import Bottle
import pymongo
load = Bottle()
conn = pymongo.MongoReplicaSetClient(
'example01.com, example02.com',
replicaSet='rs1',
)
db = conn.reports
@load.get('/<server>')
def get_loaddata(server):
cpu_user = list()
cpu_nice = list()
cpu_system = list()
cpu_idle = list()
cp... | mit | -1,367,374,833,513,415,200 | 25.854167 | 56 | 0.547711 | false | 3.392105 | false | false | false |
ichika/yoineko | core.py | 1 | 3654 | #!/usr/bin/env python3
import sys
import socket
import json
import db
class NodeBase:
"""base class of node"""
def call(self, addr, msg, wait=True):
"""do request to other node and return result"""
request = bytes(json.dumps(msg), 'utf-8')
print('request', request)
self.socke... | mit | 278,101,519,890,364,600 | 27.325581 | 87 | 0.536946 | false | 3.687185 | false | false | false |
HaraldWeber/client | src/fa/path.py | 1 | 6571 | # -------------------------------------------------------------------------------
# Copyright (c) 2012 Gael Honorez.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the GNU Public License v3.0
# which accompanies this distribution, and is available at
# http://... | gpl-3.0 | 1,149,006,220,164,790,800 | 34.139037 | 143 | 0.656521 | false | 3.714528 | false | false | false |
russellb/nova | nova/vnc/xvp_proxy.py | 1 | 6374 | #!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 Openstack, LLC.
# 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
#
# ... | apache-2.0 | 2,121,944,898,252,933,000 | 33.085561 | 77 | 0.564167 | false | 4.330163 | false | false | false |
peragro/peragro-index | damn_index/cli.py | 1 | 3711 | from __future__ import absolute_import
from __future__ import print_function
import sys
import argparse
import json
import copy
from elasticsearch import Elasticsearch
from damn_at.utilities import unique_asset_id_reference_from_fields
'''
pt a ../peragro-test-files/mesh/blender/cube1.blend -f json-pretty\
| pt inde... | bsd-3-clause | -1,764,579,313,117,547,800 | 28.927419 | 89 | 0.586904 | false | 3.845596 | false | false | false |
Daniel-Brosnan-Blazquez/DIT-100 | lib/bitOps.py | 1 | 1763 | # -*- coding: utf-8 -*-
def CheckBit(value, position):
mask = 1 << position
return value & mask == mask
def SetBit(value, position):
return value | (1 << position)
def ClearBit(value, position):
return value & ~(1 << position)
def FlipBit(value, position):
return value ^ (1 << posit... | gpl-3.0 | -3,122,407,504,018,430,000 | 26.435484 | 84 | 0.617697 | false | 3.783262 | false | false | false |
ilmir-k/website-addons | website_sales_team/website_sales_team_models.py | 1 | 2489 | # -*- coding: utf-8 -*-
from openerp import SUPERUSER_ID
from openerp import fields
from openerp import models
class ProductTemplate(models.Model):
_inherit = 'product.template'
def _get_default_section_id(self):
return self.env.user.default_section_id
section_id = fields.Many2one('crm.case.sect... | lgpl-3.0 | 750,377,855,924,190,700 | 37.890625 | 219 | 0.672961 | false | 3.591631 | false | false | false |
R2pChyou/starcheat | starcheat/gui/ship.py | 1 | 2414 | """
Qt ship management dialog
"""
import logging
from gui.common import ListEdit
import qt_ship
from PyQt5.QtWidgets import QDialog
class Ship():
def __init__(self, main_window):
self.dialog = QDialog(main_window.window)
self.ui = qt_ship.Ui_Dialog()
self.ui.setupUi(self.dialog)
... | mit | -6,686,477,986,343,633,000 | 33.985507 | 83 | 0.637531 | false | 3.534407 | false | false | false |
genesi/cardapio | src/plugins/tracker_fts.py | 1 | 4314 | #
# Copyright (C) 2010 Cardapio Team (tvst@hotmail.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ... | gpl-3.0 | 8,854,574,007,254,268,000 | 27.012987 | 101 | 0.659017 | false | 3.214605 | false | false | false |
LaiTash/OEUO-python | profiles/default/scripts/journal_event.py | 1 | 1099 | from uo.serpent.script import ScriptBase
from uo import manager
import gevent
import re
class BindObj(object):
def __init__(self, regexp, callback):
self.regexp = re.compile(regexp)
self.callback = callback
class JournalScannerScript(ScriptBase):
script_name = "Journal scanner"
def load... | gpl-3.0 | 8,903,835,215,289,260,000 | 23.422222 | 58 | 0.5596 | false | 3.712838 | false | false | false |
madarivi/PianoSimulation | Parameters/parametersAd5.py | 1 | 1862 | import numpy as np
# in this file the parameters used in the simulation are set
# string parameters
f1 = 934.60 # fundamental string frequency
l = 0.200 # string length
d = 0.898e-3
rhoV = 7850.
A = np.pi * (d/2.)**2
m_s = A * l * rhoV # total string mass
print m_s
b1 = 1.1 ... | mit | 6,467,938,529,171,412,000 | 33.481481 | 75 | 0.542427 | false | 2.9792 | false | true | false |
AllYarnsAreBeautiful/knittingpattern | knittingpattern/__init__.py | 1 | 4042 | """The knitting pattern module.
Load and convert knitting patterns using the convenience functions listed
below.
"""
# there should be no imports
#: the version of the knitting pattern library
__version__ = '0.1.19'
#: an empty knitting pattern set as specification
EMPTY_KNITTING_PATTERN_SET = {"version": "0.1", "ty... | lgpl-3.0 | 2,694,559,779,322,161,700 | 29.164179 | 78 | 0.690252 | false | 3.454701 | false | false | false |
joshuahellier/PhDStuff | codes/kmc/batchJobs/rateCaculation/mainStuff/tempSteadyFlow.py | 1 | 13591 | import sys
import os
import math
import shutil as sh
resultDir = os.environ.get('RESULTS')
tempDir = os.environ.get('TMPDIR')
if resultDir == None or tempDir == None :
print ("WARNING! $RESULTS not set! Attempt to write results will fail!\n")
# Expecting input botConc, topConc, rateConstFull, sysSize, analInterv... | mit | -1,052,233,033,452,451,000 | 35.534946 | 202 | 0.610919 | false | 3.460031 | false | false | false |
wideioltd/mimejson | mimejson/mimetype/video_opencv.py | 1 | 3911 | # ############################################################################
# |W|I|D|E|I|O|L|T|D|W|I|D|E|I|O|L|T|D|W|I|D|E|I|O|L|T|D|W|I|D|E|I|O|L|T|D|
# Copyright (c) WIDE IO LTD
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that... | bsd-3-clause | 678,036,403,070,895,600 | 43.443182 | 78 | 0.601892 | false | 3.689623 | false | false | false |
sergiorb/askkit | askkit/settings.py | 1 | 12452 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Django settings for askkit project.
Generated by 'django-admin startproject' using Django 1.8.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproj... | apache-2.0 | 6,907,194,725,354,861,000 | 31.854881 | 141 | 0.509075 | false | 4.14652 | false | false | false |
SUSE-Cloud/glance | glance/tests/unit/v1/test_api.py | 1 | 119257 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# -*- coding: utf-8 -*-
# Copyright 2010-2011 OpenStack, LLC
# 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
#
# ... | apache-2.0 | -5,985,045,226,187,337,000 | 39.847893 | 79 | 0.570034 | false | 3.761119 | true | false | false |
Sid1057/obstacle_detector | sample_extra_plane_transformer.py | 1 | 1461 | #!/usr/bin/python3
import cv2
import numpy as np
from obstacle_detector.perspective import inv_persp_new
from obstacle_detector.distance_calculator import spline_dist
def video_test(input_video_path=None):
cx = 603
cy = 297
roi_width = 25
roi_length = 90
px_height_of_roi_length = 352
#int(
... | mit | 90,747,233,213,776,740 | 23.35 | 65 | 0.557153 | false | 3.397674 | false | false | false |
zzjkf2009/Midterm_Astar | opencv/platforms/ios/build_framework.py | 1 | 10978 | #!/usr/bin/env python
"""
The script builds OpenCV.framework for iOS.
The built framework is universal, it can be used to build app and run it on either iOS simulator or real device.
Usage:
./build_framework.py <outputdir>
By cmake conventions (and especially if you work with OpenCV repository),
the output dir sh... | mit | -2,232,820,552,741,659,100 | 37.250871 | 159 | 0.578338 | false | 3.771213 | false | false | false |
mrcodehang/cqut-chat-server | configs/__init__.py | 1 | 1131 |
configs = {}
configs['app_key'] = 'cbe36a100c9977c74c296a6777e920ec'
configs['enviroment'] = 'development'
configs['appid'] = '12353'
configs['content'] = '【CQUT-CHAT】您的验证码是:'
def save_config(key, value):
configs[key] = value
def get_config(key):
return configs.get(key)
username_invalid = { 'code': 1, 'ms... | mpl-2.0 | 8,151,344,901,222,302,000 | 31.551724 | 66 | 0.625663 | false | 2.104911 | true | false | false |
DigiThinkIT/stem | test/integ/process.py | 1 | 4793 | """
Tests the stem.process functions with various use cases.
"""
import shutil
import subprocess
import tempfile
import time
import unittest
import stem.prereq
import stem.process
import stem.socket
import stem.util.system
import stem.version
import test.runner
try:
# added in python 3.3
from unittest.mock impor... | lgpl-3.0 | -1,561,313,229,695,803,600 | 27.700599 | 115 | 0.662007 | false | 3.724165 | true | false | false |
josdaza/deep-toolbox | TensorFlow/seq2seq/Main_simple.py | 1 | 4953 | import numpy as np
import tensorflow as tf
import helpers
tf.reset_default_graph()
PAD = 0
EOS = 1
VOCAB_SIZE = 10
EMBEDDINGS_SIZE = 20
ENC_HIDDEN_UNITS = 20
DEC_HIDDEN_UNITS = 20
# Fake Function to Emulate a series of encoder and decoder sequences
# Given encoder_inputs [5, 6, 7], decoder_targets would be [5, 6, 7... | mit | -3,960,815,499,132,609,000 | 38.943548 | 109 | 0.608924 | false | 3.578757 | false | false | false |
jaklinger/nesta_dataflow | collect_data/utils/uae/business_directory/dcc.py | 1 | 3272 | '''
dcc
----
'''
from bs4 import BeautifulSoup
import logging
import requests
import time
# Local imports
from utils.common.browser import SelfClosingBrowser
from utils.common.datapipeline import DataPipeline
def get_field_from_box(field, box):
''''''
for row in box.find("ul"):
# Accept rows co... | mit | 3,339,632,406,249,094,700 | 31.386139 | 79 | 0.558239 | false | 4.053284 | false | false | false |
ge0rgi/cinder | cinder/volume/drivers/netapp/dataontap/fc_cmode.py | 1 | 5379 | # Copyright (c) - 2014, Clinton Knight. All rights reserved.
# Copyright (c) - 2016 Mike Rooney. 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
#
# htt... | apache-2.0 | -4,857,598,255,072,615,000 | 38.844444 | 78 | 0.671314 | false | 4.005212 | false | false | false |
StackStorm/mistral | mistral/tests/unit/engine/test_task_publish.py | 1 | 2807 | # Copyright 2015 - StackStorm, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | apache-2.0 | -4,910,604,444,682,694,000 | 28.861702 | 79 | 0.625223 | false | 3.589514 | false | false | false |
mlwithtf/mlwithtf | chapter_10/models.py | 1 | 1545 | import tensorflow as tf
def compute_loss(logits, labels):
labels = tf.squeeze(tf.cast(labels, tf.int32))
cross_entropy = tf.nn.sparse_softmax_cross_entropy_with_logits(logits=logits, labels=labels)
cross_entropy_loss= tf.reduce_mean(cross_entropy)
reg_loss = tf.reduce_mean(tf.get_collection(tf.GraphK... | apache-2.0 | -2,445,733,855,455,899,000 | 32.586957 | 115 | 0.68932 | false | 3.322581 | false | false | false |
devilry/devilry-django | devilry/devilry_admin/cradminextensions/listfilter/listfilter_relateduser.py | 1 | 3399 | from django.conf import settings
from django.db import models
from django.db.models.functions import Lower, Concat
from django.utils.translation import gettext_lazy, pgettext_lazy
from cradmin_legacy.viewhelpers import listfilter
from cradmin_legacy.viewhelpers.listfilter.basefilters.single import abstractselect
from ... | bsd-3-clause | -3,571,475,830,365,769,700 | 35.159574 | 99 | 0.597823 | false | 4.206683 | false | false | false |
tonyqiu1019/BulletAPI | models/api/models.py | 1 | 1264 | from django.db import models
# the bullet object
class Bullet(models.Model):
# required fields
content = models.CharField(max_length=512)
ret_time = models.DateTimeField(blank=True, null=True)
post_time = models.DateTimeField(blank=True, null=True)
# optional fields
info = models.ForeignKey('I... | mit | 3,125,209,969,669,040,000 | 35.114286 | 81 | 0.662184 | false | 3.611429 | false | false | false |
siko/xyz-get | src/ext/ipnli.py | 1 | 2052 | #!/usr/bin/env python
# -- coding:utf-8 --
import os, re, sys, time, datetime
import urllib,urllib2,threading,requests
from bs4 import BeautifulSoup
downurls = []
threads=[]
f=open('log.txt', 'w+')
class downloader(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.info=[... | mit | -2,164,372,479,213,248,500 | 25.808219 | 91 | 0.542434 | false | 2.950226 | false | false | false |
z23han/Wrangling-MongoDB | Lesson_5_Analyzing_Data/14-Using_push/push.py | 1 | 2297 | #!/usr/bin/env python
"""
$push is similar to $addToSet. The difference is that rather than accumulating only unique values
it aggregates all values into an array.
Using an aggregation query, count the number of tweets for each user. In the same $group stage,
use $push to accumulate all the tweet texts for each user... | agpl-3.0 | -3,282,531,151,248,877,000 | 38.603448 | 101 | 0.684806 | false | 4.079929 | false | false | false |
aaiijmrtt/WORDVECTORS | shiftreducer.py | 1 | 4286 | import neuralnet, numpy
SHIFT = -1
REDUCELEFT = 0
REDUCERIGHT = 1
def transition(stack, queue, arcs, dependencies):
if len(stack) < 2:
return (SHIFT, SHIFT, SHIFT)
for dependency in dependencies:
if stack[-1] == dependency[0] and stack[-2] == dependency[1]:
return dependency
for dependency in dependencies:
... | mit | 8,538,488,397,566,068,000 | 40.211538 | 277 | 0.685254 | false | 3.110305 | false | false | false |
jittat/ku-eng-direct-admission | scripts/import_final_results.py | 1 | 1966 | import codecs
import sys
if len(sys.argv)!=2:
print "Usage: import_final_results [results.csv]"
quit()
file_name = sys.argv[1]
from django.conf import settings
from django_bootstrap import bootstrap
bootstrap(__file__)
from result.models import AdmissionResult
from application.models import Applicant, Submi... | agpl-3.0 | 2,766,383,835,464,029,000 | 24.532468 | 77 | 0.573245 | false | 3.73055 | false | false | false |
glaslos/waechter | samples/hello_job_lock.py | 1 | 1122 | # Waechter - Job Scheduling Helper
# Copyright (C) 2016 Lukas Rist
# 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 version.
# ... | gpl-3.0 | -2,088,577,196,151,638 | 32 | 71 | 0.720143 | false | 3.895833 | false | false | false |
lesion/indicator-stickynotes | stickynotes/backend.py | 1 | 8331 | # Copyright © 2012-2015 Umang Varma <umang.me@gmail.com>
#
# This file is part of indicator-stickynotes.
#
# indicator-stickynotes 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 Lice... | gpl-3.0 | -2,976,877,124,460,908,000 | 34.751073 | 78 | 0.569868 | false | 4.071359 | false | false | false |
vietdh85/vh-utility | script/hyip_stop.py | 1 | 1859 | import sys
import os.path
import urllib2
import re
from pyquery import PyQuery as pq
import common
def getId(url):
arr = url.split("/")
id = arr[len(arr) - 2]
return id
def getSiteUrl(urlRequest, monitor, rcbUrl):
result = ""
print("REQUEST: {0}".format(urlRequest))
try:
req = urllib2.urlopen(urlRequest, t... | gpl-3.0 | -9,091,527,717,578,031,000 | 21.39759 | 86 | 0.629371 | false | 2.713869 | false | false | false |
mscoutermarsh/exercism_coveralls | assignments/python/space-age/space_age_test.py | 1 | 1640 | try:
from space_age import SpaceAge
except ImportError:
raise SystemExit('Could not find space_age.py. Does it exist?')
import unittest
class SpaceAgeTest(unittest.TestCase):
def test_age_in_seconds(self):
age = SpaceAge(1e6)
self.assertEqual(1e6, age.seconds)
def test_age_in_earth_... | agpl-3.0 | -6,469,365,441,323,217,000 | 29.943396 | 67 | 0.615244 | false | 2.992701 | true | false | false |
hulifox008/bitbake | lib/bb/msg.py | 1 | 5659 | # ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'msg' implementation
Message handling infrastructure for bitbake
"""
# Copyright (C) 2006 Richard Purdie
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU... | gpl-2.0 | -3,374,870,527,087,330,000 | 27.580808 | 93 | 0.626436 | false | 3.91085 | false | false | false |
retux/google-finance-storage | quotes-exporter.py | 1 | 1531 | #!/usr/bin/env python
'''
quotes-exporter: exposes quotes as prometheus exporter api
Usage: quotes-exporter.py <port>
'''
import sys
from prometheus_client import start_http_server, Metric, REGISTRY
from stockwatch import *
def cat_to_string (Symbols):
strSymbols = ' '
o = 0
for i in Symbols:
... | gpl-2.0 | 4,092,831,948,622,307,300 | 25.396552 | 103 | 0.601568 | false | 3.387168 | false | false | false |
haandol/review_crawler | crawler.py | 1 | 1108 | # coding: utf-8
import time
import json
import urllib
import urllib2
import logging
from bs4 import BeautifulSoup as Soup
logging.basicConfig(level=logging.DEBUG)
url = 'https://play.google.com/store/getreviews?authuser=0'
headers = {
'content-type': 'application/x-www-form-urlencoded;charset=UTF-8',
'user-... | mit | 6,187,855,021,797,479,000 | 21.612245 | 96 | 0.633574 | false | 3.297619 | false | false | false |
tforrest/soda-automation | app/runserver.py | 1 | 1857 | from flask_script import Manager
from flask_restful import Api
from models.user import User
from redis_ops.init_redis import RedisPopulater
from config import app
from config import db
from api import api
import logging
import os
import sys
manager = Manager(app)
def setup_api(app):
"""
Config resources wi... | mit | -2,609,925,388,766,893,600 | 20.604651 | 98 | 0.658051 | false | 3.550669 | false | false | false |
thomas-schmid-ubnt/avocado | selftests/functional/test_output.py | 1 | 20899 | import json
import tempfile
import os
import re
import shutil
import unittest
from xml.dom import minidom
import pkg_resources
from avocado.core import exit_codes
from avocado.core.output import TermSupport
from avocado.utils import process
from avocado.utils import script
from avocado.utils import path as utils_path... | gpl-2.0 | 296,487,700,817,237,500 | 42.269151 | 167 | 0.537442 | false | 3.931339 | true | false | false |
ge0rgi/cinder | cinder/volume/utils.py | 1 | 31057 | # Copyright (c) 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | apache-2.0 | 8,789,788,171,055,562,000 | 33.016429 | 79 | 0.601314 | false | 3.949262 | false | false | false |
Astyan-42/skepticalscience | skepticalsciencewebsite/publications/forms.py | 1 | 6022 | from django import forms
from django.utils.translation import ugettext_lazy as _
from django.utils import timezone
from django_select2.forms import Select2MultipleWidget
from django.db.models import Q
from django.contrib.auth import get_user_model
from crispy_forms.helper import FormHelper
from crispy_forms.layout impo... | agpl-3.0 | 1,018,924,324,186,331,900 | 37.608974 | 113 | 0.65377 | false | 4.0389 | false | false | false |
encukou/freeipa | ipalib/x509.py | 1 | 28653 | # Authors:
# Rob Crittenden <rcritten@redhat.com>
#
# Copyright (C) 2010 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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... | gpl-3.0 | 5,514,516,305,728,191,000 | 30.077007 | 89 | 0.621191 | false | 3.898898 | false | false | false |
beiko-lab/gengis | bin/Lib/site-packages/numpy/core/tests/test_errstate.py | 1 | 1930 | # The following exec statement (or something like it) is needed to
# prevent SyntaxError on Python < 2.5. Even though this is a test,
# SyntaxErrors are not acceptable; on Debian systems, they block
# byte-compilation during install and thus cause the package to fail
# to install.
import sys
if sys.version_info... | gpl-3.0 | 8,773,401,320,805,839,000 | 29.639344 | 69 | 0.542487 | false | 4.177489 | true | false | false |
BuzzFeedNews/nics-firearm-background-checks | scripts/chart-total-checks-36-months.py | 1 | 1215 | #!/usr/bin/env python
import sys, os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import StrMethodFormatter
from matplotlib.dates import MonthLocator
import seaborn as sb
sb.set()
checks = (
pd.read_csv(sys.stdin)
.assign(
month_dt = lambda df: pd.to_dat... | mit | -1,528,021,792,744,747,500 | 23.734694 | 75 | 0.644389 | false | 2.885714 | false | true | false |
Universal-Model-Converter/UMC3.0a | dev tests and files/data backups/GUI_update.py | 1 | 17618 | #1
#v 0.001
#I don't have a TOC here yet as everything constantly changes
import COMMON #file vars and functions for import/export processing
import VIEWER #mainly for the toggles
from VIEWER import __GL,__GLU #GL functions
from VIEWER import __pyg
'''
from COMMON import Scripts
#Shapes (private)
#Widgets (privat... | mit | 511,102,529,398,882,100 | 32.686424 | 142 | 0.564082 | false | 2.511833 | false | false | false |
CloudBrewery/duplicity-swiftkeys | duplicity/backends/swiftbackend.py | 1 | 4654 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2013 Matthieu Huin <mhu@enovance.com>
#
# This file is part of duplicity.
#
# Duplicity 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; ei... | gpl-2.0 | -4,472,042,862,085,545,000 | 37.46281 | 83 | 0.603997 | false | 4.181491 | false | false | false |
google/ci_edit | tools/checkSpelling.py | 1 | 3269 | #!/usr/bin/env python3
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 | 4,742,552,453,476,556,000 | 30.432692 | 81 | 0.649128 | false | 3.496257 | false | false | false |
nathanielksmith/prosaicweb | prosaicweb/__init__.py | 1 | 2338 | # prosaicweb
# Copyright (C) 2016 nathaniel smith
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This pro... | agpl-3.0 | 1,900,292,323,592,605,700 | 39.310345 | 79 | 0.640719 | false | 3.608025 | false | false | false |
liqin75/vse-vpnaas-plugin | quantum/plugins/vmware/vshield/plugin.py | 1 | 14836 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 OpenStack LLC.
# 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/... | apache-2.0 | -8,121,185,046,052,741,000 | 41.267806 | 92 | 0.611957 | false | 3.872618 | false | false | false |
pohzhiee/ghetto_omr | edcamcam_testfile_imgproc7.py | 1 | 5239 | import numpy as np
import cv2
from edcamcam_testfile_shape import shapedetector
import matplotlib.pyplot as plt
#Part 1: Image Loading
#-------------------------------------------------------------------
#load image
img = cv2.imread('img_data/omstest2.jpg',cv2.IMREAD_GRAYSCALE)
img2= cv2.imread('img_data/omstest2.jpg'... | gpl-3.0 | 6,262,305,167,322,656,000 | 24.807882 | 145 | 0.649361 | false | 2.766103 | false | false | false |
zorna/zorna | zorna/calendars/forms.py | 1 | 2212 | from django import forms
from django.utils.translation import ugettext_lazy as _
from schedule.models import Event, Occurrence
import datetime
import time
from zorna.calendars.models import ZornaCalendar, EventDetails, ZornaResourceCalendar
FREQUENCIES_CHOICES = (
("", _("-----")),
("WEEKLY", _("Weekly")),
... | bsd-3-clause | 1,895,415,933,786,963,200 | 29.30137 | 97 | 0.631555 | false | 3.880702 | false | false | false |
gregcorbett/SciBot | src/Board.py | 1 | 4163 | """This file defines the Board class."""
import pygame
from src.Component import Component
from src.Point import Point
class Board(Component):
"""This class defines the board (a.k.a. map)."""
def __init__(self, scenario):
"""Create the board."""
self.step = scenario.get_board_step()
... | gpl-2.0 | 5,462,970,932,799,122,000 | 41.050505 | 77 | 0.528705 | false | 4.476344 | false | false | false |
fretsonfire/fof-python | src/Credits.py | 1 | 9490 | #####################################################################
# -*- coding: iso-8859-1 -*- #
# #
# Frets on Fire #
# Copyright (C) 2006 Sami Kyöstilä ... | mit | -1,735,713,498,330,326,300 | 36.509881 | 127 | 0.546891 | false | 3.255575 | false | false | false |
cggh/DQXServer | _CreateFilterBankData.py | 1 | 1099 | # This file is part of DQXServer - (C) Copyright 2014, Paul Vauterin, Ben Jeffery, Alistair Miles <info@cggh.org>
# This program is free software licensed under the GNU Affero General Public License.
# You can find a copy of this license in LICENSE in the top directory of the source code or at <http://opensource.org/li... | agpl-3.0 | -1,543,107,310,729,181,400 | 32.30303 | 136 | 0.690628 | false | 3.522436 | false | false | false |
GammaC0de/pyload | src/pyload/plugins/downloaders/ShareonlineBiz.py | 1 | 5833 | # -*- coding: utf-8 -*-
import base64
import re
import time
from datetime import timedelta
from pyload.core.network.request_factory import get_url
from ..anticaptchas.ReCaptcha import ReCaptcha
from ..base.simple_downloader import SimpleDownloader
class ShareonlineBiz(SimpleDownloader):
__name__ = "Shareonline... | agpl-3.0 | 814,808,045,400,288,100 | 28.459596 | 109 | 0.513286 | false | 3.755956 | false | false | false |
yossan4343434/TK_15 | src/yamashita/preprocessing/capture_face.py | 1 | 1798 | # -*- coding: utf-8 -*-
import os
import shutil
import cv2
import glob
ROOT = os.path.abspath(os.path.dirname(__file__))
SRCDIR = ROOT.replace("src/yamashita/preprocessing", "data/rugby/goromaru/raw_goromaru/")
TARDIR = ROOT.replace("src/yamashita/preprocessing", "data/rugby/goromaru/pre_goromaru/")
NODIR = ROOT.repl... | mit | 5,616,299,162,888,946,000 | 27.539683 | 132 | 0.626808 | false | 2.724242 | false | false | false |
indashnet/InDashNet.Open.UN2000 | android/external/chromium_org/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py | 1 | 73915 | # Copyright (C) 2009 Google Inc. All rights reserved.
# Copyright (C) 2009 Apple Inc. All rights reserved.
# Copyright (C) 2011 Daniel Bates (dbates@intudata.com). All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following condit... | apache-2.0 | -2,000,034,110,292,578,300 | 43.905832 | 211 | 0.663235 | false | 3.409521 | true | false | false |
geoffsmiller/RetroTechClub | retrotechclub/views/game_views.py | 1 | 5726 | from flask import flash, redirect, render_template, url_for
from flask_login import login_required
from retrotechclub import app, db
from retrotechclub.models import Company, GameMaster, GameRelease, Platform
from retrotechclub.forms import GameMasterForm, GameReleaseForm
@app.route('/games')
def game_masters_list():... | mit | -1,783,189,908,252,373,000 | 37.689189 | 79 | 0.66853 | false | 3.558732 | false | false | false |
Grumpy-Mike/Mikes-Pi-Bakery | Santa's-Run/software/santa's_run.py | 1 | 8982 | # Santa's Run - a Christmas game
# By Mike Cook - October 2020
import pygame
import time
import os
import random
import RPi.GPIO as io
def main():
global restart, santaState, coverTrack, santaDistance, targetRect, disInc
global santaL_R, delivered, santaHeight, drop, lastDistance, throwCount, distance
ini... | gpl-2.0 | 4,538,330,641,443,869,000 | 36.739496 | 143 | 0.5943 | false | 3.496302 | false | false | false |
kubeflow/kfp-tekton | sdk/python/tests/compiler/testdata/withparam_global.py | 1 | 1802 | # Copyright 2021 kubeflow.org
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | apache-2.0 | -853,971,105,150,103,200 | 31.178571 | 122 | 0.629301 | false | 3.35568 | false | false | false |
Scitator/rl-course-experiments | GEN/genetic_gym.py | 1 | 5386 | #!/usr/bin/python
import gym
from gym import wrappers
import argparse
import numpy as np
import random
from tqdm import trange
def get_random_policy(env):
"""
Build a numpy array representing agent policy.
This array must have one element per each of 16 environment states.
Element must be an integer ... | mit | 801,298,826,288,472,000 | 28.431694 | 100 | 0.604716 | false | 3.543421 | false | false | false |
Adrianacmy/Classic-Interesting-CS-Mini-Programs | old/reverse_dict.py | 1 | 2014 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Created on Sun May 15
@author: Adrianacmy
Create a function reverse that takes in a dictionary and reverses it, such that
all of the values become keys and all of the keys become values. Be careful: we
do not wish to lose any information. Consider what to do if ... | mit | -2,144,025,257,464,626,000 | 22.149425 | 89 | 0.541708 | false | 3.166667 | false | false | false |
tkaitchuck/nupic | py/nupic/research/fdrutilities.py | 1 | 62245 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# This pro... | gpl-3.0 | -4,347,953,636,782,061,600 | 36.429946 | 114 | 0.6196 | false | 4.012441 | false | false | false |
blancltd/django-latest-tweets | latest_tweets/utils.py | 1 | 6404 | from __future__ import unicode_literals
from datetime import datetime
import hashlib
from tempfile import TemporaryFile
from django.core.files import File
from django.utils.six.moves import html_parser
from django.utils.timezone import utc
from PIL import Image
import requests
from .models import Hashtag, Like, Phot... | bsd-3-clause | -4,917,055,748,261,835,000 | 33.994536 | 96 | 0.570581 | false | 3.731935 | false | false | false |
bk1285/rpi_wordclock | wordclock_interfaces/event_handler.py | 1 | 2667 | import threading
from monotonic import monotonic as _time
class next_action:
NEXT_PLUGIN = 1
GOTO_MENU = 2
RUN_DEFAULT_PLUGIN = 3
class event_handler:
EVENT_INVALID = -1
EVENT_BUTTON_LEFT = 0
EVENT_BUTTON_RIGHT = 1
EVENT_BUTTON_RETURN = 2
EVENT_EXIT_PLUGIN = 3
EVENT_NEXT_PLUGIN_... | gpl-3.0 | 370,705,147,843,874,800 | 31.13253 | 116 | 0.600675 | false | 4.090491 | false | false | false |
saikia81/the-number-game | 4/number_game.py | 2 | 11834 | #!/usr/bin/python
# version 4
# april 2012
# this was written by saikia81 and is copyrighted under the GNU general public license 3
# it was written in notepad++, a program I recommend!
# whitespace ftw!
#import random, system and operating system possibilities.
import os, sys
import random, time #time moduele
#pick... | gpl-3.0 | -2,437,525,922,798,313,000 | 32.908309 | 120 | 0.577489 | false | 3.857236 | false | false | false |
akusok/website-ibc | wibc_old/utils/copy_hdf5.py | 1 | 6601 | # -*- coding: utf-8 -*-
"""
Utilites for copying huge HDF5 files.
Created on Thu Jun 20 14:02:59 2013
"""
#from ../modules/hdf5_creator import create_empty_hdf5
from tables import openFile
import numpy as np
import time
def copy_hdf5_newindex(data, new):
"""Copying a part of data, updating indexes.
Cop... | gpl-2.0 | -4,039,075,724,023,822,300 | 22.242958 | 67 | 0.518709 | false | 3.109279 | false | false | false |
qiime2-plugins/feature-table | q2_feature_table/_summarize/_visualizer.py | 1 | 11251 | # ----------------------------------------------------------------------------
# Copyright (c) 2016-2020, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | bsd-3-clause | 6,885,744,701,589,621,000 | 41.449057 | 79 | 0.598631 | false | 3.881643 | false | false | false |
AlexanderHaase/eppraise | eppraise.py | 1 | 16057 | #!/usr/bin/python3
from ebaysdk.finding import Connection as Finding
from ebaysdk.exception import ConnectionError
import itertools
import functools
import openpyxl
import sys
import re
import yaml
import argparse
import logging
import json
import datetime
import collections
from flask import Flask, redirect, request,... | gpl-3.0 | 1,612,893,145,415,447,600 | 31.438384 | 139 | 0.667746 | false | 3.362723 | true | false | false |
ProjetSigma/backend | sigma_chat/models/message.py | 1 | 1271 | # -*- coding: utf-8 -*-
from django.db import models
from sigma_chat.models.chat_member import ChatMember
from sigma_chat.models.chat import Chat
def chat_directory_path(instance, filename):
# file will be uploaded to MEDIA_ROOT/user_<id>/<filename>
return 'uploads/chats/{0}/{1}'.format(instance.chat_id.id, ... | agpl-3.0 | 1,941,828,085,756,653,000 | 34.305556 | 84 | 0.608183 | false | 4.279461 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.