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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
db3ea965c5c068c95deadd65f2f299b1fb2aad20 | 3,478 | py | Python | app/views.py | kdelwat/LangEvolve | 6e400f9e3d7ff7bc0dce0d1db0af3682b2ad0e01 | [
"MIT"
] | 29 | 2016-12-18T08:44:26.000Z | 2022-03-20T09:39:22.000Z | app/views.py | kdelwat/LangEvolve | 6e400f9e3d7ff7bc0dce0d1db0af3682b2ad0e01 | [
"MIT"
] | 11 | 2016-11-22T01:13:11.000Z | 2022-03-04T21:21:15.000Z | app/views.py | kdelwat/LangEvolve | 6e400f9e3d7ff7bc0dce0d1db0af3682b2ad0e01 | [
"MIT"
] | 5 | 2017-02-07T08:54:49.000Z | 2022-01-13T15:23:45.000Z | import sys
import os.path as path
base_directory = path.dirname(path.dirname(path.abspath(__file__)))
sys.path.append(path.join(base_directory, 'engine'))
import metrics
optimisation_functions = {'Maximise': max, 'Minimise': min}
metric_functions = {'weighted phonetic product': metrics.weighted_phonetic_product,
... | 32.203704 | 89 | 0.642611 | import json
import sys
import os.path as path
from flask import render_template, jsonify, request
from app import app
base_directory = path.dirname(path.dirname(path.abspath(__file__)))
sys.path.append(path.join(base_directory, 'engine'))
import engine
import metrics
optimisation_functions = {'Maximise': max, 'Minim... | 9 | 1,997 | 0 | 0 | 0 | 0 | 0 | 10 | 158 |
708de96b5e867459e01ef603bcccd38b98f7676d | 2,532 | py | Python | NotIncluded/Draw_NetworkX_Graph.py | DaluS/GEMMES | 10d4a062004ce5b7fd26eb8c4937d940b7d097d5 | [
"MIT"
] | 4 | 2021-06-28T07:11:34.000Z | 2022-01-11T13:43:17.000Z | NotIncluded/Draw_NetworkX_Graph.py | DaluS/GEMMES | 10d4a062004ce5b7fd26eb8c4937d940b7d097d5 | [
"MIT"
] | 167 | 2021-06-28T07:10:21.000Z | 2022-03-18T17:30:40.000Z | NotIncluded/Draw_NetworkX_Graph.py | DaluS/GEMMES | 10d4a062004ce5b7fd26eb8c4937d940b7d097d5 | [
"MIT"
] | 3 | 2021-06-28T07:19:12.000Z | 2022-03-03T02:44:15.000Z | # -*- coding: utf-8 -*
import pandas as pd
import pygraphviz
import pygemmes as pgm
import networkx as nx
import matplotlib.pyplot as plt
from graph_tools import Graph
import graph_tools as gt
import pygraphviz as pgv
A = pgv.AGraph(directed=True,)
model = 'GK'
hub = pgm.Hub(model, verb=False)
R = hub.get_dparam(retu... | 26.652632 | 77 | 0.631122 | # -*- coding: utf-8 -*
import pandas as pd
import pygraphviz
import numpy as np
import pygemmes as pgm
import networkx as nx
import matplotlib.pyplot as plt
from graph_tools import Graph
import graph_tools as gt
import pygraphviz as pgv
A = pgv.AGraph(directed=True,)
model = 'GK'
hub = pgm.Hub(model, verb=False)
R = ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 22 |
94e2f679c8e9b5dd0244c89c55f353b897eaaca9 | 481 | py | Python | hot/software-config/elements/heat-config-cfn-init/install.d/hook-cfn-init.py | ader1990/heat-templates | 47d4b403af5b557b3885556b75c903d504f9354d | [
"Apache-2.0"
] | 1 | 2017-09-27T18:19:21.000Z | 2017-09-27T18:19:21.000Z | hot/software-config/elements/heat-config-cfn-init/install.d/hook-cfn-init.py | abettadapur/heat-templates | c9b682f1eff9b1ecf8de08af7760e5ed7c070adb | [
"Apache-2.0"
] | null | null | null | hot/software-config/elements/heat-config-cfn-init/install.d/hook-cfn-init.py | abettadapur/heat-templates | c9b682f1eff9b1ecf8de08af7760e5ed7c070adb | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import sys
if __name__ == '__main__':
sys.exit(main(sys.argv))
| 22.904762 | 48 | 0.677755 | #!/usr/bin/env python
from heat_cfntools.cfntools import cfn_helper
import json
import sys
def main(argv=sys.argv):
c = json.load(sys.stdin)
config = c.get('config', {})
if not isinstance(config, dict):
config = json.loads(config)
meta = {'AWS::CloudFormation::Init': config}
metadata = c... | 0 | 0 | 0 | 0 | 0 | 309 | 0 | 14 | 67 |
6f31fe2d4e259ee5e5ee9297370fbb182351a229 | 17,536 | py | Python | tests/integration_tests/performance/test_network_tcp_throughput.py | Tobbeman/firecracker | b4376a9e5ab03d3754b6d3001972968251df4d8b | [
"Apache-2.0"
] | null | null | null | tests/integration_tests/performance/test_network_tcp_throughput.py | Tobbeman/firecracker | b4376a9e5ab03d3754b6d3001972968251df4d8b | [
"Apache-2.0"
] | null | null | null | tests/integration_tests/performance/test_network_tcp_throughput.py | Tobbeman/firecracker | b4376a9e5ab03d3754b6d3001972968251df4d8b | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests the network throughput of Firecracker uVMs."""
from framework.artifacts import DEFAULT_HOST_IP
from framework.statistics import core, criteria, types
from framework.utils import CpuMap
import integr... | 41.752381 | 79 | 0.602304 | # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests the network throughput of Firecracker uVMs."""
import json
import logging
import time
import concurrent.futures
import pytest
from conftest import _test_images_s3_bucket
from framework.artifacts im... | 0 | 1,100 | 0 | 0 | 8,290 | 0 | 0 | 207 | 313 |
b3715c510b71bd30b076561c32affaf68f804c42 | 5,039 | py | Python | mfsetup/ic.py | aleaf/MFsetup | 85cc44eb767c595b19006e43587699be4771f818 | [
"CC0-1.0"
] | 21 | 2020-05-06T16:40:06.000Z | 2022-02-13T03:57:19.000Z | mfsetup/ic.py | aleaf/MFsetup | 85cc44eb767c595b19006e43587699be4771f818 | [
"CC0-1.0"
] | 39 | 2020-05-13T12:35:48.000Z | 2022-01-26T18:03:42.000Z | mfsetup/ic.py | aleaf/MFsetup | 85cc44eb767c595b19006e43587699be4771f818 | [
"CC0-1.0"
] | 12 | 2020-04-06T15:06:47.000Z | 2022-01-24T14:14:12.000Z | """
Functions for setting up starting heads
"""
| 43.817391 | 92 | 0.576305 | """
Functions for setting up starting heads
"""
import shutil
from mfsetup.fileio import save_array, setup_external_filepaths
from mfsetup.mf5to6 import get_variable_name, get_variable_package_name
from mfsetup.sourcedata import (
ArraySourceData,
MFArrayData,
MFBinaryArraySourceData,
get_source_data_f... | 0 | 0 | 0 | 0 | 0 | 4,638 | 0 | 218 | 134 |
0dbac0c2d70a9f50a7701c7330f2e30799e45748 | 1,259 | py | Python | blog.py | rserling/blogapi | ff26ff9503c78b1778ae65d8b30438d900bb205d | [
"Apache-2.0"
] | null | null | null | blog.py | rserling/blogapi | ff26ff9503c78b1778ae65d8b30438d900bb205d | [
"Apache-2.0"
] | null | null | null | blog.py | rserling/blogapi | ff26ff9503c78b1778ae65d8b30438d900bb205d | [
"Apache-2.0"
] | null | null | null | ####
## see EOF where you have to set the listening IP, that's the only edit
from flask import Flask, request, make_response
from flask_restful import Resource, Api
from flask_jsonpify import jsonify
from json import dumps
from sqlalchemy import create_engine
# post_id
# title
# body
db_connect = create_engine('sqli... | 26.787234 | 86 | 0.69579 | ####
## see EOF where you have to set the listening IP, that's the only edit
from flask import Flask, request, make_response
from flask_restful import Resource, Api
from flask_jsonpify import jsonify
from json import dumps
from sqlalchemy import create_engine
# post_id
# title
# body
db_connect = create_engine('sqli... | 0 | 83 | 0 | 445 | 0 | 0 | 0 | 0 | 69 |
40a7ede8a018d55657337243bc47b0c601e47bff | 2,703 | py | Python | 2.show_conv1bn_pic.py | Tcloser/resnet_conv_show | b4d0e67a41888cb8fe513087d968f99cdecf1a64 | [
"MIT"
] | 1 | 2019-07-30T05:27:57.000Z | 2019-07-30T05:27:57.000Z | 2.show_conv1bn_pic.py | Tcloser/resnet_conv_show | b4d0e67a41888cb8fe513087d968f99cdecf1a64 | [
"MIT"
] | null | null | null | 2.show_conv1bn_pic.py | Tcloser/resnet_conv_show | b4d0e67a41888cb8fe513087d968f99cdecf1a64 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torchvision.transforms as transforms
if __name__ == '__main__':
unloader = transforms.ToPILImage()
device = torch.device('cuda:0')
main() | 35.565789 | 120 | 0.572697 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
import torchvision.transforms as transforms
import cv2
import numpy as np
from PIL import Image
from matplotlib import pyplot as plt
class resnet():
def __init__(self, inplanes, planes, kernel_size,stride=1,padding=1):
sel... | 126 | 0 | 0 | 825 | 0 | 1,435 | 0 | 8 | 200 |
b5164d931aebc0c2c26ea7e2fb6a9aeb49f33b51 | 1,877 | py | Python | cnn.py | loop333/ha_web_server_example | 4327f356e9c3477f10c311a29ffa368d69241c47 | [
"MIT"
] | 1 | 2020-11-24T06:26:33.000Z | 2020-11-24T06:26:33.000Z | cnn.py | loop333/ha_web_server_example | 4327f356e9c3477f10c311a29ffa368d69241c47 | [
"MIT"
] | null | null | null | cnn.py | loop333/ha_web_server_example | 4327f356e9c3477f10c311a29ffa368d69241c47 | [
"MIT"
] | null | null | null | import logging
_LOGGER = logging.getLogger(__name__)
| 34.127273 | 79 | 0.478956 | import logging
import urllib.request
import xml.etree.ElementTree as ET
import re
from . import HTMLView
import homeassistant.core as ha
_LOGGER = logging.getLogger(__name__)
class cnn(HTMLView):
url = '/my_api/news/cnn/{path:.*}'
name = 'my_api:news_cnn'
requires_auth = False
@ha.callback
def ... | 0 | 1,556 | 0 | 120 | 0 | 0 | 0 | 12 | 135 |
8d0ea1fc6385f18441014c4f433e3f19413d5ef7 | 63 | py | Python | datahub/omis/payment/__init__.py | Staberinde/data-hub-api | 3d0467dbceaf62a47158eea412a3dba827073300 | [
"MIT"
] | 6 | 2019-12-02T16:11:24.000Z | 2022-03-18T10:02:02.000Z | datahub/omis/payment/__init__.py | Staberinde/data-hub-api | 3d0467dbceaf62a47158eea412a3dba827073300 | [
"MIT"
] | 1,696 | 2019-10-31T14:08:37.000Z | 2022-03-29T12:35:57.000Z | datahub/omis/payment/__init__.py | Staberinde/data-hub-api | 3d0467dbceaf62a47158eea412a3dba827073300 | [
"MIT"
] | 9 | 2019-11-22T12:42:03.000Z | 2021-09-03T14:25:05.000Z | default_app_config = 'datahub.omis.payment.apps.PaymentConfig'
| 31.5 | 62 | 0.84127 | default_app_config = 'datahub.omis.payment.apps.PaymentConfig'
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4d5f9943269cd8039084ce660955ac1c487d0dc9 | 326 | py | Python | Utuputki/manager/urls.py | katajakasa/utuputki | e20cc950b59c66a0279a05fd6362c2985af4a022 | [
"MIT"
] | 2 | 2015-04-28T08:04:28.000Z | 2016-04-16T22:34:36.000Z | Utuputki/manager/urls.py | katajakasa/utuputki | e20cc950b59c66a0279a05fd6362c2985af4a022 | [
"MIT"
] | 12 | 2015-02-11T17:08:13.000Z | 2015-02-20T22:39:20.000Z | Utuputki/manager/urls.py | katajakasa/utuputki | e20cc950b59c66a0279a05fd6362c2985af4a022 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.conf.urls import patterns, url
urlpatterns = patterns(
'Utuputki.manager.views',
url(r'^$', 'index', name="index"),
url(r'^linklist/$', 'linklist', name="linklist"),
url(r'^reqskip/$', 'request_skip', name="reqskip"),
url(r'^getdata/$', 'get_data', name="getdata... | 27.166667 | 55 | 0.607362 | # -*- coding: utf-8 -*-
from django.conf.urls import patterns, url
urlpatterns = patterns(
'Utuputki.manager.views',
url(r'^$', 'index', name="index"),
url(r'^linklist/$', 'linklist', name="linklist"),
url(r'^reqskip/$', 'request_skip', name="reqskip"),
url(r'^getdata/$', 'get_data', name="getdata... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6b76a40f910ad81a0d43315e4b598b00dfe30784 | 1,972 | py | Python | videoLooper.py | barrulik/video-looper | e9b3d2ae38d639b9b08891fdadf7687cb5b6db68 | [
"Apache-2.0"
] | null | null | null | videoLooper.py | barrulik/video-looper | e9b3d2ae38d639b9b08891fdadf7687cb5b6db68 | [
"Apache-2.0"
] | null | null | null | videoLooper.py | barrulik/video-looper | e9b3d2ae38d639b9b08891fdadf7687cb5b6db68 | [
"Apache-2.0"
] | null | null | null | # Python program to play a video
# in reverse mode using opencv
# import cv2 library
import cv2
import os
import shutil
if os.path.isdir("images"):
shutil.rmtree("images")
os.mkdir("images")
fileName = input("type the file path: ")
# videoCapture method of cv2 return video object
# Pass absolute address of video fil... | 22.930233 | 112 | 0.727688 | # Python program to play a video
# in reverse mode using opencv
# import cv2 library
import cv2
import os
import shutil
if os.path.isdir("images"):
shutil.rmtree("images")
os.mkdir("images")
fileName = input("type the file path: ")
# videoCapture method of cv2 return video object
# Pass absolute address of video fil... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5f013d7157104d5ee7d0a4a18aa044f7d675251a | 275 | py | Python | testes e exercícios/URI/URI_PositivosMedia.py | LightSnow17/exercicios-Python | 3ac016ce284860f45d71cfb396d33a73ec06c25d | [
"MIT"
] | null | null | null | testes e exercícios/URI/URI_PositivosMedia.py | LightSnow17/exercicios-Python | 3ac016ce284860f45d71cfb396d33a73ec06c25d | [
"MIT"
] | null | null | null | testes e exercícios/URI/URI_PositivosMedia.py | LightSnow17/exercicios-Python | 3ac016ce284860f45d71cfb396d33a73ec06c25d | [
"MIT"
] | null | null | null | # Variaveis
i = 1
# Definir o vetor no escopo
lista = []
a = 0
while i <= 6:
lista.append(float(input()))
if(lista[i] > 0):
a += 1
i += 1
pass
print ('Os valores foram: ')
j = 0
num_Cont = len(a)
while j < num_Cont:
print(a)
j += 1
pass | 13.095238 | 32 | 0.52 | # Variaveis
i = 1
# Definir o vetor no escopo
lista = []
a = 0
while i <= 6:
lista.append(float(input()))
if(lista[i] > 0):
a += 1
i += 1
pass
print ('Os valores foram: ')
j = 0
num_Cont = len(a)
while j < num_Cont:
print(a)
j += 1
pass | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
80cf66be167904a4b8f24d650b2ddbed60d794d5 | 1,754 | py | Python | tests/integration/test_client.py | Global19-atlassian-net/python2 | 35e998bdf4a2a9f9852d5fcc841ff29218aea3cf | [
"MIT"
] | 1 | 2017-02-13T18:26:24.000Z | 2017-02-13T18:26:24.000Z | tests/integration/test_client.py | Global19-atlassian-net/python2 | 35e998bdf4a2a9f9852d5fcc841ff29218aea3cf | [
"MIT"
] | null | null | null | tests/integration/test_client.py | Global19-atlassian-net/python2 | 35e998bdf4a2a9f9852d5fcc841ff29218aea3cf | [
"MIT"
] | 2 | 2020-07-31T16:36:25.000Z | 2020-07-31T16:36:32.000Z |
def test_unique_proxy_objects(py2):
"""
Test that identical Python 2 objects are represented by the same
`Py2Object` object.
"""
f = py2.eval("lambda x: (x, x)")
o1, o2 = f(py2.object())._
assert o1 is o2
p = py2.object()
assert p is not o1
def test_projected_identity(py2):
... | 23.702703 | 78 | 0.647092 | import weakref
import pytest
from python2.client import Py2Error, Py2Object
def test_exception(py2, helpers):
with pytest.raises(Py2Error) as einfo:
py2.int("asdf")
py2.ping() # Make sure session is still working
assert hasattr(einfo.value, 'exception')
py2_exc = einfo.value.exception
... | 0 | 0 | 0 | 0 | 0 | 805 | 0 | 10 | 114 |
4ec1eeb21a3fa678f8fa38d7586c01a00f767477 | 1,030 | py | Python | read_name.py | wangyuechina/LFNet-light-field-saliency-net | 59e4f52ac03f049a56009785a4afe2980cf7dd79 | [
"MIT"
] | 11 | 2019-11-03T10:35:59.000Z | 2022-03-23T07:55:02.000Z | read_name.py | wangyuechina/LFNet-light-field-saliency-net | 59e4f52ac03f049a56009785a4afe2980cf7dd79 | [
"MIT"
] | 2 | 2020-10-07T19:54:35.000Z | 2021-06-04T19:52:57.000Z | read_name.py | wangyuechina/LFNet-light-field-saliency-net | 59e4f52ac03f049a56009785a4afe2980cf7dd79 | [
"MIT"
] | 7 | 2019-10-08T04:45:35.000Z | 2021-08-23T17:00:24.000Z | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 27 20:57:14 2018
@author: dhubel
"""
Test()
| 29.428571 | 91 | 0.592233 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 27 20:57:14 2018
@author: dhubel
"""
import os
def ListFilesToTxt(dir,file,wildcard,recursion):
exts = wildcard.split(" ")
files = os.listdir(dir)
files.sort()
for name in files:
fullname=os.path.join(dir,name)
if(... | 0 | 0 | 0 | 0 | 0 | 856 | 0 | -12 | 71 |
d4004f4ab02da4df3d9c2e344fda6c76224a36a4 | 323 | py | Python | easy_workflow_manager/scripts/tag_release.py | kenjyco/easy-workflow-manager | 7c4a193feea007e1638a98ca6466361232774fa5 | [
"MIT"
] | null | null | null | easy_workflow_manager/scripts/tag_release.py | kenjyco/easy-workflow-manager | 7c4a193feea007e1638a98ca6466361232774fa5 | [
"MIT"
] | null | null | null | easy_workflow_manager/scripts/tag_release.py | kenjyco/easy-workflow-manager | 7c4a193feea007e1638a98ca6466361232774fa5 | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
main()
| 19 | 63 | 0.702786 | import click
import input_helper as ih
import easy_workflow_manager as ewm
from pprint import pprint
@click.command()
def main():
"""Select a recent remote commit on SOURCE_BRANCH to tag"""
success = ewm.tag_release()
if success:
print('\nSuccessfully tagged')
if __name__ == '__main__':
main... | 0 | 158 | 0 | 0 | 0 | 0 | 0 | 13 | 111 |
701aa172ab14b97d87125d1f5d3e2c1ee2afb364 | 351 | py | Python | importance_sampling/layers/__init__.py | lisy14liz/importance-sampling | 15040a3c4435735e9b0155d3d0228909bd4e47b7 | [
"MIT"
] | 289 | 2017-08-03T17:30:12.000Z | 2022-03-30T12:04:21.000Z | importance_sampling/layers/__init__.py | lisy14liz/importance-sampling | 15040a3c4435735e9b0155d3d0228909bd4e47b7 | [
"MIT"
] | 34 | 2017-08-03T21:47:49.000Z | 2021-06-16T17:59:45.000Z | importance_sampling/layers/__init__.py | lisy14liz/importance-sampling | 15040a3c4435735e9b0155d3d0228909bd4e47b7 | [
"MIT"
] | 58 | 2017-08-06T01:10:24.000Z | 2022-03-07T00:30:24.000Z | #
# Copyright (c) 2017 Idiap Research Institute, http://www.idiap.ch/
# Written by Angelos Katharopoulos <angelos.katharopoulos@idiap.ch>
#
| 35.1 | 70 | 0.811966 | #
# Copyright (c) 2017 Idiap Research Institute, http://www.idiap.ch/
# Written by Angelos Katharopoulos <angelos.katharopoulos@idiap.ch>
#
from .metrics import MetricLayer, TripletLossLayer
from .normalization import BatchRenormalization, LayerNormalization, \
StatsBatchNorm, GroupNormalization
from .scores impor... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 144 | 67 |
e93c527510ecc850db72f0beb3b35957e8d41695 | 2,899 | py | Python | figshare/oauth_dance.py | rmcgibbo/figshare | 6c61bb0cd59b9a3c79722bfe2ef21edcf8ff1ed1 | [
"MIT"
] | 10 | 2016-07-06T10:45:09.000Z | 2020-06-23T15:47:24.000Z | figshare/oauth_dance.py | rmcgibbo/figshare | 6c61bb0cd59b9a3c79722bfe2ef21edcf8ff1ed1 | [
"MIT"
] | null | null | null | figshare/oauth_dance.py | rmcgibbo/figshare | 6c61bb0cd59b9a3c79722bfe2ef21edcf8ff1ed1 | [
"MIT"
] | 4 | 2017-07-02T14:56:54.000Z | 2022-02-03T13:56:29.000Z | # This code was adapted from Python Twitter Tools (MIT license)
# https://github.com/sixohsix/twitter/blob/master/twitter/oauth_dance.py
# Authors: Mike Verdone, Robert T. McGibbon
from __future__ import print_function
import os
import time
import webbrowser
from requests_oauthlib import OAuth1Session
try:
_input... | 34.511905 | 130 | 0.699207 | # This code was adapted from Python Twitter Tools (MIT license)
# https://github.com/sixohsix/twitter/blob/master/twitter/oauth_dance.py
# Authors: Mike Verdone, Robert T. McGibbon
from __future__ import print_function
import os
import time
import webbrowser
from requests_oauthlib import OAuth1Session
try:
_input... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b887eacfdd6f00b42a3648077ad6adc8c3d65cef | 9,760 | py | Python | web/run.py | alvinwan/motiosecure | bc71c36e7aa6f35eb57a34e54093f056f150726d | [
"Apache-2.0"
] | 4 | 2019-05-05T08:13:02.000Z | 2020-07-22T13:10:57.000Z | web/run.py | alvinwan/motiosecure | bc71c36e7aa6f35eb57a34e54093f056f150726d | [
"Apache-2.0"
] | null | null | null | web/run.py | alvinwan/motiosecure | bc71c36e7aa6f35eb57a34e54093f056f150726d | [
"Apache-2.0"
] | null | null | null | from apns import APNs
from apns import Payload
from flask import render_template as flask_render_template
from flask import Flask
import cv2
import time
import threading
import websockets
import asyncio
import random
import os
app = Flask(__name__)
motion_detected = False
__safety_key = random.getrandbits(128)
__use... | 31.082803 | 117 | 0.647234 | from apns import APNs
from apns import Frame
from apns import Payload
from flask import request
from flask import abort
from flask import render_template as flask_render_template
from subprocess import call
from flask import Flask
from flask import url_for
from flask import redirect
from sklearn.decomposition import Tr... | 0 | 2,222 | 525 | 3,874 | 0 | 0 | 0 | 19 | 516 |
90165396bba02525383f22461df552f7e9cdc127 | 8,901 | py | Python | cinder/tests/unit/policies/test_volume_access.py | arunvinodqmco/cinder | 62cb72c6890e458427ba0601646b186b7b36dc01 | [
"Apache-2.0"
] | 571 | 2015-01-01T17:47:26.000Z | 2022-03-23T07:46:36.000Z | cinder/tests/unit/policies/test_volume_access.py | arunvinodqmco/cinder | 62cb72c6890e458427ba0601646b186b7b36dc01 | [
"Apache-2.0"
] | 37 | 2015-01-22T23:27:04.000Z | 2021-02-05T16:38:48.000Z | cinder/tests/unit/policies/test_volume_access.py | arunvinodqmco/cinder | 62cb72c6890e458427ba0601646b186b7b36dc01 | [
"Apache-2.0"
] | 841 | 2015-01-04T17:17:11.000Z | 2022-03-31T12:06:51.000Z | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | 36.036437 | 78 | 0.604314 | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | 0 | 5,871 | 0 | 1,536 | 0 | 0 | 0 | 198 | 337 |
3b534bcfcb377052d7eebaee3e2b5d3c189b784e | 982 | py | Python | setup.py | edflow/hiker | e04b9ca27e7ce466b28dff7b1e8cc6713ff9dde6 | [
"MIT"
] | null | null | null | setup.py | edflow/hiker | e04b9ca27e7ce466b28dff7b1e8cc6713ff9dde6 | [
"MIT"
] | null | null | null | setup.py | edflow/hiker | e04b9ca27e7ce466b28dff7b1e8cc6713ff9dde6 | [
"MIT"
] | null | null | null | import os
from setuptools import setup, find_packages
def clean():
"""Custom clean command to tidy up the project root."""
if "posix" in os.name:
os.system("rm -vrf ./build ./dist ./*.pyc ./*.tgz ./*.egg-info ./*__pycache__/")
elif "nt" == os.name:
# possible to-do: also remove directories... | 27.277778 | 88 | 0.598778 | import os
from setuptools import setup, find_packages
def clean():
"""Custom clean command to tidy up the project root."""
if "posix" in os.name:
os.system("rm -vrf ./build ./dist ./*.pyc ./*.tgz ./*.egg-info ./*__pycache__/")
elif "nt" == os.name:
# possible to-do: also remove directories... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
79594d01fd1e15203d722f03169d7ffc40654904 | 24,469 | py | Python | workitem.py | gocept/alphaflow | 4b797cb12fb52254b1884159fd9a8b899c739f7c | [
"ZPL-2.1",
"ZPL-2.0"
] | null | null | null | workitem.py | gocept/alphaflow | 4b797cb12fb52254b1884159fd9a8b899c739f7c | [
"ZPL-2.1",
"ZPL-2.0"
] | null | null | null | workitem.py | gocept/alphaflow | 4b797cb12fb52254b1884159fd9a8b899c739f7c | [
"ZPL-2.1",
"ZPL-2.0"
] | 1 | 2021-11-01T07:58:18.000Z | 2021-11-01T07:58:18.000Z | # Copyright (c) 2004-2006 gocept gmbh & co. kg
# See also LICENSE.txt
# $Id$
"""Work item base classes"""
import zope.interface
import zope.component
from Globals import InitializeClass
InitializeClass(BaseWorkItem)
InitializeClass(BaseAssignableWorkItem)
InitializeClass(BaseAutomaticWorkItem)
##########... | 34.270308 | 83 | 0.643958 | # Copyright (c) 2004-2006 gocept gmbh & co. kg
# See also LICENSE.txt
# $Id$
"""Work item base classes"""
import DateTime
import persistent.list
import zope.interface
import zope.component
from AccessControl import ClassSecurityInfo, getSecurityManager
from Globals import InitializeClass
import zope.app.annotation.int... | 0 | 1,845 | 0 | 20,544 | 0 | 630 | 0 | 586 | 519 |
92be9fce8e2d3402ce08cfc8b8841dab0e8456e7 | 248 | py | Python | catalog/bindings/wfs/property.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | catalog/bindings/wfs/property.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | catalog/bindings/wfs/property.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null |
__NAMESPACE__ = "http://www.opengis.net/wfs/2.0"
| 22.545455 | 52 | 0.745968 | from dataclasses import dataclass
from bindings.wfs.property_type import PropertyType
__NAMESPACE__ = "http://www.opengis.net/wfs/2.0"
@dataclass
class Property(PropertyType):
class Meta:
namespace = "http://www.opengis.net/wfs/2.0"
| 0 | 88 | 0 | 0 | 0 | 0 | 0 | 42 | 67 |
923be82983df685c80b4399d2cd561be53787c21 | 1,027 | py | Python | sim/vec.py | oak-bay/sim | 8969e85bcbf81ba7410ce1af7b328965534ca672 | [
"MIT"
] | null | null | null | sim/vec.py | oak-bay/sim | 8969e85bcbf81ba7410ce1af7b328965534ca672 | [
"MIT"
] | null | null | null | sim/vec.py | oak-bay/sim | 8969e85bcbf81ba7410ce1af7b328965534ca672 | [
"MIT"
] | null | null | null | import numpy as np
import math
def dim(v) -> int:
""" . """
return len(v)
def vec(val):
""" . """
return np.array(val, dtype=np.float)
def dist(pos0, pos1=None) -> float:
""" . """
pos = (vec(pos0) - vec(pos1)) if pos1 is not None else vec(pos0)
return np.linalg.norm(pos)
def unit(v)... | 18.339286 | 68 | 0.519961 | import numpy as np
import math
def dim(v) -> int:
""" 获取向量维度. """
return len(v)
def vec(val):
""" 数值向量化. """
return np.array(val, dtype=np.float)
def dist(pos0, pos1=None) -> float:
""" 计算向量距离(模). """
pos = (vec(pos0) - vec(pos1)) if pos1 is not None else vec(pos0)
return np.linalg.nor... | 189 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b9a8af06ece5a1d9feb8c7f08ec3f8104e40d580 | 3,985 | py | Python | lino_book/projects/noi1e/tests/test_workflow.py | lino-framework/lino_book | 4eab916832cd8f48ff1b9fc8c2789f0b437da0f8 | [
"BSD-2-Clause"
] | 3 | 2016-08-25T05:58:09.000Z | 2019-12-05T11:13:45.000Z | lino_book/projects/noi1e/tests/test_workflow.py | lino-framework/lino_book | 4eab916832cd8f48ff1b9fc8c2789f0b437da0f8 | [
"BSD-2-Clause"
] | 18 | 2016-11-12T21:38:58.000Z | 2019-12-03T17:54:38.000Z | lino_book/projects/noi1e/tests/test_workflow.py | lino-framework/lino_book | 4eab916832cd8f48ff1b9fc8c2789f0b437da0f8 | [
"BSD-2-Clause"
] | 9 | 2016-10-15T11:12:33.000Z | 2021-09-22T04:37:37.000Z | # -*- coding: utf-8 -*-
# Copyright 2016-2018 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
"""Runs some tests about ticket and vote workflow.
You can run only these tests by issuing::
$ go team
$ python manage.py test tests.test_workflow
"""
from __future__ import unicode_literals
from __future... | 34.059829 | 68 | 0.598745 | # -*- coding: utf-8 -*-
# Copyright 2016-2018 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
"""Runs some tests about ticket and vote workflow.
You can run only these tests by issuing::
$ go team
$ python manage.py test tests.test_workflow
"""
from __future__ import unicode_literals
from __future... | 0 | 0 | 0 | 3,378 | 0 | 0 | 0 | 112 | 135 |
ac2ee55a7e1d816960f338ac54158f5dbd56f811 | 3,743 | py | Python | my_memory_card.py | tima13343/algorit | 8bcb67d7d4356038945e0b2c2d39372ece0f0ac1 | [
"CC0-1.0"
] | null | null | null | my_memory_card.py | tima13343/algorit | 8bcb67d7d4356038945e0b2c2d39372ece0f0ac1 | [
"CC0-1.0"
] | null | null | null | my_memory_card.py | tima13343/algorit | 8bcb67d7d4356038945e0b2c2d39372ece0f0ac1 | [
"CC0-1.0"
] | null | null | null | #
#
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QLabel, QVBoxLayout, QRadioButton, QHBoxLayout, QGroupBox, QPushButton, QButtonGroup
question_list = []
question_list.append(Question(' ?','','','',''))
question_list.append(Question(' ?','','','',''))
question_li... | 25.290541 | 154 | 0.738712 | #создай приложение для запоминания информации
#подключение библиотек
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication,QWidget,QPushButton,QLabel,QVBoxLayout,QRadioButton,QMessageBox,QHBoxLayout, QGroupBox, QPushButton, QButtonGroup
from random import shuffle, randint
class Question():
def __ini... | 926 | 0 | 0 | 229 | 0 | 794 | 0 | 20 | 183 |
d961d77141fbfd7d44ff4afe4cd1d7d15f2648ed | 2,107 | py | Python | test/e2e/policies.test-suite/podpools/n4c16/py_consts.var.py | huangrui666/cri-resource-manager | f17bfb48449da0ac5c1211dd2d076b1a43d687d0 | [
"Apache-2.0"
] | 84 | 2019-08-09T08:08:36.000Z | 2022-03-19T05:20:38.000Z | test/e2e/policies.test-suite/podpools/n4c16/py_consts.var.py | huangrui666/cri-resource-manager | f17bfb48449da0ac5c1211dd2d076b1a43d687d0 | [
"Apache-2.0"
] | 647 | 2019-08-30T18:37:55.000Z | 2022-03-30T13:42:40.000Z | test/e2e/policies.test-suite/podpools/n4c16/py_consts.var.py | huangrui666/cri-resource-manager | f17bfb48449da0ac5c1211dd2d076b1a43d687d0 | [
"Apache-2.0"
] | 35 | 2019-08-26T18:30:33.000Z | 2022-03-22T02:16:04.000Z | # This file captures expected CPU allocator behavior when the podpools
# policy is started with the test default cri-resmgr configuration on
# n4c16 topology.
# cri-resmgr output on constructed pools.
expected_podpools_output = """
podpools policy pools:
- pool 0: reserved[0]{cpus:15, mems:3, pods:0/0, containers:0}
-... | 40.519231 | 118 | 0.657807 | # This file captures expected CPU allocator behavior when the podpools
# policy is started with the test default cri-resmgr configuration on
# n4c16 topology.
# cri-resmgr output on constructed pools.
expected_podpools_output = """
podpools policy pools:
- pool 0: reserved[0]{cpus:15, mems:3, pods:0/0, containers:0}
-... | 0 | 0 | 0 | 52 | 0 | 629 | 0 | 0 | 46 |
8f95ef05b253e5a40aa9fd3025a844632c83e192 | 280 | py | Python | bhr_client/run.py | solidgoldbomb/bhr-client | ee608fa195def3600ec334517db21696b920c603 | [
"NCSA"
] | null | null | null | bhr_client/run.py | solidgoldbomb/bhr-client | ee608fa195def3600ec334517db21696b920c603 | [
"NCSA"
] | null | null | null | bhr_client/run.py | solidgoldbomb/bhr-client | ee608fa195def3600ec334517db21696b920c603 | [
"NCSA"
] | null | null | null |
if __name__ == "__main__":
main()
| 23.333333 | 69 | 0.732143 | from bhr_client.rest import login_from_env
from bhr_client.block_manager import BlockManager, DummyStdoutBlocker
def main():
client = login_from_env()
blocker = DummyStdoutBlocker()
m = BlockManager(client, blocker)
m.run()
if __name__ == "__main__":
main()
| 0 | 0 | 0 | 0 | 0 | 105 | 0 | 69 | 67 |
ddfecdaa668bbe7c0a07f3bc0f22caa7891cc3d7 | 85 | wsgi | Python | radar.wsgi | karthikv792/PlanningAssistance | 5693c844e9067591ea1414ee9586bcd2dfff6f51 | [
"MIT"
] | 4 | 2019-04-23T10:41:35.000Z | 2019-10-27T05:14:42.000Z | radar.wsgi | karthikv792/PlanningAssistance | 5693c844e9067591ea1414ee9586bcd2dfff6f51 | [
"MIT"
] | null | null | null | radar.wsgi | karthikv792/PlanningAssistance | 5693c844e9067591ea1414ee9586bcd2dfff6f51 | [
"MIT"
] | 4 | 2018-01-16T00:00:22.000Z | 2019-11-01T23:35:01.000Z | import sys
sys.path.insert(0, '/var/www/radar')
| 21.25 | 36 | 0.764706 | import sys
sys.path.insert(0, '/var/www/radar')
from radar import app as application
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 15 | 22 |
a6f38c05272f5bee4378551cdf5b7843490b457c | 2,246 | py | Python | app/django/apps/print3d/views.py | aoirint/Mnemosyne | 1b08aa827e4b74c24ec24887bce4bd0b50ce7b64 | [
"MIT"
] | null | null | null | app/django/apps/print3d/views.py | aoirint/Mnemosyne | 1b08aa827e4b74c24ec24887bce4bd0b50ce7b64 | [
"MIT"
] | 2 | 2020-11-12T17:12:18.000Z | 2020-11-12T17:12:18.000Z | app/django/apps/print3d/views.py | aoirint/Mnemosyne | 1b08aa827e4b74c24ec24887bce4bd0b50ce7b64 | [
"MIT"
] | null | null | null |
# Create your views here.
| 29.168831 | 61 | 0.622885 | import json
from django.http import HttpResponse
from django.shortcuts import render, redirect
from django.db import transaction
from print3d.forms import *
from filament.models import *
from print3d.models import *
# Create your views here.
def index(request):
if request.method == 'POST':
p... | 75 | 0 | 0 | 0 | 0 | 1,867 | 0 | 62 | 263 |
6b829e6551c63b3e12900a0ed8bddb8e494a2592 | 9,211 | py | Python | back_end/tests/get_routes/test_api_get_embedding_interva_data_features.py | gerlichlab/HiCognition | dff022025b7c83732b9510ff5ca8232d30aa5304 | [
"MIT"
] | null | null | null | back_end/tests/get_routes/test_api_get_embedding_interva_data_features.py | gerlichlab/HiCognition | dff022025b7c83732b9510ff5ca8232d30aa5304 | [
"MIT"
] | 5 | 2022-03-31T11:54:12.000Z | 2022-03-31T12:04:29.000Z | back_end/tests/get_routes/test_api_get_embedding_interva_data_features.py | gerlichlab/HiCognition | dff022025b7c83732b9510ff5ca8232d30aa5304 | [
"MIT"
] | null | null | null | """Tests for get route of features associated with embedding interval data."""
import unittest
# add path to import app
# import sys
# sys.path.append("./")
if __name__ == "__main__":
res = unittest.main(verbosity=3, exit=False)
| 38.061983 | 91 | 0.605906 | """Tests for get route of features associated with embedding interval data."""
import os
import gzip
import json
import unittest
from unittest.mock import patch
import numpy as np
from hicognition.test_helpers import LoginTestCase, TempDirTestCase
# add path to import app
# import sys
# sys.path.append("./")
from app ... | 0 | 0 | 0 | 8,702 | 0 | 0 | 0 | 73 | 199 |
9d75f6db294d268b5cb7a9ad1dcb8ca7f7f24895 | 457 | py | Python | setup.py | ReneTC/sgraphics | 32ef7b257576843043f39e1e438e98a108a631f4 | [
"MIT"
] | null | null | null | setup.py | ReneTC/sgraphics | 32ef7b257576843043f39e1e438e98a108a631f4 | [
"MIT"
] | 1 | 2021-09-04T09:00:15.000Z | 2021-09-04T17:01:35.000Z | setup.py | ReneTC/sgraphics | 32ef7b257576843043f39e1e438e98a108a631f4 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name = "sgraphic",
version = "0.1.2",
author = "Rene Czepluch Thomsen",
author_email = "sepluk1@gmail.com",
description = ("Fast and simple graphics. "),
url="https://github.com/ReneTC/Simple-graphics",
license = "BSD",
keywords = "graphics package 2d... | 20.772727 | 52 | 0.619256 | from setuptools import setup
setup(
name = "sgraphic",
version = "0.1.2",
author = "Rene Czepluch Thomsen",
author_email = "sepluk1@gmail.com",
description = ("Fast and simple graphics. "),
url="https://github.com/ReneTC/Simple-graphics",
license = "BSD",
keywords = "graphics package 2d... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9173c6d51ecab7648ce105021df857f01f31df81 | 59,817 | py | Python | modules/AIController/backend/middleware.py | junxnone/aerial_wildlife_detection | 0eebed2aaf926ceb212b6a2b7a75bb0a82b28a88 | [
"MIT"
] | null | null | null | modules/AIController/backend/middleware.py | junxnone/aerial_wildlife_detection | 0eebed2aaf926ceb212b6a2b7a75bb0a82b28a88 | [
"MIT"
] | null | null | null | modules/AIController/backend/middleware.py | junxnone/aerial_wildlife_detection | 0eebed2aaf926ceb212b6a2b7a75bb0a82b28a88 | [
"MIT"
] | null | null | null | '''
Middleware for AIController: handles requests and updates to and from the database.
2019-20 Benjamin Kellenberger
'''
| 46.048499 | 186 | 0.557467 | '''
Middleware for AIController: handles requests and updates to and from the database.
2019-20 Benjamin Kellenberger
'''
from datetime import datetime
import uuid
import re
import json
from constants.annotationTypes import ANNOTATION_TYPES
from ai import PREDICTION_MODELS, ALCRITERION_MODELS
from modules.AIC... | 0 | 0 | 0 | 58,743 | 0 | 0 | 0 | 456 | 487 |
d18e6a78eb355c7e09f2598bd265f8c301656f48 | 2,333 | py | Python | src/chord/helpers.py | melzareix/chord-dht | e7956e41f1200cb2ddc183d186eb16da3f106b68 | [
"MIT"
] | null | null | null | src/chord/helpers.py | melzareix/chord-dht | e7956e41f1200cb2ddc183d186eb16da3f106b68 | [
"MIT"
] | null | null | null | src/chord/helpers.py | melzareix/chord-dht | e7956e41f1200cb2ddc183d186eb16da3f106b68 | [
"MIT"
] | null | null | null | import hashlib
from typing import Union
from config.config import dht_config
def generate_id(key: Union[bytes, str]) -> str:
"""Generate id for key or node on the ring.
Args:
key (string): Key or node-ip to hash
Returns:
string: the first m bits from the key hash.
"""
_ke... | 31.527027 | 97 | 0.595371 | import hashlib
from typing import Union
from config.config import dht_config
def generate_id(key: Union[bytes, str]) -> str:
"""Generate id for key or node on the ring.
Args:
key (string): Key or node-ip to hash
Returns:
string: the first m bits from the key hash.
"""
_ke... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3b1ce493fa6b2c943fa8c59c41e6cb2d1811a2ee | 4,787 | py | Python | src/datruf/find_units.py | yoshihikosuzuki/RepeatAssembly | a5629affd669c9c029058f6f1519205ea592d1f1 | [
"MIT"
] | 1 | 2020-01-30T13:50:05.000Z | 2020-01-30T13:50:05.000Z | src/datruf/find_units.py | yoshihikosuzuki/RepeatAssembly | a5629affd669c9c029058f6f1519205ea592d1f1 | [
"MIT"
] | null | null | null | src/datruf/find_units.py | yoshihikosuzuki/RepeatAssembly | a5629affd669c9c029058f6f1519205ea592d1f1 | [
"MIT"
] | null | null | null | from multiprocessing import Pool
import numpy as np
from interval import interval
from logzero import logger
from BITS.util.io import save_pickle
from BITS.util.interval import intvl_len, subtract_intvl
from .io import load_tr_reads, load_paths
from ..types import TRUnit
def find_units(start_dbid, end_dbid, n_core, d... | 43.126126 | 110 | 0.665553 | from multiprocessing import Pool
import numpy as np
from interval import interval
from logzero import logger
from BITS.util.io import save_pickle
from BITS.util.interval import intvl_len, subtract_intvl
from .io import load_tr_reads, load_paths
from ..types import TRUnit
def find_units(start_dbid, end_dbid, n_core, d... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2fb41badb7a51137dd06115d9c314aaf2e792b99 | 3,682 | py | Python | src/project/settings/default.py | jmaslanka/movie-db | fcee4b0a1fa6f4c7d4bdc02972dae473b916127e | [
"MIT"
] | null | null | null | src/project/settings/default.py | jmaslanka/movie-db | fcee4b0a1fa6f4c7d4bdc02972dae473b916127e | [
"MIT"
] | null | null | null | src/project/settings/default.py | jmaslanka/movie-db | fcee4b0a1fa6f4c7d4bdc02972dae473b916127e | [
"MIT"
] | null | null | null | import environ
from django.urls import reverse_lazy
# ---------- Basic settings ----------
env = environ.Env()
root = environ.Path(__file__) - 3
BASE_DIR = root()
SECRET_KEY = env('SECRET_KEY')
DEBUG = env.bool('DEBUG', default=False)
SITE_ID = env.int('SITE_ID', default=1)
ALLOWED_HOSTS = env.list('ALLOWED_HOSTS'... | 25.748252 | 99 | 0.654264 | import environ
from django.urls import reverse_lazy
# ---------- Basic settings ----------
env = environ.Env()
root = environ.Path(__file__) - 3
BASE_DIR = root()
SECRET_KEY = env('SECRET_KEY')
DEBUG = env.bool('DEBUG', default=False)
SITE_ID = env.int('SITE_ID', default=1)
ALLOWED_HOSTS = env.list('ALLOWED_HOSTS'... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
440194087440116498a8c088b1f6b7c33e2d2d53 | 12,135 | py | Python | tiktok_file_operations.py | ItsABlackScreen/ErrorChecking-tiktok-scraper | d7c17c9cdd731d32e6ffecdd261e039c99c5d381 | [
"MIT"
] | 4 | 2020-08-07T18:30:06.000Z | 2021-02-22T06:12:42.000Z | tiktok_file_operations.py | ItsABlackScreen/ErrorChecking-tiktok-scraper | d7c17c9cdd731d32e6ffecdd261e039c99c5d381 | [
"MIT"
] | null | null | null | tiktok_file_operations.py | ItsABlackScreen/ErrorChecking-tiktok-scraper | d7c17c9cdd731d32e6ffecdd261e039c99c5d381 | [
"MIT"
] | null | null | null | import argparse
if __name__ == "__main__":
my_parser = argparse.ArgumentParser(
fromfile_prefix_chars="+",
description="Error check titok-scraper for missing and empty files.",
)
mutual_exc = my_parser.add_mutually_exclusive_group()
my_parser.add_argument(
"file... | 38.52381 | 114 | 0.572971 | import os
import shutil
import json
import argparse
from pathlib import Path
class TikTokFiles:
"""A simple class to model various file operations on tiktok files."""
def __init__(self, args):
"""Initializing various attributes."""
self.start_folder = Path(args.filepath)
... | 0 | 0 | 0 | 10,133 | 0 | 0 | 0 | -27 | 117 |
f9cb681c5df423e1cce8c94a15a9016f3d43227e | 95,548 | py | Python | tests/conftest.py | karlchillmaid/notifications-admin | 9ef6da4ef9e2fa97b7debb4b573cb035a5cb8880 | [
"MIT"
] | null | null | null | tests/conftest.py | karlchillmaid/notifications-admin | 9ef6da4ef9e2fa97b7debb4b573cb035a5cb8880 | [
"MIT"
] | null | null | null | tests/conftest.py | karlchillmaid/notifications-admin | 9ef6da4ef9e2fa97b7debb4b573cb035a5cb8880 | [
"MIT"
] | null | null | null |
SERVICE_ONE_ID = "596364a0-858e-42c8-9062-a8fe822260eb"
SERVICE_TWO_ID = "147ad62a-2951-4fa1-9ca0-093cd1a52c52"
ORGANISATION_ID = "c011fa40-4cbe-4524-b415-dde2f421bd9c"
... | 31.617472 | 120 | 0.616245 | import json
import os
from contextlib import contextmanager
from datetime import date, datetime, timedelta
from unittest.mock import Mock
import pytest
from bs4 import BeautifulSoup
from flask import Flask, url_for
from notifications_python_client.errors import HTTPError
from notifications_utils.url_safe_token import ... | 12 | 89,465 | 0 | 0 | 0 | 144 | 0 | 459 | 5,096 |
82f17ca4a851990839c8aafe1e3db6dee38b6e5d | 1,180 | py | Python | som_example.py | xSakix/ml-learnig | d1a6178d77b195a7c179046b24f17df72544dc64 | [
"Apache-2.0"
] | null | null | null | som_example.py | xSakix/ml-learnig | d1a6178d77b195a7c179046b24f17df72544dc64 | [
"Apache-2.0"
] | null | null | null | som_example.py | xSakix/ml-learnig | d1a6178d77b195a7c179046b24f17df72544dc64 | [
"Apache-2.0"
] | null | null | null | # For plotting the images
from matplotlib import pyplot as plt
import numpy as np
from som import SOM
#source https://codesachin.wordpress.com/2015/11/28/self-organizing-maps-with-googles-tensorflow/
# Training inputs for RGBcolors
colors = np.array(
[[0., 0., 0.],
[0., 0., 1.],
[0., 0., 0.5],
[0.1... | 25.106383 | 97 | 0.562712 | # For plotting the images
from matplotlib import pyplot as plt
import numpy as np
from som import SOM
#source https://codesachin.wordpress.com/2015/11/28/self-organizing-maps-with-googles-tensorflow/
# Training inputs for RGBcolors
colors = np.array(
[[0., 0., 0.],
[0., 0., 1.],
[0., 0., 0.5],
[0.1... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
804d41c0055d9cb7c66f36ec7aff180058e7601f | 4,596 | py | Python | sdk/python/pulumi_google_native/firebasehosting/v1beta1/get_site.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 44 | 2021-04-18T23:00:48.000Z | 2022-02-14T17:43:15.000Z | sdk/python/pulumi_google_native/firebasehosting/v1beta1/get_site.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 354 | 2021-04-16T16:48:39.000Z | 2022-03-31T17:16:39.000Z | sdk/python/pulumi_google_native/firebasehosting/v1beta1/get_site.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 8 | 2021-04-24T17:46:51.000Z | 2022-01-05T10:40:21.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import pulumi
import pulumi.runtime
from typing import Optional
from ... import _utilities
__all__ = [
'GetSiteResult',
'AwaitableGetSiteResult... | 37.672131 | 563 | 0.654917 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
__... | 0 | 3,003 | 0 | 323 | 0 | 0 | 0 | 35 | 92 |
c6542b626f55d6787e0ad41d353a5844ec55f261 | 1,683 | py | Python | mridc/core/classes/module.py | jerke123/mridc | 7e22ac50f8df73f2305d61979da2a5d59874546e | [
"Apache-2.0"
] | null | null | null | mridc/core/classes/module.py | jerke123/mridc | 7e22ac50f8df73f2305d61979da2a5d59874546e | [
"Apache-2.0"
] | null | null | null | mridc/core/classes/module.py | jerke123/mridc | 7e22ac50f8df73f2305d61979da2a5d59874546e | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
__author__ = "Dimitrios Karkalousos"
# Taken and adapted from: https://github.com/NVIDIA/NeMo/blob/main/nemo/core/classes/module.py
__all__ = ["NeuralModule"]
| 28.05 | 114 | 0.648841 | # encoding: utf-8
__author__ = "Dimitrios Karkalousos"
# Taken and adapted from: https://github.com/NVIDIA/NeMo/blob/main/nemo/core/classes/module.py
from abc import ABC
from contextlib import contextmanager
from torch.nn import Module
__all__ = ["NeuralModule"]
from mridc.core.classes.common import FileIO, Seriali... | 0 | 748 | 0 | 576 | 0 | 0 | 0 | 66 | 113 |
7d71fd340e7a0630cd67298df5b087e478af6b2c | 498 | py | Python | apps/index/urls.py | tufbel/wFocus | ee0f02053b8a5bc9c40dd862306fc5df1a063b9d | [
"Apache-2.0"
] | null | null | null | apps/index/urls.py | tufbel/wFocus | ee0f02053b8a5bc9c40dd862306fc5df1a063b9d | [
"Apache-2.0"
] | 11 | 2020-06-06T01:51:51.000Z | 2022-02-10T14:31:21.000Z | apps/index/urls.py | tufbel/wFocus | ee0f02053b8a5bc9c40dd862306fc5df1a063b9d | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
"""
@File : urls
@Date : 2019/11/15
@Author : Regulus
@Contact : yusheng831143@gmail.com
@Desc : url
"""
from django.urls import path
from apps.index import views
app_name = 'app_index'
urlpatterns = [
path('', views.index, name='index'),
path('home', views.home, name='ho... | 19.92 | 57 | 0.636546 | # -*- encoding: utf-8 -*-
"""
@File : urls
@Date : 2019/11/15
@Author : Regulus
@Contact : yusheng831143@gmail.com
@Desc : 所有首页相关url映射。
"""
from django.urls import path
from apps.index import views
app_name = 'app_index'
urlpatterns = [
path('', views.index, name='index'),
path('home', views.home,... | 27 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a51dc19230ec15b9534a5a1282d2793542deafd9 | 636 | py | Python | pyclesperanto_prototype/_tier10/_touching_labels_to_networkx.py | elsandal/pyclesperanto_prototype | 7bda828813b86b44b63d73d5e8f466d9769cded1 | [
"BSD-3-Clause"
] | 2 | 2020-07-01T06:20:44.000Z | 2020-07-01T09:36:48.000Z | pyclesperanto_prototype/_tier10/_touching_labels_to_networkx.py | elsandal/pyclesperanto_prototype | 7bda828813b86b44b63d73d5e8f466d9769cded1 | [
"BSD-3-Clause"
] | null | null | null | pyclesperanto_prototype/_tier10/_touching_labels_to_networkx.py | elsandal/pyclesperanto_prototype | 7bda828813b86b44b63d73d5e8f466d9769cded1 | [
"BSD-3-Clause"
] | 1 | 2020-06-29T18:40:54.000Z | 2020-06-29T18:40:54.000Z | from .._tier0 import Image
def touching_labels_to_networkx(label_image:Image):
"""
Takes a label image, determines which labels are touching each other and returns an networkx graph
representing labels in range.
Parameters
----------
label_image : Image
Returns
-------
networkx Gr... | 27.652174 | 102 | 0.724843 | import numpy as np
from .._tier0 import Image
def touching_labels_to_networkx(label_image:Image):
"""
Takes a label image, determines which labels are touching each other and returns an networkx graph
representing labels in range.
Parameters
----------
label_image : Image
Returns
----... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 22 |
43076ffd359f53fde61c9667e6dc26e3b05882a6 | 17,111 | py | Python | tests/frontend/test_sf_cli.py | Lucaman99/strawberryfields | 627b8e6c1049d1108303bf0d9ba53cf6b120ea1f | [
"Apache-2.0"
] | 1 | 2020-07-12T17:54:12.000Z | 2020-07-12T17:54:12.000Z | tests/frontend/test_sf_cli.py | Lucaman99/strawberryfields | 627b8e6c1049d1108303bf0d9ba53cf6b120ea1f | [
"Apache-2.0"
] | null | null | null | tests/frontend/test_sf_cli.py | Lucaman99/strawberryfields | 627b8e6c1049d1108303bf0d9ba53cf6b120ea1f | [
"Apache-2.0"
] | null | null | null | # Copyright 2019-2020 Xanadu Quantum Technologies 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... | 35.207819 | 127 | 0.662381 | # Copyright 2019-2020 Xanadu Quantum Technologies 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... | 0 | 1,560 | 0 | 12,978 | 0 | 0 | 0 | 49 | 568 |
4a28c245b9bd8a81f806c4f9337d1113963f2955 | 1,585 | py | Python | src/main/python/irbl/bug2vec.py | NIL-zhuang/IRBL | 4f787e2bf065f728f086dfad07d71ef6210dd159 | [
"MIT"
] | null | null | null | src/main/python/irbl/bug2vec.py | NIL-zhuang/IRBL | 4f787e2bf065f728f086dfad07d71ef6210dd159 | [
"MIT"
] | null | null | null | src/main/python/irbl/bug2vec.py | NIL-zhuang/IRBL | 4f787e2bf065f728f086dfad07d71ef6210dd159 | [
"MIT"
] | null | null | null | """
WeightDefiner
bug reportvec
2021.4.14 crx
"""
if __name__ == '__main__':
wd = VectorBuilder('report', 'bug2vec.json')
wd.process()
| 28.818182 | 95 | 0.64858 | """
更加简洁的WeightDefiner版本
用于实现bug report转vec
2021.4.14 crx
"""
from sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer
from file_reader import FileReader
from file_writer import JSONWriter
from constants import data_pool_path
import os
class VectorBuilder:
def __init__(self, report_path, sav... | 243 | 0 | 0 | 1,139 | 0 | 0 | 0 | 85 | 134 |
3c381f961a1389530d19198913cef30d7c53d0d7 | 4,279 | py | Python | LASS-Simulator/codes/cli.py | QuenLo/LASS | e266860c6bebe218a42b81b72cf9a20985fa8e45 | [
"MIT"
] | 171 | 2015-06-28T03:17:40.000Z | 2021-11-18T07:55:15.000Z | LASS-Simulator/codes/cli.py | QuenLo/LASS | e266860c6bebe218a42b81b72cf9a20985fa8e45 | [
"MIT"
] | 9 | 2015-09-29T09:24:54.000Z | 2018-12-20T01:02:45.000Z | LASS-Simulator/codes/cli.py | QuenLo/LASS | e266860c6bebe218a42b81b72cf9a20985fa8e45 | [
"MIT"
] | 107 | 2015-07-28T03:40:28.000Z | 2020-06-01T08:08:32.000Z | # @file cli.py
# @brief cli of whole tool
# README: Command line interface
# MODULE_ARCH:
# CLASS_ARCH:
# GLOBAL USAGE:
#standard
#extend
#library
##### Code section #####
#Spec: local variable maintain, about, user commands, test commands
#How/NeedToKnow: | 32.416667 | 102 | 0.555971 | # @file cli.py
# @brief cli of whole tool
# README: Command line interface
# MODULE_ARCH:
# CLASS_ARCH:
# GLOBAL USAGE:
#standard
import cmd
#extend
#library
import lib.globalclasses as gc
from lib.const import *
##### Code section #####
#Spec: local variable maintain, about, user commands, test commands
#How/Need... | 0 | 0 | 0 | 3,930 | 0 | 0 | 0 | 0 | 88 |
c810a4f51434d8d2d3f95d98e285aebf0aa9e4be | 271 | py | Python | rds/mysql/list-instances.py | dantso/aws-python | 7bb232a052454edf76c53e94230eb53b417ae812 | [
"Apache-2.0"
] | null | null | null | rds/mysql/list-instances.py | dantso/aws-python | 7bb232a052454edf76c53e94230eb53b417ae812 | [
"Apache-2.0"
] | null | null | null | rds/mysql/list-instances.py | dantso/aws-python | 7bb232a052454edf76c53e94230eb53b417ae812 | [
"Apache-2.0"
] | 8 | 2020-09-04T16:17:09.000Z | 2021-01-09T21:32:13.000Z | #!/usr/bin/env python
import boto3
rds = boto3.client('rds')
try:
# get all of the db instances
dbs = rds.describe_db_instances()
for db in dbs['DBInstances']:
print ("{}".format(db['Endpoint']['Address']))
except Exception as error:
print (error) | 27.1 | 54 | 0.649446 | #!/usr/bin/env python
import boto3
rds = boto3.client('rds')
try:
# get all of the db instances
dbs = rds.describe_db_instances()
for db in dbs['DBInstances']:
print ("{}".format(db['Endpoint']['Address']))
except Exception as error:
print (error) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4550bd2bef450e4cea86289d9afd3a67cb2f287a | 125,565 | py | Python | COT/vm_description/ovf/ovf.py | morneaup/cot | 3d4dc7079a33aa0c09216ec339b44f84ab69ff4b | [
"MIT"
] | 81 | 2015-01-18T22:31:42.000Z | 2022-03-14T12:34:33.000Z | COT/vm_description/ovf/ovf.py | morneaup/cot | 3d4dc7079a33aa0c09216ec339b44f84ab69ff4b | [
"MIT"
] | 67 | 2015-01-05T15:24:39.000Z | 2021-08-16T12:44:58.000Z | COT/vm_description/ovf/ovf.py | morneaup/cot | 3d4dc7079a33aa0c09216ec339b44f84ab69ff4b | [
"MIT"
] | 20 | 2015-07-09T14:20:25.000Z | 2021-09-18T17:59:57.000Z | #!/usr/bin/env python
#
# ovf.py - Class for OVF/OVA handling
#
# August 2013, Glenn F. Matthews
# Copyright (c) 2013-2017, 2019 the COT project developers.
# See the COPYRIGHT.txt file at the top-level directory of this distribution
# and at https://github.com/glennmatthews/cot/blob/master/COPYRIGHT.txt.
#
# This file... | 41.114931 | 79 | 0.569641 | #!/usr/bin/env python
#
# ovf.py - Class for OVF/OVA handling
#
# August 2013, Glenn F. Matthews
# Copyright (c) 2013-2017, 2019 the COT project developers.
# See the COPYRIGHT.txt file at the top-level directory of this distribution
# and at https://github.com/glennmatthews/cot/blob/master/COPYRIGHT.txt.
#
# This file... | 0 | 12,789 | 0 | 111,019 | 0 | 0 | 0 | 434 | 415 |
19ddeb58583bdf5fbb77f04d29f55f4789918714 | 9,318 | py | Python | alibabacloud/signer/composer.py | wallisyan/alibabacloud-python-sdk-v2 | 6e024c97cded2403025a7dd8fea8261e41872156 | [
"Apache-2.0"
] | 21 | 2018-12-20T07:34:13.000Z | 2020-03-05T14:32:08.000Z | alibabacloud/signer/composer.py | wallisyan/alibabacloud-python-sdk-v2 | 6e024c97cded2403025a7dd8fea8261e41872156 | [
"Apache-2.0"
] | 22 | 2018-12-21T13:22:33.000Z | 2020-06-29T08:37:09.000Z | alibabacloud/signer/composer.py | wallisyan/alibabacloud-python-sdk-v2 | 6e024c97cded2403025a7dd8fea8261e41872156 | [
"Apache-2.0"
] | 12 | 2018-12-29T05:45:55.000Z | 2022-01-05T09:59:30.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 37.272 | 100 | 0.649388 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 0 | 3,581 | 0 | 4,084 | 0 | 0 | 0 | 247 | 246 |
2a977d760c22763278aec41457818a2baa2f3046 | 1,268 | py | Python | tcd/__init__.py | TheDrHax/Twitch-Chat-Downloader | 2f0ddb8def2d3256782b522f9573b6fb957274eb | [
"MIT"
] | 19 | 2017-10-08T06:29:51.000Z | 2022-03-09T15:56:37.000Z | tcd/__init__.py | TheDrHax/Twitch-Chat-Downloader | 2f0ddb8def2d3256782b522f9573b6fb957274eb | [
"MIT"
] | 6 | 2017-06-18T19:35:48.000Z | 2020-07-26T19:25:00.000Z | tcd/__init__.py | TheDrHax/Twitch-Chat-Downloader | 2f0ddb8def2d3256782b522f9573b6fb957274eb | [
"MIT"
] | 7 | 2017-11-06T09:14:07.000Z | 2021-09-22T17:40:20.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
if __name__ == "__main__":
main()
| 23.481481 | 63 | 0.638013 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from .twitch import Messages, Channel
from .subtitles import SubtitleWriter
from .settings import argparser, settings
def generate_config():
with open('settings.json', 'w') as f:
f.write(json.dumps(settings, indent=2))
def download(video):
... | 0 | 0 | 0 | 0 | 0 | 954 | 0 | 42 | 182 |
0f45bac2e09b3f5280dec643ffc3d13b36063c00 | 1,925 | py | Python | freefolks/migrations/0003_accounts_transaction.py | sivaprakashniet/blogger | e02bb99f9f86fddfa5892a7cf387ff73584b00d9 | [
"BSD-3-Clause"
] | null | null | null | freefolks/migrations/0003_accounts_transaction.py | sivaprakashniet/blogger | e02bb99f9f86fddfa5892a7cf387ff73584b00d9 | [
"BSD-3-Clause"
] | 2 | 2018-07-22T16:50:42.000Z | 2019-02-20T05:10:06.000Z | freefolks/migrations/0003_accounts_transaction.py | sivaprakashniet/blogger | e02bb99f9f86fddfa5892a7cf387ff73584b00d9 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-06-03 06:27
from __future__ import unicode_literals
| 46.95122 | 125 | 0.642078 | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-06-03 06:27
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependenc... | 0 | 0 | 0 | 1,682 | 0 | 0 | 0 | 41 | 90 |
32f53785a22cdbc7bbbcbc0581bc7c762e300df2 | 407 | py | Python | test/test_case/030_test_debug.py | xupingmao/subpy | c956f151ed1ebd2faeaf1565352b59ca5a8fa0b4 | [
"MIT"
] | 6 | 2015-10-11T15:06:54.000Z | 2016-07-03T06:06:52.000Z | test/test_case/030_test_debug.py | xupingmao/snake | c956f151ed1ebd2faeaf1565352b59ca5a8fa0b4 | [
"MIT"
] | 7 | 2015-08-03T12:01:21.000Z | 2016-04-24T09:00:09.000Z | test/test_case/030_test_debug.py | xupingmao/snake | c956f151ed1ebd2faeaf1565352b59ca5a8fa0b4 | [
"MIT"
] | 2 | 2016-04-18T14:51:25.000Z | 2016-04-18T15:07:09.000Z |
main(5)
print("-" * 50)
main(10)
print("-" * 50)
main(15)
print("-" * 50)
main(20)
print("-" * 50)
main(30)
print("-" * 50) | 11.970588 | 32 | 0.562654 |
import debug
import random
def rand_str(length):
v = ""
a = ord('A')
b = ord('Z')
for i in range(length):
v += chr(random.randint(a, b))
return v
def main(n):
print("n=%d" % n)
d = dict()
for i in range(n):
key = rand_str(5)
d[key] = 1
debug.print_dict_info(d)
main(5)
print("-" * 50)
main(10)
print(... | 0 | 0 | 0 | 0 | 0 | 205 | 0 | -17 | 91 |
e65a6001b34e535166845c0c7fe59cf1214e4815 | 1,919 | py | Python | dawp/book/10_mcs/CIR_zcb_valuation_gen.py | PyCN/dawp | 6a81535d6173727362438244d91398babbc654bd | [
"CNRI-Python"
] | 484 | 2015-08-04T19:24:06.000Z | 2022-03-30T20:59:30.000Z | dawp/book/10_mcs/CIR_zcb_valuation_gen.py | joshuatu/dawp | 6a81535d6173727362438244d91398babbc654bd | [
"CNRI-Python"
] | 3 | 2019-09-10T14:37:30.000Z | 2019-09-10T14:37:45.000Z | dawp/book/10_mcs/CIR_zcb_valuation_gen.py | joshuatu/dawp | 6a81535d6173727362438244d91398babbc654bd | [
"CNRI-Python"
] | 360 | 2015-08-08T03:30:37.000Z | 2022-03-30T12:07:31.000Z | #
# Valuation of Zero-Coupon Bonds
# in Cox-Ingersoll-Ross (1985) Model
# 09_gmm/CIR_zcb_valuation_gen.py
#
# (c) Dr. Yves J. Hilpisch
# Derivatives Analytics with Python
#
import math
import numpy as np
#
# Example Parameters CIR85 Model
#
r0, kappa_r, theta_r, sigma_r, t, T = 0.04, 0.3, 0.04, 0.1, 0.5, 5.0
#
# Zero... | 23.691358 | 68 | 0.562272 | #
# Valuation of Zero-Coupon Bonds
# in Cox-Ingersoll-Ross (1985) Model
# 09_gmm/CIR_zcb_valuation_gen.py
#
# (c) Dr. Yves J. Hilpisch
# Derivatives Analytics with Python
#
import math
import numpy as np
#
# Example Parameters CIR85 Model
#
r0, kappa_r, theta_r, sigma_r, t, T = 0.04, 0.3, 0.04, 0.1, 0.5, 5.0
#
# Zero... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ed52a5e878411f6de5c4ed707029fa8f48702ef7 | 1,264 | py | Python | examples/tcp/example_client.py | marbirg/openschc | 593bb355ab27c92677c0e53a7df73bfd83f1bbb5 | [
"MIT"
] | 21 | 2018-11-05T06:48:32.000Z | 2022-02-28T14:38:09.000Z | examples/tcp/example_client.py | marbirg/openschc | 593bb355ab27c92677c0e53a7df73bfd83f1bbb5 | [
"MIT"
] | 34 | 2019-01-28T01:32:41.000Z | 2021-05-06T09:40:14.000Z | examples/tcp/example_client.py | marbirg/openschc | 593bb355ab27c92677c0e53a7df73bfd83f1bbb5 | [
"MIT"
] | 28 | 2018-10-31T22:21:26.000Z | 2022-03-17T09:44:40.000Z | THIS.CODE.IS.UNDER.CONSTRUCTION
import tcp_helper as helper
#import protocol
helper_config = {
"mode": "client",
"address": None, # or IPv4/IPv6 address
"port": None, # TCP port,
"compression": False,
"fragmentation": False
}
rule_manager = XXX
rule_manager.Add({ rule_set })
helper = helper.hel... | 25.28 | 118 | 0.710443 | THIS.CODE.IS.UNDER.CONSTRUCTION
import tcp_helper as helper
import gen_rulemanager
#import protocol
helper_config = {
"mode": "client",
"address": None, # or IPv4/IPv6 address
"port": None, # TCP port,
"compression": False,
"fragmentation": False
}
rule_manager = XXX
rule_manager.Add({ rule_set }... | 0 | 0 | 0 | 168 | 0 | 0 | 0 | 1 | 45 |
0613f2ac395915dba85532024ab0e897622d9419 | 1,247 | py | Python | dataservices/data_provider.py | automatos-studios/cellular-probabilistic | 9546d7a01c2b3e17131f34aa1e916e514c052ea8 | [
"Apache-2.0"
] | null | null | null | dataservices/data_provider.py | automatos-studios/cellular-probabilistic | 9546d7a01c2b3e17131f34aa1e916e514c052ea8 | [
"Apache-2.0"
] | null | null | null | dataservices/data_provider.py | automatos-studios/cellular-probabilistic | 9546d7a01c2b3e17131f34aa1e916e514c052ea8 | [
"Apache-2.0"
] | null | null | null | #
# ---------------------------------------------------------
# Copyright 2018-present (c) Automatos Studios. All Rights Reserved.
# ---------------------------------------------------------
#
# @file data_provider.py
# @author cosmoplankton@automatos.studio
#
"""
DataProvider Implementation:
Imports the ... | 23.980769 | 68 | 0.586207 | #
# ---------------------------------------------------------
# Copyright 2018-present (c) Automatos Studios. All Rights Reserved.
# ---------------------------------------------------------
#
# @file data_provider.py
# @author cosmoplankton@automatos.studio
#
"""
DataProvider Implementation:
Imports the ... | 0 | 607 | 0 | 144 | 0 | 0 | 0 | -5 | 46 |
122ed3c1e40e6fa9557564c02741a7d11f2949c5 | 3,197 | py | Python | pipeline/extracellular.py | ttngu207/Economo-2018 | c1d9c9d1490380d7e6f2669de14beb7b61297aeb | [
"MIT"
] | 1 | 2019-04-01T13:30:41.000Z | 2019-04-01T13:30:41.000Z | pipeline/extracellular.py | ttngu207/Economo-2018 | c1d9c9d1490380d7e6f2669de14beb7b61297aeb | [
"MIT"
] | 1 | 2021-06-02T00:26:35.000Z | 2021-06-02T00:26:35.000Z | pipeline/extracellular.py | ttngu207/Economo-2018 | c1d9c9d1490380d7e6f2669de14beb7b61297aeb | [
"MIT"
] | 1 | 2019-04-01T13:25:01.000Z | 2019-04-01T13:25:01.000Z | import datajoint as dj
schema = dj.schema(dj.config['custom'].get('database.prefix', '') + 'extracellular')
| 33.302083 | 143 | 0.637785 | import re
import os
import sys
from datetime import datetime
import numpy as np
import scipy.io as sio
import datajoint as dj
import tqdm
from . import (reference, utilities, acquisition, analysis)
schema = dj.schema(dj.config['custom'].get('database.prefix', '') + 'extracellular')
@schema
class ProbeInsertion(dj.... | 0 | 2,812 | 0 | 0 | 0 | 0 | 0 | -1 | 270 |
19a75d46e13e88f5e7d29ef1e36459ba78d5bcd4 | 6,608 | py | Python | fabfile/__init__.py | nprapps/elections14 | b89f65aa276eebb790594f456d58e741066c1f93 | [
"MIT"
] | 5 | 2015-01-23T19:23:21.000Z | 2015-05-01T17:15:13.000Z | fabfile/__init__.py | nprapps/elections14 | b89f65aa276eebb790594f456d58e741066c1f93 | [
"MIT"
] | 1 | 2015-02-04T18:58:40.000Z | 2015-02-04T18:58:40.000Z | fabfile/__init__.py | nprapps/elections14 | b89f65aa276eebb790594f456d58e741066c1f93 | [
"MIT"
] | 1 | 2021-02-23T10:25:25.000Z | 2021-02-23T10:25:25.000Z | #!/usr/bin/env python
from fabric.state import env
import app_config
# Other fabfiles
if app_config.DEPLOY_TO_SERVERS:
if app_config.DEPLOY_CRONTAB:
# Bootstrap can only be run once, then it's disabled
if app_config.PROJECT_SLUG == '$NEW_PROJECT_SLUG':
"""
Base configuration
"""
env.user = app_config.SERVER_USER
... | 23.104895 | 182 | 0.669946 | #!/usr/bin/env python
from datetime import datetime
import json
from fabric.api import local, require, settings, task
from fabric.state import env
from termcolor import colored
import app_config
# Other fabfiles
import ap
import assets
import daemons
import data
import instagram
import issues
import liveblog
import ... | 0 | 4,881 | 0 | 0 | 0 | 0 | 0 | -80 | 842 |
5236587ef940d17116cc1bbb983825cf3b3c80c9 | 2,021 | py | Python | code/python/echomesh/color/LEDBank.py | silky/echomesh | 2fe5a00a79c215b4aca4083e5252fcdcbd0507aa | [
"MIT"
] | 1 | 2019-06-27T11:34:13.000Z | 2019-06-27T11:34:13.000Z | code/python/echomesh/color/LEDBank.py | silky/echomesh | 2fe5a00a79c215b4aca4083e5252fcdcbd0507aa | [
"MIT"
] | null | null | null | code/python/echomesh/color/LEDBank.py | silky/echomesh | 2fe5a00a79c215b4aca4083e5252fcdcbd0507aa | [
"MIT"
] | null | null | null | from __future__ import absolute_import, division, print_function, unicode_literals
# See http://dev.moorescloud.com/2012/10/18/about-lpd8806-based-rgb-led-strips/
#
# Inspired by:
# https://github.com/adammhaile/RPi-LPD8806/blob/master/LPD8806.py#L90
| 28.871429 | 82 | 0.650173 | from __future__ import absolute_import, division, print_function, unicode_literals
from echomesh.color import GammaTable
from echomesh.util.thread import Lock
# See http://dev.moorescloud.com/2012/10/18/about-lpd8806-based-rgb-led-strips/
#
# Inspired by:
# https://github.com/adammhaile/RPi-LPD8806/blob/master/LPD880... | 0 | 0 | 0 | 1,668 | 0 | 0 | 0 | 32 | 68 |
68b07ab69355268601844543563e3a3e2cea5398 | 4,390 | py | Python | example_tank_nlc/main.py | kyriacosparperis/apm_python | 1f7701131db1414d4274be71dd6bfa6b0c71de6b | [
"BSD-2-Clause-FreeBSD"
] | 99 | 2015-07-05T06:12:16.000Z | 2021-12-16T17:52:48.000Z | example_tank_nlc/main.py | kyriacosparperis/apm_python | 1f7701131db1414d4274be71dd6bfa6b0c71de6b | [
"BSD-2-Clause-FreeBSD"
] | 4 | 2018-03-27T01:30:40.000Z | 2019-06-24T20:00:18.000Z | example_tank_nlc/main.py | kyriacosparperis/apm_python | 1f7701131db1414d4274be71dd6bfa6b0c71de6b | [
"BSD-2-Clause-FreeBSD"
] | 35 | 2015-07-05T06:12:19.000Z | 2021-08-09T08:33:52.000Z | # Import
import sys
sys.path.append("../")
# Import
# Select server
server = 'http://byu.apmonitor.com'
# Application name
app = 'nlc'
# Clear previous application
apm(server,app,'clear all')
# Load model file
apm_load(server,app,'tank.apm')
# Load time points for future predictions
csv_load(server,app,'tank.csv... | 27.610063 | 75 | 0.707062 | # Import
import sys
sys.path.append("../")
# Import
from apm import *
# Select server
server = 'http://byu.apmonitor.com'
# Application name
app = 'nlc'
# Clear previous application
apm(server,app,'clear all')
# Load model file
apm_load(server,app,'tank.apm')
# Load time points for future predictions
csv_load(se... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -4 | 22 |
d5226e9fd0c4925665fe1771b8a9288b8e8f35c5 | 4,217 | py | Python | rally-jobs/plugins/mistral_huge_wf_scenario.py | shubhamdang/mistral | 3c83837f6ce1e4ab74fb519a63e82eaae70f9d2d | [
"Apache-2.0"
] | 205 | 2015-06-21T11:51:47.000Z | 2022-03-05T04:00:04.000Z | rally-jobs/plugins/mistral_huge_wf_scenario.py | shubhamdang/mistral | 3c83837f6ce1e4ab74fb519a63e82eaae70f9d2d | [
"Apache-2.0"
] | 8 | 2015-06-23T14:47:58.000Z | 2021-01-28T06:06:44.000Z | rally-jobs/plugins/mistral_huge_wf_scenario.py | shubhamdang/mistral | 3c83837f6ce1e4ab74fb519a63e82eaae70f9d2d | [
"Apache-2.0"
] | 110 | 2015-06-14T03:34:38.000Z | 2021-11-11T12:12:56.000Z | # Copyright 2020 - Nokia Software.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 32.689922 | 77 | 0.672753 | # Copyright 2020 - Nokia Software.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 0 | 803 | 0 | 2,267 | 0 | 0 | 0 | 60 | 180 |
8cc734fadba7a27f81e5017d86835a0b555e9a4d | 5,894 | py | Python | examples/trials/ga_squad/evaluate.py | narumiruna/nni | 09ce78302ca9f48ecb446e1129f28f70ee35dc4a | [
"MIT"
] | 1 | 2018-09-12T06:32:56.000Z | 2018-09-12T06:32:56.000Z | examples/trials/ga_squad/evaluate.py | 0Deer0/nni | b4e9f0878d3f74742ae3acd783ddff303b4732cb | [
"MIT"
] | null | null | null | examples/trials/ga_squad/evaluate.py | 0Deer0/nni | b4e9f0878d3f74742ae3acd783ddff303b4732cb | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation
# All rights reserved.
#
# MIT License
#
# Permission is hereby granted, free of charge,
# to any person obtaining a copy of this software and associated
# documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights... | 37.069182 | 100 | 0.656091 | # Copyright (c) Microsoft Corporation
# All rights reserved.
#
# MIT License
#
# Permission is hereby granted, free of charge,
# to any person obtaining a copy of this software and associated
# documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b662e28176f049d6451bf95891fa93d8477caf79 | 9,337 | py | Python | remodet_repository_wdh_part/python/py_loss_target_layer.py | UrwLee/Remo_experience | a59d5b9d6d009524672e415c77d056bc9dd88c72 | [
"MIT"
] | null | null | null | remodet_repository_wdh_part/python/py_loss_target_layer.py | UrwLee/Remo_experience | a59d5b9d6d009524672e415c77d056bc9dd88c72 | [
"MIT"
] | null | null | null | remodet_repository_wdh_part/python/py_loss_target_layer.py | UrwLee/Remo_experience | a59d5b9d6d009524672e415c77d056bc9dd88c72 | [
"MIT"
] | null | null | null | # coding=utf-8
import os
import caffe
import yaml
import numpy as np
import numpy.random as npr
from utils.cython_bbox import bbox_overlaps
import json
DEBUG = False
import time
import sys
print sys.path
def _compute_targets(ex_rois, gt_rois):
"""Compute bounding-box regression targets for an image."""
as... | 41.132159 | 162 | 0.617008 | # coding=utf-8
import os
import caffe
import yaml
import numpy as np
import numpy.random as npr
from utils.cython_bbox import bbox_overlaps
import json
DEBUG = False
import time
import sys
print sys.path
class LossTargetLayer(caffe.Layer):
"""
Assign anchors to ground-truth targets. Produces anchor classific... | 273 | 0 | 0 | 7,215 | 0 | 511 | 0 | 0 | 67 |
50ad367c93644ede2b0752bd5ccf7aa4702bd260 | 5,396 | py | Python | tests/test_dump.py | h5preserve/h5preserve | c3840b26868d15dd8d14f99d1d188aa066c2bb84 | [
"BSD-3-Clause"
] | 2 | 2020-03-03T20:34:13.000Z | 2020-10-02T05:51:01.000Z | tests/test_dump.py | h5preserve/h5preserve | c3840b26868d15dd8d14f99d1d188aa066c2bb84 | [
"BSD-3-Clause"
] | 178 | 2017-07-14T01:33:50.000Z | 2022-03-31T10:14:25.000Z | tests/test_dump.py | h5preserve/h5preserve | c3840b26868d15dd8d14f99d1d188aa066c2bb84 | [
"BSD-3-Clause"
] | 2 | 2017-07-14T01:29:25.000Z | 2018-02-28T12:10:26.000Z | from h5py import Group, Dataset
def is_matching_hdf5_object(new, old):
"""
Check if two objects have the same hdf5 representation
"""
if type(new) != type(old):
return False
elif isinstance(new, Dataset):
if new[:] != old[:]:
return False
elif new.attrs != old.at... | 37.472222 | 102 | 0.687361 | import pytest
import numpy as np
from h5py import Group, Dataset, SoftLink, ExternalLink
from h5preserve import RegistryContainer, HardLink, new_registry_list
def is_matching_hdf5_object(new, old):
"""
Check if two objects have the same hdf5 representation
"""
if type(new) != type(old):
retur... | 0 | 639 | 0 | 3,866 | 0 | 0 | 0 | 61 | 137 |
000aa3dc31d30cb1685d75d6126237c2f1296f93 | 623 | py | Python | microbench/tests/test_nvidia.py | alubbock/microbench | ad1c07dcbcfb8b92e81bcb99dc71e98b6eaf55f2 | [
"MIT"
] | 9 | 2018-08-03T19:10:21.000Z | 2021-08-19T16:41:33.000Z | microbench/tests/test_nvidia.py | alubbock/microbench | ad1c07dcbcfb8b92e81bcb99dc71e98b6eaf55f2 | [
"MIT"
] | null | null | null | microbench/tests/test_nvidia.py | alubbock/microbench | ad1c07dcbcfb8b92e81bcb99dc71e98b6eaf55f2 | [
"MIT"
] | null | null | null | import subprocess
try:
subprocess.call(['nvidia-smi'])
nvidia_smi_available = True
except FileNotFoundError:
nvidia_smi_available = False
| 21.482759 | 74 | 0.720706 | from microbench import MicroBench, MBNvidiaSmi
import subprocess
import unittest
import pandas
try:
subprocess.call(['nvidia-smi'])
nvidia_smi_available = True
except FileNotFoundError:
nvidia_smi_available = False
@unittest.skipIf(not nvidia_smi_available, 'nvidia-smi command not found')
def test_nvidia... | 0 | 371 | 0 | 0 | 0 | 0 | 0 | 11 | 89 |
2c15ac6ac0c744ae4ff869ee48abd6170086ae86 | 1,593 | py | Python | scripts/extract_results_stanford_sieve.py | natemalek/molen-pater-nathan-rma-thesis-coreference-with-singletons | 3d2d6c751eadd6438a80b0c24f48b2635bc6acc7 | [
"MIT"
] | null | null | null | scripts/extract_results_stanford_sieve.py | natemalek/molen-pater-nathan-rma-thesis-coreference-with-singletons | 3d2d6c751eadd6438a80b0c24f48b2635bc6acc7 | [
"MIT"
] | null | null | null | scripts/extract_results_stanford_sieve.py | natemalek/molen-pater-nathan-rma-thesis-coreference-with-singletons | 3d2d6c751eadd6438a80b0c24f48b2635bc6acc7 | [
"MIT"
] | null | null | null | '''
Extract results from the log files of Stanford sieve and put into a CSV file
Usage:
extract_results_stanford_sieve.py --out=<fn> <log_paths>...
'''
from docopt import docopt
if __name__ == '__main__':
args = docopt(__doc__)
main(args['<log_paths>'], args['--out'])
| 33.893617 | 118 | 0.632141 | '''
Extract results from the log files of Stanford sieve and put into a CSV file
Usage:
extract_results_stanford_sieve.py --out=<fn> <log_paths>...
'''
from utils import match_with_line_no, grouper
import re
from docopt import docopt
import pandas as pd
import os
def main(log_paths, out_path):
results = [extr... | 0 | 0 | 0 | 0 | 0 | 1,172 | 0 | -2 | 135 |
e00fc9e9b13dda0a862f4b3bb6db76b324fdbf5e | 8,231 | py | Python | scripts/jtl_listener_service.py | paulbrodner/jtl-reporter | 76b2dc53afe233d3e111c569fb7f2e9f63431988 | [
"MIT"
] | null | null | null | scripts/jtl_listener_service.py | paulbrodner/jtl-reporter | 76b2dc53afe233d3e111c569fb7f2e9f63431988 | [
"MIT"
] | null | null | null | scripts/jtl_listener_service.py | paulbrodner/jtl-reporter | 76b2dc53afe233d3e111c569fb7f2e9f63431988 | [
"MIT"
] | null | null | null | import gevent
| 36.745536 | 129 | 0.575507 | import gevent
import gevent.monkey
import socket
from time import sleep, time
import requests
import logging
from typing import List
import sys
import os
class JtlListener:
# holds results until processed
results: List[dict] = []
def __init__(
self,
env,
project_name:... | 0 | 0 | 0 | 8,051 | 0 | 0 | 0 | -36 | 200 |
c3ae7d5530008e782df53e09d8260d95f59213be | 2,087 | py | Python | setup.py | kohyamat/MassGenotyping | 4a3d8d073d39aa4860db4a214954bbaae65dbaf1 | [
"MIT"
] | 5 | 2020-04-27T21:24:42.000Z | 2021-12-15T03:14:42.000Z | setup.py | kohyamat/MassGenotyping | 4a3d8d073d39aa4860db4a214954bbaae65dbaf1 | [
"MIT"
] | 1 | 2020-09-23T17:17:28.000Z | 2020-09-24T17:05:50.000Z | setup.py | kohyamat/massgenotyping | 4a3d8d073d39aa4860db4a214954bbaae65dbaf1 | [
"MIT"
] | null | null | null |
from setuptools import find_packages, setup
with open("README.rst", "r") as fh:
long_description = fh.read()
setup(
name="massgenotyping",
version=get_version("massgenotyping/__init__.py"),
description=(
"Python package for microsatellite genotyping from amplicon sequencing data"
),
... | 29.814286 | 84 | 0.605654 | import codecs
import os.path
from setuptools import find_packages, setup
def read(rel_path):
here = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os.path.join(here, rel_path), "r") as fp:
return fp.read()
def get_version(rel_path):
for line in read(rel_path).splitlines():
... | 0 | 0 | 0 | 0 | 0 | 392 | 0 | -15 | 90 |
41246b4e2ade5aa7808be2662e30a735edcf004f | 74 | py | Python | datacoco_redis_tools/__init__.py | equinoxfitness/datacoco-redis_tools | 6a985f985d90a41b9c38097eabaeb1a1ff441a4e | [
"MIT"
] | 1 | 2020-03-19T17:53:42.000Z | 2020-03-19T17:53:42.000Z | datacoco_redis_tools/__init__.py | equinoxfitness/datacoco-redis_tools | 6a985f985d90a41b9c38097eabaeb1a1ff441a4e | [
"MIT"
] | null | null | null | datacoco_redis_tools/__init__.py | equinoxfitness/datacoco-redis_tools | 6a985f985d90a41b9c38097eabaeb1a1ff441a4e | [
"MIT"
] | null | null | null | from .redis_tools import RedisInteraction
__all__ = ["RedisInteraction"]
| 18.5 | 41 | 0.810811 | from .redis_tools import RedisInteraction
__all__ = ["RedisInteraction"]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2f48d7c5ec3fda9267e4bb1f4c0c9ca768901b56 | 759 | py | Python | setup.py | tylerbutler/typogrify | 7b7a67348a2d51400fd38c0b61e30e34ca98994e | [
"BSD-3-Clause"
] | null | null | null | setup.py | tylerbutler/typogrify | 7b7a67348a2d51400fd38c0b61e30e34ca98994e | [
"BSD-3-Clause"
] | null | null | null | setup.py | tylerbutler/typogrify | 7b7a67348a2d51400fd38c0b61e30e34ca98994e | [
"BSD-3-Clause"
] | null | null | null | from setuptools import setup, find_packages
setup(
name='typogrify',
version='2.0.0',
packages=find_packages(),
author='Christian Metts',
author_email='xian@mintchaos.com',
license='BSD',
description='Typography related template filters for Django & Jinja2 applications',
url='https://g... | 30.36 | 87 | 0.638999 | from setuptools import setup, find_packages
setup(
name='typogrify',
version='2.0.0',
packages=find_packages(),
author='Christian Metts',
author_email='xian@mintchaos.com',
license='BSD',
description='Typography related template filters for Django & Jinja2 applications',
url='https://g... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3c0662918efdb4ce3c4db029289f84a83b4e82cd | 3,093 | py | Python | ranger/commands.py | rusito-23/vifm-powerline | 4dc037244f8f12320e1c72f9ef252466f0f18cae | [
"MIT"
] | 1 | 2019-06-03T17:56:56.000Z | 2019-06-03T17:56:56.000Z | ranger/commands.py | rusito-23/vifm-powerline | 4dc037244f8f12320e1c72f9ef252466f0f18cae | [
"MIT"
] | null | null | null | ranger/commands.py | rusito-23/vifm-powerline | 4dc037244f8f12320e1c72f9ef252466f0f18cae | [
"MIT"
] | null | null | null | #!/bin/python3
# Author: Igor Andruskiewitsch
# Notes: Custom commands for the Ranger terminal file manager
# -- IMPORTS
# -- COMMON CONSTANTS
NULL_ERR="2> /dev/null"
MATCH="\( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \)"
FIND="find -L {} {} -prune -o {} -print"
FZF="fzf --height 100% +m"
FZF_TMUX="fzf-tmux ... | 27.371681 | 72 | 0.580666 | #!/bin/python3
# Author: Igor Andruskiewitsch
# Notes: Custom commands for the Ranger terminal file manager
# -- IMPORTS
import os
import subprocess
import ranger
# -- COMMON CONSTANTS
NULL_ERR="2> /dev/null"
MATCH="\( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \)"
FIND="find -L {} {} -prune -o {} -print"
FZF... | 0 | 309 | 0 | 2,318 | 0 | 0 | 0 | -24 | 136 |
2900a903fa25469c7c70bbc6c2ba5000ba307223 | 289 | py | Python | Strings/1803.py | LorranSutter/URI-Online-Judge | aef885b9a7caa83484cf172e29eea8ec92fc3627 | [
"MIT"
] | null | null | null | Strings/1803.py | LorranSutter/URI-Online-Judge | aef885b9a7caa83484cf172e29eea8ec92fc3627 | [
"MIT"
] | null | null | null | Strings/1803.py | LorranSutter/URI-Online-Judge | aef885b9a7caa83484cf172e29eea8ec92fc3627 | [
"MIT"
] | null | null | null | F = ''
L = ''
S = input()
N = len(S)
M = [S[k+1] for k in range(N-2)]
F = S[0]
L = S[-1]
for k in range(3):
S = input()
for w in range(N-2):
M[w] += S[w+1]
F += S[0]
L += S[-1]
res = ''
for w in range(N-2):
res += chr((int(F)*int(M[w])+int(L))%257)
print(res)
| 15.210526 | 45 | 0.429066 | F = ''
L = ''
S = input()
N = len(S)
M = [S[k+1] for k in range(N-2)]
F = S[0]
L = S[-1]
for k in range(3):
S = input()
for w in range(N-2):
M[w] += S[w+1]
F += S[0]
L += S[-1]
res = ''
for w in range(N-2):
res += chr((int(F)*int(M[w])+int(L))%257)
print(res)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1d3771f8d2a29d3f4fc9534f5bd935caf93b3d37 | 1,951 | py | Python | src/top/model/anchor.py | yycho0108/ai604-video-object-pose | 7067f36281038272b0e39166d8f9718076bb6e75 | [
"MIT"
] | null | null | null | src/top/model/anchor.py | yycho0108/ai604-video-object-pose | 7067f36281038272b0e39166d8f9718076bb6e75 | [
"MIT"
] | 13 | 2021-04-13T04:58:38.000Z | 2021-06-17T04:58:07.000Z | src/top/model/anchor.py | yycho0108/ai604-video-object-pose | 7067f36281038272b0e39166d8f9718076bb6e75 | [
"MIT"
] | null | null | null | """
Compute priorbox coordinates in center-offset(2D) form for each source feature map.
Attempt to modify SSD anchor to 3D(scale:w,h,d). Create two kind of cube(small,large) in every feature map cell.
Reference: https://github.com/amdegroot/ssd.pytorch/blob/master/layers/functions/prior_box.py
"""
from math import sqrt... | 30.484375 | 112 | 0.62327 | """
Compute priorbox coordinates in center-offset(2D) form for each source feature map.
Attempt to modify SSD anchor to 3D(scale:w,h,d). Create two kind of cube(small,large) in every feature map cell.
Reference: https://github.com/amdegroot/ssd.pytorch/blob/master/layers/functions/prior_box.py
"""
from typing import L... | 0 | 142 | 0 | 1,092 | 0 | 70 | 0 | 30 | 158 |
db12256b912edddfde90d2f2069a2f7ebf8a4b67 | 13,718 | py | Python | BP35A1.py | miyaichi/SmartMeter | b3753e376f4407d99dc5febf62358433bc4365ab | [
"MIT"
] | 2 | 2020-07-07T14:34:10.000Z | 2021-02-01T13:08:21.000Z | BP35A1.py | miyaichi/SmartMeter | b3753e376f4407d99dc5febf62358433bc4365ab | [
"MIT"
] | null | null | null | BP35A1.py | miyaichi/SmartMeter | b3753e376f4407d99dc5febf62358433bc4365ab | [
"MIT"
] | 1 | 2021-05-25T13:33:24.000Z | 2021-05-25T13:33:24.000Z |
# global variables
logger = None
# decoretor
# date time function
if __name__ == '__main__':
id = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
password = 'xxxxxxxxxxxx'
contract_amperage = "50"
collect_date = "22"
bp35a1 = BP35A1(id, password, contract_amperage, collect_date)
bp35a1.ope... | 27.381238 | 77 | 0.482286 | import logging
import machine
import utime
from m5stack import lcd
# global variables
logger = None
# decoretor
def iofunc(func):
def wrapper(obj, *args):
if (args):
logger.debug('> %s', args[0].strip())
response = func(obj, *args)
if (response):
logger.debug('< ... | 1,080 | 3,406 | 0 | 7,107 | 0 | 1,987 | 0 | -21 | 318 |
1156bac9b7482cfbaa4290f0ff035001f9d8b5f0 | 7,017 | py | Python | bench/scribble_infiltration.py | histocartography/athena | 8a1af389dc936bf5b8e62c56ae682a2fe4d2d71a | [
"BSD-3-Clause"
] | 9 | 2021-12-07T07:08:55.000Z | 2022-03-24T13:40:51.000Z | bench/scribble_infiltration.py | histocartography/athena | 8a1af389dc936bf5b8e62c56ae682a2fe4d2d71a | [
"BSD-3-Clause"
] | null | null | null | bench/scribble_infiltration.py | histocartography/athena | 8a1af389dc936bf5b8e62c56ae682a2fe4d2d71a | [
"BSD-3-Clause"
] | 2 | 2021-10-08T07:11:13.000Z | 2022-02-02T18:52:52.000Z |
import pandas as pd
import spatialHeterogeneity as sh
from spatialHeterogeneity.neighborhood.utils import get_node_interactions
from networkx import Graph
import numpy as np
import spatialHeterogeneity as sh
from spatialHeterogeneity.graph_builder.constants import GRAPH_BUILDER_DEFAULT_PARAMS
import matplotlib.pyplot... | 32.336406 | 144 | 0.673935 | import logging
import pandas as pd
import spatialHeterogeneity as sh
from spatialHeterogeneity.neighborhood.utils import get_node_interactions
from networkx import Graph
import numpy as np
import spatialHeterogeneity as sh
from spatialHeterogeneity.graph_builder.constants import GRAPH_BUILDER_DEFAULT_PARAMS
import ma... | 0 | 0 | 0 | 0 | 0 | 1,516 | 0 | -7 | 45 |
b40ae50cd4ad232820a1353b18b2fa8a177f0981 | 3,964 | py | Python | demo.py | ShuangXieIrene/ssds.pytorch | b5ec682a42c923afe964205b21448e9f141d55bc | [
"MIT"
] | 661 | 2018-03-19T12:13:07.000Z | 2022-03-31T04:35:37.000Z | demo.py | menapedreira/ssds.pytorch | b5ec682a42c923afe964205b21448e9f141d55bc | [
"MIT"
] | 80 | 2018-03-20T14:17:30.000Z | 2021-07-22T14:52:44.000Z | demo.py | menapedreira/ssds.pytorch | b5ec682a42c923afe964205b21448e9f141d55bc | [
"MIT"
] | 195 | 2018-03-23T07:17:59.000Z | 2022-03-31T02:24:23.000Z | import sys
import argparse
import cv2
from ssds.ssds import SSDDetector
COLORS = [(255, 0, 0), (0, 255, 0), (0, 0, 255)]
FONT = cv2.FONT_HERSHEY_SIMPLEX
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Demo a ssds.pytorch network')
parser.add_argument('-cfg', '--confg-file',
... | 37.752381 | 115 | 0.616044 | import os
import sys
import argparse
import cv2
from tqdm import tqdm
from ssds.ssds import SSDDetector
COLORS = [(255, 0, 0), (0, 255, 0), (0, 0, 255)]
FONT = cv2.FONT_HERSHEY_SIMPLEX
def plot_one_box(img, x, color=None, label=None, line_thickness=None):
# Plots one bounding box on image img
tl = line_thick... | 0 | 0 | 0 | 0 | 0 | 2,788 | 0 | -12 | 113 |
426c5f98e359dcd97f62a47bfc637d54f1bd889f | 1,212 | py | Python | walkdict/walkdict.py | f3rdy/pybox | d75ce59a4620c3e35f8297d20359bd6501faf257 | [
"Apache-2.0"
] | null | null | null | walkdict/walkdict.py | f3rdy/pybox | d75ce59a4620c3e35f8297d20359bd6501faf257 | [
"Apache-2.0"
] | null | null | null | walkdict/walkdict.py | f3rdy/pybox | d75ce59a4620c3e35f8297d20359bd6501faf257 | [
"Apache-2.0"
] | null | null | null | __author__ = 'fthiele'
data = {
'level 1-1':
{
'level 1-1-1':
{
'a': 1,
'b': 2,
'c': 3,
},
'level 1-1-2':
{
'd': 4,
'e': 5,
... | 20.2 | 50 | 0.238449 | __author__ = 'fthiele'
data = {
'level 1-1':
{
'level 1-1-1':
{
'a': 1,
'b': 2,
'c': 3,
},
'level 1-1-2':
{
'd': 4,
'e': 5,
... | 0 | 0 | 0 | 0 | 0 | 332 | 0 | 0 | 46 |
a3091f595fd4436213dbbf5a45e173d837cd4bd7 | 504 | py | Python | utils/metrics.py | elientumba2019/Learning-Exposure-Correction-via-consistency-Modeling-Pytorch-Implementation- | eba44073a8dc699de880e5d6b9977db3dd80ace2 | [
"MIT"
] | 8 | 2021-10-18T10:59:49.000Z | 2022-03-30T08:08:11.000Z | utils/metrics.py | elientumba2019/Learning-Exposure-Correction-via-consistency-Modeling-Pytorch-Implementation- | eba44073a8dc699de880e5d6b9977db3dd80ace2 | [
"MIT"
] | 1 | 2022-02-22T03:10:12.000Z | 2022-02-22T03:10:12.000Z | utils/metrics.py | elientumba2019/Learning-Exposure-Correction-via-consistency-Modeling-Pytorch-Implementation- | eba44073a8dc699de880e5d6b9977db3dd80ace2 | [
"MIT"
] | 1 | 2022-01-21T02:55:19.000Z | 2022-01-21T02:55:19.000Z | import torch
if __name__ == '__main__':
i = torch.randn(1, 3, 20, 20)
j = i / 1.000001
p = PSNR()
print(p(i, j).item())
| 21 | 60 | 0.577381 | import torch
class PSNR:
"""Peak Signal to Noise Ratio
img1 and img2 have range [0, 255]"""
def __init__(self, max_value):
self.name = "PSNR"
self.max_value = max_value # 255 or 1
@staticmethod
def __call__(img1, img2, max_value):
mse = torch.mean((img1 - img2) ** 2)
... | 0 | 139 | 0 | 202 | 0 | 0 | 0 | 0 | 23 |
3c18845cb8912ca3b690a1806c4fe5eec8acd629 | 1,830 | py | Python | webapp/layout/migrations/0001_initial.py | jacyn/burst | a3a655fbffa7f19197eb05ecb07b5fe05f6171b0 | [
"MIT"
] | null | null | null | webapp/layout/migrations/0001_initial.py | jacyn/burst | a3a655fbffa7f19197eb05ecb07b5fe05f6171b0 | [
"MIT"
] | null | null | null | webapp/layout/migrations/0001_initial.py | jacyn/burst | a3a655fbffa7f19197eb05ecb07b5fe05f6171b0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
| 45.75 | 178 | 0.620765 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import filer.fields.image
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('filer', '0002_auto_20150606_2003'),
]
operations = [
migrations.C... | 0 | 0 | 0 | 1,641 | 0 | 0 | 0 | 34 | 90 |
f7ac44c62a1ba492e6f7fd0c8df93adcfa8f6961 | 4,917 | py | Python | redshift-dataapi/iac/policies/policies.py | InfrastructureHQ/AWS-CDK-Accelerators | a8a3f61040f4419a6c3485c8f4b8df6204a55940 | [
"Apache-2.0"
] | null | null | null | redshift-dataapi/iac/policies/policies.py | InfrastructureHQ/AWS-CDK-Accelerators | a8a3f61040f4419a6c3485c8f4b8df6204a55940 | [
"Apache-2.0"
] | null | null | null | redshift-dataapi/iac/policies/policies.py | InfrastructureHQ/AWS-CDK-Accelerators | a8a3f61040f4419a6c3485c8f4b8df6204a55940 | [
"Apache-2.0"
] | null | null | null | from settings.globalsettings import GlobalSettings
globalsettings = GlobalSettings()
AWS_ACCOUNT_ID = globalsettings.AWS_ACCOUNT_ID
AWS_REGION = globalsettings.AWS_REGION
def code_build_batch_policy_in_json(project_ids):
"""
Define an IAM policy statement for CodeBuild batch operation.
:param project_id... | 30.351852 | 115 | 0.522676 | from settings.globalsettings import GlobalSettings
globalsettings = GlobalSettings()
AWS_ACCOUNT_ID = globalsettings.AWS_ACCOUNT_ID
AWS_REGION = globalsettings.AWS_REGION
def code_build_batch_policy_in_json(project_ids):
"""
Define an IAM policy statement for CodeBuild batch operation.
:param project_id... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f38b7b037526be424b827b3a88916a3eb387f61c | 2,539 | py | Python | Lib/site-packages/win32com/test/testExplorer.py | raychorn/svn_Python-2.5.1 | 425005b1b489ba44ec0bb989e077297e8953d9be | [
"PSF-2.0"
] | null | null | null | Lib/site-packages/win32com/test/testExplorer.py | raychorn/svn_Python-2.5.1 | 425005b1b489ba44ec0bb989e077297e8953d9be | [
"PSF-2.0"
] | null | null | null | Lib/site-packages/win32com/test/testExplorer.py | raychorn/svn_Python-2.5.1 | 425005b1b489ba44ec0bb989e077297e8953d9be | [
"PSF-2.0"
] | null | null | null | # testExplorer -
from util import CheckClean
bVisibleEventFired = 0
if __name__=='__main__':
TestAll()
CheckClean()
| 29.870588 | 98 | 0.648287 | # testExplorer -
import string
import sys
import os
import win32com.client.dynamic
import win32api
import glob
import pythoncom
import time
from util import CheckClean
bVisibleEventFired = 0
class ExplorerEvents:
def OnVisible(self, visible):
global bVisibleEventFired
bVisibleEve... | 0 | 0 | 0 | 102 | 0 | 2,068 | 0 | -53 | 286 |
bd0692f375874db9f09ad0810929ab60692a27cd | 1,015 | py | Python | scripts/find_diffcoeffs.py | maikeriva/APL104 | fe29a89e8965811313df6d06de8f878b10e7987e | [
"MIT"
] | 2 | 2020-01-10T06:52:02.000Z | 2020-01-14T19:44:47.000Z | scripts/find_diffcoeffs.py | maikeriva/APL104 | fe29a89e8965811313df6d06de8f878b10e7987e | [
"MIT"
] | null | null | null | scripts/find_diffcoeffs.py | maikeriva/APL104 | fe29a89e8965811313df6d06de8f878b10e7987e | [
"MIT"
] | null | null | null | """
Find diffusion coefficients
"""
import numpy as np
from scipy.optimize import minimize
exec(open('refsample.py').read())
exec(open('expsample.py').read())
# Define problem
# Optimization routine
guess=np.array([7.04998003e-03, 8.69586536e-03, 4.61830549e-03, 5.64390294e-02,
1.29183677e-03... | 30.757576 | 108 | 0.700493 | """
Find diffusion coefficients
"""
import numpy as np
import apl104lib as apl104
from scipy.optimize import minimize
import copy
exec(open('refsample.py').read())
exec(open('expsample.py').read())
# Define problem
def problem(guess,expsample):
# Prepare test sample
sample=copy.deepcopy(refsample)
... | 0 | 0 | 0 | 0 | 0 | 365 | 0 | -5 | 68 |
16643c23f3c06039c0dd67112f118cef6935e6c9 | 567 | py | Python | tests/test_entrypoint.py | nekitdev/entrypoint.py | d61e95326031024ba0ed2d790109f3cd8569ef32 | [
"MIT"
] | null | null | null | tests/test_entrypoint.py | nekitdev/entrypoint.py | d61e95326031024ba0ed2d790109f3cd8569ef32 | [
"MIT"
] | null | null | null | tests/test_entrypoint.py | nekitdev/entrypoint.py | d61e95326031024ba0ed2d790109f3cd8569ef32 | [
"MIT"
] | null | null | null | from entrypoint import entrypoint
MAIN = "__main__"
TEST = "__test__"
entrypoint_call = entrypoint(MAIN)
entrypoint_no_call = entrypoint(TEST)
| 17.181818 | 42 | 0.689594 | from entrypoint import entrypoint, is_main
from tests.track import track
MAIN = "__main__"
TEST = "__test__"
def test_is_main() -> None:
assert is_main(MAIN)
assert not is_main(TEST)
entrypoint_call = entrypoint(MAIN)
entrypoint_no_call = entrypoint(TEST)
def main() -> None:
pass
def test_call() ->... | 0 | 0 | 0 | 0 | 0 | 286 | 0 | 17 | 114 |
63ce3e2ce7ee483a859e45ab496e5b26d367e854 | 4,078 | py | Python | other/app.py | JakeWasChosen/edocSite | 9c108f18959c63b5b49351a466ef967ca9ae4b89 | [
"MIT"
] | 1 | 2021-09-06T15:37:15.000Z | 2021-09-06T15:37:15.000Z | other/app.py | JakeWasChosen/edocSite | 9c108f18959c63b5b49351a466ef967ca9ae4b89 | [
"MIT"
] | null | null | null | other/app.py | JakeWasChosen/edocSite | 9c108f18959c63b5b49351a466ef967ca9ae4b89 | [
"MIT"
] | null | null | null | from discord.ext import ipc
from quart import (Quart)
from quart_auth import AuthManager
from quart_discord import DiscordOAuth2Session
from os import environ
from dotenv import load_dotenv
load_dotenv()
app = Quart(__name__)
ipc_client = ipc.Client(secret_key="edoCBotAdmin")
app.config["SECRET_KEY"] = "edoC"
app.con... | 28.124138 | 190 | 0.672388 | from discord.ext import ipc
from quart import (Quart, Response, abort, redirect, render_template, request,
url_for)
from quart_auth import AuthManager, AuthUser, Unauthorized
from quart_auth import login_required as auth_required
from quart_auth import login_user, logout_user
from quart_discord impor... | 0 | 2,680 | 0 | 0 | 0 | 0 | 0 | 187 | 364 |
2ae0d3f90fa795d0b9377a97965e66868956174a | 801 | py | Python | sim/models.py | j54854/simulation | 4ab899165839c04a500f4ed17315bd732d1f04fc | [
"MIT"
] | null | null | null | sim/models.py | j54854/simulation | 4ab899165839c04a500f4ed17315bd732d1f04fc | [
"MIT"
] | null | null | null | sim/models.py | j54854/simulation | 4ab899165839c04a500f4ed17315bd732d1f04fc | [
"MIT"
] | null | null | null |
# ---------- ---------- ----------
# ---------- ---------- ----------
| 29.666667 | 60 | 0.501873 | from django.db import models
# ---------- ---------- ----------
class Game(models.Model):
# ---------- ---------- ----------
score = models.IntegerField(default=0)
# ---------- ---------- ----------
def __str__(self):
return u"game_{}".format(self.pk)
# ---------- ---------- ----------
class State(mod... | 0 | 0 | 0 | 650 | 0 | 0 | 0 | 7 | 66 |
008032e0e3d530c52688a36d3e89dccdf8c5e694 | 3,079 | py | Python | Apps/Engines/Nuke/NukeCallBacks/geoff_callbacks/CamProjTab.py | geoffroygivry/CyclopsVFX-Unity | 6ab9ab122b6c3e6200e90d49a0c2bf774e53d985 | [
"MIT"
] | 17 | 2017-06-27T04:14:42.000Z | 2022-03-07T03:37:44.000Z | Apps/Engines/Nuke/NukeCallBacks/geoff_callbacks/CamProjTab.py | geoffroygivry/Cyclops-VFX | 6ab9ab122b6c3e6200e90d49a0c2bf774e53d985 | [
"MIT"
] | 2 | 2017-06-14T04:17:51.000Z | 2018-08-23T20:12:44.000Z | Apps/Engines/Nuke/NukeCallBacks/geoff_callbacks/CamProjTab.py | geoffroygivry/CyclopsVFX-Unity | 6ab9ab122b6c3e6200e90d49a0c2bf774e53d985 | [
"MIT"
] | 2 | 2019-03-18T06:18:33.000Z | 2019-08-14T21:07:53.000Z | #The MIT License (MIT)
#
#Copyright (c) 2015 Geoffroy Givry
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, m... | 43.985714 | 157 | 0.717116 | #The MIT License (MIT)
#
#Copyright (c) 2015 Geoffroy Givry
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, m... | 0 | 0 | 0 | 0 | 0 | 1,837 | 0 | -10 | 124 |
e36b164f04ff2792e572a9e5d9fc280641f0feb9 | 1,205 | py | Python | test_files/telegram.py | Seabreg/prowler | af79c2c2147486e80ebb8000a3a2f0ab04e4eaca | [
"MIT"
] | 103 | 2018-01-31T12:10:55.000Z | 2022-02-03T22:05:19.000Z | test_files/telegram.py | tlkh/infosec-community-hackathon-2017 | af79c2c2147486e80ebb8000a3a2f0ab04e4eaca | [
"MIT"
] | 3 | 2018-03-22T09:47:00.000Z | 2018-03-31T16:20:54.000Z | test_files/telegram.py | tlkh/infosec-community-hackathon-2017 | af79c2c2147486e80ebb8000a3a2f0ab04e4eaca | [
"MIT"
] | 33 | 2018-03-23T10:13:01.000Z | 2021-02-13T23:12:33.000Z | import time
import telepot
from telepot.loop import MessageLoop
import pyrebase
subbed = []
TOKEN = ""
config = {
"apiKey": "",
"authDomain": "clusterscanner.firebaseio.com",
"databaseURL": "https://clusterscanner.firebaseio.com",
"storageBucket": "clusterscanner.appspot.com"
}
firebase = pyrebase.i... | 25.104167 | 76 | 0.659751 | import sys
import time
import telepot
from telepot.loop import MessageLoop
import pyrebase
subbed = []
def handle(msg):
content_type, chat_type, chat_id = telepot.glance(msg)
bot.sendMessage(chat_id, "k")
if msg['text'] == "sub":
subbed.append(chat_id)
print(subbed)
def stream_handler(... | 0 | 0 | 0 | 0 | 0 | 414 | 0 | -11 | 76 |
0ed5fb3c21dc44df5783a2e1dbc0a08433708ef8 | 1,116 | py | Python | python-package/lets_plot/frontend_context/_intellij_python_json_ctx.py | OLarionova-HORIS/lets-plot | 89e30a574fe2de3da17186acdbe1cf427d66d87f | [
"MIT"
] | 768 | 2019-11-28T14:09:46.000Z | 2022-03-30T18:19:28.000Z | python-package/lets_plot/frontend_context/_intellij_python_json_ctx.py | OLarionova-HORIS/lets-plot | 89e30a574fe2de3da17186acdbe1cf427d66d87f | [
"MIT"
] | 240 | 2019-12-04T20:15:03.000Z | 2022-03-30T17:12:23.000Z | python-package/lets_plot/frontend_context/_intellij_python_json_ctx.py | OLarionova-HORIS/lets-plot | 89e30a574fe2de3da17186acdbe1cf427d66d87f | [
"MIT"
] | 43 | 2019-12-05T13:45:32.000Z | 2022-03-31T21:27:00.000Z | #
# Copyright (c) 2019. JetBrains s.r.o.
# Use of this source code is governed by the MIT license that can be found in the LICENSE file.
#
| 28.615385 | 95 | 0.706093 | #
# Copyright (c) 2019. JetBrains s.r.o.
# Use of this source code is governed by the MIT license that can be found in the LICENSE file.
#
from typing import Dict, Tuple
from ._frontend_ctx import FrontendContext
from ._mime_types import LETS_PLOT_JSON
from .._type_utils import standardize_dict
class IntellijPython... | 0 | 0 | 0 | 770 | 0 | 0 | 0 | 69 | 136 |
f8a9001e9ac048458febbebe445987f1d2a3ecb5 | 636 | py | Python | 6/6-11.py | liuhanyu200/pygame | 38a68e779e6b0a63edb1758fca98ebbf40bb0444 | [
"BSD-3-Clause"
] | null | null | null | 6/6-11.py | liuhanyu200/pygame | 38a68e779e6b0a63edb1758fca98ebbf40bb0444 | [
"BSD-3-Clause"
] | null | null | null | 6/6-11.py | liuhanyu200/pygame | 38a68e779e6b0a63edb1758fca98ebbf40bb0444 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding:utf-8 -*-
citys = {
'kunming': {
'country': 'China',
'population': 14000000,
'fact': 'elephint in kunming',
},
'beijing': {
'country': 'China',
'population': 2400000,
'fact': 'changcheng in beijing',
},
'shanghai': {
'country': 'C... | 26.5 | 58 | 0.496855 | # -*- coding:utf-8 -*-
citys = {
'kunming': {
'country': 'China',
'population': 14000000,
'fact': 'elephint in kunming',
},
'beijing': {
'country': 'China',
'population': 2400000,
'fact': 'changcheng in beijing',
},
'shanghai': {
'country': 'C... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
427fa3e135748cffa2ce0a655fe0ce39a4fdeb25 | 1,588 | py | Python | scripts/mixedalphabet.py | WilliamMayor/present.scytale.xyz | cd7f386bfb2492001c7f14630b18583d1f53bd12 | [
"MIT"
] | null | null | null | scripts/mixedalphabet.py | WilliamMayor/present.scytale.xyz | cd7f386bfb2492001c7f14630b18583d1f53bd12 | [
"MIT"
] | null | null | null | scripts/mixedalphabet.py | WilliamMayor/present.scytale.xyz | cd7f386bfb2492001c7f14630b18583d1f53bd12 | [
"MIT"
] | null | null | null | # -*- coding:utf8
alphabet = u' !"#$%&\'()*+,-./:;<=>?@[\]^_`{}~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
alphabet_length = len(alphabet)
example_key = {alphabet[i]: alphabet[(i + 32) % alphabet_length] for i in xrange(alphabet_length)}
if __name__ == '__main__':
main() | 33.787234 | 161 | 0.629723 | # -*- coding:utf8
import itertools
import time
import sys
alphabet = u' !"#$%&\'()*+,-./:;<=>?@[\]^_`{£}~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzϕϴΩβε'
alphabet_length = len(alphabet)
example_key = {alphabet[i]: alphabet[(i + 32) % alphabet_length] for i in xrange(alphabet_length)}
def encrypt(... | 13 | 0 | 0 | 0 | 0 | 1,151 | 0 | -26 | 158 |
c3b2295032b2e28b9aba423da083d2aab6907d7c | 586 | py | Python | python/Lab 1/1-1/1-1.py | bitxer/ICT1002 | b7c88788b81c1b3e31fc8d61dc757d23ba773675 | [
"MIT"
] | 1 | 2021-11-30T11:54:37.000Z | 2021-11-30T11:54:37.000Z | python/Lab 1/1-1/1-1.py | bitxer/ICT1002 | b7c88788b81c1b3e31fc8d61dc757d23ba773675 | [
"MIT"
] | null | null | null | python/Lab 1/1-1/1-1.py | bitxer/ICT1002 | b7c88788b81c1b3e31fc8d61dc757d23ba773675 | [
"MIT"
] | 2 | 2020-11-20T12:55:41.000Z | 2020-11-25T13:15:42.000Z | ############################
# Module: ICT1002 #
# Language: Python2 #
# Lab Exercise 1-1 #
# Done By: bitxer #
############################
if __name__ == '__main__':
main()
| 20.206897 | 56 | 0.418089 | ############################
# Module: ICT1002 #
# Language: Python2 #
# Lab Exercise 1-1 #
# Done By: bitxer #
############################
def main():
import sys
if len(sys.argv) != 4:
print('Your input is invalid!')
exit(1)
args = [
sys.argv[1],
... | 0 | 0 | 0 | 0 | 0 | 350 | 0 | 0 | 23 |
71747ebe639c15b613399ed39eae691ea7038c08 | 1,153 | py | Python | core/xmlrpc.py | shijieqin/flatfish | 2db30ede58493da3b6970518422f6fce53cbc5fb | [
"Apache-2.0"
] | 7 | 2018-11-14T11:18:15.000Z | 2020-02-24T05:59:08.000Z | core/xmlrpc.py | shijieqin/flatfish | 2db30ede58493da3b6970518422f6fce53cbc5fb | [
"Apache-2.0"
] | 7 | 2019-05-19T11:17:57.000Z | 2021-06-10T21:14:45.000Z | core/xmlrpc.py | shijieqin/flatfish | 2db30ede58493da3b6970518422f6fce53cbc5fb | [
"Apache-2.0"
] | 1 | 2018-11-14T11:18:45.000Z | 2018-11-14T11:18:45.000Z | #!/usr/bin/env python
# encoding: utf-8
"""
@version: v1.0
@author: Shijie Qin
@license: Apache Licence
@contact: qsj4work@gmail.com
@site: https://shijieqin.github.io
@software: PyCharm
@file: xmlrpc.py
@time: 2018/11/8 3:16 PM
"""
| 25.065217 | 77 | 0.538595 | #!/usr/bin/env python
# encoding: utf-8
"""
@version: v1.0
@author: Shijie Qin
@license: Apache Licence
@contact: qsj4work@gmail.com
@site: https://shijieqin.github.io
@software: PyCharm
@file: xmlrpc.py
@time: 2018/11/8 3:16 PM
"""
import xmlrpc.client
class XmlRpc:
@staticmethod
def connection(... | 0 | 817 | 0 | -8 | 0 | 0 | 0 | -1 | 98 |
995d3fa1aaa5bcde321d358ad82b4832b6afb7dc | 4,847 | py | Python | django_push/subscriber/models.py | bwold001/django-push | ee83ff553aa4bdf2ff969f5443971450cdd25eb5 | [
"BSD-3-Clause"
] | 38 | 2015-02-04T15:48:01.000Z | 2020-12-27T19:34:28.000Z | django_push/subscriber/models.py | bwold001/django-push | ee83ff553aa4bdf2ff969f5443971450cdd25eb5 | [
"BSD-3-Clause"
] | 12 | 2015-04-03T23:35:40.000Z | 2019-05-27T09:46:49.000Z | cvproject/Lib/site-packages/django_push/subscriber/models.py | MdReyajuddin/Big-Project-Codes | 79ab22f2f51e29e2ff17f680306877559c719a56 | [
"BSD-3-Clause"
] | 9 | 2015-02-15T08:13:03.000Z | 2019-06-02T17:23:57.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
try:
from urllib.parse import urlparse
except ImportError: # python2
logger = logging.getLogger(__name__)
| 34.375887 | 79 | 0.623478 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
from datetime import timedelta
try:
from urllib.parse import urlparse
except ImportError: # python2
from urlparse import urlparse
import requests
from django.conf import settings
from django.db import models, transaction
from d... | 3 | 264 | 0 | 3,960 | 0 | 0 | 0 | 151 | 275 |
f1f9fefa181303ad0b37663b760946e7e248ff1f | 493 | py | Python | aio_jsonrpc_20/exception.py | Hellzed/aio-jsonrpc-2.0 | 75d2397931429c5126e420b5e7d7ba87c24bc8ad | [
"MIT"
] | 6 | 2017-03-16T12:48:12.000Z | 2020-11-11T03:39:41.000Z | aio_jsonrpc_20/exception.py | Hellzed/aio-jsonrpc-2.0 | 75d2397931429c5126e420b5e7d7ba87c24bc8ad | [
"MIT"
] | 2 | 2017-05-29T14:52:58.000Z | 2017-06-09T09:41:55.000Z | aio_jsonrpc_20/exception.py | Hellzed/aio-jsonrpc-2.0 | 75d2397931429c5126e420b5e7d7ba87c24bc8ad | [
"MIT"
] | 4 | 2019-04-16T15:33:44.000Z | 2020-11-11T03:41:33.000Z | import logging
logger = logging.getLogger(__name__)
| 19.72 | 59 | 0.622718 | import logging
logger = logging.getLogger(__name__)
class AioJsonRpcException(Exception):
pass
class InvalidRequestException(AioJsonRpcException):
pass
class CustomJsonRpcException(AioJsonRpcException):
def __init__(self, code, data):
self.code = code
self.data = data
if not... | 0 | 0 | 0 | 367 | 0 | 0 | 0 | 0 | 69 |
a2f46f948812b574bfb821e3dd180e8f192381e8 | 2,198 | py | Python | DiscoverConstraints/dc/utility.py | meghu2791/Profiler | 2cf58e30b4f146d6d0124181608cfd69621359f6 | [
"MIT"
] | null | null | null | DiscoverConstraints/dc/utility.py | meghu2791/Profiler | 2cf58e30b4f146d6d0124181608cfd69621359f6 | [
"MIT"
] | null | null | null | DiscoverConstraints/dc/utility.py | meghu2791/Profiler | 2cf58e30b4f146d6d0124181608cfd69621359f6 | [
"MIT"
] | null | null | null |
"""
Get the unique values for each column in a dataset.
- value_dic = {col_num:{row_value:index}}
"""
"""
Takes a dataset of strings and returns the
integer mapping of the string values.
- return_dic: True - return value_dic
- value_dic a dictionary of the string values
mapped with numeric value (index)
format: va... | 26.166667 | 73 | 0.61283 | import numpy as np
from scipy import stats
from copy import copy
import csv
import math
import pandas as pd
"""
Get the unique values for each column in a dataset.
- value_dic = {col_num:{row_value:index}}
"""
def unique_bins(value_dic):
# value_dic = {col_num:{row_value:index}}
bins = []
for i in value... | 0 | 0 | 0 | 0 | 0 | 1,505 | 0 | -24 | 198 |
d104710ef497f6757e667d92502fcd7af2b4a450 | 658 | py | Python | problems/data/parsers/BugsDictParser.py | xcsp3team/pycsp3 | a11bc370e34cd3fe37faeae9a5df935fcbd7770d | [
"MIT"
] | 28 | 2019-12-14T09:25:52.000Z | 2022-03-24T08:15:13.000Z | problems/data/parsers/BugsDictParser.py | xcsp3team/pycsp3 | a11bc370e34cd3fe37faeae9a5df935fcbd7770d | [
"MIT"
] | 7 | 2020-04-15T11:02:07.000Z | 2022-01-20T12:48:54.000Z | problems/data/parsers/BugsDictParser.py | xcsp3team/pycsp3 | a11bc370e34cd3fe37faeae9a5df935fcbd7770d | [
"MIT"
] | 3 | 2020-04-15T08:23:45.000Z | 2021-12-07T14:02:28.000Z |
next_line()
data["height"] = next_int()
data["width"] = next_int()
next_line()
nBugTypes = next_int()
next_line()
bugTypesLength = [next_int() for i in range(nBugTypes)];
next_line()
nBugs = next_int()
next_line()
data["bugs"] = []
data["bugTypes"] = []
lst = [False] * nBugs
for index in range(nBugs):
bug = {"... | 23.5 | 68 | 0.647416 | from pycsp3.problems.data.parsing import *
next_line()
data["height"] = next_int()
data["width"] = next_int()
next_line()
nBugTypes = next_int()
next_line()
bugTypesLength = [next_int() for i in range(nBugTypes)];
next_line()
nBugs = next_int()
next_line()
data["bugs"] = []
data["bugTypes"] = []
lst = [False] * nB... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 21 | 22 |
470477c3432a8916b44e2abb2e333da2227a6361 | 959 | py | Python | FluentPython/chapter11_Tombola/tombolalist.py | Liuzkai/PythonScript | fb21ad80e085f6390ae970b81404f7e5c7923f4e | [
"MIT"
] | 1 | 2021-01-16T16:09:33.000Z | 2021-01-16T16:09:33.000Z | FluentPython/chapter11_Tombola/tombolalist.py | Liuzkai/PythonScript | fb21ad80e085f6390ae970b81404f7e5c7923f4e | [
"MIT"
] | null | null | null | FluentPython/chapter11_Tombola/tombolalist.py | Liuzkai/PythonScript | fb21ad80e085f6390ae970b81404f7e5c7923f4e | [
"MIT"
] | 1 | 2021-01-16T16:09:36.000Z | 2021-01-16T16:09:36.000Z | # register
import sys
sys.path.extend(r'/Users/liuzhongkai/Documents/Git/PythonScript/FluentPython/chapter11_Tombola/')
#
| 30.935484 | 97 | 0.672576 | # 使用注册的方法来实现虚拟子类有两种方法:一个是使用修饰器,一个是使用register函数
import sys
sys.path.extend(r'/Users/liuzhongkai/Documents/Git/PythonScript/FluentPython/chapter11_Tombola/')
from random import randrange
from tombola import Tombola
# 使用第一种方法
@Tombola.register # 使用基类的register修饰器来创建虚拟子类
class TombolaList(list): # 实际继承了list类,亦可称为对list... | 588 | 559 | 0 | 0 | 0 | 0 | 0 | 13 | 67 |
a3b6cbb6b29d943004453bf248d838b10100cb4d | 34,786 | py | Python | sdk/containerregistry/azure-mgmt-containerregistry/tests/test_cli_mgmt_containerregistry_registry.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/containerregistry/azure-mgmt-containerregistry/tests/test_cli_mgmt_containerregistry_registry.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/containerregistry/azure-mgmt-containerregistry/tests/test_cli_mgmt_containerregistry_registry.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding: utf-8
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#----------------------------------------------------------------------... | 60.287695 | 3,335 | 0.575576 | # coding: utf-8
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#----------------------------------------------------------------------... | 0 | 33,392 | 0 | 434 | 0 | 0 | 0 | 98 | 113 |
394ee3eb7fd07b384e0d3cdf5e42bfc56efa8720 | 298 | py | Python | app/api/urls.py | P4R/django-graphql-api-z1 | 5b469384631e8e916567865b659641ac5710dfb3 | [
"MIT"
] | null | null | null | app/api/urls.py | P4R/django-graphql-api-z1 | 5b469384631e8e916567865b659641ac5710dfb3 | [
"MIT"
] | null | null | null | app/api/urls.py | P4R/django-graphql-api-z1 | 5b469384631e8e916567865b659641ac5710dfb3 | [
"MIT"
] | null | null | null | from django.urls import path
from django.views.decorators.csrf import csrf_exempt
from graphene_django.views import GraphQLView
from api.schema import schema
urlpatterns = [
path(
"graphql",
csrf_exempt(
GraphQLView.as_view(graphiql=True, schema=schema))
),
]
| 21.285714 | 62 | 0.708054 | from django.urls import path
from django.views.decorators.csrf import csrf_exempt
from graphene_django.views import GraphQLView
from api.schema import schema
urlpatterns = [
path(
"graphql",
csrf_exempt(
GraphQLView.as_view(graphiql=True, schema=schema))
),
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
74ee42e759a2f234d0253ececae9620ff4a89dbd | 5,889 | py | Python | scripts/python/PostAlignmentLogToDatabase.py | cmatKhan/rnaseq_pipeline_rewrite | f742c409e57b1bc642bf874206adc2db7fc1de08 | [
"MIT"
] | null | null | null | scripts/python/PostAlignmentLogToDatabase.py | cmatKhan/rnaseq_pipeline_rewrite | f742c409e57b1bc642bf874206adc2db7fc1de08 | [
"MIT"
] | null | null | null | scripts/python/PostAlignmentLogToDatabase.py | cmatKhan/rnaseq_pipeline_rewrite | f742c409e57b1bc642bf874206adc2db7fc1de08 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Parse novoalign log, write out qc and post to database
usage:
author: chase.mateusiak@gmail.com
output: {'librarySize': 35003, 'uniqueAlignment': 22737, 'multiMap': 1986, 'noMap': 10233, 'homopolymerFilter': 47, 'readLengthFilter': 0}
output: parsed novoalign log as csv
... | 43.622222 | 183 | 0.651893 | #!/usr/bin/env python
"""
Parse novoalign log, write out qc and post to database
usage:
author: chase.mateusiak@gmail.com
output: {'librarySize': 35003, 'uniqueAlignment': 22737, 'multiMap': 1986, 'noMap': 10233, 'homopolymerFilter': 47, 'readLengthFilter': 0}
output: parsed novoalign log as csv
... | 0 | 0 | 0 | 0 | 0 | 3,090 | 0 | 40 | 178 |
7cf1430a6614a1eced51b5baf47c7b35cd71cbf4 | 4,495 | py | Python | src/supplement_code/parallel_go_annotation_from_eggnog.py | NTU-CGM/MiDSystem | 0d7dadafe4811ec9d1c0df03e99d7c479e8c7f1d | [
"MIT"
] | null | null | null | src/supplement_code/parallel_go_annotation_from_eggnog.py | NTU-CGM/MiDSystem | 0d7dadafe4811ec9d1c0df03e99d7c479e8c7f1d | [
"MIT"
] | null | null | null | src/supplement_code/parallel_go_annotation_from_eggnog.py | NTU-CGM/MiDSystem | 0d7dadafe4811ec9d1c0df03e99d7c479e8c7f1d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Parsing GO Accession from a table file produced by InterProScan and mapping to GOSlim.
(c) Chien-Yueh Lee 2018 / MIT Licence
kinomoto[AT]sakura[DOT]idv[DOT]tw
"""
from __future__ import print_function
from os import path
import sys
import pandas as pd
from goatools.obo_parser import GODag
fro... | 44.50495 | 256 | 0.710567 | #!/usr/bin/env python
"""
Parsing GO Accession from a table file produced by InterProScan and mapping to GOSlim.
(c) Chien-Yueh Lee 2018 / MIT Licence
kinomoto[AT]sakura[DOT]idv[DOT]tw
"""
from __future__ import print_function
from os import path
import sys
import pandas as pd
from goatools.obo_parser import GODag
fro... | 0 | 0 | 0 | 0 | 0 | 805 | 0 | 15 | 45 |
d8e6136cd758cae1b52a15b5d58b07266b3ee4f3 | 128 | py | Python | Sem5SLLPYTHON/demo/reduce.py | tanisha03/5th-Sem-ISE | 7adc291057e290572be3b52493a797aef167992f | [
"MIT"
] | 1 | 2019-10-18T15:19:38.000Z | 2019-10-18T15:19:38.000Z | Sem5SLLPYTHON/demo/reduce.py | tanisha03/5th-Sem-ISE | 7adc291057e290572be3b52493a797aef167992f | [
"MIT"
] | 2 | 2019-10-19T12:38:52.000Z | 2019-12-23T11:05:18.000Z | Sem5SLLPYTHON/demo/reduce.py | tanisha03/5th-Sem-ISE | 7adc291057e290572be3b52493a797aef167992f | [
"MIT"
] | 19 | 2019-09-15T12:04:30.000Z | 2020-10-02T13:21:28.000Z | # from functools import reduce
wordlen = [2,3,4,2]
sum = reduce(lambda x,y : x+y ,wordlen )
print(sum)
print(sum/len(wordlen))
| 21.333333 | 40 | 0.6875 | # from functools import reduce
wordlen = [2,3,4,2]
sum = reduce(lambda x,y : x+y ,wordlen )
print(sum)
print(sum/len(wordlen))
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |