blob_id
stringlengths
40
40
content_id
stringlengths
40
40
repo_name
stringlengths
5
114
path
stringlengths
5
318
language
stringclasses
5 values
extension
stringclasses
12 values
length_bytes
int64
200
200k
license_type
stringclasses
2 values
content
stringlengths
143
200k
5d17d57baf645910b2dd8e50c63d65820a63f8a8
829b0b1d91b2c4a1b95fd733ba39688eff5de867
samsteyer/udacity-data-engineer-project-2
/create_tables.py
Python
py
833
permissive
import configparser import psycopg2 from sql_queries import create_table_queries, drop_table_queries def drop_tables(cur, conn): """ Drop all tables we created in the cluster """ for query in drop_table_queries: cur.execute(query) conn.commit() def create_tables(cur, conn): """ ...
20f7a348946371a0c711409d5f89b4b015da45df
33872b02d6173d0da22756f313f6e4e495da9e66
yuanzilin/bishe_backend
/service/migrations/0006_auto_20210426_1813.py
Python
py
406
no_license
# Generated by Django 3.1.7 on 2021-04-26 18:13 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('service', '0005_auto_20210426_1125'), ] operations = [ migrations.AlterField( model_name='service', name='service_to...
bdbcce0a9f453f8e7acb5ca2d5b4a5dae80b25fc
1235935e2410c1ed6707b33411359ae749d275bf
langerest/pyscf
/pyscf/mcscf/casci.py
Python
py
44,831
permissive
#!/usr/bin/env python # Copyright 2014-2020 The PySCF Developers. 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 # # U...
670bb660a7f534bcae6ab3fff3b7099c3412ced3
ef4ea37e9db1afab5e6bf33ce8056c5385d66489
ihjohny/UVA-Solutions
/UVA-Solutions-Python/694 The Collatz Sequence.py
Python
py
332
no_license
# 694 The Collatz Sequence t=0 while True: t+=1 a,l=map(int,input().split()) aa=a if(a<0 and l<0): break; count=0 while(a<=l and a!=1): count+=1 if(a%2==0): a=a/2 else: a=3*a+1 if(a==1): count+=1 print("Case "+str(t)+": A = "+str(aa)+", limit = "+str(l)+", number of terms = "+s...
4eec7e2f7cf9501dc7853367c005fa3b9525ebb1
a77365239a24019cd52c115b03d8dc6b99518759
abbylane/ControlAltDefeat
/server.py
Python
py
32,117
permissive
from flask import * import sys import json import MySQLdb import atexit import itertools import collections import csv from queries import * #global variables for column names PLAYER_COLS = ['name', 'position', 'playerTag', 'height', 'weight', 'active'] PLAYERS_GET_QUERY = "SELECT * FROM Players WHERE active=1;" DRIV...
77081bedc375c4492dd00d4547c01c87707095a2
969ca6b4d0d0c772c5ede0c61ad1cda39576fe6d
janhybs/ci-hpc-app
/src/cihpc/shared/db/cols/col_index_stat.py
Python
py
1,273
no_license
#!/bin/python3 # author: Jan Hybs from itertools import groupby from typing import List, Dict, Optional from cihpc.shared.db.timer_index import TimerIndex from cihpc.shared.db.models import ( Entity, IdEntity, ) class ColIndexStatComputed(Entity): pval: Optional[float] stat: Optional[float] a: O...
86a6750556f753a688d8c01d78c73b8a037136d5
bcc3f2e908b122ce53e540d56d6df4ec9c01ee88
HAHAHANIBAL/Euler_Project_Training
/Triangular, pentagonal, and hexagonal.py
Python
py
445
no_license
#!/usr/bin/python #-*- coding: utf-8 -*- #author=moc #Euler #45 from math import sqrt #Hex is the subset of tri, so we only need to check if hex belongs to pent and we're good def ispentagonal(number): pentagonal=(sqrt(1.0+24*number)+1.0)/6.0 if pentagonal==int(pentagonal): return True else: ...
04239b257bc1c75371c031b9b127a1ccb9a6523d
07811667a8981bd84751f6bbb0c741e873699ca0
kennybrugman/bitcoin
/test/functional/test_framework/mininode.py
Python
py
26,134
permissive
#!/usr/bin/env python3 # Copyright (c) 2010 ArtForz -- public domain half-a-node # Copyright (c) 2012 Jeff Garzik # Copyright (c) 2010-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Bitcoin P2P ...
34acdc24345b6414618f51a7419e95998ede9ba2
c2f91a68bd78202efe44027db251c93bf355fc0a
jargij/masonite-working-package-example
/ding/setup.py
Python
py
295
no_license
from setuptools import setup setup( name="ding", version='0.0.1', packages=[ 'ding', 'ding.commands', 'ding.contracts', 'ding.drivers', 'ding.managers' ], install_requires=[ 'masonite', ], include_package_data=True, )
1fd699f9896b17cd928d220269a3ba94ca56db5a
a55aaa36764786730abbaca43dc3d7fee537b559
khushbu10/TFG-chatbot
/db.py
Python
py
4,237
no_license
from flask import jsonify, json from flask_mysqldb import MySQLdb import sys from datetime import datetime import config class SingletonMeta(type): _instances = {} def __call__(cls, *args, **kwargs): if cls not in cls._instances: instance = super().__call__(*args, **kwargs) cl...
77f42bea4132c9092f76d66f355a61903ba6d515
a2b45fd5a8475a0e213405d2c9bd5ccf08719a8a
sranyjstrannik/codeforces
/codeforces386/D.py
Python
py
390
no_license
n, k, g, b = map(int, input().split()) if g >= b: gs = 'G' bs = 'B' else: g, b = b, g gs = 'B' bs = 'G' if g-k*b>k: print("NO") else: gblock = g//(b+1) i = g%(b+1) result = '' for j in range(b): result += gs*gblock if i > 0: i -= 1 result...
3c4c7a3b1a2e0f0da1af9dd97faf6171f193115c
e88a5a9f64bb13cbadd700ce2ae7508a66e2adc8
Prakashchater/FLASK-WTForms
/main.py
Python
py
1,437
no_license
from flask import Flask, render_template, request from flask_wtf import FlaskForm from wtforms import StringField, PasswordField, SubmitField from flask_bootstrap import Bootstrap from wtforms.validators import DataRequired, Email, Length class MyForm(FlaskForm): # email = StringField('email', [ # validat...
684d2a388de36ea5d5f2687b0c9848894d88dc80
24e1464592ff3eb5027de2ca960a455ae5b3e655
bastiandg/projecteuler
/problems/problem60.py
Python
py
3,350
no_license
#!/usr/bin/python # -*- coding: utf-8 -*- #Title: Spiral primes limit = 10000 primeLimit = 100000000 import sys import math import numpy import itertools from bisect import bisect_left def primeSieve(n): """ Input n>=6, Returns a array of primes, 2 <= p < n """ sieve = numpy.ones(n/3 + (n%6==2), dtype=numpy.bool) ...
c249c221930ded8f0350af5b0900ba49e91d8454
ae5d91a8bab1b0c3c2b3a80eba6d17becf09e62c
liyingkun1237/ccxmodel
/dist/ccxmodel-0.1.0/ccxmodel/modelconf.py
Python
py
6,294
no_license
import configparser class ModelConf(object): ''' 模型配置文件类 用于提供默认的初始化模型参数和自定义的参数设置 ''' def __init__(self, conf_path): self.conf_path = conf_path cf = configparser.ConfigParser() cf.read(conf_path) self.conf = cf self.flag = True def __del__(self): ''...
1153f612b3011ed1943caa9faee2f84f5f4142c1
51560161faa8fa6d2c68f3ef20bb9d2e814c67cc
Shulyaka/home-assistant
/homeassistant/components/workday/binary_sensor.py
Python
py
8,060
permissive
"""Sensor to indicate whether the current day is a workday.""" from __future__ import annotations from datetime import date, timedelta from typing import Any import holidays from holidays import DateLike, HolidayBase import voluptuous as vol from homeassistant.components.binary_sensor import ( PLATFORM_SCHEMA as...
e2516387e2ace68f8be9793630fbf13a45aa89ed
f19d6e781102cad8e23ca1d8602bbece4379ff9d
Bartosz-D3V/machine-learning-jupyter
/k_means/compute_centroids.py
Python
py
431
no_license
import numpy as np def compute_centroids(x, dist_centroids, num_of_centroids): centroids = np.zeros((num_of_centroids, np.shape(x)[1])) for i in range(0, num_of_centroids): x_indexes = np.where(dist_centroids == i) x_points = x[x_indexes[0], :] x_points_len = np.size(x_points, 0) ...
8c59ec6b396d56956b984b854560ffcc71c4c3c5
dac139566b88c21b1990c00c54cd1250bb77c5fb
lizhhui/Deep-Reinforcement-Learning-Processor
/tb/data_set/DRLP_4x4_testing.py
Python
py
2,831
no_license
import numpy as np import math size = 4 xmove = 1 ymove = 2 zmove = 64 scale = 7 channel = zmove np.random.seed(1) bias = np.random.randint(0,20,size=16) act = np.random.randint(0,30,size=(zmove, size+ymove, size*(xmove+1))) fil = np.random.randint(-30,30,size=(16, zmove, size, size)) yend = size+ymove xend = size*...
5beeead93aead3075a2619fb89b02f428198f0b4
a7c2f1aaff2e62513bdf9bcc34ef5921007c30dd
kvmanohar22/bbox-refine
/utils/common.py
Python
py
2,153
no_license
import os import json import numpy as np import pandas as pd from scipy import ndimage def mkdir(path): if not os.path.exists(path): os.makedirs(path) def mkdirs(paths): if isinstance(paths, list): for path in paths: mkdir(path) def read_file(path): if not os.path.exists(path): raise FileNotFoundError('F...
89e87a9dab935afb88eb4508b3de38e1fbc4cb2b
b88eaaca1a54a1438141ff43feed671f5ca1393b
GenVas/bbbs
/bbbs/afisha/migrations/0001_initial.py
Python
py
1,067
no_license
# Generated by Django 3.2.2 on 2021-05-08 19:14 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('common', '0001_initial'), ] operations = [ migrations.CreateModel( name='Ev...
a7e3391acb35165a7554e03c833205a9c79c9e45
a92047c96c5809047c7e02478b6dd3d401adceae
liuhadong/7.19-
/function_tips.py
Python
py
717
no_license
import datetime def lhd_function_tips(): word = ['今天星期一:\n坚持下去不是因为我很坚强,而是因为我别无选择', '今天星期二:\n含泪播种的人一定能笑着收获', '今天星期三:\n做对的事情比把事情做对更重要', '今天星期四:\n命运给予我们的不是失望之就,而是机会之杯', '今天星期五:\n不要等到明天,明天太遥远,今天就行动', '今天星期六:\n求之若饥,虚心若愚', '今天星期日:\n成功将属于那些从不说“不可能”的人'...
2849a61f1b2b82728b686c154f35e4b1182985de
9b33e32e6bc6bda19f7f8a134fdc1ecee3532f73
jsainero/gcom
/Práctica 1/Pr1opc.py
Python
py
2,655
permissive
# -*- coding: utf-8 -*- """ Created on Wed Feb 5 13:41:00 2020 @author: Jorge Sainero """ import numpy as np from PIL import Image import math #Recibe una matriz de 0s y 1s y la pinta def pintar(a,dim): dibujo=np.empty((dim,dim,3), dtype=np.uint8) for i in range(dim): for j in range(d...
978bac6e9b052edfea9b2289b08ace6c73edfee8
3e866084ca1474bbd69f142ba622ad68cbfc6b9f
fliespl/multi-php-ubuntu
/library/snap.py
Python
py
7,529
no_license
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Stanislas Lange (angristan) <angristan@pm.me> # Copyright: (c) 2018, Victor Carceler <vcarceler@iespuigcastellar.xeill.net> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_imp...
8d1fb64866c7d7f40d4136a4f9a5fd3b25ce2b2f
163cf44c215ef0a6e47983f63e6e2ffc1bbdff6c
James-lh/vad
/positional_encoding/op_compile.py
Python
py
2,855
no_license
import os import tensorflow as tf class OperaterCompiler: def __init__(self, op_name, source_dir, lib_dirs=None): self._op_name = op_name self._source_dir = source_dir self._lib_dirs = lib_dirs if lib_dirs else [] def record_cpu_basis(self, cc_paths, so_path, ext=''): self._cc...
1ebd47b9ef7d55cbcd5f683594e41e62cea48043
e30d73d0a4bbaad267e7ffcdc0631e1f5a51029c
crowdbotics-apps/schindlerpeterymailco-862
/home/management/commands/load_initial_data.py
Python
py
763
no_license
from django.core.management import BaseCommand from home.models import CustomText, HomePage def load_initial_data(): homepage_body = """ <h1 class="display-4 text-center">peter-schindler-schindlerpeter</h1> <p class="lead"> This is the sample application created and deployed from the...
96ebf0441f1fdca99f1bebf7338bc701c2dd68c0
da6c440a4fe3536a2dc36c2841ff30c9da2b7ce6
Eastwu5788/pre-request
/tests/test_flask/test_json.py
Python
py
998
permissive
# !/usr/local/python/bin/python # -*- coding: utf-8 -*- # (C) Wu Dong, 2020 # All rights reserved # @Author: 'Wu Dong <wudong@eastwu.cn>' # @Time: '2020-03-18 13:17' # sys import json # 3p from flask import Flask, make_response # project from pre_request import pre, Rule app = Flask(__name__) app.config["TESTING"] = ...
dd3d1d483ca061f1150d8e14d008c31033ab2728
5b57768dd27aabda8a28ef6bafeee00d1117b4e4
gabrielgamer136/aula-git-gabriel
/Documentos/lista de exercicios 1 python gabriel/lista de exercicios 2 phyton/exercicio numero 5.py
Python
py
267
no_license
#Gabriel maurilio num1 = int(input("digite o primeiro numero")) num2 = int(input("digite o segundo numero")) num3 = int(input("digite o terceiro numero")) if num1 > num2 or num3: print(num1 > num2 or num3 ) if num1 < num2 or num3: print(num3 < num2 or num1)
cca4746d49a7304a72738ddcabfd89028e11c04d
e46bb2b968ca4792cef2b649a3031710a177ee03
Dsblima/cascor_elm
/utils/activation_functions.py
Python
py
647
no_license
import numpy as np def sigmoid(x, derivative=False): return 1 / (1 + np.exp(-x)) if not derivative \ else x * (1 - x) def tanh(x, derivative=False): return np.tanh(x) if not derivative \ else 1 - x * x def linear(x): return x def relu(x, derivate = False): if not derivate: output =...
f07cbcfd5fd237f973967805a1b5848417e67f33
43d511400436c0f2829e726ff8351ad070e17f51
atereshkin/perforate
/dash/fakeclient.py
Python
py
1,641
no_license
import time import random from threading import Thread import perforate URLS = ('/', '/items/', '/items/{}/', '/items/{}/some-detail/', '/account/dashboard', '/help/', '/some-other-items/{}/', '/users/{}/stories/{}/') def random_url(): url = random.choice(...
5479251cfe646c00d01c0297ad8eda7eee0e39d5
998ffdba4fe1ff16c29469251fcdcc9427bed1e8
thinhlx1993/rl-learning-dino
/dino_game/test_screen_capture.py
Python
py
1,390
no_license
""" This is part of the MSS Python's module. Source: https://github.com/BoboTiG/python-mss Simple naive benchmark to compare with: https://pythonprogramming.net/game-frames-open-cv-python-plays-gta-v/ """ import time import cv2 import mss import numpy def screen_record(): try: from PIL import ImageG...
a59c330658fa71b7df307865b0f124c56cfb5db0
c0bb492347e1decfd7f7070dd46b42fdaffcba3f
Xinmudotmoe/pyglet
/contrib/wydget/wydget/layouts.py
Python
py
15,805
permissive
import operator import math from wydget import util from wydget.widgets.label import Label TOP = 'top' BOTTOM = 'bottom' LEFT = 'left' RIGHT = 'right' CENTER = 'center' FILL = 'fill' intceil = lambda i: int(math.ceil(i)) class Layout: """Absolute positioning layout -- also base class for other layouts. E...
74dd121cbaaf4c7813482df406dc3d6f81e93025
369ffc528f8f4c4484c166892f84c5984f338944
gururajraop/sassy_semicolon
/deeplab/utils/input_generator_lstm.py
Python
py
6,056
no_license
# 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 applicab...
91e6e3e3595a7721ca2a21f92f531690c8753aa1
e1a04335278e89f43100697f5e393d4a238be182
k9ert/cheesepi
/cheesepi/server/storage/models/result.py
Python
py
663
permissive
from __future__ import unicode_literals, absolute_import from cheesepi.exceptions import UnsupportedResultType class Result(object): @classmethod def fromDict(cls, dct): name = dct['task_name'] from .PingResult import PingResult if name == 'ping': return PingResult.fromDict(dct) else: raise UnsupportedRes...
0d89a095b411d68ce19f4143a67acd9e0f4f5a21
def3810aa0c770a02eea798f0fdbe4fb39358d30
daniel08311/ML2017
/hw3/saliency_map.py
Python
py
1,260
no_license
import numpy as np from matplotlib import pyplot as plt import pandas as pd from keras.preprocessing.image import img_to_array from keras.applications.imagenet_utils import preprocess_input from keras.models import model_from_json from keras.models import load_model, Sequential, Model from vis.utils import utils from v...
0d859cbbec179546bdc9fd77ffb6c4620d68b81f
053d4892f525370c45ac5610ff67c9f3ba8b1807
ashxxh/discountme
/main.py
Python
py
462
no_license
import extract import tags import tweets if __name__ == "__main__": print("Don't forget to chcp 65001") # this is a reminder to me when I run this program from command line print('Enter your query') query = input() list_of_tags = tags.get_tags(query) list_of_tweets = tweets.get_tweets(list_of_tags) result = e...
8bc5018fd65ce03e9468fac14307f5e5f3423c81
98244dfd1496775e040dd72240ca933ea3330fb4
guam68/code
/practice/checkio/ship_teams.py
Python
py
965
no_license
def two_teams(sailors): ship1 = [] ship2 = [] for name, age in sailors.items(): if 20 > age or age > 40: ship1.append(name) else: ship2.append(name) return [ sorted(ship1), sorted(ship2) ] if __name__ == '__main__': print("Example:") ...
f503c28f4f84ba96d515de6fb217e860bfcf8814
5af29eba5eaacaa607b4b47f231aec71c4b07e61
hqsds/Python
/leet_code/12. Integer_to_Roman_m.py
Python
py
1,304
no_license
# Given an integer, convert it to a roman numeral. # # Input is guaranteed to be within the range from 1 to 3999. # key:1) build a list to store all the case of romans # 2)start from the biggest roman, num-=values[i] class Solution(object): def intToRoman(self, num): #roman={"I":1,"V":5,"X":10,"L":50,"C":10...
930451fd080318105cabd76ba636770e46dec4d6
c22818d94036584bacd7499965a5c7d515710382
nbardy/client
/wandb/sdk_py27/wandb_setup.py
Python
py
7,619
permissive
# File is generated by: tox -e codemod """Setup wandb session. This module configures a wandb session which can extend to mutiple wandb runs. Functions: setup(): Configure wandb session. Early logging keeps track of logger output until the call to wandb.init() when the run_id can be resolved. """ import copy i...
86e98dae81cf05dcb52d95df3af459ccbc72d6d4
52b92321e48020dc64f6e06f4ca07e9c97910252
daniel-reich/turbo-robot
/EJRa8efMPoCwzLNRW_14.py
Python
py
1,514
no_license
""" Juan loves the Dakti song and wants to memorize the chorus of the song. His friend sent him the chorus in phrases, but the phrases are somewhat strange; they do not have an order and they have numbers. His friend helps Juan organize the chorus of the song. Use RegEx, natural sorting, sorting, or lambda function...
72536616a59dd6fd3b695b3b101d5c72b3b82d5a
f91923530f14f876a6a958b6f1b79355ed19569c
taral2000/python-projects
/01 python core/TupleDemo.py
Python
py
679
no_license
#For more exaples https://www.programiz.com/python-programming/methods/tuple #Tuple t = (1,'test', 3.23) tuple1 = ("Test", 3.14, 55,"Apple",[3,4],"Cherry","Berry","Melon","Orange","Test",("x","y")) print("tuple1 : ", tuple1) print("tuple1[1] : ", tuple1[1]) print("tuple1[-1] : ", tuple1[-1]) print("tuple1[2:5] : ", tup...
8f530126e450d3385317a84a27802f961dd1215a
5e43ce35b7460b36c75fdc5d268520af0dbde709
guessmewho233/CoGNN_info_for_SC22
/software/pipeswitch/worker_common.py
Python
py
2,886
no_license
import importlib import torch ### Class class ModelSummary(): def __init__(self, model_name, para_cache_size, comp_cache_size, param_trans_pipe): """ """ self.task_name, self.data_name, self.num_layers = model_name[0], model_name[1], int(model_name[2]) self.para_cache_size, self.comp_cache...
24f50c1a2de76e99660bd0e903a9a7a9363fb46c
d2301ea8bf4b87555ebd244de06db5a61c89a7cc
DMUPraveen/Round2
/arm_ik_testing,py.py
Python
py
1,347
no_license
from math import asin, acos, atan,pi a1 =0.253 a2 = 0.155 a3 = 0.135 a4 = 0.081 a5 = 0.105 def arm_ik(x,y,z): x1 = (x**2+y**2)**0.5 y1 = y + a4 +a5 -a1 a = a2 b = a3 c = (x1**2+y1**2)**0.5 theta = acos((a*a+c*c-b*b)/(2*a*c)) alpha = asin(z/x1) beta = pi/2 - theta gamma = theta...
fb17b9ce8b9b4ba8ebd5dcd94323fa186bdfb2b2
473d42d9666d1049abf196b713e3ef3b49216118
dlsaavedra/Detector_GDXray
/keras-yolo3-master/yolo.py
Python
py
19,008
permissive
from keras.layers import Conv2D, Input, BatchNormalization, LeakyReLU, ZeroPadding2D, UpSampling2D, Lambda from keras.layers.merge import add, concatenate from keras.models import Model from keras.engine.topology import Layer import tensorflow as tf class YoloLayer(Layer): def __init__(self, anchors, max_grid, bat...
bf0297ad8ae7b5e717d9a7159d469a5a89703c19
0a0279d5fc3cc25c395c52215d260ba043bf7e39
ksorat/StormPSD
/genVids/IVid.py
Python
py
8,656
no_license
import kCyl as kc import pyStorm as pS import os import numpy as np import datetime import matplotlib.pyplot as plt import matplotlib as mpl from matplotlib.colors import LogNorm from matplotlib.colors import Normalize import matplotlib.gridspec as gridspec import matplotlib.dates as mdates import lfmViz as lfmv import...
aaca40c645bdd091a05079cd1dbaedfd4af99dbb
86eefa223363c4761292c7cc08701185d0788ade
kumarshrinath/counterparty-lib
/counterpartylib/test/fixtures/params.py
Python
py
2,153
permissive
""" This is a collection of default transaction data used to test various components. """ UNIT = 100000000 """This structure is used throughout the test suite to populate transactions with standardized and tested data.""" DEFAULT_PARAMS = { 'addresses': [ ['mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc', 'cPdUqd5EbB...
03bbe3bad3a42b9353414ade1bfab46d322d927d
3a17a4d6c4128f066da25914ec8ec77d215c9c25
NYPL-Simplified/circulation
/api/admin/controller/__init__.py
Python
py
93,540
permissive
import base64 import copy import json import logging import os import sys import urllib.parse from datetime import date, datetime, timedelta import flask import jwt from flask import Response, redirect from flask_babel import lazy_gettext as lgt from sqlalchemy.sql import func from sqlalchemy.sql.expression import ( ...
bf6c57778d76ff8082a58cd5dd1586a959bbb983
10e5d7d35743b79d925e84c142ed634cdac1d0f2
mgerst/flag-slurper
/docs/conf.py
Python
py
5,311
permissive
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Flag Slurper documentation build configuration file, created by # sphinx-quickstart on Wed Sep 12 22:07:18 2018. # # 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...
8f32527968afab6dca90490682fd76bb0c069553
8b8bf752130f10daf195e3a311bb95cf92c59a9a
IT-rosalyn/Ballet_With_Web
/manage.py
Python
py
547
no_license
#!/usr/bin/env python import os import sys if __name__ == '__main__': os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Ballet_With_Web.settings') try: from django.core.management import execute_from_command_line except ImportError as exc: raise ImportError( "Couldn't import Djan...
7b8e199e35ff9096295d8bf5345f978dbd6398ef
3d8b2f1c91160b8aad872c9d6ed14b27a1cbde5b
masQelec/plugin.video.netflix
/resources/lib/utils/website.py
Python
py
15,669
permissive
# -*- coding: utf-8 -*- """ Copyright (C) 2017 Sebastian Golasch (plugin.video.netflix) Copyright (C) 2018 Caphm (original implementation module) Parsing of Netflix Website SPDX-License-Identifier: MIT See LICENSES/MIT.md for more information. """ import json from re import search, compile as recom...
770661c97d1a215fdac660135b333dfd46ede03a
f2d164d5bb365b7935c867accbe90dbd75041de5
Duinobot/django-api-adv
/app/core/tests/test_models.py
Python
py
1,370
permissive
from django.test import TestCase from django.contrib.auth import get_user_model class ModelTests(TestCase): def test_create_user_with_email_successfully(self): """Test creating a new user with an email is successful""" email = "test@gmail.com" password = "You'rethebest" user = get...
6e99a8285fe5b997548f8b2242579ad7de10aae1
16348c6f3ee6e0bc56047888680d4acb453d4842
harmishpatel21/Flask-Webapp-Purchase-Amount-Prediction
/Model_Testing.py
Python
py
2,472
no_license
## Import packages import sys import pandas as pd import numpy as np import pickle as pkl import xgboost as xgb import matplotlib.pyplot as mlp import seaborn as sns from sklearn.preprocessing import LabelEncoder from optparse import OptionParser parser = OptionParser() parser.add_option("-u","--user",help="view top C...
c27cb67bf77fdeb9dc210e8075434068444a0bf8
ef40f00a20637d921cfbb33cf03e9d493d7c7fad
SovietPanda/cloudroast
/cloudroast/compute/integration/volumes/boot_from_volume/admin_api/v1/test_server_live_migration.py
Python
py
1,290
permissive
""" Copyright 2013 Rackspace 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, software dist...
9b251747a56fdd9936278cfe0fa9b8170e846497
5fb790b4eb5192bc6cffe04a40c05bb4a87857a6
xingdu1991/Algorithmic-toolbox
/start/inverted_index.py
Python
py
888
no_license
import MapReduce import sys """ Inverted Index using Simple Python MapReduce Framework Test Input: books.json Test Output: inverted_index.json """ mr = MapReduce.MapReduce() def mapper(record): # record is a 2-element list # key: a word # value: a document that the word appears in id = record[0] ...
a0b76012b624e42c3ad282b54d763fa84e0991a5
641759a173b3ec8cfed6dcddf0a16b1346a3b7bb
baden/gps-maps27
/server/appengine_config.py
Python
py
2,355
no_license
# -*- coding: utf-8 -*- import logging import os import Cookie #from google.appengine.api import namespace_manager import re #logging.getLogger().setLevel(logging.ERROR) logging.info('Loading %s from %s', __name__, __file__) #apptrace_URL_PATTERNS = ['^/$'] #apptrace_TRACE_MODULES = ['api.py'] # Пока запретис стат...
bda9ac805c02bb61c7e876f297024c0e78ee920f
e91b6aca56caea9b17d732b15ead25c6d9a79b27
footballradar/thrift-utils
/setup.py
Python
py
202
no_license
from distutils.core import setup setup( name='thrift-utils', version='0.0.1', packages=['fr_thrift'], install_requires=[ "thrift", "kazoo", "ipython", ], )
b49916452de1e0e98eb1f31b15d9ad5667d089d8
656ac87cbf58898b38db2b85e17caff180429606
sa2shun/MatsuoDRL
/DQN_Priorized_Reply/model_load.py
Python
py
1,510
no_license
import gym import retro from stable_baselines.common.vec_env import DummyVecEnv from stable_baselines import DQN from stable_baselines.common import set_global_seeds from stable_baselines.bench import Monitor from baselines.common.retro_wrappers import * from util import log_dir, callback, AirstrikerDiscretizer, Custom...
4003a28288188698f198e617fd1af8a929dcbda5
91db48f3fbfe29ee4e8165702893ca05b9b3893d
lyf1006/python-exercise
/16. download data/world_population.py
Python
py
400
permissive
import json #将数据加载到一个列表中 filename = '16. download data/population_data.json' with open(filename) as f: pop_data = json.load(f) #打印每个国家2010年的人口数量 for pop_dict in pop_data: if pop_dict['Year'] == 2010: country_name = pop_dict['Country Name'] population = int(pop_dict['Value']) print(coun...
ba50bfc1a3d2883b5c4cfc8b2c219a48e407c4d6
214b3726c2ea8f66d12990580258afe260ddf4d8
jianjian0dandan/sensitive_user_portrait
/sensitive_user_portrait/user_rank/temporal_rank.py
Python
py
3,672
no_license
# -*-coding:utf-8-*- import sys import json import time from sensitive_user_portrait.global_utils import R_CLUSTER_FLOW1 as r from sensitive_user_portrait.global_utils import es_user_profile, es_user_portrait from sensitive_user_portrait.global_utils import profile_index_name, profile_index_type, portrait_index_name, ...
ae3892b52a97b54982b29a2d801db49356bb8eaa
527d81aad69f45cbf0eb3704b8647bdd04617d55
amgenene/Wallbreakers_homework
/reverseString.py
Python
py
347
no_license
def reverseString(self, s): """ :type s: List[str] :rtype: None Do not return anything, modify s in-place instead. """ i = -1 counter = 0 while i >= (len(s)/2) * -1: temp = s[counter] s[counter] = s[i] s[i] = temp i...
d92445aa32f073e67b6d005e1b61b4e6e3fc6025
a63347d78b6db5e8fc47e97c22dde5d39aaa0da7
wuhuanhost/docx2html
/src/parseHtmlAbsolutePath.py
Python
py
2,769
no_license
#-*- coding:utf-8 -*- import mammoth import sys,os, base64,re,uuid from utils.remove_file_folder import delete_file_folder from docx import to_latex reload(sys) sys.setdefaultencoding('gbk') input_argv = sys.argv[1] inputFile=input_argv imgIndex=0 #base64转图片 def base64ToFile(baseData,file_name): imgData = base64.b64...
1d4414c99b90bcc4bbc33945a3a589759a12b51b
b1dd88941d27dea8cc65822c56b8045cd29dac15
Panwanwan/bass-model
/bass2.py
Python
py
2,195
no_license
# 最小二乘法 from math import e # 引入自然数e import numpy as np # 科学计算库 import matplotlib.pyplot as plt # 绘图库 import csv from scipy.optimize import leastsq # 引入最小二乘法算法 # 样本数据(Xi,Yi),需要转换成数组(列表)形式 ti = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10,11]) # 读取文件 def read_data(filename): data_csv = [] with ope...
6f34f1d31bae18bfbd02537d90d2d81f99408fc0
bf2cab8e78bac4d3e7a33b9334b13253ed14ff20
tweak-com-public/tweak-api-client-python
/test/test_billing_source_owner.py
Python
py
1,472
permissive
# coding: utf-8 """ tweak-api Tweak API to integrate with all the Tweak services. You can find out more about Tweak at <a href='https://www.tweak.com'>https://www.tweak.com</a>, #tweak. OpenAPI spec version: 1.0.8-beta.0 Generated by: https://github.com/swagger-api/swagger-codegen.git ...
2a2a4c0ee6653e9e35f2b0d6316c146f491f217e
b6d35e883eacc00f946a916d5aafa76f7edfd00a
AndrewLester/mechmania-2021
/movement.py
Python
py
2,325
no_license
from planting import get_harvestable_crops_nearby from model.crop_type import CropType from api import game_util from model.tile_type import TileType from model.game_state import GameState from api.game_util import distance from model.position import Position from api.constants import Constants from model.decisions.mo...
c098e51d5e66f800cedfb2212d13ebdadf2ae532
8f6ad37a6da0b774618dfb6d1bd0c019c85fd8d1
geramolinest/FlaskTest
/app.py
Python
py
778
no_license
from flask import Flask, render_template #import for the blueprint address from bluePrints.address.addressBP import address #Instance of the FlaskApp app = Flask(__name__) #Register of the blueprint for the calculus of address app.register_blueprint(address) #Adding two routes for initial page, in this page (index.h...
aeca92625f821791493d1921fe9b8722670dc7fa
35fe43fa7a447743be02ca272ff9ebd386174f2c
RahatIbnRafiq/leetcodeProblems
/Dynamic Programming/516. Longest Palindromic Subsequence.py
Python
py
539
no_license
class Solution(object): def longestPalindromeSubseq(self, s): if not s: return none if len(s) < 2:return 1 if s == s[::-1]: return len(s) dp = [[0 for i in range(0,len(s))]for j in range(0,len(s))] for i in xrange(len(dp)-1,-1,-1): dp[i][i] = 1 ...
c6b763ecedd0cb1b26698b7480916a7c4a9f3615
dee4880311b21d2df1372b8d0dc24fae1a3df21d
litterstar7/Qualcomm_BT_Audio
/audio/extensions/acat_tab/py/acat_tab.py
Python
py
15,527
no_license
############################################################################ # CONFIDENTIAL # # Copyright (c) 2016 - 2018 Qualcomm Technologies, Inc. and/or its # subsidiaries. All rights reserved. # ############################################################################ """ Forms a wrapper around ACAT allowing it...
ef4e9274297f3924ffb66936c3bd1231013b71dd
98e27daf62f4b5af73afd8af876b4b388f024dd4
luisfdez/koku
/koku/masu/test/database/test_azure_report_db_accessor.py
Python
py
19,830
permissive
# # Copyright 2021 Red Hat Inc. # SPDX-License-Identifier: Apache-2.0 # """Test the AzureReportDBAccessor utility object.""" import datetime import decimal from unittest.mock import patch from django.db import connection from django.db.models import F from django.db.models import Max from django.db.models import Min f...
d5b8f4b214e80d2b711b9b96326aa5c3536a02c5
07443c257e33f7df2c7547dc81ff602df249e560
OuJng/GoMoKu
/client/terminal.py
Python
py
2,301
no_license
from client import player import re class terminal: playCommand = ["play", "play game", "start game", "join game"] quitCommand = ["quit", "quit game", "exit game"] exitCommand = ["exit"] putCommand = ["put", "put chess"] def __init__(self): self.client = player() return ...
04cdb38d2aece490de5002c798a4457eaeacd123
1de8cfdc83f8936566dca444b47631ccb2695e4d
d0lphis/gita
/tests/test_utils.py
Python
py
5,305
permissive
import pytest import asyncio import subprocess from pathlib import Path from unittest.mock import patch, mock_open from gita import utils, info from conftest import ( PATH_FNAME, PATH_FNAME_EMPTY, PATH_FNAME_CLASH, GROUP_FNAME, TEST_DIR, ) @pytest.mark.parametrize('test_input, diff_return, expected', [ ([{'a...
a7a8f0116cd79ed00a171f60779b9fee0779ee27
6e09e33c12ad98c7df35ab5070c5077a321dda93
jina-ai/jina
/jina/serve/runtimes/gateway/models.py
Python
py
10,232
permissive
from collections import defaultdict from datetime import datetime from enum import Enum from types import SimpleNamespace from typing import TYPE_CHECKING, Callable, Dict, List, Optional, Union from google.protobuf.descriptor import Descriptor, FieldDescriptor from pydantic import BaseConfig, BaseModel, Field, create_m...
c8a8d69f8dc6b6ec5b587d49a998368f825224fb
4babe74df0d0a65fe7c801bbe7bdc49353e69cae
jieren172/open-data-test-bonus
/src/main.py
Python
py
1,549
no_license
from os import path import os import lib.utils as utils import json def main (): dir_name = path.dirname(path.dirname(__file__)) # Test 1 print('\n-- Running test 1 ...') with open(path.join(dir_name, 'data', 'test1-1.json'), 'r') as f: data = json.loads(f.read()) output = utils.trans...
584be6ae5f99630def29bbadbf194a757c20cb57
66441887cb4c439e07f24b7ee3d245e27bef69da
Ata-92/Django-Blog-App
/src/auth_app/migrations/0004_alter_profile_image.py
Python
py
402
no_license
# Generated by Django 3.2.5 on 2021-07-28 14:23 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('auth_app', '0003_alter_profile_image'), ] operations = [ migrations.AlterField( model_name='profile', name='image', ...
d1d2dc6a3840c1cd93ba4a94ce6345576544b0e5
03418d90caf4db8fabf9054c7287b6eb9af4cfc1
sanderisbestok/detectron2
/projects/TridentNet/train_net.py
Python
py
2,336
permissive
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. """ TridentNet Training Script. This script is a simplified version of the training script in detectron2/tools. """ import os from detectron2.checkpoint import DetectionCheckpointer from detectron2.config import get_cfg from detectron2.engine...
85cc81cff2ef24c08de0b9b382e6d8746253895a
d42c6c8dbb49be831d0ef75bb90dd79d895af040
xarthurx/compas_fab
/src/compas_fab/backends/ros/backend_features/move_it_plan_motion.py
Python
py
7,645
permissive
from __future__ import absolute_import from __future__ import division from __future__ import print_function from compas.utilities import await_callback from compas_fab.backends.interfaces import PlanMotion from compas_fab.backends.ros.backend_features.helpers import convert_constraints_to_rosmsg from compas_fab.back...
c13a2a33feeeded9e2224bf6204e9317335a0485
44d9edf97206f89b44106cae149fdbb7823866a6
AlexFengCisco/Tensorflow
/TFlearn_RNN_sin/Sine_predict.py
Python
py
2,237
no_license
import numpy as np import tensorflow as tf import matplotlib as mpl from matplotlib import pyplot as plt from tensorflow.contrib.learn.python.learn.estimators.estimator import SKCompat learn = tf.contrib.learn HIDDEN_SIZE = 30 NUM_LAYERS = 2 TIMESTEPS = 10 BATCH_SIZE = 32 TRAINING_STEPS = 3000 TRAINING_E...
1e2bfdca473a3340a350f0dea93904a5a268ade2
38e958604d5f8b5c6ad3ae8627c2c7a2a30e1f8e
tectronics/dnatop
/dna_topology/dna_vessel.py
Python
py
27,371
no_license
#!/usr/bin/env python """ Provides vessel class. """ import time, heapq from dna_component import * from dna_util import * __author__ = "Christofer Hedbrandh" __credits__ = ["Christofer Hedbrandh", "Jessica P. Chang"] __license__ = 'GNU' __maintainer__ = "Christofer Hedbrandh" __email__ = "chedbrandh@gmail.com" # t...
169cc7e605d283cde062e08259e3199f13c58ffa
01ae81ea93aa564993ddb4fd04f52615e9b2d97a
chenjinpeng1/python
/day16/books/migrations/0004_remove_author_last_name.py
Python
py
391
no_license
# -*- coding: utf-8 -*- # Generated by Django 1.9.5 on 2016-05-20 15:32 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('books', '0003_author_last_name'), ] operations = [ migrations.RemoveField( ...
1444816e9b759a251d0a1401a124c0907307252e
5f6e354ec044ab2c6aeb719d1ab300545140e2a3
luismontoyanav/ConcretosMontoya
/config/settings.py
Python
py
3,921
no_license
""" Django settings for config project. Generated by 'django-admin startproject' using Django 3.2.3. For more information on this file, see https://docs.djangoproject.com/en/3.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.2/ref/settings/ """ from pathlib ...
91e1b6489d4017759c6d0a2b8f2c4543418cd5e7
6f2fe2f020ee97f7c9c18504cacc14f724bb75cf
igayy9/api-server
/server/methods/general.py
Python
py
1,877
permissive
from server import utils from server import cache import requests import config class General(): @classmethod def info(cls): data = utils.make_request('getblockchaininfo') if data['error'] is None: data['result']['supply'] = utils.supply(data['result']['blocks'])['supply'] data['result']['reward'] = utils...
c3c30e44510b7b6d801f2508818de0a9fd1039bd
9fbe1f0138f91a74500000200efc5c8298b223dd
mckjzhangxk/deepAI
/daily/8/DeepLearning/myproject/cluster/build/lib/cfai/cluster.py
Python
py
6,683
no_license
from time import sleep import glob import os from collections import OrderedDict from cfai.utils import * from cfai.utilsHelper import clusterHelper import argparse import traceback def printProcess(fn): def wrapper(*args,**kwargs): print('开始处理:',args[0]) fn(*args,**kwargs) print('结束处理') ...
9b58dafd5913a0dd17ca8a5be3cbf8ad98b82b88
7d5a876456c7a3fd51265216b2c5f9a33f225650
Tinjombo/Skogestad-Python
/Example_06_04.py
Python
py
842
no_license
from utils import pole_zero_directions, BoundKS, tf, mimotf from reporting import display_export_data import numpy as np s = tf([1, 0]) G11 = (s - 2.5) / (s - 2) G12 = -(0.1 * s + 1) / (s + 2) G21 = (s - 2.5) / (0.1 * s + 1) G22 = 1 G = mimotf([[G11, G12], [G21, G22]]) p = G.poles() z = G.zeros() print...
ed0771f07fff39c3c6fd1ae01aadabc959407e8c
e2ff0691cc7c77302f774fc704fcd676157cea30
cctbx/cctbx_project
/mmtbx/nci/skew_kurt_plot.py
Python
py
4,578
permissive
from __future__ import absolute_import, division, print_function import libtbx.load_env from libtbx import easy_pickle from mmtbx.utils.grid2d import Grid2D import numpy as np import matplotlib.pyplot as plt import os def get_filling_data(data, x_nbins, y_nbins, xmin, xmax, ymin, ymax, threshold=2, interpolation=...
5df7bbbe14d41385b884065af63a69dde3eb8a0c
d373357de9538ea17687acab93e6e41838b1205c
crowdbotics-apps/navigate-me-1673
/backend/navigate_me_1673/wsgi.py
Python
py
409
no_license
""" WSGI config for navigate_me_1673 project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJA...
4411b72d0a3fe4ba8080fd102abf6c564a9a58a7
ea0017b9d25c85cece0e42c463a105225bc47631
future1111/GraphGallery
/examples/TensorFlow/SBVAT.py
Python
py
758
permissive
#!/usr/bin/env python # coding: utf-8 import graphgallery import tensorflow as tf graphgallery.set_memory_growth() print("GraphGallery version: ", graphgallery.__version__) print("TensorFlow version: ", tf.__version__) ''' Load Datasets - cora/citeseer/pubmed ''' from graphgallery.datasets import Planetoid data = ...
1bb8a440c0d1b5b87a58abfd562015fd9c8c0a44
42a9e2a7fba84f9d3a0a92a329ea2bce211364bb
shineyb/cloud-custodian
/tools/c7n_left/c7n_left/cli.py
Python
py
2,959
permissive
# Copyright The Cloud Custodian Authors. # SPDX-License-Identifier: Apache-2.0 # import logging from pathlib import Path import sys import click from c7n.config import Config from .core import CollectionRunner, ExecutionFilter from .entry import initialize_iac from .output import get_reporter, report_outputs, summary...
d3e43ffce77ed9508a6bc96c616adc4aea905eaa
6fa81e8e779a942e45d9c598d5a9bbce5380384b
vedantc98/Plone-test
/buildout-cache/eggs/plone.app.iterate-3.3.7-py2.7.egg/plone/app/iterate/tests/test_doctests.py
Python
py
858
no_license
# -*- coding: utf-8 -*- from plone.app.iterate.testing import PLONEAPPITERATE_FUNCTIONAL_TESTING from plone.app.iterate.testing import PLONEAPPITERATEDEX_FUNCTIONAL_TESTING from plone.testing import layered from unittest import TestSuite import doctest def test_suite(): suite = TestSuite() OPTIONFLAGS = (doc...
6aae0ca903a3f1b13bb84c963d3517a7b506feec
c5b92c926768877c0215fb04266673e34d5dc51a
gsergom/YouSet
/YouSet/modules/inpututils.py
Python
py
2,852
permissive
import re, sys, os from Bio.PDB import * def get_interactions_from_dir(input_dir): """Searches for files containing interactions between two PDB chains. Arguments: input_dir -- path to the directory containing the pdb interaction files. Returns: List with the input files that are identified as interactio...
de8b7cc9a2c6f2ce7965d94aa251d6448911267e
dd06ef4e760406e9f87202d4a1eb620bfd6298ea
supramolecular-toolkit/stk
/tests/serialization/json/to_json/case_data.py
Python
py
887
permissive
class CaseData: """ A test case. Attributes ---------- jsonizer : :class:`.MoleculeJsonizer` or \ :class:`.ConstructedMoleculeJsonizer` The jsonizer to test. molecule : :class:`.Molecule` The molecule to JSONize. json : :class:`dict` The JSON of :attr:`...
8bd1df4ee48048339acba0704f428a91a69bc159
7a719d1a140a33e95e9fd4e6c56862632da0481b
ewencluley/final-curtain
/manage.py
Python
py
632
no_license
#!/usr/bin/env python """Django's command-line utility for administrative tasks.""" import os import sys def main(): os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'finalcurtain.settings') try: from django.core.management import execute_from_command_line except ImportError as exc: raise I...
bb8f47be1d0b92ddfa03e6753818993dd45c318e
bcb64fcfc7f3215ce8714b824bf36a92c881e487
qiuyingyue/ONV2SEQ
/sketch_rnn_train_image.py
Python
py
20,994
no_license
# Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
4d9cd03ccd02a9a6ffefcf63729c667547e54dd8
caffdc9d808b042fa49aebfaab19b7530732d801
amarin/sphinxpapyrus-docxbuilder
/sphinxpapyrus/docxbuilder/nodes/acronym.py
Python
py
614
permissive
# -*- coding: utf-8 -*- """ Translate docutils node acronym formatting. each acronym start will processed with visit() and finished with depart() """ from docutils.nodes import Node from sphinxpapyrus.docxbuilder.translator import DocxTranslator node_name = "acronym" def visit(visitor: DocxTranslator, node: Node): ...
a52165040b767e2f6a28be2137afead9f41112ef
950f61c4bd8bcb9ad2766a998385aefd175756b1
lenzip/UserCode
/PyHLLJJ/HLLJJTemplateBoth_prod_eta47_vbf_noKinFit_cff.py
Python
py
37,608
no_license
import FWCore.ParameterSet.Config as cms from PhysicsTools.PatAlgos.tools.helpers import * import copy from HiggsAna.HLLJJCommon.cmdLine import options #options.parseArguments() options.selection = 'presel' #options.maxEvents = 100 options.output = "cmgTuple_newId_vbf.root" print options.selection runOnMC ...
e7ea2757085d4ebf4f0c42bab76c74599368b4f9
72db11a93e4988139cecd78ed053426cc6c9c787
Hackertreff-Reutte/Pager-Code-Chunks
/POCSAG WAV-file Decoder/squareWavDecoder.py
Python
py
1,189
no_license
from scipy.io import wavfile import matplotlib.pyplot as plt from functools import partial def filterVal(mini, maxi, x): if x >= mini + ((maxi - mini) / 3) * 2: return 1 elif x <= mini + (maxi - mini) / 3: return 0 else: return 0 samplerate, data = wavfile.read('/home/alex/aud...
03acd7a566547a009cc547ebd935a3c1ffbd073f
e098c778c770351538935fbb75b61d9677d9f8d8
spezifisch/leetcode-problems
/fibonacci-number/two.py
Python
py
1,207
no_license
class Solution: def __init__(self): self.cache = { 0: 0, 1: 1, 2: 1, 3: 2, 4: 3, 5: 5, 6: 8, 7: 13, 8: 21, 9: 34, 10: 55, 11: 89, 12: 144...
c626d6c160dd57d0624009ff122a91c3548ee91f
1ddce97e5e3084a25b9d44faf92528b1a5d77b77
Chrissimple/program-y
/src/programy/extensions/admin/properties.py
Python
py
2,779
permissive
""" Copyright (c) 2016-17 Keith Sterling http://www.keithsterling.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, mod...
aab6f6bd2a07012b65b5aaa37d49841cf818381f
2afaee2ff2c3ecc0573629497c48915d22c5957a
Mee321/a2c_hapg_storm
/envs.py
Python
py
6,645
no_license
import os import gym import numpy as np import torch from gym.spaces.box import Box from baselines import bench from baselines.common.vec_env import VecEnvWrapper from baselines.common.vec_env.dummy_vec_env import DummyVecEnv from baselines.common.vec_env.shmem_vec_env import ShmemVecEnv from baselines.common.vec_env...
76ad4fa1292f70b387f0fb8a708fa011b65c3de9
dc092ea1d18dacd930f2658bab223a48fd507725
ragnarr18/castle_apartments
/ProjectArnar/Project/settings.py
Python
py
3,135
no_license
""" Django settings for Project project. Generated by 'django-admin startproject' using Django 2.2.1. For more information on this file, see https://docs.djangoproject.com/en/2.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.2/ref/settings/ """ import os #...
6bad18bb9ea683d94ad60c4d87b6facb9dd6634b
7735d338f5aacc59fc0f5a72ab567cfad58a471f
katipallyvig8899/Innomatics_internship
/Day_4/Day4_Merge_The_Tools!.py
Python
py
334
no_license
def merge_the_tools(a,K): for n in range(len(a)//K): s = set([]) out = "" for i in range(K*n, K*(n+1)): if a[i] not in s: s.add(a[i]) out += a[i] print(out) if __name__ == '__main__': string, k = input(), int(input()) merge_the_too...
a88a6570e353190b2447e52c6e7ff601cc8a30c1
043e47125de00f04a737db503474bfc4acd36780
nadiinchi/TopicHierarchy
/model_class/Visualizator.py
Python
py
5,594
no_license
import numpy as np class Visualizator: """ Creates web-navigator on hierarchy H is an instance of HAPTM class (built model) titles_file is a path to file in specific format containing docs info links_file is a path to file in specific format containing links info """ def __init__(self...
044b5359f81a945c1f4c870562ed3eb22afd38cc
ef1fe8896882843b681f21fee1cc543baf09fa4d
robwoidi/ws_ur10e_hand
/build/franka_ros/catkin_generated/generate_cached_setup.py
Python
py
1,352
no_license
# -*- coding: utf-8 -*- from __future__ import print_function import os import stat import sys # find the import for catkin's python package - either from source space or from an installed underlay if os.path.exists(os.path.join('/opt/ros/noetic/share/catkin/cmake', 'catkinConfig.cmake.in')): sys.path.insert(0, o...
b85f0440d954cc78ded729826ca4771fca726b12
36db1d1743acae95a89df3eb0c81879502b109c9
PinkFIuffyUnicorn/Timathon
/Website/main/views.py
Python
py
1,876
no_license
import requests from django.shortcuts import render, redirect from django.http import HttpResponse from django.forms import inlineformset_factory from django.contrib.auth.forms import UserCreationForm # Messages import from django.contrib import messages # Authentication, login and logout imports from django.contri...