hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b37315c092291462fb88dadcb559cba929629c77 | 8,278 | py | Python | hr_little_api/builders.py | jwoo92/hr-little-api | 624c6054223cbc90ae6327e24236beebbc205fe6 | [
"Apache-2.0"
] | 9 | 2019-12-28T14:02:23.000Z | 2022-02-17T01:46:39.000Z | hr_little_api/builders.py | jwoo92/hr-little-api | 624c6054223cbc90ae6327e24236beebbc205fe6 | [
"Apache-2.0"
] | 2 | 2020-01-19T03:39:10.000Z | 2021-09-19T05:28:56.000Z | hr_little_api/builders.py | jwoo92/hr-little-api | 624c6054223cbc90ae6327e24236beebbc205fe6 | [
"Apache-2.0"
] | 5 | 2019-10-28T16:35:23.000Z | 2021-05-31T10:03:02.000Z | # Copyright 2019 Hanson Robotics Limited
#
# 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 i... | 32.719368 | 119 | 0.633366 |
1dd562f671e32ea1c8536d882815a94fa5b9041f | 5,560 | py | Python | arachniclient/__init__.py | catatonicprime/arachniclient | 2d56fbc0eafe8065f57f577fdae0f6c6ce11f02d | [
"MIT"
] | null | null | null | arachniclient/__init__.py | catatonicprime/arachniclient | 2d56fbc0eafe8065f57f577fdae0f6c6ce11f02d | [
"MIT"
] | null | null | null | arachniclient/__init__.py | catatonicprime/arachniclient | 2d56fbc0eafe8065f57f577fdae0f6c6ce11f02d | [
"MIT"
] | null | null | null | import requests
from requests.auth import HTTPBasicAuth
from io import StringIO
class Scan:
def __init__(self, scanId=None, scanOptions=None, client=None, scan=None):
self.id = scanId
self.scanOptions = scanOptions
self.client = client
self.scan = scan
def display(self):
... | 33.902439 | 100 | 0.580755 |
04afe43423b51cba2f37cdf5c2bd73a7f6c7806a | 6,422 | py | Python | PythonScripts/CS_Flux_Contours.py | UBC-MOAD/outputanalysisnotebooks | 50839cde3832d26bac6641427fed03c818fbe170 | [
"Apache-2.0"
] | null | null | null | PythonScripts/CS_Flux_Contours.py | UBC-MOAD/outputanalysisnotebooks | 50839cde3832d26bac6641427fed03c818fbe170 | [
"Apache-2.0"
] | null | null | null | PythonScripts/CS_Flux_Contours.py | UBC-MOAD/outputanalysisnotebooks | 50839cde3832d26bac6641427fed03c818fbe170 | [
"Apache-2.0"
] | null | null | null | ## generate colors of time dep phase and adv phase of CS transport and flux
from math import *
import matplotlib.pyplot as plt
import matplotlib.colors as mcolors
from netCDF4 import Dataset
import numpy as np
import os
import pandas as pd
import pylab as pl
import scipy.io
import scipy as spy
import seab... | 35.877095 | 143 | 0.654625 |
cad5ed227971641e5f84d2302241c76f1ddbcc49 | 93 | py | Python | common/determined_common/experimental/checkpoint/__init__.py | renedlog/determined | 7b1f2b1a845e4def17d489a5ad7592a2eaef0608 | [
"Apache-2.0"
] | null | null | null | common/determined_common/experimental/checkpoint/__init__.py | renedlog/determined | 7b1f2b1a845e4def17d489a5ad7592a2eaef0608 | [
"Apache-2.0"
] | 1 | 2022-02-10T07:31:44.000Z | 2022-02-10T07:31:44.000Z | common/determined_common/experimental/checkpoint/__init__.py | renedlog/determined | 7b1f2b1a845e4def17d489a5ad7592a2eaef0608 | [
"Apache-2.0"
] | null | null | null | from determined_common.experimental.checkpoint._checkpoint import Checkpoint, get_checkpoint
| 46.5 | 92 | 0.903226 |
7150c2407aa6de0fd10c10c62780152528827a4e | 999 | py | Python | animation/health.py | dansarno/pygame-pandemic-simulation | 24e4faa03538735552d189f1b5f286d80e25db4b | [
"MIT"
] | null | null | null | animation/health.py | dansarno/pygame-pandemic-simulation | 24e4faa03538735552d189f1b5f286d80e25db4b | [
"MIT"
] | null | null | null | animation/health.py | dansarno/pygame-pandemic-simulation | 24e4faa03538735552d189f1b5f286d80e25db4b | [
"MIT"
] | null | null | null | import tools
import numpy as np
configs = tools.load_yaml('config.yaml')
class Status:
def __init__(self, status, speed, frame_limit):
self.status = status
self.speed = speed
self.frame_limit = frame_limit
healthy = Status('healthy',
tools.random_between(configs['people... | 38.423077 | 87 | 0.617618 |
db326751a7e6439270937312ab34a121fd53e865 | 1,731 | py | Python | dn.py | abhijith0505/SimpDFS | 08a30ecf672a045a03bb9968c51d48ffe8a02542 | [
"MIT"
] | null | null | null | dn.py | abhijith0505/SimpDFS | 08a30ecf672a045a03bb9968c51d48ffe8a02542 | [
"MIT"
] | null | null | null | dn.py | abhijith0505/SimpDFS | 08a30ecf672a045a03bb9968c51d48ffe8a02542 | [
"MIT"
] | null | null | null | from xmlrpc.server import SimpleXMLRPCServer
from xmlrpc.server import SimpleXMLRPCRequestHandler
# TODO: Read from config file
BLOCK_STORE_PATH = "./blocks"
class RequestHandler(SimpleXMLRPCRequestHandler):
rpc_paths = ("/RPC2",)
def get_block_name(path, seq):
"""Return block id (name) for given file pat... | 27.47619 | 88 | 0.664934 |
d6b6e2dac5cbecb42f38e89971beef4bbcd9148e | 982 | py | Python | meteoservice/urls.py | berthakim/world-meteo-page | 6789ab8e571f6be64d250f0a60413fa5de5671d7 | [
"MIT"
] | null | null | null | meteoservice/urls.py | berthakim/world-meteo-page | 6789ab8e571f6be64d250f0a60413fa5de5671d7 | [
"MIT"
] | null | null | null | meteoservice/urls.py | berthakim/world-meteo-page | 6789ab8e571f6be64d250f0a60413fa5de5671d7 | [
"MIT"
] | null | null | null | """map_service URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-b... | 35.071429 | 80 | 0.720978 |
6046204381846cc3374129ab37cb3544833f8011 | 680 | py | Python | home.admin/config.scripts/lnd.unlock.py | johnzweng/raspiblitz | 8d6dad1b9895853d900f68b725144ec96f99da95 | [
"MIT"
] | 1 | 2020-05-01T22:40:16.000Z | 2020-05-01T22:40:16.000Z | home.admin/config.scripts/lnd.unlock.py | johnzweng/raspiblitz | 8d6dad1b9895853d900f68b725144ec96f99da95 | [
"MIT"
] | 1 | 2020-01-17T15:43:23.000Z | 2020-01-17T16:40:01.000Z | home.admin/config.scripts/lnd.unlock.py | johnzweng/raspiblitz | 8d6dad1b9895853d900f68b725144ec96f99da95 | [
"MIT"
] | 1 | 2021-03-04T05:44:34.000Z | 2021-03-04T05:44:34.000Z | # parameter #1: password c to unlock wallet
import base64
import codecs
import json
import requests
import sys
pw = sys.argv[1]
url = 'https://localhost:8080/v1/unlockwallet'
cert_path = '/mnt/hdd/lnd/tls.cert'
try:
pw_b64 = base64.b64encode(pw).decode()
except TypeError: # for Python3+
pw_b64 = base64.b64e... | 22.666667 | 67 | 0.7 |
e359dde2717d7fd3e0840f8a303f0af548431382 | 4,603 | py | Python | src/snowflake/connector/tool/dump_ocsp_response.py | jurecuhalev/snowflake-connector-python | c7b71e18111c16ffa8869855cd52c21e5b8e19d1 | [
"Apache-2.0"
] | 311 | 2017-01-06T03:02:10.000Z | 2022-03-28T12:39:10.000Z | src/snowflake/connector/tool/dump_ocsp_response.py | jurecuhalev/snowflake-connector-python | c7b71e18111c16ffa8869855cd52c21e5b8e19d1 | [
"Apache-2.0"
] | 720 | 2017-01-12T19:05:15.000Z | 2022-03-31T12:24:36.000Z | src/snowflake/connector/tool/dump_ocsp_response.py | jurecuhalev/snowflake-connector-python | c7b71e18111c16ffa8869855cd52c21e5b8e19d1 | [
"Apache-2.0"
] | 289 | 2017-02-02T00:01:41.000Z | 2022-03-19T06:01:23.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012-2021 Snowflake Computing Inc. All rights reserved.
#
import time
from os import path
from time import gmtime, strftime
from asn1crypto import ocsp as asn1crypto_ocsp
from snowflake.connector.compat import urlsplit
from snowflake.connector.ocsp_asn1... | 36.531746 | 88 | 0.6335 |
2e4d0ce16bd1dec25ccdf3b823e6ecf2fd6f5842 | 2,304 | py | Python | test/functional/p2p_pos_fakestake.py | smartblockscoin/smartblockscoin_src | 13bcb5953998e8a54533ac0a7bbb05a21bfc74d9 | [
"MIT"
] | null | null | null | test/functional/p2p_pos_fakestake.py | smartblockscoin/smartblockscoin_src | 13bcb5953998e8a54533ac0a7bbb05a21bfc74d9 | [
"MIT"
] | null | null | null | test/functional/p2p_pos_fakestake.py | smartblockscoin/smartblockscoin_src | 13bcb5953998e8a54533ac0a7bbb05a21bfc74d9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2019 The PIVX developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Covers the scenario of a PoS block where the coinstake input prevout is already spent.
'''
from time import sleep... | 39.050847 | 115 | 0.672743 |
d423fcf35ecc8e350befa4f0602d6c0322c2194b | 79 | py | Python | plugins/github/komand_github/actions/create_issue_comment/__init__.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 46 | 2019-06-05T20:47:58.000Z | 2022-03-29T10:18:01.000Z | plugins/github/komand_github/actions/create_issue_comment/__init__.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 386 | 2019-06-07T20:20:39.000Z | 2022-03-30T17:35:01.000Z | plugins/github/komand_github/actions/create_issue_comment/__init__.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 43 | 2019-07-09T14:13:58.000Z | 2022-03-28T12:04:46.000Z | # GENERATED BY KOMAND SDK - DO NOT EDIT
from .action import CreateIssueComment
| 26.333333 | 39 | 0.797468 |
07799efe7e42778f0cf3cc5b099bdb17f1f1b30d | 4,360 | py | Python | accounts/views.py | calvin620707/reservoir | f6d403a783cfb3b7e7091e7b1e57dee1d7f3cc46 | [
"MIT"
] | null | null | null | accounts/views.py | calvin620707/reservoir | f6d403a783cfb3b7e7091e7b1e57dee1d7f3cc46 | [
"MIT"
] | null | null | null | accounts/views.py | calvin620707/reservoir | f6d403a783cfb3b7e7091e7b1e57dee1d7f3cc46 | [
"MIT"
] | null | null | null | import logging
from django.contrib import messages
from django.http import HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from django.urls import reverse, reverse_lazy
from django.views import View
from django.views.generic import ListView, DetailView, DeleteView
from accounts.forms impor... | 36.638655 | 119 | 0.696101 |
7f044af4ff6ce0dde13e961c761b52da8c5878e3 | 993 | py | Python | test/test_statistics.py | kunakl07/AL-MLresearch | 5ab80169563e6cbe4de15aefa4bbfa09298795f9 | [
"MIT"
] | null | null | null | test/test_statistics.py | kunakl07/AL-MLresearch | 5ab80169563e6cbe4de15aefa4bbfa09298795f9 | [
"MIT"
] | null | null | null | test/test_statistics.py | kunakl07/AL-MLresearch | 5ab80169563e6cbe4de15aefa4bbfa09298795f9 | [
"MIT"
] | null | null | null | from keras.preprocessing.image import ImageDataGenerator
from sklearn.metrics import roc_curve
from sklearn.metrics import roc_auc_score
from matplotlib import pyplot
import tensorflow as tf
import statistics
import unittest
import random
img_width, img_height = 288, 432
test_datagen = ImageDataGenerator(rescale=1. /... | 28.371429 | 122 | 0.777442 |
daf03884e1ac982c1a8f1eea39109ce81fd6a379 | 1,373 | py | Python | TrekBot2_WS/build/hector_map_tools/catkin_generated/generate_cached_setup.py | Rafcin/RescueRoboticsLHMV | d3dc63e6c16a040b16170f143556ef358018b7da | [
"Unlicense"
] | 1 | 2018-10-04T14:37:00.000Z | 2018-10-04T14:37:00.000Z | TrekBot2_WS/build/hector_map_tools/catkin_generated/generate_cached_setup.py | Rafcin/TrekBot | d3dc63e6c16a040b16170f143556ef358018b7da | [
"Unlicense"
] | null | null | null | TrekBot2_WS/build/hector_map_tools/catkin_generated/generate_cached_setup.py | Rafcin/TrekBot | d3dc63e6c16a040b16170f143556ef358018b7da | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
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/melodic/share/catkin/cmake', 'catkinConfig.cmake.in')):
sys.... | 44.290323 | 108 | 0.74654 |
2bb7090fe81735f77b92afaf74bb235fe84903f8 | 1,478 | py | Python | settings.py | Vultik/KiCad-Diff | 8c8814c212f8d9beebc2e5731ff31586a03fa27e | [
"MIT"
] | null | null | null | settings.py | Vultik/KiCad-Diff | 8c8814c212f8d9beebc2e5731ff31586a03fa27e | [
"MIT"
] | null | null | null | settings.py | Vultik/KiCad-Diff | 8c8814c212f8d9beebc2e5731ff31586a03fa27e | [
"MIT"
] | null | null | null | import sys
from subprocess import PIPE, Popen
from typing import List, Tuple
args = ""
global verbose
global gitProg
global fossilProg
global svnProg
global diffProg
global grepProg
global plot_prog
global output_dir
global web_dir
verbose = 0
gitProg = "git"
fossilProg = "fossil"
svnProg = "svn"
diffProg = "di... | 18.948718 | 87 | 0.59134 |
f55613ca66cbc6caee64f560857978450cd17712 | 1,437 | py | Python | Exercises/Kattis/3_1_i_hate_the_number_nine.py | Gwarglemar/PythonExercises | 3261892dea4d51b320cde2ce8a47e67a67609d30 | [
"MIT"
] | 1 | 2019-05-04T04:49:17.000Z | 2019-05-04T04:49:17.000Z | Exercises/Kattis/3_1_i_hate_the_number_nine.py | Gwarglemar/Python | 3261892dea4d51b320cde2ce8a47e67a67609d30 | [
"MIT"
] | null | null | null | Exercises/Kattis/3_1_i_hate_the_number_nine.py | Gwarglemar/Python | 3261892dea4d51b320cde2ce8a47e67a67609d30 | [
"MIT"
] | null | null | null | #for T test cases, each consisting of an integer D, how many numbers are there of D digits that DO NOT contain any 9's?
#sounds weird at first, but I think it's super simple; the difficulty of this primarily comes from the problem of efficiency, in that you have to compute results with large values for D in under 1 se... | 41.057143 | 233 | 0.627001 |
f1f812275c8763641044393451d5247a69623303 | 121 | py | Python | pycode3/elif.py | v-sukt/misc_code | ac5ea0a55a070c88c410d14511c25d332fc675d5 | [
"Apache-2.0"
] | null | null | null | pycode3/elif.py | v-sukt/misc_code | ac5ea0a55a070c88c410d14511c25d332fc675d5 | [
"Apache-2.0"
] | null | null | null | pycode3/elif.py | v-sukt/misc_code | ac5ea0a55a070c88c410d14511c25d332fc675d5 | [
"Apache-2.0"
] | null | null | null | day="Tuesday"
if day=="Monday":
print("Sunny")
elif day=="Tuesday":
print("Cloudy")
else:
print("Rainy!")
| 15.125 | 20 | 0.578512 |
233f99a6c7825102ce3818e81f325bafff215abb | 6,904 | py | Python | caravel/config.py | JoeBrody/Caravel | fc1e63761cc86a5673433b0e2efc0081325684d3 | [
"Apache-2.0"
] | null | null | null | caravel/config.py | JoeBrody/Caravel | fc1e63761cc86a5673433b0e2efc0081325684d3 | [
"Apache-2.0"
] | null | null | null | caravel/config.py | JoeBrody/Caravel | fc1e63761cc86a5673433b0e2efc0081325684d3 | [
"Apache-2.0"
] | null | null | null | """The main config file for Caravel
All configuration in this file can be overridden by providing a caravel_config
in your PYTHONPATH as there is a ``from caravel_config import *``
at the end of this file.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
... | 31.962963 | 81 | 0.637457 |
8d94c972cf4c2bcb45385ec0527d1cda31cd8e64 | 178 | py | Python | rename_firmware.py | Domochip/WirelessTeleInfo | de3a102a243ed62f59b8e26e92527a03253679a2 | [
"CC-BY-3.0"
] | 18 | 2019-07-03T15:46:47.000Z | 2021-11-24T09:35:07.000Z | rename_firmware.py | Domochip/Wireless-TeleInfo | 73cb27d8035635d4fd43aecab1bea120f048a898 | [
"CC-BY-3.0"
] | 3 | 2019-07-29T11:58:44.000Z | 2022-03-04T21:31:25.000Z | rename_firmware.py | Domochip/Wireless-TeleInfo | 73cb27d8035635d4fd43aecab1bea120f048a898 | [
"CC-BY-3.0"
] | 7 | 2019-12-28T18:55:45.000Z | 2021-09-06T14:29:13.000Z | Import("env")
my_flags = env.ParseFlags(env['BUILD_FLAGS'])
defines = {k: v for (k, v) in my_flags.get("CPPDEFINES")}
# print defines
env.Replace(PROGNAME=defines.get("MODEL")) | 25.428571 | 57 | 0.707865 |
ccb72b67893f092ece864160a4c2429514eb3bad | 3,870 | py | Python | covid19_cali.py | wjma98/covid19-stats | c7ecd174a146fd8902db9f2fade58aaacc0ab309 | [
"MIT"
] | null | null | null | covid19_cali.py | wjma98/covid19-stats | c7ecd174a146fd8902db9f2fade58aaacc0ab309 | [
"MIT"
] | null | null | null | covid19_cali.py | wjma98/covid19-stats | c7ecd174a146fd8902db9f2fade58aaacc0ab309 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Jan 20 14:42:01 2021
@author: William
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy.interpolate import UnivariateSpline
import pandas as pd
import matplotlib.dates as mdates
import datetime as dt
# Parsing .csv data from NYT to find total deaths. starts... | 32.25 | 86 | 0.710594 |
0228276a92c6a30f5b0e37fbcfa61081060a1750 | 2,052 | py | Python | docs/auto_aim.py | mbway/game-jam-2018 | 00ea01d0eb697ceddba009034351f859dba98ab5 | [
"MIT"
] | null | null | null | docs/auto_aim.py | mbway/game-jam-2018 | 00ea01d0eb697ceddba009034351f859dba98ab5 | [
"MIT"
] | null | null | null | docs/auto_aim.py | mbway/game-jam-2018 | 00ea01d0eb697ceddba009034351f859dba98ab5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as plt
from numpy import pi
def main():
fig, (ax1, ax2) = plt.subplots(2, 1, figsize=(12, 10))
x = np.linspace(-pi*0.75, pi*0.75, num=200)
start_influence = 0.1 # [0,1]
max_influence = 0.8 # [0,1]
start_diff = 1 # rad
def in... | 34.779661 | 101 | 0.648635 |
c8c0b92b08e56d896cadb4bc53d2c88b77b07ac4 | 730 | py | Python | complex_venv/lib/python3.7/site-packages/shexer/io/graph/yielder/multi_tsv_nt_triples_yielder.py | lubianat/complex_bot | e0ddabcc0487c52b14fb94950c5a812f0bdb2283 | [
"MIT"
] | 1 | 2021-10-06T00:21:10.000Z | 2021-10-06T00:21:10.000Z | complex_venv/lib/python3.7/site-packages/shexer/io/graph/yielder/multi_tsv_nt_triples_yielder.py | lubianat/complex_bot | e0ddabcc0487c52b14fb94950c5a812f0bdb2283 | [
"MIT"
] | 14 | 2021-01-15T21:51:38.000Z | 2021-11-10T10:08:22.000Z | complex_venv/lib/python3.7/site-packages/shexer/io/graph/yielder/multi_tsv_nt_triples_yielder.py | lubianat/complex_bot | e0ddabcc0487c52b14fb94950c5a812f0bdb2283 | [
"MIT"
] | 1 | 2021-01-18T10:32:56.000Z | 2021-01-18T10:32:56.000Z | from shexer.io.graph.yielder.tsv_nt_triples_yielder import TsvNtTriplesYielder
from shexer.io.graph.yielder.multifile_base_triples_yielder import MultifileBaseTripleYielder
class MultiTsvNtTriplesYielder(MultifileBaseTripleYielder):
def __init__(self, list_of_files, allow_untyped_numbers=False):
s... | 52.142857 | 100 | 0.735616 |
c9b41a18d6999c394bf2e2c0547ad118721dde2e | 5,064 | py | Python | paddlenlp/ops/faster_transformer/sample/plato_export_model_sample.py | d294270681/PaddleNLP | 76385a79ce835049aae3975f882baf8bcd1c65fc | [
"Apache-2.0"
] | null | null | null | paddlenlp/ops/faster_transformer/sample/plato_export_model_sample.py | d294270681/PaddleNLP | 76385a79ce835049aae3975f882baf8bcd1c65fc | [
"Apache-2.0"
] | null | null | null | paddlenlp/ops/faster_transformer/sample/plato_export_model_sample.py | d294270681/PaddleNLP | 76385a79ce835049aae3975f882baf8bcd1c65fc | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2022 PaddlePaddle 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 appli... | 31.65 | 122 | 0.627962 |
a8530918efd50d913e9c772cbec2116431927d98 | 26,674 | py | Python | src/robusta/integrations/kubernetes/autogenerated/events.py | pavangudiwada/robusta | cc1cb8a2e198f404e275a3947cf64e9f700f56f4 | [
"MIT"
] | 273 | 2021-12-28T20:48:48.000Z | 2022-03-31T16:03:13.000Z | src/robusta/integrations/kubernetes/autogenerated/events.py | pavangudiwada/robusta | cc1cb8a2e198f404e275a3947cf64e9f700f56f4 | [
"MIT"
] | 103 | 2022-01-10T11:45:47.000Z | 2022-03-31T16:31:11.000Z | src/robusta/integrations/kubernetes/autogenerated/events.py | pavangudiwada/robusta | cc1cb8a2e198f404e275a3947cf64e9f700f56f4 | [
"MIT"
] | 35 | 2021-12-30T15:30:14.000Z | 2022-03-28T11:43:57.000Z | # This file was autogenerated. Do not edit.
import logging
import traceback
from dataclasses import dataclass
from abc import abstractmethod
from hikaru.model import Pod,ReplicaSet,DaemonSet,Deployment,StatefulSet,Service,Event,HorizontalPodAutoscaler,Node,ClusterRole,ClusterRoleBinding,Job,Namespace,ServiceAccount,Pe... | 42.272583 | 726 | 0.768464 |
d5c00b12f31d47c39358bb04cef918a333106eba | 2,727 | py | Python | src/phantomx_gazebo/phantomx.py | kkonen/phantomx_gazebo | 19f5d5735e15aa3cc1bbd2c051d6f7024862752e | [
"BSD-2-Clause-FreeBSD"
] | 30 | 2015-04-01T16:55:56.000Z | 2022-01-13T00:02:36.000Z | src/phantomx_gazebo/phantomx.py | kkonen/phantomx_gazebo | 19f5d5735e15aa3cc1bbd2c051d6f7024862752e | [
"BSD-2-Clause-FreeBSD"
] | 2 | 2015-07-30T12:47:51.000Z | 2019-03-09T21:27:25.000Z | src/phantomx_gazebo/phantomx.py | kkonen/phantomx_gazebo | 19f5d5735e15aa3cc1bbd2c051d6f7024862752e | [
"BSD-2-Clause-FreeBSD"
] | 21 | 2015-07-30T09:36:41.000Z | 2021-12-20T14:59:13.000Z | import rospy
import time
from geometry_msgs.msg import Twist
from sensor_msgs.msg import JointState
from std_msgs.msg import Float64
class PhantomX:
"""Client ROS class for manipulating PhantomX in Gazebo"""
def __init__(self, ns='/phantomx/'):
self.ns = ns
self.joints = None
self.ang... | 28.705263 | 80 | 0.569124 |
e0d2885f1e95069a1e7859d88d3edf8cca939904 | 542 | py | Python | test_cluster_response_time.py | qikiqi/docker-filebeat | ad7e75b8553b00be32a65bc54878f23c82728290 | [
"MIT"
] | null | null | null | test_cluster_response_time.py | qikiqi/docker-filebeat | ad7e75b8553b00be32a65bc54878f23c82728290 | [
"MIT"
] | null | null | null | test_cluster_response_time.py | qikiqi/docker-filebeat | ad7e75b8553b00be32a65bc54878f23c82728290 | [
"MIT"
] | null | null | null | import requests
import pprint as pp
import sys
times = int(sys.argv[2])
for i in range(times):
headers = {
'Content-Type': 'application/json',
}
data = '{"profile": true,"query" : {"match" : { "ts_date" : "20180315" }}}'
response = requests.post('http://elastic:changeme@{}:9200/filebeat/_sea... | 30.111111 | 139 | 0.632841 |
ec714c22711073ec04c038d3d96c587f0113613b | 888 | py | Python | toolset/utils/audit.py | xsoheilalizadeh/FrameworkBenchmarks | 855527008f7488e4fd508d1e72dfa9953874a2c6 | [
"BSD-3-Clause"
] | 5,300 | 2015-01-02T08:04:20.000Z | 2022-03-31T10:08:33.000Z | toolset/utils/audit.py | xsoheilalizadeh/FrameworkBenchmarks | 855527008f7488e4fd508d1e72dfa9953874a2c6 | [
"BSD-3-Clause"
] | 3,075 | 2015-01-01T05:11:45.000Z | 2022-03-31T23:56:33.000Z | toolset/utils/audit.py | xsoheilalizadeh/FrameworkBenchmarks | 855527008f7488e4fd508d1e72dfa9953874a2c6 | [
"BSD-3-Clause"
] | 2,151 | 2015-01-02T14:16:09.000Z | 2022-03-30T00:15:26.000Z | from toolset.utils.output_helper import log
from colorama import Fore
class Audit:
'''
Audits frameworks for inconsistencies
'''
def __init__(self, benchmarker):
self.benchmarker = benchmarker
def start_audit(self):
for lang in self.benchmarker.metadata.gather_languages():
... | 28.645161 | 76 | 0.618243 |
27780476e04d4f37214826072debd6e66845bce3 | 2,675 | py | Python | src/robotide/lib/robot/running/arguments/argumentspec.py | adrianyorke/RIDE | b7db7fb376276add0cb1d7b0ee9cf89500d0d26d | [
"ECL-2.0",
"Apache-2.0"
] | 775 | 2015-01-12T06:54:09.000Z | 2022-03-25T05:18:05.000Z | src/robotide/lib/robot/running/arguments/argumentspec.py | adrianyorke/RIDE | b7db7fb376276add0cb1d7b0ee9cf89500d0d26d | [
"ECL-2.0",
"Apache-2.0"
] | 2,191 | 2015-05-19T16:49:09.000Z | 2022-03-28T21:38:34.000Z | src/robotide/lib/robot/running/arguments/argumentspec.py | adrianyorke/RIDE | b7db7fb376276add0cb1d7b0ee9cf89500d0d26d | [
"ECL-2.0",
"Apache-2.0"
] | 382 | 2015-01-24T08:41:44.000Z | 2022-03-13T10:14:20.000Z | # Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework 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
... | 37.152778 | 79 | 0.687103 |
545b89cb60838d6339ab1852e4e7eb46c1590184 | 751 | py | Python | pubsubat/urls.py | zerobased-co/pubsub.at | c53ee698d3d2beced0147a8aa9707f69c3ef46c1 | [
"MIT"
] | null | null | null | pubsubat/urls.py | zerobased-co/pubsub.at | c53ee698d3d2beced0147a8aa9707f69c3ef46c1 | [
"MIT"
] | null | null | null | pubsubat/urls.py | zerobased-co/pubsub.at | c53ee698d3d2beced0147a8aa9707f69c3ef46c1 | [
"MIT"
] | null | null | null | from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, include, re_path
from django.views.decorators.csrf import csrf_exempt
from graphene_django.views import GraphQLView
from graphql_playground.views import GraphQLPlaygroundView
from ... | 32.652174 | 80 | 0.778961 |
85b5fa38d032e98644a4822963580067d3151834 | 213 | py | Python | bitdotio/api/__init__.py | bitdotioinc/python-bitdotio | acdc58e34c047a4fda9cee557bf3851f6cfec71e | [
"MIT"
] | 6 | 2021-03-03T21:56:28.000Z | 2022-02-16T09:03:20.000Z | bitdotio/api/__init__.py | bitdotioinc/python-bitdotio | acdc58e34c047a4fda9cee557bf3851f6cfec71e | [
"MIT"
] | 4 | 2021-06-14T17:58:12.000Z | 2021-09-23T17:27:20.000Z | bitdotio/api/__init__.py | bitdotioinc/python-bitdotio | acdc58e34c047a4fda9cee557bf3851f6cfec71e | [
"MIT"
] | null | null | null | # do not import all apis into this module because that uses a lot of memory and stack frames
# if you need the ability to import all apis from one package, import them with
# from bitdotio.apis import ApiBitdotio
| 53.25 | 92 | 0.788732 |
27578770d6c55e6e0e95254bfa3776b3444a6e59 | 3,885 | py | Python | tests/test_plugin_utils.py | hymer-up/streamlink | f09bf6e04cddc78eceb9ded655f716ef3ee4b84f | [
"BSD-2-Clause"
] | 1 | 2020-06-19T08:34:23.000Z | 2020-06-19T08:34:23.000Z | tests/test_plugin_utils.py | hymer-up/streamlink | f09bf6e04cddc78eceb9ded655f716ef3ee4b84f | [
"BSD-2-Clause"
] | 1 | 2021-01-16T14:13:39.000Z | 2022-02-09T10:43:44.000Z | tests/test_plugin_utils.py | hymer-up/streamlink | f09bf6e04cddc78eceb9ded655f716ef3ee4b84f | [
"BSD-2-Clause"
] | 1 | 2020-07-11T22:09:07.000Z | 2020-07-11T22:09:07.000Z | from __future__ import unicode_literals
import sys
import unittest
from streamlink.plugin.api.utils import itertags
def unsupported_versions_1979():
"""Unsupported python versions for itertags
3.7.0 - 3.7.2 and 3.8.0a1
- https://github.com/streamlink/streamlink/issues/1979
- https://bugs.pyt... | 38.088235 | 111 | 0.606435 |
fb32e014506e69ab0680016bfe499f6bb686f32c | 272 | py | Python | ch02/perceptron-nand.py | nobukatsu/deep-learning-from-scratch | 34e4b3e90aa2a3c34369653e75ae17a5a092ca94 | [
"MIT"
] | null | null | null | ch02/perceptron-nand.py | nobukatsu/deep-learning-from-scratch | 34e4b3e90aa2a3c34369653e75ae17a5a092ca94 | [
"MIT"
] | null | null | null | ch02/perceptron-nand.py | nobukatsu/deep-learning-from-scratch | 34e4b3e90aa2a3c34369653e75ae17a5a092ca94 | [
"MIT"
] | null | null | null | import numpy as np
def NAND(x1, x2):
x = np.array([x1, x2])
w = np.array([-0.5, -0.5])
b = 0.7
tmp = np.sum(w*x) + b
if tmp <= 0:
return 0
elif tmp > 0:
return 1
print(NAND(0,0))
print(NAND(1,0))
print(NAND(0,1))
print(NAND(1,1))
| 16 | 30 | 0.5 |
e6e28ca269021cacbcf2ade0db64a484215f2339 | 338 | py | Python | src/ufdl/json/core/jobs/_ValueTypePair.py | waikato-ufdl/ufdl-json-messages | 408901bdf79aa9ae7cff1af165deee83e62f6088 | [
"Apache-2.0"
] | null | null | null | src/ufdl/json/core/jobs/_ValueTypePair.py | waikato-ufdl/ufdl-json-messages | 408901bdf79aa9ae7cff1af165deee83e62f6088 | [
"Apache-2.0"
] | null | null | null | src/ufdl/json/core/jobs/_ValueTypePair.py | waikato-ufdl/ufdl-json-messages | 408901bdf79aa9ae7cff1af165deee83e62f6088 | [
"Apache-2.0"
] | null | null | null | from wai.json.object import StrictJSONObject
from wai.json.object.property import StringProperty
class ValueTypePair(StrictJSONObject['ValueTypePair']):
"""
A pair of a value and its type.
"""
# The value passed to the input
value: str = StringProperty()
# The type of the value
type: str ... | 26 | 55 | 0.704142 |
f9ed5011ffef37009b331790110e40710d0507c9 | 5,241 | py | Python | conda_env/cli/main_create.py | cswartzvi/conda | b2e0ed6b6119b7623d8f64c47d4d04f56e9cf137 | [
"BSD-3-Clause"
] | null | null | null | conda_env/cli/main_create.py | cswartzvi/conda | b2e0ed6b6119b7623d8f64c47d4d04f56e9cf137 | [
"BSD-3-Clause"
] | null | null | null | conda_env/cli/main_create.py | cswartzvi/conda | b2e0ed6b6119b7623d8f64c47d4d04f56e9cf137 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import print_function
from argparse import RawDescriptionHelpFormatter
import json
import os
import sys
import textwrap
from conda.cli import install as cli_install
from conda.cli.conda_argparse import a... | 32.351852 | 95 | 0.64606 |
799242c9b74ad450c42183aa61805b0f4f3eb789 | 40,293 | py | Python | test/functional/p2p_compactblocks.py | alexander3636/btcbam-core-1 | 2565b3b110d049e8f188b57ea42e84466f307f35 | [
"MIT"
] | 6 | 2021-08-02T21:35:10.000Z | 2022-01-18T05:41:49.000Z | test/functional/p2p_compactblocks.py | alexander3636/btcbam-core-1 | 2565b3b110d049e8f188b57ea42e84466f307f35 | [
"MIT"
] | null | null | null | test/functional/p2p_compactblocks.py | alexander3636/btcbam-core-1 | 2565b3b110d049e8f188b57ea42e84466f307f35 | [
"MIT"
] | 4 | 2021-08-14T13:12:43.000Z | 2021-11-26T21:19:35.000Z | #!/usr/bin/env python3
# Copyright (c) 2016-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test compact blocks (BIP 152).
Version 1 compact blocks are pre-segwit (txids)
Version 2 compact block... | 46.635417 | 500 | 0.672276 |
7bc85d9f7f27f7dc9c69edc5ef90853576f69591 | 10,271 | py | Python | datumaro/plugins/icdar_format/extractor.py | certiware/posemaro | 3f9bed71dd4a1053ea27bed1a85f2ff01fdcf800 | [
"MIT"
] | null | null | null | datumaro/plugins/icdar_format/extractor.py | certiware/posemaro | 3f9bed71dd4a1053ea27bed1a85f2ff01fdcf800 | [
"MIT"
] | null | null | null | datumaro/plugins/icdar_format/extractor.py | certiware/posemaro | 3f9bed71dd4a1053ea27bed1a85f2ff01fdcf800 | [
"MIT"
] | 1 | 2021-06-20T05:29:48.000Z | 2021-06-20T05:29:48.000Z | # Copyright (C) 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
from glob import iglob
import os.path as osp
import numpy as np
from datumaro.components.extractor import (
Bbox, Caption, DatasetItem, Importer, Mask, MaskCategories, Polygon,
SourceExtractor,
)
from datumaro.util.image import find_imag... | 38.040741 | 86 | 0.489242 |
d4a8a2d9facc33082b8449beec0957f3ceb1b91c | 25,100 | py | Python | electrum_ltc/base_wizard.py | vivekteega/electrum-flo | 8278132246b2dc9a253ec94b97de746771ef01be | [
"MIT"
] | null | null | null | electrum_ltc/base_wizard.py | vivekteega/electrum-flo | 8278132246b2dc9a253ec94b97de746771ef01be | [
"MIT"
] | null | null | null | electrum_ltc/base_wizard.py | vivekteega/electrum-flo | 8278132246b2dc9a253ec94b97de746771ef01be | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2016 Thomas Voegtlin
#
# 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 witho... | 43.957968 | 174 | 0.594542 |
8ce8f6d4728baf847887814122e864445c89a24c | 3,208 | py | Python | extractm5.py | zohan180/gem5_tca | 97102622927dbcce4cf4e43268780eadbbc1e31e | [
"BSD-3-Clause"
] | null | null | null | extractm5.py | zohan180/gem5_tca | 97102622927dbcce4cf4e43268780eadbbc1e31e | [
"BSD-3-Clause"
] | null | null | null | extractm5.py | zohan180/gem5_tca | 97102622927dbcce4cf4e43268780eadbbc1e31e | [
"BSD-3-Clause"
] | null | null | null | import os
import sys
walk_dir = sys.argv[1]
print('walk_dir = ' + walk_dir)
stringlist=[]
#stringlist.append("system.cpu.iq.fu_full::FloatMult")
stringlist.append("Multiplied 123 submatrices")
# stringlist.append("system.cpu.rob.rob_Access_Usage::mean")
# stringlist.append("system.cpu.rename.serializeStallCycles")... | 36.873563 | 138 | 0.65586 |
07de0baf8d9090ba259060f3e58b38fdd4b16883 | 1,245 | py | Python | test/it/fakebintray.py | uk-gov-mirror/hmrc.service-manager | 6d6fcc4a1d25d094e7d0c798fc4219cf20a6f234 | [
"Apache-2.0"
] | 52 | 2015-02-04T21:09:11.000Z | 2022-02-23T15:48:06.000Z | test/it/fakebintray.py | uk-gov-mirror/hmrc.service-manager | 6d6fcc4a1d25d094e7d0c798fc4219cf20a6f234 | [
"Apache-2.0"
] | 57 | 2015-01-08T10:17:16.000Z | 2021-11-18T14:56:51.000Z | test/it/fakebintray.py | uk-gov-mirror/hmrc.service-manager | 6d6fcc4a1d25d094e7d0c798fc4219cf20a6f234 | [
"Apache-2.0"
] | 50 | 2015-02-02T16:12:13.000Z | 2021-11-13T09:19:32.000Z | #!/usr/bin/python
from bottle import route, run, request
from bottle import static_file
MAVEN_METADATA = """<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>uk.gov.hmrc</groupId>
<artifactId>help-frontend_2.11</artifactId>
<version>1.26.0-3-gd7ed03c</version>
<versioning>
<latest>1.26.0-3-gd7ed0... | 27.666667 | 118 | 0.704418 |
b60a588279aa6608775edf8b7311008f37d193e8 | 3,231 | py | Python | extensions/rules/tar_file_string.py | aldeka/oppia | aead304c95a282c9ca8035bc25c4794864d07578 | [
"Apache-2.0"
] | 3 | 2015-01-10T23:45:23.000Z | 2015-02-17T10:46:08.000Z | extensions/rules/tar_file_string.py | aldeka/oppia | aead304c95a282c9ca8035bc25c4794864d07578 | [
"Apache-2.0"
] | null | null | null | extensions/rules/tar_file_string.py | aldeka/oppia | aead304c95a282c9ca8035bc25c4794864d07578 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | 31.676471 | 79 | 0.648406 |
19341549f97f506e1ec83003e62998a371bf7e10 | 1,621 | py | Python | examples/rnp_gen.py | pernici/hobj | ccd3e49dd3c7eaf656de9b3f8f041c687f824be6 | [
"BSD-3-Clause"
] | 1 | 2020-04-18T18:33:27.000Z | 2020-04-18T18:33:27.000Z | examples/rnp_gen.py | pernici/hobj | ccd3e49dd3c7eaf656de9b3f8f041c687f824be6 | [
"BSD-3-Clause"
] | null | null | null | examples/rnp_gen.py | pernici/hobj | ccd3e49dd3c7eaf656de9b3f8f041c687f824be6 | [
"BSD-3-Clause"
] | null | null | null | import sys
sys.path.insert(0,'../src')
from hobj import Hobj
from densearith import dup_add
from compatibility import itervalues
def get_sum(p, K):
"""
nv from p for rectangle non periodic
"""
nv = []
for v in itervalues(p):
nv = dup_add(nv, v, K)
return nv
def nv_r_nx_ny_np_rec(ny, K)... | 23.157143 | 73 | 0.502776 |
bc12113e874219b18176a585f6b260ba41a9da80 | 924 | py | Python | scripts/plot_primitives.py | personalrobotics/herbpy | ab48e9190b061759b31bc9c879a7f96a51d975f5 | [
"BSD-3-Clause"
] | 4 | 2017-03-04T06:18:21.000Z | 2019-01-04T08:03:41.000Z | scripts/plot_primitives.py | personalrobotics/herbpy | ab48e9190b061759b31bc9c879a7f96a51d975f5 | [
"BSD-3-Clause"
] | 87 | 2015-01-30T03:50:35.000Z | 2017-02-20T18:55:42.000Z | scripts/plot_primitives.py | personalrobotics/herbpy | ab48e9190b061759b31bc9c879a7f96a51d975f5 | [
"BSD-3-Clause"
] | 10 | 2015-07-29T13:13:05.000Z | 2019-02-13T22:11:24.000Z | #!/usr/bin/env python
import argparse, yaml
import matplotlib.pyplot as plt
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="Plot the primitives in a primitives file")
parser.add_argument('--filename', type=str, default='base_planner_parameters.yaml')
args = parser.parse_args()
... | 28 | 92 | 0.577922 |
48e1224189be745b9783db0fe288fc49aaaa514d | 7,490 | py | Python | onlineassessmentsystem/submissions/views.py | jwalit21/SDP_Online_Assessment_System | a778a0e0ae264fe74037a5f0b210d205ebc18d98 | [
"MIT"
] | 1 | 2021-03-05T12:28:36.000Z | 2021-03-05T12:28:36.000Z | onlineassessmentsystem/submissions/views.py | jwalit21/SDP_Online_Assessment_System | a778a0e0ae264fe74037a5f0b210d205ebc18d98 | [
"MIT"
] | null | null | null | onlineassessmentsystem/submissions/views.py | jwalit21/SDP_Online_Assessment_System | a778a0e0ae264fe74037a5f0b210d205ebc18d98 | [
"MIT"
] | null | null | null | import datetime
import json
import os
from urllib.parse import urlencode
import pytz
import requests
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.core.exceptions import ObjectDoesNotExist
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
... | 33.587444 | 120 | 0.68024 |
db2d13ed1d2b15e81291da4ffc3868b9f6040fd9 | 17,609 | py | Python | objectModel/Python/tests/cdm/projection/test_projection_add_supporting_attribute.py | rt112000/CDM | 34bd34f9260140a8f8aa02bd87c23033f3daad4c | [
"CC-BY-4.0",
"MIT"
] | 884 | 2019-05-10T02:09:10.000Z | 2022-03-31T14:02:00.000Z | objectModel/Python/tests/cdm/projection/test_projection_add_supporting_attribute.py | rt112000/CDM | 34bd34f9260140a8f8aa02bd87c23033f3daad4c | [
"CC-BY-4.0",
"MIT"
] | 171 | 2019-06-10T11:34:37.000Z | 2022-03-31T22:50:12.000Z | objectModel/Python/tests/cdm/projection/test_projection_add_supporting_attribute.py | rt112000/CDM | 34bd34f9260140a8f8aa02bd87c23033f3daad4c | [
"CC-BY-4.0",
"MIT"
] | 340 | 2019-05-07T18:00:16.000Z | 2022-03-31T12:00:15.000Z | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
import os
import unittest
from typing import TYPE_CHECKING
from cdm.enums import CdmObjectType
from cdm.objectmodel import CdmCorpusDefinition, CdmEntityDefinition... | 60.098976 | 147 | 0.734965 |
84cb8e0a9b6506e913fd8bd37fab9f2d7f8319fe | 251 | py | Python | Networking/Packets/Outgoing/ShowAllyShootPacket.py | dot1991/pyrelay | 2f0a6e55c54938b1a75afea257d77f5e6a2d51c3 | [
"MIT"
] | null | null | null | Networking/Packets/Outgoing/ShowAllyShootPacket.py | dot1991/pyrelay | 2f0a6e55c54938b1a75afea257d77f5e6a2d51c3 | [
"MIT"
] | null | null | null | Networking/Packets/Outgoing/ShowAllyShootPacket.py | dot1991/pyrelay | 2f0a6e55c54938b1a75afea257d77f5e6a2d51c3 | [
"MIT"
] | null | null | null | class ShowAllyShootPacket:
def __init__(self):
self.type = "SHOWALLYSHOOT"
self.toggle = 0
def write(self, writer):
writer.writeInt32(self.toggle)
def read(self, reader):
self.toggle = reader.writeInt32()
| 22.818182 | 41 | 0.629482 |
e4fd0674ee69114a6cd2bdcda409f1d6750b9364 | 3,090 | py | Python | app/db_methods.py | Stanley-Okwii/send-it-api | c86654e828e64b5f39db4ed5fad1e8889c14c6a2 | [
"Apache-2.0"
] | null | null | null | app/db_methods.py | Stanley-Okwii/send-it-api | c86654e828e64b5f39db4ed5fad1e8889c14c6a2 | [
"Apache-2.0"
] | 1 | 2018-11-11T11:35:43.000Z | 2018-11-11T11:35:43.000Z | app/db_methods.py | Stanley-Okwii/send-it-api | c86654e828e64b5f39db4ed5fad1e8889c14c6a2 | [
"Apache-2.0"
] | 1 | 2018-11-11T11:32:06.000Z | 2018-11-11T11:32:06.000Z | from app.models import DataModel
from datetime import datetime
from pytz import timezone
db_connect = DataModel()
cursor = db_connect.cursor
dictcur = db_connect.dict_cursor
def register_new_user(data):
"""registers a new user"""
query = "INSERT INTO users(username, email, password, role) \
VALUES('{... | 30 | 87 | 0.600647 |
d62e1351ebac5c8ee472e1d1b280f4c6faa778f2 | 4,062 | py | Python | testcases/pytorch/fast_neural_style.py | shinh/chainer-compiler | 2a5e0bfd3f1abd7258a4cbffcfab79bc1d28f9e9 | [
"MIT"
] | 116 | 2019-01-25T03:54:44.000Z | 2022-03-08T00:11:14.000Z | testcases/pytorch/fast_neural_style.py | shinh/chainer-compiler | 2a5e0bfd3f1abd7258a4cbffcfab79bc1d28f9e9 | [
"MIT"
] | 431 | 2019-01-25T10:18:44.000Z | 2020-06-17T05:28:55.000Z | testcases/pytorch/fast_neural_style.py | momohatt/chainer-compiler | 26782cd29a5becf8e2badf268b47d98b3a6aea1d | [
"MIT"
] | 26 | 2019-01-25T07:21:09.000Z | 2021-11-26T04:24:35.000Z | # Original: https://github.com/pytorch/examples/blob/490243127c02a5ea3348fa4981ecd7e9bcf6144c/fast_neural_style/neural_style/transformer_net.py
import torch
class TransformerNet(torch.nn.Module):
def __init__(self):
super(TransformerNet, self).__init__()
# Initial convolution layers
self.... | 37.266055 | 143 | 0.65288 |
6e39f7294a2d2c59632272eb6e6cd8c97c93fc6d | 87 | py | Python | project/twittr/apps.py | evrom/django-example-for-class | c53b9e0ffe01014efa1229255887fc23b810d265 | [
"MIT"
] | 1 | 2017-10-27T14:22:27.000Z | 2017-10-27T14:22:27.000Z | project/twittr/apps.py | evrom/django-example-for-class | c53b9e0ffe01014efa1229255887fc23b810d265 | [
"MIT"
] | null | null | null | project/twittr/apps.py | evrom/django-example-for-class | c53b9e0ffe01014efa1229255887fc23b810d265 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class TwittrConfig(AppConfig):
name = 'twittr'
| 14.5 | 33 | 0.747126 |
8eff933ff7c025841ca792783960e7e73d780d6a | 14,780 | py | Python | tests/test_mail.py | agdsn/sipa | a733bce0a54ad3a79732de82e7f32b35bd87d4e2 | [
"MIT"
] | 22 | 2015-04-17T15:58:30.000Z | 2021-04-19T08:26:32.000Z | tests/test_mail.py | agdsn/sipa | a733bce0a54ad3a79732de82e7f32b35bd87d4e2 | [
"MIT"
] | 329 | 2015-04-14T23:34:31.000Z | 2022-01-21T03:02:46.000Z | tests/test_mail.py | agdsn/sipa | a733bce0a54ad3a79732de82e7f32b35bd87d4e2 | [
"MIT"
] | 18 | 2015-04-17T13:57:56.000Z | 2018-05-30T14:20:59.000Z | from dataclasses import dataclass, field
from typing import List
from unittest import TestCase
from unittest.mock import MagicMock, patch
from sipa.mail import send_contact_mail, send_complex_mail, \
send_official_contact_mail, send_usersuite_contact_mail, \
compose_subject, compose_body, send_mail
class Mai... | 34.292343 | 94 | 0.643166 |
bf60095e2d59cb2f39a7f6d41f03ef2643cd4f72 | 282 | py | Python | tests/test_skeleton.py | aniket-ak/Battery-SOH-Forecasting | da9bf14556e2f617f4f79701605bfc1846dcac20 | [
"MIT"
] | 2 | 2021-11-23T08:47:25.000Z | 2022-02-23T07:53:20.000Z | tests/test_skeleton.py | aniket-ak/Battery-SOH-Forecasting | da9bf14556e2f617f4f79701605bfc1846dcac20 | [
"MIT"
] | null | null | null | tests/test_skeleton.py | aniket-ak/Battery-SOH-Forecasting | da9bf14556e2f617f4f79701605bfc1846dcac20 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import pytest
from gpr.skeleton import fib
__author__ = "Aniket"
__copyright__ = "Aniket"
__license__ = "mit"
def test_fib():
assert fib(1) == 1
assert fib(2) == 1
assert fib(7) == 13
with pytest.raises(AssertionError):
fib(-10)
| 15.666667 | 39 | 0.620567 |
db0ffc1c8ac44f4fb8d9522cdbb603cd83a516da | 7,814 | py | Python | assignment1/cs231n/classifiers/k_nearest_neighbor.py | YorksonChang/CS231n-Assignments | 8113f69a3b9f7b26640d454c48aa05f653e71bd6 | [
"MIT"
] | null | null | null | assignment1/cs231n/classifiers/k_nearest_neighbor.py | YorksonChang/CS231n-Assignments | 8113f69a3b9f7b26640d454c48aa05f653e71bd6 | [
"MIT"
] | null | null | null | assignment1/cs231n/classifiers/k_nearest_neighbor.py | YorksonChang/CS231n-Assignments | 8113f69a3b9f7b26640d454c48aa05f653e71bd6 | [
"MIT"
] | null | null | null | import numpy as np
from past.builtins import xrange
class KNearestNeighbor(object):
""" a kNN classifier with L2 distance """
def __init__(self):
pass
def train(self, X, y):
"""
Train the classifier. For k-nearest neighbors this is just
memorizing the training data.
Inputs:
- X: A nu... | 44.651429 | 80 | 0.455337 |
27d4d543afebedb09c7dbc8c3463fa8b5c67298b | 32,709 | py | Python | rosserial/rosserial_python/src/rosserial_python/SerialClient.py | JVR01/3DPrinted_Robot_ArmRepo | 0f0b5aa7ddb9279f11aba6ad7c2a38c2d8926714 | [
"MIT"
] | 1 | 2020-11-20T03:10:18.000Z | 2020-11-20T03:10:18.000Z | rosserial/rosserial_python/src/rosserial_python/SerialClient.py | JVR01/3DPrinted_Robot_ArmRepo | 0f0b5aa7ddb9279f11aba6ad7c2a38c2d8926714 | [
"MIT"
] | 30 | 2020-11-27T23:12:12.000Z | 2021-04-25T15:37:42.000Z | rosserial/rosserial_python/src/rosserial_python/SerialClient.py | JVR01/3DPrinted_Robot_ArmRepo | 0f0b5aa7ddb9279f11aba6ad7c2a38c2d8926714 | [
"MIT"
] | null | null | null | #####################################################################
# Software License Agreement (BSD License)
#
# Copyright (c) 2011, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
... | 40.183047 | 181 | 0.593812 |
505d4ee52422ed0383f10227bae7a5c0b5eba290 | 18,384 | py | Python | aries_cloudagent/protocols/present_proof/indy/proof.py | rbeltranmontijo/aries-python | 77f6e0dd2f98cb70c2a17a1c72b729f0766f8f61 | [
"Apache-2.0"
] | 1 | 2021-04-15T09:44:00.000Z | 2021-04-15T09:44:00.000Z | aries_cloudagent/protocols/present_proof/indy/proof.py | rbeltranmontijo/aries-python | 77f6e0dd2f98cb70c2a17a1c72b729f0766f8f61 | [
"Apache-2.0"
] | null | null | null | aries_cloudagent/protocols/present_proof/indy/proof.py | rbeltranmontijo/aries-python | 77f6e0dd2f98cb70c2a17a1c72b729f0766f8f61 | [
"Apache-2.0"
] | null | null | null | """Marshmallow bindings for indy proofs."""
from typing import Mapping, Sequence
from marshmallow import fields, validate
from ....messaging.models.base import BaseModel, BaseModelSchema
from ....messaging.valid import (
INDY_CRED_DEF_ID,
INDY_REV_REG_ID,
INDY_SCHEMA_ID,
INT_EPOCH,
NUM_STR_WHOLE,... | 27.770393 | 85 | 0.645888 |
9f237a40c972eec607f4897b4fb4d7aa5bccd058 | 3,144 | py | Python | tests/test_data_date_ranges.py | ksilo/LiuAlgoTrader | 90b3ffdf4fd61adf37880e7b01ca4137a013f79c | [
"MIT"
] | null | null | null | tests/test_data_date_ranges.py | ksilo/LiuAlgoTrader | 90b3ffdf4fd61adf37880e7b01ca4137a013f79c | [
"MIT"
] | null | null | null | tests/test_data_date_ranges.py | ksilo/LiuAlgoTrader | 90b3ffdf4fd61adf37880e7b01ca4137a013f79c | [
"MIT"
] | null | null | null | import time
from datetime import date
import pytest
from hypothesis import given, settings
from hypothesis import strategies as st
from liualgotrader.common.types import DataConnectorType, TimeScale
from liualgotrader.data.data_factory import data_loader_factory
def test_alpaca_num_trading_day():
print("test_al... | 24.952381 | 75 | 0.573791 |
1f4fe594d257e9b74502c8009498b12da3d52f2b | 17,705 | py | Python | gpMgmt/bin/ext/yaml/representer.py | wapache-org/greenplum-gpdb | 79e2bd251c1d27054846f630acd52e7903854829 | [
"PostgreSQL",
"Apache-2.0"
] | 790 | 2015-01-03T02:13:39.000Z | 2020-05-10T19:53:57.000Z | AppServer/lib/yaml/lib/yaml/representer.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 1,361 | 2015-01-08T23:09:40.000Z | 2020-04-14T00:03:04.000Z | AppServer/lib/yaml/lib/yaml/representer.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 278 | 2015-09-21T19:15:06.000Z | 2018-08-31T00:36:51.000Z |
__all__ = ['BaseRepresenter', 'SafeRepresenter', 'Representer',
'RepresenterError']
from error import *
from nodes import *
import datetime
try:
set
except NameError:
from sets import Set as set
import sys, copy_reg, types
class RepresenterError(YAMLError):
pass
class BaseRepresenter(object):
... | 36.206544 | 91 | 0.62118 |
e1f8fdcc0553fca3069503f9a5ff7dbd08a9121c | 721 | py | Python | search.py | rajat19/bluecord | 623bcd4eb8a5e66f2c9c5ff8932dfed567f353cc | [
"MIT"
] | 1 | 2021-07-09T12:09:42.000Z | 2021-07-09T12:09:42.000Z | search.py | rajat19/bluecord | 623bcd4eb8a5e66f2c9c5ff8932dfed567f353cc | [
"MIT"
] | null | null | null | search.py | rajat19/bluecord | 623bcd4eb8a5e66f2c9c5ff8932dfed567f353cc | [
"MIT"
] | null | null | null | #!/usr/bin/env python
__author__ = 'Rajat Srivastava'
import pprint
import settings as my_settings
from googleapiclient.discovery import build
def search_main(query):
service = build("customsearch", "v1",
developerKey=my_settings.GOOGLE_API_KEY)
result = service.cse().list(
q=que... | 25.75 | 60 | 0.613037 |
ed11e81faff7c4638056f1f14114800b1af32135 | 1,640 | py | Python | commands_execution.py | rahmaevao/remote_develop | 104ebd28ec7d2e530582324dca0eef33fe5f44a6 | [
"CC0-1.0"
] | null | null | null | commands_execution.py | rahmaevao/remote_develop | 104ebd28ec7d2e530582324dca0eef33fe5f44a6 | [
"CC0-1.0"
] | 2 | 2020-09-01T20:38:14.000Z | 2020-09-02T06:07:51.000Z | commands_execution.py | rahmaevao/remote_develop | 104ebd28ec7d2e530582324dca0eef33fe5f44a6 | [
"CC0-1.0"
] | null | null | null | """
This script launches executable files of the remote machine, with the transfer of graphics via ssh.
For working you must pass the label command to the script as an argument.
"""
import subprocess
from constants import USER_AND_ADDRESS, PORT, command_groups
import sys
import argparse
if __name__ == '__main__':
... | 37.272727 | 113 | 0.583537 |
89ca3a8c60e2b380d17c25b9ef89cd073f59ef24 | 6,086 | py | Python | colossalai/nn/optimizer/fused_adam.py | SMesForoush/ColossalAI | 104cbbb313348e04cf83bda9f2dbfbe3b0f369fb | [
"Apache-2.0"
] | null | null | null | colossalai/nn/optimizer/fused_adam.py | SMesForoush/ColossalAI | 104cbbb313348e04cf83bda9f2dbfbe3b0f369fb | [
"Apache-2.0"
] | null | null | null | colossalai/nn/optimizer/fused_adam.py | SMesForoush/ColossalAI | 104cbbb313348e04cf83bda9f2dbfbe3b0f369fb | [
"Apache-2.0"
] | null | null | null | # modified from https://github.com/NVIDIA/apex/blob/master/apex/optimizers/fused_adam.py
import torch
from colossalai.registry import OPTIMIZERS
from colossalai.utils import multi_tensor_applier
@OPTIMIZERS.register_module
class FusedAdam(torch.optim.Optimizer):
"""Implements Adam algorithm.
Currently GPU-o... | 42.859155 | 145 | 0.605652 |
ce33c99523fec35706a4ea9375cc106966bd9750 | 115,071 | py | Python | practical-neo4j-apress/practicalneo4j-python-master/virtual/env/lib/python2.7/site-packages/py2neo/neo4j.py | dynamicdeploy/networkx | 6a57d49503295f4e5b8b5d728aa142e2efd5188a | [
"Apache-2.0"
] | 4 | 2015-07-05T03:23:04.000Z | 2021-03-21T16:42:59.000Z | practical-neo4j-apress/practicalneo4j-python-master/virtual/env/lib/python2.7/site-packages/py2neo/neo4j.py | dynamicdeploy/networkx | 6a57d49503295f4e5b8b5d728aa142e2efd5188a | [
"Apache-2.0"
] | null | null | null | practical-neo4j-apress/practicalneo4j-python-master/virtual/env/lib/python2.7/site-packages/py2neo/neo4j.py | dynamicdeploy/networkx | 6a57d49503295f4e5b8b5d728aa142e2efd5188a | [
"Apache-2.0"
] | 1 | 2021-10-08T03:41:54.000Z | 2021-10-08T03:41:54.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2011-2014, Nigel Small
#
# 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
#
# Unl... | 35.780784 | 147 | 0.584969 |
e3a604517e62253b33e4ef722735bc71e555b8f2 | 1,289 | py | Python | tests/test_enum_type.py | Attsun1031/schematics | 90dee53fd1d5c29f2c947bec6f5ffe5f74305ab1 | [
"BSD-3-Clause"
] | null | null | null | tests/test_enum_type.py | Attsun1031/schematics | 90dee53fd1d5c29f2c947bec6f5ffe5f74305ab1 | [
"BSD-3-Clause"
] | 1 | 2020-09-18T08:21:35.000Z | 2020-09-18T08:21:35.000Z | tests/test_enum_type.py | Attsun1031/schematics | 90dee53fd1d5c29f2c947bec6f5ffe5f74305ab1 | [
"BSD-3-Clause"
] | null | null | null | import pytest
from schematics.contrib.enum_type import EnumType
from schematics.exceptions import ConversionError
try:
from enum import Enum
class E(Enum):
A = 1
B = 'b'
class F(Enum):
A = 1
B = 1
except ImportError:
Enum = None
pytestmark = pytest.mark.skipif(Enu... | 21.483333 | 55 | 0.653995 |
8115f3070d6e47f1cc207abd12a34736ce996e0d | 1,340 | py | Python | main.py | kevinzakka/hypersearch | 8fddfd3a23d3f6b8401924af49bfaacebd20a409 | [
"MIT"
] | 270 | 2018-06-06T00:53:18.000Z | 2022-03-19T13:11:21.000Z | main.py | thanhkaist/hypersearch | 8fddfd3a23d3f6b8401924af49bfaacebd20a409 | [
"MIT"
] | 4 | 2018-06-07T15:48:01.000Z | 2020-09-10T11:42:47.000Z | main.py | thanhkaist/hypersearch | 8fddfd3a23d3f6b8401924af49bfaacebd20a409 | [
"MIT"
] | 31 | 2018-06-06T00:53:20.000Z | 2021-10-01T14:39:31.000Z | import config
from hyperband import Hyperband
from model import get_base_model
from utils import prepare_dirs, save_results
def main(args):
# ensure directories are setup
dirs = [args.data_dir, args.ckpt_dir]
prepare_dirs(dirs)
# create base model
model = get_base_model()
# define params
... | 27.916667 | 76 | 0.54403 |
fea61c5590bf7cc704ab7ebdf37710e73facfaae | 7,155 | py | Python | src/olympia/browse/feeds.py | makyen/Mozilla-addons-server | 555d9f31cc4b00799466f16c8809edd5f1858ab8 | [
"BSD-3-Clause"
] | 1 | 2020-12-03T10:02:15.000Z | 2020-12-03T10:02:15.000Z | src/olympia/browse/feeds.py | makyen/Mozilla-addons-server | 555d9f31cc4b00799466f16c8809edd5f1858ab8 | [
"BSD-3-Clause"
] | null | null | null | src/olympia/browse/feeds.py | makyen/Mozilla-addons-server | 555d9f31cc4b00799466f16c8809edd5f1858ab8 | [
"BSD-3-Clause"
] | null | null | null | from django.shortcuts import get_object_or_404
from django.utils.translation import ugettext
from olympia import amo
from olympia.amo.feeds import NonAtomicFeed
from olympia.amo.urlresolvers import reverse
from olympia.amo.helpers import absolutify, url, page_name
from olympia.addons.models import Addon, Category
fro... | 33.591549 | 79 | 0.608526 |
5aa87692078537fb3b7c9a9fe901f2e0a40d30cf | 1,830 | py | Python | providers/airlaunch/opcua/transfers/opcua_to_s3.py | airlaunch-ch/airflow-dags-demo-industry | a07fdca734694c9ba5ae06a4b4fa95c51289ee7f | [
"Apache-2.0"
] | null | null | null | providers/airlaunch/opcua/transfers/opcua_to_s3.py | airlaunch-ch/airflow-dags-demo-industry | a07fdca734694c9ba5ae06a4b4fa95c51289ee7f | [
"Apache-2.0"
] | null | null | null | providers/airlaunch/opcua/transfers/opcua_to_s3.py | airlaunch-ch/airflow-dags-demo-industry | a07fdca734694c9ba5ae06a4b4fa95c51289ee7f | [
"Apache-2.0"
] | null | null | null | from datetime import datetime, timedelta
from dateutil import parser
from typing import List, Optional, Union
import json
from io import BytesIO
from providers.airlaunch.opcua.transfers.opcua_transfer_base import OPCUATransferBaseOperator
from airflow.providers.amazon.aws.hooks.s3 import S3Hook
from airflow.exception... | 30.5 | 93 | 0.633333 |
f959114cef0a1ced51ae5cb095fb72310bd0c918 | 30,273 | py | Python | run_var_UCB_continuous.py | qphong/BayesOpt-LV | b852a94e9bae8716566e014ca1dd02186bcdf7ca | [
"MIT"
] | 1 | 2021-11-11T17:55:40.000Z | 2021-11-11T17:55:40.000Z | run_var_UCB_continuous.py | qphong/BayesOpt-LV | b852a94e9bae8716566e014ca1dd02186bcdf7ca | [
"MIT"
] | null | null | null | run_var_UCB_continuous.py | qphong/BayesOpt-LV | b852a94e9bae8716566e014ca1dd02186bcdf7ca | [
"MIT"
] | null | null | null | import sys
import os
import argparse
import pickle
epsilon = 1e-12
parser = argparse.ArgumentParser(description="Bayesian Optimization for Value at Risk.")
parser.add_argument(
"-g",
"--gpu",
help="gpu device index for tensorflow",
required=False,
type=str,
default="0",
)
parser.add_argument(
... | 33.267033 | 186 | 0.570674 |
8dc6a70cad327ddfd38fad42a2778b7012f2e352 | 3,372 | py | Python | nova/conf/image_file_url.py | badock/nova-tidb | 4c4591f2cd887fdc22828e12f0c297c051bbd912 | [
"Apache-2.0"
] | null | null | null | nova/conf/image_file_url.py | badock/nova-tidb | 4c4591f2cd887fdc22828e12f0c297c051bbd912 | [
"Apache-2.0"
] | null | null | null | nova/conf/image_file_url.py | badock/nova-tidb | 4c4591f2cd887fdc22828e12f0c297c051bbd912 | [
"Apache-2.0"
] | null | null | null | # needs:fix_opt_description
# needs:check_deprecation_status
# needs:check_opt_group_and_type
# needs:fix_opt_description_indentation
# needs:fix_opt_registration_consistency
# Copyright 2013 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not u... | 40.142857 | 79 | 0.661032 |
d611b3677aee3d7810bbe1509eb235a4e29204e9 | 355 | py | Python | student/urls.py | YarinBou/SJMaster | 74f2d77bf03a9a5856ffd44ce57041ae7a416bcb | [
"MIT"
] | 1 | 2022-03-17T10:34:56.000Z | 2022-03-17T10:34:56.000Z | student/urls.py | YarinBou/SJMaster | 74f2d77bf03a9a5856ffd44ce57041ae7a416bcb | [
"MIT"
] | 49 | 2021-11-15T08:29:25.000Z | 2022-01-01T17:52:46.000Z | student/urls.py | YarinBou/SJMaster | 74f2d77bf03a9a5856ffd44ce57041ae7a416bcb | [
"MIT"
] | 2 | 2021-11-02T09:22:23.000Z | 2021-11-04T11:04:18.000Z | from django.urls import path
from student.views import update_student_account_settings_view, account_update_success
urlpatterns = [
path('student/account_settings/', update_student_account_settings_view,
name="student_account_settings"),
path('account_update_success/', account_update_success,
... | 35.5 | 86 | 0.788732 |
63f642a9612be623f107ee6ec057fe65d60f0dc4 | 567 | py | Python | physics/boundary_conditions/third_type_boundary_condition.py | fedorpashin/physics | d587d50679fb5ad3994a8b992806a30053ed45e1 | [
"MIT"
] | 2 | 2021-09-06T16:20:25.000Z | 2021-09-06T16:21:17.000Z | physics/boundary_conditions/third_type_boundary_condition.py | fedorpashin/physics | d587d50679fb5ad3994a8b992806a30053ed45e1 | [
"MIT"
] | 30 | 2021-09-06T16:20:29.000Z | 2021-11-27T22:41:03.000Z | physics/boundary_conditions/third_type_boundary_condition.py | fedorpashin/physics | d587d50679fb5ad3994a8b992806a30053ed45e1 | [
"MIT"
] | null | null | null | from physics.boundary_conditions.boundary_condition import BoundaryCondition
from dataclasses import dataclass
from final_class import final
from overrides import overrides
__all__ = ['ThirdTypeBoundaryCondition']
@final
@dataclass
class ThirdTypeBoundaryCondition(BoundaryCondition):
__ν: float
__κ: float
... | 20.25 | 76 | 0.698413 |
613679698dd09c922c898a19badfb25043a1b8c1 | 231 | py | Python | tests/test_compression.py | d1618033/Flask-Loopback | 6e2e7bc6c94d51c238b91fe15bf070e8b99f6e25 | [
"BSD-3-Clause"
] | 8 | 2015-01-28T18:47:56.000Z | 2022-02-13T01:26:14.000Z | tests/test_compression.py | d1618033/Flask-Loopback | 6e2e7bc6c94d51c238b91fe15bf070e8b99f6e25 | [
"BSD-3-Clause"
] | 13 | 2016-01-18T15:42:41.000Z | 2021-01-07T16:18:19.000Z | tests/test_compression.py | d1618033/Flask-Loopback | 6e2e7bc6c94d51c238b91fe15bf070e8b99f6e25 | [
"BSD-3-Clause"
] | 4 | 2016-09-18T12:47:32.000Z | 2020-03-13T05:35:32.000Z | import requests
def test_compression(active_app, url): # pylint: disable=unused-argument
resp = requests.get(url.add_path('compressed'))
resp.raise_for_status()
assert resp.content.decode('utf-8') == 'uncompressed!'
| 25.666667 | 72 | 0.727273 |
65a154eda8d2848c581251e026cd75cb004fdc70 | 4,623 | py | Python | project/admin.py | tomgreen66/cogs3 | 6a0240faca83a7d1af061e70b5d7c324cf5e067a | [
"MIT"
] | null | null | null | project/admin.py | tomgreen66/cogs3 | 6a0240faca83a7d1af061e70b5d7c324cf5e067a | [
"MIT"
] | null | null | null | project/admin.py | tomgreen66/cogs3 | 6a0240faca83a7d1af061e70b5d7c324cf5e067a | [
"MIT"
] | null | null | null | from django.contrib import admin
from project.forms import ProjectAdminForm, ProjectUserMembershipAdminForm
from project.models import (Project, ProjectCategory, ProjectFundingSource,
ProjectSystemAllocation, ProjectUserMembership)
from project.openldap import (update_openldap_project,
... | 33.258993 | 112 | 0.674886 |
c1a8c7bc78dc25a74f08d18acde5c3055ab765e9 | 863 | py | Python | socket/server/logger.py | cheeseywhiz/cheeseywhiz | 51f6651ddbaeebd14d9ce77776bc4cf3a95511c4 | [
"MIT"
] | null | null | null | socket/server/logger.py | cheeseywhiz/cheeseywhiz | 51f6651ddbaeebd14d9ce77776bc4cf3a95511c4 | [
"MIT"
] | null | null | null | socket/server/logger.py | cheeseywhiz/cheeseywhiz | 51f6651ddbaeebd14d9ce77776bc4cf3a95511c4 | [
"MIT"
] | null | null | null | import logging
import sys
class StdErrHandler(logging.Handler):
def __init__(self, level=None):
if level is None:
level = logging.NOTSET
super().__init__(level)
fmt = logging.Formatter('%(name)s: %(message)s')
super().setFormatter(fmt)
def flush(self):
pri... | 21.575 | 56 | 0.606025 |
17f69032f8f005d57937c3ee4a9597ea3d63759c | 7,603 | py | Python | moveControl/pathTrack/fuzzy_pid.py | ndkjing/usv | 132e021432a0344a22914aaf68da7d7955d7331f | [
"MIT"
] | null | null | null | moveControl/pathTrack/fuzzy_pid.py | ndkjing/usv | 132e021432a0344a22914aaf68da7d7955d7331f | [
"MIT"
] | null | null | null | moveControl/pathTrack/fuzzy_pid.py | ndkjing/usv | 132e021432a0344a22914aaf68da7d7955d7331f | [
"MIT"
] | 1 | 2021-09-04T10:27:30.000Z | 2021-09-04T10:27:30.000Z | import skfuzzy as sf
import time
import numpy as np
from math import pi, log
class FuzzyPID:
def __init__(self, Pmax, Pmin, Imax, Imin, Dmax, Dmin):
self.Kpmax = Pmax
self.Kpmin = Pmin
self.Kimax = Imax
self.Kimin = Imin
self.Kdmax = Dmax
self.Kdmin = Dmin
s... | 35.036866 | 119 | 0.519926 |
02b641e8cf741d60e6eaada38df857e69d300475 | 8,241 | py | Python | wenet/bin/alignment.py | underdogliu/wenet | 19af50a6c848e77adb5dfa40a861061c1ae8b78e | [
"Apache-2.0"
] | null | null | null | wenet/bin/alignment.py | underdogliu/wenet | 19af50a6c848e77adb5dfa40a861061c1ae8b78e | [
"Apache-2.0"
] | null | null | null | wenet/bin/alignment.py | underdogliu/wenet | 19af50a6c848e77adb5dfa40a861061c1ae8b78e | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 Mobvoi Inc. (authors: Di Wu)
#
# 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 a... | 37.802752 | 79 | 0.58391 |
45b60fb0cc52ee27686bbe532a4810ebc3efe5fc | 1,165 | py | Python | router_mod/quagga.py | bachnguyenhuu/RENAT | f747996e1b79284ef70c51b71774098c200abc7f | [
"Apache-2.0"
] | 65 | 2018-01-23T00:25:52.000Z | 2022-02-03T12:02:59.000Z | router_mod/quagga.py | bachnguyenhuu/RENAT | f747996e1b79284ef70c51b71774098c200abc7f | [
"Apache-2.0"
] | 11 | 2018-01-25T05:29:14.000Z | 2021-01-03T12:07:33.000Z | router_mod/quagga.py | bachnguyenhuu/RENAT | f747996e1b79284ef70c51b71774098c200abc7f | [
"Apache-2.0"
] | 18 | 2018-01-25T03:09:00.000Z | 2021-12-15T10:41:15.000Z | # -*- coding: utf-8 -*-
# Copyright 2017-2020 NTT Communications
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 32.361111 | 80 | 0.721888 |
de082847a14f054297938aefb2c758d740ee28fc | 17,418 | py | Python | python/tvm/relay/op/op_attrs.py | jianshitansuantong233/tvm | 61e4fcfb842772e205e64373fb09228b0c5b7e01 | [
"Apache-2.0"
] | null | null | null | python/tvm/relay/op/op_attrs.py | jianshitansuantong233/tvm | 61e4fcfb842772e205e64373fb09228b0c5b7e01 | [
"Apache-2.0"
] | null | null | null | python/tvm/relay/op/op_attrs.py | jianshitansuantong233/tvm | 61e4fcfb842772e205e64373fb09228b0c5b7e01 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 28.184466 | 81 | 0.768975 |
0ddb5ad568b54dc141e05d8dfce7cdb63c57a3fd | 347 | py | Python | spritzbot/plugins/friends.py | sengupta/spritzbot | 0ca2ab453556b3a1eb98c9f40345ea8a3eba74e5 | [
"BSD-2-Clause"
] | 1 | 2015-11-23T11:22:40.000Z | 2015-11-23T11:22:40.000Z | spritzbot/plugins/friends.py | sengupta/spritzbot | 0ca2ab453556b3a1eb98c9f40345ea8a3eba74e5 | [
"BSD-2-Clause"
] | null | null | null | spritzbot/plugins/friends.py | sengupta/spritzbot | 0ca2ab453556b3a1eb98c9f40345ea8a3eba74e5 | [
"BSD-2-Clause"
] | null | null | null | import re
def commands():
"""Returns the list of commands that this plugin handles.
"""
return [
{
'type':'friends',
'triggers':[re.compile('.*')],
'field':'all',
}
]
def process(event):
return "You have %s friends.... | 21.6875 | 61 | 0.45245 |
b04e303b2542333cc55ca40a9020673bf48830d7 | 3,290 | py | Python | acoustics/building.py | cnheider/python-acoustics | fbc87454422c41e1a39e282d7680126a6d8014dd | [
"BSD-3-Clause"
] | 371 | 2015-02-21T19:16:49.000Z | 2022-03-31T03:36:56.000Z | acoustics/building.py | sky-enter/python-acoustics | fbc87454422c41e1a39e282d7680126a6d8014dd | [
"BSD-3-Clause"
] | 80 | 2015-01-03T09:48:05.000Z | 2022-01-31T23:09:11.000Z | acoustics/building.py | sky-enter/python-acoustics | fbc87454422c41e1a39e282d7680126a6d8014dd | [
"BSD-3-Clause"
] | 109 | 2015-01-26T01:46:38.000Z | 2022-03-23T06:41:42.000Z | """
Building
========
The building module contains functions related to building acoustics.
"""
import numpy as np
def rw_curve(tl):
"""
Calculate the curve of :math:`Rw` from a NumPy array `tl` with third
octave data between 100 Hz and 3.15 kHz.
:param tl: Transmission Loss
"""
ref_curve ... | 27.416667 | 98 | 0.590274 |
56b3d3524025e9ec6ea0de18ef9825f82429672f | 362 | py | Python | runner_master/runner/models/get.py | bigvideoresearch/SCC | f26cdb6aaf248b5112812dbdac1f1b5086aebccc | [
"MIT"
] | 5 | 2021-09-15T21:48:55.000Z | 2022-03-22T11:21:58.000Z | runner_master/runner/models/get.py | bigvideoresearch/SCC | f26cdb6aaf248b5112812dbdac1f1b5086aebccc | [
"MIT"
] | null | null | null | runner_master/runner/models/get.py | bigvideoresearch/SCC | f26cdb6aaf248b5112812dbdac1f1b5086aebccc | [
"MIT"
] | 1 | 2021-08-20T08:40:15.000Z | 2021-08-20T08:40:15.000Z | from .. import models
def get(model_name):
names = model_name.split('.')
if model_name.startswith('gluon.'):
func = getattr(models.gluon, model_name[len('gluon.'):], None)
else:
func = getattr(models, model_name, None)
if func is None:
raise RuntimeError('model_name [{}] not ex... | 27.846154 | 75 | 0.640884 |
de6e0a2000e20e795fe90ea9afc5121e4cf93d2a | 390 | py | Python | chameleon/celery.py | msherman64/portal | e5399ef2ed3051d7c9a46c660f028c666ae22ca6 | [
"Apache-2.0"
] | 3 | 2015-08-04T20:53:41.000Z | 2020-02-14T22:58:20.000Z | chameleon/celery.py | msherman64/portal | e5399ef2ed3051d7c9a46c660f028c666ae22ca6 | [
"Apache-2.0"
] | 103 | 2015-01-15T14:21:00.000Z | 2022-03-31T19:14:20.000Z | chameleon/celery.py | msherman64/portal | e5399ef2ed3051d7c9a46c660f028c666ae22ca6 | [
"Apache-2.0"
] | 4 | 2016-02-22T16:48:20.000Z | 2021-01-08T17:13:21.000Z |
import os
from celery import Celery
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'chameleon.settings')
from django.conf import settings
app = Celery('chameleon')
app.config_from_object('django.conf:settings', namespace='CELERY')
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
@app.task(bind=True)
def... | 20.526316 | 69 | 0.769231 |
7d32e9939241ebc467a8418cdf7771de842a61d7 | 13,174 | py | Python | wouso/games/quest/tests.py | AlexandruGhergut/wouso | f26244ff58ae626808ae8c58ccc93d21f9f2666f | [
"Apache-2.0"
] | 117 | 2015-01-02T18:07:33.000Z | 2021-01-06T22:36:25.000Z | wouso/games/quest/tests.py | AlexandruGhergut/wouso | f26244ff58ae626808ae8c58ccc93d21f9f2666f | [
"Apache-2.0"
] | 229 | 2015-01-12T07:07:58.000Z | 2019-10-12T08:27:01.000Z | wouso/games/quest/tests.py | AlexandruGhergut/wouso | f26244ff58ae626808ae8c58ccc93d21f9f2666f | [
"Apache-2.0"
] | 96 | 2015-01-07T05:26:09.000Z | 2020-06-25T07:28:51.000Z | from datetime import datetime, timedelta
from django.test import TestCase
from django.contrib.auth.models import User
from django.test import Client
from django.test.client import RequestFactory
from django.core.urlresolvers import reverse
import json
from wouso.core import scoring
from wouso.core.qpool.models import Q... | 45.271478 | 120 | 0.661151 |
0a55f23444ed3c655a579ef4df8faf76611caa39 | 5,540 | py | Python | horovod/spark/keras/bare.py | hcyang99/horovod | 825cc197468548da47dcd38872d5b4ba6e6a125b | [
"Apache-2.0"
] | 1 | 2020-05-07T08:26:36.000Z | 2020-05-07T08:26:36.000Z | horovod/spark/keras/bare.py | kyocen/horovod | e9b1e228ff92eb7f65d9aea2d36f23b327df28bd | [
"Apache-2.0"
] | null | null | null | horovod/spark/keras/bare.py | kyocen/horovod | e9b1e228ff92eb7f65d9aea2d36f23b327df28bd | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Uber Technologies, 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 applica... | 35.974026 | 87 | 0.598556 |
cc3fa632de2a78e548a25b3fdb96497a418e1d52 | 16,927 | py | Python | cherrypy/test/test_tools.py | abancu/core | e110a1df32ec8bf67f007960e61df55f0a926219 | [
"MIT"
] | null | null | null | cherrypy/test/test_tools.py | abancu/core | e110a1df32ec8bf67f007960e61df55f0a926219 | [
"MIT"
] | null | null | null | cherrypy/test/test_tools.py | abancu/core | e110a1df32ec8bf67f007960e61df55f0a926219 | [
"MIT"
] | null | null | null | """Test the various means of instantiating and invoking tools."""
import gzip
import sys
import unittest
import io
from cherrypy._cpcompat import copyitems, itervalues
from cherrypy._cpcompat import IncompleteRead, ntob, ntou, xrange
import time
timeout = 0.2
import types
import six
import cherrypy
from cherrypy im... | 37.952915 | 94 | 0.561174 |
122c5123a067f57e701f4bd14752028b058979d9 | 891 | py | Python | dns/rdtypes/IN/NSAP_PTR.py | preo/dnspython | 465785f85f87508209117264c677080e901e957c | [
"0BSD"
] | null | null | null | dns/rdtypes/IN/NSAP_PTR.py | preo/dnspython | 465785f85f87508209117264c677080e901e957c | [
"0BSD"
] | null | null | null | dns/rdtypes/IN/NSAP_PTR.py | preo/dnspython | 465785f85f87508209117264c677080e901e957c | [
"0BSD"
] | null | null | null | # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | 44.55 | 72 | 0.780022 |
0364160c1903589508f9e772e99e3fa7b3c3eb67 | 27,807 | py | Python | scripts/irods/test/test_ichksum.py | JustinKyleJames/irods | 59e9db75200e95796ec51ec20eb3b185d9e4b5f5 | [
"BSD-3-Clause"
] | 333 | 2015-01-15T15:42:29.000Z | 2022-03-19T19:16:15.000Z | scripts/irods/test/test_ichksum.py | JustinKyleJames/irods | 59e9db75200e95796ec51ec20eb3b185d9e4b5f5 | [
"BSD-3-Clause"
] | 3,551 | 2015-01-02T19:55:40.000Z | 2022-03-31T21:24:56.000Z | scripts/irods/test/test_ichksum.py | JustinKyleJames/irods | 59e9db75200e95796ec51ec20eb3b185d9e4b5f5 | [
"BSD-3-Clause"
] | 148 | 2015-01-31T16:13:46.000Z | 2022-03-23T20:23:43.000Z | from __future__ import print_function
import sys
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
import os
import shutil
import re
import hashlib
import base64
from . import session
from . import settings
from . import resource_suite
from .. import lib
from .. import test
from... | 59.289979 | 173 | 0.659402 |
3fe351b8982b48d5099b52ac68c87586c54b0883 | 2,209 | py | Python | addHumanLabels.py | online-behaviour/2017-election | b6c0b8a52336c26909b8c852de55d18d38a4cbfb | [
"Apache-2.0"
] | null | null | null | addHumanLabels.py | online-behaviour/2017-election | b6c0b8a52336c26909b8c852de55d18d38a4cbfb | [
"Apache-2.0"
] | null | null | null | addHumanLabels.py | online-behaviour/2017-election | b6c0b8a52336c26909b8c852de55d18d38a4cbfb | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""
addHumanLabels.py: add human labels to data file
usage: addHumanLabels.py labelFile < dataFile > outFile
20190206 erikt(at)xs4all.nl
"""
import csv
import sys
COMMAND = sys.argv.pop(0)
USAGE = "usage: "+COMMAND+" labelFile < dataFile > outFile "
OFFSET = 1
SEPARATOR = ","
INDEXI... | 30.260274 | 185 | 0.664101 |
3d10dd112998618244852a725c037996365f9844 | 823 | py | Python | Chapters/Chapter_3-Resizing_and_cropping.py | Balaji-Ganesh/Furnishing-OpenCV-Basics | 54cd8fa09cc6f1298861b12ffb190432f412bd1f | [
"MIT"
] | null | null | null | Chapters/Chapter_3-Resizing_and_cropping.py | Balaji-Ganesh/Furnishing-OpenCV-Basics | 54cd8fa09cc6f1298861b12ffb190432f412bd1f | [
"MIT"
] | null | null | null | Chapters/Chapter_3-Resizing_and_cropping.py | Balaji-Ganesh/Furnishing-OpenCV-Basics | 54cd8fa09cc6f1298861b12ffb190432f412bd1f | [
"MIT"
] | null | null | null | import cv2
img = cv2.imread("Resources/lena.jpg")
print(img.shape)
# Resizing the image..
imgResize = cv2.resize(src=img, dsize=(200, 300)) # dsize=(width, height)
# Cropping the image.. for this no need of an OpenCV function, can do normally via matrix manipulation, but its bit tricky --> first height, nex... | 45.722222 | 215 | 0.687728 |
497c3788de1338cd9fe2c07355b1c7e5c9318bd5 | 219 | py | Python | csacademy/digit-function.py | phvash/competitive-programming | 33c881764341d8ff42b7c819ed04eb9c7d6f93f4 | [
"MIT"
] | null | null | null | csacademy/digit-function.py | phvash/competitive-programming | 33c881764341d8ff42b7c819ed04eb9c7d6f93f4 | [
"MIT"
] | null | null | null | csacademy/digit-function.py | phvash/competitive-programming | 33c881764341d8ff42b7c819ed04eb9c7d6f93f4 | [
"MIT"
] | null | null | null | def f(num):
global count
count += 1
if num == 0:
return 0
sum_of_digits = sum(map(int, str(num)))
f(num - sum_of_digits)
global count
count = 0
num = int(input())
f(num)
print(count)
| 12.882353 | 43 | 0.56621 |
cc8ef23a1bda282279da246073e3d471d36a60a0 | 662 | py | Python | amodem/tests/test_sampling.py | Matthew-MK/amodem | a75dda9ab0f7445589a036357e604703ccb34726 | [
"MIT"
] | 766 | 2015-01-14T15:48:07.000Z | 2022-03-30T01:19:48.000Z | amodem/tests/test_sampling.py | Matthew-MK/amodem | a75dda9ab0f7445589a036357e604703ccb34726 | [
"MIT"
] | 42 | 2015-01-02T18:50:11.000Z | 2022-03-11T19:10:35.000Z | amodem/tests/test_sampling.py | Matthew-MK/amodem | a75dda9ab0f7445589a036357e604703ccb34726 | [
"MIT"
] | 116 | 2015-01-14T20:43:52.000Z | 2022-03-24T13:10:30.000Z | from amodem import sampling
from amodem import common
import numpy as np
from io import BytesIO
def test_resample():
x = np.sin(2*np.pi * 10 * np.linspace(0, 1, 1001))
src = BytesIO(common.dumps(x))
dst = BytesIO()
sampling.resample(src=src, dst=dst, df=0.0)
y = common.loads(dst.getvalue())
e... | 25.461538 | 64 | 0.623867 |
f98768da4591835f07f914a88fc6ef93707fafca | 9,983 | py | Python | uf/modeling/gpt2.py | yupeijei1997/unif | 16685a89446e6ce14080439162a9bfd0c75f0521 | [
"Apache-2.0"
] | 1 | 2021-05-15T12:07:40.000Z | 2021-05-15T12:07:40.000Z | uf/modeling/gpt2.py | yupeijei1997/unif | 16685a89446e6ce14080439162a9bfd0c75f0521 | [
"Apache-2.0"
] | null | null | null | uf/modeling/gpt2.py | yupeijei1997/unif | 16685a89446e6ce14080439162a9bfd0c75f0521 | [
"Apache-2.0"
] | null | null | null | # coding:=utf-8
# Copyright 2020 Tencent. 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 applic... | 36.039711 | 79 | 0.565361 |
7c69cb8e63dd507135b0da61eac979a99498de39 | 1,327 | py | Python | checkio/Rock/DNA Common Sequence/dna_common_sequences.py | KenMercusLai/checkio | c7702221e1bc0b0b30425859ffa6c09722949d65 | [
"MIT"
] | 39 | 2015-02-09T13:24:12.000Z | 2019-05-16T17:51:19.000Z | checkio/Rock/DNA Common Sequence/dna_common_sequences.py | KenMercusLai/checkio | c7702221e1bc0b0b30425859ffa6c09722949d65 | [
"MIT"
] | 1 | 2019-10-21T16:18:14.000Z | 2019-10-21T16:18:14.000Z | checkio/Rock/DNA Common Sequence/dna_common_sequences.py | KenMercusLai/checkio | c7702221e1bc0b0b30425859ffa6c09722949d65 | [
"MIT"
] | 22 | 2015-01-30T18:00:05.000Z | 2021-05-22T02:57:23.000Z | # please read the following article for algothmn explanation
# http://wordaligned.org/articles/longest-common-subsequence
def common(first, second):
dp_rec = [[('',)] * (len(second) + 1) for i in range(len(first) + 1)]
for i in range(1, len(first) + 1):
for j in range(1, len(second) + 1):
... | 41.46875 | 86 | 0.515448 |
8b42cb5c97af45c56dd32c3d7d4ed86ca82ed439 | 1,865 | py | Python | src/pycity_scheduling/algorithms/__init__.py | ElsevierSoftwareX/SOFTX-D-20-00087 | d2d3f1effda2c0499cb05abf87435375a21379e3 | [
"MIT"
] | 4 | 2021-11-01T15:13:27.000Z | 2022-01-16T18:01:06.000Z | src/pycity_scheduling/algorithms/__init__.py | ElsevierSoftwareX/SOFTX-D-20-00087 | d2d3f1effda2c0499cb05abf87435375a21379e3 | [
"MIT"
] | 2 | 2021-11-18T05:58:00.000Z | 2022-01-19T16:46:20.000Z | src/pycity_scheduling/algorithms/__init__.py | ElsevierSoftwareX/SOFTX-D-20-00087 | d2d3f1effda2c0499cb05abf87435375a21379e3 | [
"MIT"
] | 5 | 2021-11-01T15:13:35.000Z | 2022-02-03T21:28:48.000Z | """
The pycity_scheduling framework
Copyright (C) 2022,
Institute for Automation of Complex Power Systems (ACS),
E.ON Energy Research Center (E.ON ERC),
RWTH Aachen University
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Softwa... | 37.3 | 118 | 0.787668 |
d37353cf4c6658b97996ff365832047189978593 | 3,101 | py | Python | mysite/timesheets/migrations/0001_initial.py | xanderyzwich/Timesheets | 15685ac7b786d3e66bd24e8a3a252f193ee8f49b | [
"MIT"
] | null | null | null | mysite/timesheets/migrations/0001_initial.py | xanderyzwich/Timesheets | 15685ac7b786d3e66bd24e8a3a252f193ee8f49b | [
"MIT"
] | 1 | 2019-06-11T21:23:49.000Z | 2019-06-11T21:23:49.000Z | mysite/timesheets/migrations/0001_initial.py | xanderyzwich/Timesheets | 15685ac7b786d3e66bd24e8a3a252f193ee8f49b | [
"MIT"
] | null | null | null | # Generated by Django 2.0.6 on 2018-06-21 21:01
import datetime
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Adhoc',
fi... | 42.479452 | 115 | 0.571751 |
50994f0b071b8e55a71c2ed2a59105999f56fad3 | 48,442 | py | Python | tests/validation/tests/v3_api/common.py | zehuaiWANG/rancher | 111645ae58da302a0d48138e054fd97dd1b6a1f9 | [
"Apache-2.0"
] | null | null | null | tests/validation/tests/v3_api/common.py | zehuaiWANG/rancher | 111645ae58da302a0d48138e054fd97dd1b6a1f9 | [
"Apache-2.0"
] | 2 | 2021-03-25T23:07:41.000Z | 2022-03-29T21:57:09.000Z | tests/validation/tests/v3_api/common.py | zehuaiWANG/rancher | 111645ae58da302a0d48138e054fd97dd1b6a1f9 | [
"Apache-2.0"
] | null | null | null | import inspect
import json
import os
import random
import subprocess
import time
import requests
import ast
import paramiko
import rancher
from rancher import ApiError
from lib.aws import AmazonWebServices
DEFAULT_TIMEOUT = 120
DEFAULT_MULTI_CLUSTER_APP_TIMEOUT = 300
DEFAULT_APP_DELETION_TIMEOUT = 360
DEFAULT_MONITORI... | 35.30758 | 79 | 0.626997 |
aba0018aa1043212cb8093434da60964716af72e | 4,139 | py | Python | gym_server/server.py | ThomasGale/pytorch-cpp-rl | e25fa6418e308eefb7213c2d45528eaac20780ee | [
"MIT"
] | 445 | 2019-04-11T12:30:34.000Z | 2022-03-28T08:14:42.000Z | gym_server/server.py | ThomasGale/pytorch-cpp-rl | e25fa6418e308eefb7213c2d45528eaac20780ee | [
"MIT"
] | 21 | 2019-04-11T20:18:02.000Z | 2021-11-27T12:56:58.000Z | gym_server/server.py | ThomasGale/pytorch-cpp-rl | e25fa6418e308eefb7213c2d45528eaac20780ee | [
"MIT"
] | 87 | 2019-04-11T17:42:05.000Z | 2022-03-10T15:55:48.000Z | """
Contains a class that trains an agent.
"""
import logging
from typing import Tuple
import numpy as np
import gym
from gym_server.envs import make_vec_envs
from gym_server.messages import (InfoMessage, MakeMessage, ResetMessage,
StepMessage)
from gym_server.zmq_client import ZmqClie... | 33.379032 | 78 | 0.543368 |
e4ddc7bf09f8e1b91ec6b5df9789ec5339f5732f | 896 | py | Python | setup.py | sbousseaden/PythonForWindows | 8d33e0143f8b7735118dde2e13bcc0175db9adcd | [
"BSD-3-Clause"
] | 1 | 2020-08-02T09:35:14.000Z | 2020-08-02T09:35:14.000Z | setup.py | sbousseaden/PythonForWindows | 8d33e0143f8b7735118dde2e13bcc0175db9adcd | [
"BSD-3-Clause"
] | null | null | null | setup.py | sbousseaden/PythonForWindows | 8d33e0143f8b7735118dde2e13bcc0175db9adcd | [
"BSD-3-Clause"
] | 1 | 2020-09-21T14:46:44.000Z | 2020-09-21T14:46:44.000Z | # -*- coding: utf-8 -*-
import sys
from setuptools import setup
PKG_NAME = "PythonForWindows"
VERSION = "0.6"
setup(
name = PKG_NAME,
version = VERSION,
author = 'Hakril',
author_email = 'none',
description = 'A codebase aimed to make interaction with Windows and native execution easier',
li... | 30.896552 | 98 | 0.554688 |
fcedd0a353eaffa18bdf8fa44ba5d5a8c4de4d1a | 269 | py | Python | dataset_06/malis/setup.py | naibaf7/caffe_neural_models | 9d372c4bc599029902185e19f89e5c39f842fff7 | [
"BSD-2-Clause"
] | 28 | 2015-06-11T07:48:29.000Z | 2019-06-28T01:29:09.000Z | dataset_06/malis/setup.py | naibaf7/caffe_neural_models | 9d372c4bc599029902185e19f89e5c39f842fff7 | [
"BSD-2-Clause"
] | 2 | 2015-10-01T13:14:46.000Z | 2016-09-28T16:25:35.000Z | dataset_06/malis/setup.py | naibaf7/caffe_neural_models | 9d372c4bc599029902185e19f89e5c39f842fff7 | [
"BSD-2-Clause"
] | 16 | 2015-07-08T18:47:59.000Z | 2020-03-26T13:48:48.000Z | from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
ext_modules = [Extension("malis", ["malis.pyx", "malis_cpp.cpp"], language='c++',)]
setup(cmdclass = {'build_ext': build_ext}, ext_modules = ext_modules) | 38.428571 | 83 | 0.765799 |
8ab35bccc122e46362187084443f32d25ddaa048 | 2,360 | py | Python | duplication_reversal_task/lsnn/toolbox/matplotlib_extension.py | IGITUGraz/Spike-Frequency-Adaptation-Supports-Network-Computations | 58a33584b34b477cfb1d3614460f66f94344fb9c | [
"MIT"
] | 1 | 2021-07-17T10:34:15.000Z | 2021-07-17T10:34:15.000Z | duplication_reversal_task/lsnn/toolbox/matplotlib_extension.py | IGITUGraz/Spike-Frequency-Adaptation-Supports-Network-Computations | 58a33584b34b477cfb1d3614460f66f94344fb9c | [
"MIT"
] | null | null | null | duplication_reversal_task/lsnn/toolbox/matplotlib_extension.py | IGITUGraz/Spike-Frequency-Adaptation-Supports-Network-Computations | 58a33584b34b477cfb1d3614460f66f94344fb9c | [
"MIT"
] | null | null | null | """
Copyright (C) 2019 the LSNN team, TU Graz
"""
__author__ = 'guillaume'
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import patches
from matplotlib import cm
from collections import OrderedDict
from matplotlib.colors import LinearSegmentedColormap
import scipy as si
... | 27.44186 | 145 | 0.608898 |
4e3b4e1f5ab08a1a154b819ffbe3424f853569f3 | 15,430 | py | Python | scenarios/application_performance_scalabilty.py | jpavlav/cbtool | ed1e65dd50aa76fc6388999b36f1305c23b708d8 | [
"Apache-2.0"
] | 69 | 2015-01-29T14:19:57.000Z | 2021-12-05T13:21:37.000Z | scenarios/application_performance_scalabilty.py | jpavlav/cbtool | ed1e65dd50aa76fc6388999b36f1305c23b708d8 | [
"Apache-2.0"
] | 132 | 2015-01-07T21:39:11.000Z | 2022-01-28T19:12:18.000Z | scenarios/application_performance_scalabilty.py | jpavlav/cbtool | ed1e65dd50aa76fc6388999b36f1305c23b708d8 | [
"Apache-2.0"
] | 50 | 2015-02-10T15:53:22.000Z | 2022-01-13T06:22:10.000Z | #!/usr/bin/env python
#/*******************************************************************************
# Copyright (c) 2012 IBM Corp.
# 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
# ht... | 39.66581 | 157 | 0.607129 |
aedc647aff36e47ca57f42620fd2dd1123b74bc0 | 1,004 | py | Python | server.py | objectc/smart_remote | 86a71c76fd04461e3071b285eb3683f643902aaf | [
"MIT"
] | 1 | 2020-08-16T15:41:04.000Z | 2020-08-16T15:41:04.000Z | server.py | objectc/smart_remote | 86a71c76fd04461e3071b285eb3683f643902aaf | [
"MIT"
] | null | null | null | server.py | objectc/smart_remote | 86a71c76fd04461e3071b285eb3683f643902aaf | [
"MIT"
] | 1 | 2021-03-01T11:13:25.000Z | 2021-03-01T11:13:25.000Z | import logging
import os
from flask import Flask
from flask import request
from flask import make_response
from flask import abort, jsonify
from flask import Flask
app = Flask(__name__)
logging.getLogger('flask_ask').setLevel(logging.DEBUG)
COMMANDS = {
'POWER': 'POWER',
'COOL': 'COOL',
'SPEED_UP': 'SPEE... | 23.904762 | 71 | 0.624502 |
9760fdeba3e5299a32a8bb669cbd50617014b41e | 1,789 | py | Python | src/svs/assert_hint.py | inacademia-development/svs | a6c91d42b5abd09a7781a417cd26127fd2fb6b01 | [
"Apache-2.0"
] | 1 | 2018-01-30T07:36:02.000Z | 2018-01-30T07:36:02.000Z | src/svs/assert_hint.py | InAcademia/svs | a6c91d42b5abd09a7781a417cd26127fd2fb6b01 | [
"Apache-2.0"
] | 10 | 2020-01-21T15:02:49.000Z | 2020-10-15T08:26:27.000Z | src/svs/assert_hint.py | inacademia-development/svs | a6c91d42b5abd09a7781a417cd26127fd2fb6b01 | [
"Apache-2.0"
] | 1 | 2018-08-02T12:31:22.000Z | 2018-08-02T12:31:22.000Z | """
Micro Service that asserts the requested idp_hint
"""
import hashlib
import logging
from satosa.internal_data import InternalResponse
from satosa.micro_services.base import ResponseMicroService
logger = logging.getLogger('satosa')
def inacademia_hinting_hash(data):
"""
Hash data the same way this is done... | 37.270833 | 108 | 0.708776 |
866a91a2a61280a89bd4dbe72f158da89c1622c4 | 6,040 | py | Python | instagrapi/types.py | jhd3197/instagrapi | cf05591ba8397856871ce7daae5458cfc4f527da | [
"MIT"
] | 1 | 2020-12-29T12:24:03.000Z | 2020-12-29T12:24:03.000Z | instagrapi/types.py | jhd3197/instagrapi | cf05591ba8397856871ce7daae5458cfc4f527da | [
"MIT"
] | null | null | null | instagrapi/types.py | jhd3197/instagrapi | cf05591ba8397856871ce7daae5458cfc4f527da | [
"MIT"
] | null | null | null | from datetime import datetime
from typing import List, Optional
from pydantic import BaseModel, FilePath, HttpUrl
class Resource(BaseModel):
pk: int
video_url: Optional[HttpUrl] # for Video and IGTV
thumbnail_url: HttpUrl
media_type: int
class User(BaseModel):
pk: int
username: str
ful... | 22.706767 | 70 | 0.671026 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.