hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | 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 245 | max_issues_repo_name stringlengths 6 130 | 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 245 | max_forks_repo_name stringlengths 6 130 | 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 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
08fca8549867210f9b03b94273a3cd186b277178 | 1,553 | py | Python | env/lib/python3.8/site-packages/plotly/validators/sunburst/marker/colorbar/_tickfont.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | env/lib/python3.8/site-packages/plotly/validators/sunburst/marker/colorbar/_tickfont.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | env/lib/python3.8/site-packages/plotly/validators/sunburst/marker/colorbar/_tickfont.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import _plotly_utils.basevalidators
class TickfontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="tickfont", parent_name="sunburst.marker.colorbar", **kwargs
):
super(TickfontValidator, self).__init__(
plotly_name=plotly_name,
... | 38.825 | 86 | 0.558274 | import _plotly_utils.basevalidators
class TickfontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="tickfont", parent_name="sunburst.marker.colorbar", **kwargs
):
super(TickfontValidator, self).__init__(
plotly_name=plotly_name,
... | true | true |
08fca893c212ab0d101f0ef851858d63fb25fafa | 2,766 | py | Python | main.py | AshimaM29/15-puzzle | e260983241eeaf87655962f4fe59e3bcf69aa7eb | [
"MIT"
] | null | null | null | main.py | AshimaM29/15-puzzle | e260983241eeaf87655962f4fe59e3bcf69aa7eb | [
"MIT"
] | null | null | null | main.py | AshimaM29/15-puzzle | e260983241eeaf87655962f4fe59e3bcf69aa7eb | [
"MIT"
] | null | null | null | from flask import Flask, render_template, request, redirect, url_for, json
from flaskext.mysql import MySQL
from decimal import Decimal
from IDAStar import *
app = Flask(__name__)
app.secret_key = 'ssh...Big secret!'
mysql = MySQL()
app.config['MYSQL_DATABASE_USER'] = 'root'
app.config['MYSQL_DATABASE_DB'] = 'puzzle... | 24.696429 | 114 | 0.687997 | from flask import Flask, render_template, request, redirect, url_for, json
from flaskext.mysql import MySQL
from decimal import Decimal
from IDAStar import *
app = Flask(__name__)
app.secret_key = 'ssh...Big secret!'
mysql = MySQL()
app.config['MYSQL_DATABASE_USER'] = 'root'
app.config['MYSQL_DATABASE_DB'] = 'puzzle... | false | true |
08fcab3ff43fc2888e064114404a891a18aa7755 | 1,300 | py | Python | The 88th Puzzle_1.py | Darkhunter9/python | 8caa3d0aa4b06e5e48871ff085fc740b0ea2d7aa | [
"MIT"
] | null | null | null | The 88th Puzzle_1.py | Darkhunter9/python | 8caa3d0aa4b06e5e48871ff085fc740b0ea2d7aa | [
"MIT"
] | null | null | null | The 88th Puzzle_1.py | Darkhunter9/python | 8caa3d0aa4b06e5e48871ff085fc740b0ea2d7aa | [
"MIT"
] | 1 | 2022-01-08T00:20:15.000Z | 2022-01-08T00:20:15.000Z | GOAL = (1, 2, 1, 0, 2, 0, 0, 3, 0, 4, 3, 4)
def puzzle88(state):
def rotate(n, st):
wk = list(st)
if n == 1:
wk[0], wk[3], wk[5], wk[2] = st[2], st[0], st[3], st[5]
if n == 2:
wk[1], wk[4], wk[6], wk[3] = st[3], st[1], st[4], st[6]
if n == 3:
w... | 31.707317 | 107 | 0.466154 | GOAL = (1, 2, 1, 0, 2, 0, 0, 3, 0, 4, 3, 4)
def puzzle88(state):
def rotate(n, st):
wk = list(st)
if n == 1:
wk[0], wk[3], wk[5], wk[2] = st[2], st[0], st[3], st[5]
if n == 2:
wk[1], wk[4], wk[6], wk[3] = st[3], st[1], st[4], st[6]
if n == 3:
w... | true | true |
08fcac7496f8d7ffb204fe010b834ccdf57a3407 | 28,722 | py | Python | keylime/tenant_webapp.py | cjustacoder/keylime | 351fa1d0f7b87da57ae2522974bb737356ed6352 | [
"BSD-2-Clause"
] | null | null | null | keylime/tenant_webapp.py | cjustacoder/keylime | 351fa1d0f7b87da57ae2522974bb737356ed6352 | [
"BSD-2-Clause"
] | null | null | null | keylime/tenant_webapp.py | cjustacoder/keylime | 351fa1d0f7b87da57ae2522974bb737356ed6352 | [
"BSD-2-Clause"
] | 1 | 2019-11-06T22:48:52.000Z | 2019-11-06T22:48:52.000Z | #!/usr/bin/python3
'''
DISTRIBUTION STATEMENT A. Approved for public release: distribution unlimited.
This material is based upon work supported by the Assistant Secretary of Defense for
Research and Engineering under Air Force Contract No. FA8721-05-C-0002 and/or
FA8702-15-D-0001. Any opinions, findings, conclusions... | 44.119816 | 167 | 0.538925 |
import base64
import functools
import os
import ssl
import configparser
import traceback
import sys
try:
import simplejson as json
except ImportError:
raise("Simplejson is mandatory, please install")
import tornado.ioloop
import tornado.web
from tornado import httpserver
from tornado.httpclient import AsyncH... | true | true |
08fcae586eedc858a600de3ea2f91e2378823fb0 | 1,416 | py | Python | test/functional/feature_reindex.py | Shurabthini/tapyrus-core | 1efe8749071672d1d7581aa4a853237eb84b5974 | [
"MIT"
] | 40 | 2019-10-07T04:30:45.000Z | 2022-02-23T16:24:10.000Z | test/functional/feature_reindex.py | Shurabthini/tapyrus-core | 1efe8749071672d1d7581aa4a853237eb84b5974 | [
"MIT"
] | 78 | 2019-10-09T07:21:19.000Z | 2022-03-01T06:32:23.000Z | test/functional/feature_reindex.py | Naviabheeman/tapyrus-core | 2b554a6f6eaa12d24d628b64e1a269ffee65815f | [
"MIT"
] | 11 | 2019-11-14T08:08:42.000Z | 2021-09-15T12:31:36.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Copyright (c) 2019 Chaintope Inc.
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test running bitcoind with -reindex and -reindex-chainstate options... | 36.307692 | 106 | 0.714689 |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import wait_until
class ReindexTest(BitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 1
def reindex(self, justchainstate=False):
self.nodes[0].genera... | true | true |
08fcafa2b0404a7f231a72497695b42124d66dd1 | 149 | py | Python | Agenda_Zero_ILumi_Teste/Agenda_Zero_ILumi/Agenda_Zero_ILumi_Project/Agenda_Zero_ILumi_Core_App/views.py | ZeroILumi/Zero_ILumi_Agenda_Django | 1a34c12e92e233b0e3d96f34b78d235f88fc7124 | [
"MIT"
] | null | null | null | Agenda_Zero_ILumi_Teste/Agenda_Zero_ILumi/Agenda_Zero_ILumi_Project/Agenda_Zero_ILumi_Core_App/views.py | ZeroILumi/Zero_ILumi_Agenda_Django | 1a34c12e92e233b0e3d96f34b78d235f88fc7124 | [
"MIT"
] | null | null | null | Agenda_Zero_ILumi_Teste/Agenda_Zero_ILumi/Agenda_Zero_ILumi_Project/Agenda_Zero_ILumi_Core_App/views.py | ZeroILumi/Zero_ILumi_Agenda_Django | 1a34c12e92e233b0e3d96f34b78d235f88fc7124 | [
"MIT"
] | null | null | null | from django.shortcuts import render
# Create your views here.
def listar_eventos_agendados(request):
render(request, 'zero_ilumi_agenda.html')
| 21.285714 | 45 | 0.791946 | from django.shortcuts import render
def listar_eventos_agendados(request):
render(request, 'zero_ilumi_agenda.html')
| true | true |
08fcafbea55bee4245c007420c97077dc0100a9b | 381,793 | py | Python | gc3_query/var/scratchpad/beta_01/r_result_json.py | ericmharris/gc3-query | 0bf5226130aafbb1974aeb96d93ee1996833e87d | [
"MIT"
] | null | null | null | gc3_query/var/scratchpad/beta_01/r_result_json.py | ericmharris/gc3-query | 0bf5226130aafbb1974aeb96d93ee1996833e87d | [
"MIT"
] | null | null | null | gc3_query/var/scratchpad/beta_01/r_result_json.py | ericmharris/gc3-query | 0bf5226130aafbb1974aeb96d93ee1996833e87d | [
"MIT"
] | null | null | null | r_result_json = {
'result': [{
'dst_is_ip':
'false',
'src_is_ip':
'true',
'dst_list':
'seclist:/Compute-587626604/mayurnath.gokare@oracle.com/paas/SOA/gc3ntagrogr605/lb/ora_otd_infraadmin',
'name':
'/Compute-587626604/mayurnath.gokare@o... | 41.070676 | 189 | 0.591022 | r_result_json = {
'result': [{
'dst_is_ip':
'false',
'src_is_ip':
'true',
'dst_list':
'seclist:/Compute-587626604/mayurnath.gokare@oracle.com/paas/SOA/gc3ntagrogr605/lb/ora_otd_infraadmin',
'name':
'/Compute-587626604/mayurnath.gokare@o... | true | true |
08fcafe28637604bef1a99e2b9881e4b031a4d89 | 633 | py | Python | edj/Spot_test.py | CircuitLaunch/Spot_Bootcamp | 47735ce474a59c5478099f6095b68c46b77d3da6 | [
"BSD-3-Clause"
] | null | null | null | edj/Spot_test.py | CircuitLaunch/Spot_Bootcamp | 47735ce474a59c5478099f6095b68c46b77d3da6 | [
"BSD-3-Clause"
] | null | null | null | edj/Spot_test.py | CircuitLaunch/Spot_Bootcamp | 47735ce474a59c5478099f6095b68c46b77d3da6 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
from Spot import *
import time
if __name__ == '__main__':
spot = Spot()
try:
# It's ALIVE!
spot.power_on()
# Strike some poses
spot.stand()
time.sleep(5.0)
spot.belly_rub(direction=BELLY_RUB_RIGHT)
time.sleep(10.0)
spot... | 16.657895 | 53 | 0.541864 |
from Spot import *
import time
if __name__ == '__main__':
spot = Spot()
try:
spot.power_on()
# Strike some poses
spot.stand()
time.sleep(5.0)
spot.belly_rub(direction=BELLY_RUB_RIGHT)
time.sleep(10.0)
spot.power_on()
spot.self_right(... | true | true |
08fcb04cc49bed0eb145c67b18a0a9734c0640f4 | 1,294 | py | Python | tests/xlfunctions_vs_excel/datedif_test.py | ckp95/xlcalculator | 8f3f04a2a0a2ecb12c3d5837a5b13519137ae427 | [
"MIT"
] | 54 | 2020-04-26T09:18:29.000Z | 2022-03-30T08:47:45.000Z | tests/xlfunctions_vs_excel/datedif_test.py | st-lo/xlcalculator | 19190ec90e948b7ab1eceb06448b96cc1728bc51 | [
"MIT"
] | 41 | 2020-05-04T04:12:36.000Z | 2022-01-31T02:41:05.000Z | tests/xlfunctions_vs_excel/datedif_test.py | st-lo/xlcalculator | 19190ec90e948b7ab1eceb06448b96cc1728bc51 | [
"MIT"
] | 21 | 2020-05-21T20:49:23.000Z | 2022-02-20T14:15:56.000Z | from .. import testing
class DatedifTest(testing.FunctionalTestCase):
filename = "DATEDIF.xlsx"
def test_counta_evaluation_Y(self):
excel_value = self.evaluator.get_cell_value('Sheet1!C2')
value = self.evaluator.evaluate('Sheet1!C2')
self.assertEqual(excel_value, value)
def test_... | 35.944444 | 64 | 0.693199 | from .. import testing
class DatedifTest(testing.FunctionalTestCase):
filename = "DATEDIF.xlsx"
def test_counta_evaluation_Y(self):
excel_value = self.evaluator.get_cell_value('Sheet1!C2')
value = self.evaluator.evaluate('Sheet1!C2')
self.assertEqual(excel_value, value)
def test_... | true | true |
08fcb0d4eadf3b8b3da427cec1ed0a17f741e58f | 6,470 | py | Python | converter/converter.py | tz301/kaldi-onnx-tf | 61ad1fbe532b0c5e8a0f82bf8c54ab12267fba74 | [
"Apache-2.0"
] | null | null | null | converter/converter.py | tz301/kaldi-onnx-tf | 61ad1fbe532b0c5e8a0f82bf8c54ab12267fba74 | [
"Apache-2.0"
] | null | null | null | converter/converter.py | tz301/kaldi-onnx-tf | 61ad1fbe532b0c5e8a0f82bf8c54ab12267fba74 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Created by tz301 on 2020/05/22
"""Convert kaldi model to tensorflow pb."""
import logging
from argparse import ArgumentParser
from os import environ
from pathlib import Path
from subprocess import run
from tempfile import TemporaryDirectory
from onnx import ModelProto
f... | 35.163043 | 80 | 0.682844 | import logging
from argparse import ArgumentParser
from os import environ
from pathlib import Path
from subprocess import run
from tempfile import TemporaryDirectory
from onnx import ModelProto
from onnx_tf.backend import prepare
from converter import component as cop
from converter import node
from converter.graph i... | true | true |
08fcb1e871e920dd440fc26f5ffb9efee56be532 | 2,884 | py | Python | src/optimization/BayesianOptimizationCV.py | lyonva/Nue | 90680de00b0c76f6bfdbed71b785671e7c3a3f54 | [
"Apache-2.0"
] | null | null | null | src/optimization/BayesianOptimizationCV.py | lyonva/Nue | 90680de00b0c76f6bfdbed71b785671e7c3a3f54 | [
"Apache-2.0"
] | null | null | null | src/optimization/BayesianOptimizationCV.py | lyonva/Nue | 90680de00b0c76f6bfdbed71b785671e7c3a3f54 | [
"Apache-2.0"
] | null | null | null | from sklearn.model_selection._search import BaseSearchCV
import numpy as np
from optimization import grid_to_bounds, grid_types, cast_parameters, aggregate_dict
import pandas as pd
from sklearn.model_selection import train_test_split
import nevergrad as ng
from optimization import BaseOptimizer
# Generic interface for... | 53.407407 | 125 | 0.686893 | from sklearn.model_selection._search import BaseSearchCV
import numpy as np
from optimization import grid_to_bounds, grid_types, cast_parameters, aggregate_dict
import pandas as pd
from sklearn.model_selection import train_test_split
import nevergrad as ng
from optimization import BaseOptimizer
class BayesianOptimizat... | true | true |
08fcb31203463f8909219a25e7b937f2764b4fa9 | 320 | py | Python | array/shortest_distance_character.py | elenaborisova/LeetCode-Solutions | 98376aab7fd150a724e316357ae5ea46988d9eac | [
"MIT"
] | null | null | null | array/shortest_distance_character.py | elenaborisova/LeetCode-Solutions | 98376aab7fd150a724e316357ae5ea46988d9eac | [
"MIT"
] | null | null | null | array/shortest_distance_character.py | elenaborisova/LeetCode-Solutions | 98376aab7fd150a724e316357ae5ea46988d9eac | [
"MIT"
] | null | null | null | def shortest_to_char(s, c):
answer = []
c_indices = [i for i in range(len(s)) if s[i] == c]
for i in range(len(s)):
distance = min([abs(j - i) for j in c_indices])
answer.append(distance)
return answer
print(shortest_to_char('loveleetcode', 'e'))
print(shortest_to_char('aaab', 'b'))
| 22.857143 | 55 | 0.609375 | def shortest_to_char(s, c):
answer = []
c_indices = [i for i in range(len(s)) if s[i] == c]
for i in range(len(s)):
distance = min([abs(j - i) for j in c_indices])
answer.append(distance)
return answer
print(shortest_to_char('loveleetcode', 'e'))
print(shortest_to_char('aaab', 'b'))
| true | true |
08fcb3faf3012e5ea0e283695d10a148144a0559 | 5,134 | py | Python | common/utils/preprocessing.py | Qin-Folks/I2L-MeshNet_RELEASE | d250b00a0e2146cc612802d456d1d96387ad2231 | [
"MIT"
] | 544 | 2020-07-15T08:44:01.000Z | 2022-03-31T07:53:38.000Z | common/utils/preprocessing.py | CV-IP/I2L-MeshNet_RELEASE | 2749441e03ae77d42837a4d8f0287e537d5e768c | [
"MIT"
] | 110 | 2020-08-11T19:22:31.000Z | 2022-03-21T10:54:34.000Z | common/utils/preprocessing.py | CV-IP/I2L-MeshNet_RELEASE | 2749441e03ae77d42837a4d8f0287e537d5e768c | [
"MIT"
] | 127 | 2020-08-11T05:12:19.000Z | 2022-03-24T02:42:59.000Z | import numpy as np
import cv2
import random
from config import cfg
import math
def load_img(path, order='RGB'):
img = cv2.imread(path, cv2.IMREAD_COLOR | cv2.IMREAD_IGNORE_ORIENTATION)
if not isinstance(img, np.ndarray):
raise IOError("Fail to read %s" % path)
if order=='RGB':
img = img[:,... | 33.122581 | 126 | 0.6194 | import numpy as np
import cv2
import random
from config import cfg
import math
def load_img(path, order='RGB'):
img = cv2.imread(path, cv2.IMREAD_COLOR | cv2.IMREAD_IGNORE_ORIENTATION)
if not isinstance(img, np.ndarray):
raise IOError("Fail to read %s" % path)
if order=='RGB':
img = img[:,... | true | true |
08fcb555bb502d99c5977b56e92d152b4b0fbacc | 3,520 | py | Python | ebot_main/scripts/main_task4.py | Jovian-Dsouza/sahayak_bot | 3565e910218e73e95ed8ce9b9d92dfcbe537894e | [
"MIT"
] | 3 | 2021-10-02T10:36:48.000Z | 2022-03-18T15:47:17.000Z | ebot_main/scripts/main_task4.py | Jovian-Dsouza/sahayak_bot | 3565e910218e73e95ed8ce9b9d92dfcbe537894e | [
"MIT"
] | 2 | 2021-10-06T07:21:57.000Z | 2022-03-04T03:20:27.000Z | ebot_main/scripts/main_task4.py | Jovian-Dsouza/sahayak_bot | 3565e910218e73e95ed8ce9b9d92dfcbe537894e | [
"MIT"
] | 1 | 2021-09-06T16:34:45.000Z | 2021-09-06T16:34:45.000Z | #! /usr/bin/env python
'''
This node uses the detection_info topic and performs the actual Ur5 arm manipulation
'''
import rospy
import random
import math
from geometry_msgs.msg import Point, Quaternion, Pose , PointStamped
from std_msgs.msg import Header
from object_msgs.msg import ObjectPose
from std_srvs.srv impo... | 30.08547 | 149 | 0.640625 |
import rospy
import random
import math
from geometry_msgs.msg import Point, Quaternion, Pose , PointStamped
from std_msgs.msg import Header
from object_msgs.msg import ObjectPose
from std_srvs.srv import Empty
from tf.transformations import quaternion_from_euler
from tf.transformations import euler_from_quaternion
... | true | true |
08fcb5807344dd4bb08d7f4afa5d12b70bf8af93 | 34,160 | py | Python | second/core/box_np_ops.py | RickOnEarth/pointpillars_based_CLOCs | c6d4576a151540200dac2354b00dc4ecce6ee72d | [
"MIT"
] | 2 | 2022-01-05T08:41:38.000Z | 2022-02-14T01:30:08.000Z | second/core/box_np_ops.py | RickOnEarth/pointpillars_based_CLOCs | c6d4576a151540200dac2354b00dc4ecce6ee72d | [
"MIT"
] | 1 | 2022-03-28T03:23:36.000Z | 2022-03-28T03:23:36.000Z | second/core/box_np_ops.py | RickOnEarth/pointpillars_based_CLOCs | c6d4576a151540200dac2354b00dc4ecce6ee72d | [
"MIT"
] | 2 | 2022-01-07T05:56:43.000Z | 2022-02-16T13:26:13.000Z | import numba
from pathlib import Path
import numpy as np
from second.utils.buildtools.pybind11_build import load_pb11
from second.core.geometry import points_in_convex_polygon_3d_jit
from second.core.non_max_suppression.nms_gpu import rotate_iou_gpu_eval
try:
from second.core import box_ops_cc
except:
current... | 36.731183 | 135 | 0.570755 | import numba
from pathlib import Path
import numpy as np
from second.utils.buildtools.pybind11_build import load_pb11
from second.core.geometry import points_in_convex_polygon_3d_jit
from second.core.non_max_suppression.nms_gpu import rotate_iou_gpu_eval
try:
from second.core import box_ops_cc
except:
current... | true | true |
08fcb5b29cbd501f581f3cf6266e58caad1eeb40 | 6,612 | py | Python | setup-app.py | ibmjstart/cf-letsencrypt | ac3dac3bcb7f78060bcc51a3359e4a99eff05996 | [
"MIT"
] | 37 | 2016-10-24T00:38:59.000Z | 2020-11-05T15:46:55.000Z | setup-app.py | ibmjstart/cf-letsencrypt | ac3dac3bcb7f78060bcc51a3359e4a99eff05996 | [
"MIT"
] | 29 | 2016-08-12T22:28:43.000Z | 2020-07-20T23:19:00.000Z | setup-app.py | ibmjstart/cf-letsencrypt | ac3dac3bcb7f78060bcc51a3359e4a99eff05996 | [
"MIT"
] | 25 | 2017-01-20T15:04:56.000Z | 2020-06-22T15:40:15.000Z | import requests
import json
import yaml
from subprocess import call, check_call, Popen, PIPE
import sys
import time
# Define some helper functions
def domain_has_ssl(domain, full_host, print_info=False):
"""domain_has_ssl uses the two most-reliable ways to check for an SSL on
a domain name within bluemix. It ... | 38.666667 | 127 | 0.684059 | import requests
import json
import yaml
from subprocess import call, check_call, Popen, PIPE
import sys
import time
def domain_has_ssl(domain, full_host, print_info=False):
pipe = Popen("ibmcloud app domain-cert %s" % domain,
stdout=PIPE, shell=True)
output = pipe.stdout.read().decode("unicod... | true | true |
08fcb63c7e4b34fc30887b349a61d6a04af48bb9 | 111 | py | Python | Week1/Tarefa 02/Exercicio_02_matrizes_multiplicaveis.py | WesGtoX/Intro-Computer-Science-with-Python-Part02 | 9dc53362c32575b63d8d1c06c201bc7a01bc07b6 | [
"MIT"
] | null | null | null | Week1/Tarefa 02/Exercicio_02_matrizes_multiplicaveis.py | WesGtoX/Intro-Computer-Science-with-Python-Part02 | 9dc53362c32575b63d8d1c06c201bc7a01bc07b6 | [
"MIT"
] | null | null | null | Week1/Tarefa 02/Exercicio_02_matrizes_multiplicaveis.py | WesGtoX/Intro-Computer-Science-with-Python-Part02 | 9dc53362c32575b63d8d1c06c201bc7a01bc07b6 | [
"MIT"
] | null | null | null | def sao_multiplicaveis(m1, m2):
col1, lin2 = len(m1[0]), len(m2)
return True if col1 == lin2 else False | 37 | 42 | 0.657658 | def sao_multiplicaveis(m1, m2):
col1, lin2 = len(m1[0]), len(m2)
return True if col1 == lin2 else False | true | true |
08fcb67bb1d59b2da208a83d071920caa652b5ce | 185 | py | Python | Pipeline/main/AssetSelection/lib/__init__.py | simonydbutt/b2a | 0bf4a6de8547d73ace22967780442deeaff2d5c6 | [
"MIT"
] | 2 | 2018-07-01T03:36:24.000Z | 2020-02-13T17:22:46.000Z | Pipeline/main/AssetSelection/lib/__init__.py | simonydbutt/b2a | 0bf4a6de8547d73ace22967780442deeaff2d5c6 | [
"MIT"
] | null | null | null | Pipeline/main/AssetSelection/lib/__init__.py | simonydbutt/b2a | 0bf4a6de8547d73ace22967780442deeaff2d5c6 | [
"MIT"
] | null | null | null | from Pipeline.main.AssetSelection.lib.All import All
from Pipeline.main.AssetSelection.lib.BaseVolume import BaseVolume
from Pipeline.main.AssetSelection.lib.AllNomics import AllNomics
| 46.25 | 66 | 0.87027 | from Pipeline.main.AssetSelection.lib.All import All
from Pipeline.main.AssetSelection.lib.BaseVolume import BaseVolume
from Pipeline.main.AssetSelection.lib.AllNomics import AllNomics
| true | true |
08fcb703dfe5837606ffce94d65e9b942a12c215 | 6,673 | py | Python | nebula_meta/tests/test_value_type.py | threathunterX/python_lib | e2d4052de04c82cb7bccd08042f28db824cab442 | [
"Apache-2.0"
] | 2 | 2019-03-17T04:03:08.000Z | 2019-05-01T09:42:23.000Z | nebula_meta/tests/test_value_type.py | threathunterX/python_lib | e2d4052de04c82cb7bccd08042f28db824cab442 | [
"Apache-2.0"
] | null | null | null | nebula_meta/tests/test_value_type.py | threathunterX/python_lib | e2d4052de04c82cb7bccd08042f28db824cab442 | [
"Apache-2.0"
] | 4 | 2019-06-24T05:47:24.000Z | 2020-09-29T05:00:31.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from nebula_meta.value_type import get_supported_types
from nebula_meta.value_type import is_value_valid, convert_value_by_type, is_value_type_supported
def test_support_types():
assert 'long' in get_supported_types()
assert 'double' in get_supported_types()
... | 47.664286 | 109 | 0.588791 |
from nebula_meta.value_type import get_supported_types
from nebula_meta.value_type import is_value_valid, convert_value_by_type, is_value_type_supported
def test_support_types():
assert 'long' in get_supported_types()
assert 'double' in get_supported_types()
assert 'string' in get_supported_types()
... | true | true |
08fcb7607c5cc9e1b94272ee5f4ae112847e84d0 | 1,045 | py | Python | 11-mail_lists/start_11_blue_yellow_app/blue_yellow_app/controllers/home_controller.py | g2gcio/course-demo | b0d00a6ac7a6a6a17af963cee67cf13dc5941e95 | [
"MIT"
] | 276 | 2016-04-04T20:57:36.000Z | 2022-03-12T02:42:46.000Z | 11-mail_lists/start_11_blue_yellow_app/blue_yellow_app/controllers/home_controller.py | g2gcio/course-demo | b0d00a6ac7a6a6a17af963cee67cf13dc5941e95 | [
"MIT"
] | 37 | 2016-10-13T12:04:27.000Z | 2020-11-22T10:36:53.000Z | 11-mail_lists/start_11_blue_yellow_app/blue_yellow_app/controllers/home_controller.py | g2gcio/course-demo | b0d00a6ac7a6a6a17af963cee67cf13dc5941e95 | [
"MIT"
] | 163 | 2016-10-03T02:10:00.000Z | 2022-03-25T03:43:01.000Z | import pyramid_handlers
from blue_yellow_app.controllers.base_controller import BaseController
from blue_yellow_app.infrastructure.supressor import suppress
class HomeController(BaseController):
alternate_mode = False
@pyramid_handlers.action(renderer='templates/home/index.pt')
def index(self):
r... | 26.794872 | 72 | 0.690909 | import pyramid_handlers
from blue_yellow_app.controllers.base_controller import BaseController
from blue_yellow_app.infrastructure.supressor import suppress
class HomeController(BaseController):
alternate_mode = False
@pyramid_handlers.action(renderer='templates/home/index.pt')
def index(self):
r... | true | true |
08fcb7c363f0e3620a5636b68cd6a167b16d9a74 | 2,100 | py | Python | loggerBot/common/rawWsOutput.py | mcpiroman/jarchiwum-server | e219eb0380bb4880fb83009fab21a4a1bf1a70ba | [
"MIT"
] | null | null | null | loggerBot/common/rawWsOutput.py | mcpiroman/jarchiwum-server | e219eb0380bb4880fb83009fab21a4a1bf1a70ba | [
"MIT"
] | null | null | null | loggerBot/common/rawWsOutput.py | mcpiroman/jarchiwum-server | e219eb0380bb4880fb83009fab21a4a1bf1a70ba | [
"MIT"
] | null | null | null | import datetime
import sys
import os
import json
class RawWsOutputFileManager:
def __init__(self, targetDir):
self.targetDir = targetDir
self.currentFile = None
self.currentFileDate = None
def connection_opened(self):
self._write_event_base("opened")
def connec... | 33.870968 | 104 | 0.601429 | import datetime
import sys
import os
import json
class RawWsOutputFileManager:
def __init__(self, targetDir):
self.targetDir = targetDir
self.currentFile = None
self.currentFileDate = None
def connection_opened(self):
self._write_event_base("opened")
def connec... | true | true |
08fcb7d9894f31361381a36af91ac118f98430e5 | 473 | py | Python | proxypool/proxypool/proxypool/LosmliProxyPool/crawler/ajax/ajax/pipelines.py | yhr-git/study_git | b509dcc2195c8fab02d4c16a9299f6ba26a192e8 | [
"MIT"
] | null | null | null | proxypool/proxypool/proxypool/LosmliProxyPool/crawler/ajax/ajax/pipelines.py | yhr-git/study_git | b509dcc2195c8fab02d4c16a9299f6ba26a192e8 | [
"MIT"
] | null | null | null | proxypool/proxypool/proxypool/LosmliProxyPool/crawler/ajax/ajax/pipelines.py | yhr-git/study_git | b509dcc2195c8fab02d4c16a9299f6ba26a192e8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from redis import Redis
from LosmliProxyPool.crawler.ajax.ajax import settings
class AjaxPipeline(object):
def open_spider(self, spider):
self.rds = Redis(host=settings.REDIS_HOST, password=settings.REDIS_PASSWORD, db=settings.REDIS_DB)
def process_item(self, item, spider):
... | 31.533333 | 106 | 0.693446 | from redis import Redis
from LosmliProxyPool.crawler.ajax.ajax import settings
class AjaxPipeline(object):
def open_spider(self, spider):
self.rds = Redis(host=settings.REDIS_HOST, password=settings.REDIS_PASSWORD, db=settings.REDIS_DB)
def process_item(self, item, spider):
value = ':'.join(... | true | true |
08fcba22c6b31959c2ca0876641bf7befa214622 | 1,474 | py | Python | bt_consts.py | TangibleDisplay/twiz | 02da1120af19620345ec035dfb69b9da94f8679e | [
"MIT"
] | 14 | 2015-05-15T09:24:31.000Z | 2022-03-08T17:39:03.000Z | bt_consts.py | gaecom/twiz | 02da1120af19620345ec035dfb69b9da94f8679e | [
"MIT"
] | 17 | 2015-02-04T11:00:19.000Z | 2016-06-13T00:56:52.000Z | bt_consts.py | gaecom/twiz | 02da1120af19620345ec035dfb69b9da94f8679e | [
"MIT"
] | 4 | 2015-02-28T14:09:47.000Z | 2020-05-09T18:01:33.000Z | LE_META_EVENT = 0x3e
LE_PUBLIC_ADDRESS = 0x00
LE_RANDOM_ADDRESS = 0x01
LE_SET_SCAN_PARAMETERS_CP_SIZE = 7
OGF_LE_CTL = 0x08
OCF_LE_SET_SCAN_PARAMETERS = 0x000B
OCF_LE_SET_SCAN_ENABLE = 0x000C
OCF_LE_SET_RANDOM_ADDRESS = 0x0005
OCF_LE_CREATE_CONN = 0x000D
LE_ROLE_MASTER = 0x00
LE_ROLE_SLAVE = 0x01
# these are actual... | 23.396825 | 48 | 0.84464 | LE_META_EVENT = 0x3e
LE_PUBLIC_ADDRESS = 0x00
LE_RANDOM_ADDRESS = 0x01
LE_SET_SCAN_PARAMETERS_CP_SIZE = 7
OGF_LE_CTL = 0x08
OCF_LE_SET_SCAN_PARAMETERS = 0x000B
OCF_LE_SET_SCAN_ENABLE = 0x000C
OCF_LE_SET_RANDOM_ADDRESS = 0x0005
OCF_LE_CREATE_CONN = 0x000D
LE_ROLE_MASTER = 0x00
LE_ROLE_SLAVE = 0x01
EVT_LE_CONN_COMPLE... | true | true |
08fcbb1589250ff542b47fa872184e7021cad15f | 138 | py | Python | modularodm/fields/floatfield.py | felliott/modular-odm | 8a34891892b8af69b21fdc46701c91763a5c1cf9 | [
"Apache-2.0"
] | 4 | 2018-09-21T18:57:03.000Z | 2020-10-19T05:38:14.000Z | modularodm/fields/floatfield.py | cos-archives/modular-odm | 8a34891892b8af69b21fdc46701c91763a5c1cf9 | [
"Apache-2.0"
] | null | null | null | modularodm/fields/floatfield.py | cos-archives/modular-odm | 8a34891892b8af69b21fdc46701c91763a5c1cf9 | [
"Apache-2.0"
] | null | null | null | from . import Field
from ..validators import validate_float
class FloatField(Field):
validate = validate_float
data_type = float | 19.714286 | 39 | 0.76087 | from . import Field
from ..validators import validate_float
class FloatField(Field):
validate = validate_float
data_type = float | true | true |
08fcbbe56bdfedf8bd2f1715b8a4c8656b048602 | 365 | py | Python | pysparktestingexample/stackoverflow.py | zhangabner/pyspark-debug-test | e79ab5f1784900b28b0625badd0cec77c4503071 | [
"CNRI-Python"
] | null | null | null | pysparktestingexample/stackoverflow.py | zhangabner/pyspark-debug-test | e79ab5f1784900b28b0625badd0cec77c4503071 | [
"CNRI-Python"
] | null | null | null | pysparktestingexample/stackoverflow.py | zhangabner/pyspark-debug-test | e79ab5f1784900b28b0625badd0cec77c4503071 | [
"CNRI-Python"
] | null | null | null | from functools import reduce
def rename_chars(column_name):
chars = ((' ', '_&'), ('.', '_$'))
new_cols = reduce(lambda a, kv: a.replace(*kv), chars, column_name)
return new_cols
def column_names(df):
changed_col_names = df.schema.names
for cols in changed_col_names:
df = df.withColumnRen... | 26.071429 | 71 | 0.665753 | from functools import reduce
def rename_chars(column_name):
chars = ((' ', '_&'), ('.', '_$'))
new_cols = reduce(lambda a, kv: a.replace(*kv), chars, column_name)
return new_cols
def column_names(df):
changed_col_names = df.schema.names
for cols in changed_col_names:
df = df.withColumnRen... | true | true |
08fcbc17b883906d90c97a1a9ed6da2398f38ae8 | 79 | py | Python | utils/__init__.py | stasbel/task-gen | d65dde5196d7b81cc27d3da9dc3dbf5def543cf5 | [
"MIT"
] | null | null | null | utils/__init__.py | stasbel/task-gen | d65dde5196d7b81cc27d3da9dc3dbf5def543cf5 | [
"MIT"
] | null | null | null | utils/__init__.py | stasbel/task-gen | d65dde5196d7b81cc27d3da9dc3dbf5def543cf5 | [
"MIT"
] | null | null | null | from .hd import *
from .common import *
__all__ = common.__all__ + hd.__all__ | 15.8 | 37 | 0.721519 | from .hd import *
from .common import *
__all__ = common.__all__ + hd.__all__ | true | true |
08fcbc43aed8e349258b167f71336e2339f25d9d | 12,488 | py | Python | app/xbooks/i.py | carlosal1015/Xbooks | c83d9aa64777b2d68a6312248c15c4dcef601dfc | [
"MIT"
] | 9 | 2019-08-11T20:16:46.000Z | 2021-12-19T09:05:43.000Z | app/xbooks/i.py | XinYaanZyoy/Xbooks | c83d9aa64777b2d68a6312248c15c4dcef601dfc | [
"MIT"
] | 120 | 2019-06-26T08:03:30.000Z | 2021-05-09T22:36:13.000Z | app/xbooks/i.py | XinYaanZyoy/Xbooks | c83d9aa64777b2d68a6312248c15c4dcef601dfc | [
"MIT"
] | 5 | 2019-06-17T19:44:12.000Z | 2021-08-17T03:05:56.000Z | #!/usr/bin/env python
import os, sys
import shutil
from bs4 import BeautifulSoup
import time, datetime
import shutil
from .import ccc, e, cnv
def chooseMonth(num):
"""
returns texted month
"""
if num == "01":
return "JAN"
if num == "02":
return "FEB"
if num == "03":
re... | 40.025641 | 276 | 0.556935 |
import os, sys
import shutil
from bs4 import BeautifulSoup
import time, datetime
import shutil
from .import ccc, e, cnv
def chooseMonth(num):
if num == "01":
return "JAN"
if num == "02":
return "FEB"
if num == "03":
return "MAR"
if num == "04":
return "APR"
if num ... | true | true |
08fcbcaeb42eb68288dc133d902b1cdceebda218 | 2,010 | py | Python | social/backends/stripe.py | dongweiming/flask_reveal | 739a0c49d2fbf5a36c7b9cb11ec1303b9c8b0e83 | [
"BSD-3-Clause"
] | 41 | 2015-01-31T08:23:04.000Z | 2021-03-20T08:55:23.000Z | social/backends/stripe.py | dongweiming/flask_reveal | 739a0c49d2fbf5a36c7b9cb11ec1303b9c8b0e83 | [
"BSD-3-Clause"
] | null | null | null | social/backends/stripe.py | dongweiming/flask_reveal | 739a0c49d2fbf5a36c7b9cb11ec1303b9c8b0e83 | [
"BSD-3-Clause"
] | 19 | 2015-01-17T11:50:35.000Z | 2019-05-01T22:49:02.000Z | """
Stripe OAuth2 support.
This backend adds support for Stripe OAuth2 service. The settings
STRIPE_APP_ID and STRIPE_API_SECRET must be defined with the values
given by Stripe application registration process.
"""
from social.backends.oauth import BaseOAuth2
class StripeOAuth2(BaseOAuth2):
"""Stripe OAuth2 auth... | 34.655172 | 68 | 0.640299 | from social.backends.oauth import BaseOAuth2
class StripeOAuth2(BaseOAuth2):
name = 'stripe'
ID_KEY = 'stripe_user_id'
AUTHORIZATION_URL = 'https://connect.stripe.com/oauth/authorize'
ACCESS_TOKEN_URL = 'https://connect.stripe.com/oauth/token'
ACCESS_TOKEN_METHOD = 'POST'
REDIRECT_STATE = Fals... | true | true |
08fcbcdbe4249cf2fd4ad35460c02e84fa9cf2cc | 4,798 | py | Python | orchestrator/health_status_keeper.py | multiscale-cosim/EBRAINS-FatEndpoint | 6e46a0ded5e1b8c810395406e3e57087e802fbeb | [
"BSD-3-Clause"
] | null | null | null | orchestrator/health_status_keeper.py | multiscale-cosim/EBRAINS-FatEndpoint | 6e46a0ded5e1b8c810395406e3e57087e802fbeb | [
"BSD-3-Clause"
] | null | null | null | orchestrator/health_status_keeper.py | multiscale-cosim/EBRAINS-FatEndpoint | 6e46a0ded5e1b8c810395406e3e57087e802fbeb | [
"BSD-3-Clause"
] | null | null | null | # ------------------------------------------------------------------------------
# Copyright 2020 Forschungszentrum Jülich GmbH and Aix-Marseille Université
# "Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements; and to You under the Apache License, Version 2.0. "
#
# F... | 45.695238 | 87 | 0.651521 | # license agreements; and to You under the Apache License, Version 2.0. "
from datetime import datetime
from EBRAINS_RichEndpoint.orchestrator.health_status import HealthStatus
from EBRAINS_RichEndpoint.orchestrator.health_status_monitor import HealthStatusMonitor
from EBRAINS_RichEndpoint.Application_Companion.common... | true | true |
08fcbd0a81148ff7a391c8b1e9b996e585a27413 | 3,914 | py | Python | person_following/test_dlib_webcam.py | bhavanajain/autonomous-vehicles | 2d0429095b42dd5fc033ba416d770bb1fc4b3fea | [
"MIT"
] | null | null | null | person_following/test_dlib_webcam.py | bhavanajain/autonomous-vehicles | 2d0429095b42dd5fc033ba416d770bb1fc4b3fea | [
"MIT"
] | null | null | null | person_following/test_dlib_webcam.py | bhavanajain/autonomous-vehicles | 2d0429095b42dd5fc033ba416d770bb1fc4b3fea | [
"MIT"
] | null | null | null | import os
import sys
lib_path = "/home/bhavana*/.local/lib/python2.7/site-packages"
if os.path.exists(lib_path):
sys.path.insert(0, lib_path)
import dlib
from imutils.video import VideoStream
from imutils.video import FPS
import argparse
import imutils
import time
import cv2
# construct the argument parser and p... | 33.741379 | 70 | 0.609351 | import os
import sys
lib_path = "/home/bhavana*/.local/lib/python2.7/site-packages"
if os.path.exists(lib_path):
sys.path.insert(0, lib_path)
import dlib
from imutils.video import VideoStream
from imutils.video import FPS
import argparse
import imutils
import time
import cv2
parser = argparse.ArgumentParser()
pa... | true | true |
08fcbd45e777532c5751505a20b284268c21c846 | 959 | py | Python | worf/exceptions.py | gundotio/worf | 45268e3d04ba5a2549d3a4f511d876622c9e0cad | [
"MIT"
] | null | null | null | worf/exceptions.py | gundotio/worf | 45268e3d04ba5a2549d3a4f511d876622c9e0cad | [
"MIT"
] | 33 | 2021-03-05T05:20:30.000Z | 2022-03-16T02:01:45.000Z | worf/exceptions.py | gundotio/worf | 45268e3d04ba5a2549d3a4f511d876622c9e0cad | [
"MIT"
] | null | null | null | class HTTPException(Exception):
def __init__(self, message=None):
super().__init__(message)
if message is not None:
self.message = message
class HTTP400(HTTPException):
message = "Bad Request"
status = 400
class HTTP401(HTTPException):
message = "Unauthorized"
status ... | 17.125 | 81 | 0.68926 | class HTTPException(Exception):
def __init__(self, message=None):
super().__init__(message)
if message is not None:
self.message = message
class HTTP400(HTTPException):
message = "Bad Request"
status = 400
class HTTP401(HTTPException):
message = "Unauthorized"
status ... | true | true |
08fcbfda5a23cb07b52f36d21f8294d3c4076fd8 | 2,926 | py | Python | setup.py | jtpio/p5-notebook | 818f75b8200efc325ffe51046298676560de7514 | [
"BSD-3-Clause"
] | 80 | 2020-03-22T05:51:10.000Z | 2022-03-21T09:17:44.000Z | setup.py | jtpio/p5-notebook | 818f75b8200efc325ffe51046298676560de7514 | [
"BSD-3-Clause"
] | 62 | 2020-03-21T20:12:15.000Z | 2022-03-27T20:29:38.000Z | setup.py | jtpio/p5-notebook | 818f75b8200efc325ffe51046298676560de7514 | [
"BSD-3-Clause"
] | 7 | 2020-03-23T19:08:18.000Z | 2022-02-09T22:01:05.000Z | """
jupyterlite-p5-kernel setup
"""
import json
import sys
from pathlib import Path
import setuptools
HERE = Path(__file__).parent.resolve()
# The name of the project
NAME = "p5-notebook"
PACKAGE = NAME.replace("-", "_")
ensured_targets = []
data_files_spec = []
for folder, labext_name in [
("labextension", "@... | 28.970297 | 83 | 0.642857 | import json
import sys
from pathlib import Path
import setuptools
HERE = Path(__file__).parent.resolve()
NAME = "p5-notebook"
PACKAGE = NAME.replace("-", "_")
ensured_targets = []
data_files_spec = []
for folder, labext_name in [
("labextension", "@p5-notebook/lab-extension"),
("p5-theme-light", "@p5-noteb... | true | true |
08fcc21bc2d9850d992515dcd6d2a474ce3378ef | 2,365 | py | Python | examples/dispFps.py | tech-life-hacking/face_recognition | 51801027025ec772f860c77784b841d8c19ec89e | [
"MIT"
] | null | null | null | examples/dispFps.py | tech-life-hacking/face_recognition | 51801027025ec772f860c77784b841d8c19ec89e | [
"MIT"
] | null | null | null | examples/dispFps.py | tech-life-hacking/face_recognition | 51801027025ec772f860c77784b841d8c19ec89e | [
"MIT"
] | null | null | null | from timeit import default_timer as timer
import cv2
import subprocess
import time
class DispFps():
def __init__(self):
# display variables
self.__width = 80
self.__height = 20
self.__font_size = 0.4
self.__font_width = 1
self.__font_style = cv2.FONT_HERSHEY_COMPLEX
... | 34.275362 | 124 | 0.610148 | from timeit import default_timer as timer
import cv2
import subprocess
import time
class DispFps():
def __init__(self):
self.__width = 80
self.__height = 20
self.__font_size = 0.4
self.__font_width = 1
self.__font_style = cv2.FONT_HERSHEY_COMPLEX
self.__font_... | true | true |
08fcc22d34db976d251d2902d18c331c17c7a59c | 6,214 | py | Python | models/ebconv.py | Daniel-H-99/FBINET | 3f0ff747b1ec430946eb8d2facb6e91c28236f93 | [
"MIT"
] | 18 | 2021-07-16T00:53:36.000Z | 2022-03-24T10:37:02.000Z | models/ebconv.py | Daniel-H-99/FBINET | 3f0ff747b1ec430946eb8d2facb6e91c28236f93 | [
"MIT"
] | null | null | null | models/ebconv.py | Daniel-H-99/FBINET | 3f0ff747b1ec430946eb8d2facb6e91c28236f93 | [
"MIT"
] | 3 | 2021-07-16T15:22:44.000Z | 2021-09-27T10:58:27.000Z | import torch
import torch.nn.functional as F
from torch import nn
from torch.nn.common_types import _size_2_t
import math
import numpy as np
from functools import partial
from typing import Union
from bnn import BConfig, bconfig
from bnn.layers.helpers import copy_paramters
class BinarySoftActivation(torch.autograd... | 32.534031 | 106 | 0.579015 | import torch
import torch.nn.functional as F
from torch import nn
from torch.nn.common_types import _size_2_t
import math
import numpy as np
from functools import partial
from typing import Union
from bnn import BConfig, bconfig
from bnn.layers.helpers import copy_paramters
class BinarySoftActivation(torch.autograd... | true | true |
08fcc330b341bd166ca98704188f1fcc0719d8bb | 61,667 | py | Python | cs-script.py | oleg-shilo/cs-script.st3 | 13fd2d2ff9b70c26d74ef1f9890d36f3bdfa6dc7 | [
"MIT"
] | null | null | null | cs-script.py | oleg-shilo/cs-script.st3 | 13fd2d2ff9b70c26d74ef1f9890d36f3bdfa6dc7 | [
"MIT"
] | null | null | null | cs-script.py | oleg-shilo/cs-script.st3 | 13fd2d2ff9b70c26d74ef1f9890d36f3bdfa6dc7 | [
"MIT"
] | null | null | null | import os
import io
import codecs
import sys
import html
import time
import sublime
import sublime_plugin
import subprocess
import shutil
import signal
import threading
from subprocess import Popen, PIPE, STDOUT
from os import path
version = '1.3.1' # build 0
os.environ["PACKAGE_VERSION"] = version
... | 40.069526 | 202 | 0.504776 | import os
import io
import codecs
import sys
import html
import time
import sublime
import sublime_plugin
import subprocess
import shutil
import signal
import threading
from subprocess import Popen, PIPE, STDOUT
from os import path
version = '1.3.1' os.environ["PACKAGE_VERSION"] = version
from .impo... | true | true |
08fcc48a6d978613d9ec767a8f43715c483e0c8c | 14,022 | py | Python | ImbalancedSelfPU/utils/util.py | JSchweisthal/Positive-and-Unlabeled-Learning-from-Imbalanced-Data | 82e193842e4f6a7b4a0ef476f1104944ef90ee47 | [
"MIT"
] | 1 | 2021-08-03T02:44:33.000Z | 2021-08-03T02:44:33.000Z | ImbalancedSelfPU/utils/util.py | JSchweisthal/Positive-and-Unlabeled-Learning-from-Imbalanced-Data | 82e193842e4f6a7b4a0ef476f1104944ef90ee47 | [
"MIT"
] | null | null | null | ImbalancedSelfPU/utils/util.py | JSchweisthal/Positive-and-Unlabeled-Learning-from-Imbalanced-Data | 82e193842e4f6a7b4a0ef476f1104944ef90ee47 | [
"MIT"
] | 1 | 2021-10-05T14:53:15.000Z | 2021-10-05T14:53:15.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
from sklearn.utils import extmath
non_image_vars = ['Age', 'PTGENDER', 'PTEDUCAT', 'APOE Status', 'MMSCORE', 'CDR', 'AVLT-LTM', 'AVLT-Total', 'ADAS']
one_hot_vars = {"APOE Status": {'NC': 0, 'HT':... | 38.842105 | 144 | 0.615889 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
from sklearn.utils import extmath
non_image_vars = ['Age', 'PTGENDER', 'PTEDUCAT', 'APOE Status', 'MMSCORE', 'CDR', 'AVLT-LTM', 'AVLT-Total', 'ADAS']
one_hot_vars = {"APOE Status": {'NC': 0, 'HT':... | true | true |
08fcc5063dd5216e6a5c934b2140d7cda4fb512d | 8,721 | py | Python | maskrcnn_benchmark/modeling/poolers.py | wuyuebupt/doubleheadsrcnn | a744b4121d52935741f49d845bae7878270ea291 | [
"MIT"
] | 60 | 2020-04-20T00:21:23.000Z | 2022-01-23T10:32:07.000Z | maskrcnn_benchmark/modeling/poolers.py | wuyuebupt/doubleheadsrcnn | a744b4121d52935741f49d845bae7878270ea291 | [
"MIT"
] | 10 | 2020-07-13T14:00:00.000Z | 2022-03-10T08:53:09.000Z | maskrcnn_benchmark/modeling/poolers.py | wuyuebupt/doubleheadsrcnn | a744b4121d52935741f49d845bae7878270ea291 | [
"MIT"
] | 11 | 2020-06-18T04:08:29.000Z | 2022-03-10T20:38:18.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import torch
import torch.nn.functional as F
from torch import nn
from maskrcnn_benchmark.layers import ROIAlign
from .utils import cat
class LevelMapper(object):
"""Determine which FPN level each RoI in a set of RoIs should map to based
... | 35.165323 | 90 | 0.592019 | import torch
import torch.nn.functional as F
from torch import nn
from maskrcnn_benchmark.layers import ROIAlign
from .utils import cat
class LevelMapper(object):
def __init__(self, k_min, k_max, canonical_scale=224, canonical_level=4, eps=1e-6):
self.k_min = k_min
self.k_max = k_max
se... | true | true |
08fcc6166e905ba8028222cc268e701e8f04ec27 | 212 | py | Python | Chapter10/06/hello_microservice.py | susumuasaga/Python-Web-Scraping-Cookbook | dcb6241c5ead11070648b9c829b18f4e0d90f464 | [
"MIT"
] | 1 | 2019-09-29T13:58:54.000Z | 2019-09-29T13:58:54.000Z | Chapter10/06/hello_microservice.py | MindaugasVaitkus2/Python-Web-Scraping-Cookbook | dcb6241c5ead11070648b9c829b18f4e0d90f464 | [
"MIT"
] | null | null | null | Chapter10/06/hello_microservice.py | MindaugasVaitkus2/Python-Web-Scraping-Cookbook | dcb6241c5ead11070648b9c829b18f4e0d90f464 | [
"MIT"
] | null | null | null | from nameko.rpc import rpc
class HelloMicroService:
name = "hello_microservice"
@rpc
def hello(self, name):
print('Received a request from: ' + name)
return "Hello, {}!".format(name) | 23.555556 | 49 | 0.636792 | from nameko.rpc import rpc
class HelloMicroService:
name = "hello_microservice"
@rpc
def hello(self, name):
print('Received a request from: ' + name)
return "Hello, {}!".format(name) | true | true |
08fcc638496e3a9aea2c33aa8b2dc84e53eff116 | 7,414 | py | Python | api/Upload.py | variski/utu-vm-site | 8a2eeaeac019fad0663caca035820c288e3d8849 | [
"MIT"
] | 2 | 2019-11-13T10:41:26.000Z | 2021-01-29T13:19:06.000Z | api/Upload.py | variski/utu-vm-site | 8a2eeaeac019fad0663caca035820c288e3d8849 | [
"MIT"
] | 32 | 2019-11-18T19:01:27.000Z | 2022-02-07T08:47:09.000Z | api/Upload.py | variski/utu-vm-site | 8a2eeaeac019fad0663caca035820c288e3d8849 | [
"MIT"
] | 3 | 2019-11-27T21:55:16.000Z | 2020-01-22T13:06:54.000Z | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Turku University (2020) Department of Future Technologies
# Course Virtualization / Website
# Class for Course Virtualization site upload handling
#
# Upload.py - Jani Tammi <jasata@utu.fi>
#
# 2020-09-06 Initial version.
# 2020-09-07 Permission response now inc... | 33.547511 | 470 | 0.545724 | # - "{UPLOAD_FOLDER}/{upid}" directory is created
#
# When last chunk is accepted:
# - Chunks are joined. (If not written-in-place)
# - File is "prepublished()", 'file' row is written
# - IMAGE NAME CONFLICT RESOLVING NEEDED
# - VM file is moved to {DOWNLOAD_FOLDER}
#
import logging
impo... | true | true |
08fcc68878253f1611f0797a9fef658ea0306b46 | 21,462 | py | Python | Experiments_pendulum/train_noise.py | ssantos97/SyMo | 58d7b64f888fd78cc27d4c1092071ef35725f0d4 | [
"MIT"
] | null | null | null | Experiments_pendulum/train_noise.py | ssantos97/SyMo | 58d7b64f888fd78cc27d4c1092071ef35725f0d4 | [
"MIT"
] | null | null | null | Experiments_pendulum/train_noise.py | ssantos97/SyMo | 58d7b64f888fd78cc27d4c1092071ef35725f0d4 | [
"MIT"
] | null | null | null | import torch, argparse
import numpy as np
from torch.utils.data import TensorDataset, DataLoader
from torch import optim
from torch.optim.lr_scheduler import ReduceLROnPlateau
import pickle
import scipy.integrate
solve_ivp = scipy.integrate.solve_ivp
import os, sys
THIS_DIR = os.path.dirname(os.path.abspath(__file__))... | 50.617925 | 151 | 0.669416 | import torch, argparse
import numpy as np
from torch.utils.data import TensorDataset, DataLoader
from torch import optim
from torch.optim.lr_scheduler import ReduceLROnPlateau
import pickle
import scipy.integrate
solve_ivp = scipy.integrate.solve_ivp
import os, sys
THIS_DIR = os.path.dirname(os.path.abspath(__file__))... | true | true |
08fcc6ad01295ae22758eb4828b57f62d8147821 | 37,860 | py | Python | paat/wear_time.py | Trybnetic/paat | b3ff42f51423ae323da1bc776497d6432168d1b6 | [
"MIT"
] | null | null | null | paat/wear_time.py | Trybnetic/paat | b3ff42f51423ae323da1bc776497d6432168d1b6 | [
"MIT"
] | 2 | 2022-03-22T11:12:33.000Z | 2022-03-24T10:58:48.000Z | paat/wear_time.py | Trybnetic/paat | b3ff42f51423ae323da1bc776497d6432168d1b6 | [
"MIT"
] | null | null | null | """
Wear Time Module
----------------
*paat.wear_time* provides functions to infer wear and non wear times from
raw acceleration signals.
"""
import logging
import os
import sys
import numpy as np
import pandas as pd
from tensorflow.keras import models
from . import preprocessing, features
def _find_candidate_non... | 47.206983 | 249 | 0.670814 | import logging
import os
import sys
import numpy as np
import pandas as pd
from tensorflow.keras import models
from . import preprocessing, features
def _find_candidate_non_wear_segments_from_raw(acc_data, std_threshold, hz, min_segment_length=1, sliding_window=1, use_vmu=False):
sliding_window *= hz * 60
... | true | true |
08fcc72379f1b84f9ff2b24a250f93d7a36db0cc | 5,008 | py | Python | supplychainpy/reporting/blueprints/simulation/controller.py | luisccalves/supplychainpy | 63a10b77ffdcc5bca71e815c70667c819d8f9af0 | [
"BSD-3-Clause"
] | 231 | 2016-05-30T02:34:45.000Z | 2022-03-28T17:00:29.000Z | supplychainpy/reporting/blueprints/simulation/controller.py | luisccalves/supplychainpy | 63a10b77ffdcc5bca71e815c70667c819d8f9af0 | [
"BSD-3-Clause"
] | 77 | 2016-03-23T16:28:34.000Z | 2021-09-30T22:08:03.000Z | supplychainpy/reporting/blueprints/simulation/controller.py | luisccalves/supplychainpy | 63a10b77ffdcc5bca71e815c70667c819d8f9af0 | [
"BSD-3-Clause"
] | 103 | 2016-08-10T19:53:09.000Z | 2022-03-16T16:34:38.000Z | # Copyright (c) 2015-2016, The Authors and Contributors
# <see AUTHORS file>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
# following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright n... | 59.619048 | 116 | 0.754593 | import datetime
from flask import Flask
from supplychainpy._helpers._db_connection import database_connection_uri
from supplychainpy.reporting.blueprints.models import SimulationSummary, Simulation, MasterSkuList
from supplychainpy.reporting.config.settings import ProdConfig
from supplychainpy.reporting.extensions im... | true | true |
08fcc73f00462679b7e181e30d07c893b73991cc | 402 | py | Python | dash/cleaning_datas_tests.py | JuanPorrasl/AMSECovid19 | e8d754e04c301f164b19117e779ea82e79b79558 | [
"MIT"
] | null | null | null | dash/cleaning_datas_tests.py | JuanPorrasl/AMSECovid19 | e8d754e04c301f164b19117e779ea82e79b79558 | [
"MIT"
] | 1 | 2020-05-02T17:18:16.000Z | 2020-05-02T17:18:16.000Z | dash/cleaning_datas_tests.py | JuanPorrasl/AMSECovid19 | e8d754e04c301f164b19117e779ea82e79b79558 | [
"MIT"
] | 1 | 2020-05-02T15:18:02.000Z | 2020-05-02T15:18:02.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon May 18 16:03:41 2020
@author: juanporras
"""
import pandas as pd
import numpy as np
import json
import urllib.request
from urllib.request import urlopen
import datetime
import time
config = {'displayModeBar': False}
from cleaning_datas import df
O... | 16.08 | 81 | 0.738806 |
import pandas as pd
import numpy as np
import json
import urllib.request
from urllib.request import urlopen
import datetime
import time
config = {'displayModeBar': False}
from cleaning_datas import df
OWData = pd.read_csv("https://covid.ourworldindata.org/data/owid-covid-data.csv")
| true | true |
08fcc784eba425a5f709c3569fb820ac873c2ec8 | 1,029 | py | Python | docs/sphinxext/setup.py | stormvirux/queueing-tool | 16d5b4700e839979ab6ca23c5be813d0b38b04af | [
"MIT"
] | 49 | 2015-04-30T00:42:45.000Z | 2022-03-21T14:49:46.000Z | docs/sphinxext/setup.py | stormvirux/queueing-tool | 16d5b4700e839979ab6ca23c5be813d0b38b04af | [
"MIT"
] | 48 | 2015-02-16T01:24:04.000Z | 2021-02-11T04:31:15.000Z | docs/sphinxext/setup.py | stormvirux/queueing-tool | 16d5b4700e839979ab6ca23c5be813d0b38b04af | [
"MIT"
] | 11 | 2017-11-23T08:53:12.000Z | 2022-03-21T18:22:09.000Z | from __future__ import division, print_function
import sys
import setuptools
from distutils.core import setup
if sys.version_info[:2] < (2, 6) or (3, 0) <= sys.version_info[0:2] < (3, 3):
raise RuntimeError("Python version 2.6, 2.7 or >= 3.3 required.")
version = "0.5"
setup(
name="numpydoc",
packages=[... | 33.193548 | 80 | 0.646259 | from __future__ import division, print_function
import sys
import setuptools
from distutils.core import setup
if sys.version_info[:2] < (2, 6) or (3, 0) <= sys.version_info[0:2] < (3, 3):
raise RuntimeError("Python version 2.6, 2.7 or >= 3.3 required.")
version = "0.5"
setup(
name="numpydoc",
packages=[... | true | true |
08fcc8fbdab66f2cccb9dcf37e664c7d87997196 | 393 | py | Python | abc_bank/asgi.py | jmothiki/abc_bank | bb15fc5c9f7413c8fd3dd89ddeb6ea978870ca02 | [
"Apache-2.0"
] | null | null | null | abc_bank/asgi.py | jmothiki/abc_bank | bb15fc5c9f7413c8fd3dd89ddeb6ea978870ca02 | [
"Apache-2.0"
] | null | null | null | abc_bank/asgi.py | jmothiki/abc_bank | bb15fc5c9f7413c8fd3dd89ddeb6ea978870ca02 | [
"Apache-2.0"
] | null | null | null | """
ASGI config for abc_bank project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETT... | 23.117647 | 78 | 0.78626 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'abc_bank.settings')
application = get_asgi_application()
| true | true |
08fcca16abbd5d2861164f9d18e1031123449e5d | 3,337 | py | Python | service_catalog/forms/service_forms.py | SyedMaseerulla/squest | d741a928f6361cf355607c2def31b0539592814b | [
"Apache-2.0"
] | null | null | null | service_catalog/forms/service_forms.py | SyedMaseerulla/squest | d741a928f6361cf355607c2def31b0539592814b | [
"Apache-2.0"
] | null | null | null | service_catalog/forms/service_forms.py | SyedMaseerulla/squest | d741a928f6361cf355607c2def31b0539592814b | [
"Apache-2.0"
] | 1 | 2022-03-24T03:37:12.000Z | 2022-03-24T03:37:12.000Z | from django import forms
from profiles.models import BillingGroup
from service_catalog.models import Service
from Squest.utils.squest_model_form import SquestModelForm
class ServiceForm(SquestModelForm):
def __init__(self, *args, **kwargs):
super(ServiceForm, self).__init__(*args, **kwargs)
self.f... | 40.204819 | 117 | 0.628409 | from django import forms
from profiles.models import BillingGroup
from service_catalog.models import Service
from Squest.utils.squest_model_form import SquestModelForm
class ServiceForm(SquestModelForm):
def __init__(self, *args, **kwargs):
super(ServiceForm, self).__init__(*args, **kwargs)
self.f... | true | true |
08fcca5b1882665b27b4de23f82fe7595258cda2 | 2,916 | py | Python | statick_tool/plugins/tool/perlcritic_tool_plugin.py | creffett/statick | 9545d499ae99729cdcf59966a10311cfb41d3644 | [
"CC0-1.0"
] | 1 | 2018-08-29T01:07:55.000Z | 2018-08-29T01:07:55.000Z | statick_tool/plugins/tool/perlcritic_tool_plugin.py | creffett/statick | 9545d499ae99729cdcf59966a10311cfb41d3644 | [
"CC0-1.0"
] | 3 | 2018-09-01T17:33:56.000Z | 2019-02-15T15:05:43.000Z | statick_tool/plugins/tool/perlcritic_tool_plugin.py | creffett/statick | 9545d499ae99729cdcf59966a10311cfb41d3644 | [
"CC0-1.0"
] | null | null | null | """Apply Perl::Critic tool and gather results."""
from __future__ import print_function
import subprocess
from statick_tool.issue import Issue
from statick_tool.tool_plugin import ToolPlugin
class PerlCriticToolPlugin(ToolPlugin):
"""Apply Perl::Critic tool and gather results."""
def get_name(self):
... | 33.517241 | 84 | 0.551783 |
from __future__ import print_function
import subprocess
from statick_tool.issue import Issue
from statick_tool.tool_plugin import ToolPlugin
class PerlCriticToolPlugin(ToolPlugin):
def get_name(self):
return "perlcritic"
def gather_args(self, args):
args.add_argument("--perlcritic-bin", d... | true | true |
08fccaa611fdaa1d57039fa3b8140b521769169a | 14,033 | py | Python | openml/runs/trace.py | MichaelMMeskhi/openml-python | 6792015e03f3e31130c4cd00035a2f8f69384d59 | [
"BSD-3-Clause"
] | 1 | 2019-05-07T21:57:08.000Z | 2019-05-07T21:57:08.000Z | openml/runs/trace.py | MichaelMMeskhi/openml-python | 6792015e03f3e31130c4cd00035a2f8f69384d59 | [
"BSD-3-Clause"
] | null | null | null | openml/runs/trace.py | MichaelMMeskhi/openml-python | 6792015e03f3e31130c4cd00035a2f8f69384d59 | [
"BSD-3-Clause"
] | null | null | null | import arff
import json
import os
import xmltodict
from collections import OrderedDict
PREFIX = 'parameter_'
REQUIRED_ATTRIBUTES = [
'repeat',
'fold',
'iteration',
'evaluation',
'selected',
]
class OpenMLRunTrace(object):
"""OpenML Run Trace: parsed output from Run Trace call
Parameters
... | 31.115299 | 80 | 0.550916 | import arff
import json
import os
import xmltodict
from collections import OrderedDict
PREFIX = 'parameter_'
REQUIRED_ATTRIBUTES = [
'repeat',
'fold',
'iteration',
'evaluation',
'selected',
]
class OpenMLRunTrace(object):
def __init__(self, run_id, trace_iterations):
self.run_id = ru... | true | true |
08fccaa91d32ebcc4992318c104b46c125228bfe | 79,609 | bzl | Python | tensorflow/tensorflow.bzl | hanton/tensorflow | 34fd2a5e9bcdb40957ece90fec46a37e6e9248b2 | [
"Apache-2.0"
] | 1 | 2021-08-28T17:58:06.000Z | 2021-08-28T17:58:06.000Z | tensorflow/tensorflow.bzl | hanton/tensorflow | 34fd2a5e9bcdb40957ece90fec46a37e6e9248b2 | [
"Apache-2.0"
] | null | null | null | tensorflow/tensorflow.bzl | hanton/tensorflow | 34fd2a5e9bcdb40957ece90fec46a37e6e9248b2 | [
"Apache-2.0"
] | null | null | null | # -*- Python -*-
# Return the options to use for a C++ library or binary build.
# Uses the ":optmode" config_setting to pick the options.
load(
"//tensorflow/core:platform/default/build_config_root.bzl",
"if_dynamic_kernels",
"if_static",
"tf_additional_grpc_deps_py",
"tf_additional_xla_deps_py",
... | 32.640016 | 247 | 0.584067 |
load(
"//tensorflow/core:platform/default/build_config_root.bzl",
"if_dynamic_kernels",
"if_static",
"tf_additional_grpc_deps_py",
"tf_additional_xla_deps_py",
"tf_cuda_tests_tags",
"tf_exec_compatible_with",
"tf_gpu_tests_tags",
"tf_sycl_tests_tags",
)
load(
"@local_config_tens... | true | true |
08fccb4dbd282c65a7d5d38641f8776309e421c5 | 2,789 | py | Python | section3/task2/sec3_task2.py | pin-hsuan-wu/caw-quant-training2 | d3bb66390c2060d8dde41725f0d4da97a02d07cf | [
"MIT"
] | null | null | null | section3/task2/sec3_task2.py | pin-hsuan-wu/caw-quant-training2 | d3bb66390c2060d8dde41725f0d4da97a02d07cf | [
"MIT"
] | null | null | null | section3/task2/sec3_task2.py | pin-hsuan-wu/caw-quant-training2 | d3bb66390c2060d8dde41725f0d4da97a02d07cf | [
"MIT"
] | null | null | null | import talib
import numpy as np
from binance.websockets import BinanceSocketManager
from binance.client import Client
import pandas as pd
with open("./binance_api.txt") as f:
file = f.read()
key = file.split(',')[0]
secret = file.split(',')[1]
client = Client(api_key=key, api_secret=secret)
bm = BinanceSocketMan... | 34.012195 | 148 | 0.528146 | import talib
import numpy as np
from binance.websockets import BinanceSocketManager
from binance.client import Client
import pandas as pd
with open("./binance_api.txt") as f:
file = f.read()
key = file.split(',')[0]
secret = file.split(',')[1]
client = Client(api_key=key, api_secret=secret)
bm = BinanceSocketMan... | true | true |
08fccbf8e5aaab3c7440f7c0e340b77f92010ac4 | 12,179 | py | Python | lib/messages/rps.py | FuzzyBearBTC/counterpartyd | 0733463249b71901daba5d73c7b30a334860bb0a | [
"MIT"
] | 1 | 2020-10-15T06:42:34.000Z | 2020-10-15T06:42:34.000Z | lib/messages/rps.py | FuzzyBearBTC/counterpartyd | 0733463249b71901daba5d73c7b30a334860bb0a | [
"MIT"
] | null | null | null | lib/messages/rps.py | FuzzyBearBTC/counterpartyd | 0733463249b71901daba5d73c7b30a334860bb0a | [
"MIT"
] | null | null | null | #! /usr/bin/python3
"""
Transaction 1: rps (Open the game)
source: address used to play the game
wager: amount to bet
move_random_hash: sha256(sha256(move + random)) (stored as bytes, 16 bytes random)
possible_moves: arbitrary odd number >= 3
expiration: how many blocks the game is valid
Matching conditions:
- tx0_po... | 39.931148 | 164 | 0.624682 |
import struct
import decimal
D = decimal.Decimal
import time
import binascii
import string
from lib import (config, bitcoin, exceptions, util)
FORMAT = '>HQ32sI'
LENGTH = 2 + 8 + 32 + 4
ID = 80
def cancel_rps (db, rps, status, block_index):
cursor = db.cursor()
bindings = {
'status': status,
... | true | true |
08fcccb9aaeca4536172bcf72b2d431dd2f6d324 | 2,099 | py | Python | test/TEX/LATEXCOMSTR.py | datalogics-staylor/scons | 4c48deb6947066e53aac7d86621a7ec17f3b4034 | [
"MIT"
] | 3 | 2017-01-06T09:26:23.000Z | 2017-03-04T04:13:20.000Z | test/TEX/LATEXCOMSTR.py | datalogics-staylor/scons | 4c48deb6947066e53aac7d86621a7ec17f3b4034 | [
"MIT"
] | 2 | 2015-10-27T20:17:24.000Z | 2016-08-04T21:49:56.000Z | test/TEX/LATEXCOMSTR.py | datalogics-staylor/scons | 4c48deb6947066e53aac7d86621a7ec17f3b4034 | [
"MIT"
] | 4 | 2015-03-31T16:09:15.000Z | 2021-08-04T12:41:47.000Z | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
... | 28.364865 | 73 | 0.722725 |
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os
import string
import sys
import TestSCons
_python_ = TestSCons._python_
_exe = TestSCons._exe
test = TestSCons.TestSCons()
test.write('mylatex.py', r"""
import sys
outfile = open(sys.argv[1], 'wb')
infile = open(sys.argv[2], 'rb')
for l i... | true | true |
08fcccc23c1232555d25a8e1f0a7dfcb3f2b395a | 537 | py | Python | manage.py | applicationsdev/Django-Python-Redis-AJAX-Social-Network | f0e35a396aa0f2e304ce4c267bd0c075618eb3de | [
"MIT"
] | 9 | 2019-01-17T15:47:41.000Z | 2020-04-18T02:30:41.000Z | manage.py | applicationsdev/Django-Python-Redis-AJAX-Social-Network | f0e35a396aa0f2e304ce4c267bd0c075618eb3de | [
"MIT"
] | 9 | 2020-06-05T17:28:56.000Z | 2022-03-03T22:27:22.000Z | manage.py | applicationsdev/Django-Python-Redis-AJAX-Social-Network | f0e35a396aa0f2e304ce4c267bd0c075618eb3de | [
"MIT"
] | 1 | 2020-12-15T06:54:53.000Z | 2020-12-15T06:54:53.000Z | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myapp.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are yo... | 33.5625 | 73 | 0.685289 | import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myapp.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed ... | true | true |
08fccd25bb77f9da2d919ff6ea01648f1261d9bb | 511 | py | Python | tests/test_all/test_memoize.py | Rgcsh/distributed_redis_sdk | 6ab9a8191154bfeb8ae3981119760df3686f6bec | [
"MIT"
] | null | null | null | tests/test_all/test_memoize.py | Rgcsh/distributed_redis_sdk | 6ab9a8191154bfeb8ae3981119760df3686f6bec | [
"MIT"
] | null | null | null | tests/test_all/test_memoize.py | Rgcsh/distributed_redis_sdk | 6ab9a8191154bfeb8ae3981119760df3686f6bec | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
(C) Guangcai Ren <rgc@bvrft.com>
All rights reserved
create time '2020/7/22 15:34'
Usage:
"""
import time
from tests import TestBase
class TestMemoize(TestBase):
def test_normal(self, client):
""" 测试 正常获取
"""
get_result = client.get('api/memoize/1/2')
... | 20.44 | 75 | 0.624266 | import time
from tests import TestBase
class TestMemoize(TestBase):
def test_normal(self, client):
get_result = client.get('api/memoize/1/2')
self.check_result(get_result, client.get('api/memoize/1/2').data)
time.sleep(1.3)
self.check_un_equal(get_result, client.get('api/... | true | true |
08fccd39efd681e7aa821a3c777b5cedb2a3cddb | 33,221 | py | Python | tests/snappy_pipeline/workflows/test_workflows_variant_calling.py | PotatoThrone/snappy-pipeline | 31200eba84bff8e459e9e210d6d95e2984627f5c | [
"MIT"
] | null | null | null | tests/snappy_pipeline/workflows/test_workflows_variant_calling.py | PotatoThrone/snappy-pipeline | 31200eba84bff8e459e9e210d6d95e2984627f5c | [
"MIT"
] | null | null | null | tests/snappy_pipeline/workflows/test_workflows_variant_calling.py | PotatoThrone/snappy-pipeline | 31200eba84bff8e459e9e210d6d95e2984627f5c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Tests for the variant_calling workflow module code"""
from copy import deepcopy
import textwrap
import pytest
import ruamel.yaml as yaml
from snakemake.io import Wildcards
from snappy_pipeline.workflows.variant_calling import VariantCallingWorkflow
from .common import get_expected_log_fil... | 38.854971 | 100 | 0.690045 |
from copy import deepcopy
import textwrap
import pytest
import ruamel.yaml as yaml
from snakemake.io import Wildcards
from snappy_pipeline.workflows.variant_calling import VariantCallingWorkflow
from .common import get_expected_log_files_dict, get_expected_output_vcf_files_dict
from .conftest import patch_module_fs... | true | true |
08fcced36c54505c98cbd6c62d452bfa92760622 | 570 | py | Python | python/541_Reverse_String_II.py | dvlpsh/leetcode-1 | f965328af72113ac8a5a9d6624868c1502be937b | [
"MIT"
] | 4,416 | 2016-03-30T15:02:26.000Z | 2022-03-31T16:31:03.000Z | python/541_Reverse_String_II.py | YinpuLi/leetcode-6 | 1371de2631d745efba39de41b51c3424e35da434 | [
"MIT"
] | 20 | 2018-11-17T13:46:25.000Z | 2022-03-13T05:37:06.000Z | python/541_Reverse_String_II.py | YinpuLi/leetcode-6 | 1371de2631d745efba39de41b51c3424e35da434 | [
"MIT"
] | 1,374 | 2017-05-26T15:44:30.000Z | 2022-03-30T19:21:02.000Z | class Solution:
def reverseStr(self, s: str, k: int) -> str:
N = len(s)
ans = ""
position = 0
while position < N:
nx = s[position : position + k]
ans = ans + nx[::-1] + s[position + k : position + 2 * k]
position += 2 * k
return ans
# ... | 23.75 | 69 | 0.452632 | class Solution:
def reverseStr(self, s: str, k: int) -> str:
N = len(s)
ans = ""
position = 0
while position < N:
nx = s[position : position + k]
ans = ans + nx[::-1] + s[position + k : position + 2 * k]
position += 2 * k
return ans
... | true | true |
08fccf0ce7262938af8af1533f33225df5f430ee | 404 | py | Python | urls.py | cartologic/cartoview_esri_app_starter | dca4649fe0200e9b9b709293697a5807a405f6d1 | [
"Apache-2.0"
] | 1 | 2016-04-29T22:20:10.000Z | 2016-04-29T22:20:10.000Z | urls.py | cartologic/cartoview_esri_app_starter | dca4649fe0200e9b9b709293697a5807a405f6d1 | [
"Apache-2.0"
] | null | null | null | urls.py | cartologic/cartoview_esri_app_starter | dca4649fe0200e9b9b709293697a5807a405f6d1 | [
"Apache-2.0"
] | null | null | null | from django.conf.urls import patterns, url
import views
urlpatterns = patterns('',
url(r'^new/$', views.new, name='%s.new' % views.APP_NAME),
url(r'^view/(?P<resource_id>\d+)/$', views.view, name='%s.view' % views.APP_NAME),
url(r'^edit/(?P<resource... | 40.4 | 105 | 0.507426 | from django.conf.urls import patterns, url
import views
urlpatterns = patterns('',
url(r'^new/$', views.new, name='%s.new' % views.APP_NAME),
url(r'^view/(?P<resource_id>\d+)/$', views.view, name='%s.view' % views.APP_NAME),
url(r'^edit/(?P<resource... | true | true |
08fcd105ac2911e02ad4062147f1cae2f7a22486 | 15,654 | py | Python | tests/test_serializers.py | scieloorg/oai-pmh | 9d3044921d2d5cafb18e54f04070e8783f49c06d | [
"BSD-2-Clause"
] | 2 | 2019-03-16T04:40:29.000Z | 2022-03-10T14:50:21.000Z | tests/test_serializers.py | DalavanCloud/oai-pmh | 9d3044921d2d5cafb18e54f04070e8783f49c06d | [
"BSD-2-Clause"
] | 27 | 2017-08-23T17:11:57.000Z | 2021-06-01T21:57:31.000Z | tests/test_serializers.py | DalavanCloud/oai-pmh | 9d3044921d2d5cafb18e54f04070e8783f49c06d | [
"BSD-2-Clause"
] | 2 | 2017-06-12T16:18:35.000Z | 2019-03-16T04:40:12.000Z | import unittest
from unittest.mock import patch
from datetime import datetime
from oaipmh import serializers, validators, formatters
class SchemaValidatorMixin:
def assertXMLIsValid(self, xml_bytes):
validator = validators.OAIValidator(xml_bytes)
is_valid, errors = validator.validate()
if... | 61.873518 | 1,560 | 0.596716 | import unittest
from unittest.mock import patch
from datetime import datetime
from oaipmh import serializers, validators, formatters
class SchemaValidatorMixin:
def assertXMLIsValid(self, xml_bytes):
validator = validators.OAIValidator(xml_bytes)
is_valid, errors = validator.validate()
if... | true | true |
08fcd158cf57a1be98ce5c399d27dd68ab63d346 | 976 | py | Python | bardeen/text.py | mverleg/bardeen | 5e91f5bad6b3d460c9afb5a41d2020dd91a27124 | [
"BSD-3-Clause"
] | null | null | null | bardeen/text.py | mverleg/bardeen | 5e91f5bad6b3d460c9afb5a41d2020dd91a27124 | [
"BSD-3-Clause"
] | null | null | null | bardeen/text.py | mverleg/bardeen | 5e91f5bad6b3d460c9afb5a41d2020dd91a27124 | [
"BSD-3-Clause"
] | null | null | null |
"""
Routines related to changing text, e.g. substitution or escape for some format
"""
from re import escape as re_escape, compile
#todo: unit test
def tex_escape(text):
"""
:param text: a plain text message
:return: the message escaped to appear correctly in LaTeX
"""
conv = {
'&': r'\&',
'%': r'\%',
'$... | 23.238095 | 115 | 0.623975 |
from re import escape as re_escape, compile
def tex_escape(text):
conv = {
'&': r'\&',
'%': r'\%',
'$': r'\$',
'#': r'\#',
'_': r'\_',
'{': r'\{',
'}': r'\}',
'~': r'\textasciitilde{}',
'^': r'\^{}',
'\\': r'\textbackslash{}',
'<': r'\textless',
'>': r'\textgreater',
}
return sub_dict(tex... | true | true |
08fcd18a185c8ab2eebc1d1ecce57168d49dbaf3 | 2,562 | py | Python | users/api/views/activation_token.py | heolin123/funcrowd | 20167783de208394c09ed0429a5f02ec6dd79c42 | [
"MIT"
] | null | null | null | users/api/views/activation_token.py | heolin123/funcrowd | 20167783de208394c09ed0429a5f02ec6dd79c42 | [
"MIT"
] | 11 | 2019-11-12T23:26:45.000Z | 2021-06-10T17:37:23.000Z | users/api/views/activation_token.py | heolin123/funcrowd | 20167783de208394c09ed0429a5f02ec6dd79c42 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import funcrowd.settings as settings
from rest_framework.generics import GenericAPIView
from rest_framework.permissions import AllowAny
from rest_framework.response import Response
from rest_framework import status
from modules.communication.email impor... | 35.583333 | 90 | 0.704528 | from __future__ import unicode_literals
import funcrowd.settings as settings
from rest_framework.generics import GenericAPIView
from rest_framework.permissions import AllowAny
from rest_framework.response import Response
from rest_framework import status
from modules.communication.email import EmailHelper
from users... | true | true |
08fcd1a195fef8120bd5316a2e72bc931fe061c5 | 594 | py | Python | flask/todo-list/serve/todolist/user/model.py | jianchengwang/todo-python | 36bdaf6fae714531946047ececca995d60f86e4a | [
"MIT"
] | null | null | null | flask/todo-list/serve/todolist/user/model.py | jianchengwang/todo-python | 36bdaf6fae714531946047ececca995d60f86e4a | [
"MIT"
] | null | null | null | flask/todo-list/serve/todolist/user/model.py | jianchengwang/todo-python | 36bdaf6fae714531946047ececca995d60f86e4a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from werkzeug.security import generate_password_hash, check_password_hash
from todolist import db, ma
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(20))
password_hash = db.Column(db.String(128))
def set_password(sel... | 31.263158 | 74 | 0.691919 | from werkzeug.security import generate_password_hash, check_password_hash
from todolist import db, ma
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(20))
password_hash = db.Column(db.String(128))
def set_password(self, password):
se... | true | true |
08fcd1a42e9d3bb7528623392c6f76e1dd3aae93 | 448 | py | Python | scripts/utils.py | InnopolisAero/image_pose_estimation_ros | f69eb07dd6affcd908cff1aab2d2a23018bf4743 | [
"MIT"
] | 1 | 2022-03-26T09:18:15.000Z | 2022-03-26T09:18:15.000Z | scripts/utils.py | InnopolisAero/image_pose_estimation_ros | f69eb07dd6affcd908cff1aab2d2a23018bf4743 | [
"MIT"
] | null | null | null | scripts/utils.py | InnopolisAero/image_pose_estimation_ros | f69eb07dd6affcd908cff1aab2d2a23018bf4743 | [
"MIT"
] | 1 | 2021-04-18T16:25:33.000Z | 2021-04-18T16:25:33.000Z | from pathlib import Path
def project_root():
root_dir = Path.cwd().resolve()
while not Path(root_dir, '.root').exists():
root_dir = root_dir.parent
if root_dir == Path.root:
raise Exception('Can\'t find a project root directory')
return str(root_dir)
def unique(list1):
u... | 20.363636 | 67 | 0.620536 | from pathlib import Path
def project_root():
root_dir = Path.cwd().resolve()
while not Path(root_dir, '.root').exists():
root_dir = root_dir.parent
if root_dir == Path.root:
raise Exception('Can\'t find a project root directory')
return str(root_dir)
def unique(list1):
u... | true | true |
08fcd2332768248496813fab88407db3519a8db3 | 2,118 | py | Python | bspump/declarative/expression/utility/castexpr.py | LibertyAces/BitSwanPump | 02301bfd4e807836403ce6a22030ad47058541d6 | [
"BSD-3-Clause"
] | 17 | 2019-02-14T09:26:03.000Z | 2022-03-11T09:23:52.000Z | bspump/declarative/expression/utility/castexpr.py | LibertyAces/BitSwanPump | 02301bfd4e807836403ce6a22030ad47058541d6 | [
"BSD-3-Clause"
] | 91 | 2019-05-06T18:59:02.000Z | 2022-01-11T06:22:32.000Z | bspump/declarative/expression/utility/castexpr.py | LibertyAces/BitSwanPump | 02301bfd4e807836403ce6a22030ad47058541d6 | [
"BSD-3-Clause"
] | 10 | 2019-04-23T08:48:58.000Z | 2022-02-13T14:24:28.000Z | from bspump.declarative.abc import Expression
from ..value.eventexpr import ARG
from ..value.valueexpr import VALUE
import logging
#
L = logging.getLogger(__name__)
#
class CAST(Expression):
"""
Casts "value" to "type"
"""
Attributes = {
"What": ["*"],
"Default": ["*"],
}
CastMap = {
'bool': (bool,... | 21.393939 | 88 | 0.63881 | from bspump.declarative.abc import Expression
from ..value.eventexpr import ARG
from ..value.valueexpr import VALUE
import logging
L = logging.getLogger(__name__)
class CAST(Expression):
Attributes = {
"What": ["*"],
"Default": ["*"],
}
CastMap = {
'bool': (bool, bool.__name__),
'ui1': (bool, bool._... | true | true |
08fcd2f64e3bfd446fb83936ddfe4fb1af8b1ce1 | 3,949 | py | Python | gitee/models/user_email.py | pygitee/pygitee | 7622314a4dbb08cf2f729b6cdd0a2887b96e394e | [
"MIT"
] | null | null | null | gitee/models/user_email.py | pygitee/pygitee | 7622314a4dbb08cf2f729b6cdd0a2887b96e394e | [
"MIT"
] | null | null | null | gitee/models/user_email.py | pygitee/pygitee | 7622314a4dbb08cf2f729b6cdd0a2887b96e394e | [
"MIT"
] | null | null | null | # coding: utf-8
import pprint
import re # noqa: F401
import six
class UserEmail(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
... | 25.477419 | 80 | 0.528995 |
import pprint
import re
import six
class UserEmail(object):
swagger_types = {
'email': 'str',
'state': 'str',
'scope': 'list[str]'
}
attribute_map = {
'email': 'email',
'state': 'state',
'scope': 'scope'
}
def __init__(self, email=None, state=N... | true | true |
08fcd43a73ecd63fb9dae2840313f7a72837496c | 395 | py | Python | homework_07/My_garage/My_garage/wsgi.py | GalliyRazotto/05-2021_Homeworks | f6700f73d46694ac130fd707b94f0bde8902de63 | [
"Unlicense"
] | null | null | null | homework_07/My_garage/My_garage/wsgi.py | GalliyRazotto/05-2021_Homeworks | f6700f73d46694ac130fd707b94f0bde8902de63 | [
"Unlicense"
] | null | null | null | homework_07/My_garage/My_garage/wsgi.py | GalliyRazotto/05-2021_Homeworks | f6700f73d46694ac130fd707b94f0bde8902de63 | [
"Unlicense"
] | null | null | null | """
WSGI config for My_garage 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/3.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SET... | 23.235294 | 78 | 0.787342 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'My_garage.settings')
application = get_wsgi_application()
| true | true |
08fcd46ce42253926677f86afaadc9f3f8e4fd71 | 3,145 | py | Python | src/tnglib/plans.py | ebriseid/tng-cli | e158d900e003d4a4affc2233b43daff2c19acb84 | [
"Apache-2.0"
] | null | null | null | src/tnglib/plans.py | ebriseid/tng-cli | e158d900e003d4a4affc2233b43daff2c19acb84 | [
"Apache-2.0"
] | null | null | null | src/tnglib/plans.py | ebriseid/tng-cli | e158d900e003d4a4affc2233b43daff2c19acb84 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2015 SONATA-NFV, 2017 5GTANGO
# 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 ... | 33.817204 | 74 | 0.675994 |
import requests
import logging
import json
import tnglib.env as env
LOG = logging.getLogger(__name__)
def get_test_plans():
resp = requests.get(env.test_plans_api, timeout=env.timeout)
if resp.status_code != 200:
LOG.debug("Request for test plans returned with " +
(str(resp.st... | true | true |
08fcd5973f8bc2a4d2686f4720fdf49f14c5661f | 1,302 | py | Python | apps/core/forms/gmm.py | CosmosTUe/Cosmos | cec2541d3f8ea1944edfaab2090916ba66f9d2f3 | [
"MIT"
] | 1 | 2021-02-01T19:27:07.000Z | 2021-02-01T19:27:07.000Z | apps/core/forms/gmm.py | CosmosTUe/Cosmos | cec2541d3f8ea1944edfaab2090916ba66f9d2f3 | [
"MIT"
] | 79 | 2020-08-05T09:01:00.000Z | 2022-03-24T11:27:21.000Z | apps/core/forms/gmm.py | CosmosTUe/Cosmos | cec2541d3f8ea1944edfaab2090916ba66f9d2f3 | [
"MIT"
] | 3 | 2021-02-22T18:36:52.000Z | 2021-10-13T17:05:44.000Z | from crispy_forms.helper import FormHelper
from crispy_forms.layout import Div, Field, Layout
from django import forms
from django.forms.models import inlineformset_factory
from apps.core.models.gmm import GMM, FileObject
class FileObjectForm(forms.ModelForm):
class Meta:
model = FileObject
exclu... | 27.702128 | 91 | 0.622888 | from crispy_forms.helper import FormHelper
from crispy_forms.layout import Div, Field, Layout
from django import forms
from django.forms.models import inlineformset_factory
from apps.core.models.gmm import GMM, FileObject
class FileObjectForm(forms.ModelForm):
class Meta:
model = FileObject
exclu... | true | true |
08fcd5b6228f3d102fd5fb284839b052ee34c55a | 5,085 | py | Python | pocs/utils/messaging.py | AstroHuntsman/POCS | c582bef36b7f2c4da9b8f36144f1e2a10df3b5cc | [
"MIT"
] | 1 | 2018-01-04T16:06:39.000Z | 2018-01-04T16:06:39.000Z | pocs/utils/messaging.py | AstroHuntsman/POCS | c582bef36b7f2c4da9b8f36144f1e2a10df3b5cc | [
"MIT"
] | 49 | 2017-02-13T02:59:18.000Z | 2018-02-12T04:38:56.000Z | pocs/utils/messaging.py | AstroHuntsman/POCS | c582bef36b7f2c4da9b8f36144f1e2a10df3b5cc | [
"MIT"
] | 1 | 2019-04-16T04:52:16.000Z | 2019-04-16T04:52:16.000Z | import datetime
import logging
import zmq
import yaml
from astropy import units as u
from astropy.time import Time
from bson import ObjectId
from json import dumps
from json import loads
from pocs.utils import current_time
class PanMessaging(object):
"""Messaging class for PANOPTES project. Creates a new ZMQ
... | 27.192513 | 93 | 0.554572 | import datetime
import logging
import zmq
import yaml
from astropy import units as u
from astropy.time import Time
from bson import ObjectId
from json import dumps
from json import loads
from pocs.utils import current_time
class PanMessaging(object):
logger = logging
def __init__(self, **kwargs):
... | true | true |
08fcd5fb140774b96c3700de565f69dfe623c9ff | 563 | py | Python | test/Unit_String.py | mreichl-tgm/sew5-jenkins | 9958f819f46764bb354809026f3b4c2442258263 | [
"MIT"
] | null | null | null | test/Unit_String.py | mreichl-tgm/sew5-jenkins | 9958f819f46764bb354809026f3b4c2442258263 | [
"MIT"
] | null | null | null | test/Unit_String.py | mreichl-tgm/sew5-jenkins | 9958f819f46764bb354809026f3b4c2442258263 | [
"MIT"
] | null | null | null | """
Created on 27.12.2013
@author: uhs374h
"""
import unittest
from bruch import *
class TestString(unittest.TestCase):
def setUp(self):
self.b = Bruch(3, 2)
self.b2 = Bruch(self.b)
self.b3 = Bruch(4, 2)
pass
def tearDown(self):
del self.b, self.b2, self.b3
... | 16.558824 | 36 | 0.531083 | import unittest
from bruch import *
class TestString(unittest.TestCase):
def setUp(self):
self.b = Bruch(3, 2)
self.b2 = Bruch(self.b)
self.b3 = Bruch(4, 2)
pass
def tearDown(self):
del self.b, self.b2, self.b3
pass
def teststr(self):
str1 = "(3/... | true | true |
08fcd60126d4efb1685286cdd61340ce706417a4 | 53,820 | py | Python | tinyquery/runtime.py | DataBiosphere/azul-tinyquery | ffda59f550a084b5e7d926fda1cc05fa688e8425 | [
"MIT"
] | null | null | null | tinyquery/runtime.py | DataBiosphere/azul-tinyquery | ffda59f550a084b5e7d926fda1cc05fa688e8425 | [
"MIT"
] | 1 | 2021-04-28T00:07:02.000Z | 2021-04-28T00:07:32.000Z | tinyquery/runtime.py | DataBiosphere/azul-tinyquery | ffda59f550a084b5e7d926fda1cc05fa688e8425 | [
"MIT"
] | null | null | null | """Implementation of the standard built-in functions."""
from __future__ import absolute_import
import abc
import datetime
import functools
import json
import math
import random
import re
import time
from typing import (
Callable,
Sequence,
)
import arrow
import six
from tinyquery import exceptions
from tiny... | 37.219917 | 87 | 0.61715 | from __future__ import absolute_import
import abc
import datetime
import functools
import json
import math
import random
import re
import time
from typing import (
Callable,
Sequence,
)
import arrow
import six
from tinyquery import exceptions
from tinyquery import context
from tinyquery import repeated_util
... | true | true |
08fcd63e2eb8ba4969a2132e33c45ffb4c58b126 | 79,989 | py | Python | tests/www/test_views.py | eminency/airflow | 55bb579a135f37d651cedf8f208c98baa6e78217 | [
"Apache-2.0"
] | 1 | 2019-10-12T09:40:06.000Z | 2019-10-12T09:40:06.000Z | tests/www/test_views.py | eminency/airflow | 55bb579a135f37d651cedf8f208c98baa6e78217 | [
"Apache-2.0"
] | null | null | null | tests/www/test_views.py | eminency/airflow | 55bb579a135f37d651cedf8f208c98baa6e78217 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# 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
#... | 40.357719 | 108 | 0.630712 |
import copy
import io
import json
import logging.config
import os
import shutil
import sys
import tempfile
import unittest
import urllib
from datetime import timedelta
from unittest import mock
from urllib.parse import quote_plus
import jinja2
from flask import Markup, url_for
from parameterized import parameterized
... | true | true |
08fcd67c1656ba95773e34cd7f87971fd69a6cec | 671 | py | Python | app/commons/management/commands/wait_for_db.py | Tupek/meetUp-clone | 27267730cc6443e50b64a05dfc0f3d994346a03c | [
"MIT"
] | 8 | 2020-04-23T02:57:04.000Z | 2022-03-17T08:11:23.000Z | app/commons/management/commands/wait_for_db.py | Tupek/meetUp-clone | 27267730cc6443e50b64a05dfc0f3d994346a03c | [
"MIT"
] | 3 | 2021-03-19T02:30:07.000Z | 2021-09-08T01:10:23.000Z | app/commons/management/commands/wait_for_db.py | Tupek/meetUp-clone | 27267730cc6443e50b64a05dfc0f3d994346a03c | [
"MIT"
] | 1 | 2020-04-29T06:14:39.000Z | 2020-04-29T06:14:39.000Z | import time
from django.db import connections
from django.db.utils import OperationalError
from django.core.management.base import BaseCommand
class Command(BaseCommand):
"""Django command to pause execution until database is available"""
def handle(self, *args, **options):
self.stdout.write('Waitin... | 30.5 | 77 | 0.651267 | import time
from django.db import connections
from django.db.utils import OperationalError
from django.core.management.base import BaseCommand
class Command(BaseCommand):
def handle(self, *args, **options):
self.stdout.write('Waiting for database...')
db_conn = None
while not db_conn:
... | true | true |
08fcd83f9af4b90695423d96b283f7b038331cab | 2,766 | py | Python | Projects/3_Adversarial Search/tests/test_my_custom_player.py | jeffcore/artificial-intelligence-udacity | 7821c38ad791ef0a6e6e788c1d63f1e7d9996307 | [
"MIT"
] | null | null | null | Projects/3_Adversarial Search/tests/test_my_custom_player.py | jeffcore/artificial-intelligence-udacity | 7821c38ad791ef0a6e6e788c1d63f1e7d9996307 | [
"MIT"
] | null | null | null | Projects/3_Adversarial Search/tests/test_my_custom_player.py | jeffcore/artificial-intelligence-udacity | 7821c38ad791ef0a6e6e788c1d63f1e7d9996307 | [
"MIT"
] | null | null | null |
import unittest
from collections import deque
from random import choice
from textwrap import dedent
from isolation import Isolation, Agent, fork_get_action, play, DebugState
from sample_players import RandomPlayer
from my_custom_player import CustomPlayer
class BaseCustomPlayerTest(unittest.TestCase):
def setU... | 39.514286 | 100 | 0.679682 |
import unittest
from collections import deque
from random import choice
from textwrap import dedent
from isolation import Isolation, Agent, fork_get_action, play, DebugState
from sample_players import RandomPlayer
from my_custom_player import CustomPlayer
class BaseCustomPlayerTest(unittest.TestCase):
def setU... | true | true |
08fcd8ed58acce2e18df43eadd5992900d590b84 | 3,879 | py | Python | utils.py | ShiChenAI/ACCORD-tf | 1b07b133d55d702ddea0186ff8849da0346ec84f | [
"MIT"
] | null | null | null | utils.py | ShiChenAI/ACCORD-tf | 1b07b133d55d702ddea0186ff8849da0346ec84f | [
"MIT"
] | null | null | null | utils.py | ShiChenAI/ACCORD-tf | 1b07b133d55d702ddea0186ff8849da0346ec84f | [
"MIT"
] | null | null | null | import numpy as np
from tqdm import tqdm
import yaml
import glob
from pathlib import Path
from datasets import ACCORDDataloader
class Params:
def __init__(self, project_file):
self.params = yaml.safe_load(open(project_file).read())
def __getattr__(self, item):
return self.params.get(item, None... | 38.405941 | 114 | 0.580562 | import numpy as np
from tqdm import tqdm
import yaml
import glob
from pathlib import Path
from datasets import ACCORDDataloader
class Params:
def __init__(self, project_file):
self.params = yaml.safe_load(open(project_file).read())
def __getattr__(self, item):
return self.params.get(item, None... | true | true |
08fcd928739054b4116ac8368bfdd60df85c31de | 1,547 | py | Python | lib/spack/spack/cmd/gc.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2,360 | 2017-11-06T08:47:01.000Z | 2022-03-31T14:45:33.000Z | lib/spack/spack/cmd/gc.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13,838 | 2017-11-04T07:49:45.000Z | 2022-03-31T23:38:39.000Z | lib/spack/spack/cmd/gc.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1,793 | 2017-11-04T07:45:50.000Z | 2022-03-30T14:31:53.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import llnl.util.tty as tty
import spack.cmd.common.arguments
import spack.cmd.uninstall
import spack.environment as ev
i... | 32.229167 | 78 | 0.684551 |
import llnl.util.tty as tty
import spack.cmd.common.arguments
import spack.cmd.uninstall
import spack.environment as ev
import spack.store
description = "remove specs that are now no longer needed"
section = "build"
level = "short"
def setup_parser(subparser):
spack.cmd.common.arguments.add_common_arguments(su... | true | true |
08fcdb053181aa342ad320fb5b43c2d67d9dcbc4 | 647 | py | Python | msgboard/migrations/0001_initial.py | rebeccaTubman/beyond-tutorial | 65af7c3610ee62951345a35bff1749a946f92289 | [
"MIT"
] | null | null | null | msgboard/migrations/0001_initial.py | rebeccaTubman/beyond-tutorial | 65af7c3610ee62951345a35bff1749a946f92289 | [
"MIT"
] | 1 | 2021-03-11T13:20:12.000Z | 2021-03-11T13:22:59.000Z | msgboard/migrations/0001_initial.py | rebeccaTubman/beyond-tutorial | 65af7c3610ee62951345a35bff1749a946f92289 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-02-22 12:59
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Message',
fields=[
... | 25.88 | 114 | 0.584235 |
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Message',
fields=[
('id', models.AutoField(auto_created=True, ... | true | true |
08fcdb49756c51b1eb2fb05ed6074f34f48a33be | 2,725 | py | Python | featuresimilarityloss/vgg_model.py | ChenQingya/instagan-part | 1ff152a9340a88e0681d62a7250434ef50cede8a | [
"BSD-3-Clause"
] | null | null | null | featuresimilarityloss/vgg_model.py | ChenQingya/instagan-part | 1ff152a9340a88e0681d62a7250434ef50cede8a | [
"BSD-3-Clause"
] | null | null | null | featuresimilarityloss/vgg_model.py | ChenQingya/instagan-part | 1ff152a9340a88e0681d62a7250434ef50cede8a | [
"BSD-3-Clause"
] | null | null | null | import torch
import torch.nn as nn
from torchvision.models import vgg19, vgg16
from collections import OrderedDict
# VGG 19
# vgg_layer = {
# 'conv_1_1': 0, 'conv_1_2': 2, 'pool_1': 4, 'conv_2_1': 5, 'conv_2_2': 7, 'pool_2': 9, 'conv_3_1': 10, 'conv_3_2': 12, 'conv_3_3': 14, 'conv_3_4': 16, 'pool_3': 18, 'conv_4_1... | 46.982759 | 324 | 0.574679 | import torch
import torch.nn as nn
from torchvision.models import vgg19, vgg16
from collections import OrderedDict
vgg_layer = {
'conv_1_1': 0, 'conv_1_2': 2, 'pool_1': 4, 'conv_2_1': 5, 'conv_2_2': 7, 'pool_2': 9, 'conv_3_1': 10, 'conv_3_2': 12, 'conv_3_3': 14, 'pool_3': 16, 'conv_4_1': 17, 'conv_4_2': 19, 'conv_... | true | true |
08fcdb5df3e566bf6b8f12a908e4056b34e08f7c | 932 | py | Python | TRV.indigoPlugin/Contents/Server Plugin/postgresql/python/itertools.py | autolog/TRV_Controller | 39b40e666cf35dad517335f1bea27a8ab45e2c22 | [
"MIT"
] | null | null | null | TRV.indigoPlugin/Contents/Server Plugin/postgresql/python/itertools.py | autolog/TRV_Controller | 39b40e666cf35dad517335f1bea27a8ab45e2c22 | [
"MIT"
] | null | null | null | TRV.indigoPlugin/Contents/Server Plugin/postgresql/python/itertools.py | autolog/TRV_Controller | 39b40e666cf35dad517335f1bea27a8ab45e2c22 | [
"MIT"
] | null | null | null | ##
# .python.itertools
##
"""
itertools extensions
"""
import collections.abc
from itertools import cycle, islice
def interlace(*iters, next = next) -> collections.abc.Iterable:
"""
interlace(i1, i2, ..., in) -> (
i1-0, i2-0, ..., in-0,
i1-1, i2-1, ..., in-1,
.
.
.
i1-n, i2-n, ..., in-n,
)
"""
return ... | 19.020408 | 77 | 0.630901 | import collections.abc
from itertools import cycle, islice
def interlace(*iters, next = next) -> collections.abc.Iterable:
return map(next, cycle([iter(x) for x in iters]))
def chunk(iterable, chunksize = 256):
iterable = iter(iterable)
last = ()
lastsize = chunksize
while lastsize == chunksize:
last = list(is... | true | true |
08fcdc6b6b4b5fa75134337915de7bab840a70ba | 3,895 | py | Python | lark/reconstruct.py | psboyce/lark | 18f8b530a0bdef83ba945d997412540150d5f2d9 | [
"MIT"
] | null | null | null | lark/reconstruct.py | psboyce/lark | 18f8b530a0bdef83ba945d997412540150d5f2d9 | [
"MIT"
] | null | null | null | lark/reconstruct.py | psboyce/lark | 18f8b530a0bdef83ba945d997412540150d5f2d9 | [
"MIT"
] | null | null | null | from collections import defaultdict
from .tree import Tree, Transformer_NoRecurse
from .common import is_terminal, ParserConf, PatternStr
from .lexer import Token
from .parsers import earley, resolve_ambig
from .grammar import Rule
def is_discarded_terminal(t):
return is_terminal(t) and t.startswith('_')
def i... | 31.92623 | 140 | 0.585623 | from collections import defaultdict
from .tree import Tree, Transformer_NoRecurse
from .common import is_terminal, ParserConf, PatternStr
from .lexer import Token
from .parsers import earley, resolve_ambig
from .grammar import Rule
def is_discarded_terminal(t):
return is_terminal(t) and t.startswith('_')
def i... | true | true |
08fcdd7c5c190b2688a148daeeecc7a2fcb886c6 | 3,786 | py | Python | tests/test_spark.py | njutxw/fnal-column-analysis-tools | 679acf7e511f0539bafec7a4e1a3a3f07f100118 | [
"BSD-3-Clause"
] | null | null | null | tests/test_spark.py | njutxw/fnal-column-analysis-tools | 679acf7e511f0539bafec7a4e1a3a3f07f100118 | [
"BSD-3-Clause"
] | null | null | null | tests/test_spark.py | njutxw/fnal-column-analysis-tools | 679acf7e511f0539bafec7a4e1a3a3f07f100118 | [
"BSD-3-Clause"
] | null | null | null | from fnal_column_analysis_tools import (hist,processor)
import warnings
import numpy as np
def test_spark_imports():
try:
import pyspark
except ImportError:
warnings.warn('pyspark not installed, skipping tests')
return
except Exception as e:
warnings.warn('other error when... | 35.716981 | 116 | 0.645536 | from fnal_column_analysis_tools import (hist,processor)
import warnings
import numpy as np
def test_spark_imports():
try:
import pyspark
except ImportError:
warnings.warn('pyspark not installed, skipping tests')
return
except Exception as e:
warnings.warn('other error when... | true | true |
08fcddd5ac701916f081baa851edb1d4bb8bda23 | 2,626 | py | Python | grit/format/policy_templates/writers/plist_strings_writer.py | yinquan529/platform-external-chromium_org-tools-grit | 36d23aad1af37916cdbbca554faa31a509ac1064 | [
"BSD-2-Clause"
] | null | null | null | grit/format/policy_templates/writers/plist_strings_writer.py | yinquan529/platform-external-chromium_org-tools-grit | 36d23aad1af37916cdbbca554faa31a509ac1064 | [
"BSD-2-Clause"
] | null | null | null | grit/format/policy_templates/writers/plist_strings_writer.py | yinquan529/platform-external-chromium_org-tools-grit | 36d23aad1af37916cdbbca554faa31a509ac1064 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from grit.format.policy_templates.writers import plist_helper
from grit.format.policy_templates.writers import template_writer
d... | 34.103896 | 73 | 0.677837 |
from grit.format.policy_templates.writers import plist_helper
from grit.format.policy_templates.writers import template_writer
def GetWriter(config):
return PListStringsWriter(['mac'], config)
class PListStringsWriter(template_writer.TemplateWriter):
def _AddToStringTable(self, item_name, caption, desc):
... | true | true |
08fcde0e47a27852371b717ca16afebf29409995 | 35,669 | py | Python | Allura/allura/controllers/repository.py | 99Kies/allura | 745ab3c5a9bd287b365b699bd38ef94650afc32e | [
"Apache-2.0"
] | 1 | 2021-12-09T21:52:12.000Z | 2021-12-09T21:52:12.000Z | Allura/allura/controllers/repository.py | 99Kies/allura | 745ab3c5a9bd287b365b699bd38ef94650afc32e | [
"Apache-2.0"
] | null | null | null | Allura/allura/controllers/repository.py | 99Kies/allura | 745ab3c5a9bd287b365b699bd38ef94650afc32e | [
"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 (t... | 37.86518 | 129 | 0.593428 |
from __future__ import unicode_literals
from __future__ import absolute_import
import os
import logging
import difflib
from datetime import datetime
from six.moves.urllib.parse import quote, unquote
from collections import defaultdict, OrderedDict
from ming.utils import LazyProperty
from paste.deploy.converters impo... | true | true |
08fcde85d2244f18b013dfc2d1d0707271fabd1a | 169 | py | Python | Exercise27.py | JBCFurtado/Rabiscos_Em_Python | a1a5be9391e1bbbb301b8a7776043f7ea77e24da | [
"MIT"
] | null | null | null | Exercise27.py | JBCFurtado/Rabiscos_Em_Python | a1a5be9391e1bbbb301b8a7776043f7ea77e24da | [
"MIT"
] | null | null | null | Exercise27.py | JBCFurtado/Rabiscos_Em_Python | a1a5be9391e1bbbb301b8a7776043f7ea77e24da | [
"MIT"
] | null | null | null | ##FATORIAL
n = int(input('Digite um número para saber seu fatorial: '))
fatorial = 1
for i in range(2, n+1):
fatorial *= i
print('{}! = {}'.format(i, fatorial))
| 24.142857 | 60 | 0.609467 | n = int(input('Digite um número para saber seu fatorial: '))
fatorial = 1
for i in range(2, n+1):
fatorial *= i
print('{}! = {}'.format(i, fatorial))
| true | true |
08fcde8d3022e49a36e59d683eacfee1ec7a1ebd | 56,756 | py | Python | pandas/io/tests/test_stata.py | sandbox/pandas | fd5471208244ae1cb9cb426d6aa02ab408cfacba | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | null | null | null | pandas/io/tests/test_stata.py | sandbox/pandas | fd5471208244ae1cb9cb426d6aa02ab408cfacba | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | null | null | null | pandas/io/tests/test_stata.py | sandbox/pandas | fd5471208244ae1cb9cb426d6aa02ab408cfacba | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | 1 | 2020-11-14T00:18:18.000Z | 2020-11-14T00:18:18.000Z | # -*- coding: utf-8 -*-
# pylint: disable=E1101
import datetime as dt
import os
import struct
import sys
import warnings
from datetime import datetime
from distutils.version import LooseVersion
import nose
import numpy as np
import pandas as pd
import pandas.util.testing as tm
from pandas import compat
from pandas.co... | 44.133748 | 83 | 0.541388 |
import datetime as dt
import os
import struct
import sys
import warnings
from datetime import datetime
from distutils.version import LooseVersion
import nose
import numpy as np
import pandas as pd
import pandas.util.testing as tm
from pandas import compat
from pandas.compat import iterkeys
from pandas.core.frame impo... | true | true |
08fcdff45070a1be5a863209e94c9e550d2b20bf | 1,353 | py | Python | api_dashboard.py | JohnYoon13/hiring-engineers | 6e8f3d72eefa0217a747d4207727afdb1d56fc20 | [
"Apache-2.0"
] | null | null | null | api_dashboard.py | JohnYoon13/hiring-engineers | 6e8f3d72eefa0217a747d4207727afdb1d56fc20 | [
"Apache-2.0"
] | null | null | null | api_dashboard.py | JohnYoon13/hiring-engineers | 6e8f3d72eefa0217a747d4207727afdb1d56fc20 | [
"Apache-2.0"
] | null | null | null | from datadog import initialize, api
options = {
'api_key': 'ba3b35b93da6244f4ae958f7ac5d7c1f',
'app_key': '3fc17dab284e9136e4bcbcf1fcd31c797f50b3d6'
}
initialize(**options)
title = 'API Visualizations'
widgets = [
{
'definition': {
'type': 'timeseries',
'requests': [
{'q': 'r... | 22.55 | 74 | 0.568367 | from datadog import initialize, api
options = {
'api_key': 'ba3b35b93da6244f4ae958f7ac5d7c1f',
'app_key': '3fc17dab284e9136e4bcbcf1fcd31c797f50b3d6'
}
initialize(**options)
title = 'API Visualizations'
widgets = [
{
'definition': {
'type': 'timeseries',
'requests': [
{'q': 'r... | true | true |
08fce046accc79fe55310fe4435caa1d4da4c3c4 | 5,289 | py | Python | save_flow.py | ougx/swatResultReader | 554128883095ed9a2e0f2cae46831ff92aff7ea6 | [
"MIT"
] | 3 | 2020-11-30T01:24:31.000Z | 2022-01-11T04:38:02.000Z | save_flow.py | ougx/swatResultReader | 554128883095ed9a2e0f2cae46831ff92aff7ea6 | [
"MIT"
] | null | null | null | save_flow.py | ougx/swatResultReader | 554128883095ed9a2e0f2cae46831ff92aff7ea6 | [
"MIT"
] | 4 | 2020-10-10T01:46:10.000Z | 2022-02-15T13:43:42.000Z | # -*- coding: utf-8 -*-
"""
This script read a SWAT output.rch file and plot against USGS observed flow.
Created on Fri Feb 14 00:21:31 2020
@author: Michael Ou
usage:
python swat_plot.py
"""
import os
import pandas as pd
import matplotlib.pyplot as plt
from swat_reader import swat_reader
from usgs_water_d... | 43.710744 | 172 | 0.640575 |
import os
import pandas as pd
import matplotlib.pyplot as plt
from swat_reader import swat_reader
from usgs_water_data_reader import read_usgs_flow
import argparse
plt.style.use('ggplot')
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Save streamflow from SWAT output.rch (agains... | true | true |
08fce159a9ab1f41c66895fd958286d2cee0721d | 2,599 | py | Python | app/views/admin/user.py | mrakzero/FlaskCMS | 03ad35610befca1f45d5705f07cfb4794f9b2d3b | [
"MulanPSL-1.0"
] | 1 | 2022-03-31T03:57:45.000Z | 2022-03-31T03:57:45.000Z | app/views/admin/user.py | mrakzero/FlaskCMS | 03ad35610befca1f45d5705f07cfb4794f9b2d3b | [
"MulanPSL-1.0"
] | null | null | null | app/views/admin/user.py | mrakzero/FlaskCMS | 03ad35610befca1f45d5705f07cfb4794f9b2d3b | [
"MulanPSL-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
# File: user_resource.py
# Author: Zhangzhijun
# Date: 2021/2/13 17:26
from flask import Blueprint, flash, redirect, url_for, render_template
from flask_login import LoginManager, login_user, login_required, logout_user
from werkzeug.security import generate_password_hash
from app import db, lo... | 33.753247 | 86 | 0.684879 | from flask import Blueprint, flash, redirect, url_for, render_template
from flask_login import LoginManager, login_user, login_required, logout_user
from werkzeug.security import generate_password_hash
from app import db, login_manager
from app.forms.user_form import UserForm, LoginForm, RegisterForm
from app.models.u... | true | true |
08fce17c11e3b928edfffceb1716c9f8611b1947 | 468 | py | Python | materials/migrations/0029_bandstructure_visible.py | mgovoni-devel/MatD3 | 5b68d147f886bce427f92bb560159e62cec2d4e7 | [
"BSD-2-Clause-FreeBSD"
] | 7 | 2019-09-14T07:24:09.000Z | 2021-06-15T16:15:05.000Z | materials/migrations/0029_bandstructure_visible.py | mgovoni-devel/MatD3 | 5b68d147f886bce427f92bb560159e62cec2d4e7 | [
"BSD-2-Clause-FreeBSD"
] | 14 | 2019-12-05T01:49:19.000Z | 2021-06-23T18:34:51.000Z | materials/migrations/0029_bandstructure_visible.py | mgovoni-devel/MatD3 | 5b68d147f886bce427f92bb560159e62cec2d4e7 | [
"BSD-2-Clause-FreeBSD"
] | 2 | 2019-11-06T21:16:57.000Z | 2019-11-30T10:51:44.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-04-05 21:49
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('materials', '0028_synthesismethod_syn_file'),
]
operations = [
migrations.A... | 22.285714 | 55 | 0.630342 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('materials', '0028_synthesismethod_syn_file'),
]
operations = [
migrations.AddField(
model_name='bandstructure',
name='visibl... | true | true |
08fce1a76733e0cb94834de3ba388e45edc33a99 | 826 | py | Python | main.py | hananbercu/red-detector | ddaf8f6ef2caa3803bcbe832f6b9ed20e3e3597c | [
"Apache-2.0"
] | 1 | 2021-02-28T18:46:40.000Z | 2021-02-28T18:46:40.000Z | main.py | hananbercu/red-detector | ddaf8f6ef2caa3803bcbe832f6b9ed20e3e3597c | [
"Apache-2.0"
] | null | null | null | main.py | hananbercu/red-detector | ddaf8f6ef2caa3803bcbe832f6b9ed20e3e3597c | [
"Apache-2.0"
] | null | null | null | import boto3
from art import *
import create_ec2_instance
import create_snapshot
def main():
art = text2art("RED DETECTOR")
print(art)
print(" +++ WELCOME RED-DETECTOR - CVE SCANNER USING VULS +++\n\n")
region = create_snapshot.get_region()
client = boto3.client('ec2', region_name=r... | 30.592593 | 105 | 0.753027 | import boto3
from art import *
import create_ec2_instance
import create_snapshot
def main():
art = text2art("RED DETECTOR")
print(art)
print(" +++ WELCOME RED-DETECTOR - CVE SCANNER USING VULS +++\n\n")
region = create_snapshot.get_region()
client = boto3.client('ec2', region_name=r... | true | true |
08fce247504a3a4278f330c9b76f77b741406c59 | 10,302 | py | Python | tools/python/ort_test_dir_utils.py | dennyac/onnxruntime | d5175795d2b7f2db18b0390f394a49238f814668 | [
"MIT"
] | 5 | 2021-02-20T04:53:48.000Z | 2021-03-09T19:29:27.000Z | tools/python/ort_test_dir_utils.py | dennyac/onnxruntime | d5175795d2b7f2db18b0390f394a49238f814668 | [
"MIT"
] | 5 | 2021-03-01T21:35:50.000Z | 2022-03-09T05:38:38.000Z | tools/python/ort_test_dir_utils.py | dennyac/onnxruntime | d5175795d2b7f2db18b0390f394a49238f814668 | [
"MIT"
] | 2 | 2021-02-20T12:10:05.000Z | 2021-03-09T19:15:20.000Z | import glob
import numpy as np
import onnx
import onnx_test_data_utils
import onnxruntime as ort
import os
import shutil
from onnx import numpy_helper
def _get_numpy_type(model_info, name):
for i in model_info:
if i.name == name:
type_name = i.type.WhichOneof('value')
if type_name... | 41.708502 | 115 | 0.641526 | import glob
import numpy as np
import onnx
import onnx_test_data_utils
import onnxruntime as ort
import os
import shutil
from onnx import numpy_helper
def _get_numpy_type(model_info, name):
for i in model_info:
if i.name == name:
type_name = i.type.WhichOneof('value')
if type_name... | true | true |
08fce254d4c30c91d8242edf9a1f00b3d4923681 | 6,018 | py | Python | scons/scons.py | epuzanov/pivy | 2f049c19200ab4a3a1e4740268450496c12359f9 | [
"ISC"
] | 29 | 2019-12-28T10:37:16.000Z | 2022-02-09T10:48:04.000Z | scons/scons.py | epuzanov/pivy | 2f049c19200ab4a3a1e4740268450496c12359f9 | [
"ISC"
] | 29 | 2019-12-26T13:46:11.000Z | 2022-03-29T18:14:33.000Z | scons/scons.py | epuzanov/pivy | 2f049c19200ab4a3a1e4740268450496c12359f9 | [
"ISC"
] | 17 | 2019-12-29T11:49:32.000Z | 2022-02-23T00:28:18.000Z | #! /usr/bin/env python
#
# SCons - a Software Constructor
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# 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 ... | 34.988372 | 89 | 0.619309 |
__revision__ = "src/script/scons.py 4369 2009/09/19 16:58:54 scons"
__version__ = "1.2.0.d20090919"
__build__ = "r4369[MODIFIED]"
__buildsys__ = "scons-dev"
__date__ = "2009/09/19 16:58:54"
__developer__ = "scons"
import os
import os.path
import sys
# "SCons" package. Replace it with our own library directori... | true | true |
08fce2dd02079058fa8686619adb67463270f278 | 1,403 | py | Python | exercise.py | YaleGaussian/at_selector | 4fae7b7d3862b7fc23de7d9cb30c8b81a6f10995 | [
"MIT"
] | null | null | null | exercise.py | YaleGaussian/at_selector | 4fae7b7d3862b7fc23de7d9cb30c8b81a6f10995 | [
"MIT"
] | null | null | null | exercise.py | YaleGaussian/at_selector | 4fae7b7d3862b7fc23de7d9cb30c8b81a6f10995 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
开始练习前:
1) 下载最新版的练习文件到目录 tutorial
2) 运行本地网站服务器(默认端口 8080)
3) 运行 jupyter notebook (默认端口 8888)
"""
import os
import time
from subprocess import check_call, Popen
workDir = os.path.abspath('tutorial/')
def pullRepository():
if not os.path.isdir(workDir):
check_call([
... | 17.759494 | 67 | 0.506771 | import os
import time
from subprocess import check_call, Popen
workDir = os.path.abspath('tutorial/')
def pullRepository():
if not os.path.isdir(workDir):
check_call([
'git', 'clone',
'https://github.com/YaleGaussian/at_selector',
workDir,
])
else:
... | true | true |
08fce37318e1cd477e20e0b3d0be69bac0665081 | 4,552 | py | Python | nvd3/lineWithFocusChart.py | timgates42/python-nvd3 | f9cb41b5deaa0d7c338764d7008a4c9a5ad50dca | [
"MIT"
] | 442 | 2015-01-12T10:13:52.000Z | 2022-01-11T15:18:48.000Z | nvd3/lineWithFocusChart.py | timgates42/python-nvd3 | f9cb41b5deaa0d7c338764d7008a4c9a5ad50dca | [
"MIT"
] | 106 | 2015-01-11T20:27:50.000Z | 2021-11-05T17:18:15.000Z | nvd3/lineWithFocusChart.py | timgates42/python-nvd3 | f9cb41b5deaa0d7c338764d7008a4c9a5ad50dca | [
"MIT"
] | 161 | 2015-01-06T13:31:18.000Z | 2022-03-09T05:22:30.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Python-nvd3 is a Python wrapper for NVD3 graph library.
NVD3 is an attempt to build re-usable charts and chart components
for d3.js without taking away the power that d3.js gives you.
Project location : https://github.com/areski/python-nvd3
"""
from .NVD3Chart import NVD... | 42.943396 | 175 | 0.522408 |
from .NVD3Chart import NVD3Chart, TemplateMixin
class lineWithFocusChart(TemplateMixin, NVD3Chart):
CHART_FILENAME = "./linewfocuschart.html"
template_chart_nvd3 = NVD3Chart.template_environment.get_template(CHART_FILENAME)
def __init__(self, **kwargs):
super(lineWithFocusChart, self).__init__... | true | true |
08fce39de1b0238957e7ab070e45030e7fadc10f | 9,488 | py | Python | spinnaker-monitoring-daemon/spinnaker-monitoring/server_handlers.py | chinaboard/spinnaker-monitoring | 8045833a811ca037a0386b77cdf139958e9298ba | [
"Apache-2.0"
] | null | null | null | spinnaker-monitoring-daemon/spinnaker-monitoring/server_handlers.py | chinaboard/spinnaker-monitoring | 8045833a811ca037a0386b77cdf139958e9298ba | [
"Apache-2.0"
] | null | null | null | spinnaker-monitoring-daemon/spinnaker-monitoring/server_handlers.py | chinaboard/spinnaker-monitoring | 8045833a811ca037a0386b77cdf139958e9298ba | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 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 a... | 36.775194 | 80 | 0.67812 |
import logging
import threading
import time
import traceback
import http_server
import command_processor
import spectator_client
class HomePageHandler(command_processor.CommandHandler):
def __init__(self, all_handlers, url_path, command_name, description):
super(HomePageHandler, self).__init__(url_path, com... | true | true |
08fce4a6181e639ec126b01a382ad441a11d2592 | 3,949 | py | Python | excerpt_tool/core.py | Mryan2005/excerpt_tool | ceb6cb7ad8921a77ebb41a9642e453648e7e5b8e | [
"MIT"
] | null | null | null | excerpt_tool/core.py | Mryan2005/excerpt_tool | ceb6cb7ad8921a77ebb41a9642e453648e7e5b8e | [
"MIT"
] | null | null | null | excerpt_tool/core.py | Mryan2005/excerpt_tool | ceb6cb7ad8921a77ebb41a9642e453648e7e5b8e | [
"MIT"
] | null | null | null | import os,sys
def laoding():
line = []
text = ''
zhailu = open('./zhailu.file','r')
for i in zhailu:
for a in i:
if a == '\n' or a == '|' or a == '':
line.append(text)
text = ''
else:
text = text + a
sentence = []
... | 27.615385 | 59 | 0.440871 | import os,sys
def laoding():
line = []
text = ''
zhailu = open('./zhailu.file','r')
for i in zhailu:
for a in i:
if a == '\n' or a == '|' or a == '':
line.append(text)
text = ''
else:
text = text + a
sentence = []
... | true | true |
08fce5c87a5275a3428f7fb133e8ca5f69fdbb17 | 939 | py | Python | server/app/TelegramAssistantClient.py | mygs/babilonia | 6cf122e6ef7b30e5d5bce9ecbc6a386610ee9538 | [
"MIT"
] | null | null | null | server/app/TelegramAssistantClient.py | mygs/babilonia | 6cf122e6ef7b30e5d5bce9ecbc6a386610ee9538 | [
"MIT"
] | 10 | 2018-01-14T11:52:49.000Z | 2018-06-16T13:00:44.000Z | server/app/TelegramAssistantClient.py | mygs/babilonia | 6cf122e6ef7b30e5d5bce9ecbc6a386610ee9538 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import os, json, requests
from TelegramAssistantServer import *
SERVER_HOME = os.path.dirname(os.path.abspath(__file__))
COMMON_DIR = os.path.join(SERVER_HOME, "../../common")
os.chdir(SERVER_HOME) # change directory because of log files
with open(os.path.join(SERVER_HOME, "... | 37.56 | 124 | 0.71885 | import os, json, requests
from TelegramAssistantServer import *
SERVER_HOME = os.path.dirname(os.path.abspath(__file__))
COMMON_DIR = os.path.join(SERVER_HOME, "../../common")
os.chdir(SERVER_HOME) with open(os.path.join(SERVER_HOME, "config.json"), "r") as config_json_file:
cfg = json.load(config_json_file)
de... | true | true |
08fce61383124a905f9207497502e0df8247d0ef | 9,941 | py | Python | fcos_core/structures/bounding_box.py | Davidnet/EmbedMask | 7f9082cdfc0ec41e4bdb86fff50008f99abd2c7e | [
"MIT"
] | 1 | 2020-07-09T11:01:51.000Z | 2020-07-09T11:01:51.000Z | fcos_core/structures/bounding_box.py | Davidnet/EmbedMask | 7f9082cdfc0ec41e4bdb86fff50008f99abd2c7e | [
"MIT"
] | null | null | null | fcos_core/structures/bounding_box.py | Davidnet/EmbedMask | 7f9082cdfc0ec41e4bdb86fff50008f99abd2c7e | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import torch
# transpose
FLIP_LEFT_RIGHT = 0
FLIP_TOP_BOTTOM = 1
class BoxList(object):
"""
This class represents a set of bounding boxes.
The bounding boxes are represented as a Nx4 Tensor.
In order to uniquely determine the bou... | 36.413919 | 92 | 0.559602 | import torch
FLIP_LEFT_RIGHT = 0
FLIP_TOP_BOTTOM = 1
class BoxList(object):
def __init__(self, bbox, image_size, mode="xyxy"):
device = bbox.device if isinstance(bbox, torch.Tensor) else torch.device("cpu")
bbox = torch.as_tensor(bbox, dtype=torch.float32, device=device)
if len(bbox) > 0... | true | true |
08fce624b84e049874cff266bebc1c3aef442aee | 1,008 | py | Python | Pregunta6.py | RodrigoES22/PythonPc3 | 989ed3930b067dcb5ea9bf4ab10ae7e142606e25 | [
"Apache-2.0"
] | null | null | null | Pregunta6.py | RodrigoES22/PythonPc3 | 989ed3930b067dcb5ea9bf4ab10ae7e142606e25 | [
"Apache-2.0"
] | null | null | null | Pregunta6.py | RodrigoES22/PythonPc3 | 989ed3930b067dcb5ea9bf4ab10ae7e142606e25 | [
"Apache-2.0"
] | null | null | null | ##Pregunta 6:
#Cree un programa que solicite al usuario una lista de calificaciones separadas
#por comas. Divida la cadena en calificaciones individuales y almacénelas en una
#lista para luego convertir cada calificación en un entero. Deberá utilizar una
#sentencia try/except para informar al usuario cuando ... | 36 | 84 | 0.628968 | def Calificaciones():
a = []
b = []
try:
cantidad = int(input("¿Cuántas notas digitará?: "))
except:
print("ERROR")
return Calificaciones()
print(f"Digite las {cantidad} calificaciones: ")
for i in range(len(a),cantidad):
try:
a... | true | true |
08fce6ddc00fe0ee64d0097feb7ee32813db5373 | 468 | py | Python | tracking/urls.py | ceys/django-tracking | e95de30b09cb208e1487e064d91ce8070b01d308 | [
"MIT"
] | 112 | 2015-08-12T19:22:35.000Z | 2022-02-04T13:21:43.000Z | tracking/urls.py | Bunch/django-tracking | 2204c165acb6df6d9676a6ab5330348fbdfe1ab8 | [
"MIT"
] | 17 | 2015-09-18T06:05:38.000Z | 2020-07-04T17:43:41.000Z | tracking/urls.py | Bunch/django-tracking | 2204c165acb6df6d9676a6ab5330348fbdfe1ab8 | [
"MIT"
] | 53 | 2015-08-12T19:19:50.000Z | 2021-10-18T11:48:49.000Z | from django.conf.urls.defaults import *
from django.conf import settings
from tracking import views
urlpatterns = patterns('',
url(r'^refresh/$', views.update_active_users, name='tracking-refresh-active-users'),
url(r'^refresh/json/$', views.get_active_users, name='tracking-get-active-users'),
)
if getattr(se... | 33.428571 | 88 | 0.711538 | from django.conf.urls.defaults import *
from django.conf import settings
from tracking import views
urlpatterns = patterns('',
url(r'^refresh/$', views.update_active_users, name='tracking-refresh-active-users'),
url(r'^refresh/json/$', views.get_active_users, name='tracking-get-active-users'),
)
if getattr(se... | true | true |
08fce73a9f23b1c081b8225a12303fa1c6b76c43 | 841 | py | Python | dvc/dependency/base.py | kaiogu/dvc | ffa8fe5888dbbb3d37b3874562f99fd77d4bbcb7 | [
"Apache-2.0"
] | null | null | null | dvc/dependency/base.py | kaiogu/dvc | ffa8fe5888dbbb3d37b3874562f99fd77d4bbcb7 | [
"Apache-2.0"
] | null | null | null | dvc/dependency/base.py | kaiogu/dvc | ffa8fe5888dbbb3d37b3874562f99fd77d4bbcb7 | [
"Apache-2.0"
] | null | null | null | from dvc.exceptions import DvcException
class DependencyDoesNotExistError(DvcException):
def __init__(self, path):
msg = "dependency '{}' does not exist".format(path)
super().__init__(msg)
class DependencyIsNotFileOrDirError(DvcException):
def __init__(self, path):
msg = "dependency ... | 26.28125 | 71 | 0.697979 | from dvc.exceptions import DvcException
class DependencyDoesNotExistError(DvcException):
def __init__(self, path):
msg = "dependency '{}' does not exist".format(path)
super().__init__(msg)
class DependencyIsNotFileOrDirError(DvcException):
def __init__(self, path):
msg = "dependency ... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.