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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
82b05f03764210c51049c75916f11753c411f7c9 | 2,354 | py | Python | mcadmin/io/mc_profile.py | michelfaria/mcadmin | bb048f415d5effcf6f125e9ec050d1e693ff4e99 | [
"MIT"
] | null | null | null | mcadmin/io/mc_profile.py | michelfaria/mcadmin | bb048f415d5effcf6f125e9ec050d1e693ff4e99 | [
"MIT"
] | null | null | null | mcadmin/io/mc_profile.py | michelfaria/mcadmin | bb048f415d5effcf6f125e9ec050d1e693ff4e99 | [
"MIT"
] | null | null | null | """
Utility for getting information about a Minecraft user
"""
import json
from urllib.parse import urljoin
import requests
_ID = 'id'
_NAME = 'name'
_MOJANG_USER_API = 'https://api.mojang.com/users/profiles/minecraft/'
def _format_mojang_uuid(uuid):
"""
Formats a non-hyphenated UUID into a whitelist-comp... | 29.797468 | 115 | 0.674172 | """
Utility for getting information about a Minecraft user
"""
import json
from urllib.parse import urljoin
import requests
from mcadmin.exception import PublicError
_ID = 'id'
_NAME = 'name'
_MOJANG_USER_API = 'https://api.mojang.com/users/profiles/minecraft/'
class ProfileAPIError(PublicError):
"""
Raise... | 0 | 0 | 0 | 183 | 0 | 0 | 0 | 20 | 69 |
02fe6cef54638b112332eda79d71db557fc88e3e | 742 | py | Python | guides/python/pysample/tcp/tcp_clie.py | ToraNova/library | 20b321302868e8c2ce8723c808aa9e7a313e2cb8 | [
"MIT"
] | null | null | null | guides/python/pysample/tcp/tcp_clie.py | ToraNova/library | 20b321302868e8c2ce8723c808aa9e7a313e2cb8 | [
"MIT"
] | null | null | null | guides/python/pysample/tcp/tcp_clie.py | ToraNova/library | 20b321302868e8c2ce8723c808aa9e7a313e2cb8 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import socket
# Create a TCP/IP socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# Connect the socket to the port where the server is listening
server_address = ('localhost', 10000)
if __name__ == "__main__":
print('connecting to %s port %s' % server_address)
sock.connect(server_a... | 23.1875 | 62 | 0.710243 | #!/usr/bin/python3
import socket
import sys
# Create a TCP/IP socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# Connect the socket to the port where the server is listening
server_address = ('localhost', 10000)
if __name__ == "__main__":
print('connecting to %s port %s' % server_address)
sock.conne... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -11 | 22 |
1e8b4dcd5ca5f3a928451bb51103c41b1576ca2b | 1,664 | py | Python | simulation/02b_plotting.py | jcooper036/tri_hybid_mapping | a4a0aebcf1a1fb3773b1b402a25635b53004856a | [
"MIT"
] | null | null | null | simulation/02b_plotting.py | jcooper036/tri_hybid_mapping | a4a0aebcf1a1fb3773b1b402a25635b53004856a | [
"MIT"
] | null | null | null | simulation/02b_plotting.py | jcooper036/tri_hybid_mapping | a4a0aebcf1a1fb3773b1b402a25635b53004856a | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
import numpy as np
import matplotlib.pyplot as plt
LENGTH = 50000000
N_TRIALS = 350
selection_strength = 1
replicates = 10
window = 1000000
step = 20000
out_pre = '/Volumes/Jacob_2TB_storage/sim_sec_recombination_mapping/simulation/'
differences = []
for i2 in range(replicates):
filena... | 29.714286 | 80 | 0.691106 | #! /usr/bin/env python3
import random
import copy
import pickle
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import find_peaks_cwt
LENGTH = 50000000
N_TRIALS = 350
selection_strength = 1
replicates = 10
window = 1000000
step = 20000
out_pre = '/Volumes/Jacob_2TB_storage/... | 0 | 0 | 0 | 0 | 0 | 792 | 0 | -10 | 157 |
dc35196da8399c0456d152eca432a88be3e0a628 | 792 | py | Python | ChiantiPy/Gui/__init__.py | kdere/ChiantiPy | 2d17585d64dd1ed5a92edc645d6c85176899c185 | [
"0BSD",
"MIT"
] | 56 | 2016-01-14T15:34:50.000Z | 2022-03-09T10:41:36.000Z | ChiantiPy/Gui/__init__.py | kdere/ChiantiPy | 2d17585d64dd1ed5a92edc645d6c85176899c185 | [
"0BSD",
"MIT"
] | 163 | 2015-11-12T16:01:22.000Z | 2022-03-23T14:19:59.000Z | ChiantiPy/Gui/__init__.py | chianti-atomic/ChiantiPy | 0d47cc1c5855ab0290d0c6bd43628722651a77c5 | [
"0BSD",
"MIT"
] | 36 | 2015-11-12T16:03:47.000Z | 2022-02-09T17:53:39.000Z | """
Select GUI package
"""
#
import os
import configparser
#check chiantirc for gui selection
rcfile=os.path.join(os.environ['HOME'],'.chianti/chiantirc')
rcparse=configparser.ConfigParser()
rcparse.read(rcfile)
try:
if rcparse.get('chianti','gui').lower() == 'true':
use_gui=True
else:
use_gui... | 20.307692 | 60 | 0.695707 | """
Select GUI package
"""
#
import os
import configparser
#check chiantirc for gui selection
rcfile=os.path.join(os.environ['HOME'],'.chianti/chiantirc')
rcparse=configparser.ConfigParser()
rcparse.read(rcfile)
try:
if rcparse.get('chianti','gui').lower() == 'true':
use_gui=True
else:
use_gui... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 26 |
6f26ea029337db37edad26c811bbde21312663eb | 106 | py | Python | hackerrank/Python/Validating phone numbers/solution.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | 4 | 2020-07-24T01:59:50.000Z | 2021-07-24T15:14:08.000Z | hackerrank/Python/Validating phone numbers/solution.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | null | null | null | hackerrank/Python/Validating phone numbers/solution.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | null | null | null | import re
for _ in range(int(input())):
print('YES' if re.match(r'^[789]\d{9}$', input()) else 'NO')
| 21.2 | 64 | 0.575472 | import re
for _ in range(int(input())):
print('YES' if re.match(r'^[789]\d{9}$', input()) else 'NO')
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
888c06e9a4a6bfaceb6261d1536d109bf40a1e37 | 6,261 | py | Python | mobile/src/operators/kernel/cl/gen_code.py | jameswu2014/Paddle-Lite | 827e349ac8eb769a873fe9b3aa961af8b8b20a96 | [
"Apache-2.0"
] | 3 | 2018-08-01T09:45:48.000Z | 2021-01-06T14:55:10.000Z | mobile/src/operators/kernel/cl/gen_code.py | tao8687/Paddle-Lite | ebc0e39c7e8c09ad2d1b6a2923a420b2c1727635 | [
"Apache-2.0"
] | null | null | null | mobile/src/operators/kernel/cl/gen_code.py | tao8687/Paddle-Lite | ebc0e39c7e8c09ad2d1b6a2923a420b2c1727635 | [
"Apache-2.0"
] | 5 | 2020-10-13T09:30:16.000Z | 2021-06-08T02:46:17.000Z | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 29.956938 | 104 | 0.532503 | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 0 | 0 | 0 | 0 | 0 | 5,415 | 0 | -24 | 91 |
373670b8a9b930b1f05e074f540790b5ce421d8a | 3,662 | py | Python | repodata_tools/tokens.py | regro/repodata-tools | eea0aaa1d63b914e597161297a1d672b5e208657 | [
"BSD-3-Clause"
] | null | null | null | repodata_tools/tokens.py | regro/repodata-tools | eea0aaa1d63b914e597161297a1d672b5e208657 | [
"BSD-3-Clause"
] | 2 | 2020-09-10T18:46:11.000Z | 2020-10-27T01:15:52.000Z | repodata_tools/tokens.py | regro/repodata-tools | eea0aaa1d63b914e597161297a1d672b5e208657 | [
"BSD-3-Clause"
] | null | null | null | import time
import base64
import os
import io
import sys
from contextlib import redirect_stdout, redirect_stderr
import github
import jwt
import requests
from cryptography.hazmat.backends import default_backend
from nacl import encoding, public
def _encrypt_github_secret(public_key, secret_value):
"""Encrypt a U... | 28.387597 | 87 | 0.553523 | import time
import base64
import os
import io
import sys
from contextlib import redirect_stdout, redirect_stderr
import github
import jwt
import requests
from cryptography.hazmat.backends import default_backend
from nacl import encoding, public
def _encrypt_github_secret(public_key, secret_value):
"""Encrypt a U... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d02af1b99bbe2d95dc499109ce87222f232ba252 | 245 | py | Python | knxpy/dpts/dpt2.py | BrechtBa/knxpy | 9e486f4a4623f586091e72cc6472441f3efbdd72 | [
"MIT"
] | null | null | null | knxpy/dpts/dpt2.py | BrechtBa/knxpy | 9e486f4a4623f586091e72cc6472441f3efbdd72 | [
"MIT"
] | null | null | null | knxpy/dpts/dpt2.py | BrechtBa/knxpy | 9e486f4a4623f586091e72cc6472441f3efbdd72 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
???
"""
| 13.611111 | 53 | 0.518367 | #!/usr/bin/env python3
"""
???
"""
def encode(value):
# control, value
return [(value[0] << 1) & 0x02 | value[1] & 0x01]
def decode(data):
if len(data) != 1:
return None
return [data[0] >> 1 & 0x01, data[0] & 0x01]
| 0 | 0 | 0 | 0 | 0 | 160 | 0 | 0 | 46 |
d65e14d074268b456be679394a5a73e2adac03ae | 22,495 | py | Python | applehealth.py | dhwan11/applehealth | 876a8f2ba909a91c60638aeb83442131ec2822b5 | [
"MIT"
] | null | null | null | applehealth.py | dhwan11/applehealth | 876a8f2ba909a91c60638aeb83442131ec2822b5 | [
"MIT"
] | null | null | null | applehealth.py | dhwan11/applehealth | 876a8f2ba909a91c60638aeb83442131ec2822b5 | [
"MIT"
] | null | null | null | # an instance of apple Health
# fname is the name of data file to be parsed must be an XML files
# flags for cache | 45.814664 | 184 | 0.673527 | import xml.etree.ElementTree as ET
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import calendar
import time
from datetime import datetime
import pytz
from scipy import stats
from os.path import exists
# an instance of apple Health
# fname is the name of data file to be pa... | 0 | 0 | 0 | 22,110 | 0 | 0 | 0 | 7 | 264 |
b71db9cb25dbe7e9f1542d6325c6657890481600 | 343 | py | Python | EachSensor/testGasSensor.py | rhiroakidata/PiDjango | e58cfca9c9d128000c9cba8ff500f1fb15dd7c3f | [
"MIT"
] | null | null | null | EachSensor/testGasSensor.py | rhiroakidata/PiDjango | e58cfca9c9d128000c9cba8ff500f1fb15dd7c3f | [
"MIT"
] | null | null | null | EachSensor/testGasSensor.py | rhiroakidata/PiDjango | e58cfca9c9d128000c9cba8ff500f1fb15dd7c3f | [
"MIT"
] | null | null | null | # coding: utf-8
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setup(16, GPIO.IN)
try:
while True:
print(GPIO.input(16))
if GPIO.input(16):
print('Ambiente bom')
time.sleep(0.2)
if GPIO.input(16)!=1:
print('Gs detectado')
except KeyboardInterrup... | 18.052632 | 31 | 0.603499 | # coding: utf-8
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setup(16, GPIO.IN)
try:
while True:
print(GPIO.input(16))
if GPIO.input(16):
print('Ambiente bom')
time.sleep(0.2)
if GPIO.input(16)!=1:
print('Gás detectado')
except KeyboardInterru... | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ce487ecd6d21632a62de84d16394694a44ea1aab | 1,132 | py | Python | protofuzz/tests/test_log.py | Spellchaser/protofuzz | 831bb0a75e124ba12104e6b4ee055d7580ba9ef3 | [
"MIT"
] | null | null | null | protofuzz/tests/test_log.py | Spellchaser/protofuzz | 831bb0a75e124ba12104e6b4ee055d7580ba9ef3 | [
"MIT"
] | null | null | null | protofuzz/tests/test_log.py | Spellchaser/protofuzz | 831bb0a75e124ba12104e6b4ee055d7580ba9ef3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
| 21.358491 | 56 | 0.602473 | #!/usr/bin/env python3
import os
import shutil
import tempfile
import unittest
from protofuzz import log
class TestLog(unittest.TestCase):
def setUp(self):
self.fd, self.tempfile = tempfile.mkstemp()
def _get_logger(self, n):
return log.LastNMessagesLogger(self.tempfile, n)
def tearDow... | 0 | 0 | 0 | 1,001 | 0 | 0 | 0 | -28 | 135 |
fe314affd57bd43d39e032243ac3a05fc2b6a504 | 811 | py | Python | tools/python/boutiques/tests/test_example3.py | jerdra/boutiques | f6ee252fd1332ec686dc76dc12e52a0d69c685c3 | [
"MIT"
] | null | null | null | tools/python/boutiques/tests/test_example3.py | jerdra/boutiques | f6ee252fd1332ec686dc76dc12e52a0d69c685c3 | [
"MIT"
] | null | null | null | tools/python/boutiques/tests/test_example3.py | jerdra/boutiques | f6ee252fd1332ec686dc76dc12e52a0d69c685c3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
| 31.192308 | 79 | 0.607891 | #!/usr/bin/env python
import os
import subprocess
from unittest import TestCase
from boutiques import __file__ as bfile
import boutiques as bosh
class TestExample2(TestCase):
def get_examples_dir(self):
return os.path.join(os.path.dirname(bfile),
"schema", "examples")
de... | 0 | 0 | 0 | 641 | 0 | 0 | 0 | 13 | 134 |
e1317c904f02fea4a0e46b4dfa064a7e8914c11f | 19,040 | py | Python | dataset/src/create_data.py | golyshevilya/gan_for_interfaces | 875ebb7f24eeceb9951db101447d224f687bb96f | [
"Apache-2.0"
] | null | null | null | dataset/src/create_data.py | golyshevilya/gan_for_interfaces | 875ebb7f24eeceb9951db101447d224f687bb96f | [
"Apache-2.0"
] | null | null | null | dataset/src/create_data.py | golyshevilya/gan_for_interfaces | 875ebb7f24eeceb9951db101447d224f687bb96f | [
"Apache-2.0"
] | null | null | null | from src import item as it
import random
import numpy as np
import os
from xml.dom import minidom
from config import config
from xml.etree.ElementTree import Element, SubElement, tostring
import progressbar
from PIL import Image
def create_matrix() -> np.ndarray:
"""
Function for creating a matrix to control ... | 44.8 | 119 | 0.555987 | from src import item as it
import random
import numpy as np
import os
from xml.dom import minidom
from config import config
from xml.etree.ElementTree import Element, SubElement, tostring
import progressbar
from PIL import Image
def create_matrix() -> np.ndarray:
"""
Function for creating a matrix to control ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f9d98c4a840de674264f82e3c4ffcdf24ca29005 | 263 | py | Python | configs/preprocess/chestxdet.py | Beaver48/kaggle-chest-xray-abnormalities | d41f32d1c59cb5c925795df3291e929b3ea6d5fd | [
"MIT"
] | null | null | null | configs/preprocess/chestxdet.py | Beaver48/kaggle-chest-xray-abnormalities | d41f32d1c59cb5c925795df3291e929b3ea6d5fd | [
"MIT"
] | null | null | null | configs/preprocess/chestxdet.py | Beaver48/kaggle-chest-xray-abnormalities | d41f32d1c59cb5c925795df3291e929b3ea6d5fd | [
"MIT"
] | null | null | null | import configs.preprocess.prep as prep
config = dict(
metapath='data/raw/chestxdet10/*.json',
images='data/raw/chestxdet10/*/*',
clear=False,
visualize=False,
result_dir='data/processed/vinbigdataVOC2012',
preprocessor=prep.preprocessor)
| 26.3 | 50 | 0.718631 | import configs.preprocess.prep as prep
config = dict(
metapath='data/raw/chestxdet10/*.json',
images='data/raw/chestxdet10/*/*',
clear=False,
visualize=False,
result_dir='data/processed/vinbigdataVOC2012',
preprocessor=prep.preprocessor)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4a97cbfea3da9e99b9a8714d62d0d8c2b86591b5 | 282 | py | Python | kabzimal/utils/get_user.py | arasumran/kabzimal | dbae35fdb940bdf0338bd43983b1894c87a35961 | [
"MIT"
] | null | null | null | kabzimal/utils/get_user.py | arasumran/kabzimal | dbae35fdb940bdf0338bd43983b1894c87a35961 | [
"MIT"
] | 12 | 2020-06-05T23:02:28.000Z | 2022-03-11T23:59:56.000Z | kabzimal/utils/get_user.py | arasumran/kabzimal | dbae35fdb940bdf0338bd43983b1894c87a35961 | [
"MIT"
] | null | null | null | def get_user():
"""
Get current TLS user
"""
from django.conf import settings
from tls_middleware import _tls
get_user_fn = getattr(settings, 'GET_CURRENT_USER', None)
if get_user_fn:
return get_user_fn()
return getattr(_tls, 'user', None)
| 21.692308 | 61 | 0.656028 | def get_user():
"""
Get current TLS user
"""
from django.conf import settings
from tls_middleware import _tls
get_user_fn = getattr(settings, 'GET_CURRENT_USER', None)
if get_user_fn:
return get_user_fn()
return getattr(_tls, 'user', None)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2a253a9f8ebbeaa2e96a493ec6e14f0b7f6580ec | 2,781 | py | Python | app/api/v1/endpoints/soft_prompts.py | harubaru/gpt-server | c2be47f0df94392793eae04adbbdb18e6f4218e5 | [
"BSD-2-Clause"
] | 6 | 2021-11-06T00:47:26.000Z | 2021-12-04T03:52:04.000Z | app/api/v1/endpoints/soft_prompts.py | harubaru/gpt-server | c2be47f0df94392793eae04adbbdb18e6f4218e5 | [
"BSD-2-Clause"
] | 11 | 2021-11-13T10:44:07.000Z | 2021-12-11T05:03:45.000Z | app/api/v1/endpoints/soft_prompts.py | harubaru/gpt-server | c2be47f0df94392793eae04adbbdb18e6f4218e5 | [
"BSD-2-Clause"
] | 3 | 2021-11-11T06:01:48.000Z | 2021-12-13T05:24:33.000Z |
from fastapi import APIRouter
router = APIRouter()
| 37.08 | 169 | 0.719885 | import base64
import json
from fastapi import APIRouter, Depends, File, HTTPException, UploadFile
from sqlalchemy.ext.asyncio import AsyncSession
from typing import Optional
import app.crud.soft_prompt as crud
from app.api.deps import get_current_approved_user, get_session, get_current_user
from app.models.user impor... | 0 | 2,283 | 0 | 0 | 0 | 0 | 0 | 172 | 269 |
9878f3105a2db82907caddb483cca862d48b28ba | 3,792 | py | Python | gtin/__main__.py | davebelais/gtin | 3e375b603a43664d5d28c51cd457c58284b2979a | [
"MIT"
] | 8 | 2016-10-07T14:08:51.000Z | 2021-07-06T01:38:29.000Z | gtin/__main__.py | davebelais/gtin | 3e375b603a43664d5d28c51cd457c58284b2979a | [
"MIT"
] | 3 | 2019-12-06T14:55:03.000Z | 2021-10-01T04:08:52.000Z | gtin/__main__.py | davebelais/gtin | 3e375b603a43664d5d28c51cd457c58284b2979a | [
"MIT"
] | 4 | 2017-01-31T12:46:05.000Z | 2021-08-06T13:11:27.000Z |
if __name__ == "__main__":
main()
| 27.882353 | 79 | 0.58808 | import argparse
import sys
from gtin import (
calculate_check_digit,
validate_check_digit,
has_valid_check_digit,
append_check_digit,
get_gcp,
GTIN,
)
def _get_command() -> str:
command: str = ""
if len(sys.argv) > 1:
command = sys.argv.pop(1).lower().replace("_", "-")
retu... | 0 | 0 | 0 | 0 | 0 | 3,409 | 0 | 109 | 227 |
0c7bad60d84e532b850c5f5dc1b3082f429416f5 | 26,292 | py | Python | specsim/config.py | michaelJwilson/specsim | 0e3e1b3fa84282b32d61c3c8f189fe98c1a327cf | [
"BSD-3-Clause"
] | 3 | 2015-12-08T23:31:00.000Z | 2017-07-18T19:01:02.000Z | specsim/config.py | michaelJwilson/specsim | 0e3e1b3fa84282b32d61c3c8f189fe98c1a327cf | [
"BSD-3-Clause"
] | 104 | 2015-09-15T17:33:22.000Z | 2022-01-10T18:11:03.000Z | specsim/config.py | michaelJwilson/specsim | 0e3e1b3fa84282b32d61c3c8f189fe98c1a327cf | [
"BSD-3-Clause"
] | 9 | 2016-01-21T08:54:22.000Z | 2021-03-02T19:18:28.000Z | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Manage simulation configuration data.
Configuration data is normally loaded from a yaml file. Some standard
configurations are included with this package and can be loaded by name,
for example:
>>> test_config = load_config('test')
Otherwise any ... | 36.823529 | 80 | 0.58417 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Manage simulation configuration data.
Configuration data is normally loaded from a yaml file. Some standard
configurations are included with this package and can be loaded by name,
for example:
>>> test_config = load_config('test')
Otherwise any ... | 0 | 0 | 0 | 20,156 | 0 | 0 | 0 | -16 | 135 |
3714fb462c517517985d493f7145e6f95827972b | 4,642 | py | Python | Server/ChatBot/venv/Lib/site-packages/pygubu/widgets/accordionframe.py | sozuer53/BBC | 31bb128cb1e1a19db955fd673d67cf0e92bac3a4 | [
"Apache-2.0"
] | 42 | 2018-12-12T01:00:59.000Z | 2022-03-27T07:32:29.000Z | pygubu/pygubu/widgets/accordionframe.py | GoopyAspirin/python-rsa | 1779b35ee0abe80b44be77fe2e26c7fc26765c1c | [
"MIT"
] | 13 | 2020-11-06T13:50:45.000Z | 2022-01-25T07:17:37.000Z | pygubu/pygubu/widgets/accordionframe.py | GoopyAspirin/python-rsa | 1779b35ee0abe80b44be77fe2e26c7fc26765c1c | [
"MIT"
] | 8 | 2020-11-14T04:30:26.000Z | 2021-01-16T17:55:19.000Z | # encoding: UTF-8
#
# Copyright 2012-2013 Alejandro Autaln
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but
# ... | 28.133333 | 76 | 0.627531 | # encoding: UTF-8
#
# Copyright 2012-2013 Alejandro Autalán
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but
#... | 2 | 307 | 0 | 2,383 | 0 | 0 | 0 | -11 | 49 |
c06deb118bffd2d587a0275589e903279b01c9bb | 577 | py | Python | Chapter02/Ch02_Code/GUI_tabbed.py | mr4dsd43/Python-GUI-Programming-Cookbook-Second-Edition | 18e4632106169991e9b75680bdd7250c9d77c3be | [
"MIT"
] | 2 | 2021-01-12T03:13:29.000Z | 2021-01-12T03:13:31.000Z | Chapter02/Ch02_Code/GUI_tabbed.py | mr4dsd43/Python-GUI-Programming-Cookbook-Second-Edition | 18e4632106169991e9b75680bdd7250c9d77c3be | [
"MIT"
] | null | null | null | Chapter02/Ch02_Code/GUI_tabbed.py | mr4dsd43/Python-GUI-Programming-Cookbook-Second-Edition | 18e4632106169991e9b75680bdd7250c9d77c3be | [
"MIT"
] | 1 | 2022-02-22T02:06:32.000Z | 2022-02-22T02:06:32.000Z | '''
May 2017
@author: Burkhard A. Meier
'''
#======================
# imports
#======================
import tkinter as tk
from tkinter import ttk
win = tk.Tk() # Create instance
win.title("Python GUI") # Add a title
tabControl = ttk.Notebook(win) # Create Tab ... | 26.227273 | 62 | 0.500867 | '''
May 2017
@author: Burkhard A. Meier
'''
#======================
# imports
#======================
import tkinter as tk
from tkinter import ttk
win = tk.Tk() # Create instance
win.title("Python GUI") # Add a title
tabControl = ttk.Notebook(win) # Create Tab ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
16065698d68927983148921033feff4c1ac972e1 | 5,439 | py | Python | app/reports/reports.py | xunnanxu/github-annual-review | 13d7bec9c63dd546138f8ae84bc892e1b39a7348 | [
"MIT"
] | null | null | null | app/reports/reports.py | xunnanxu/github-annual-review | 13d7bec9c63dd546138f8ae84bc892e1b39a7348 | [
"MIT"
] | null | null | null | app/reports/reports.py | xunnanxu/github-annual-review | 13d7bec9c63dd546138f8ae84bc892e1b39a7348 | [
"MIT"
] | null | null | null |
from .. import github
COMMIT_WEIGHT = 0.7
ISSUE_WEIGHT = 0.2
STAR_WEIGHT = 0.1 | 39.992647 | 117 | 0.668873 | from collections import defaultdict
from datetime import date
from dataclasses import asdict
from .. import github
from ..models import RepoLanguages, RepoStats
from typing import List, Set
COMMIT_WEIGHT = 0.7
ISSUE_WEIGHT = 0.2
STAR_WEIGHT = 0.1
def build_report(client):
user = client.get_user()
response =... | 0 | 0 | 0 | 0 | 0 | 5,144 | 0 | 58 | 157 |
425ae6aa62825f7d02a9093243aa1a067e9ce701 | 7,631 | py | Python | delta_node/app/v1/coord.py | delta-mpc/delta-node | 674fc61f951e41ed353597f93ca6ea6bc74a102b | [
"Apache-2.0"
] | 4 | 2021-07-22T01:11:15.000Z | 2022-03-17T03:26:20.000Z | delta_node/app/v1/coord.py | delta-mpc/delta-node | 674fc61f951e41ed353597f93ca6ea6bc74a102b | [
"Apache-2.0"
] | 10 | 2021-09-13T09:55:02.000Z | 2022-03-23T09:41:26.000Z | delta_node/app/v1/coord.py | delta-mpc/delta-node | 674fc61f951e41ed353597f93ca6ea6bc74a102b | [
"Apache-2.0"
] | null | null | null | import logging
from fastapi import (APIRouter)
_logger = logging.getLogger(__name__)
router = APIRouter(prefix="/coord")
| 32.063025 | 126 | 0.646704 | import json
import logging
import os
import shutil
import time
from typing import Dict, List, Optional
import sqlalchemy as sa
from delta_node import coord, db, entity
from delta_node.serialize import bytes_to_hex, hex_to_bytes
from fastapi import (APIRouter, Depends, File, Form, HTTPException, Query,
... | 0 | 6,466 | 0 | 314 | 0 | 0 | 0 | 199 | 518 |
48f030cb8d52954f716028c4b8e779d0f640e3e8 | 1,267 | py | Python | namer/all_languages.py | geoffreyphipps/namer | b0953979d9bac8ddbbc4047b33cb2042a23d52f7 | [
"Apache-2.0"
] | null | null | null | namer/all_languages.py | geoffreyphipps/namer | b0953979d9bac8ddbbc4047b33cb2042a23d52f7 | [
"Apache-2.0"
] | null | null | null | namer/all_languages.py | geoffreyphipps/namer | b0953979d9bac8ddbbc4047b33cb2042a23d52f7 | [
"Apache-2.0"
] | null | null | null |
if __name__ == "__main__":
generate_all_syllabic_structures()
generate_all_languages()
| 39.59375 | 109 | 0.690608 | import fnmatch
import os
from namer.words import generate_words_in_language
from namer.phonemes import generate_phonemes_in_language
def generate_all_syllabic_structures() -> None:
os.makedirs(f"output/tmp", 0o755, True)
os.makedirs(f"output/syllables", 0o755, True)
for file in os.listdir('input/phonemes... | 0 | 0 | 0 | 0 | 0 | 988 | 0 | 45 | 135 |
fcf932af908d661a48287eedeccc5cf3ab62fb94 | 396 | py | Python | xibless/util.py | hsoft/xibless | a7393d28b4a31698869b2203d4d8b3398de1de7f | [
"BSD-3-Clause"
] | 2 | 2016-09-13T12:34:34.000Z | 2018-05-15T01:06:53.000Z | xibless/util.py | hsoft/xibless | a7393d28b4a31698869b2203d4d8b3398de1de7f | [
"BSD-3-Clause"
] | null | null | null | xibless/util.py | hsoft/xibless | a7393d28b4a31698869b2203d4d8b3398de1de7f | [
"BSD-3-Clause"
] | null | null | null | import os
def modified_after(first_path, second_path):
"""Returns True if first_path's mtime is higher than second_path's mtime."""
try:
first_mtime = os.stat(first_path).st_mtime
except EnvironmentError:
return False
try:
second_mtime = os.stat(second_path).st_mtime
except ... | 28.285714 | 80 | 0.69697 | import os
def modified_after(first_path, second_path):
"""Returns True if first_path's mtime is higher than second_path's mtime."""
try:
first_mtime = os.stat(first_path).st_mtime
except EnvironmentError:
return False
try:
second_mtime = os.stat(second_path).st_mtime
except ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d2b8a62ba6d0d98e20cdcead63c333d292dec5ed | 579 | py | Python | setup.py | MosheSheena/ovirtlib4 | 340ff6401c6291460da8ef7163838101cab717b9 | [
"Apache-2.0"
] | null | null | null | setup.py | MosheSheena/ovirtlib4 | 340ff6401c6291460da8ef7163838101cab717b9 | [
"Apache-2.0"
] | 4 | 2021-08-08T11:48:58.000Z | 2022-03-15T12:59:04.000Z | setup.py | MosheSheena/ovirtlib4 | 340ff6401c6291460da8ef7163838101cab717b9 | [
"Apache-2.0"
] | 3 | 2020-07-29T16:27:34.000Z | 2021-07-28T11:16:29.000Z | from distutils.core import setup
setup(
name='ovirtlib4',
packages=['ovirtlib4', 'ovirtlib4.utils'],
license='Apache License 2.0',
version='1.2.1',
description='Ovirtsdk4 wrapper',
long_description=open('README.rst').read(),
author='Roni Eliezer',
author_email='reliezer@redhat.com',
url='https://githu... | 34.058824 | 79 | 0.711572 | from distutils.core import setup
setup(
name='ovirtlib4',
packages=['ovirtlib4', 'ovirtlib4.utils'],
license='Apache License 2.0',
version='1.2.1',
description='Ovirtsdk4 wrapper',
long_description=open('README.rst').read(),
author='Roni Eliezer',
author_email='reliezer@redhat.com',
url='https://githu... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
95eac00108f82aa660c3b4c8cb8d94274cbece82 | 1,639 | py | Python | tests/core/http/test_httping.py | pfeairheller/hio | 44669adb62c81357491f9f6157312bc1313b56cf | [
"Apache-2.0"
] | 1 | 2021-04-07T19:10:28.000Z | 2021-04-07T19:10:28.000Z | tests/core/http/test_httping.py | pfeairheller/hio | 44669adb62c81357491f9f6157312bc1313b56cf | [
"Apache-2.0"
] | 4 | 2021-03-30T20:50:19.000Z | 2022-01-06T17:16:18.000Z | tests/core/http/test_httping.py | pfeairheller/hio | 44669adb62c81357491f9f6157312bc1313b56cf | [
"Apache-2.0"
] | 3 | 2021-04-08T19:35:36.000Z | 2021-06-03T13:39:05.000Z | # -*- coding: utf-8 -*-
"""
httping module tests
"""
from hio import help
from hio.core import http
logger = help.ogler.getLogger()
def test_http_error():
"""
Test HTTPError class
"""
error = http.HTTPError(status=400)
assert error.status == 400
assert error.reason == 'Bad Request'
ass... | 27.316667 | 75 | 0.538743 | # -*- coding: utf-8 -*-
"""
httping module tests
"""
import pytest
from hio import help
from hio.core import http
logger = help.ogler.getLogger()
def test_http_error():
"""
Test HTTPError class
"""
error = http.HTTPError(status=400)
assert error.status == 400
assert error.reason == 'Bad R... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -8 | 23 |
a2e1aff7884fd9608c249f64affa6543a727da1f | 4,422 | py | Python | src/project_template/main.py | BenDev9/template_python_discord_bot | bf9dfd1515b14809a15c1c2b125c4cb5eb55afc5 | [
"MIT"
] | 2 | 2021-08-14T19:47:27.000Z | 2021-08-18T19:31:17.000Z | src/project_template/main.py | BenDev9/template_python_discord_bot | bf9dfd1515b14809a15c1c2b125c4cb5eb55afc5 | [
"MIT"
] | 17 | 2021-07-19T17:06:17.000Z | 2021-09-26T02:01:56.000Z | src/project_template/main.py | BenDev9/template_python_discord_bot | bf9dfd1515b14809a15c1c2b125c4cb5eb55afc5 | [
"MIT"
] | 2 | 2021-09-03T11:30:57.000Z | 2021-10-06T03:40:14.000Z | from discord.ext import commands
from project_template import config
bot = commands.Bot(command_prefix=config.DISCORD_BOT_COMMAND_PREFIX)
if __name__ == "__main__":
main()
| 34.27907 | 97 | 0.650837 | import importlib
import os
from typing import List, Set
import discord
from discord.ext import commands
from project_template import config
from project_template.utils.logger import log
bot = commands.Bot(command_prefix=config.DISCORD_BOT_COMMAND_PREFIX)
@bot.event
async def on_ready():
log.info("Main on read... | 0 | 939 | 0 | 0 | 0 | 3,088 | 0 | 7 | 203 |
c6bd2c856114596a3c5d150f75b00f15c14cfa16 | 81 | py | Python | goscale/__init__.py | sternoru/goscalecms | 7eee50357c47ebdfe3e573a8b4be3b67892d229e | [
"BSD-3-Clause"
] | 2 | 2015-09-28T10:07:38.000Z | 2016-05-31T00:17:16.000Z | goscale/__init__.py | sternoru/goscalecms | 7eee50357c47ebdfe3e573a8b4be3b67892d229e | [
"BSD-3-Clause"
] | null | null | null | goscale/__init__.py | sternoru/goscalecms | 7eee50357c47ebdfe3e573a8b4be3b67892d229e | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
__version__ = '0.6.a12'
VERSION = __version__.split('.')
| 20.25 | 32 | 0.604938 | # -*- coding: utf-8 -*-
__version__ = '0.6.a12'
VERSION = __version__.split('.')
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4e91dab47ebd1dd945df5ea8f051bfcb2e851580 | 390 | py | Python | H02/p1/p1.py | akshay-ap/SWSHomeowork | 8d9ab131dfa43526be65162a1f2b67982a33381c | [
"Apache-2.0"
] | null | null | null | H02/p1/p1.py | akshay-ap/SWSHomeowork | 8d9ab131dfa43526be65162a1f2b67982a33381c | [
"Apache-2.0"
] | null | null | null | H02/p1/p1.py | akshay-ap/SWSHomeowork | 8d9ab131dfa43526be65162a1f2b67982a33381c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import subprocess
shell_code = "\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd\x80\xe8\xdc\xff\xff\xff/bin/sh"
nopsled = '\x90' * 116
padding = 'A' * (446 - 116 - 32)
eip = '\x40\xf6\xff\xbf'
r = nopsled + shell_code... | 32.5 | 174 | 0.666667 | #!/usr/bin/python
import subprocess
shell_code = "\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd\x80\xe8\xdc\xff\xff\xff/bin/sh"
nopsled = '\x90' * 116
padding = 'A' * (446 - 116 - 32)
eip = '\x40\xf6\xff\xbf'
r = nopsled + shell_code... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d9a2514a0b11ed67d3c1b99f5918e913b98ccae9 | 14,108 | py | Python | generate_vcoco_official.py | JacobYuan7/OCN-HOI-Benchmark | d764ce1e59cd67958bb709ac4985274352f47da8 | [
"Apache-2.0"
] | 8 | 2021-12-15T07:07:34.000Z | 2022-03-23T02:39:05.000Z | generate_vcoco_official.py | JacobYuan7/OCN-HOI-Benchmark | d764ce1e59cd67958bb709ac4985274352f47da8 | [
"Apache-2.0"
] | null | null | null | generate_vcoco_official.py | JacobYuan7/OCN-HOI-Benchmark | d764ce1e59cd67958bb709ac4985274352f47da8 | [
"Apache-2.0"
] | 1 | 2022-02-16T07:09:29.000Z | 2022-02-16T07:09:29.000Z | # ------------------------------------------------------------------------
# Copyright (c) Hitachi, Ltd. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 [see LICENSE for details]
# ------------------------------------------------------------------------
import argparse
if __name__ == '__ma... | 45.217949 | 130 | 0.59569 | # ------------------------------------------------------------------------
# Copyright (c) Hitachi, Ltd. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 [see LICENSE for details]
# ------------------------------------------------------------------------
import argparse
from pathlib import Path
imp... | 0 | 5,054 | 0 | 2,479 | 0 | 5,370 | 0 | 291 | 470 |
7ceb43ab1ea5601d792b7e7d89ace12d7857a12c | 29,100 | py | Python | numpyro/infer/mcmc.py | vishalbelsare/numpyro | de94469f19388ff09b705754f407461163030fbe | [
"Apache-2.0"
] | 1,394 | 2019-03-19T16:28:45.000Z | 2022-03-31T18:03:26.000Z | numpyro/infer/mcmc.py | vishalbelsare/numpyro | de94469f19388ff09b705754f407461163030fbe | [
"Apache-2.0"
] | 964 | 2019-03-21T05:02:01.000Z | 2022-03-31T18:27:31.000Z | numpyro/infer/mcmc.py | vishalbelsare/numpyro | de94469f19388ff09b705754f407461163030fbe | [
"Apache-2.0"
] | 163 | 2019-03-20T17:23:15.000Z | 2022-03-31T13:39:29.000Z | # Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
__all__ = [
"MCMCKernel",
"MCMC",
]
# XXX: Is there a better hash key that we can use?
| 42.173913 | 108 | 0.62354 | # Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
from abc import ABC, abstractmethod
from functools import partial
from operator import attrgetter
import os
import warnings
import numpy as np
from jax import jit, lax, local_device_count, pmap, random, vmap
from jax.core import Trac... | 0 | 3,321 | 0 | 23,935 | 0 | 970 | 0 | 188 | 496 |
26022d3b255f7d28ab62d72a738d398607f6dbe6 | 573 | py | Python | character/views/__init__.py | SamusChief/myth-caster-api | 76a43f48b70c6a4b509c90757d7906689799cc25 | [
"MIT"
] | null | null | null | character/views/__init__.py | SamusChief/myth-caster-api | 76a43f48b70c6a4b509c90757d7906689799cc25 | [
"MIT"
] | null | null | null | character/views/__init__.py | SamusChief/myth-caster-api | 76a43f48b70c6a4b509c90757d7906689799cc25 | [
"MIT"
] | 1 | 2021-08-14T18:46:52.000Z | 2021-08-14T18:46:52.000Z | """ Character app views module. """
| 52.090909 | 79 | 0.82897 | """ Character app views module. """
from .ancestry import AncestryViewSet, SubAncestryViewSet
from .background import BackgroundViewSet
from .character_class import CharacterClassViewSet, ArchetypeViewSet, \
FeaturesAtLevelViewSet, SpellsKnownAtLevelViewSet, SpellSlotsAtLevelViewSet
from .character import Character... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 427 | 110 |
6886dd2dbabfc06a657d8424041b0500d46ed500 | 845 | py | Python | ext/database.py | Mateus-Brito/flask-start | 3a772d65708c7ef050d4060db8182b88e6b7bc5f | [
"MIT"
] | 1 | 2021-11-22T17:40:39.000Z | 2021-11-22T17:40:39.000Z | ext/database.py | Mateus-Brito/flask-start | 3a772d65708c7ef050d4060db8182b88e6b7bc5f | [
"MIT"
] | 1 | 2018-08-25T20:44:47.000Z | 2018-08-25T20:44:47.000Z | ext/database.py | Mateus-Brito/flask-start | 3a772d65708c7ef050d4060db8182b88e6b7bc5f | [
"MIT"
] | null | null | null | import sys
sys.path.append("..") | 35.208333 | 80 | 0.660355 | from flask_sqlalchemy import SQLAlchemy as SQLAlchemyBase
import sys
sys.path.append("..")
from models.base import set_query_property
class SQLAlchemy(SQLAlchemyBase):
""" Extensão do FLASK que integra o alchemy com o Flask-SQLAlchemy. """
def __init__(self,
app=None,
use_nat... | 2 | 0 | 0 | 687 | 0 | 0 | 0 | 57 | 68 |
c75668be85fae55b6b024db81873e752a07d20e3 | 4,210 | py | Python | tools/interactive/isee/render.py | pvanheus/galaxy | 48403b0e45b71c4b0ce7a1e22d65a0a7cdb79574 | [
"CC-BY-3.0"
] | 3 | 2016-09-15T21:04:56.000Z | 2019-04-21T02:48:25.000Z | tools/interactive/isee/render.py | pvanheus/galaxy | 48403b0e45b71c4b0ce7a1e22d65a0a7cdb79574 | [
"CC-BY-3.0"
] | 209 | 2015-06-17T16:15:20.000Z | 2022-03-21T15:23:07.000Z | tools/interactive/isee/render.py | pvanheus/galaxy | 48403b0e45b71c4b0ce7a1e22d65a0a7cdb79574 | [
"CC-BY-3.0"
] | 7 | 2016-07-10T16:44:30.000Z | 2020-08-30T19:25:51.000Z | """Pre-configured iSEE options for selection by user.
Currently user configuration is NOT IMPLEMENTED - the code is here but option
is hidden from user in the tool form. Without ``custom`` selection, this simply
returns a DEFAULT iSEE configuration (defined at the bottom of this file).
These are preconfigured iSEE pa... | 28.066667 | 100 | 0.650831 | """Pre-configured iSEE options for selection by user.
Currently user configuration is NOT IMPLEMENTED - the code is here but option
is hidden from user in the tool form. Without ``custom`` selection, this simply
returns a DEFAULT iSEE configuration (defined at the bottom of this file).
These are preconfigured iSEE pa... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ddaa840a32f2f5872cefc3f9cdc0c9c4742108e0 | 1,007 | py | Python | flask_project/reporter/test/test_osm_way_parser.py | russbiggs/MapCampaigner | 05b6c6eb1bdefbe0b60313a9d3cd1a0d2df2a148 | [
"BSD-3-Clause"
] | 24 | 2018-10-05T06:39:11.000Z | 2022-02-22T08:54:37.000Z | flask_project/reporter/test/test_osm_way_parser.py | russbiggs/MapCampaigner | 05b6c6eb1bdefbe0b60313a9d3cd1a0d2df2a148 | [
"BSD-3-Clause"
] | 384 | 2017-05-17T07:50:02.000Z | 2018-09-20T08:18:56.000Z | flask_project/reporter/test/test_osm_way_parser.py | russbiggs/MapCampaigner | 05b6c6eb1bdefbe0b60313a9d3cd1a0d2df2a148 | [
"BSD-3-Clause"
] | 16 | 2017-05-11T08:52:19.000Z | 2018-06-08T06:55:43.000Z | # coding=utf-8
"""Test cases for the OSM Way Parser module.
:copyright: (c) 2013 by Tim Sutton
:license: GPLv3, see LICENSE for more details.
"""
import unittest
if __name__ == '__main__':
unittest.main()
| 28.771429 | 68 | 0.622642 | # coding=utf-8
"""Test cases for the OSM Way Parser module.
:copyright: (c) 2013 by Tim Sutton
:license: GPLv3, see LICENSE for more details.
"""
import xml
import unittest
from reporter.test.logged_unittest import LoggedTestCase
from reporter.osm_way_parser import OsmParser
from reporter.test.helpers import FIXTURE_P... | 0 | 0 | 0 | 610 | 0 | 0 | 0 | 73 | 112 |
745ed85d43355ea5b09de8a48804c8b9e290c82f | 7,623 | py | Python | knowledge/SSHAll.py | procter-gamble-tech/pentest-report | f9e9d8f5dc76316fd5a1fe43956d60d1efd1aacc | [
"MIT"
] | 2 | 2021-02-18T13:46:06.000Z | 2021-04-30T05:11:19.000Z | knowledge/SSHAll.py | procter-gamble-tech/pentest-report | f9e9d8f5dc76316fd5a1fe43956d60d1efd1aacc | [
"MIT"
] | null | null | null | knowledge/SSHAll.py | procter-gamble-tech/pentest-report | f9e9d8f5dc76316fd5a1fe43956d60d1efd1aacc | [
"MIT"
] | 1 | 2021-02-18T13:45:37.000Z | 2021-02-18T13:45:37.000Z | #!/usr/bin/python3
#from pssh.pssh2_client import SSHClient
import time
import sys
import os
import signal
import argparse
#
# parser = argparse.ArgumentParser(description='Interactively executesssh commands against all known hosts / credentials.')
# parser.add_argument('-U', '--user', type=str, nargs='*', help='Conne... | 45.921687 | 248 | 0.59268 | #!/usr/bin/python3
from pymongo import MongoClient
#from pssh.pssh2_client import SSHClient
import paramiko
import time
import sys
import json
import os
import subprocess
import signal
import time
import argparse
from termcolor import colored
from KnowledgeUtils import KnowledgeUtils
class SSHAll:
def __init__(se... | 0 | 0 | 0 | 4,943 | 0 | 0 | 0 | 9 | 177 |
97d741a63b85b203e22666e63c22074486864493 | 173 | py | Python | zvt/recorders/__init__.py | manstiilin/zvt | 5a37c19f4837c0250b04d9f41ead910f42b72ce4 | [
"MIT"
] | 1 | 2019-12-09T12:13:09.000Z | 2019-12-09T12:13:09.000Z | zvt/recorders/__init__.py | manstiilin/zvt | 5a37c19f4837c0250b04d9f41ead910f42b72ce4 | [
"MIT"
] | 2 | 2019-12-05T00:46:06.000Z | 2019-12-15T12:22:07.000Z | zvt/recorders/__init__.py | manstiilin/zvt | 5a37c19f4837c0250b04d9f41ead910f42b72ce4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from zvt.recorders.common.init_data import init_main_index
init_main_index()
| 19.222222 | 58 | 0.745665 | # -*- coding: utf-8 -*-
from zvt.recorders.common.init_data import init_main_index
init_main_index()
from .ccxt import *
from .eastmoney import *
from .joinquant import *
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 67 |
e018cb01d3660bc3ea920c490bdd08390999dcf0 | 2,310 | py | Python | opsdroid/configuration/validation.py | danielballan/opsdroid | 03afd709682bd60deaeeb9c872e45a3aa153f4d8 | [
"Apache-2.0"
] | null | null | null | opsdroid/configuration/validation.py | danielballan/opsdroid | 03afd709682bd60deaeeb9c872e45a3aa153f4d8 | [
"Apache-2.0"
] | 2 | 2021-09-08T02:59:21.000Z | 2022-01-13T03:37:31.000Z | opsdroid/configuration/validation.py | danielballan/opsdroid | 03afd709682bd60deaeeb9c872e45a3aa153f4d8 | [
"Apache-2.0"
] | null | null | null | """Schema validation for configuration.yaml."""
import logging
import sys
from voluptuous import Schema, ALLOW_EXTRA, Optional, Required, Any, MultipleInvalid
_LOGGER = logging.getLogger(__name__)
logging = {
Optional("level"): str,
Optional("timestamp"): bool,
Optional("console"): bool,
Optional("ext... | 30 | 102 | 0.660173 | """Schema validation for configuration.yaml."""
import logging
import sys
from voluptuous import Schema, ALLOW_EXTRA, Optional, Required, Any, MultipleInvalid
_LOGGER = logging.getLogger(__name__)
logging = {
Optional("level"): str,
Optional("timestamp"): bool,
Optional("console"): bool,
Optional("ext... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9baafcad59b251994d283d0f800b0468cbf432b0 | 1,478 | py | Python | tests/python/gaia-ui-tests/gaiatest/tests/functional/cards_view/test_cards_view_kill_apps_with_two_apps.py | b2g2onyxL/gaia | b86f15617e933a732b5964874a1c9a4decf1de09 | [
"Apache-2.0"
] | 1 | 2021-07-27T23:21:30.000Z | 2021-07-27T23:21:30.000Z | tests/python/gaia-ui-tests/gaiatest/tests/functional/cards_view/test_cards_view_kill_apps_with_two_apps.py | b2g2onyxL/gaia | b86f15617e933a732b5964874a1c9a4decf1de09 | [
"Apache-2.0"
] | null | null | null | tests/python/gaia-ui-tests/gaiatest/tests/functional/cards_view/test_cards_view_kill_apps_with_two_apps.py | b2g2onyxL/gaia | b86f15617e933a732b5964874a1c9a4decf1de09 | [
"Apache-2.0"
] | null | null | null | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
| 36.04878 | 137 | 0.707713 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import time
from gaiatest import GaiaTestCase
from gaiatest.apps.system.regions.cards_view import CardsView
from gaiate... | 0 | 0 | 0 | 1,057 | 0 | 0 | 0 | 86 | 135 |
599680bce3ef09e0de360b6520a48ad153c04939 | 114,032 | py | Python | looker_client_31/api/dashboard_api.py | ContrastingSounds/looker_sdk_31 | f973434049fff1b605b10086ab8b84f2f62e3489 | [
"MIT"
] | null | null | null | looker_client_31/api/dashboard_api.py | ContrastingSounds/looker_sdk_31 | f973434049fff1b605b10086ab8b84f2f62e3489 | [
"MIT"
] | null | null | null | looker_client_31/api/dashboard_api.py | ContrastingSounds/looker_sdk_31 | f973434049fff1b605b10086ab8b84f2f62e3489 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Experimental Looker API 3.1 Preview
This API 3.1 is in active development. Breaking changes are likely to occur to some API functions in future Looker releases until API 3.1 is officially launched and upgraded to beta status. If you have time and interest to experiment with new or modifie... | 42.966089 | 553 | 0.62543 | # coding: utf-8
"""
Experimental Looker API 3.1 Preview
This API 3.1 is in active development. Breaking changes are likely to occur to some API functions in future Looker releases until API 3.1 is officially launched and upgraded to beta status. If you have time and interest to experiment with new or modifie... | 0 | 0 | 0 | 113,141 | 0 | 0 | 0 | 5 | 105 |
808d2290ad0552ec26c7d98529ad7e5e8442b472 | 370 | py | Python | src/compas_ghpython/components/Compas_FromJson/code.py | ricardoavelino/compas | e3c7f004b8839f96bf01f9f6b21a75786c3f59fa | [
"MIT"
] | null | null | null | src/compas_ghpython/components/Compas_FromJson/code.py | ricardoavelino/compas | e3c7f004b8839f96bf01f9f6b21a75786c3f59fa | [
"MIT"
] | null | null | null | src/compas_ghpython/components/Compas_FromJson/code.py | ricardoavelino/compas | e3c7f004b8839f96bf01f9f6b21a75786c3f59fa | [
"MIT"
] | null | null | null | """
Deserializes JSON into COMPAS objects.
"""
| 20.555556 | 69 | 0.645946 | """
Deserializes JSON into COMPAS objects.
"""
from ghpythonlib.componentbase import executingcomponent as component
import compas
class CompasInfo(component):
def RunScript(self, json):
if not json:
return None
try:
return compas.json_load(json)
except: # noqa... | 0 | 0 | 0 | 214 | 0 | 0 | 0 | 40 | 68 |
36c6992dbcf81328c24c29316fd808fa634762ff | 218 | py | Python | blog/admin.py | IreneG5/spss_online | 760abcdd3304a141396ab982ca17cb992afbcecd | [
"CNRI-Python",
"blessing"
] | 14 | 2017-09-28T12:15:42.000Z | 2022-01-27T20:27:01.000Z | blog/admin.py | IreneG5/spss_online | 760abcdd3304a141396ab982ca17cb992afbcecd | [
"CNRI-Python",
"blessing"
] | null | null | null | blog/admin.py | IreneG5/spss_online | 760abcdd3304a141396ab982ca17cb992afbcecd | [
"CNRI-Python",
"blessing"
] | 9 | 2017-10-25T16:49:02.000Z | 2022-01-22T10:48:18.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from .models import Category, Post
# Register your models here.
admin.site.register(Category)
admin.site.register(Post)
| 24.222222 | 39 | 0.779817 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from .models import Category, Post
# Register your models here.
admin.site.register(Category)
admin.site.register(Post)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2d334582ebbab7b07ccc816187522280a531fa06 | 3,865 | py | Python | neuralcompression/data/_clic_2020_image.py | tallamjr/NeuralCompression | 21d05ec0d9f8c52d8742fde36f569b4dad2842a5 | [
"MIT"
] | 233 | 2021-07-19T18:50:21.000Z | 2022-03-30T22:06:40.000Z | neuralcompression/data/_clic_2020_image.py | tallamjr/NeuralCompression | 21d05ec0d9f8c52d8742fde36f569b4dad2842a5 | [
"MIT"
] | 79 | 2021-07-22T13:33:45.000Z | 2022-02-09T16:38:42.000Z | neuralcompression/data/_clic_2020_image.py | tallamjr/NeuralCompression | 21d05ec0d9f8c52d8742fde36f569b4dad2842a5 | [
"MIT"
] | 21 | 2021-07-29T18:27:59.000Z | 2022-02-28T02:32:53.000Z | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import torchvision.datasets.folder
| 30.433071 | 82 | 0.549806 | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import os.path
import shutil
from pathlib import Path
from typing import Callable, Optional, Union
import torchvision.datasets.fo... | 69 | 0 | 0 | 3,369 | 0 | 0 | 0 | 47 | 199 |
8310220186611da2140bb527929053a91e7d1484 | 6,224 | py | Python | tutorials/bios-script/forceio.py | eosforce/FORCEIO | b8dc334db53a66f8913027bc396eee852f6fe770 | [
"MIT"
] | 10 | 2019-01-17T11:56:40.000Z | 2019-12-23T11:08:13.000Z | tutorials/bios-script/forceio.py | eosforce/FORCEIO | b8dc334db53a66f8913027bc396eee852f6fe770 | [
"MIT"
] | null | null | null | tutorials/bios-script/forceio.py | eosforce/FORCEIO | b8dc334db53a66f8913027bc396eee852f6fe770 | [
"MIT"
] | 6 | 2019-04-24T11:16:02.000Z | 2020-11-29T05:41:07.000Z |
root_account = "codex"
relay_account_name = system_account("relay")
token_account_name = system_account("token")
code_account_name = system_account("code")
match_account_name = system_account("match")
bridge_account_name = system_account("bridge")
relay_token_name = "relay.token"
datas = dataSet() | 35.565714 | 158 | 0.612468 | import argparse
import json
import os
import subprocess
import sys
import time
import copy
root_account = "codex"
def system_account(sub_name):
return root_account + "." + sub_name
relay_account_name = system_account("relay")
token_account_name = system_account("token")
code_account_name = system_account("code")... | 0 | 0 | 0 | 808 | 0 | 4,560 | 0 | -63 | 607 |
95ea78305ad087d401a10ad74f684f2b9cc07f34 | 22 | py | Python | aliyun-python-sdk-dataworks-public/aliyunsdkdataworks_public/__init__.py | liuzheng/aliyun-openapi-python-sdk | 1ba6743f3d6f2cef57ec9e3be1754b04293c3150 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-dataworks-public/aliyunsdkdataworks_public/__init__.py | liuzheng/aliyun-openapi-python-sdk | 1ba6743f3d6f2cef57ec9e3be1754b04293c3150 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-dataworks-public/aliyunsdkdataworks_public/__init__.py | liuzheng/aliyun-openapi-python-sdk | 1ba6743f3d6f2cef57ec9e3be1754b04293c3150 | [
"Apache-2.0"
] | null | null | null | __version__ = '3.3.11' | 22 | 22 | 0.681818 | __version__ = '3.3.11' | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
851091fe63128eb2a9c7a704fb1867d15d1a9d0d | 808 | py | Python | app/__init__.py | d-kahara/store_manager_api | b2a1df2318c3e7ffb7d89bfc03ef0381379e1556 | [
"MIT"
] | 1 | 2019-07-02T12:22:34.000Z | 2019-07-02T12:22:34.000Z | app/__init__.py | d-kahara/store_manager_api | b2a1df2318c3e7ffb7d89bfc03ef0381379e1556 | [
"MIT"
] | 2 | 2018-10-24T09:14:42.000Z | 2018-11-02T08:08:40.000Z | app/__init__.py | d-kahara/store_manager_api | b2a1df2318c3e7ffb7d89bfc03ef0381379e1556 | [
"MIT"
] | 2 | 2018-10-21T13:09:46.000Z | 2018-10-27T11:44:14.000Z | """Configuration for creating app"""
| 25.25 | 69 | 0.709158 | """Configuration for creating app"""
from flask import Flask, jsonify
from flask_cors import CORS
from instance.config import app_config
from app.database import SetupDB
def create_app(config_name):
app = Flask(__name__, instance_relative_config=True)
app.config.from_object(app_config[config_name])
app.u... | 0 | 0 | 0 | 0 | 0 | 612 | 0 | 45 | 112 |
c4cb24246e0c46656dc3b43e3a4afb113fdf6049 | 408 | py | Python | acp/data_config/sbm_data_beta_crp_config.py | yueqiw/attentive_clustering_processes | 3925eebbbce5b17f86805836b720c7bb518af9f4 | [
"MIT"
] | 3 | 2020-10-31T21:43:15.000Z | 2020-11-12T07:22:03.000Z | acp/data_config/sbm_data_beta_crp_config.py | yueqiw/attentive_clustering_processes | 3925eebbbce5b17f86805836b720c7bb518af9f4 | [
"MIT"
] | 2 | 2020-11-05T12:50:25.000Z | 2020-11-13T16:45:20.000Z | acp/data_config/sbm_data_beta_crp_config.py | yueqiw/attentive_clustering_processes | 3925eebbbce5b17f86805836b720c7bb518af9f4 | [
"MIT"
] | 2 | 2020-11-06T16:19:58.000Z | 2021-04-15T01:29:30.000Z |
sbm_data_beta_crp_params = {
# number of data points (for training), N ~ unif(Nmin, Nmax)
'Nmin': 50,
'Nmax': 300,
# CRP
'alpha': .7,
'maxK': 12, # max number of clusters to generate
# SBM
'within_alpha': 6,
'within_beta': 3,
'between_alpha': 1,
'between_beta'... | 15.692308 | 64 | 0.551471 |
sbm_data_beta_crp_params = {
# number of data points (for training), N ~ unif(Nmin, Nmax)
'Nmin': 50,
'Nmax': 300,
# CRP
'alpha': .7,
'maxK': 12, # max number of clusters to generate
# SBM
'within_alpha': 6,
'within_beta': 3,
'between_alpha': 1,
'between_beta'... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
719aff20d3939d625275604906a1b3d1dc82c572 | 708 | py | Python | pythonCore/ch03/makeTextFile.py | Furzoom/learnpython | a3034584e481d4e7c55912d9da06439688aa67ea | [
"MIT"
] | null | null | null | pythonCore/ch03/makeTextFile.py | Furzoom/learnpython | a3034584e481d4e7c55912d9da06439688aa67ea | [
"MIT"
] | null | null | null | pythonCore/ch03/makeTextFile.py | Furzoom/learnpython | a3034584e481d4e7c55912d9da06439688aa67ea | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""makeTextFile.py -- create text file
"""
import os
ls = os.linesep
fname = ''
# get filename
while True:
fname = raw_input('Input filename: ')
if os.path.exists(fname):
print "ERROR: '%s' already exists" % fname
else:
break
# get file cont... | 19.135135 | 55 | 0.614407 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""makeTextFile.py -- create text file
"""
import os
ls = os.linesep
fname = ''
# get filename
while True:
fname = raw_input('Input filename: ')
if os.path.exists(fname):
print "ERROR: '%s' already exists" % fname
else:
break
# get file cont... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6610fed7fa99ed7207b5a634e4d04774093c4b0b | 314 | py | Python | soundreinforcements/__init__.py | Chum4k3r/soundreinforcements | d929627b396ddd3a3d85be1989026bfeb86e3a1b | [
"MIT"
] | null | null | null | soundreinforcements/__init__.py | Chum4k3r/soundreinforcements | d929627b396ddd3a3d85be1989026bfeb86e3a1b | [
"MIT"
] | null | null | null | soundreinforcements/__init__.py | Chum4k3r/soundreinforcements | d929627b396ddd3a3d85be1989026bfeb86e3a1b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Jul 31 00:58:20 2020
@author: joaovitor
"""
from .air import Air
from .receivers import Receiver, ReceiversGrid
from .sources import SourceChain, Source, Audio
__version__ = '0.1.0a'
__all__ = ['Air', 'Receiver', 'ReceiversGrid', 'Audio', 'Source', 'SourceChain']
| 17.444444 | 80 | 0.684713 | # -*- coding: utf-8 -*-
"""
Created on Fri Jul 31 00:58:20 2020
@author: joaovitor
"""
from .air import Air
from .receivers import Receiver, ReceiversGrid
from .sources import SourceChain, Source, Audio
__version__ = '0.1.0a'
__all__ = ['Air', 'Receiver', 'ReceiversGrid', 'Audio', 'Source', 'SourceChain']
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ad6effeb4aae9ac8c8ee2a5307ea62472a74f25e | 132 | py | Python | main.py | mwang87/ChemicalStructureWebService | 10abb0306b8e2876ed34c038738eaa86cdc83c66 | [
"MIT"
] | 4 | 2016-05-04T03:41:19.000Z | 2021-07-13T08:16:46.000Z | main.py | mwang87/ChemicalStructureWebService | 10abb0306b8e2876ed34c038738eaa86cdc83c66 | [
"MIT"
] | 11 | 2019-07-25T23:45:42.000Z | 2020-02-13T20:44:35.000Z | main.py | mwang87/ChemicalStructureWebService | 10abb0306b8e2876ed34c038738eaa86cdc83c66 | [
"MIT"
] | 2 | 2019-07-23T22:23:02.000Z | 2019-07-25T22:58:16.000Z | # main.py
from app import app
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000)
| 14.666667 | 38 | 0.69697 | # main.py
from app import app
import views
import dashinterface
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | -10 | 45 |
bbdd676802bbb0bf4ff7e70bbd4d43e2bf5a9dad | 4,332 | py | Python | test/test_arns.py | fishzle/policy_sentry | aa880c0ff87565132538e1d23ebf113d24c6b3b5 | [
"MIT"
] | 1 | 2019-10-22T00:50:47.000Z | 2019-10-22T00:50:47.000Z | test/test_arns.py | fishzle/policy_sentry | aa880c0ff87565132538e1d23ebf113d24c6b3b5 | [
"MIT"
] | null | null | null | test/test_arns.py | fishzle/policy_sentry | aa880c0ff87565132538e1d23ebf113d24c6b3b5 | [
"MIT"
] | null | null | null | from pathlib import Path
from policy_sentry.shared.database import connect_db
home = str(Path.home())
config_directory = '/.policy_sentry/'
database_file_name = 'aws.sqlite3'
database_path = home + config_directory + database_file_name
db_session = connect_db(database_path)
# "Does Arn Match" tests
# See docs for thi... | 59.342466 | 161 | 0.751385 | import unittest
from pathlib import Path
from policy_sentry.shared.arns import does_arn_match
from policy_sentry.shared.database import connect_db
home = str(Path.home())
config_directory = '/.policy_sentry/'
database_file_name = 'aws.sqlite3'
database_path = home + config_directory + database_file_name
db_session = c... | 0 | 0 | 0 | 3,373 | 0 | 0 | 0 | 25 | 67 |
3964205cea9a25ac29ef5f4a846ae4a8b9538173 | 627 | py | Python | homan/datasets/verify.py | ktw361/homan | add9afd17f2854c0e32869e273daf68b8926b178 | [
"Xnet",
"Info-ZIP",
"X11"
] | 47 | 2021-08-14T02:19:49.000Z | 2022-03-09T16:29:51.000Z | homan/datasets/verify.py | ktw361/homan | add9afd17f2854c0e32869e273daf68b8926b178 | [
"Xnet",
"Info-ZIP",
"X11"
] | 3 | 2021-08-28T17:26:04.000Z | 2021-10-20T13:38:55.000Z | homan/datasets/verify.py | ktw361/homan | add9afd17f2854c0e32869e273daf68b8926b178 | [
"Xnet",
"Info-ZIP",
"X11"
] | 6 | 2021-08-14T04:19:57.000Z | 2022-03-30T15:57:27.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
| 28.5 | 51 | 0.526316 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
def check_setup(bboxes, setup):
valid_setup = True
computed_setup = {}
valid_boxes = {}
for item, item_nb in setup.items():
if bboxes[0][item] is None:
valid_setup = False
else:
if bboxes[0][item].ndim == 2:
... | 0 | 0 | 0 | 0 | 0 | 557 | 0 | 0 | 23 |
83677841554251940349c484e632fb70f1a420eb | 961 | py | Python | apply_measures/apply_measures_v1.py | adambreznicky/smudge_python | af7ba221890253ac6fe7f38691b351861f8b3d96 | [
"MIT"
] | 1 | 2017-05-24T02:05:20.000Z | 2017-05-24T02:05:20.000Z | apply_measures/apply_measures_v1.py | adambreznicky/smudge_python | af7ba221890253ac6fe7f38691b351861f8b3d96 | [
"MIT"
] | null | null | null | apply_measures/apply_measures_v1.py | adambreznicky/smudge_python | af7ba221890253ac6fe7f38691b351861f8b3d96 | [
"MIT"
] | null | null | null | import arcpy
from arcpy import env
env.workspace = "C:\\TxDOT\\FederalRoads"
# desc = arcpy.Describe("tester.shp")
# shapefieldname = desc.ShapeFieldName
spatialRef = arcpy.Describe("tester.shp").spatialReference
rows = arcpy.UpdateCursor("tester.shp")
for row in rows:
geom = row.shape
wholeLen = geom.length*.0006... | 25.289474 | 69 | 0.66077 | import arcpy
from arcpy import env
env.workspace = "C:\\TxDOT\\FederalRoads"
# desc = arcpy.Describe("tester.shp")
# shapefieldname = desc.ShapeFieldName
spatialRef = arcpy.Describe("tester.shp").spatialReference
rows = arcpy.UpdateCursor("tester.shp")
for row in rows:
geom = row.shape
wholeLen = geom.length*.0006... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
01588a56e00fc183e5264283315ed83caa765f6f | 7,581 | py | Python | autocomplete_light/tests/autocomplete/test_model.py | julyzergcn/django-autocomplete-light-2.3.3 | 1043af9dc463bc97e0d6bf35f24133c6f7f42700 | [
"MIT"
] | null | null | null | autocomplete_light/tests/autocomplete/test_model.py | julyzergcn/django-autocomplete-light-2.3.3 | 1043af9dc463bc97e0d6bf35f24133c6f7f42700 | [
"MIT"
] | 2 | 2021-03-31T18:52:30.000Z | 2021-12-13T19:50:13.000Z | autocomplete_light/tests/autocomplete/test_model.py | julyzergcn/django-autocomplete-light-2.3.3 | 1043af9dc463bc97e0d6bf35f24133c6f7f42700 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
| 30.817073 | 83 | 0.497955 | from __future__ import unicode_literals
import unittest
import pytest
from django import VERSION
from django.utils.encoding import force_text
from autocomplete_light.example_apps.autocomplete_test_case_app.models import (
NonIntegerPk, SubGroup, CustomSchema, CustomIntegerPk, Caps)
from .case import *
clas... | 0 | 385 | 0 | 6,786 | 0 | 0 | 0 | 139 | 227 |
3e661e5f9a496adbc73202034107fabf5affcb77 | 2,593 | py | Python | skills/transfertransfo/confidence_tank.py | stefanrer/commonbsecret | bb527f9b3e460124ccc307c0d39baba9a2490fcd | [
"Apache-2.0"
] | null | null | null | skills/transfertransfo/confidence_tank.py | stefanrer/commonbsecret | bb527f9b3e460124ccc307c0d39baba9a2490fcd | [
"Apache-2.0"
] | null | null | null | skills/transfertransfo/confidence_tank.py | stefanrer/commonbsecret | bb527f9b3e460124ccc307c0d39baba9a2490fcd | [
"Apache-2.0"
] | null | null | null | import os
import numpy as np
import requests
TGT_URL = os.getenv("TGT_URL", "http://localhost/transfertransfo/")
N_REQUESTS = int(os.getenv("N_REQUESTS", 5))
OUT_FILE = int(os.getenv("OUT_FILE", "confidences.npy"))
personality = [
"I am a socialbot.",
"I live on Amazon Web Service.",
"I was born during t... | 27.88172 | 119 | 0.563054 | import os
import numpy as np
import requests
TGT_URL = os.getenv("TGT_URL", "http://localhost/transfertransfo/")
N_REQUESTS = int(os.getenv("N_REQUESTS", 5))
OUT_FILE = int(os.getenv("OUT_FILE", "confidences.npy"))
personality = [
"I am a socialbot.",
"I live on Amazon Web Service.",
"I was born during t... | 0 | 0 | 0 | 0 | 134 | 0 | 0 | 0 | 23 |
1a52bd4d18e4b5021cf5f3f226099013bd35358f | 749 | py | Python | cuda/two_dimension_work.py | vyscond/sliding-puzzle-problem | 4f79bde560abda61e3d14ba00dadef936a423926 | [
"MIT"
] | null | null | null | cuda/two_dimension_work.py | vyscond/sliding-puzzle-problem | 4f79bde560abda61e3d14ba00dadef936a423926 | [
"MIT"
] | null | null | null | cuda/two_dimension_work.py | vyscond/sliding-puzzle-problem | 4f79bde560abda61e3d14ba00dadef936a423926 | [
"MIT"
] | null | null | null | import pycuda.driver as cuda
import pycuda.autoinit
from pycuda.compiler import SourceModule
import numpy
a = numpy.random.randn(4,4)
a = a.astype(numpy.int32)
a_gpu = cuda.mem_alloc(a.nbytes)
cuda.memcpy_htod(a_gpu, a)
mod = SourceModule("""
#include <stdio.h>
__global__ void doublify(in... | 20.805556 | 117 | 0.616822 | import pycuda.driver as cuda
import pycuda.autoinit
from pycuda.compiler import SourceModule
import numpy
a = numpy.random.randn(4,4)
a = a.astype(numpy.int32)
a_gpu = cuda.mem_alloc(a.nbytes)
cuda.memcpy_htod(a_gpu, a)
mod = SourceModule("""
#include <stdio.h>
__global__ void doublify(in... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c643f7dd419e42b6e476c8f10d08d8c697e823cc | 61 | py | Python | view/display_utils.py | spacewaterbear/pubmed_data | 6e0d85ff623df1f1badd2f711b7d46ea8211741e | [
"MIT"
] | null | null | null | view/display_utils.py | spacewaterbear/pubmed_data | 6e0d85ff623df1f1badd2f711b7d46ea8211741e | [
"MIT"
] | null | null | null | view/display_utils.py | spacewaterbear/pubmed_data | 6e0d85ff623df1f1badd2f711b7d46ea8211741e | [
"MIT"
] | null | null | null | from PIL import Image
image = Image.open('images/sleep.jpg') | 20.333333 | 38 | 0.754098 | from PIL import Image
image = Image.open('images/sleep.jpg') | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f99aedc568cee701e429f5527535974201ca4157 | 1,077 | py | Python | account/modules/functions.py | kami-z88/courier | 4b5366f410b7ac1e6d6c0767e8211ec2c7695d5d | [
"MIT"
] | 2 | 2017-12-07T12:30:25.000Z | 2020-04-22T21:22:05.000Z | account/modules/functions.py | kami-z88/courier | 4b5366f410b7ac1e6d6c0767e8211ec2c7695d5d | [
"MIT"
] | 6 | 2020-02-12T00:16:48.000Z | 2022-03-11T23:19:00.000Z | account/modules/functions.py | Towhidn/django-boilerplate | 089aed5a2a9ac13a746e4fc3c52526e1a54c8657 | [
"MIT"
] | null | null | null | import itertools
from django.template.defaultfilters import slugify
from django.utils.encoding import smart_bytes
from hashlib import sha1
import random
def get_slug(obj, title, group):
"""
used to get unique slugs
:param obj: Model Object
:param title: Title to create slug from
:param group: Model Class
:retur... | 26.925 | 109 | 0.724234 | import itertools
from django.template.defaultfilters import slugify
from django.utils.encoding import smart_bytes
from hashlib import sha1
import random
def get_slug(obj, title, group):
"""
used to get unique slugs
:param obj: Model Object
:param title: Title to create slug from
:param group: Model Class
:retur... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3b140d39b8d18aedcc929871feefdb2f3b6200be | 33,465 | py | Python | regym/rl_algorithms/agents/i2a_agent.py | KnwSondess/Regym | 825c7dacf955a3e2f6c658c0ecb879a0ca036c1a | [
"MIT"
] | 2 | 2020-09-13T15:53:20.000Z | 2020-12-08T15:57:05.000Z | regym/rl_algorithms/agents/i2a_agent.py | KnwSondess/Regym | 825c7dacf955a3e2f6c658c0ecb879a0ca036c1a | [
"MIT"
] | null | null | null | regym/rl_algorithms/agents/i2a_agent.py | KnwSondess/Regym | 825c7dacf955a3e2f6c658c0ecb879a0ca036c1a | [
"MIT"
] | 1 | 2021-09-20T13:48:30.000Z | 2021-09-20T13:48:30.000Z | from typing import Dict
import torch.nn as nn
import torch.nn.functional as F
from functools import partial
from regym.rl_algorithms.networks import ResizeCNNPreprocessFunction
from regym.rl_algorithms.algorithms.I2A import I2AAlgorithm, ImaginationCore, EnvironmentModel, AutoEncoderEnvironmentModel, I2AModel
from reg... | 54.150485 | 163 | 0.626983 | from typing import Dict, List
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from functools import partial
from regym.rl_algorithms.networks import ResizeCNNPreprocessFunction
from regym.rl_algorithms.algorithms.I2A import I2AAlgorithm, ImaginationCore, EnvironmentModel, AutoEnc... | 0 | 1,042 | 0 | 13,635 | 0 | 5,513 | 0 | 20 | 160 |
c5cb202f6f5460ce8d72f41f7787eb7335104e9d | 1,724 | py | Python | Yahtzee.py | LeviBarnes/Yahtzee | a3261bbfd665a22dd1252f27913b37aa10804e52 | [
"MIT"
] | null | null | null | Yahtzee.py | LeviBarnes/Yahtzee | a3261bbfd665a22dd1252f27913b37aa10804e52 | [
"MIT"
] | null | null | null | Yahtzee.py | LeviBarnes/Yahtzee | a3261bbfd665a22dd1252f27913b37aa10804e52 | [
"MIT"
] | null | null | null | import Scoresheet
from ManualPlayer import player
n_players = 0
while(n_players == 0):
try:
n_players = int(input("How many players? "))
except:
print("Please enter a number between 1 and 8")
n_players = 0
sheets = [Scoresheet.scoreSheet() for i in range(n_players)]
player... | 33.803922 | 76 | 0.591067 | import Dice
import Scoresheet
from ManualPlayer import player
def one_turn(sheet, decider):
values = [0] * 5
keep = [False] * 5
Dice.roll_dice(values,keep)
print("Your scoresheet:")
for q in range(13):
print(Scoresheet.row_names[q] + " " + str(sheet.scores[q]))
for q in rang... | 0 | 0 | 0 | 0 | 0 | 945 | 0 | -10 | 48 |
59ee9c563923dc22cead8d4487d30764fcde6e57 | 1,658 | py | Python | divide_and_conquer/53.py | l1n4n/leetcode_by_topics | bb53a4aa9bf9ff6c9a32afe99ba9b70cdeed0d61 | [
"CC0-1.0"
] | null | null | null | divide_and_conquer/53.py | l1n4n/leetcode_by_topics | bb53a4aa9bf9ff6c9a32afe99ba9b70cdeed0d61 | [
"CC0-1.0"
] | null | null | null | divide_and_conquer/53.py | l1n4n/leetcode_by_topics | bb53a4aa9bf9ff6c9a32afe99ba9b70cdeed0d61 | [
"CC0-1.0"
] | null | null | null | # 53. Maximum Subarray
# Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.
# DIVIDE into halves, leave the mid one as the center of the subarray
# CAVEAT:
## for the left part, start adding from the tail, cuz the subarray has to be ... | 42.512821 | 138 | 0.629674 | # 53. Maximum Subarray
# Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.
# DIVIDE into halves, leave the mid one as the center of the subarray
# CAVEAT:
## for the left part, start adding from the tail, cuz the subarray has to be ... | 0 | 0 | 0 | 955 | 0 | 0 | 0 | 0 | 23 |
3db2aa44c45086ebbee0e8838683a72c241540ad | 8,381 | py | Python | tacker_horizon/openstack_dashboard/dashboards/nfv/vnffgmanager/tables.py | SSU-DCN/tacker-horizon | c4f27e2373b6d5d35ffc8ef37bf70bae9368d8b8 | [
"Apache-2.0"
] | 24 | 2015-10-18T02:57:08.000Z | 2021-05-19T15:34:13.000Z | tacker_horizon/openstack_dashboard/dashboards/nfv/vnffgmanager/tables.py | SSU-DCN/tacker-horizon | c4f27e2373b6d5d35ffc8ef37bf70bae9368d8b8 | [
"Apache-2.0"
] | null | null | null | tacker_horizon/openstack_dashboard/dashboards/nfv/vnffgmanager/tables.py | SSU-DCN/tacker-horizon | c4f27e2373b6d5d35ffc8ef37bf70bae9368d8b8 | [
"Apache-2.0"
] | 13 | 2015-11-10T00:32:05.000Z | 2021-07-19T04:48:30.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
# distributed under t... | 40.100478 | 75 | 0.544923 | # 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
# distributed under t... | 0 | 519 | 0 | 6,756 | 0 | 0 | 0 | 191 | 362 |
3d646c4573e5fb1a412e056c57c1d6a4b20d5638 | 2,502 | py | Python | cairis/gui/SingleGoalPanel.py | nathanjenx/cairis | 06d2d592b64af20746b9a2713551db597af46805 | [
"Apache-2.0"
] | null | null | null | cairis/gui/SingleGoalPanel.py | nathanjenx/cairis | 06d2d592b64af20746b9a2713551db597af46805 | [
"Apache-2.0"
] | null | null | null | cairis/gui/SingleGoalPanel.py | nathanjenx/cairis | 06d2d592b64af20746b9a2713551db597af46805 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | 48.115385 | 109 | 0.792166 | # 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... | 0 | 0 | 0 | 1,470 | 0 | 0 | 0 | 49 | 156 |
bdb3f852648237aedbb48bf44174a066e9789861 | 3,903 | py | Python | handlers/noticenter.py | jam0929/hanasee-server-python | 87d68a1ea86b2ca65b704c73ac52f74db5739cce | [
"MIT"
] | null | null | null | handlers/noticenter.py | jam0929/hanasee-server-python | 87d68a1ea86b2ca65b704c73ac52f74db5739cce | [
"MIT"
] | null | null | null | handlers/noticenter.py | jam0929/hanasee-server-python | 87d68a1ea86b2ca65b704c73ac52f74db5739cce | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
| 28.698529 | 123 | 0.613118 | # -*- coding: utf-8 -*-
from init import InitHandler
from model.users import Users
from model.notifications import Logs
from model.notifications import NotiCenter, Notification_Settings, Messages
from datetime import datetime
from datetime import timedelta
from google.appengine.ext import ndb
import logging
im... | 0 | 0 | 0 | 3,522 | 0 | 0 | 0 | 99 | 257 |
5abfcb366bb22cdd209cfa49fa45ce2ceaf30474 | 1,869 | py | Python | basket/contexts.py | Gregory4321/cooks_finest | a7980ede050882ded5471d1cdb0dab216256a12a | [
"PostgreSQL"
] | null | null | null | basket/contexts.py | Gregory4321/cooks_finest | a7980ede050882ded5471d1cdb0dab216256a12a | [
"PostgreSQL"
] | null | null | null | basket/contexts.py | Gregory4321/cooks_finest | a7980ede050882ded5471d1cdb0dab216256a12a | [
"PostgreSQL"
] | 1 | 2021-04-30T10:53:30.000Z | 2021-04-30T10:53:30.000Z | """
Basket contexts.py
"""
from decimal import Decimal
from django.conf import settings
from django.shortcuts import get_object_or_404
from products.models import Product
def basket_contents(request):
"""
Contexts for basket contents
"""
basket_items = []
total = 0
product_count = 0
baske... | 29.203125 | 74 | 0.583735 | """
Basket contexts.py
"""
from decimal import Decimal
from django.conf import settings
from django.shortcuts import get_object_or_404
from products.models import Product
def basket_contents(request):
"""
Contexts for basket contents
"""
basket_items = []
total = 0
product_count = 0
baske... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bc5e941ef3709e57d12a6009eaf00b85877beda4 | 296 | py | Python | #232div2/b_[inspiredAgainBy]xk.py | SnowOnion/CodeForcesLee | c2e964432ce9c2f6ca0c9038934c10f1bf1268b3 | [
"MIT"
] | null | null | null | #232div2/b_[inspiredAgainBy]xk.py | SnowOnion/CodeForcesLee | c2e964432ce9c2f6ca0c9038934c10f1bf1268b3 | [
"MIT"
] | null | null | null | #232div2/b_[inspiredAgainBy]xk.py | SnowOnion/CodeForcesLee | c2e964432ce9c2f6ca0c9038934c10f1bf1268b3 | [
"MIT"
] | null | null | null | #@ status AC
t=int(raw_input())
for time in xrange(t):
n,l,r=map(int,raw_input().split(' '))
# xk: exist k, s.t. l*k<=n<=r*k,
# namely exist k s.t. float(n/r)<=k<=float(n/l), namely int(n/l)>int((n-1)/r)
# @GET math is good
if n/l>(n-1)/r:
print 'Yes'
else:
print 'No' | 19.733333 | 79 | 0.540541 | #@ status AC
t=int(raw_input())
for time in xrange(t):
n,l,r=map(int,raw_input().split(' '))
# xk: exist k, s.t. l*k<=n<=r*k,
# namely exist k s.t. float(n/r)<=k<=float(n/l), namely int(n/l)>int((n-1)/r)
# @GET math is good
if n/l>(n-1)/r:
print 'Yes'
else:
print 'No' | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1055305b0413204fbeda4c49ee089e549fd5204a | 17,968 | py | Python | Phase4/ui.py | aadarshraghunathan/DAA | 0d78ce33a36df66616da740244ad1a7ec65cc2ca | [
"MIT"
] | null | null | null | Phase4/ui.py | aadarshraghunathan/DAA | 0d78ce33a36df66616da740244ad1a7ec65cc2ca | [
"MIT"
] | null | null | null | Phase4/ui.py | aadarshraghunathan/DAA | 0d78ce33a36df66616da740244ad1a7ec65cc2ca | [
"MIT"
] | null | null | null | import subprocess as sp
import pymysql
import pymysql.err
import pymysql.cursors
"""
Functions for different options
"""
# -------------------------------------------------------------------------------
# End of Functionalities
def dispatch(ch):
"""
Function that maps helper functions to ... | 30.402707 | 250 | 0.535841 | import subprocess as sp
import pymysql
import pymysql.err
import pymysql.cursors
"""
Functions for different options
"""
def get_feedback(): # Finds specific record in Feedback
try:
entry = {}
print("Enter the Feedback details:- ")
entry["Waiter"] = input("Waiter ID: ").strip()
e... | 0 | 0 | 0 | 0 | 0 | 12,949 | 0 | 0 | 414 |
e7d27b93b554f8748289adf59449df23f0251e20 | 3,326 | py | Python | news_comment_spider/news_comment_spider/pipelines.py | zwh42/NewsSentimentAnalysis | b7ce2d6423fd016a4f9d55cc482195e4b7f925d5 | [
"MIT"
] | null | null | null | news_comment_spider/news_comment_spider/pipelines.py | zwh42/NewsSentimentAnalysis | b7ce2d6423fd016a4f9d55cc482195e4b7f925d5 | [
"MIT"
] | null | null | null | news_comment_spider/news_comment_spider/pipelines.py | zwh42/NewsSentimentAnalysis | b7ce2d6423fd016a4f9d55cc482195e4b7f925d5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
import sys
import os
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../../')))
| 36.152174 | 134 | 0.658449 | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
import pymysql
import sys
import os
import path
import re
import pandas
from snownlp import SnowNLP
sys.path.append(os.path.a... | 15 | 0 | 0 | 2,849 | 0 | 0 | 0 | -11 | 178 |
2b4bd5e574134b845e888104ccb6b9579cea6129 | 1,185 | py | Python | switch.py | furuya02/LexClient_made_with_RasPI | e17f03ca38817952d247d411e93ca7e8b713d395 | [
"MIT"
] | null | null | null | switch.py | furuya02/LexClient_made_with_RasPI | e17f03ca38817952d247d411e93ca7e8b713d395 | [
"MIT"
] | null | null | null | switch.py | furuya02/LexClient_made_with_RasPI | e17f03ca38817952d247d411e93ca7e8b713d395 | [
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
"""
"""
import RPi.GPIO as GPIO
# | 26.931818 | 71 | 0.389873 |
# -*- coding: utf-8 -*-
"""
スイッチを制御するクラス
"""
import RPi.GPIO as GPIO
import time
# スイッチ制御クラス
class Switch:
def __init__(self, on, off):
GPIO.setmode(GPIO.BCM)
GPIO.setup(15,GPIO.OUT)
GPIO.setup(14,GPIO.IN)
self.__on = on
self.__off = off
self.__loop()
def _... | 198 | 0 | 0 | 1,024 | 0 | 0 | 0 | -10 | 44 |
b77ed83081e78b42224f669147525b99c9c0600a | 2,482 | py | Python | tools/preprocess_utils/geometry.py | shiyutang/MedicalSeg | 68c670b2cdee6ee4b8d28020735a95142e862fa8 | [
"Apache-2.0"
] | 18 | 2021-12-11T01:26:57.000Z | 2022-02-14T15:38:07.000Z | tools/preprocess_utils/geometry.py | shiyutang/MedicalSeg | 68c670b2cdee6ee4b8d28020735a95142e862fa8 | [
"Apache-2.0"
] | 8 | 2021-12-16T06:20:46.000Z | 2022-03-01T01:50:57.000Z | tools/preprocess_utils/geometry.py | shiyutang/MedicalSeg | 68c670b2cdee6ee4b8d28020735a95142e862fa8 | [
"Apache-2.0"
] | 7 | 2021-12-08T09:56:15.000Z | 2022-02-28T13:01:54.000Z | # Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 35.457143 | 90 | 0.680097 | # Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 26 |
86430e310025345777821fe5fb7d2b964bf25fca | 6,271 | py | Python | src/west/runners/pyocd.py | ulfalizer/west | 1b11d2f383b249d96d0d849c778c1ed37f96001c | [
"Apache-2.0"
] | null | null | null | src/west/runners/pyocd.py | ulfalizer/west | 1b11d2f383b249d96d0d849c778c1ed37f96001c | [
"Apache-2.0"
] | null | null | null | src/west/runners/pyocd.py | ulfalizer/west | 1b11d2f383b249d96d0d849c778c1ed37f96001c | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2017 Linaro Limited.
#
# SPDX-License-Identifier: Apache-2.0
'''Runner for pyOCD .'''
DEFAULT_PYOCD_GDB_PORT = 3333
| 37.327381 | 81 | 0.560198 | # Copyright (c) 2017 Linaro Limited.
#
# SPDX-License-Identifier: Apache-2.0
'''Runner for pyOCD .'''
import os
import sys
from west.runners.core import ZephyrBinaryRunner, RunnerCaps, BuildConfiguration
from west import log
DEFAULT_PYOCD_GDB_PORT = 3333
class PyOcdBinaryRunner(ZephyrBinaryRunner):
'''Runner ... | 0 | 2,354 | 0 | 3,634 | 0 | 0 | 0 | 35 | 113 |
9da57bbd561ca13f28a363f10c7db3071ea42141 | 3,462 | py | Python | softwarecollections/scls/migrations/0003_other_repos.py | WEBZCC/softwarecollections | efee5c3c276033d526a0cdba504d43deff71581e | [
"BSD-3-Clause"
] | 39 | 2016-12-24T02:57:55.000Z | 2022-02-15T09:29:43.000Z | softwarecollections/scls/migrations/0003_other_repos.py | WEBZCC/softwarecollections | efee5c3c276033d526a0cdba504d43deff71581e | [
"BSD-3-Clause"
] | 32 | 2016-11-21T15:05:07.000Z | 2021-12-06T11:52:32.000Z | softwarecollections/scls/migrations/0003_other_repos.py | WEBZCC/softwarecollections | efee5c3c276033d526a0cdba504d43deff71581e | [
"BSD-3-Clause"
] | 13 | 2016-12-14T10:42:22.000Z | 2022-01-01T20:35:15.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
| 42.740741 | 169 | 0.601098 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def migrate_centos_repos(apps, schema_editor):
CentOSRepo = apps.get_model('scls', 'CentOSRepo')
OtherRepo = apps.get_model('scls', 'OtherRepo')
SoftwareCollection = apps.get_model... | 0 | 0 | 0 | 2,120 | 0 | 1,187 | 0 | 19 | 69 |
b41d4f791bbab87f57f62308817ab4a1fc087f38 | 1,357 | py | Python | benchmarks/models.py | mcoughlin/sncosmo | f2933b269bd6d6e767ab93a23f3ab14ee90398f0 | [
"BSD-3-Clause"
] | 51 | 2015-01-14T23:38:36.000Z | 2021-12-29T15:15:10.000Z | benchmarks/models.py | mcoughlin/sncosmo | f2933b269bd6d6e767ab93a23f3ab14ee90398f0 | [
"BSD-3-Clause"
] | 233 | 2015-01-04T22:49:10.000Z | 2022-03-17T03:48:59.000Z | benchmarks/models.py | mcoughlin/sncosmo | f2933b269bd6d6e767ab93a23f3ab14ee90398f0 | [
"BSD-3-Clause"
] | 55 | 2015-01-09T00:30:38.000Z | 2022-01-08T17:51:55.000Z | #!/usr/bin/env python
"""Run benchmarks for model synthetic photometry"""
import time
from collections import OrderedDict
import numpy as np
import sncosmo
delim = 61 * "-"
# test data
ndata = 100 # make divisible by 4!
dates = np.linspace(-15., 40., ndata)
bands = np.array((ndata//4) * ['desg', 'desr', 'desi', 'sds... | 28.270833 | 64 | 0.597642 | #!/usr/bin/env python
"""Run benchmarks for model synthetic photometry"""
import time
import os
import glob
import argparse
from collections import OrderedDict
import numpy as np
import sncosmo
delim = 61 * "-"
# test data
ndata = 100 # make divisible by 4!
dates = np.linspace(-15., 40., ndata)
bands = np.array((nda... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -28 | 66 |
74d65214648e584ca9d18e7939517842fb9a8f29 | 4,237 | py | Python | plugins/modules/truenas_api_pool_snapshottask.py | nkiraly/ansible-collection-spatiumcepa-truenas | 285292ba42de2e4ad9b756024eb0eb69f61424f1 | [
"BSD-2-Clause"
] | 1 | 2022-01-21T18:57:06.000Z | 2022-01-21T18:57:06.000Z | plugins/modules/truenas_api_pool_snapshottask.py | nkiraly/ansible-collection-spatiumcepa-truenas | 285292ba42de2e4ad9b756024eb0eb69f61424f1 | [
"BSD-2-Clause"
] | 1 | 2021-07-28T01:56:48.000Z | 2021-07-28T01:56:48.000Z | plugins/modules/truenas_api_pool_snapshottask.py | nkiraly/ansible-collection-spatiumcepa-truenas | 285292ba42de2e4ad9b756024eb0eb69f61424f1 | [
"BSD-2-Clause"
] | 1 | 2022-01-21T19:11:32.000Z | 2022-01-21T19:11:32.000Z | from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
"metadata_version": "1.1",
"status": ["preview"],
"supported_by": "community"
}
DOCUMENTATION = """
module: truenas_api_pool_snapshottask
short_description: Manage TrueNAS Pool Snapshottasks
descr... | 26.987261 | 106 | 0.633939 | from __future__ import absolute_import, division, print_function
from ansible_collections.spatiumcepa.truenas.plugins.module_utils.common import HTTPCode, HTTPResponse, \
TruenasServerError, TruenasModelError, TruenasUnexpectedResponse, strip_null_module_params
from ansible_collections.spatiumcepa.truenas.plugins.m... | 0 | 0 | 0 | 0 | 0 | 1,699 | 0 | 420 | 133 |
c3913fc2b71f6ba89a9cbf5737e6fa4d8dc829bb | 10,211 | py | Python | apps/users/views.py | HuChangShan/MyMOOC | 4f82a70da58dbd06f4bf2200ac320595421b5625 | [
"MIT"
] | null | null | null | apps/users/views.py | HuChangShan/MyMOOC | 4f82a70da58dbd06f4bf2200ac320595421b5625 | [
"MIT"
] | null | null | null | apps/users/views.py | HuChangShan/MyMOOC | 4f82a70da58dbd06f4bf2200ac320595421b5625 | [
"MIT"
] | null | null | null | # coding:utf-8
# Create your views here.
| 29.856725 | 99 | 0.724121 | # coding:utf-8
import json
from django.shortcuts import render, render_to_response
from django.core.urlresolvers import reverse
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth import authenticate, login, logout
from django.db.models import Q
from django.views.generic import View
from dja... | 606 | 0 | 0 | 8,380 | 0 | 208 | 0 | 502 | 859 |
a5cd964fee2620673dea679baa4f2565369805b3 | 6,187 | py | Python | myTransforms/aug_spatial.py | sunshinnnn/DSMnet | eed7a4de12f93cd625e1e68758aa4c3193a60d28 | [
"Apache-2.0"
] | 31 | 2018-08-14T04:05:41.000Z | 2022-02-07T06:23:22.000Z | myTransforms/aug_spatial.py | sunshinnnn/DSMnet | eed7a4de12f93cd625e1e68758aa4c3193a60d28 | [
"Apache-2.0"
] | 3 | 2019-04-08T23:25:03.000Z | 2020-12-09T20:05:38.000Z | myTransforms/aug_spatial.py | sunshinnnn/DSMnet | eed7a4de12f93cd625e1e68758aa4c3193a60d28 | [
"Apache-2.0"
] | 8 | 2018-08-14T04:05:44.000Z | 2021-03-16T16:10:57.000Z | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
| 36.181287 | 79 | 0.477453 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import cv2
import numpy as np
class Spatial_stereo(object):
'''空间变换(缩放,平移,随机裁剪)'''
def __init__(self, size_crop=[768, 384], scale_delt=0.5, shift_max=32):
self.size_crop = size_crop
self.ws = 0
self.hs = 0
self.scale_rand = 1
... | 735 | 0 | 0 | 5,816 | 0 | 0 | 0 | -14 | 91 |
17612adf450c55478d40795c36878fe651ef6ecf | 10,794 | py | Python | floris/wake_velocity.py | nhamilto/doctest | 88de5b2d1aff81d67107e7d2243080445f40336e | [
"Apache-2.0"
] | null | null | null | floris/wake_velocity.py | nhamilto/doctest | 88de5b2d1aff81d67107e7d2243080445f40336e | [
"Apache-2.0"
] | null | null | null | floris/wake_velocity.py | nhamilto/doctest | 88de5b2d1aff81d67107e7d2243080445f40336e | [
"Apache-2.0"
] | null | null | null | """
Copyright 2017 NREL
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 distributed
un... | 44.057143 | 165 | 0.56272 | """
Copyright 2017 NREL
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 distributed
un... | 0 | 0 | 0 | 10,166 | 0 | 0 | 0 | 11 | 68 |
309c476cf05e56a4295e78eb9d65483c54ba2908 | 3,708 | py | Python | api/time_management.py | coord-e/lottery-backend | 4e1136ea62c471c98871ae28ad6b5144657151b4 | [
"MIT"
] | 3 | 2019-03-17T12:53:25.000Z | 2020-06-28T07:05:47.000Z | api/time_management.py | coord-e/lottery-backend | 4e1136ea62c471c98871ae28ad6b5144657151b4 | [
"MIT"
] | 297 | 2018-06-23T09:48:04.000Z | 2021-09-08T00:06:11.000Z | api/time_management.py | Sakuten/lottery-backend | 4e1136ea62c471c98871ae28ad6b5144657151b4 | [
"MIT"
] | 3 | 2019-03-07T15:38:19.000Z | 2019-03-30T08:00:14.000Z | from flask import current_app
import datetime
def mod_time(t, dt):
"""
Modify the supplied time with timedelta
Args:
t(datetime.time|datetime.datetime): The Time to modify
dt(datetime.timedelta): Difference
Returns:
time(datetime.time|datetime.datetime):... | 28.523077 | 68 | 0.633765 | from flask import current_app
import datetime
def mod_time(t, dt):
"""
Modify the supplied time with timedelta
Args:
t(datetime.time|datetime.datetime): The Time to modify
dt(datetime.timedelta): Difference
Returns:
time(datetime.time|datetime.datetime):... | 0 | 0 | 0 | 245 | 0 | 400 | 0 | 0 | 69 |
75c4eb63a994475549672ea422a30092da6b987b | 276 | py | Python | Python/digitos_adjacentes.py | robertogoes/exercicios-coursera-python | 5093cc31ccda764b6131987fa81601b7179a9bfc | [
"MIT"
] | null | null | null | Python/digitos_adjacentes.py | robertogoes/exercicios-coursera-python | 5093cc31ccda764b6131987fa81601b7179a9bfc | [
"MIT"
] | null | null | null | Python/digitos_adjacentes.py | robertogoes/exercicios-coursera-python | 5093cc31ccda764b6131987fa81601b7179a9bfc | [
"MIT"
] | null | null | null | n = int(input("Digite um nmero inteiro:"))
ac1 = n%10
achouadjacente = False
n = n//10
while n !=0 and not(achouadjacente):
ac2 = n%10
if ac1 == ac2:
achouadjacente = True
n = n//10
ac1 = ac2
if achouadjacente:
print("sim")
else:
print("no")
| 18.4 | 43 | 0.594203 | n = int(input("Digite um número inteiro:"))
ac1 = n%10
achouadjacente = False
n = n//10
while n !=0 and not(achouadjacente):
ac2 = n%10
if ac1 == ac2:
achouadjacente = True
n = n//10
ac1 = ac2
if achouadjacente:
print("sim")
else:
print("não")
| 4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5595793dcbd07fa7f12a1e4e42524803cd94b917 | 1,242 | py | Python | tests/shared/test_grids.py | wheelerMT/pygpe | c0dc5dc7d2d6778b50103e47a3590472ee218261 | [
"MIT"
] | null | null | null | tests/shared/test_grids.py | wheelerMT/pygpe | c0dc5dc7d2d6778b50103e47a3590472ee218261 | [
"MIT"
] | null | null | null | tests/shared/test_grids.py | wheelerMT/pygpe | c0dc5dc7d2d6778b50103e47a3590472ee218261 | [
"MIT"
] | null | null | null | import pygpe.shared.grid as grid
| 30.292683 | 60 | 0.623188 | import unittest
import pygpe.shared.grid as grid
class TestGrid(unittest.TestCase):
def test_correct_mesh_shape(self):
"""
Tests to see whether meshgrids match the
shape of points passed in.
"""
shape = (64, 64)
grid2d = grid.Grid(shape, (0.5, 0.5))
self.... | 0 | 0 | 0 | 1,169 | 0 | 0 | 0 | -6 | 45 |
6adef8b74ace7f23d11b0509edfe3f3472602da6 | 3,380 | py | Python | water/PrecipitationMatrixTransformation/precipitation_matrix_transformation.py | KhaosResearch/TITAN-dockers | 545fd59f1b544902653f1042e74a479a65a59258 | [
"MIT"
] | 1 | 2022-02-23T10:55:37.000Z | 2022-02-23T10:55:37.000Z | water/PrecipitationMatrixTransformation/precipitation_matrix_transformation.py | KhaosResearch/TITAN-dockers | 545fd59f1b544902653f1042e74a479a65a59258 | [
"MIT"
] | null | null | null | water/PrecipitationMatrixTransformation/precipitation_matrix_transformation.py | KhaosResearch/TITAN-dockers | 545fd59f1b544902653f1042e74a479a65a59258 | [
"MIT"
] | null | null | null | import typer
if __name__ == "__main__":
typer.run(precipitationMatrixTransformation)
| 39.764706 | 115 | 0.646746 | import datetime
import os
from pathlib import Path
import pandas as pd
import typer
from numpy import NaN
def precipitationMatrixTransformation(
file_path: str = typer.Option(..., help="Path of AEMET Precipitation Test file"),
delimiter: str = typer.Option(..., help="Delimiter of CSV"),
):
os.chdir("dat... | 18 | 0 | 0 | 0 | 0 | 3,163 | 0 | -17 | 134 |
b0f400b2330ce8625e82057ad0e0377fab7b338d | 66 | py | Python | fabscript/__init__.py | syunkitada/fabkit-repo | 126d3507c3d395ca70662eb18d1c12d4588eb3ec | [
"MIT"
] | null | null | null | fabscript/__init__.py | syunkitada/fabkit-repo | 126d3507c3d395ca70662eb18d1c12d4588eb3ec | [
"MIT"
] | null | null | null | fabscript/__init__.py | syunkitada/fabkit-repo | 126d3507c3d395ca70662eb18d1c12d4588eb3ec | [
"MIT"
] | null | null | null | # coding: utf-8
# import openstack # noqa
# import test # noqa
| 13.2 | 26 | 0.651515 | # coding: utf-8
# import openstack # noqa
# import test # noqa
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
524d254a234ad9f7726d3a9b2cc28c9fee64e43b | 1,295 | py | Python | line_bot/Chat/models.py | MayGrass/LineBot_Django | 5c6bfad2829b291851e951d5331306b55c1b3d91 | [
"MIT"
] | null | null | null | line_bot/Chat/models.py | MayGrass/LineBot_Django | 5c6bfad2829b291851e951d5331306b55c1b3d91 | [
"MIT"
] | null | null | null | line_bot/Chat/models.py | MayGrass/LineBot_Django | 5c6bfad2829b291851e951d5331306b55c1b3d91 | [
"MIT"
] | null | null | null |
# Create your models here.
| 43.166667 | 97 | 0.752124 | from django.db import models
# Create your models here.
class Store(models.Model):
store_name = models.CharField(max_length=50, help_text="商家名稱", unique=True)
store_address = models.CharField(max_length=100, help_text="商家地址")
store_type = models.ManyToManyField("StoreType")
store_phone = models.CharFie... | 216 | 0 | 0 | 1,072 | 0 | 0 | 0 | 7 | 113 |
032253730186ee146cba59b1202a11ca861223d8 | 2,274 | py | Python | app.py | m1z0r3/gsahrk | d31b3b547e1d91fc8f5ec0cfd636d57f7de568b4 | [
"MIT"
] | 4 | 2019-01-11T15:33:20.000Z | 2020-06-17T07:47:55.000Z | app.py | m1z0r3/gsahrk | d31b3b547e1d91fc8f5ec0cfd636d57f7de568b4 | [
"MIT"
] | 5 | 2020-07-17T04:25:47.000Z | 2022-02-12T11:09:56.000Z | app.py | Fangrn/gshark | d31b3b547e1d91fc8f5ec0cfd636d57f7de568b4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from flask import Flask
app = Flask(__name__, static_folder='public')
app.config['JSON_AS_ASCII'] = False
if __name__ == '__main__':
app.run()
| 27.731707 | 92 | 0.700967 | #!/usr/bin/env python3
from flask import Flask
from flask import render_template, request, jsonify, redirect
from api import query
app = Flask(__name__, static_folder='public')
app.config['JSON_AS_ASCII'] = False
@app.route('/', methods=['GET'])
def index():
return redirect('/statistic')
@app.route('/flow', me... | 0 | 1,801 | 0 | 0 | 0 | 0 | 0 | 40 | 251 |
745ebedf8303b80e829cf57bd4b18fd7086cdc96 | 378 | py | Python | registrations/migrations/0003_auto_20210607_0356.py | eustone/PatientManagement | 9b4895edb509e6609afe766d7cf5b8844757d047 | [
"Apache-2.0"
] | 2 | 2020-03-27T14:22:22.000Z | 2020-03-27T15:53:52.000Z | registrations/migrations/0003_auto_20210607_0356.py | eustone/PatientManagement | 9b4895edb509e6609afe766d7cf5b8844757d047 | [
"Apache-2.0"
] | 5 | 2021-03-19T01:13:01.000Z | 2021-09-22T18:47:41.000Z | registrations/migrations/0003_auto_20210607_0356.py | eustone/PatientManagement | 9b4895edb509e6609afe766d7cf5b8844757d047 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.0.4 on 2021-06-07 03:56
| 19.894737 | 53 | 0.600529 | # Generated by Django 3.0.4 on 2021-06-07 03:56
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('registrations', '0002_auto_20210606_2145'),
]
operations = [
migrations.RenameField(
model_name='patientrecord',
old_name='a... | 0 | 0 | 0 | 272 | 0 | 0 | 0 | 11 | 46 |
7e18747d7151274e32faf3ae1af6171bc7f02f80 | 6,374 | py | Python | Main/User/views.py | 310224954/Fitapplication | c9169ad410be6c36fa37acedf604ec6a9f2eed6a | [
"bzip2-1.0.6"
] | null | null | null | Main/User/views.py | 310224954/Fitapplication | c9169ad410be6c36fa37acedf604ec6a9f2eed6a | [
"bzip2-1.0.6"
] | null | null | null | Main/User/views.py | 310224954/Fitapplication | c9169ad410be6c36fa37acedf604ec6a9f2eed6a | [
"bzip2-1.0.6"
] | null | null | null | # from django.db import IntegrityError
#Workign one but not connecting
# @login_required
# def add_prod_to_diet(request, pk):
# user_profile = Profile.objects.get(user = request.user)
# product = Products.objects.filter(pk = pk).first()
# user_product, prod_created = UserProd.objects.get_or_cr... | 29.924883 | 120 | 0.694697 | from django.shortcuts import render,redirect, get_object_or_404
from django.http import HttpResponse
from django.views.generic import ListView, DetailView, CreateView, UpdateView, DeleteView
from django.contrib import messages
from django.contrib.auth.decorators import login_required
# from django.db import IntegrityEr... | 0 | 758 | 0 | 382 | 0 | 1,304 | 0 | 287 | 359 |
7291b9f834f52d5467d565d3aa9a8ac17c4bc098 | 7,887 | py | Python | FMNIST/TAE.py | Sungyeop/IPRL | 6ee17f415998ac5cc058c63cea06a5cad40b267c | [
"MIT"
] | 2 | 2021-02-08T05:34:45.000Z | 2021-03-02T08:36:06.000Z | FMNIST/TAE.py | Sungyeop/IPRL | 6ee17f415998ac5cc058c63cea06a5cad40b267c | [
"MIT"
] | null | null | null | FMNIST/TAE.py | Sungyeop/IPRL | 6ee17f415998ac5cc058c63cea06a5cad40b267c | [
"MIT"
] | null | null | null | import torch
from torch import nn
from torchvision import transforms, datasets
# Training Options
#==============================================================================================================
EPOCH = 50 # Epoch
batch = 100 # mini-batch size
n = 50 # the number ... | 30.929412 | 117 | 0.567389 | import numpy as np
import copy
import torch
import torchvision
from torch import nn, optim
from torchvision import transforms, datasets
from scipy.spatial.distance import pdist, squareform
from scipy.special import expit
import matplotlib.pyplot as plt
# Training Options
#=============================================... | 0 | 0 | 0 | 396 | 0 | 5,433 | 0 | 42 | 339 |
fc50abc4c3c110500e72a7fddc69cb7213fc9851 | 2,122 | py | Python | bitfinex/main.py | assassinen/coursera_mfti_python | eee7b3c55256f391c1be32924fa1ad3364b307f2 | [
"Apache-2.0"
] | null | null | null | bitfinex/main.py | assassinen/coursera_mfti_python | eee7b3c55256f391c1be32924fa1ad3364b307f2 | [
"Apache-2.0"
] | null | null | null | bitfinex/main.py | assassinen/coursera_mfti_python | eee7b3c55256f391c1be32924fa1ad3364b307f2 | [
"Apache-2.0"
] | null | null | null |
if __name__ == "__main__":
find_bot_params()
| 39.296296 | 117 | 0.590481 | from bitfinex.model.bot import Bot
from bitfinex.api.data import Ticker, Candles
from bitfinex.states.states import OrderDir
def find_bot_params():
symbol = 'tETHBTC'
bot_list = []
for spread in range (10, 25, 5):
for step in range (1, 2, 2):
bot_list.append(Bot(tiker=symbol, spread=sp... | 0 | 0 | 0 | 0 | 0 | 1,895 | 0 | 59 | 112 |
c73ce4c38cf482cdec5db85589a47b2f39f0adb3 | 9,851 | py | Python | test_and_tune/x86debug/tune_relay_cuda.py | TVM-for-armgpu/tvm | 4c4392306f5b4d21e85d633231bae71e935f39a2 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | 1 | 2022-03-19T12:21:33.000Z | 2022-03-19T12:21:33.000Z | test_and_tune/x86debug/tune_relay_cuda.py | TVM-for-armgpu/tvm | 4c4392306f5b4d21e85d633231bae71e935f39a2 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | null | null | null | test_and_tune/x86debug/tune_relay_cuda.py | TVM-for-armgpu/tvm | 4c4392306f5b4d21e85d633231bae71e935f39a2 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 35.308244 | 100 | 0.641864 | # 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 | 0 | 0 | 0 | 0 | 2,775 | 0 | 63 | 135 |
9bb7d45e009700690dbad4bd20d2e8e36447255c | 448 | py | Python | Exercicios-Python/076.py | LuizHenriqudesouza419/Exercicios-de-Python3-main | af53cc1eea1e22a304e206a453c4b24bf67615a8 | [
"MIT"
] | 1 | 2021-11-08T22:59:33.000Z | 2021-11-08T22:59:33.000Z | Exercicios-Python/076.py | LuizHenriqudesouza419/Exercicios-de-Python3-main | af53cc1eea1e22a304e206a453c4b24bf67615a8 | [
"MIT"
] | null | null | null | Exercicios-Python/076.py | LuizHenriqudesouza419/Exercicios-de-Python3-main | af53cc1eea1e22a304e206a453c4b24bf67615a8 | [
"MIT"
] | null | null | null | listagem = ('lapis', 1.75,
'Borracha', 2,
'Caderno', 15.90,
'Estojo', 25,
'Trasferidor', 4.20,
'Compasso', 9.90,
'Mochila ', 120.30,
'Canetas', 22.90,
'Livros', 100)
print('Listagem de preos:')
print('--' * 17)
for pos in range(0, len(lista... | 26.352941 | 46 | 0.464286 | listagem = ('lapis', 1.75,
'Borracha', 2,
'Caderno', 15.90,
'Estojo', 25,
'Trasferidor', 4.20,
'Compasso', 9.90,
'Mochila ', 120.30,
'Canetas', 22.90,
'Livros', 100)
print('Listagem de preços:')
print('--' * 17)
for pos in range(0, len(list... | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9dead35844580222c266a881675e30d222fd85a7 | 1,311 | py | Python | floodsystem/flood.py | angelinaachillea/New-Floods | 6a01918be6bfb2475d5cdbcf2d3d0cfb94dcedb2 | [
"MIT"
] | null | null | null | floodsystem/flood.py | angelinaachillea/New-Floods | 6a01918be6bfb2475d5cdbcf2d3d0cfb94dcedb2 | [
"MIT"
] | null | null | null | floodsystem/flood.py | angelinaachillea/New-Floods | 6a01918be6bfb2475d5cdbcf2d3d0cfb94dcedb2 | [
"MIT"
] | null | null | null |
'''
def stations_highest_rel_level(stations, N):
for station in stations:
x= sorted_by_key(stations,station.latest_level,True)
At_risk_stations=x[:N]
return At_risk_stations
'''
| 39.727273 | 118 | 0.729214 | from secrets import token_urlsafe
from floodsystem.utils import sorted_by_key, gt_with_none
def stations_level_over_threshold(stations, tol):
#for station in stations:
# if gt_with_none(station.relative_water_level(), tol) and station.name != "Letcombe Bassett"], 1, True)
#return sorted_by_key(station... | 0 | 0 | 0 | 0 | 0 | 967 | 0 | 48 | 90 |
be1376ad7399f704cfc63c267b685df172d71a34 | 349 | py | Python | backend/run_dev.py | rk250ky/coworktest | 466f5eb262cba3753388bd6c77e7604640ed1d77 | [
"MIT"
] | null | null | null | backend/run_dev.py | rk250ky/coworktest | 466f5eb262cba3753388bd6c77e7604640ed1d77 | [
"MIT"
] | 21 | 2021-10-11T11:43:19.000Z | 2022-02-27T19:18:56.000Z | backend/run_dev.py | rk250ky/coworktest | 466f5eb262cba3753388bd6c77e7604640ed1d77 | [
"MIT"
] | 2 | 2021-10-16T11:52:43.000Z | 2021-11-15T16:25:08.000Z | from app import create_app
from pathlib import Path
from app.seedDB import seed_database
from app.utils import migrate_database
config = Path("config/development.py")
application = create_app(config) # call from wsgi server
migrate_database(application)
seed_database(application)
if __name__ == "__main... | 23.266667 | 58 | 0.765043 | from app import create_app
from pathlib import Path
from app.seedDB import seed_database
from app.utils import migrate_database
config = Path("config/development.py")
application = create_app(config) # call from wsgi server
migrate_database(application)
seed_database(application)
if __name__ == "__main... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ae2b35f2c999b3bdc6de6b24616857badac595b4 | 45 | py | Python | polyglot/__init__.py | jmcclelland/polyglot | e1afc5937cfd4d38dba5e4e4689db016a255b2b4 | [
"MIT"
] | null | null | null | polyglot/__init__.py | jmcclelland/polyglot | e1afc5937cfd4d38dba5e4e4689db016a255b2b4 | [
"MIT"
] | null | null | null | polyglot/__init__.py | jmcclelland/polyglot | e1afc5937cfd4d38dba5e4e4689db016a255b2b4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
__version__ = "2.1.4"
| 15 | 22 | 0.666667 | #!/usr/bin/env python3
__version__ = "2.1.4"
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bcb70cc98910ff0c7c7a032a386ff90efefecb5b | 7,067 | py | Python | allennlp/tests/semparse/worlds/text2sql_world_test.py | annaproxy/udify-metalearning | 55206a3aac0aba74a3615a36192d03b6467cfd6f | [
"MIT"
] | 65 | 2020-11-13T05:36:29.000Z | 2022-03-26T22:45:46.000Z | allennlp/tests/semparse/worlds/text2sql_world_test.py | annaproxy/udify-metalearning | 55206a3aac0aba74a3615a36192d03b6467cfd6f | [
"MIT"
] | 11 | 2021-05-26T16:22:17.000Z | 2022-03-02T04:03:18.000Z | allennlp/tests/semparse/worlds/text2sql_world_test.py | annaproxy/udify-metalearning | 55206a3aac0aba74a3615a36192d03b6467cfd6f | [
"MIT"
] | 10 | 2020-11-21T15:25:02.000Z | 2022-02-25T11:09:50.000Z | # pylint: disable=too-many-lines,invalid-name
| 57.455285 | 110 | 0.539267 | # pylint: disable=too-many-lines,invalid-name
import sqlite3
from parsimonious import Grammar, ParseError
from allennlp.common.testing import AllenNlpTestCase
from allennlp.semparse.worlds.text2sql_world import Text2SqlWorld
from allennlp.semparse.contexts.sql_context_utils import format_grammar_string
from allennlp... | 0 | 0 | 0 | 6,668 | 0 | 0 | 0 | 194 | 158 |
ab6d92449f6470eeb4f83a9db598f85e004d961a | 901 | py | Python | geolocate/classes/exceptions.py | kayodebristol/geolocate | a05a5875f71b2523cac20a385d15009b3ef0a402 | [
"BSD-3-Clause"
] | 4 | 2015-11-25T12:18:30.000Z | 2019-09-22T23:47:26.000Z | geolocate/classes/exceptions.py | kayodebristol/geolocate | a05a5875f71b2523cac20a385d15009b3ef0a402 | [
"BSD-3-Clause"
] | 1 | 2015-05-19T11:23:25.000Z | 2015-06-26T22:37:36.000Z | geolocate/classes/exceptions.py | kayodebristol/geolocate | a05a5875f71b2523cac20a385d15009b3ef0a402 | [
"BSD-3-Clause"
] | 2 | 2017-05-29T17:28:13.000Z | 2021-06-16T20:45:46.000Z | """
Custom exceptions for geolocate.
Programmed by: Dante Signal31
email: dante.signal31@gmail.com
"""
# TODO: Find the way to take this code back to geowrapper module.
# This class shouldn't be here. Initially it was defined at geowrapper module.
# Problem is that when class is there, test_GeolocateInputParser_n... | 40.954545 | 83 | 0.748058 | """
Custom exceptions for geolocate.
Programmed by: Dante Signal31
email: dante.signal31@gmail.com
"""
# TODO: Find the way to take this code back to geowrapper module.
# This class shouldn't be here. Initially it was defined at geowrapper module.
# Problem is that when class is there, test_GeolocateInputParser_n... | 0 | 0 | 0 | 266 | 0 | 0 | 0 | 0 | 22 |
15196245c4165b4664f45abc5cd1f8f45ff309f0 | 18,536 | py | Python | Code/Train_cLapIRN_2D.py | cwmok/Conditional_LapIRN | c0b689ce8ec43c93315c03ae1bee0f6bb5dc74df | [
"MIT"
] | 28 | 2021-06-13T08:19:35.000Z | 2022-03-10T02:09:03.000Z | Code/Train_cLapIRN_2D.py | cwmok/Conditional_LapIRN | c0b689ce8ec43c93315c03ae1bee0f6bb5dc74df | [
"MIT"
] | 5 | 2021-07-07T18:54:09.000Z | 2022-03-14T03:20:43.000Z | Code/Train_cLapIRN_2D.py | cwmok/Conditional_LapIRN | c0b689ce8ec43c93315c03ae1bee0f6bb5dc74df | [
"MIT"
] | 5 | 2021-09-17T11:20:03.000Z | 2022-02-14T02:48:18.000Z | import os
from argparse import ArgumentParser
from datetime import datetime
parser = ArgumentParser()
parser.add_argument("--lr", type=float,
dest="lr", default=1e-4, help="learning rate")
parser.add_argument("--iteration_lvl1", type=int,
dest="iteration_lvl1", default=20001,
... | 41.375 | 126 | 0.575529 | import glob
import os
import sys
from argparse import ArgumentParser
from datetime import datetime
import numpy as np
import torch
import torch.utils.data as Data
import torch.nn.functional as F
from Functions import generate_grid, Dataset_epoch, Dataset_epoch_validation, transform_unit_flow_to_flow_cuda, \
gener... | 0 | 0 | 0 | 0 | 0 | 15,342 | 0 | 407 | 270 |
57ebee473b399f123a9d00644e62b1adaf973d6c | 862 | py | Python | kraken/performance_dashboards/setup.py | amitsagtani97/kraken | a14f4c2561783a611cd9b969c80415fb680ed974 | [
"Apache-2.0"
] | null | null | null | kraken/performance_dashboards/setup.py | amitsagtani97/kraken | a14f4c2561783a611cd9b969c80415fb680ed974 | [
"Apache-2.0"
] | null | null | null | kraken/performance_dashboards/setup.py | amitsagtani97/kraken | a14f4c2561783a611cd9b969c80415fb680ed974 | [
"Apache-2.0"
] | null | null | null |
# Installs a mutable grafana on the Kubernetes/OpenShift cluster and loads the performance dashboards
| 43.1 | 101 | 0.721578 | import subprocess
import logging
import git
# Installs a mutable grafana on the Kubernetes/OpenShift cluster and loads the performance dashboards
def setup(repo):
command = "cd /tmp/performance-dashboards/dittybopper && ./deploy.sh"
delete_repo = "rm -rf /tmp/performance-dashboards || exit 0"
logging.info... | 0 | 0 | 0 | 0 | 0 | 692 | 0 | -22 | 88 |
2e7ca46806856c7aa6e39e1402105f0b71575e03 | 24,097 | py | Python | django_form_builder/dynamic_fields.py | RAJKRIS/django-form-builder | 2453988ea540c17e5eeec62d4cdbc1e3d57d71e6 | [
"Apache-2.0"
] | 32 | 2019-07-12T09:40:17.000Z | 2022-03-27T00:13:04.000Z | django_form_builder/dynamic_fields.py | RAJKRIS/django-form-builder | 2453988ea540c17e5eeec62d4cdbc1e3d57d71e6 | [
"Apache-2.0"
] | 9 | 2020-02-17T11:52:23.000Z | 2022-03-11T14:26:36.000Z | django_form_builder/dynamic_fields.py | RAJKRIS/django-form-builder | 2453988ea540c17e5eeec62d4cdbc1e3d57d71e6 | [
"Apache-2.0"
] | 14 | 2020-01-29T01:13:18.000Z | 2022-03-07T15:20:38.000Z | import logging
from django.conf import settings
from . enc import encrypt
from . formsets import build_formset
from . utils import (format_field_name, _split_choices, _split_choices_in_list_canc, _successivo_ad_oggi)
logger = logging.getLogger(__name__)
get_signatures = None
try:
from filesig.filesig import get_... | 33.655028 | 122 | 0.628169 | import ast
import base64
import inspect
import json
import logging
import os
import random
import re
import string
import sys
from django import forms
from django.conf import settings
from django.core.exceptions import ValidationError
from django.core.validators import MinValueValidator, MaxValueValidator
from django.... | 6 | 0 | 0 | 20,773 | 0 | 379 | 0 | 250 | 1,244 |
711107f4f80c6ac3204f8f1a23c6d88c56b2ac53 | 1,877 | py | Python | tests/transcript/test_Kozak.py | gagneurlab/gfeat | a5ddb081567253ee2d6046485f81941bebb1f0f9 | [
"MIT"
] | 2 | 2018-09-28T21:30:07.000Z | 2020-06-09T15:54:24.000Z | tests/transcript/test_Kozak.py | gagneurlab/gfeat | a5ddb081567253ee2d6046485f81941bebb1f0f9 | [
"MIT"
] | 1 | 2021-11-15T17:47:48.000Z | 2021-11-15T17:47:48.000Z | tests/transcript/test_Kozak.py | gagneurlab/gfeat | a5ddb081567253ee2d6046485f81941bebb1f0f9 | [
"MIT"
] | null | null | null | """
Test get_Kozak_seq, get_consensus_Kozak_seq and get_line_Kozak_matrix
"""
| 41.711111 | 75 | 0.443793 | """
Test get_Kozak_seq, get_consensus_Kozak_seq and get_line_Kozak_matrix
"""
from tests.transcript.config import genome, transcript2
import pandas as pd
import pandas.util.testing as pdt
def test_get_Kosak_seq(transcript2):
res = transcript2.get_Kozak_seq()
assert res == "AAGCAGATGGTGGCT"
def test_get_co... | 0 | 0 | 0 | 0 | 0 | 1,591 | 0 | 44 | 160 |
0b9ebd7f50ebcf431c15405bf1d6de861cfd7ba8 | 9,639 | py | Python | clarify/serve/utils/cloudrun_utils.py | cwbeitel/clarify | b54bde103684f19b2da1e455c4231aeb6ad0a771 | [
"Apache-2.0"
] | 8 | 2020-01-24T20:53:21.000Z | 2021-04-02T11:18:56.000Z | clarify/serve/utils/cloudrun_utils.py | cwbeitel/clarify | b54bde103684f19b2da1e455c4231aeb6ad0a771 | [
"Apache-2.0"
] | 123 | 2020-01-16T00:29:27.000Z | 2022-03-08T23:39:36.000Z | clarify/serve/utils/cloudrun_utils.py | hmallen99/project_clarify | 2753e82046a8fa94e55165f84b154ecdacdeb558 | [
"Apache-2.0"
] | 4 | 2020-02-01T05:11:37.000Z | 2020-03-22T23:35:45.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
# distributed under th... | 30.503165 | 79 | 0.665629 | # 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
# distributed under th... | 0 | 0 | 0 | 0 | 0 | 5,929 | 0 | 122 | 475 |