hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ea3cb6e3c90e2b527b53dee5264a9f0e700dc0e6 | 746 | py | Python | tst/regression/scripts/tests/diffusion/viscous_diffusion_sts.py | lucyundead/athena--fork | 04a4027299145f61bdc08528548e0b1b398ba0a6 | [
"BSD-3-Clause"
] | null | null | null | tst/regression/scripts/tests/diffusion/viscous_diffusion_sts.py | lucyundead/athena--fork | 04a4027299145f61bdc08528548e0b1b398ba0a6 | [
"BSD-3-Clause"
] | null | null | null | tst/regression/scripts/tests/diffusion/viscous_diffusion_sts.py | lucyundead/athena--fork | 04a4027299145f61bdc08528548e0b1b398ba0a6 | [
"BSD-3-Clause"
] | 2 | 2020-11-21T18:35:02.000Z | 2021-03-03T01:08:19.000Z | # Regression test based on the diffusion of a Gaussian
# velocity field. Convergence of L1 norm of the error
# in v is tested. Expected 1st order conv. for STS.
# Modules
# (needed for global variables modified in run_tests.py, even w/o athena.run(), etc.)
import scripts.utils.athena as athena # noqa
import scripts... | 28.692308 | 85 | 0.752011 | # Regression test based on the diffusion of a Gaussian
# velocity field. Convergence of L1 norm of the error
# in v is tested. Expected 1st order conv. for STS.
# Modules
# (needed for global variables modified in run_tests.py, even w/o athena.run(), etc.)
import scripts.utils.athena as athena # noqa
import scripts... | 0 | 0 | 0 | 0 | 0 | 141 | 0 | 0 | 69 |
66d4ec547b50f12e68ebec7194564864bf2947bb | 4,143 | py | Python | credentials_test.py | audreynjiraini/password-Locker | 33bcc72ca6811e6583def7444ff2c48be4a71b21 | [
"MIT"
] | null | null | null | credentials_test.py | audreynjiraini/password-Locker | 33bcc72ca6811e6583def7444ff2c48be4a71b21 | [
"MIT"
] | null | null | null | credentials_test.py | audreynjiraini/password-Locker | 33bcc72ca6811e6583def7444ff2c48be4a71b21 | [
"MIT"
] | null | null | null | import unittest #import unittest module
if __name__ == '__main__':
unittest.main() | 34.525 | 101 | 0.63384 | import unittest #import unittest module
from credentials import User
from credentials import Credentials
class TestUser(unittest.TestCase):
'''
Test class that defines test cases for the user class behaviours.
Args:
unittest.TestCase: TestCase class that helps in creating test cases
'''
... | 0 | 0 | 0 | 3,916 | 0 | 0 | 0 | 21 | 98 |
00b455d8fd1d594c4913d5aab37050e3d6d79a71 | 1,893 | py | Python | main10.py | sgalati528/E02a-Control-Structures | 3df2e6437246bce35863cc7dc0f37ea3a01d28c7 | [
"MIT"
] | null | null | null | main10.py | sgalati528/E02a-Control-Structures | 3df2e6437246bce35863cc7dc0f37ea3a01d28c7 | [
"MIT"
] | null | null | null | main10.py | sgalati528/E02a-Control-Structures | 3df2e6437246bce35863cc7dc0f37ea3a01d28c7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys, random
assert sys.version_info >= (3,7), "This script requires at least Python 3.7"
print('Greetings!')#prints 'Greetings' in window
colors = ['red','orange','yellow','green','blue','violet','purple']#list of colors
play_again = ''#establishing empty variable
best_count = sys.maxsi... | 51.162162 | 98 | 0.683043 | #!/usr/bin/env python3
import sys, random
assert sys.version_info >= (3,7), "This script requires at least Python 3.7"
print('Greetings!')#prints 'Greetings' in window
colors = ['red','orange','yellow','green','blue','violet','purple']#list of colors
play_again = ''#establishing empty variable
best_count = sys.maxsi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
12534567a129ddc28bc58f9b5ad9a2f169707527 | 1,953 | py | Python | setup.py | aurzenligl/prophy | 4e60162b3871aa7c43a38f273c2840ce4cf758f7 | [
"MIT"
] | 14 | 2015-02-19T22:00:37.000Z | 2020-11-30T03:03:55.000Z | setup.py | aurzenligl/prophy | 4e60162b3871aa7c43a38f273c2840ce4cf758f7 | [
"MIT"
] | 31 | 2015-06-22T11:11:10.000Z | 2021-05-12T06:35:47.000Z | setup.py | aurzenligl/prophy | 4e60162b3871aa7c43a38f273c2840ce4cf758f7 | [
"MIT"
] | 16 | 2015-06-12T06:48:06.000Z | 2019-11-26T22:48:13.000Z | from setuptools import setup, find_packages
long_description = open('README.rst').read()
setup(
name='prophy',
version='1.2.4',
author='Krzysztof Laskowski',
author_email='aurzenligl@gmail.com',
maintainer='Krzysztof Laskowski',
maintainer_email='aurzenligl@gmail.com',
license='MIT license... | 39.06 | 82 | 0.631848 | from setuptools import setup, find_packages
long_description = open('README.rst').read()
setup(
name='prophy',
version='1.2.4',
author='Krzysztof Laskowski',
author_email='aurzenligl@gmail.com',
maintainer='Krzysztof Laskowski',
maintainer_email='aurzenligl@gmail.com',
license='MIT license... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7c93f6ac49cf6ace4ed9e1f7c1cbc4f6c2227ae9 | 4,712 | py | Python | ambuild2/graph.py | Accelerator74/ambuild | b322668b7ee4063d2443623bc2b777cfad1695c1 | [
"BSD-3-Clause"
] | 34 | 2015-02-11T19:43:01.000Z | 2022-01-24T10:18:54.000Z | ambuild2/graph.py | Accelerator74/ambuild | b322668b7ee4063d2443623bc2b777cfad1695c1 | [
"BSD-3-Clause"
] | 64 | 2015-02-06T19:54:22.000Z | 2021-11-07T11:42:47.000Z | ambuild2/graph.py | Accelerator74/ambuild | b322668b7ee4063d2443623bc2b777cfad1695c1 | [
"BSD-3-Clause"
] | 32 | 2015-02-06T19:36:51.000Z | 2021-12-01T22:05:28.000Z | # vim: set ts=8 sts=2 sw=2 tw=99 et:
#
# This file is part of AMBuild.
#
# AMBuild is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ... | 32.951049 | 80 | 0.610781 | # vim: set ts=8 sts=2 sw=2 tw=99 et:
#
# This file is part of AMBuild.
#
# AMBuild is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ... | 0 | 123 | 0 | 3,822 | 0 | 0 | 0 | 9 | 68 |
34c2231ff683dea892eed3e2e72b153911ddc95f | 2,188 | py | Python | ImageSegmentationAPI/segmentation.py | ayoolaolafenwa/MLOps | 1faec566688dedf7e98a399de546e481b3a6641e | [
"MIT"
] | 3 | 2021-11-24T09:20:15.000Z | 2022-02-12T19:44:34.000Z | ImageSegmentationAPI/segmentation.py | ayoolaolafenwa/MLOps | 1faec566688dedf7e98a399de546e481b3a6641e | [
"MIT"
] | null | null | null | ImageSegmentationAPI/segmentation.py | ayoolaolafenwa/MLOps | 1faec566688dedf7e98a399de546e481b3a6641e | [
"MIT"
] | null | null | null | from flask import Flask
from pixellib.torchbackend.instance import instanceSegmentation
import os
app = Flask(__name__)
upload_folder = "static"
os.makedirs(upload_folder, exist_ok=True)
app.config["upload_folder"] = upload_folder
ins = instanceSegmentation()
ins.load_model("pointrend_resnet50.pkl")
... | 33.151515 | 199 | 0.675503 | import flask
from flask import Flask, jsonify, render_template, url_for, request, redirect, jsonify, send_from_directory
from werkzeug.utils import secure_filename
import pixellib
from pixellib.torchbackend.instance import instanceSegmentation
import os
app = Flask(__name__)
upload_folder = "static"
os.makedirs(uploa... | 0 | 1,550 | 0 | 0 | 0 | 0 | 0 | 90 | 158 |
3340464613516bc80450402681fc7fc101fdc4af | 1,706 | py | Python | miningpool_test/rpc_client.py | tiaotiao00/HSR00qianbao | a88afebeb98e786389f369447bcf9c3a2a352cfa | [
"MIT"
] | 66 | 2017-09-29T07:09:59.000Z | 2020-01-12T06:45:08.000Z | miningpool_test/rpc_client.py | tiaotiao00/HSR00qianbao | a88afebeb98e786389f369447bcf9c3a2a352cfa | [
"MIT"
] | 5 | 2017-12-13T13:12:05.000Z | 2018-01-18T10:34:02.000Z | miningpool_test/rpc_client.py | tiaotiao00/HSR00qianbao | a88afebeb98e786389f369447bcf9c3a2a352cfa | [
"MIT"
] | 11 | 2017-12-05T07:02:05.000Z | 2018-01-28T02:52:50.000Z | #!/usr/bin/env python
# encoding: utf-8
__author__ = 'hasee'
if __name__ == '__main__':
pass
| 25.848485 | 88 | 0.590856 | #!/usr/bin/env python
# encoding: utf-8
__author__ = 'hasee'
import socket
import json
class RpcConnection(object):
request_template = '''{"jsonrpc":"2.0","id":"1","method":"%s","params":%s}'''
ReadBufSize = 4096
def __init__(self, ip, port):
self.rpc_server_ip = ip
self.rpc_server_port ... | 0 | 0 | 0 | 1,249 | 0 | 259 | 0 | -18 | 114 |
5887a2e5a4198204e4fbd39ba5658f17ca21f81c | 1,080 | py | Python | gui_and_analytics/analytics/linear_path_solar.py | panzer/capstone-mppt | 02e42139ea3031d15924d65de24ef47282327752 | [
"MIT"
] | 1 | 2019-11-17T15:15:44.000Z | 2019-11-17T15:15:44.000Z | gui_and_analytics/analytics/linear_path_solar.py | panzer/capstone-mppt | 02e42139ea3031d15924d65de24ef47282327752 | [
"MIT"
] | null | null | null | gui_and_analytics/analytics/linear_path_solar.py | panzer/capstone-mppt | 02e42139ea3031d15924d65de24ef47282327752 | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
main() | 32.727273 | 82 | 0.752778 | import pvlib as pv
from datetime import datetime
import pandas.plotting
from analytics.location.path import LinearPath
from analytics.solar_qualities.position import get_solar_position_time_range_track
from analytics.plots.plot_solar_position import plot_elevation_azimuth
from analytics.plots.plot_path import plot_path... | 0 | 0 | 0 | 0 | 0 | 643 | 0 | 177 | 221 |
15f64549cba042691451a506d51d93db8572a104 | 2,583 | py | Python | UnitTests/Volume/TypedCoords2Volume/test_backward.py | dendisuhubdy/TorchProteinLibrary | 89f0f6c311658b9313484cd92804682a251b1b97 | [
"MIT"
] | 96 | 2018-10-18T20:08:32.000Z | 2021-09-27T11:31:25.000Z | UnitTests/Volume/TypedCoords2Volume/test_backward.py | dendisuhubdy/TorchProteinLibrary | 89f0f6c311658b9313484cd92804682a251b1b97 | [
"MIT"
] | 24 | 2018-10-19T13:59:21.000Z | 2021-08-04T16:13:48.000Z | UnitTests/Volume/TypedCoords2Volume/test_backward.py | dendisuhubdy/TorchProteinLibrary | 89f0f6c311658b9313484cd92804682a251b1b97 | [
"MIT"
] | 23 | 2018-12-06T06:17:18.000Z | 2021-10-05T12:46:34.000Z | import torch
import matplotlib.pylab as plt
import numpy as np
from TorchProteinLibrary.Volume import TypedCoords2Volume
if __name__=='__main__':
num_atoms = 10
atom_coords = []
atom_types = []
for i in range(0,num_atoms):
atom_coords.append(1.0 + np.random.rand(3)*110.0)
atom_types.append(np.random.randint(l... | 32.2875 | 100 | 0.707317 | import sys
import os
import torch
import matplotlib.pylab as plt
import numpy as np
from TorchProteinLibrary.FullAtomModel import Angles2Coords
from TorchProteinLibrary.FullAtomModel import Coords2TypedCoords
from TorchProteinLibrary.FullAtomModel import Coords2CenteredCoords
from TorchProteinLibrary.Volume import Typ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 97 | 134 |
5cb23c362a3c6b3acb04e5a8549245bf13d288c3 | 4,611 | py | Python | tests/test_profile.py | sjforeman/halomod | 587db6bc71a77ea60a541b306fc3601eeb424bc9 | [
"MIT"
] | null | null | null | tests/test_profile.py | sjforeman/halomod | 587db6bc71a77ea60a541b306fc3601eeb424bc9 | [
"MIT"
] | null | null | null | tests/test_profile.py | sjforeman/halomod | 587db6bc71a77ea60a541b306fc3601eeb424bc9 | [
"MIT"
] | null | null | null | """
Test various halo profile properties.
"""
from halomod.concentration import Bullock01Power
import numpy as np
bullock = Bullock01Power(ms=1e12)
m = np.logspace(10, 15, 100)
r = np.logspace(-2, 2, 20)
| 25.335165 | 88 | 0.612665 | """
Test various halo profile properties.
"""
from halomod.concentration import Bullock01Power
from halomod import profiles as pf
from halomod import TracerHaloModel
import pytest
import numpy as np
bullock = Bullock01Power(ms=1e12)
m = np.logspace(10, 15, 100)
r = np.logspace(-2, 2, 20)
class NFWnum(pf.Profile):
... | 0 | 2,008 | 0 | 260 | 0 | 1,717 | 0 | 19 | 388 |
6ce137d2082d9c6f59d245ef8965cd4c05d1fee6 | 3,000 | py | Python | app/1.3.py | filangelos/random-forest | 0fc7a4f74b1120f3e527e824abc1de1aa32f2b18 | [
"MIT"
] | 1 | 2019-10-21T20:49:24.000Z | 2019-10-21T20:49:24.000Z | app/1.3.py | filangel/random-forest | 0fc7a4f74b1120f3e527e824abc1de1aa32f2b18 | [
"MIT"
] | null | null | null | app/1.3.py | filangel/random-forest | 0fc7a4f74b1120f3e527e824abc1de1aa32f2b18 | [
"MIT"
] | 2 | 2020-09-22T16:27:50.000Z | 2020-12-01T21:08:37.000Z | # EXECUTION TIME: 4s
# Python 3 ImportError
import sys
sys.path.append('.')
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import src as ya
from sklearn import tree
import graphviz
# prettify plots
plt.rcParams['font.family'] = 'Times New Roman'
sns.set_style({"xtick.direction": "in", "yti... | 31.914894 | 79 | 0.557667 | # EXECUTION TIME: 4s
# Python 3 ImportError
import sys
sys.path.append('.')
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import src as ya
from sklearn import tree
import graphviz
# prettify plots
plt.rcParams['font.family'] = 'Times New Roman'
sns.set_style({"xtick.direction": "in", "yti... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6cdb2cfdf25492c511629572a6ebe4abdfd9eb72 | 2,168 | py | Python | src/translate.py | efrubin/text-translate | 8e7ae2af17cbff97e4d55c8644ec5234711593b3 | [
"MIT"
] | null | null | null | src/translate.py | efrubin/text-translate | 8e7ae2af17cbff97e4d55c8644ec5234711593b3 | [
"MIT"
] | null | null | null | src/translate.py | efrubin/text-translate | 8e7ae2af17cbff97e4d55c8644ec5234711593b3 | [
"MIT"
] | null | null | null | # translate.py
# Author: Elias Rubin
import requests
def parse_body(body_text):
"""
param: body_text :: string
"""
try:
split_text = body_text.rsplit(" ")
source_lang = split_text[0]
target_lang = split_text[1]
query_string = " ".join(split_text[2:])
except Exc... | 31.42029 | 79 | 0.632841 | # translate.py
# Author: Elias Rubin
import requests
from config import *
def parse_body(body_text):
"""
param: body_text :: string
"""
try:
split_text = body_text.rsplit(" ")
source_lang = split_text[0]
target_lang = split_text[1]
query_string = " ".join(split_text... | 0 | 0 | 0 | 0 | 0 | 306 | 0 | -1 | 45 |
7f4b3c1917762fddb659e869cc3527294c28056e | 16,572 | py | Python | OptimizationSolver.py | purboday/ResilientDeploymentSolver | 1ea1471a71e9993cd766abc907694d92b1142b67 | [
"MIT"
] | null | null | null | OptimizationSolver.py | purboday/ResilientDeploymentSolver | 1ea1471a71e9993cd766abc907694d92b1142b67 | [
"MIT"
] | null | null | null | OptimizationSolver.py | purboday/ResilientDeploymentSolver | 1ea1471a71e9993cd766abc907694d92b1142b67 | [
"MIT"
] | null | null | null |
# A = ['A1','A2','A3']
# D = [2,2,2]
# C = [['A1','A2']]
# S = [[['A1','A2'], ['A3']]]
# H = {}
# num_nodes = 3
HOSTCONF = '/usr/local/riaps/etc/riaps-hosts.conf'
HWSPEC = '/home/riaps/workspace/ResilientDeploymentSolver/hardware-spec.conf'
if __name__ == '__main__':
main()
| 52.113208 | 478 | 0.538861 | from z3 import *
from ModelParser import ModelParser
import argparse
from configparser import ConfigParser
import time
from DeplGenerator import DeplGenerator
# A = ['A1','A2','A3']
# D = [2,2,2]
# C = [['A1','A2']]
# S = [[['A1','A2'], ['A3']]]
# H = {}
# num_nodes = 3
HOSTCONF = '/usr/local/riaps/etc/r... | 0 | 0 | 0 | 14,353 | 0 | 1,681 | 0 | 27 | 197 |
8dbb579a608c0e6cabd5b059b9d8539d9c061fa1 | 294 | py | Python | app/api/api.py | ridhanf/python-fastapi-challenge | 041a2156c222dbd84805d6b6ee1d9b88b8227db3 | [
"MIT"
] | null | null | null | app/api/api.py | ridhanf/python-fastapi-challenge | 041a2156c222dbd84805d6b6ee1d9b88b8227db3 | [
"MIT"
] | null | null | null | app/api/api.py | ridhanf/python-fastapi-challenge | 041a2156c222dbd84805d6b6ee1d9b88b8227db3 | [
"MIT"
] | null | null | null | from fastapi import APIRouter
from app.api.endpoints import user_controller, course_controller
api_router = APIRouter()
api_router.include_router(user_controller.router, prefix="/users", tags=["users"])
api_router.include_router(course_controller.router, prefix="/courses", tags=["courses"])
| 36.75 | 88 | 0.809524 | from fastapi import APIRouter
from app.api.endpoints import user_controller, course_controller
api_router = APIRouter()
api_router.include_router(user_controller.router, prefix="/users", tags=["users"])
api_router.include_router(course_controller.router, prefix="/courses", tags=["courses"])
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
992eab7cfe01a30b4028dd1e1fb01d94f6009d53 | 57 | py | Python | Tkinter Library/test.py | ssergiuk/codes | ea1dea9cf3985228dacb02d31de01bc929fda939 | [
"MIT"
] | null | null | null | Tkinter Library/test.py | ssergiuk/codes | ea1dea9cf3985228dacb02d31de01bc929fda939 | [
"MIT"
] | null | null | null | Tkinter Library/test.py | ssergiuk/codes | ea1dea9cf3985228dacb02d31de01bc929fda939 | [
"MIT"
] | null | null | null |
print(search(year = "1918"))
| 11.4 | 29 | 0.631579 | from backend import *
print(search(year = "1918"))
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 23 |
2b2b4802f14c5cec452653b92e08c2d93f4137e2 | 953 | py | Python | tasks.py | xycfree/spot_trend_grid_web | 261e66901ce98fe13fd8a01b96ae7a9771744278 | [
"Apache-2.0"
] | 4 | 2021-04-30T10:22:58.000Z | 2021-09-16T10:11:23.000Z | tasks.py | xycfree/spot_trend_grid_web | 261e66901ce98fe13fd8a01b96ae7a9771744278 | [
"Apache-2.0"
] | 1 | 2021-09-16T17:35:13.000Z | 2021-09-16T17:35:13.000Z | tasks.py | xycfree/spot_trend_grid_web | 261e66901ce98fe13fd8a01b96ae7a9771744278 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
| 27.228571 | 98 | 0.627492 | # -*- coding: utf-8 -*-
from django import views
from spot_trend_grid.views import SpotTrendGridView, logger, BatchOrderDetailView, BatchOrderView
class SpotTrendGridViews(views.View):
def spot_start_run(self):
logger.debug("趋势策略定时任务开始执行")
try:
SpotTrendGridView().loop_r... | 216 | 0 | 0 | 648 | 0 | 0 | 0 | 79 | 124 |
7d5ec5be628fcb4db2f071463e7c659cd12f6ee7 | 701 | py | Python | pyrevolve/build/sdf/battery.py | braj29/robo_swimmers | b3c3fa91976884095eb6b5e67844167598ec573d | [
"Apache-1.1"
] | 24 | 2017-06-19T20:25:15.000Z | 2022-01-03T16:27:34.000Z | pyrevolve/build/sdf/battery.py | Ravi-Bossema/revolve | 46ece6f7dc137afcc0ddcde163ffcfe9548bd1ad | [
"Apache-1.1"
] | 51 | 2016-04-19T16:01:34.000Z | 2021-09-17T19:07:10.000Z | pyrevolve/build/sdf/battery.py | Ravi-Bossema/revolve | 46ece6f7dc137afcc0ddcde163ffcfe9548bd1ad | [
"Apache-1.1"
] | 37 | 2017-02-21T23:20:44.000Z | 2022-01-18T16:40:17.000Z | from __future__ import absolute_import
| 23.366667 | 73 | 0.620542 | from __future__ import absolute_import
from pyrevolve.sdfbuilder import Element
from pyrevolve.sdfbuilder.util import number_format as nf
class BasicBattery(Element):
"""
The rv:battery element, to be included in a robot's plugin
"""
TAG_NAME = 'rv:battery'
def __init__(self, level):
"""... | 0 | 0 | 0 | 538 | 0 | 0 | 0 | 55 | 68 |
350e538d008365e6784c812a01c6607d75ebaa48 | 116 | py | Python | static_website_activitypub/__init__.py | ned14/hugo-activitypub | e5ee1225ace2691a710b736e29a808e1a0fe8005 | [
"Apache-2.0"
] | 17 | 2019-01-23T07:05:10.000Z | 2021-10-17T07:06:04.000Z | static_website_activitypub/__init__.py | ned14/hugo-activitypub | e5ee1225ace2691a710b736e29a808e1a0fe8005 | [
"Apache-2.0"
] | null | null | null | static_website_activitypub/__init__.py | ned14/hugo-activitypub | e5ee1225ace2691a710b736e29a808e1a0fe8005 | [
"Apache-2.0"
] | null | null | null | from .cmd import version
__version__ = version
| 23.2 | 34 | 0.706897 | from .cmd import main, version
__version__ = version
def invoke_main(*args):
return next(main(*args), None)
| 0 | 0 | 0 | 0 | 0 | 37 | 0 | 6 | 22 |
e04d0b8f0cf3c7d97f8345f26315c2cc9d35a3b6 | 1,510 | py | Python | load_balance/decorators.py | kaikwb/load-balance | 90cad93cabd777bdd0c55db945b26cce895c1ae5 | [
"MIT"
] | null | null | null | load_balance/decorators.py | kaikwb/load-balance | 90cad93cabd777bdd0c55db945b26cce895c1ae5 | [
"MIT"
] | null | null | null | load_balance/decorators.py | kaikwb/load-balance | 90cad93cabd777bdd0c55db945b26cce895c1ae5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import typing as ty
def validate_range(parameter: str, minimum: ty.Union[int, float],
maximum: ty.Union[int, float]) -> ty.Callable:
"""
Validate a parameter range.
Args:
parameter: Parameter to validate
minimum: Minimum limit.
maximum: Ma... | 29.038462 | 75 | 0.552318 | #!/usr/bin/env python3
import functools
import inspect
import typing as ty
from .exceptions import InvalidArgumentValueException
def validate_range(parameter: str, minimum: ty.Union[int, float],
maximum: ty.Union[int, float]) -> ty.Callable:
"""
Validate a parameter range.
Args:
... | 0 | 932 | 0 | 0 | 0 | 54 | 0 | 20 | 94 |
6d31838be1f74f3976e0e3798e6668779faf3482 | 1,510 | py | Python | src/rpdk/core/submit.py | wbingli/cloudformation-cli | 75a39cb7f73596f01ce04c85967dea74fe5a893d | [
"Apache-2.0"
] | 200 | 2019-12-02T03:33:37.000Z | 2022-03-31T21:50:23.000Z | src/rpdk/core/submit.py | wbingli/cloudformation-cli | 75a39cb7f73596f01ce04c85967dea74fe5a893d | [
"Apache-2.0"
] | 353 | 2019-11-26T20:20:56.000Z | 2022-03-31T00:53:05.000Z | src/rpdk/core/submit.py | wbingli/cloudformation-cli | 75a39cb7f73596f01ce04c85967dea74fe5a893d | [
"Apache-2.0"
] | 110 | 2019-11-26T21:58:16.000Z | 2022-03-26T19:02:11.000Z | """This sub command uploads the resource type to CloudFormation.
Projects can be created via the 'init' sub command.
"""
import logging
LOG = logging.getLogger(__name__)
| 29.038462 | 88 | 0.660927 | """This sub command uploads the resource type to CloudFormation.
Projects can be created via the 'init' sub command.
"""
import logging
from .project import Project
LOG = logging.getLogger(__name__)
def submit(args):
project = Project()
project.load()
project.submit(
args.dry_run,
args.... | 0 | 0 | 0 | 0 | 0 | 1,260 | 0 | 7 | 69 |
007058e50c3d63652db41001463200413a3da7c2 | 1,229 | py | Python | inst/python/rpytools/output.py | Mormukut11/R-interface-to-Python | 43664503884625f55cd4d452228a7a855ce86ce2 | [
"Apache-2.0"
] | null | null | null | inst/python/rpytools/output.py | Mormukut11/R-interface-to-Python | 43664503884625f55cd4d452228a7a855ce86ce2 | [
"Apache-2.0"
] | null | null | null | inst/python/rpytools/output.py | Mormukut11/R-interface-to-Python | 43664503884625f55cd4d452228a7a855ce86ce2 | [
"Apache-2.0"
] | 1 | 2019-12-16T13:09:28.000Z | 2019-12-16T13:09:28.000Z | try:
from StringIO import StringIO
except ImportError:
| 17.811594 | 55 | 0.684296 |
import sys
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
def start_stdout_capture():
restore = sys.stdout
sys.stdout = StringIO()
return restore
def end_stdout_capture(restore):
output = sys.stdout.getvalue()
sys.stdout.close()
sys.stdout = restore
return output
de... | 0 | 0 | 0 | 438 | 0 | 547 | 0 | -9 | 185 |
b4818ce695a52ff6cbc3f1cd492575e1570ecafd | 105 | py | Python | week1.py | alicia3106/csws-week1 | 3506e2bd288e1427e0a1b87dc25f1e5185a484bd | [
"Apache-2.0"
] | null | null | null | week1.py | alicia3106/csws-week1 | 3506e2bd288e1427e0a1b87dc25f1e5185a484bd | [
"Apache-2.0"
] | null | null | null | week1.py | alicia3106/csws-week1 | 3506e2bd288e1427e0a1b87dc25f1e5185a484bd | [
"Apache-2.0"
] | null | null | null | message = "Hello python world"
print(message)
message = "Hello python crash course world"
print(message) | 21 | 43 | 0.771429 | message = "Hello python world"
print(message)
message = "Hello python crash course world"
print(message) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9e9f2bd8f1745c93555461963f8bfcaa19749402 | 317 | py | Python | packages/PIPS/validation/Transformations/pragma.py | DVSR1966/par4all | 86b33ca9da736e832b568c5637a2381f360f1996 | [
"MIT"
] | 51 | 2015-01-31T01:51:39.000Z | 2022-02-18T02:01:50.000Z | packages/PIPS/validation/Transformations/pragma.py | DVSR1966/par4all | 86b33ca9da736e832b568c5637a2381f360f1996 | [
"MIT"
] | 7 | 2017-05-29T09:29:00.000Z | 2019-03-11T16:01:39.000Z | packages/PIPS/validation/Transformations/pragma.py | DVSR1966/par4all | 86b33ca9da736e832b568c5637a2381f360f1996 | [
"MIT"
] | 12 | 2015-03-26T08:05:38.000Z | 2022-02-18T02:01:51.000Z | from __future__ import with_statement # this is to work with python2.5
from pyps import workspace
import pypips
filename="pragma"
pypips.delete_workspace(filename)
with workspace(filename+".c", parents=[], driver="sse", name=filename) as w:
m=w[filename]
m.suppress_dead_code()
m.display()
| 24.384615 | 76 | 0.772871 | from __future__ import with_statement # this is to work with python2.5
from pyps import workspace
from os import remove
import pypips
filename="pragma"
pypips.delete_workspace(filename)
with workspace(filename+".c", parents=[], driver="sse", name=filename) as w:
m=w[filename]
m.suppress_dead_code()
m.display()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 22 |
c4ff67927f8cb153b6156d60713471bd0f4c2b5a | 9,151 | py | Python | run/php/projects/BLB/get.strongs.py | DataWar/-code- | b25a01d2ee34528880da464fec62c2fb3ed36ff4 | [
"MIT"
] | null | null | null | run/php/projects/BLB/get.strongs.py | DataWar/-code- | b25a01d2ee34528880da464fec62c2fb3ed36ff4 | [
"MIT"
] | null | null | null | run/php/projects/BLB/get.strongs.py | DataWar/-code- | b25a01d2ee34528880da464fec62c2fb3ed36ff4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import argparse
import os
import time
# stackoverflow.com/questions/230751/how-to-flush-output-of-print-function
# https://opensource.com/article/19/7/parse-arguments-python
options = getOptions()
print(options)
img_small = options.local + "small.png"
# if it is cached, let's quit
... | 27.730303 | 334 | 0.722107 | #!/usr/bin/env python
import argparse
import sys
import os
import time
# stackoverflow.com/questions/230751/how-to-flush-output-of-print-function
# https://opensource.com/article/19/7/parse-arguments-python
def getOptions(args=sys.argv[1:]):
parser = argparse.ArgumentParser(description="Parses command.")
pa... | 3 | 0 | 0 | 0 | 0 | 654 | 0 | 29 | 89 |
e11a5f4db8ff10027a22b3aef00f0134729f3a35 | 1,068 | py | Python | 2021/3/main.py | scleond/advent-of-code | a91ebbcb8c36dd89a95a9ddbb0a07319b0e44247 | [
"Unlicense"
] | null | null | null | 2021/3/main.py | scleond/advent-of-code | a91ebbcb8c36dd89a95a9ddbb0a07319b0e44247 | [
"Unlicense"
] | null | null | null | 2021/3/main.py | scleond/advent-of-code | a91ebbcb8c36dd89a95a9ddbb0a07319b0e44247 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat Dec 4 11:19:02 2021
@author: chris
"""
# part 1
with open('input.txt') as f:
lines = f.read().splitlines() # doesn't read \n
reportSum = [0] * len(lines[0])
gammaRateArray = [0] * len(lines[0])
epsilonRateArray = [0] * len(lines[0])
for line... | 22.723404 | 66 | 0.539326 | # -*- coding: utf-8 -*-
"""
Created on Sat Dec 4 11:19:02 2021
@author: chris
"""
# part 1
with open('input.txt') as f:
lines = f.read().splitlines() # doesn't read \n
reportSum = [0] * len(lines[0])
gammaRateArray = [0] * len(lines[0])
epsilonRateArray = [0] * len(lines[0])
for line... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
66d246fe1950e294db439302240a2bb421a41938 | 570 | py | Python | src/test/get_page.py | fmontoto/bot-valevista | c7cfd853cbdbd9971d6fbea93865e414b1f12e2a | [
"MIT"
] | null | null | null | src/test/get_page.py | fmontoto/bot-valevista | c7cfd853cbdbd9971d6fbea93865e414b1f12e2a | [
"MIT"
] | null | null | null | src/test/get_page.py | fmontoto/bot-valevista | c7cfd853cbdbd9971d6fbea93865e414b1f12e2a | [
"MIT"
] | null | null | null | """Test call for testing web retrieve, don't call automatically, as it does a
real http GET."""
import unittest
if __name__ == '__main__':
unittest.main()
| 23.75 | 77 | 0.685965 | """Test call for testing web retrieve, don't call automatically, as it does a
real http GET."""
import unittest
from unittest import TestCase
from src.utils import Rut
from src import web
class TestGetPage(TestCase):
"""Get a real page using dummy_rut."""
def setUp(self):
self.dummy_rut = Rut.build_... | 0 | 0 | 0 | 307 | 0 | 0 | 0 | 10 | 90 |
09c07a9b8327b78a0ad1eb60246eb68124587791 | 2,303 | py | Python | main.py | BenTimor/SerializationConceptSystem | 0f85dc32063d270a5564cda3199d84d474e5d83e | [
"MIT"
] | 1 | 2020-11-13T22:21:47.000Z | 2020-11-13T22:21:47.000Z | main.py | BenTimor/SerializationConceptSystem | 0f85dc32063d270a5564cda3199d84d474e5d83e | [
"MIT"
] | null | null | null | main.py | BenTimor/SerializationConceptSystem | 0f85dc32063d270a5564cda3199d84d474e5d83e | [
"MIT"
] | null | null | null | from flask import Flask
from blog import Config
app = Flask(__name__)
if __name__ == "__main__":
Config.setup()
app.run(debug=True) | 37.145161 | 106 | 0.65393 | from flask import Flask, render_template, request, make_response, redirect, url_for
from blog import Config, User, Comment, Post
app = Flask(__name__)
def login_or_register():
# If the request method is 'Get' it means that we're just requesting the page and not sending any form
if request.method == "POST":
... | 0 | 855 | 0 | 0 | 0 | 1,133 | 0 | 81 | 92 |
7213af397d0b6a86148b38681378ea59b6ac1d27 | 6,067 | py | Python | tests/test_alpha_vantage_api.py | NeonJarbas/neon_api_proxy | aec750f393cf0fd7c8c01388cb6e0b23dc6197cf | [
"BSD-3-Clause"
] | null | null | null | tests/test_alpha_vantage_api.py | NeonJarbas/neon_api_proxy | aec750f393cf0fd7c8c01388cb6e0b23dc6197cf | [
"BSD-3-Clause"
] | 8 | 2021-08-17T00:28:50.000Z | 2022-03-29T07:06:18.000Z | tests/test_alpha_vantage_api.py | NeonJarbas/neon_api_proxy | aec750f393cf0fd7c8c01388cb6e0b23dc6197cf | [
"BSD-3-Clause"
] | 2 | 2021-08-12T20:36:04.000Z | 2022-02-15T01:40:01.000Z | # NEON AI (TM) SOFTWARE, Software Development Kit & Application Development System
# All trademark and other rights reserved by their respective owners
# Copyright 2008-2021 Neongecko.com Inc.
# BSD-3
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the fo... | 43.335714 | 85 | 0.695896 | # NEON AI (TM) SOFTWARE, Software Development Kit & Application Development System
# All trademark and other rights reserved by their respective owners
# Copyright 2008-2021 Neongecko.com Inc.
# BSD-3
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the fo... | 0 | 60 | 0 | 3,920 | 0 | 0 | 0 | 29 | 68 |
86cc5c6cf01ae027dc19d709e6e9f51e63c50a27 | 2,492 | py | Python | models/GPND_ae.py | MPCAICDM/MPCA | c996435a0578ea4160f934bc01041c2ef23468f3 | [
"MIT"
] | null | null | null | models/GPND_ae.py | MPCAICDM/MPCA | c996435a0578ea4160f934bc01041c2ef23468f3 | [
"MIT"
] | null | null | null | models/GPND_ae.py | MPCAICDM/MPCA | c996435a0578ea4160f934bc01041c2ef23468f3 | [
"MIT"
] | null | null | null | import torch.nn as nn
| 33.675676 | 97 | 0.610754 | from functools import reduce
from operator import mul
from typing import Tuple
import torch
import torch.nn as nn
import torch.nn.functional as F
class Encoder(nn.Module):
def __init__(self, z_size, d=128, channels=1):
super(Encoder, self).__init__()
self.conv1_1 = nn.Conv2d(channels, d, 4, 2, 1)
... | 0 | 0 | 0 | 2,074 | 0 | 176 | 0 | 14 | 203 |
624f246eb36fadd0f32835d24814330ec6e4c286 | 1,416 | py | Python | setup.py | jean/plantuml-markdown | f897a6081017a44de0bcaa7e20b0dc388f6b4485 | [
"BSD-2-Clause"
] | null | null | null | setup.py | jean/plantuml-markdown | f897a6081017a44de0bcaa7e20b0dc388f6b4485 | [
"BSD-2-Clause"
] | null | null | null | setup.py | jean/plantuml-markdown | f897a6081017a44de0bcaa7e20b0dc388f6b4485 | [
"BSD-2-Clause"
] | null | null | null | import setuptools
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, "README.md")) as f:
long_description = f.read()
with open(path.join(here, 'requirements.txt')) as f:
install_requirements = f.read().splitlines()
with open(path.join(here, 'test-requirements.txt')) a... | 34.536585 | 75 | 0.680085 | import setuptools
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, "README.md")) as f:
long_description = f.read()
with open(path.join(here, 'requirements.txt')) as f:
install_requirements = f.read().splitlines()
with open(path.join(here, 'test-requirements.txt')) a... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c4773bcd889523fd8593c3f90a74fa1be28b1529 | 366 | py | Python | ledplex.py | rishaldyprisly/upy | 24986011d82c598ae504c89680a5778b42a7e81f | [
"MIT"
] | null | null | null | ledplex.py | rishaldyprisly/upy | 24986011d82c598ae504c89680a5778b42a7e81f | [
"MIT"
] | null | null | null | ledplex.py | rishaldyprisly/upy | 24986011d82c598ae504c89680a5778b42a7e81f | [
"MIT"
] | null | null | null | import charlieplex
from machine import Pin, I2C
from time import sleep
i2c = I2C(scl=Pin(22), sda=Pin(21))
display = charlieplex.Matrix(i2c)
display.fill(0)
x = 0
y = 0
while True:
display.pixel(y, x, 255)
x += 1
print(x, y)
if( x > 7):
x = 0
y += 1
if(y>7):
display.fill(... | 16.636364 | 36 | 0.530055 | import charlieplex
from machine import Pin, I2C
from time import sleep
i2c = I2C(scl=Pin(22), sda=Pin(21))
display = charlieplex.Matrix(i2c)
display.fill(0)
x = 0
y = 0
while True:
display.pixel(y, x, 255)
x += 1
print(x, y)
if( x > 7):
x = 0
y += 1
if(y>7):
display.fill(... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
80a1275c5893b3dd18615e4e4f6863e6e4a396a3 | 2,288 | py | Python | mecabpy/test/test_ipa/test_node.py | unaguna/serval-chat | 76d441a78573b066343073d60b27006bddd906d9 | [
"MIT"
] | null | null | null | mecabpy/test/test_ipa/test_node.py | unaguna/serval-chat | 76d441a78573b066343073d60b27006bddd906d9 | [
"MIT"
] | null | null | null | mecabpy/test/test_ipa/test_node.py | unaguna/serval-chat | 76d441a78573b066343073d60b27006bddd906d9 | [
"MIT"
] | null | null | null |
import mecabpy
| 37.508197 | 98 | 0.399476 | import MeCab
import mecabpy
import mecabpy.ipa
class TestNode:
"""mecabpy.ipa.Node のテスト
"""
INPUT_TEXT = '太郎はこの本を田中を見た女性に渡した。'
def test_attr_surface(self):
"""NodeWrapper.surface のテスト
"""
surface = '見'
node = mecabpy.ipa.Node(surface=surface,
... | 297 | 0 | 0 | 2,093 | 0 | 0 | 0 | -12 | 90 |
7515dbca5a2d3801a5c3c5fd4fd17591e3f8cae3 | 4,087 | py | Python | projects_in_python/CS5001/bullsAndCows/test_bulls_n_cows.py | xhusser1/schoolProjects | d1165fdb35e69a9504c5f47fcac3c48c74d866b9 | [
"MIT"
] | null | null | null | projects_in_python/CS5001/bullsAndCows/test_bulls_n_cows.py | xhusser1/schoolProjects | d1165fdb35e69a9504c5f47fcac3c48c74d866b9 | [
"MIT"
] | null | null | null | projects_in_python/CS5001/bullsAndCows/test_bulls_n_cows.py | xhusser1/schoolProjects | d1165fdb35e69a9504c5f47fcac3c48c74d866b9 | [
"MIT"
] | null | null | null | TEST_GUESSES = [[1,2, 3, 4], [5, 2, 3, 4], [7, 6, 5, 4], [0, 9, 8, 5],
[2, 4, 6, 8], [1, 3, 5, 7], [1, 2, 0, 9] ]
TEST_SECRET = [[1,9,8, 7],[2,4,6, 7], [1,2,0, 9],[7,6,5, 4]]
def test_count_bulls_and_cows():
''' Function test_count_bulls_and_cows
Input: None.
Returns: Number of fa... | 38.556604 | 78 | 0.61561 | from bulls_n_cows import*
TEST_GUESSES = [[1,2, 3, 4], [5, 2, 3, 4], [7, 6, 5, 4], [0, 9, 8, 5],
[2, 4, 6, 8], [1, 3, 5, 7], [1, 2, 0, 9] ]
TEST_SECRET = [[1,9,8, 7],[2,4,6, 7], [1,2,0, 9],[7,6,5, 4]]
def test_count_bulls_and_cows():
''' Function test_count_bulls_and_cows
Input: None.
... | 0 | 0 | 0 | 0 | 0 | 344 | 0 | 4 | 49 |
e5afcaf73eee26b665a2379bae43be5ddcea8f9c | 784 | py | Python | solving/dynamic/maxarraysum.py | williamlagos/chess | 7470479e352bf6fa28215e745af8c42dc20d7a1f | [
"MIT"
] | null | null | null | solving/dynamic/maxarraysum.py | williamlagos/chess | 7470479e352bf6fa28215e745af8c42dc20d7a1f | [
"MIT"
] | 4 | 2020-04-23T23:17:54.000Z | 2021-07-06T17:44:45.000Z | solving/dynamic/maxarraysum.py | williamlagos/chess | 7470479e352bf6fa28215e745af8c42dc20d7a1f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
# Complete the maxSubsetSum function below.
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
n = int(input())
arr = list(map(int, input().rstrip().split()))
res = maxSubsetSum(arr)
fptr.write(str(res) + '\n')
fptr.close()
| 24.5 | 73 | 0.640306 | #!/usr/bin/env python3
import math
import os
import random
import re
import sys
# Complete the maxSubsetSum function below.
def maxSubsetSum(arr):
including = 0
excluding = 0
for item in arr:
# Current max excluding item
new_excluding = excluding if excluding > including else includ... | 0 | 0 | 0 | 0 | 0 | 410 | 0 | -41 | 112 |
86025513073bbd583b38ab9b0144162a56204089 | 1,712 | py | Python | venv/lib/python3.9/site-packages/pendulum/lang/fo.py | qarik-hanrattyjen/apache-airflow-backport-providers-google-2021.3.3 | 630dcef73e6a258b6e9a52f934e2dd912ce741f8 | [
"Apache-2.0"
] | 224 | 2020-01-02T10:46:37.000Z | 2022-03-02T13:54:08.000Z | venv/lib/python3.9/site-packages/pendulum/lang/fo.py | qarik-hanrattyjen/apache-airflow-backport-providers-google-2021.3.3 | 630dcef73e6a258b6e9a52f934e2dd912ce741f8 | [
"Apache-2.0"
] | 16 | 2020-03-11T09:37:58.000Z | 2022-01-26T10:22:08.000Z | venv/lib/python3.9/site-packages/pendulum/lang/fo.py | qarik-hanrattyjen/apache-airflow-backport-providers-google-2021.3.3 | 630dcef73e6a258b6e9a52f934e2dd912ce741f8 | [
"Apache-2.0"
] | 24 | 2020-03-24T13:53:50.000Z | 2022-03-22T11:55:18.000Z | # -*- coding: utf-8 -*-
translations = {
# Days
'days': {
0: 'sunnudagur',
1: 'mnadagur',
2: 'tsdagur',
3: 'mikudagur',
4: 'hsdagur',
5: 'frggjadagur',
6: 'leygardagur'
},
'days_abbrev': {
0: 'sun',
1: 'mn',
2: 'ts',
... | 20.878049 | 53 | 0.390771 | # -*- coding: utf-8 -*-
translations = {
# Days
'days': {
0: 'sunnudagur',
1: 'mánadagur',
2: 'týsdagur',
3: 'mikudagur',
4: 'hósdagur',
5: 'fríggjadagur',
6: 'leygardagur'
},
'days_abbrev': {
0: 'sun',
1: 'mán',
2: 'týs',
... | 44 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4773bfcdcb6926ef4713931c494292b64f9253e8 | 4,041 | py | Python | databench/cli.py | springcoil/databench | dba2cb412da099a3eb970e4b0cf257a62b012958 | [
"MIT"
] | null | null | null | databench/cli.py | springcoil/databench | dba2cb412da099a3eb970e4b0cf257a62b012958 | [
"MIT"
] | null | null | null | databench/cli.py | springcoil/databench | dba2cb412da099a3eb970e4b0cf257a62b012958 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Databench command line executable. Run to create a server that serves
the analyses pages and runs the python backend."""
import os
import sys
import signal
import random
import logging
import argparse
import werkzeug.serving
from . import __version__ as DATABENCH_VERSION
def main():
""... | 36.080357 | 76 | 0.624103 | #!/usr/bin/env python
"""Databench command line executable. Run to create a server that serves
the analyses pages and runs the python backend."""
import os
import sys
import signal
import random
import logging
import argparse
import werkzeug.serving
from . import __version__ as DATABENCH_VERSION
def main():
""... | 0 | 172 | 0 | 0 | 0 | 122 | 0 | 0 | 53 |
be72c5163f7d5a2340ca95999805965b35464eac | 1,164 | py | Python | setup.py | RedFT/hexy | f218c051b24e1e5b694aeb2f454b17e1ffbde3f1 | [
"MIT"
] | null | null | null | setup.py | RedFT/hexy | f218c051b24e1e5b694aeb2f454b17e1ffbde3f1 | [
"MIT"
] | null | null | null | setup.py | RedFT/hexy | f218c051b24e1e5b694aeb2f454b17e1ffbde3f1 | [
"MIT"
] | null | null | null | from distutils.core import setup
setup(
name = 'Hexy',
packages = ['hexy'],
version = '1.4.4',
license='MIT',
description = 'A library that makes working with a hexagonal lattice easier.',
author = 'Norbu Tsering',
author_email = 'norbu.tsering.cs@gmail.com'... | 33.257143 | 83 | 0.535223 | from distutils.core import setup
setup(
name = 'Hexy',
packages = ['hexy'],
version = '1.4.4',
license='MIT',
description = 'A library that makes working with a hexagonal lattice easier.',
author = 'Norbu Tsering',
author_email = 'norbu.tsering.cs@gmail.com'... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4ef5eb72d6b88f68c782553cb4b8500dc3909479 | 2,379 | py | Python | python/federatedml/nn/backend/pytorch/optimizer.py | hubert-he/FATE | 6758e150bd7ca7d6f788f9a7a8c8aea7e6500363 | [
"Apache-2.0"
] | 3,787 | 2019-08-30T04:55:10.000Z | 2022-03-31T23:30:07.000Z | python/federatedml/nn/backend/pytorch/optimizer.py | JavaGreenHands/FATE | ea1e94b6be50c70c354d1861093187e523af32f2 | [
"Apache-2.0"
] | 1,439 | 2019-08-29T16:35:52.000Z | 2022-03-31T11:55:31.000Z | python/federatedml/nn/backend/pytorch/optimizer.py | JavaGreenHands/FATE | ea1e94b6be50c70c354d1861093187e523af32f2 | [
"Apache-2.0"
] | 1,179 | 2019-08-29T16:18:32.000Z | 2022-03-31T12:55:38.000Z | # Copyright 2019 The FATE Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 33.041667 | 94 | 0.701135 | # Copyright 2019 The FATE Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 0 | 0 | 0 | 84 | 0 | 1,396 | 0 | 53 | 227 |
20355127e5d4dbc688ecdd03b5a39de30c984e35 | 3,121 | py | Python | icc.modelstudio/setup.py | NGS-ISC/model-studio | 22f1a0d0577f868ad650777a465f5da3b7958396 | [
"Apache-2.0"
] | null | null | null | icc.modelstudio/setup.py | NGS-ISC/model-studio | 22f1a0d0577f868ad650777a465f5da3b7958396 | [
"Apache-2.0"
] | null | null | null | icc.modelstudio/setup.py | NGS-ISC/model-studio | 22f1a0d0577f868ad650777a465f5da3b7958396 | [
"Apache-2.0"
] | null | null | null | # This is your "setup.py" file.
# See the following sites for general guide to Python packaging:
# * `The Hitchhiker's Guide to Packaging <http://guide.python-distribute.org/>`_
# * `Python Project Howto <http://infinitemonkeycorps.net/docs/pph/>`_
from setuptools import setup, find_packages
import os
#from Cython... | 32.175258 | 85 | 0.662288 | # This is your "setup.py" file.
# See the following sites for general guide to Python packaging:
# * `The Hitchhiker's Guide to Packaging <http://guide.python-distribute.org/>`_
# * `Python Project Howto <http://infinitemonkeycorps.net/docs/pph/>`_
from setuptools import setup, find_packages
import sys, os
#from C... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 26 | 22 |
11a7b2bbd435b5a25fc2453ee739f54355e1843d | 2,737 | py | Python | stringbit.py | Exxuslee/sha256 | 68ad35525eabe2ec25ae65f4124bce6e34b04967 | [
"MIT"
] | null | null | null | stringbit.py | Exxuslee/sha256 | 68ad35525eabe2ec25ae65f4124bce6e34b04967 | [
"MIT"
] | null | null | null | stringbit.py | Exxuslee/sha256 | 68ad35525eabe2ec25ae65f4124bce6e34b04967 | [
"MIT"
] | null | null | null | #import math
w1 = [0]*64
s0 = [0]*64
s1 = [0]*64
for i in range (64):
w1[i] = [0]*32
s0[i] = [0]*32
s1[i] = [0]*32
w1hex= [0x0000c020, 0x8e195e82, 0x5806a5ac, 0x9467a653, 0x00fe9de6, 0xf0c34b81, 0x6f230600, 0x00000000,
0x00000000, 0x364c0811, 0x8ea34017, 0xb68edc07, 0x9dd9e834, 0xfbf4ced0, 0x9f2... | 23.393162 | 135 | 0.436609 | #import math
import os
w1 = [0]*64
s0 = [0]*64
s1 = [0]*64
for i in range (64):
w1[i] = [0]*32
s0[i] = [0]*32
s1[i] = [0]*32
w1hex= [0x0000c020, 0x8e195e82, 0x5806a5ac, 0x9467a653, 0x00fe9de6, 0xf0c34b81, 0x6f230600, 0x00000000,
0x00000000, 0x364c0811, 0x8ea34017, 0xb68edc07, 0x9dd9e834, 0xfbf4c... | 64 | 0 | 0 | 0 | 0 | 488 | 0 | -12 | 367 |
83ffc5713854064dc7e0b3f6bcf8514b1efcdf9a | 2,369 | py | Python | submissions/Colburn/myCSPs.py | LukeLT255/aima-python | aa79b0f3db54764052de2559d1d1530b17e61312 | [
"MIT"
] | null | null | null | submissions/Colburn/myCSPs.py | LukeLT255/aima-python | aa79b0f3db54764052de2559d1d1530b17e61312 | [
"MIT"
] | null | null | null | submissions/Colburn/myCSPs.py | LukeLT255/aima-python | aa79b0f3db54764052de2559d1d1530b17e61312 | [
"MIT"
] | 1 | 2018-08-23T19:27:23.000Z | 2018-08-23T19:27:23.000Z | import csp
rgb = ['R', 'G', 'B','O']#,'White','Gray','Y','Purple','Brown','seafoam','T','Kale']
d2 = { 'A' : rgb, 'B' : rgb, 'C' : ['R'], 'D' : rgb,}
domains = {
'SW': ['G'],
'SE': rgb,
'L': rgb,
'EE': rgb,
'W': rgb,
'WM': rgb,
'EM': rgb,
'NW': rgb,
'YH': rgb,
'NE': rgb,
... | 22.140187 | 84 | 0.456733 | import csp
rgb = ['R', 'G', 'B','O']#,'White','Gray','Y','Purple','Brown','seafoam','T','Kale']
d2 = { 'A' : rgb, 'B' : rgb, 'C' : ['R'], 'D' : rgb,}
domains = {
'SW': ['G'],
'SE': rgb,
'L': rgb,
'EE': rgb,
'W': rgb,
'WM': rgb,
'EM': rgb,
'NW': rgb,
'YH': rgb,
'NE': rgb,
... | 0 | 0 | 0 | 0 | 0 | 149 | 0 | 0 | 23 |
f0aa16fa68bab37dc7509384e60eb0ef6def2019 | 868 | py | Python | weatherApi.py | sairam1318/GUI | bd1892a2162993129008fccae0bfccfc11a90f2d | [
"Unlicense"
] | null | null | null | weatherApi.py | sairam1318/GUI | bd1892a2162993129008fccae0bfccfc11a90f2d | [
"Unlicense"
] | null | null | null | weatherApi.py | sairam1318/GUI | bd1892a2162993129008fccae0bfccfc11a90f2d | [
"Unlicense"
] | null | null | null | """GUI for weather report api """
root = Tk()
root.title("Temperature Finder")
root.geometry('500x300')
root.minsize(150, 150)
root.maxsize(1200, 1200)
city = Label(text = "Enter a city name to check Temperature: ")
cityValue = StringVar() #type of data
userEntry = Entry(root) #entered data
userEntry.grid(row = ... | 29.931034 | 150 | 0.693548 | """GUI for weather report api """
from tkinter import *
import json
import requests
def getTemperature():
getReq = requests.get('http://api.openweathermap.org/data/2.5/weather?q=' + userEntry.get() + '&appid=5c89bf395effa277f54aaad228fb81e3&units=metric')
getReq_dict = getReq.json()
data = "Temperature of " + str(... | 2 | 0 | 0 | 0 | 0 | 355 | 0 | -16 | 89 |
de14ffaa31c53a560fa65c555d1949d71a04f45f | 937 | py | Python | Day 1/Puzzle 2.py | rookuu/AdventOfCode-2015 | b94e98f5711d0901412b22342395457a8185bc10 | [
"MIT"
] | null | null | null | Day 1/Puzzle 2.py | rookuu/AdventOfCode-2015 | b94e98f5711d0901412b22342395457a8185bc10 | [
"MIT"
] | null | null | null | Day 1/Puzzle 2.py | rookuu/AdventOfCode-2015 | b94e98f5711d0901412b22342395457a8185bc10 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Solution to Day 1 - Puzzle 2 of the Advent Of Code 2015 series of challenges.
--- Day 1: Not Quite Lisp ---
An opening parenthesis represents an increase in floor and a closing parenthesis represents a decrease in floor.
After taking a 7000 character long input string of assorted parenthesi... | 25.324324 | 116 | 0.661686 | #!/usr/bin/env python
"""
Solution to Day 1 - Puzzle 2 of the Advent Of Code 2015 series of challenges.
--- Day 1: Not Quite Lisp ---
An opening parenthesis represents an increase in floor and a closing parenthesis represents a decrease in floor.
After taking a 7000 character long input string of assorted parenthesi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a6b48704b98c4da0f085d5ffc3ab02719b31f423 | 2,072 | py | Python | shadowproxy/proxies/aead/server.py | sanshengshi/shadowproxy | 28d66ff0803734528301d74d10bd1b2492a4b63f | [
"MIT"
] | 1 | 2019-06-13T17:54:41.000Z | 2019-06-13T17:54:41.000Z | shadowproxy/proxies/aead/server.py | sanshengshi/shadowproxy | 28d66ff0803734528301d74d10bd1b2492a4b63f | [
"MIT"
] | null | null | null | shadowproxy/proxies/aead/server.py | sanshengshi/shadowproxy | 28d66ff0803734528301d74d10bd1b2492a4b63f | [
"MIT"
] | null | null | null | from ... import gvars
| 32.375 | 75 | 0.594112 | from ... import gvars
from .parser import aead_reader
from ..base.server import ProxyBase
from ..shadowsocks.parser import addr_reader
class AEADProxy(ProxyBase):
proto = "AEAD"
def __init__(self, cipher, bind_addr, via=None, plugin=None, **kwargs):
self.cipher = cipher
self.bind_addr = bind_... | 0 | 0 | 1,526 | 387 | 0 | 0 | 0 | 47 | 89 |
6ca759080a912548446a6b6900634e8696b3753e | 1,151 | py | Python | python/task-of-pairing.py | gajubadge11/hackerrank-3 | 132a5019b7ed21507bb95b5063fa66c446b0eff7 | [
"MIT"
] | 21 | 2015-02-09T18:08:38.000Z | 2021-11-08T15:00:48.000Z | python/task-of-pairing.py | gajubadge11/hackerrank-3 | 132a5019b7ed21507bb95b5063fa66c446b0eff7 | [
"MIT"
] | 7 | 2020-04-12T23:00:19.000Z | 2021-01-30T23:44:24.000Z | python/task-of-pairing.py | gajubadge11/hackerrank-3 | 132a5019b7ed21507bb95b5063fa66c446b0eff7 | [
"MIT"
] | 27 | 2015-07-22T18:08:12.000Z | 2022-02-28T19:50:26.000Z | #!/bin/python3
import os
# NOTE: This only passes the first three test cases.
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
freq_count = int(input().strip())
freq = []
for _ in range(freq_count):
freq_item = int(input().strip())
freq.append(freq_item)
... | 22.134615 | 57 | 0.601216 | #!/bin/python3
import math
import os
import random
import re
import sys
# NOTE: This only passes the first three test cases.
def taskOfPairing(freq):
total = number_of_identical_pairs(freq)
total += number_of_off_by_one_pairs(freq)
return total
def number_of_identical_pairs(freq):
pairs = []
for... | 0 | 0 | 0 | 0 | 0 | 631 | 0 | -41 | 157 |
b94c29b0ecf81aeded292726e39a4eb08fad02b2 | 10,377 | py | Python | rrc_example_package/benchmark_rrc/python/cic/bayesian_opt/eval_code.py | wq13552463699/TriFinger_Research | 6ddfab4531cb4ba05a0fbb41227a734295dce378 | [
"BSD-3-Clause"
] | 12 | 2021-05-06T18:00:21.000Z | 2022-01-11T14:23:22.000Z | rrc_example_package/benchmark_rrc/python/cic/bayesian_opt/eval_code.py | wq13552463699/TriFinger_Research | 6ddfab4531cb4ba05a0fbb41227a734295dce378 | [
"BSD-3-Clause"
] | 3 | 2021-06-03T16:06:01.000Z | 2021-08-15T13:40:09.000Z | rrc_example_package/benchmark_rrc/python/cic/bayesian_opt/eval_code.py | wq13552463699/TriFinger_Research | 6ddfab4531cb4ba05a0fbb41227a734295dce378 | [
"BSD-3-Clause"
] | 4 | 2021-05-12T02:34:34.000Z | 2021-07-18T19:54:50.000Z | """
Bayesian Optimization experiment runner.
Relies heavily on BoTorch.
"""
import os
import logging
import matplotlib.pyplot as plt
import numpy as np
import torch
# sys.path.append("../")
logger = logging.getLogger(__file__)
# Constants
DIR_NAME = os.path.dirname(__file__)
# NOT WORKING PROPERLY AT THE MOMENT
#... | 31.929231 | 163 | 0.626385 | """
Bayesian Optimization experiment runner.
Relies heavily on BoTorch.
"""
import os
import logging
import matplotlib.pyplot as plt
import numpy as np
import torch
import sys
# sys.path.append("../")
import pickle as pkl
from tqdm import tqdm
import shutil
from distutils.spawn import find_executable
from utils.fu... | 0 | 1,576 | 0 | 1,055 | 0 | 5,568 | 0 | 311 | 465 |
7df7d356da1641f7a415acb77141aca46a0e1334 | 3,821 | py | Python | datasets/data_getter.py | pgruening/dl_bio_example | 7af124df5b2dd4e6cc63d90f4e75680a187fc98c | [
"MIT"
] | 1 | 2021-12-09T15:17:39.000Z | 2021-12-09T15:17:39.000Z | datasets/data_getter.py | pgruening/dl_bio_example | 7af124df5b2dd4e6cc63d90f4e75680a187fc98c | [
"MIT"
] | 2 | 2020-11-07T11:24:29.000Z | 2020-12-06T20:10:31.000Z | datasets/data_getter.py | pgruening/dl_bio_example | 7af124df5b2dd4e6cc63d90f4e75680a187fc98c | [
"MIT"
] | 3 | 2020-10-09T08:48:39.000Z | 2021-01-14T16:36:17.000Z | """
# data_getter
The data getter manages the initialization of different torch DataLoaders.
A dataloader is essentially an Iterable that can be called in a for-loop.
A typical training step could for example look like this:
data_loaders = data_getter.get_data_loaders(...)
for sample in data_loader['train']:
imag... | 41.532609 | 150 | 0.703742 | """
# data_getter
The data getter manages the initialization of different torch DataLoaders.
A dataloader is essentially an Iterable that can be called in a for-loop.
A typical training step could for example look like this:
data_loaders = data_getter.get_data_loaders(...)
for sample in data_loader['train']:
imag... | 0 | 0 | 0 | 0 | 0 | 1,212 | 0 | 14 | 89 |
5ffc486464df362fefe028354f670f716cd3a9eb | 10,655 | py | Python | archive/classification/compare_clusters2.py | bernhardtj/DetectorChar | be9fffc0a56c9c8848c67917a839d743a0380ce2 | [
"MIT"
] | null | null | null | archive/classification/compare_clusters2.py | bernhardtj/DetectorChar | be9fffc0a56c9c8848c67917a839d743a0380ce2 | [
"MIT"
] | null | null | null | archive/classification/compare_clusters2.py | bernhardtj/DetectorChar | be9fffc0a56c9c8848c67917a839d743a0380ce2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
'''
This script reads in seismic noise data from March 2017 and earthquake data.
It shifts the data by time for clustering
It creates a list of earthquake times in March when the peak ground motion is greater than a certain amount.
It clusters earthquake channels using kmeans and dbscan.
It compa... | 37.125436 | 147 | 0.653965 | #!/usr/bin/env python
'''
This script reads in seismic noise data from March 2017 and earthquake data.
It shifts the data by time for clustering
It creates a list of earthquake times in March when the peak ground motion is greater than a certain amount.
It clusters earthquake channels using kmeans and dbscan.
It compa... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 165 | 176 |
488ab890c5c4fef73dd3bf44853f22b7636e640b | 3,347 | py | Python | api/migrations/0001_initial.py | d2verb/firmflaws | 2ac5dd9fcde46a24b70cdd402af371e2b2f93445 | [
"Beerware"
] | null | null | null | api/migrations/0001_initial.py | d2verb/firmflaws | 2ac5dd9fcde46a24b70cdd402af371e2b2f93445 | [
"Beerware"
] | null | null | null | api/migrations/0001_initial.py | d2verb/firmflaws | 2ac5dd9fcde46a24b70cdd402af371e2b2f93445 | [
"Beerware"
] | null | null | null | # Generated by Django 3.0 on 2019-12-13 16:34
| 44.626667 | 137 | 0.568569 | # Generated by Django 3.0 on 2019-12-13 16:34
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='BrandModel',
fields=[
... | 0 | 0 | 0 | 3,202 | 0 | 0 | 0 | 30 | 68 |
17f9652dc7e758a93380b2b383c1258f794a1c43 | 3,060 | py | Python | Ar_Script/ar_303_测试_获取app信息并且检查包名(其林).py | archerckk/PyTest | 610dd89df8d70c096f4670ca11ed2f0ca3196ca5 | [
"MIT"
] | null | null | null | Ar_Script/ar_303_测试_获取app信息并且检查包名(其林).py | archerckk/PyTest | 610dd89df8d70c096f4670ca11ed2f0ca3196ca5 | [
"MIT"
] | 1 | 2020-01-19T01:19:57.000Z | 2020-01-19T01:19:57.000Z | Ar_Script/ar_303_测试_获取app信息并且检查包名(其林).py | archerckk/PyTest | 610dd89df8d70c096f4670ca11ed2f0ca3196ca5 | [
"MIT"
] | null | null | null |
import os
if __name__ == '__main__':
filePath, packageName, lanuchableActivity = getPackagInfo()
handle = uninstallApp(packageName)
uninstallApp(handle)
judgeRunning(handle)
print('%s ' % packageName)
print('%s ' % packageName)
handle_install = installapp(filePath)
print('', han... | 28.333333 | 142 | 0.635948 |
import os
import subprocess
import time
import easygui as g
import re
import requests
from selenium import webdriver
def getPackagInfo():
msg = '请选择你要检查的apk安装包'
title = '文件选择'
default = "*.apk"
filePath = g.fileopenbox(msg=msg, title=title, default=default)
if ' ' in filePath:
os.rename... | 204 | 0 | 0 | 0 | 0 | 2,318 | 0 | -25 | 247 |
281f8a6bee10ae2272f3431c8080c5e565fc110a | 6,417 | py | Python | code/words_perturbation/perturbation.py | JeyDi/Mispelling | e2a91178707532f4b00949bbf37fcd17671f1a08 | [
"MIT"
] | 1 | 2019-03-19T23:08:58.000Z | 2019-03-19T23:08:58.000Z | code/words_perturbation/perturbation.py | JeyDi/Mispelling | e2a91178707532f4b00949bbf37fcd17671f1a08 | [
"MIT"
] | null | null | null | code/words_perturbation/perturbation.py | JeyDi/Mispelling | e2a91178707532f4b00949bbf37fcd17671f1a08 | [
"MIT"
] | null | null | null | import os
import sys
from configparser import ConfigParser
pathname = os.path.dirname(sys.argv[0])
config = ConfigParser()
config.read( pathname + '/config.ini')
#Function to basic clean and preprocess input string or text
#Perturb the word by a certain percentage
#Perturb the word by a certain percentage
... | 34.132979 | 152 | 0.66355 | import os
import re
import math
import random
import sys
import json
import itertools
from random import randint
from string import ascii_letters
from os import path, listdir
from configparser import ConfigParser
pathname = os.path.dirname(sys.argv[0])
config = ConfigParser()
config.read( pathname + '/config.in... | 0 | 0 | 0 | 0 | 0 | 5,042 | 0 | -22 | 340 |
425fbdb1d73449faaa78f36eccc4823595c54c82 | 16,273 | py | Python | tools/perf-scale-workload/query_executer.py | NeoWu1216/amazon-timestream-tools | dd2a5c8814f438693b44a62f38398e96e8a71429 | [
"MIT-0"
] | null | null | null | tools/perf-scale-workload/query_executer.py | NeoWu1216/amazon-timestream-tools | dd2a5c8814f438693b44a62f38398e96e8a71429 | [
"MIT-0"
] | 1 | 2021-07-01T03:15:19.000Z | 2021-07-01T03:15:19.000Z | tools/perf-scale-workload/query_executer.py | NeoWu1216/amazon-timestream-tools | dd2a5c8814f438693b44a62f38398e96e8a71429 | [
"MIT-0"
] | null | null | null | from collections import namedtuple
Params = namedtuple('Params', 'dbname tablename region az cell silo microservicename instancetype osversion instancename processname jdkversion')
QueryParams = namedtuple('QueryParams', 'repetitions paramlist')
Header = 'Query type, Total Count, Successful Count, Avg. latency (in sec... | 43.862534 | 276 | 0.615129 | import numpy as np
from scipy.stats import gmean
from collections import namedtuple
import threading
import multiprocessing
import configparser
import timestreamquery as tsquery
import os
from timeit import default_timer as timer
from query_execution_utils import executeQueryInstance, Query
import sys, traceback
import... | 0 | 0 | 0 | 11,383 | 0 | 3,062 | 0 | 49 | 420 |
0ae91f4747e3ad31c4871f6cc1a4d025b2ec0a6d | 3,374 | py | Python | mlinsights/search_rank/search_engine_predictions.py | sdpython/mlinsights | bae59cda775a69bcce83b16b88df2f34a092cb60 | [
"MIT"
] | 48 | 2017-11-19T14:59:41.000Z | 2022-03-03T15:50:24.000Z | mlinsights/search_rank/search_engine_predictions.py | sdpython/mlinsights | bae59cda775a69bcce83b16b88df2f34a092cb60 | [
"MIT"
] | 87 | 2017-11-20T00:10:32.000Z | 2021-11-20T01:48:09.000Z | mlinsights/search_rank/search_engine_predictions.py | sdpython/mlinsights | bae59cda775a69bcce83b16b88df2f34a092cb60 | [
"MIT"
] | 12 | 2019-05-09T07:45:52.000Z | 2021-06-28T06:55:53.000Z | """
@file
@brief Implements a way to get close examples based
on the output of a machine learned model.
"""
| 37.076923 | 84 | 0.570243 | """
@file
@brief Implements a way to get close examples based
on the output of a machine learned model.
"""
from ..mlmodel import model_featurizer
from ..helpers.parameters import format_function_call
from .search_engine_vectors import SearchEngineVectors
class SearchEnginePredictions(SearchEngineVectors):
"""
... | 0 | 0 | 0 | 3,094 | 0 | 0 | 0 | 82 | 89 |
7196985cb32aa0817350e88277d40a7cd4d5247e | 3,514 | py | Python | MethodOne/voting.py | rogeroyer/2019-CCF-BDCI-Finance-Information-Negative-Judgment | 06e0582b06f99ce3348ad91ea687ab3e9a0cf363 | [
"MIT"
] | 30 | 2020-02-28T13:33:09.000Z | 2021-09-30T08:21:26.000Z | MethodOne/voting.py | williamjiamin/2019-CCF-BDCI-Finance-Information-Negative-Judgment | 06e0582b06f99ce3348ad91ea687ab3e9a0cf363 | [
"MIT"
] | 1 | 2020-07-23T07:20:08.000Z | 2020-07-24T13:29:58.000Z | MethodOne/voting.py | williamjiamin/2019-CCF-BDCI-Finance-Information-Negative-Judgment | 06e0582b06f99ce3348ad91ea687ab3e9a0cf363 | [
"MIT"
] | 21 | 2020-03-18T14:43:53.000Z | 2022-03-09T08:34:12.000Z | import os
import numpy as np
import pandas as pd
from collections import Counter
sub_path = 'sub/'
teamates = os.listdir(sub_path)
data = pd.read_csv('./single/robertawmmlarge_result_mean.csv', encoding='utf-8').rename(columns={'negative': 'negative_1', 'key_entity': 'key_entity_1'})
index = 2
for member in teamates... | 30.293103 | 153 | 0.594479 | import os
import numpy as np
import pandas as pd
from collections import Counter
sub_path = 'sub/'
teamates = os.listdir(sub_path)
data = pd.read_csv('./single/robertawmmlarge_result_mean.csv', encoding='utf-8').rename(columns={'negative': 'negative_1', 'key_entity': 'key_entity_1'})
index = 2
for member in teamates... | 78 | 0 | 0 | 0 | 0 | 459 | 0 | 0 | 45 |
e92321d46cfb00448eca9f9a237edc09c24840b1 | 718 | py | Python | chatette_qiu/adapters/factory.py | fanfanfeng/Chatette | dc88ab195876c6d3ed2e02c2e0005f47bee5ff26 | [
"MIT"
] | null | null | null | chatette_qiu/adapters/factory.py | fanfanfeng/Chatette | dc88ab195876c6d3ed2e02c2e0005f47bee5ff26 | [
"MIT"
] | null | null | null | chatette_qiu/adapters/factory.py | fanfanfeng/Chatette | dc88ab195876c6d3ed2e02c2e0005f47bee5ff26 | [
"MIT"
] | null | null | null | """
Module `chatette_qiu.adapters.factory`.
Defines a factory method that allows to create an adapter from a string name.
"""
from chatette_qiu.adapters.jsonl import JsonListAdapter
from chatette_qiu.adapters.rasa import RasaAdapter
def create_adapter(adapter_name):
"""
Instantiate an adapter and returns it ... | 28.72 | 81 | 0.697772 | """
Module `chatette_qiu.adapters.factory`.
Defines a factory method that allows to create an adapter from a string name.
"""
from chatette_qiu.adapters.jsonl import JsonListAdapter
from chatette_qiu.adapters.rasa import RasaAdapter
def create_adapter(adapter_name):
"""
Instantiate an adapter and returns it ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9ecadc0d9aadc241ff77a2e03364560acc855ef8 | 13,146 | py | Python | tests/test_cli.py | RoyalTS/great_expectations | 5ce4d499da2301d0c0497b243813a349837e95d7 | [
"Apache-2.0"
] | null | null | null | tests/test_cli.py | RoyalTS/great_expectations | 5ce4d499da2301d0c0497b243813a349837e95d7 | [
"Apache-2.0"
] | null | null | null | tests/test_cli.py | RoyalTS/great_expectations | 5ce4d499da2301d0c0497b243813a349837e95d7 | [
"Apache-2.0"
] | 1 | 2022-02-10T04:20:37.000Z | 2022-02-10T04:20:37.000Z | # Since our cli produces unicode output, but we want tests in python2 as well
from __future__ import unicode_literals
from ruamel.yaml import YAML
yaml = YAML()
yaml.default_flow_style = False
try:
from unittest import mock
except ImportError:
# def test_cli_render(tmp_path_factory):
# runner = Cli... | 37.346591 | 115 | 0.646813 | # Since our cli produces unicode output, but we want tests in python2 as well
from __future__ import unicode_literals
from datetime import datetime
from click.testing import CliRunner
import great_expectations.version
from great_expectations.cli import cli
import tempfile
import pytest
import json
import os
import shu... | 0 | 0 | 0 | 0 | 0 | 12,067 | 0 | 20 | 613 |
5e2907c997b123a57a2d0532e669720b4b164172 | 1,445 | py | Python | src/runserver.py | MattGong/flask-apscheduler | 7ee070cdc854f094c44a4a22defa0d6be846f90a | [
"BSD-3-Clause"
] | null | null | null | src/runserver.py | MattGong/flask-apscheduler | 7ee070cdc854f094c44a4a22defa0d6be846f90a | [
"BSD-3-Clause"
] | null | null | null | src/runserver.py | MattGong/flask-apscheduler | 7ee070cdc854f094c44a4a22defa0d6be846f90a | [
"BSD-3-Clause"
] | 1 | 2019-08-29T02:46:08.000Z | 2019-08-29T02:46:08.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# **************************************************************************
# Copyright 2017 jianglin
# File Name: runserver.py
# Author: jianglin
# Email: xiyang0807@gmail.com
# Created: 2017-02-02 09:18:53 (CST)
# Last Update: 2017-2-16 22:19:49 (CST)
# By:
# D... | 23.306452 | 76 | 0.586159 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# **************************************************************************
# Copyright © 2017 jianglin
# File Name: runserver.py
# Author: jianglin
# Email: xiyang0807@gmail.com
# Created: 2017-02-02 09:18:53 (CST)
# Last Update:星期四 2017-2-16 22:19:49 (CST)
# By:... | 23 | 0 | 0 | 484 | 0 | 0 | 0 | 46 | 67 |
9d614223b6e12612bcebc6423666803c0620567f | 522 | py | Python | 1day/Str08.py | jsjang93/joony | 62f7a325094c887212b894932263bf84500e0f03 | [
"MIT"
] | null | null | null | 1day/Str08.py | jsjang93/joony | 62f7a325094c887212b894932263bf84500e0f03 | [
"MIT"
] | null | null | null | 1day/Str08.py | jsjang93/joony | 62f7a325094c887212b894932263bf84500e0f03 | [
"MIT"
] | null | null | null | # Str08.py
# a1 a2 a3 a4;print(a1, a2, a3, a4) --> Java, C, SQL, Python
a1, a2, a3, a4 = 'Java,C,SQL,Python'.split(',')
print(a1, a2, a3, a4)
b = ['H', 'e', 'l', 'l', 'o']
b = ''.join(b)
print(b)
a = ''
for i in range(0,len(b)):
a += b[i]
print(a)
print('', sep=' ', end='\n')
print('', end='')
print('', ... | 17.4 | 63 | 0.482759 | # Str08.py
# a1 a2 a3 a4;print(a1, a2, a3, a4) --> Java, C, SQL, Python
a1, a2, a3, a4 = 'Java,C,SQL,Python'.split(',')
print(a1, a2, a3, a4)
b = ['H', 'e', 'l', 'l', 'o']
b = ''.join(b)
print(b)
a = ''
for i in range(0,len(b)):
a += b[i]
print(a)
print('안녕하세요', sep=' ', end='\n')
print('안녕하세요', end='')
... | 177 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
89cdd4ec798c3aebc5495f281a35b636986bfa2f | 766 | py | Python | problems/test_0071.py | chrisxue815/leetcode_python | dec3c160d411a5c19dc8e9d96e7843f0e4c36820 | [
"Unlicense"
] | 1 | 2017-06-17T23:47:17.000Z | 2017-06-17T23:47:17.000Z | problems/test_0071.py | chrisxue815/leetcode_python | dec3c160d411a5c19dc8e9d96e7843f0e4c36820 | [
"Unlicense"
] | null | null | null | problems/test_0071.py | chrisxue815/leetcode_python | dec3c160d411a5c19dc8e9d96e7843f0e4c36820 | [
"Unlicense"
] | null | null | null | import unittest
if __name__ == '__main__':
unittest.main()
| 21.277778 | 47 | 0.449086 | import unittest
class Solution:
def simplifyPath(self, path):
"""
:type path: str
:rtype: str
"""
stack = []
for p in path.split('/'):
if p == '..':
if stack:
stack.pop()
elif p and p != '.':
... | 0 | 0 | 0 | 653 | 0 | 0 | 0 | 0 | 46 |
d123323759b4f192c0f3ad0169dab4a3fa0d5224 | 309 | py | Python | src/mockkeys.py | ChrisPickard/expando | fb4a01e6399994ef910aa58da2bff82600fb55fb | [
"MIT"
] | 1 | 2015-03-04T18:01:53.000Z | 2015-03-04T18:01:53.000Z | src/mockkeys.py | ChrisPickard/expando | fb4a01e6399994ef910aa58da2bff82600fb55fb | [
"MIT"
] | null | null | null | src/mockkeys.py | ChrisPickard/expando | fb4a01e6399994ef910aa58da2bff82600fb55fb | [
"MIT"
] | null | null | null | import msgpackrpc
from core.expando import ExpandoServer
ADDR = SERVER = THREAD = None
(ADDR, SERVER, THREAD) = ExpandoServer().serve()
client = msgpackrpc.Client(ADDR, unpack_encoding='utf-8')
client.call('add_expansion', u'esc', u'a vim user I see')
action = client.call('expand', u'esc')
print(action)
| 23.769231 | 57 | 0.731392 | import msgpackrpc
from core.expando import ExpandoServer
ADDR = SERVER = THREAD = None
(ADDR, SERVER, THREAD) = ExpandoServer().serve()
client = msgpackrpc.Client(ADDR, unpack_encoding='utf-8')
client.call('add_expansion', u'esc', u'a vim user I see')
action = client.call('expand', u'esc')
print(action)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
004dea4a740ccca409afaaa19b3705d3b398bd68 | 411 | py | Python | rmon/views/urls.py | xizhongzhao/rmon | e7123e9f60a98cc26f34a89a2cd6d9df59937736 | [
"BSD-3-Clause"
] | null | null | null | rmon/views/urls.py | xizhongzhao/rmon | e7123e9f60a98cc26f34a89a2cd6d9df59937736 | [
"BSD-3-Clause"
] | null | null | null | rmon/views/urls.py | xizhongzhao/rmon | e7123e9f60a98cc26f34a89a2cd6d9df59937736 | [
"BSD-3-Clause"
] | null | null | null | """ the urls of rmon.views """
from flask import Blueprint
from rmon.views.index import IndexView
from rmon.views.server import ServerList, ServerDetail
api = Blueprint('api',__name__)
api.add_url_rule('/',view_func=IndexView.as_view('index'))
api.add_url_rule('/servers/',view_func=ServerList.as_view('server_list'))
a... | 41.1 | 92 | 0.788321 | """ the urls of rmon.views """
from flask import Blueprint
from rmon.views.index import IndexView
from rmon.views.server import ServerList,ServerDetail
api = Blueprint('api',__name__)
api.add_url_rule('/',view_func=IndexView.as_view('index'))
api.add_url_rule('/servers/',view_func=ServerList.as_view('server_list'))
ap... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -1 | 0 |
91ec81f104c484bd3e0eb44610131712acde57d8 | 1,128 | py | Python | WeChatTools/Utils/MailHelper.py | TitusWongCN/WeChatRelativeTools | 9307bae8c15e47b5bbf169a95a50be0d107a5bb1 | [
"MIT"
] | null | null | null | WeChatTools/Utils/MailHelper.py | TitusWongCN/WeChatRelativeTools | 9307bae8c15e47b5bbf169a95a50be0d107a5bb1 | [
"MIT"
] | null | null | null | WeChatTools/Utils/MailHelper.py | TitusWongCN/WeChatRelativeTools | 9307bae8c15e47b5bbf169a95a50be0d107a5bb1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# encoding: utf-8
if __name__ == "__main__":
mh = MailHelper('shaoz-he@outlook.com', '1992wen1031')
mh.sendmail('wzhwno1@163.com,863501159@qq.com, ', 'Python', ',!') | 36.387097 | 99 | 0.628546 | # -*- coding: utf-8 -*-
# encoding: utf-8
import smtplib
from email.mime.text import MIMEText
from email.utils import formataddr
class MailHelper:
def __init__(self, username, password):
self.username = username
self.password = password
def sendmail(self, mail_to, subject, content):
... | 348 | 0 | 0 | 701 | 0 | 0 | 0 | 21 | 90 |
438f9b2c169da028386555c1694bdf805d291af9 | 4,504 | py | Python | setup_softras.py | aimagelab/MCMR | eb3556bffebc734c19e7f3e39dcf018ba28c63b3 | [
"MIT"
] | 11 | 2021-10-11T12:48:47.000Z | 2022-03-01T02:00:00.000Z | setup_softras.py | aimagelab/MCMR | eb3556bffebc734c19e7f3e39dcf018ba28c63b3 | [
"MIT"
] | 1 | 2022-01-19T00:47:58.000Z | 2022-01-23T14:52:45.000Z | setup_softras.py | aimagelab/MCMR | eb3556bffebc734c19e7f3e39dcf018ba28c63b3 | [
"MIT"
] | 1 | 2022-02-08T14:53:54.000Z | 2022-02-08T14:53:54.000Z | from setuptools import setup
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
CUDA_FLAGS = []
ext_modules=[
CUDAExtension('soft_renderer.cuda.load_textures', [
'soft_renderer/cuda/load_textures_cuda.cpp',
'soft_renderer/cuda/load_textures_cuda_kernel.cu',
],
ext... | 45.04 | 91 | 0.616785 | from setuptools import setup, find_packages
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
CUDA_FLAGS = []
ext_modules=[
CUDAExtension('soft_renderer.cuda.load_textures', [
'soft_renderer/cuda/load_textures_cuda.cpp',
'soft_renderer/cuda/load_textures_cuda_kernel.cu',
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 15 | 0 |
68e313981999b7b65068787cd4afed28643400e1 | 3,129 | py | Python | generate_fake_csv.py | sandbernar/anti-corona-crm | e896a2dd0f41d099f7800769badf78e5e521d39a | [
"MIT"
] | null | null | null | generate_fake_csv.py | sandbernar/anti-corona-crm | e896a2dd0f41d099f7800769badf78e5e521d39a | [
"MIT"
] | null | null | null | generate_fake_csv.py | sandbernar/anti-corona-crm | e896a2dd0f41d099f7800769badf78e5e521d39a | [
"MIT"
] | null | null | null | from random import randrange
from datetime import timedelta
countries = ["", "", "", "", "", ""]
regions = ["", "-", ""]
choices = ["", ""]
hospitals = [" ", " ", "", "", " ", " "]
addresses = ["", "", "", "", "", "", "", "", "", ""]
def random_date(start, end):
"""
This function will return a random datet... | 41.171053 | 392 | 0.627037 | import pandas as pd
import numpy as np
from random import randrange
from datetime import timedelta
from datetime import datetime
import random
import string
from faker import Faker
countries = ["Казахстан", "Россия", "Италия", "Германия", "Китай", "США"]
regions = ["Алматы", "Нур-Султан", "Шымкент"]
choices = ["да", "... | 1,078 | 0 | 0 | 0 | 0 | 1,882 | 0 | -11 | 155 |
2047475e0393f0ac9c79e72b35804525602caac9 | 996 | py | Python | scripts/step-by-step/nearest_neighbor.py | schwille-paint/lbFCS2 | 06dc47b32128f3455f275c39794a6aaf9ffbe5b9 | [
"MIT"
] | null | null | null | scripts/step-by-step/nearest_neighbor.py | schwille-paint/lbFCS2 | 06dc47b32128f3455f275c39794a6aaf9ffbe5b9 | [
"MIT"
] | null | null | null | scripts/step-by-step/nearest_neighbor.py | schwille-paint/lbFCS2 | 06dc47b32128f3455f275c39794a6aaf9ffbe5b9 | [
"MIT"
] | null | null | null | import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy import spatial
import picasso.io as io
### High density data
dir_name = '/fs/pool/pool-schwille-paint/Data/p17.lbFCS2/20-12-09_N1_T23_ibidi_cseries/21-01-19_FS_id180'
file_name = 'ibidi_id180_Pm2-05nM_p40uW_1_MMStack_Pos0.ome... | 31.125 | 117 | 0.771084 | import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy import spatial
import picasso.io as io
### High density data
dir_name = '/fs/pool/pool-schwille-paint/Data/p17.lbFCS2/20-12-09_N1_T23_ibidi_cseries/21-01-19_FS_id180'
file_name = 'ibidi_id180_Pm2-05nM_p40uW_1_MMStack_Pos0.ome... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
28ded526ec050f99dd29f1e5456a8c439be25a61 | 1,911 | py | Python | examples/python3-base64-filtering.py | alexmv/go-camo | 7ff92356b0d4da5d38b60ebd32a18959770bef2b | [
"MIT"
] | 161 | 2015-03-07T13:11:23.000Z | 2022-03-29T11:52:06.000Z | examples/python3-base64-filtering.py | alexmv/go-camo | 7ff92356b0d4da5d38b60ebd32a18959770bef2b | [
"MIT"
] | 42 | 2017-01-04T04:58:52.000Z | 2022-03-29T04:09:40.000Z | examples/python3-base64-filtering.py | alexmv/go-camo | 7ff92356b0d4da5d38b60ebd32a18959770bef2b | [
"MIT"
] | 42 | 2015-01-27T10:40:33.000Z | 2022-03-29T11:55:01.000Z | # Copyright (c) 2012-2019 Eli Janssen
# Use of this source code is governed by an MIT-style
# license that can be found in the LICENSE file.
# this example shows how filtering can be done on the url generation side.
# this example through https urls (no proxying required), and only allows http
# requests over port 80.... | 39 | 114 | 0.722135 | # Copyright (c) 2012-2019 Eli Janssen
# Use of this source code is governed by an MIT-style
# license that can be found in the LICENSE file.
# this example shows how filtering can be done on the url generation side.
# this example through https urls (no proxying required), and only allows http
# requests over port 80.... | 0 | 0 | 0 | 0 | 0 | 996 | 0 | -13 | 112 |
032ef17d36e166cb50b8305092453a3629772ac1 | 381 | py | Python | Darlington/phase1/python Basic 2/day 27 solution/qtn2.py | CodedLadiesInnovateTech/-python-challenge-solutions | 430cd3eb84a2905a286819eef384ee484d8eb9e7 | [
"MIT"
] | 6 | 2020-05-23T19:53:25.000Z | 2021-05-08T20:21:30.000Z | Darlington/phase1/python Basic 2/day 27 solution/qtn2.py | CodedLadiesInnovateTech/-python-challenge-solutions | 430cd3eb84a2905a286819eef384ee484d8eb9e7 | [
"MIT"
] | 8 | 2020-05-14T18:53:12.000Z | 2020-07-03T00:06:20.000Z | Darlington/phase1/python Basic 2/day 27 solution/qtn2.py | CodedLadiesInnovateTech/-python-challenge-solutions | 430cd3eb84a2905a286819eef384ee484d8eb9e7 | [
"MIT"
] | 39 | 2020-05-10T20:55:02.000Z | 2020-09-12T17:40:59.000Z | #program to create a new string with no duplicate consecutive letters from a given string.
print(no_consecutive_letters("PPYYYTTHON"))
print(no_consecutive_letters("PPyyythonnn"))
print(no_consecutive_letters("Java"))
print(no_consecutive_letters("PPPHHHPPP")) | 47.625 | 90 | 0.76378 | #program to create a new string with no duplicate consecutive letters from a given string.
def no_consecutive_letters (txt):
return txt[0] + ''.join(txt[i] for i in range(1,len(txt)) if txt[i] != txt[i-1])
print(no_consecutive_letters("PPYYYTTHON"))
print(no_consecutive_letters("PPyyythonnn"))
print(no_consecutive... | 0 | 0 | 0 | 0 | 0 | 97 | 0 | 0 | 22 |
d6f297d326b2abd001c99188bf171a056b5c5804 | 3,321 | py | Python | src/reference/API.py | Limespy/interp-compression | 612d3bde77459d280fd84fc45aaf8dc4a282edbe | [
"MIT"
] | null | null | null | src/reference/API.py | Limespy/interp-compression | 612d3bde77459d280fd84fc45aaf8dc4a282edbe | [
"MIT"
] | null | null | null | src/reference/API.py | Limespy/interp-compression | 612d3bde77459d280fd84fc45aaf8dc4a282edbe | [
"MIT"
] | null | null | null | import sys
import pathlib
from collections import namedtuple
path_package = pathlib.Path(__file__).parent.absolute()
sys.path.insert(1,str(path_package.parent))
#%%
# SETUP
path_data = path_package / 'data'
Reference = namedtuple('Reference',
['raw','atol','cmethod','ostyle','compressed'],
... | 38.172414 | 93 | 0.450166 | import sys
import pathlib
import numpy as np
from collections import namedtuple
from scipy import interpolate
import math
path_package = pathlib.Path(__file__).parent.absolute()
sys.path.insert(1,str(path_package.parent))
import API as compression
#%%══════════════════════════════════════════════════════════════════... | 2,724 | 0 | 0 | 724 | 0 | 797 | 0 | -1 | 242 |
6d5c3e3574e5826f1110f971c2411ebdeb4fc8db | 416 | py | Python | leet/array/sortedSquares.py | Rahul-k25/python-cp-cheatsheet | 17ea967f669e4992fba51b26accdd44a01aaac32 | [
"Apache-2.0"
] | 1 | 2021-12-16T10:31:50.000Z | 2021-12-16T10:31:50.000Z | leet/array/sortedSquares.py | Rahul-k25/python-cp-cheatsheet | 17ea967f669e4992fba51b26accdd44a01aaac32 | [
"Apache-2.0"
] | null | null | null | leet/array/sortedSquares.py | Rahul-k25/python-cp-cheatsheet | 17ea967f669e4992fba51b26accdd44a01aaac32 | [
"Apache-2.0"
] | null | null | null | """
time: a
space: a
"""
| 20.8 | 55 | 0.338942 | """
time: a
space: a
"""
class Solution:
def sortedSquares(self, A: List[int]) -> List[int]:
dq = deque()
l = 0
r = len(A)-1
while l <= r:
ls = A[l] ** 2
rs = A[r] ** 2
if ls >= rs:
dq.appendleft(ls)
l += 1
... | 0 | 0 | 0 | 357 | 0 | 0 | 0 | 0 | 22 |
a359aa7158e69c42fc99384df0d7d144916f3d3a | 14,438 | py | Python | fzfaws/utils/pyfzf.py | kazhala/fawsf | 4abefb2301f7b489b11ed3f0b303faafa5941d5b | [
"MIT"
] | 66 | 2020-07-26T12:43:30.000Z | 2022-01-25T12:09:40.000Z | fzfaws/utils/pyfzf.py | kazhala/fawsf | 4abefb2301f7b489b11ed3f0b303faafa5941d5b | [
"MIT"
] | null | null | null | fzfaws/utils/pyfzf.py | kazhala/fawsf | 4abefb2301f7b489b11ed3f0b303faafa5941d5b | [
"MIT"
] | 3 | 2020-07-26T22:09:45.000Z | 2020-07-28T01:09:26.000Z | """This module contains the wrapper class to interacte with fzf.
The fzf class should be used for all occasion when fzf needs
to be launched. fzfaws comes with 4 fzf binary files and will
be used if user doesn't specify to use system fzf in config file.
"""
| 36.185464 | 113 | 0.584707 | """This module contains the wrapper class to interacte with fzf.
The fzf class should be used for all occasion when fzf needs
to be launched. fzfaws comes with 4 fzf binary files and will
be used if user doesn't specify to use system fzf in config file.
"""
import os
import subprocess
import sys
from typing import Any... | 0 | 0 | 0 | 13,989 | 0 | 0 | 0 | 55 | 134 |
33ed3c04845480a464b23ad1bb9cc1d4218a408d | 2,239 | py | Python | pytests/test_basics.py | RedisGears/GearsCli | 5fd9b737ca2ace76fd2d055d70534a13d70fd94f | [
"BSD-3-Clause"
] | null | null | null | pytests/test_basics.py | RedisGears/GearsCli | 5fd9b737ca2ace76fd2d055d70534a13d70fd94f | [
"BSD-3-Clause"
] | null | null | null | pytests/test_basics.py | RedisGears/GearsCli | 5fd9b737ca2ace76fd2d055d70534a13d70fd94f | [
"BSD-3-Clause"
] | null | null | null | from RLTest import Defaults
Defaults.decode_responses = True
SSL_ARGS = ['--ssl', 'True', '--ssl-keyfile', './tests/tls/redis.key', '--ssl-certfile', './tests/tls/redis.crt', '--ssl-ca-certs', './tests/tls/ca.crt', '--ssl-password', 'foobar']
| 38.603448 | 181 | 0.715498 | from gears_cli import run, install_requirements, export_requirements, import_requirements
from click.testing import CliRunner
from RLTest import Defaults
import os
Defaults.decode_responses = True
SSL_ARGS = ['--ssl', 'True', '--ssl-keyfile', './tests/tls/redis.key', '--ssl-certfile', './tests/tls/redis.crt', '--ssl-... | 0 | 0 | 0 | 0 | 0 | 1,697 | 0 | 70 | 227 |
f9ade6541bd4aeb7043ea8596642a546b2787797 | 407 | py | Python | app/stories/migrations/0011_auto_20200721_0002.py | Sherba/AdventureReader | 011ead234118ab13ac1fbe969c00ef91e03d46f5 | [
"MIT"
] | null | null | null | app/stories/migrations/0011_auto_20200721_0002.py | Sherba/AdventureReader | 011ead234118ab13ac1fbe969c00ef91e03d46f5 | [
"MIT"
] | 7 | 2020-07-16T22:24:54.000Z | 2022-03-12T00:41:13.000Z | app/stories/migrations/0011_auto_20200721_0002.py | Sherba/AdventureReader | 011ead234118ab13ac1fbe969c00ef91e03d46f5 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.8 on 2020-07-20 22:02
| 21.421053 | 73 | 0.604423 | # Generated by Django 3.0.8 on 2020-07-20 22:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('stories', '0010_auto_20200721_0000'),
]
operations = [
migrations.AlterField(
model_name='post',
name='genres',
... | 0 | 0 | 0 | 293 | 0 | 0 | 0 | 19 | 46 |
49208b0427f5abd701b0fd26b72be005a1c9db85 | 191 | py | Python | out/euler06.py | FardaleM/metalang | 171557c540f3e2c051ec39ea150afb740c1f615f | [
"BSD-2-Clause"
] | 22 | 2017-04-24T10:00:45.000Z | 2021-04-01T10:11:05.000Z | out/euler06.py | FardaleM/metalang | 171557c540f3e2c051ec39ea150afb740c1f615f | [
"BSD-2-Clause"
] | 12 | 2017-03-26T18:34:21.000Z | 2019-03-21T19:13:03.000Z | out/euler06.py | FardaleM/metalang | 171557c540f3e2c051ec39ea150afb740c1f615f | [
"BSD-2-Clause"
] | 7 | 2017-10-14T13:33:33.000Z | 2021-03-18T15:18:50.000Z | import math
lim = 100
sum = math.trunc(lim * (lim + 1) / 2)
carressum = sum * sum
sumcarres = math.trunc(lim * (lim + 1) * (2 * lim + 1) / 6)
print("%d" % (carressum - sumcarres), end='')
| 19.1 | 59 | 0.570681 | import math
lim = 100
sum = math.trunc(lim * (lim + 1) / 2)
carressum = sum * sum
sumcarres = math.trunc(lim * (lim + 1) * (2 * lim + 1) / 6)
print("%d" % (carressum - sumcarres), end='')
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2fceddae65aa7e7fa4e4abb14a7fdbb4aa78387b | 710 | py | Python | rx/__init__.py | AlexMost/RxPY | 05cb14c72806dc41e243789c05f498dede11cebd | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | rx/__init__.py | AlexMost/RxPY | 05cb14c72806dc41e243789c05f498dede11cebd | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | rx/__init__.py | AlexMost/RxPY | 05cb14c72806dc41e243789c05f498dede11cebd | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-11-04T11:13:49.000Z | 2021-11-04T11:13:49.000Z | try:
import asyncio
except ImportError:
try:
import trollius as asyncio
except ImportError:
asyncio = None
try:
from threading import RLock as Lock
except ImportError:
from rx.internal.concurrency import NoLock as Lock
try:
from asyncio import Future
except ImportError:
try... | 18.684211 | 54 | 0.714085 | try:
import asyncio
except ImportError:
try:
import trollius as asyncio
except ImportError:
asyncio = None
try:
from threading import RLock as Lock
except ImportError:
from rx.internal.concurrency import NoLock as Lock
try:
from asyncio import Future
except ImportError:
try... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 63 | 134 |
fab56e81604074a431e05bfba5b606021be545ec | 6,355 | py | Python | tensorpack/graph_builder/model_desc.py | ChenYuHo/tensorpack | 8832ac869159e99ff77630cfbd0a850197003c05 | [
"Apache-2.0"
] | null | null | null | tensorpack/graph_builder/model_desc.py | ChenYuHo/tensorpack | 8832ac869159e99ff77630cfbd0a850197003c05 | [
"Apache-2.0"
] | null | null | null | tensorpack/graph_builder/model_desc.py | ChenYuHo/tensorpack | 8832ac869159e99ff77630cfbd0a850197003c05 | [
"Apache-2.0"
] | 1 | 2020-04-21T08:37:38.000Z | 2020-04-21T08:37:38.000Z | # -*- coding: utf-8 -*-
# File: model_desc.py
from ..compat import backport_tensor_spec, tfv1
TensorSpec = backport_tensor_spec()
__all__ = ['InputDesc', 'ModelDesc', 'ModelDescBase']
def build_or_reuse_placeholder(tensor_spec):
"""
Build a tf.placeholder from the metadata in the given tensor spec, or ret... | 34.351351 | 119 | 0.634618 | # -*- coding: utf-8 -*-
# File: model_desc.py
from collections import namedtuple
import tensorflow as tf
from ..utils.argtools import memoized_method
from ..tfutils.common import get_op_tensor_name
from ..tfutils.tower import get_current_tower_context
from ..compat import backport_tensor_spec, tfv1
TensorSpec = bac... | 0 | 1,978 | 0 | 2,847 | 0 | 0 | 0 | 96 | 181 |
04c3dcddb8836bfc98e1ac0a9aaba1b602e54917 | 2,672 | py | Python | tinypkg/general_utils.py | palmhjell/tinypkg | 4eb56bb0027ff3ef3abb9e7d249b47288a9a0f8d | [
"MIT"
] | null | null | null | tinypkg/general_utils.py | palmhjell/tinypkg | 4eb56bb0027ff3ef3abb9e7d249b47288a9a0f8d | [
"MIT"
] | null | null | null | tinypkg/general_utils.py | palmhjell/tinypkg | 4eb56bb0027ff3ef3abb9e7d249b47288a9a0f8d | [
"MIT"
] | null | null | null |
def check_df_col(df, column, name=None):
"""
Checks for the presence of a column (or columns) in a tidy
DataFrame with an informative error message. Passes silently,
otherwise raises error.
"""
if column is not None:
if type(column) != list:
column = [column]
for... | 35.626667 | 116 | 0.662425 | import numpy as np
import pandas as pd
def check_df_col(df, column, name=None):
"""
Checks for the presence of a column (or columns) in a tidy
DataFrame with an informative error message. Passes silently,
otherwise raises error.
"""
if column is not None:
if type(column) != list:
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -5 | 44 |
70900917eb9f212abfb35ca7d348fc71ab012206 | 678 | py | Python | direct/single.py | hposborn/isoclassify | 9be27b8d1400aff7b955c52968457d5edfe72585 | [
"MIT"
] | null | null | null | direct/single.py | hposborn/isoclassify | 9be27b8d1400aff7b955c52968457d5edfe72585 | [
"MIT"
] | null | null | null | direct/single.py | hposborn/isoclassify | 9be27b8d1400aff7b955c52968457d5edfe72585 | [
"MIT"
] | null | null | null | import asfgrid
dnumodel = asfgrid.Seism()
bcmodel = h5py.File('bcgrid.h5', 'r')
dustmodel = mwdust.Combined15()
x=obsdata()
x.addspec([5065.,-99.0,-0.1],[120.,0.0,0.2])
x.addseismo([231.,16.5],[10.,0.5])
paras=stparas(input=x,dnumodel=dnumodel,bcmodel=bcmodel,dustmodel=dustmodel,\
useav=0,d... | 24.214286 | 77 | 0.687316 | import sys
import ebf
import numpy as np
import scipy.interpolate
import pdb
import asfgrid
from astropy.io import ascii
from classify_direct import *
dnumodel = asfgrid.Seism()
bcmodel = h5py.File('bcgrid.h5', 'r')
dustmodel = mwdust.Combined15()
x=obsdata()
x.addspec([5065.,-99.0,-0.1],[120.,0.0,0.2])
x.addsei... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -18 | 154 |
8122843f4a95c75078a060dcdb0a5eeaef29582d | 451 | py | Python | app/preprocessor/mixins/kwargstodict.py | Wordseer/wordseer | a45102c1848c93360d3815187783756dc5e16156 | [
"Unlicense"
] | 38 | 2015-02-26T02:21:04.000Z | 2022-02-03T16:29:00.000Z | app/preprocessor/mixins/kwargstodict.py | Wordseer/wordseer | a45102c1848c93360d3815187783756dc5e16156 | [
"Unlicense"
] | 106 | 2015-03-06T20:23:32.000Z | 2016-10-04T21:46:51.000Z | app/preprocessor/mixins/kwargstodict.py | Wordseer/wordseer | a45102c1848c93360d3815187783756dc5e16156 | [
"Unlicense"
] | 18 | 2015-08-17T02:29:57.000Z | 2022-02-03T16:29:30.000Z | """
A mixin to convert kwargs to attributes.
"""
| 28.1875 | 74 | 0.636364 | """
A mixin to convert kwargs to attributes.
"""
class KwargsToDict(object):
"""This mixin converts kwargs passed to the constructor to attributes.
"""
def __init__(self, **kwargs):
"""When a class is created, automatically convert its kwargs to
attributes.
:param dict kwargs: The k... | 0 | 0 | 0 | 379 | 0 | 0 | 0 | 0 | 23 |
b6791e75000767749141ef22168f4a7d6b883030 | 2,399 | py | Python | shared/uce_utils.py | n-i-x/alu_auto_builder | c4d5e59ce1667742adb00ca08f5500243f551fcf | [
"FTL",
"CNRI-Python",
"Linux-OpenIB"
] | null | null | null | shared/uce_utils.py | n-i-x/alu_auto_builder | c4d5e59ce1667742adb00ca08f5500243f551fcf | [
"FTL",
"CNRI-Python",
"Linux-OpenIB"
] | null | null | null | shared/uce_utils.py | n-i-x/alu_auto_builder | c4d5e59ce1667742adb00ca08f5500243f551fcf | [
"FTL",
"CNRI-Python",
"Linux-OpenIB"
] | null | null | null | #!/usr/bin/env python3
| 27.574713 | 98 | 0.680283 | #!/usr/bin/env python3
import os
import logging
import time
from shared import common_utils
def split_uce(input_path):
logging.info('Splitting UCE file {0} into main section and save partition'.format(input_path))
data = common_utils.get_file_content(input_path, 'rb')
squashfs_etc_data = data[:-4194304]... | 0 | 0 | 0 | 0 | 0 | 2,090 | 0 | -19 | 297 |
32531edcccfc96703dcb9e839a58f299781940b1 | 1,828 | py | Python | 438.py | wilbertgeng/LeetCode_exercise | f00c08e0d28ffa88d61d4262c6d1f49f1fa91ebc | [
"MIT"
] | null | null | null | 438.py | wilbertgeng/LeetCode_exercise | f00c08e0d28ffa88d61d4262c6d1f49f1fa91ebc | [
"MIT"
] | null | null | null | 438.py | wilbertgeng/LeetCode_exercise | f00c08e0d28ffa88d61d4262c6d1f49f1fa91ebc | [
"MIT"
] | null | null | null | """438. Find All Anagrams in a String"""
| 24.373333 | 95 | 0.335339 | """438. Find All Anagrams in a String"""
class Solution(object):
def findAnagrams(self, s, p):
"""
:type s: str
:type p: str
:rtype: List[int]
########
need = {}
window = {}
for char in p:
need[char] = need.get(char, 0) + 1
left = ... | 0 | 0 | 0 | 1,764 | 0 | 0 | 0 | 0 | 23 |
82fa6e74190d577507e6e635d6c9fbdd9bc6e456 | 24,498 | py | Python | gui.py | tzaeru/NWNLauncher | 1de07b4c503805134112c9e2010aa85b447eaf03 | [
"WTFPL"
] | null | null | null | gui.py | tzaeru/NWNLauncher | 1de07b4c503805134112c9e2010aa85b447eaf03 | [
"WTFPL"
] | null | null | null | gui.py | tzaeru/NWNLauncher | 1de07b4c503805134112c9e2010aa85b447eaf03 | [
"WTFPL"
] | null | null | null | from tkinter import ttk
import path_finder
import os
import dependency_manager
import config
from PIL import ImageTk
import webbrowser
import utilities
gui_update_cycles = 0
update_check_queued = False
shown_update = False
root = Tk()
root.title("NWN Launcher - Prisoners of The Mist")
root.resizable(0,0)
#root.... | 41.522034 | 161 | 0.73206 | from tkinter import *
from tkinter import ttk
from threading import Thread
import time
import path_finder
import os, subprocess
from tkinter.filedialog import askdirectory
import dependency_manager
import config
from PIL import Image, ImageTk
import webbrowser
import utilities
import functools
import version_c... | 0 | 0 | 0 | 0 | 0 | 10,991 | 0 | 34 | 641 |
abf15071a9b5c919b1e12a058199f758a4a686fe | 8,058 | py | Python | stage2_recall.py | antmachineintelligence/Feedback_1st | a8d201a7d91e967f3df508434f7969ca9f59d0d6 | [
"MIT"
] | null | null | null | stage2_recall.py | antmachineintelligence/Feedback_1st | a8d201a7d91e967f3df508434f7969ca9f59d0d6 | [
"MIT"
] | null | null | null | stage2_recall.py | antmachineintelligence/Feedback_1st | a8d201a7d91e967f3df508434f7969ca9f59d0d6 | [
"MIT"
] | null | null | null | import pickle
import numpy as np
import pandas as pd
from tqdm import tqdm
df = pickle.load(open('./data/data_6model_offline712_online704_ensemble.pkl','rb'))
train_df = pd.read_csv('./data/train.csv')
IDS = train_df.id.unique()
dic_off_map = df[['id','offset_mapping']].set_index('id')['offset_mapping'].to_dict()
di... | 31.724409 | 132 | 0.596798 | import pickle
import math
import numpy as np
import pandas as pd
from tqdm import tqdm
df = pickle.load(open('./data/data_6model_offline712_online704_ensemble.pkl','rb'))
train_df = pd.read_csv('./data/train.csv')
IDS = train_df.id.unique()
dic_off_map = df[['id','offset_mapping']].set_index('id')['offset_mapping'].... | 42 | 0 | 0 | 47 | 0 | 2,407 | 0 | -10 | 90 |
b282d8a78adb495fe5daec0e1315f6df69bdca8c | 9,652 | py | Python | aiida/cmdline/commands/cmd_export.py | xorJane/aiida-core | 5c120560fa4d82f1e193c66750efbf13453ac756 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | aiida/cmdline/commands/cmd_export.py | xorJane/aiida-core | 5c120560fa4d82f1e193c66750efbf13453ac756 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | aiida/cmdline/commands/cmd_export.py | xorJane/aiida-core | 5c120560fa4d82f1e193c66750efbf13453ac756 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 39.557377 | 120 | 0.67126 | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 0 | 8,532 | 0 | 0 | 0 | 0 | 0 | 119 | 269 |
bfcaabfc3210814edda553de0dd026b784d41afc | 814 | py | Python | app/db/init.py | haitwang-cloud/fastapi-alembic-sqlmodel-sample | a8b1e5b069e608702a209b64ddae3c8aff78db88 | [
"Apache-2.0"
] | null | null | null | app/db/init.py | haitwang-cloud/fastapi-alembic-sqlmodel-sample | a8b1e5b069e608702a209b64ddae3c8aff78db88 | [
"Apache-2.0"
] | null | null | null | app/db/init.py | haitwang-cloud/fastapi-alembic-sqlmodel-sample | a8b1e5b069e608702a209b64ddae3c8aff78db88 | [
"Apache-2.0"
] | null | null | null | from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session
from sqlalchemy.orm import sessionmaker
from configparser import ConfigParser
config = ConfigParser()
config.read('config.ini')
mysql_username = config.get('DATABASE', 'MYSQL_USER')
mysql_pwd = config.get('DATABASE', 'MYSQL_PWD')
mysql_ho... | 25.4375 | 86 | 0.740786 | from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session
from sqlalchemy.orm import sessionmaker
from configparser import ConfigParser
config = ConfigParser()
config.read('config.ini')
mysql_username = config.get('DATABASE', 'MYSQL_USER')
mysql_pwd = config.get('DATABASE', 'MYSQL_PWD')
mysql_ho... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c83a4d2d9774d2b0b0ff8ef6af792ee2ff68be5d | 7,475 | py | Python | metrics/FP_KT.py | hahahahahzt/DP-Star | 8ae5bc0f79b50445e7dfbef9bed54e55c4eafa11 | [
"MIT"
] | null | null | null | metrics/FP_KT.py | hahahahahzt/DP-Star | 8ae5bc0f79b50445e7dfbef9bed54e55c4eafa11 | [
"MIT"
] | null | null | null | metrics/FP_KT.py | hahahahahzt/DP-Star | 8ae5bc0f79b50445e7dfbef9bed54e55c4eafa11 | [
"MIT"
] | null | null | null | import os
pattern = ['Frequent_Pattern_init.txt', 'Frequent_Pattern_sd.txt']
path_list = ['../../data/Geolife Trajectories 1.3/Trajectories7000/', '../../data/Geolife Trajectories '
'1.3/sd/sd_final_MDL1100_ep0.1/',
'../../data/Geo... | 37.189055 | 118 | 0.479732 | import numpy as np
import os
pattern = ['Frequent_Pattern_init.txt', 'Frequent_Pattern_sd.txt']
path_list = ['../../data/Geolife Trajectories 1.3/Trajectories7000/', '../../data/Geolife Trajectories '
'1.3/sd/sd_final_MDL1100_ep0.1/',
... | 678 | 0 | 0 | 0 | 0 | 118 | 0 | -3 | 48 |
7b3221f4336ece7c481983b28ea2e6003e6688ec | 1,335 | py | Python | talkpython/100-days-of-code-in-python/my_progress/test_day_012_gold_mining_back_of_envelope.py | djrgit/coursework | 2a91da9b76cb1acbd12f3d8049f15d2e71f475a1 | [
"MIT"
] | null | null | null | talkpython/100-days-of-code-in-python/my_progress/test_day_012_gold_mining_back_of_envelope.py | djrgit/coursework | 2a91da9b76cb1acbd12f3d8049f15d2e71f475a1 | [
"MIT"
] | null | null | null | talkpython/100-days-of-code-in-python/my_progress/test_day_012_gold_mining_back_of_envelope.py | djrgit/coursework | 2a91da9b76cb1acbd12f3d8049f15d2e71f475a1 | [
"MIT"
] | 3 | 2018-08-13T23:14:22.000Z | 2019-01-11T22:50:07.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
| 26.176471 | 66 | 0.561049 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pytest
from day_012_gold_mining_back_of_envelope import share_price_calc
class FakeData:
def __init__(self, oz_per_yr=100000, price_per_oz=1750,
aisc=900, exchange_rate=1.25, shrs_out=146250000,
pe=10):
self.oz_per_y... | 0 | 665 | 0 | 375 | 0 | 94 | 0 | 36 | 115 |
277d38e04f2185bba5121186177fa1464f6df88f | 14,721 | py | Python | vra_configure.py | Gayathri-muthu/ansible-module-chaperone | 2af8a4c6188872d6a8d1517cdb8acf4796cf2c0b | [
"Apache-2.0"
] | 11 | 2016-05-11T21:13:55.000Z | 2019-02-26T14:15:15.000Z | vra_configure.py | Gayathri-muthu/ansible-module-chaperone | 2af8a4c6188872d6a8d1517cdb8acf4796cf2c0b | [
"Apache-2.0"
] | 7 | 2016-03-25T18:38:01.000Z | 2019-02-13T19:26:09.000Z | vra_configure.py | Gayathri-muthu/ansible-module-chaperone | 2af8a4c6188872d6a8d1517cdb8acf4796cf2c0b | [
"Apache-2.0"
] | 16 | 2016-01-12T21:48:22.000Z | 2019-04-29T22:50:13.000Z | #!/usr/bin/python
__author__ = 'smetta'
# Import the module
import sys
import sys
import xml.dom.minidom as minidom
DOCUMENTATION = '''
---
module: vra_configure.py
Short_description: Module for configuring vra post gres database,messaging and clustering
description:
- Provides an interface for configuring post gr... | 46.585443 | 336 | 0.586917 | #!/usr/bin/python
__author__ = 'smetta'
# Import the module
import sys
import os
import socket
import json
import httplib
import sys
import base64
import ssl
import sys
import xml.etree.ElementTree as ET
import xml.dom.minidom as minidom
DOCUMENTATION = '''
---
module: vra_configure.py
Short_description: Module for co... | 0 | 0 | 0 | 9,668 | 0 | 2,608 | 0 | -16 | 290 |
d5b9379024102fc747fb78d26ada6b5b4216e21c | 6,756 | py | Python | facebook_business/adobjects/productfeedupload.py | s-nez/facebook-python-business-sdk | 4766644c7585d2e262463862f8aae26d5bea2615 | [
"CNRI-Python"
] | 1 | 2020-05-10T20:53:02.000Z | 2020-05-10T20:53:02.000Z | facebook_business/adobjects/productfeedupload.py | s-nez/facebook-python-business-sdk | 4766644c7585d2e262463862f8aae26d5bea2615 | [
"CNRI-Python"
] | null | null | null | facebook_business/adobjects/productfeedupload.py | s-nez/facebook-python-business-sdk | 4766644c7585d2e262463862f8aae26d5bea2615 | [
"CNRI-Python"
] | 1 | 2018-09-24T14:04:48.000Z | 2018-09-24T14:04:48.000Z | # Copyright 2014 Facebook, Inc.
# You are hereby granted a non-exclusive, worldwide, royalty-free license to
# use, copy, modify, and distribute this software in source code or binary
# form for use in connection with the web services and APIs provided by
# Facebook.
# As with any software that integrates with the Fa... | 37.120879 | 115 | 0.655861 | # Copyright 2014 Facebook, Inc.
# You are hereby granted a non-exclusive, worldwide, royalty-free license to
# use, copy, modify, and distribute this software in source code or binary
# form for use in connection with the web services and APIs provided by
# Facebook.
# As with any software that integrates with the Fa... | 0 | 218 | 0 | 4,927 | 0 | 0 | 0 | 208 | 134 |
d4d9136b9fb7c4c7d9cc15f7b983fe966ba1024d | 2,804 | py | Python | core/data/info.py | google-research/runtime-error-prediction | 1eefe57183434a754171dd3db893831d45d12671 | [
"Apache-2.0"
] | 10 | 2022-03-09T13:24:35.000Z | 2022-03-14T20:29:15.000Z | core/data/info.py | google-research/runtime-error-prediction | 1eefe57183434a754171dd3db893831d45d12671 | [
"Apache-2.0"
] | null | null | null | core/data/info.py | google-research/runtime-error-prediction | 1eefe57183434a754171dd3db893831d45d12671 | [
"Apache-2.0"
] | 2 | 2022-03-09T13:25:07.000Z | 2022-03-10T18:25:50.000Z | # Copyright (C) 2021 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 30.813187 | 86 | 0.736448 | # Copyright (C) 2021 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 0 | 163 | 0 | 0 | 0 | 1,798 | 0 | 32 | 137 |
31ba468c74f3e737cab1d7ba6201842e0df7e1f9 | 3,247 | py | Python | atlassian/hip_chat.py | erichaase/atlassian | cac744b27a19dda02caf8e81fad615e0f2ecc9b7 | [
"MIT"
] | 1 | 2017-01-03T02:42:05.000Z | 2017-01-03T02:42:05.000Z | atlassian/hip_chat.py | erichaase/atlassian | cac744b27a19dda02caf8e81fad615e0f2ecc9b7 | [
"MIT"
] | null | null | null | atlassian/hip_chat.py | erichaase/atlassian | cac744b27a19dda02caf8e81fad615e0f2ecc9b7 | [
"MIT"
] | null | null | null | import collections
import json
import re
import urllib
from bs4 import BeautifulSoup
import HTMLParser
def get_properties (message):
"""
Processes a given chat message to identify particular properties: mentions,
emoticons and links. See the README.md file for more detailed documentation.
Args:
... | 35.293478 | 98 | 0.59963 | import collections
import json
import re
import urllib
from bs4 import BeautifulSoup
import HTMLParser
def get_properties (message):
"""
Processes a given chat message to identify particular properties: mentions,
emoticons and links. See the README.md file for more detailed documentation.
Args:
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b24563c9f07e1956e60e75de386432128f16030b | 875 | py | Python | useful_tools/ping.py | Westwood-Robotics/PyBEAR-WR | d0a1ecbe03d42821034b2e07fae6df6eaf7eb053 | [
"Apache-2.0"
] | 1 | 2020-12-18T00:14:49.000Z | 2020-12-18T00:14:49.000Z | useful_tools/ping.py | Westwood-Robotics/PyBEAR-WR | d0a1ecbe03d42821034b2e07fae6df6eaf7eb053 | [
"Apache-2.0"
] | 3 | 2020-11-30T07:50:57.000Z | 2021-02-22T20:17:04.000Z | useful_tools/ping.py | Westwood-Robotics/PyBEAR-WR | d0a1ecbe03d42821034b2e07fae6df6eaf7eb053 | [
"Apache-2.0"
] | 2 | 2020-12-29T04:29:12.000Z | 2021-03-11T19:24:01.000Z | #!usr/bin/env python
__author__ = "Xiaoguang Zhang"
__email__ = "xzhang@westwoodrobotics.io"
__copyright__ = "Copyright 2020 Westwood Robotics"
__date__ = "Jan 8, 2021"
__version__ = "0.1.2"
__status__ = "Production"
# Ping and search for available BEARs
from pybear import Manager
# Define port and baud rate
bear_por... | 25.735294 | 88 | 0.691429 | #!usr/bin/env python
__author__ = "Xiaoguang Zhang"
__email__ = "xzhang@westwoodrobotics.io"
__copyright__ = "Copyright 2020 Westwood Robotics"
__date__ = "Jan 8, 2021"
__version__ = "0.1.2"
__status__ = "Production"
# Ping and search for available BEARs
from pybear import Manager
# Define port and baud rate
bear_por... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d96c1dc3eb9050e3767c3f86f7da1071bf2d44f8 | 2,029 | py | Python | dataset/dataset.py | avi33/StyleMelGan-Unofficial | 5a7cc99eb0feb8ef443a54d9e8dc3dca95e03b3b | [
"MIT"
] | 22 | 2021-03-26T14:25:22.000Z | 2022-01-24T16:26:16.000Z | dataset/dataset.py | avi33/StyleMelGan-Unofficial | 5a7cc99eb0feb8ef443a54d9e8dc3dca95e03b3b | [
"MIT"
] | 1 | 2021-10-13T03:11:56.000Z | 2021-10-13T05:11:21.000Z | dataset/dataset.py | avi33/StyleMelGan-Unofficial | 5a7cc99eb0feb8ef443a54d9e8dc3dca95e03b3b | [
"MIT"
] | 1 | 2022-01-24T16:26:20.000Z | 2022-01-24T16:26:20.000Z | import torch
| 34.389831 | 86 | 0.656974 | import torch
import torchaudio
import torch.utils.data
import torch.nn.functional as F
from librosa.core import load, resample
from librosa.util import normalize
from pathlib import Path
import numpy as np
import random
from modules.helper_functions import files_to_list
from dataset.audio_augs import AudioAugs
class ... | 0 | 0 | 0 | 1,694 | 0 | 0 | 0 | 79 | 243 |
915b99e6ec1d6cb4641d8032fa188c61006dfbb3 | 1,759 | py | Python | ppocr/losses/ace_loss.py | edencfc/PaddleOCR | 82c5966a642d07f99502d779c70a707fe3edbcb0 | [
"Apache-2.0"
] | 4 | 2021-07-29T13:57:22.000Z | 2022-03-21T09:47:53.000Z | ppocr/losses/ace_loss.py | tenDay22/PaddleOCR | ca44e5766919b61b0e88513d62b551397703be2c | [
"Apache-2.0"
] | 1 | 2020-12-21T06:06:45.000Z | 2020-12-21T06:06:45.000Z | ppocr/losses/ace_loss.py | tenDay22/PaddleOCR | ca44e5766919b61b0e88513d62b551397703be2c | [
"Apache-2.0"
] | 1 | 2022-03-29T07:09:25.000Z | 2022-03-29T07:09:25.000Z | # copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 33.188679 | 74 | 0.675952 | # copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 0 | 0 | 0 | 914 | 0 | 0 | 0 | -8 | 46 |
74969a8559a9be13bcea15afeeac63a8025d9d8b | 1,110 | py | Python | mahjong/hand_calculating/yaku_list/yakuman/shosuushi.py | Enerccio/mahjong | 903505a7886c31845dfa6b3f54c936a4feb29e6e | [
"MIT"
] | null | null | null | mahjong/hand_calculating/yaku_list/yakuman/shosuushi.py | Enerccio/mahjong | 903505a7886c31845dfa6b3f54c936a4feb29e6e | [
"MIT"
] | null | null | null | mahjong/hand_calculating/yaku_list/yakuman/shosuushi.py | Enerccio/mahjong | 903505a7886c31845dfa6b3f54c936a4feb29e6e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
| 26.428571 | 74 | 0.597297 | # -*- coding: utf-8 -*-
from mahjong.constants import EAST, SOUTH, WEST, NORTH
from mahjong.hand_calculating.yaku import Yaku
from mahjong.utils import is_pon, is_pair
class Shousuushii(Yaku):
"""
The hand contains three sets of winds and a pair of the remaining wind
"""
def __init__(self, yaku_id):
... | 0 | 0 | 0 | 918 | 0 | 0 | 0 | 78 | 89 |
237cf067f17f7a8682ac3c20e6bdfbeb3fda0d3e | 1,511 | py | Python | clean/day01.py | JerryDot/advent-2021-py | c3eb44b5989c276de0b5e721d3b8dfa1698796f1 | [
"MIT"
] | null | null | null | clean/day01.py | JerryDot/advent-2021-py | c3eb44b5989c276de0b5e721d3b8dfa1698796f1 | [
"MIT"
] | null | null | null | clean/day01.py | JerryDot/advent-2021-py | c3eb44b5989c276de0b5e721d3b8dfa1698796f1 | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
input = get_input()
print(part_one(input))
print(part_one_alt(input))
print(part_two(input))
print(part_two_alt(input))
print(part_two_ext(input))
| 22.220588 | 58 | 0.549967 | from collections import deque
from typing import List
from functools import reduce
def get_input() -> List[int]:
with open('../fast/day01/day01.txt', 'rb') as f:
input = list(map(int, f.readlines()))
return input
def part_one(input: List[int]) -> int:
return reduce(
lambda acc, pair: int... | 0 | 0 | 0 | 0 | 0 | 1,084 | 0 | 17 | 204 |
7cb45296506625f5c94e5672b6c411bf25cde548 | 36,392 | py | Python | homeassistant/components/xiaomi_miio/fan.py | itewk/home-assistant | 769cf19052f8c9ef374d8ba8ae7705ccc7bf4cf4 | [
"Apache-2.0"
] | 23 | 2017-11-15T21:03:53.000Z | 2021-03-29T21:33:48.000Z | homeassistant/components/xiaomi_miio/fan.py | itewk/home-assistant | 769cf19052f8c9ef374d8ba8ae7705ccc7bf4cf4 | [
"Apache-2.0"
] | 9 | 2022-01-27T06:32:10.000Z | 2022-03-31T07:07:51.000Z | homeassistant/components/xiaomi_miio/fan.py | itewk/home-assistant | 769cf19052f8c9ef374d8ba8ae7705ccc7bf4cf4 | [
"Apache-2.0"
] | 10 | 2018-01-01T00:12:51.000Z | 2021-12-21T23:08:05.000Z | """Support for Xiaomi Mi Air Purifier and Xiaomi Mi Air Humidifier."""
import logging
import voluptuous as vol
from homeassistant.components.fan import PLATFORM_SCHEMA
from homeassistant.const import (ATTR_ENTITY_ID, ATTR_MODE, CONF_HOST, CONF_NAME, CONF_TOKEN)
import homeassistant.helpers.config_validation as cv
fro... | 32.697215 | 88 | 0.661519 | """Support for Xiaomi Mi Air Purifier and Xiaomi Mi Air Humidifier."""
import asyncio
from enum import Enum
from functools import partial
import logging
from miio import ( # pylint: disable=import-error
AirFresh,
AirHumidifier,
AirPurifier,
Device,
DeviceException,
)
from miio.airfresh import ( #... | 0 | 1,616 | 15,512 | 5,013 | 0 | 0 | 0 | 737 | 292 |
e12e16d50a5770d564ad36844ad9376725e2cc17 | 1,149 | py | Python | avatar-server.py | th4nhtung/avatars | e302db2b3852ff8910b7ea6ecb98d6662cd4e4f4 | [
"MIT"
] | null | null | null | avatar-server.py | th4nhtung/avatars | e302db2b3852ff8910b7ea6ecb98d6662cd4e4f4 | [
"MIT"
] | null | null | null | avatar-server.py | th4nhtung/avatars | e302db2b3852ff8910b7ea6ecb98d6662cd4e4f4 | [
"MIT"
] | null | null | null | import os
from pyfiglet import Figlet
from flask import Flask
from subprocess import call
from sys import platform as _platform
if _platform == 'win32' or _platform == 'win64':
call('cls', shell=True)
elif _platform == 'linux' or _platform == 'linux2':
call('clear', shell=True)
f = Figlet(font='stop')
print(f... | 23.9375 | 62 | 0.671889 | import os
from pyfiglet import Figlet
from flask import Flask, send_file, jsonify
from subprocess import call
from sys import platform as _platform
if _platform == 'win32' or _platform == 'win64':
call('cls', shell=True)
elif _platform == 'linux' or _platform == 'linux2':
call('clear', shell=True)
f = Figlet(... | 0 | 448 | 0 | 0 | 0 | 0 | 0 | 20 | 69 |
85dd50562724e29435112cd558ea5dca84638252 | 4,760 | py | Python | bin/generate_price_database.py | qfoxic/grapher-aws | 5e27a743db983f87bcaa9f0f02724053a012d44d | [
"Apache-2.0"
] | null | null | null | bin/generate_price_database.py | qfoxic/grapher-aws | 5e27a743db983f87bcaa9f0f02724053a012d44d | [
"Apache-2.0"
] | null | null | null | bin/generate_price_database.py | qfoxic/grapher-aws | 5e27a743db983f87bcaa9f0f02724053a012d44d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import sys
if __name__ == '__main__':
sys.exit(app())
| 34.492754 | 115 | 0.571639 | #!/usr/bin/env python3
import csv
import enum
import os
import pprint
import re
import sqlite3
import sys
from functools import partialmethod
class PricingField(enum.IntEnum):
# The value of a member represent column number of a csv file.
InstanceType = 1
LinuxOnDemandPrice = 30
Windo... | 0 | 158 | 0 | 4,039 | 0 | 223 | 0 | -46 | 287 |
2966f68dac735271a14badabb0ac53cc610ee645 | 413 | py | Python | MyWatchList/migrations/0006_auto_20200411_0333.py | fgl-foundation/MovieDB | 17bf065336f52f7f6ef423f85b6aa5315b1d685f | [
"MIT"
] | null | null | null | MyWatchList/migrations/0006_auto_20200411_0333.py | fgl-foundation/MovieDB | 17bf065336f52f7f6ef423f85b6aa5315b1d685f | [
"MIT"
] | 1 | 2019-11-01T15:47:04.000Z | 2019-11-01T15:47:04.000Z | MyWatchList/migrations/0006_auto_20200411_0333.py | fgl-foundation/MovieDB | 17bf065336f52f7f6ef423f85b6aa5315b1d685f | [
"MIT"
] | null | null | null | # Generated by Django 3.0.5 on 2020-04-11 00:33
| 21.736842 | 69 | 0.617433 | # Generated by Django 3.0.5 on 2020-04-11 00:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('MyWatchList', '0005_auto_20200411_0328'),
]
operations = [
migrations.AlterField(
model_name='movie',
name='kinopois... | 0 | 0 | 0 | 299 | 0 | 0 | 0 | 19 | 46 |
84fca140120abe3d5dbb8bf5f14e5d465a59a72b | 1,150 | py | Python | aniwatch_proxy_checker.py | silvershade69/Sakurajima | e2757cca8fcbc4a4292cc7aed1bebba335de714d | [
"MIT"
] | 22 | 2020-06-11T06:59:40.000Z | 2021-05-30T13:08:22.000Z | aniwatch_proxy_checker.py | notmarek/Sakurajima | 95491fe7a454b3482bed509e34a3db33aa3c1b0d | [
"MIT"
] | 33 | 2020-06-23T19:08:20.000Z | 2021-01-28T18:07:02.000Z | aniwatch_proxy_checker.py | notmarek/Sakurajima | 95491fe7a454b3482bed509e34a3db33aa3c1b0d | [
"MIT"
] | 3 | 2020-07-01T10:17:48.000Z | 2021-01-18T15:18:26.000Z | import threading
import sys
"""Usage: python aniwatch_proxy_checker.py proxy_file max_timeout"""
if __name__ == "__main__":
good_proxies = []
threads = []
with open(sys.argv[1], "r", encoding="utf-8") as f:
lol = [x.replace("\n", "") for x in f.readlines()]
lol = list(dict.fromkeys(lol))
... | 30.263158 | 113 | 0.624348 | import requests
import threading
import sys
"""Usage: python aniwatch_proxy_checker.py proxy_file max_timeout"""
def check_proxy(proxy, timeout):
global good_proxies
try:
with requests.get("https://aniwatch.me", proxies={"https": proxy}, timeout=timeout) as r:
if "The owner of this websit... | 0 | 0 | 0 | 0 | 0 | 366 | 0 | -6 | 45 |