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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ac724d362e01703fe1025a3e0157a5f123aafc88 | 8,178 | py | Python | main.py | Othko97/LotRchargen | 5741781f3e43cee0ebc949af15c2fd9aba231d4b | [
"MIT"
] | 1 | 2018-01-19T18:47:04.000Z | 2018-01-19T18:47:04.000Z | main.py | Othko97/LotRchargen | 5741781f3e43cee0ebc949af15c2fd9aba231d4b | [
"MIT"
] | null | null | null | main.py | Othko97/LotRchargen | 5741781f3e43cee0ebc949af15c2fd9aba231d4b | [
"MIT"
] | null | null | null | """Main program to be run for Character Generator"""
#########
#IMPORTS#
#########
###############
#MAIN FUNCTION#
###############
app()
| 34.361345 | 180 | 0.328931 | """Main program to be run for Character Generator"""
#########
#IMPORTS#
#########
import os
import pickle
from char import *
from chargen import *
from data import *
from traittranslator import *
from skilltranslator import *
from functions import *
###############
#MAIN FUNCTION#
###############
def app():
ru... | 0 | 0 | 0 | 0 | 0 | 7,819 | 0 | -8 | 200 |
e575dd72a41b29a2ce58d8081bdea2bead856d10 | 600 | py | Python | python_object_stuff.py | psilord/mastis_bot | e0a8183295492ea440b03c6975fb95d1677586ef | [
"MIT"
] | null | null | null | python_object_stuff.py | psilord/mastis_bot | e0a8183295492ea440b03c6975fb95d1677586ef | [
"MIT"
] | null | null | null | python_object_stuff.py | psilord/mastis_bot | e0a8183295492ea440b03c6975fb95d1677586ef | [
"MIT"
] | null | null | null |
# Some idiotic python introspection stuff for when authors don't write
# documentation about the classes their API creates.
| 24 | 70 | 0.72 |
# Some idiotic python introspection stuff for when authors don't write
# documentation about the classes their API creates.
def get_methods(obj):
object_methods = [method_name for method_name in dir(obj)
if callable(getattr(obj, method_name))]
return object_methods
def get_attributes(obj):
return dir(obj)
... | 0 | 0 | 0 | 0 | 0 | 406 | 0 | 0 | 69 |
a8ccc3671d6c87a0b85a4eea655a40385947ee79 | 3,795 | py | Python | sldtk/models/polynomial.py | DonkeyShot21/SLDTk | 3c777ccb3d7b280e2a86758b78316f415bb89145 | [
"MIT"
] | 1 | 2020-10-14T18:56:44.000Z | 2020-10-14T18:56:44.000Z | sldtk/models/polynomial.py | DonkeyShot21/SLDTk | 3c777ccb3d7b280e2a86758b78316f415bb89145 | [
"MIT"
] | 3 | 2019-03-11T09:34:34.000Z | 2019-03-27T00:41:35.000Z | sldtk/models/polynomial.py | DonkeyShot21/SLDTk | 3c777ccb3d7b280e2a86758b78316f415bb89145 | [
"MIT"
] | 1 | 2019-03-11T10:18:59.000Z | 2019-03-11T10:18:59.000Z |
DEFAULT_ORDER = 2
| 29.88189 | 83 | 0.573123 | import math
import numpy as np
import numpy.polynomial.polynomial as poly
from .limb_model import LimbModel
DEFAULT_ORDER = 2
class Polynomial(LimbModel):
"""Model a limb darkening profile as a polynomial in :math:`\cos{\psi}`.
Attributes
----------
coefs : tuple of numbers
Coefficients for... | 0 | 555 | 0 | 3,088 | 0 | 0 | 0 | 20 | 112 |
c6b1dc6f0399473c437da4be53ba32b8aa09da35 | 331 | py | Python | localemr/exec/implementations.py | rafaelleru/localemr | aa6e3e5285e96600e87c51639e75acbe35fbba3a | [
"Apache-2.0"
] | 19 | 2020-05-01T19:57:58.000Z | 2022-02-23T00:24:24.000Z | localemr/exec/implementations.py | rafaelleru/localemr | aa6e3e5285e96600e87c51639e75acbe35fbba3a | [
"Apache-2.0"
] | 2 | 2020-09-14T21:17:35.000Z | 2021-02-10T02:39:48.000Z | localemr/exec/implementations.py | rafaelleru/localemr | aa6e3e5285e96600e87c51639e75acbe35fbba3a | [
"Apache-2.0"
] | 5 | 2021-03-14T03:00:03.000Z | 2022-02-15T12:42:00.000Z | # pylint: disable=import-outside-toplevel
| 25.461538 | 54 | 0.791541 | # pylint: disable=import-outside-toplevel
from localemr.config import Configuration
def get_livylike_impl(config: Configuration):
from localemr.exec.livylike.models import LivyLike
return LivyLike(config)
def get_livy_impl(config: Configuration):
from localemr.exec.livy.backend import Livy
return Li... | 0 | 0 | 0 | 0 | 0 | 199 | 0 | 20 | 68 |
919e6ab91de214633c14225414077056978c470e | 1,042 | py | Python | lib/rucio/db/sqla/migrate_repo/versions/c129ccdb2d5_add_lumiblocknr_to_dids.py | balrampariyarath/rucio | 8a68017af6b44485a9620566f1afc013838413c1 | [
"Apache-2.0"
] | 1 | 2017-08-07T13:34:55.000Z | 2017-08-07T13:34:55.000Z | lib/rucio/db/sqla/migrate_repo/versions/c129ccdb2d5_add_lumiblocknr_to_dids.py | pujanm/rucio | 355a997a5ea213c427a5d841ab151ceb01073eb4 | [
"Apache-2.0"
] | null | null | null | lib/rucio/db/sqla/migrate_repo/versions/c129ccdb2d5_add_lumiblocknr_to_dids.py | pujanm/rucio | 355a997a5ea213c427a5d841ab151ceb01073eb4 | [
"Apache-2.0"
] | 1 | 2021-06-17T14:15:15.000Z | 2021-06-17T14:15:15.000Z | # Copyright European Organization for Nuclear Research (CERN)
#
# 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
#
# Authors:
# - Mario Lassnig, <mario... | 24.809524 | 84 | 0.704415 | # Copyright European Organization for Nuclear Research (CERN)
#
# 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
#
# Authors:
# - Mario Lassnig, <mario... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b22523c25b0de8f8a6ebd87437292d308e00ec71 | 1,398 | py | Python | E-Diaristas-Backend/django/web/views.py | Drack112/E-diaristas-TreinaWeb | 553e1e922cf378b2e23ca7e769e9e6e9df40d0e5 | [
"MIT"
] | null | null | null | E-Diaristas-Backend/django/web/views.py | Drack112/E-diaristas-TreinaWeb | 553e1e922cf378b2e23ca7e769e9e6e9df40d0e5 | [
"MIT"
] | null | null | null | E-Diaristas-Backend/django/web/views.py | Drack112/E-diaristas-TreinaWeb | 553e1e922cf378b2e23ca7e769e9e6e9df40d0e5 | [
"MIT"
] | null | null | null |
# Create your views here.
| 33.285714 | 83 | 0.708155 | from django.shortcuts import render, redirect
from .forms import diarista_forms
from .models import Diarista
# Create your views here.
def cadastrar_diarista(request):
if request.method == "POST":
form_diarista = diarista_forms.DiaristaForm(request.POST, request.FILES)
if form_diarista.is_valid()... | 0 | 0 | 0 | 0 | 0 | 1,166 | 0 | 43 | 158 |
df0b933044f5ad192471c89482849261b6165bc2 | 4,730 | py | Python | tetris game/Piece.py | ChenSunMac/Sokoban_python | 39d43f2fd020c60614e9db653b071271f30bca28 | [
"MIT"
] | null | null | null | tetris game/Piece.py | ChenSunMac/Sokoban_python | 39d43f2fd020c60614e9db653b071271f30bca28 | [
"MIT"
] | null | null | null | tetris game/Piece.py | ChenSunMac/Sokoban_python | 39d43f2fd020c60614e9db653b071271f30bca28 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Class Piece:
The shapes of tetrimonos
each of them was a tuple of tuples containing the rotations
PIECES is a dict containing all the shapes where number as a key.
{1: I, 2: J, 3: L, 4: O, 5: S, 6:T, 7:Z}
@author: Chens
https://github.com/ChenSunMac
""" | 22.740385 | 69 | 0.147569 | # -*- coding: utf-8 -*-
"""
Class Piece:
The shapes of tetrimonos
each of them was a tuple of tuples containing the rotations
PIECES is a dict containing all the shapes where number as a key.
{1: I, 2: J, 3: L, 4: O, 5: S, 6:T, 7:Z}
@author: Chens
https://github.com/ChenSunMac
"""
class Piece:
... | 0 | 0 | 0 | 4,402 | 0 | 0 | 0 | 0 | 23 |
06649076734e635187eb7a173acbc4ad0cff61ec | 2,322 | py | Python | tools/SocketObject.py | supercatex/TelloEdu | 8f434dbc9866be3025cb119175c40f1d2d7fb5f3 | [
"MIT"
] | 1 | 2019-12-04T04:30:06.000Z | 2019-12-04T04:30:06.000Z | tools/SocketObject.py | supercatex/TelloEdu | 8f434dbc9866be3025cb119175c40f1d2d7fb5f3 | [
"MIT"
] | null | null | null | tools/SocketObject.py | supercatex/TelloEdu | 8f434dbc9866be3025cb119175c40f1d2d7fb5f3 | [
"MIT"
] | null | null | null | import cv2
if __name__ == "__main__":
sc = SocketClient("127.0.0.1", 8886, "127.0.0.1", 8888)
camera = cv2.VideoCapture(0)
while camera.isOpened():
success, frame = camera.read()
if not success:
break
sc.send_image(frame)
frame = sc.receive_image()
cv... | 29.392405 | 73 | 0.589147 | import socket
import time
import cv2
import pickle
import struct
class SocketClient(object):
def __init__(self, local_ip, local_port, target_ip, target_port):
self.local_ip = local_ip
self.local_port = local_port
self.local_address = (local_ip, local_port)
self.target_ip = target... | 0 | 0 | 0 | 1,810 | 0 | 0 | 0 | -34 | 111 |
fe40272ed0ee4e5164a250370d8719522f90d5db | 2,194 | py | Python | benchmarks/rotation_cifar/appendix_plot.py | PSSF23/progressive-learning | 894d25972636def6726e2c4219dc0dc99e1c5949 | [
"MIT"
] | 18 | 2020-10-13T00:43:06.000Z | 2022-03-28T09:03:52.000Z | benchmarks/rotation_cifar/appendix_plot.py | PSSF23/progressive-learning | 894d25972636def6726e2c4219dc0dc99e1c5949 | [
"MIT"
] | 234 | 2020-10-04T17:19:15.000Z | 2022-03-17T15:43:57.000Z | benchmarks/rotation_cifar/appendix_plot.py | PSSF23/progressive-learning | 894d25972636def6726e2c4219dc0dc99e1c5949 | [
"MIT"
] | 31 | 2020-10-05T07:43:50.000Z | 2022-03-03T21:45:57.000Z | #%%
import matplotlib.pyplot as plt
import tensorflow.keras as keras
import sys
sys.path.append("../../src")
#%%
# %%
(X_train, y_train), (X_test, y_test) = keras.datasets.cifar100.load_data()
fig, ax = plt.subplots(1,2, figsize=(8,4))
cif = image_aug(X_train[34,:,:,:],0)
rotated_cif = image_aug(X_train[34,:,:,:],4... | 28.128205 | 89 | 0.731996 | #%%
import matplotlib.pyplot as plt
import random
import pickle
from skimage.transform import rotate
from scipy import ndimage
from skimage.util import img_as_ubyte
from joblib import Parallel, delayed
from sklearn.ensemble.forest import _generate_unsampled_indices
from sklearn.ensemble.forest import _generate_sample_i... | 0 | 0 | 0 | 0 | 0 | 529 | 0 | 189 | 354 |
60c8a6f0c13852dcdb6bdbbdf8ac2e5311924d34 | 3,230 | py | Python | src/data/make_dataset.py | mihaelagrigore/ResNet-Keras-code-from-scratch-train-on-GPU | ff86dc9de40f79fdce7371a98f477671cf3edad6 | [
"MIT"
] | 1 | 2022-03-10T06:20:23.000Z | 2022-03-10T06:20:23.000Z | src/data/make_dataset.py | mihaelagrigore/ResNet-Keras-code-from-scratch-train-on-GPU | ff86dc9de40f79fdce7371a98f477671cf3edad6 | [
"MIT"
] | null | null | null | src/data/make_dataset.py | mihaelagrigore/ResNet-Keras-code-from-scratch-train-on-GPU | ff86dc9de40f79fdce7371a98f477671cf3edad6 | [
"MIT"
] | null | null | null | import os
import PIL
from pathlib import Path
# folder to load config file
root = Path(__file__).parents[2]
CONFIG_FILE = os.path.join(root, 'config.yaml')
# center crop images into a square
# new size is the minimum of width or height
# across all images
# process all images for training
# square c... | 31.057692 | 97 | 0.637152 | import os
import shutil
import PIL
import pathlib
import argparse
import PIL.Image
from pathlib import Path
from src.utils.basic_functions import get_config
# folder to load config file
root = Path(__file__).parents[2]
CONFIG_FILE = os.path.join(root, 'config.yaml')
# center crop images into a square
... | 0 | 0 | 0 | 0 | 0 | 2,580 | 0 | 1 | 186 |
7c914ffce5e455cde81bce84b0f78f5ddefb3e20 | 438 | py | Python | cotk/scripts/cli_constant.py | ishine/cotk | 2242c16523830254b0ac509f7739b4cbcb03dea4 | [
"Apache-2.0"
] | 117 | 2019-03-14T15:06:42.000Z | 2022-02-28T07:06:34.000Z | cotk/scripts/cli_constant.py | ishine/cotk | 2242c16523830254b0ac509f7739b4cbcb03dea4 | [
"Apache-2.0"
] | 149 | 2019-03-12T09:43:21.000Z | 2020-08-24T02:56:34.000Z | cotk/scripts/cli_constant.py | ishine/cotk | 2242c16523830254b0ac509f7739b4cbcb03dea4 | [
"Apache-2.0"
] | 51 | 2019-03-14T15:12:48.000Z | 2021-08-09T03:37:48.000Z | import os
import sys
import logging
from pathlib import Path
LOGGER = logging.getLogger(__name__)
LOGGER.setLevel(level=logging.INFO)
FORMAT = logging.Formatter("%(levelname)s: %(message)s")
SH = logging.StreamHandler(stream=sys.stdout)
SH.setFormatter(FORMAT)
LOGGER.addHandler(SH)
CONFIG_FILE = os.path.join(str(Path... | 29.2 | 91 | 0.776256 | import os
import sys
import logging
from pathlib import Path
LOGGER = logging.getLogger(__name__)
LOGGER.setLevel(level=logging.INFO)
FORMAT = logging.Formatter("%(levelname)s: %(message)s")
SH = logging.StreamHandler(stream=sys.stdout)
SH.setFormatter(FORMAT)
LOGGER.addHandler(SH)
CONFIG_FILE = os.path.join(str(Path... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c57122fa9b21370b52e99fd1e52485f5843094ed | 5,506 | py | Python | Tools/cystdlib.py | johannes-mueller/cython | b75af38ce5c309cd84c1835220932e53e9a9adb6 | [
"Apache-2.0"
] | 6,663 | 2015-01-02T06:06:43.000Z | 2022-03-31T10:35:02.000Z | Tools/cystdlib.py | holzschu/cython | 8f6c7f707b28cb8e76ecbf5fcd089c6255dacdb8 | [
"Apache-2.0"
] | 3,094 | 2015-01-01T15:44:13.000Z | 2022-03-31T19:49:57.000Z | Tools/cystdlib.py | scoder/cython | ddaaa7b8bfe9885b7bed432cd0a5ab8191d112cd | [
"Apache-2.0"
] | 1,425 | 2015-01-12T07:21:27.000Z | 2022-03-30T14:10:40.000Z | """
Highly experimental script that compiles the CPython standard library using Cython.
Execute the script either in the CPython 'Lib' directory or pass the
option '--current-python' to compile the standard library of the running
Python interpreter.
Pass '-j N' to get a parallel build with N processes.
Usage example... | 28.978947 | 83 | 0.610788 | """
Highly experimental script that compiles the CPython standard library using Cython.
Execute the script either in the CPython 'Lib' directory or pass the
option '--current-python' to compile the standard library of the running
Python interpreter.
Pass '-j N' to get a parallel build with N processes.
Usage example... | 0 | 0 | 0 | 0 | 0 | 2,164 | 0 | 24 | 136 |
e4ee98cbf2c741aa396523f8653cee4b94ee10a3 | 339 | py | Python | Ex 91.py | brunobendel/Exercicios-python-Pycharm | 145ded6cb5533aeef1b89f0bce20f0a90e37216c | [
"MIT"
] | null | null | null | Ex 91.py | brunobendel/Exercicios-python-Pycharm | 145ded6cb5533aeef1b89f0bce20f0a90e37216c | [
"MIT"
] | null | null | null | Ex 91.py | brunobendel/Exercicios-python-Pycharm | 145ded6cb5533aeef1b89f0bce20f0a90e37216c | [
"MIT"
] | null | null | null | from random import randint
from time import sleep
dicionario = {'Jogador 1':randint(1,6),
'Jogador 2':randint(1,6),
'Jogador 3':randint(1,6),
'Jogador 4':randint(1,6)}
print(' Jogo de dados ')
print('-='*30)
for n, j in dicionario.items():
print(f'{n} tirou {j} no dado... | 24.214286 | 39 | 0.560472 | from random import randint
from time import sleep
dicionario = {'Jogador 1':randint(1,6),
'Jogador 2':randint(1,6),
'Jogador 3':randint(1,6),
'Jogador 4':randint(1,6)}
print(' Jogo de dados ')
print('-='*30)
for n, j in dicionario.items():
print(f'{n} tirou {j} no dado... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a869ca584d71818084dfd64e52a573094625defb | 684 | py | Python | tests/test_gj.py | flyweilai1287/easytrader | 492c3e9a7575e503e68306a596f4b060d1a06eec | [
"MIT"
] | null | null | null | tests/test_gj.py | flyweilai1287/easytrader | 492c3e9a7575e503e68306a596f4b060d1a06eec | [
"MIT"
] | null | null | null | tests/test_gj.py | flyweilai1287/easytrader | 492c3e9a7575e503e68306a596f4b060d1a06eec | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
"""
Created on 2019/11/23 22:38
@author: Leo
@file:test_gj.py
@desc:
"""
| 22.8 | 65 | 0.694444 | # -*- coding:utf-8 -*-
"""
Created on 2019/11/23 22:38
@author: Leo
@file:test_gj.py
@desc:
"""
import tempfile
import pywinauto
from easytrader import helpers
def startup_app(exe_path='C:\\app\\全能行证券交易终端\\xiadan.exe'):
app=pywinauto.application.Application()
app.start(exe_path)
# app.top_window().Edit1... | 27 | 0 | 0 | 0 | 0 | 466 | 0 | -2 | 113 |
df24e179b12d22936fbb72ff77dc4766045bc0a3 | 2,878 | py | Python | examples/simple_spider/hitomi_spider.py | xlbf22/ruia | 697d4e1dff62c8c60d1a7cc62bac559da5e079f6 | [
"Apache-2.0"
] | null | null | null | examples/simple_spider/hitomi_spider.py | xlbf22/ruia | 697d4e1dff62c8c60d1a7cc62bac559da5e079f6 | [
"Apache-2.0"
] | null | null | null | examples/simple_spider/hitomi_spider.py | xlbf22/ruia | 697d4e1dff62c8c60d1a7cc62bac559da5e079f6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from ruia import utils, Middleware
log = utils.log.get_logger()
fl_middleware = Middleware()
# class HitomiImageItem(Item):
# target_item = TextField(xpath_select='//*[@id="comicImages"]')
# url = AttrField(xpath_select='img', attr='src')
#
#
# class HitomiImageSpider(Spider):
# ... | 39.972222 | 309 | 0.652536 | #!/usr/bin/env python
from ruia import Spider, utils, Item, Middleware, AttrField, TextField
from ruia_pyppeteer import PyppeteerRequest as Request
log = utils.log.get_logger()
fl_middleware = Middleware()
@fl_middleware.request
async def print_on_request(spider_ins, request):
# ua = 'ruia user-agent'
ua =... | 54 | 259 | 630 | 854 | 0 | 0 | 0 | 69 | 90 |
6b15a2219e6dfda269db92b3ca047d7121f2bcb5 | 3,151 | py | Python | utils/artemis_utils/service.py | skyshe/artemis | c9686ca58b07532e7e2759ac0b0b58c7dc05a5b5 | [
"TCL",
"BSD-3-Clause",
"PostgreSQL"
] | 237 | 2018-12-20T11:16:36.000Z | 2022-03-20T02:36:31.000Z | utils/artemis_utils/service.py | skyshe/artemis | c9686ca58b07532e7e2759ac0b0b58c7dc05a5b5 | [
"TCL",
"BSD-3-Clause",
"PostgreSQL"
] | 555 | 2019-01-03T21:07:09.000Z | 2022-03-31T09:26:12.000Z | utils/artemis_utils/service.py | skyshe/artemis | c9686ca58b07532e7e2759ac0b0b58c7dc05a5b5 | [
"TCL",
"BSD-3-Clause",
"PostgreSQL"
] | 52 | 2018-12-20T18:53:51.000Z | 2022-03-14T16:39:10.000Z | # service util functions
| 33.521277 | 86 | 0.625198 | # service util functions
import re
import socket
import time
import requests
from artemis_utils.constants import HEALTH_CHECK_TIMEOUT
from artemis_utils.envvars import COMPOSE_PROJECT_NAME
from artemis_utils.envvars import REST_PORT
from . import log
def get_local_ip():
return socket.gethostbyname(socket.gethos... | 0 | 0 | 0 | 0 | 0 | 2,802 | 0 | 50 | 270 |
8e70847026ea29045bad85eef3386b1c2bca7e93 | 3,731 | py | Python | LOADDATA.py | naojibrainmachine/sentiment-analysis | c4477486a3f409bc4bbc5b5099cfe107b98ab509 | [
"MIT"
] | 1 | 2021-05-20T08:46:19.000Z | 2021-05-20T08:46:19.000Z | LOADDATA.py | naojibrainmachine/sentiment-analysis | c4477486a3f409bc4bbc5b5099cfe107b98ab509 | [
"MIT"
] | null | null | null | LOADDATA.py | naojibrainmachine/sentiment-analysis | c4477486a3f409bc4bbc5b5099cfe107b98ab509 | [
"MIT"
] | null | null | null | import fool
import pandas as pd
import numpy as np
import tensorflow as tf
def get_corpus_indices(data,chars_to_idx):
"""
"""
corpus_indices=[]
for d in data:
d=d.replace('\n','').replace('\r','').replace(' ','').replace('\u3000','')
corpus_chars=fool.cut(d)
corpus... | 27.433824 | 144 | 0.651032 | import os
import fool
import math
import pandas as pd
import numpy as np
import random
import tensorflow as tf
def get_corpus_indices(data,chars_to_idx):
"""
转化成词库索引
"""
corpus_indices=[]
for d in data:
d=d.replace('\n','').replace('\r','').replace(' ','').replace('\u3000','')
... | 855 | 0 | 0 | 0 | 731 | 0 | 0 | -30 | 89 |
5e89f5277144534e38f106a6bdf659d5052a1a8e | 442 | py | Python | leetcode/334.py | pingrunhuang/CodeChallenge | a8e5274e04c47d851836197907266418af4f1a22 | [
"MIT"
] | null | null | null | leetcode/334.py | pingrunhuang/CodeChallenge | a8e5274e04c47d851836197907266418af4f1a22 | [
"MIT"
] | null | null | null | leetcode/334.py | pingrunhuang/CodeChallenge | a8e5274e04c47d851836197907266418af4f1a22 | [
"MIT"
] | null | null | null | '''
Write a function that takes a string as input and returns the string reversed.
'''
if __name__=='__main__':
solution = Solution()
testCase1='hello'
print(solution.reverseString(testCase1)) | 21.047619 | 78 | 0.538462 | '''
Write a function that takes a string as input and returns the string reversed.
'''
class Solution:
def reverseString(self, s):
"""
:type s: str
:rtype: str
"""
result=''
i = len(s)-1
while i>=0:
result+=s[i]
i-=1
return res... | 0 | 0 | 0 | 214 | 0 | 0 | 0 | 0 | 23 |
806927bc7845497c584436c19159712525f83553 | 2,302 | py | Python | models/lanenet.py | aparecidovieira/keras_segmentation | 9e80cb502378af6021dbfa565877adebbb4b674f | [
"Net-SNMP",
"Xnet"
] | 5 | 2021-04-17T07:13:35.000Z | 2022-03-22T18:06:42.000Z | models/lanenet.py | aparecidovieira/keras_segmentation | 9e80cb502378af6021dbfa565877adebbb4b674f | [
"Net-SNMP",
"Xnet"
] | null | null | null | models/lanenet.py | aparecidovieira/keras_segmentation | 9e80cb502378af6021dbfa565877adebbb4b674f | [
"Net-SNMP",
"Xnet"
] | 2 | 2021-04-17T07:13:33.000Z | 2021-07-15T15:51:05.000Z | ###
| 30.693333 | 107 | 0.658558 | ###
import keras
from keras.layers import *
import keras.backend as K
import common as C
from keras.models import *
def build_lanenet(input_shape,input_shape1=[128, 128, 3],input_shape2=[64, 64, 3],
input_shape3=[32, 32, 3],input_shape4=[16, 16, 3], one_hot_label=False):
print(input_shape, 'Input size shape ... | 0 | 0 | 0 | 0 | 0 | 2,161 | 0 | 2 | 133 |
df4ed5f222f11f984a6e7b5fec275d35b69154ce | 204 | py | Python | basics_raspberry/readImg.py | ai-erorr404/opencv-practice | 60ef5e4aec61ee5f7e675fb919e8f612e59f664a | [
"MIT"
] | 1 | 2020-03-01T13:21:41.000Z | 2020-03-01T13:21:41.000Z | basics_raspberry/readImg.py | ai-erorr404/opencv-practice | 60ef5e4aec61ee5f7e675fb919e8f612e59f664a | [
"MIT"
] | null | null | null | basics_raspberry/readImg.py | ai-erorr404/opencv-practice | 60ef5e4aec61ee5f7e675fb919e8f612e59f664a | [
"MIT"
] | 1 | 2020-03-01T13:21:43.000Z | 2020-03-01T13:21:43.000Z | #!/usr/bin/python3
import cv2
WINDOW_NAME = "picImage"
img = cv2.imread("G:/learn-project/tmp/1.jpg", cv2.IMREAD_COLOR)
cv2.imshow("picImage", img)
cv2.waitKey(0)
print("image is closed!")
| 17 | 65 | 0.671569 | #!/usr/bin/python3
import cv2
WINDOW_NAME = "picImage"
img = cv2.imread("G:/learn-project/tmp/1.jpg", cv2.IMREAD_COLOR)
cv2.imshow("picImage", img)
cv2.waitKey(0)
print("image is closed!")
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f905aa4c3f7fded9c62d70e50107ecad6885dfb8 | 3,118 | py | Python | tanager/populationplots.py | jogoodma/inspyred-dashboard | b03f921abaac3a2271c3ca9b7ed97d954726bffd | [
"MIT"
] | 1 | 2021-04-26T21:02:05.000Z | 2021-04-26T21:02:05.000Z | tanager/populationplots.py | jogoodma/inspyred-dashboard | b03f921abaac3a2271c3ca9b7ed97d954726bffd | [
"MIT"
] | null | null | null | tanager/populationplots.py | jogoodma/inspyred-dashboard | b03f921abaac3a2271c3ca9b7ed97d954726bffd | [
"MIT"
] | 1 | 2022-03-08T03:00:16.000Z | 2022-03-08T03:00:16.000Z |
inspyred_data_folder = "/System/Volumes/Data/Personal/Degree/Tools/Inspyred/Code/Git/inspyred/tanager_data"
if __name__ == '__main__':
projects = ['Sphere'] # ,'Rastrigin', 'Ackley', 'Rosenbrock', 'TSM']
# chart_types = ['BestFit', 'AllGenerations', 'Network']
# choosen_problem = f'{problem_types[... | 32.821053 | 111 | 0.592367 | import plotly.express as px
import plotly.graph_objects as go
def get_line_plot(data, generation, candidate, label, line_color, line_size):
scatter_plot = go.Scatter(x=generation, y=data[label], mode='markers+lines',
name=label,
text=candidate,
... | 0 | 0 | 0 | 0 | 0 | 1,692 | 0 | 16 | 159 |
0db80cecac19b52a8e9ad6a9f585c77fb4b4a94c | 7,484 | py | Python | homework2.py | duanxl0917/PythonBydxl | da990a92f6474e38803e218dfd2818e2994cec63 | [
"Apache-2.0"
] | null | null | null | homework2.py | duanxl0917/PythonBydxl | da990a92f6474e38803e218dfd2818e2994cec63 | [
"Apache-2.0"
] | null | null | null | homework2.py | duanxl0917/PythonBydxl | da990a92f6474e38803e218dfd2818e2994cec63 | [
"Apache-2.0"
] | null | null | null | #1.
#import math
#r = eval(input("Enter the length from the center to a vertex:"))
#s = 2 * r * math.sin(math.pi / 5)
#area = 5 *s ** 2 / (4 * math.tan(math.pi / 5))
#print("The area of the pentagon is %.2f" %area )
#2.
#import math
#x1,y1 = eval(input("Enter point 1 (latiude and longitude) in degress: "))
#x... | 27.413919 | 107 | 0.538616 | #1.一个五边形的面积
#import math
#r = eval(input("Enter the length from the center to a vertex:"))
#s = 2 * r * math.sin(math.pi / 5)
#area = 5 *s ** 2 / (4 * math.tan(math.pi / 5))
#print("The area of the pentagon is %.2f" %area )
#2.大圆距离
#import math
#x1,y1 = eval(input("Enter point 1 (latiude and longitude) in degr... | 617 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
236a30597f14199e2b6b7d425c0696acb3fc3966 | 4,792 | py | Python | src/model/transformer/mono_transformer_torch.py | sunprinceS/MetaASR-CrossAccent | 43f45c2f121c1e47d3a088f03db5acc31d04f15a | [
"MIT"
] | 9 | 2020-07-02T09:08:08.000Z | 2021-05-12T16:14:54.000Z | src/model/transformer/mono_transformer_torch.py | sunprinceS/MetaASR-CrossAccent | 43f45c2f121c1e47d3a088f03db5acc31d04f15a | [
"MIT"
] | null | null | null | src/model/transformer/mono_transformer_torch.py | sunprinceS/MetaASR-CrossAccent | 43f45c2f121c1e47d3a088f03db5acc31d04f15a | [
"MIT"
] | 1 | 2021-07-12T02:13:35.000Z | 2021-07-12T02:13:35.000Z | import src.monitor.logger as logger
# TODO:
# add relative positional encoding
| 38.336 | 113 | 0.596411 | import torch
from torch import nn
import torch.nn.functional as F
import numpy as np
import math
from math import floor
from src.nets_utils import to_device, lecun_normal_init_parameters, make_bool_pad_mask
import src.monitor.logger as logger
# TODO:
# add relative positional encoding
class PositionalEncoding(nn.Mod... | 0 | 56 | 0 | 4,379 | 0 | 0 | 0 | 53 | 224 |
0b3e30fa399b7b95882a5b6cfeb146059ba616f1 | 1,155 | py | Python | tex/code/robrank/datasets/ilsvrc.py | cdluminate/robdml | 51ffcdbd2b316b0550a073f4c19edbef7bbbe704 | [
"Apache-2.0"
] | 5 | 2021-10-29T20:24:03.000Z | 2022-03-23T11:35:09.000Z | tex/code/robrank/datasets/ilsvrc.py | cdluminate/robdml | 51ffcdbd2b316b0550a073f4c19edbef7bbbe704 | [
"Apache-2.0"
] | null | null | null | tex/code/robrank/datasets/ilsvrc.py | cdluminate/robdml | 51ffcdbd2b316b0550a073f4c19edbef7bbbe704 | [
"Apache-2.0"
] | null | null | null |
# pylint: disable=too-many-function-args
import os
import torchvision as V
from .. import configs
def __get_classification_dataset():
'''
https://github.com/pytorch/examples/blob/master/imagenet/main.py
'''
normalize = V.transforms.Normalize(
mean=[0.485, 0.456, 0.406],
std=[0.229, 0... | 27.5 | 68 | 0.620779 |
# pylint: disable=too-many-function-args
import os
import numpy as np
import pickle
from PIL import Image
import torchvision as V
from .. import configs
def getDataset(kind: str = 'classification'):
if kind == 'classification':
return __get_classification_dataset()
else:
raise NotImplementedE... | 0 | 0 | 0 | 0 | 0 | 147 | 0 | -11 | 89 |
3d87c4b17f6e3b9a90a1e46704b5e0075e17cc9f | 3,489 | py | Python | src/grafimo/GRAFIMOException.py | pinellolab/GRAFIMO | 4fe13421ab4200e624276ea39fb37e307c311cbf | [
"MIT"
] | 21 | 2019-11-19T12:49:12.000Z | 2022-01-28T09:25:05.000Z | src/grafimo/GRAFIMOException.py | InfOmics/GRAFIMO | 5f7684ef0b5c804cffbb7335e74f319230d7b3c1 | [
"MIT"
] | 2 | 2019-12-17T15:03:32.000Z | 2019-12-23T01:25:49.000Z | src/grafimo/GRAFIMOException.py | InfOmics/GRAFIMO | 5f7684ef0b5c804cffbb7335e74f319230d7b3c1 | [
"MIT"
] | 3 | 2020-01-30T15:47:20.000Z | 2021-01-07T17:04:07.000Z | """Custom Exceptions for GRAFIMO and exception hook handler definition.
The base class GRAFIMOException inherits from Exception.
GRAFIMOException is extended with custom exceptions, handling errors
occurring during GRAFIMO run.
"""
# ------------------------------------------------------------------------... | 20.16763 | 80 | 0.693035 | """Custom Exceptions for GRAFIMO and exception hook handler definition.
The base class GRAFIMOException inherits from Exception.
GRAFIMOException is extended with custom exceptions, handling errors
occurring during GRAFIMO run.
"""
class GRAFIMOException(Exception):
"""Class to represent an excpetion which can ... | 0 | 0 | 0 | 2,639 | 0 | 0 | 0 | 0 | 505 |
a43f8de5dd9c2a4f97de83a2fde1d82db071cb63 | 2,114 | py | Python | galaxy_api/contrib/logging.py | nixocio/galaxy-api | 12dcacdc0b093f3051b5dc87095324fb63bf6af3 | [
"Apache-2.0"
] | null | null | null | galaxy_api/contrib/logging.py | nixocio/galaxy-api | 12dcacdc0b093f3051b5dc87095324fb63bf6af3 | [
"Apache-2.0"
] | null | null | null | galaxy_api/contrib/logging.py | nixocio/galaxy-api | 12dcacdc0b093f3051b5dc87095324fb63bf6af3 | [
"Apache-2.0"
] | null | null | null | """Logging utils."""
| 27.454545 | 67 | 0.645695 | """Logging utils."""
import logging
import boto3
import watchtower
import logstash_formatter
import request_id.logging
from django.conf import settings
class CloudWatchHandler(watchtower.CloudWatchLogHandler):
"""Pre-configured CloudWatch handler."""
def __init__(self):
config = settings.CLOUD_WATC... | 0 | 0 | 0 | 1,699 | 0 | 189 | 0 | -1 | 203 |
900ec01f1d388abb347b3d1e1f11ec02688870df | 6,911 | py | Python | args.py | mHamzaArain/Whatsapp_bulk_msg_files_sender | fe5ad9c430b23e72fbd3c8d3ed339cc9cfbba01c | [
"Apache-2.0"
] | null | null | null | args.py | mHamzaArain/Whatsapp_bulk_msg_files_sender | fe5ad9c430b23e72fbd3c8d3ed339cc9cfbba01c | [
"Apache-2.0"
] | null | null | null | args.py | mHamzaArain/Whatsapp_bulk_msg_files_sender | fe5ad9c430b23e72fbd3c8d3ed339cc9cfbba01c | [
"Apache-2.0"
] | 1 | 2020-12-17T16:43:29.000Z | 2020-12-17T16:43:29.000Z | # Copyright 2020 Hamza Arain. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 33.066986 | 131 | 0.534221 | # Copyright 2020 Hamza Arain. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 0 | 0 | 0 | 4,629 | 0 | 0 | 0 | -6 | 45 |
45c0d5a93ee77d9b729a387d513166b29a03e472 | 9,148 | py | Python | src/code/srcClass/pathcom.py | cblatti3/KN_Builder | 3c866a9b1884828d0ce39a5fb35b776770adf1d5 | [
"MIT"
] | 1 | 2020-07-31T03:23:19.000Z | 2020-07-31T03:23:19.000Z | src/code/srcClass/pathcom.py | KnowEnG/KN_Builder | 08086e118e0ee6600ddb01165af57a57bb5e1176 | [
"MIT"
] | null | null | null | src/code/srcClass/pathcom.py | KnowEnG/KN_Builder | 08086e118e0ee6600ddb01165af57a57bb5e1176 | [
"MIT"
] | null | null | null | """Extension of utilities.py to provide functions required to check the
version information of pathcom and determine if it needs to be updated.
Classes:
Pathcom: Extends the SrcClass class and provides the static variables and
pathcom specific functions required to perform a check on pathcom.
Functions:
... | 41.022422 | 97 | 0.581876 | """Extension of utilities.py to provide functions required to check the
version information of pathcom and determine if it needs to be updated.
Classes:
Pathcom: Extends the SrcClass class and provides the static variables and
pathcom specific functions required to perform a check on pathcom.
Functions:
... | 0 | 0 | 0 | 7,731 | 0 | 0 | 0 | -5 | 155 |
471a05f0a0b321efaf3cf6b09dbc4b10d19f2a13 | 1,895 | py | Python | src/cfn_kong_acl_provider.py | lionelliang/cfn-kong-provider | 06d6035968719c907d0993e026469edfff776f6a | [
"Apache-2.0"
] | 8 | 2017-11-07T00:16:06.000Z | 2021-01-12T16:19:37.000Z | src/cfn_kong_acl_provider.py | lionelliang/cfn-kong-provider | 06d6035968719c907d0993e026469edfff776f6a | [
"Apache-2.0"
] | 1 | 2019-05-15T02:32:25.000Z | 2019-05-16T06:41:34.000Z | src/cfn_kong_acl_provider.py | lionelliang/cfn-kong-provider | 06d6035968719c907d0993e026469edfff776f6a | [
"Apache-2.0"
] | 3 | 2018-06-08T20:36:02.000Z | 2020-08-27T19:42:02.000Z |
request_schema = {
"type": "object",
"required": ["AdminURL", "ACL"],
"properties": {
"AdminURL": {
"type": "string", "pattern": "^https?://.+",
"description": "of kong admin port"},
"JWT": {
"type": "object",
"required": ["PrivateKeyParamet... | 30.079365 | 106 | 0.427441 | from cfn_kong_provider import KongProvider
request_schema = {
"type": "object",
"required": ["AdminURL", "ACL"],
"properties": {
"AdminURL": {
"type": "string", "pattern": "^https?://.+",
"description": "of kong admin port"},
"JWT": {
"type": "object",
... | 0 | 143 | 0 | 199 | 0 | 54 | 0 | 21 | 68 |
d60f9d2e1a42145450056511f1d1222635e60b39 | 4,074 | py | Python | scripts/main.py | mrl-athomelab/saam_body_gesture_detection | 49630a23792c71cf5df70ee334e7ae52dca0572d | [
"MIT"
] | null | null | null | scripts/main.py | mrl-athomelab/saam_body_gesture_detection | 49630a23792c71cf5df70ee334e7ae52dca0572d | [
"MIT"
] | null | null | null | scripts/main.py | mrl-athomelab/saam_body_gesture_detection | 49630a23792c71cf5df70ee334e7ae52dca0572d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import rospy
# color constants
RED_COLOR = (0, 0, 255)
BLUE_COLOR = (255, 0, 0)
WHITE_COLOR = (255, 255, 255)
DEFAULT_POINTS = {'1', '2', '3', '4', '5', '6', '7'}
if __name__ == "__main__":
rospy.init_node("human_wave_detection", anonymous=True)
instance = WaveDetector()
try:
... | 33.393443 | 118 | 0.564556 | #!/usr/bin/env python
import rospy
import cv2
import time
from person_detection import PersonDetection
from pose_estimation import PoseEstimation
from camera_reader import CameraStreamer
from persons import Persons
# color constants
RED_COLOR = (0, 0, 255)
BLUE_COLOR = (255, 0, 0)
WHITE_COLOR = (255, 255, 255)
DEFAUL... | 0 | 455 | 0 | 2,512 | 0 | 389 | 0 | 48 | 201 |
18ce6ac5f8d09f10eb1cdc909c0ae368b53b187a | 571 | py | Python | CosmoLike/LSST_emu/fom.py | CosmoLike/LSST_emu_nersc | 1771d9b3382a977bb97e6e37b987beea73152bdd | [
"MIT"
] | null | null | null | CosmoLike/LSST_emu/fom.py | CosmoLike/LSST_emu_nersc | 1771d9b3382a977bb97e6e37b987beea73152bdd | [
"MIT"
] | null | null | null | CosmoLike/LSST_emu/fom.py | CosmoLike/LSST_emu_nersc | 1771d9b3382a977bb97e6e37b987beea73152bdd | [
"MIT"
] | null | null | null | import numpy as np
import os
from numpy.linalg import inv
from numpy.linalg import det
list1=["like_3x2pt_LSST_Y10_area=1.800000e+04_dmo","like_3x2pt_WFIRST_area=2.000000e+03_dmo","like_3x2pt_WFIRST_area=1.800000e+04_dmo"]
FOMDE=np.array([1.0,1.0,1.0])
i=0
FOMDE[i]
print FOMDE[i]
for name in list1:
i=0
file... | 21.961538 | 135 | 0.67951 | import numpy as np
import os
from numpy.linalg import inv
from numpy.linalg import det
list1=["like_3x2pt_LSST_Y10_area=1.800000e+04_dmo","like_3x2pt_WFIRST_area=2.000000e+03_dmo","like_3x2pt_WFIRST_area=1.800000e+04_dmo"]
FOMDE=np.array([1.0,1.0,1.0])
i=0
FOMDE[i]
print FOMDE[i]
for name in list1:
i=0
file... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7c4a5afca5e1c6a38c576935117cf302afd699d8 | 327 | py | Python | api/apis/__init__.py | DonAurelio/parallel-templates | cfa21419203889c908a15e1cf2d2271990b9cf8f | [
"MIT"
] | 1 | 2017-12-10T13:24:34.000Z | 2017-12-10T13:24:34.000Z | api/apis/__init__.py | DonAurelio/catt | cfa21419203889c908a15e1cf2d2271990b9cf8f | [
"MIT"
] | 3 | 2020-06-05T17:47:47.000Z | 2021-06-10T19:56:28.000Z | api/apis/__init__.py | DonAurelio/parallel-templates | cfa21419203889c908a15e1cf2d2271990b9cf8f | [
"MIT"
] | null | null | null | from flask_restplus import Api
from .parallel_templates import template
api = Api(
title='C99 Parallel Template Api',
version='1.0',
description="""Provides a set of parallel programming
templates for easy parallelization."""
)
# Adding template resource namesace to the API
api.add_namespace(templat... | 23.357143 | 58 | 0.749235 | from flask_restplus import Api
from .parallel_templates import template
api = Api(
title='C99 Parallel Template Api',
version='1.0',
description="""Provides a set of parallel programming
templates for easy parallelization."""
)
# Adding template resource namesace to the API
api.add_namespace(templat... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
04a3a7b6cc74f13f88e360013d16012d8fb66cd5 | 18,315 | py | Python | src/meme_4.6.0/scripts/sequence.py | kipkurui/gimmemotifs | 51bd0c6700877f79179f08e5bab7de70fc2eab94 | [
"MIT"
] | 1 | 2019-07-14T08:28:25.000Z | 2019-07-14T08:28:25.000Z | src/meme_4.6.0/scripts/sequence.py | kipkurui/gimmemotifs | 51bd0c6700877f79179f08e5bab7de70fc2eab94 | [
"MIT"
] | null | null | null | src/meme_4.6.0/scripts/sequence.py | kipkurui/gimmemotifs | 51bd0c6700877f79179f08e5bab7de70fc2eab94 | [
"MIT"
] | null | null | null | #!@WHICHPYTHON@
import string, sys
#------------------ Alphabet -------------------
# pre-defined alphabets that can be specified by their name
predefAlphabets = [
("DNA" , Alphabet('ACGT')),
("RNA" , Alphabet('ACGU')),
("Extended DNA" , Alphabet('ACGTYRN')),... | 36.339286 | 143 | 0.666612 | #!@WHICHPYTHON@
import string, sys
#------------------ Alphabet -------------------
class Alphabet(object):
"""Biological alphabet class.
This defines the set of symbols from which various objects can be built, e.g. sequences and motifs.
The symbol set is immutable and accessed as a tuple.
symstr: symbols in al... | 0 | 0 | 0 | 13,731 | 0 | 0 | 0 | 0 | 138 |
9fc9cead7aa2d25d6657bfa854cc967258ea542b | 513 | py | Python | knifehit/knifehit.py | HaleySnooks/python-knife-hit | 44c04aa0c471c64a21231ed14aa2722a61dc11d8 | [
"MIT"
] | 32 | 2019-06-22T23:31:02.000Z | 2021-07-14T02:56:49.000Z | knifehit/knifehit.py | HaleySnooks/python-knife-hit | 44c04aa0c471c64a21231ed14aa2722a61dc11d8 | [
"MIT"
] | 5 | 2019-07-11T01:06:15.000Z | 2022-01-13T01:24:09.000Z | knifehit/knifehit.py | HaleySnooks/python-knife-hit | 44c04aa0c471c64a21231ed14aa2722a61dc11d8 | [
"MIT"
] | 20 | 2019-06-24T04:24:38.000Z | 2021-07-17T04:12:48.000Z | import arcade
import yaml
from gamemanager import GameManager
def load_config():
""" Load config data from config.yaml """
with open("config.yaml", 'r') as stream:
try:
return yaml.safe_load(stream)
except yaml.YAMLError as exc:
print(exc)
def main():
""" Main met... | 18.321429 | 45 | 0.604288 | import arcade
import yaml
from gamemanager import GameManager
def load_config():
""" Load config data from config.yaml """
with open("config.yaml", 'r') as stream:
try:
return yaml.safe_load(stream)
except yaml.YAMLError as exc:
print(exc)
def main():
""" Main met... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e7828ad64f6b52ed469fa78cb68204291f6c7f3b | 185 | py | Python | at.py | LibraryBeales/pythonscraps | 26610103a24e56501296eaca14c4dd10ceeed16c | [
"bzip2-1.0.6"
] | null | null | null | at.py | LibraryBeales/pythonscraps | 26610103a24e56501296eaca14c4dd10ceeed16c | [
"bzip2-1.0.6"
] | null | null | null | at.py | LibraryBeales/pythonscraps | 26610103a24e56501296eaca14c4dd10ceeed16c | [
"bzip2-1.0.6"
] | null | null | null | ff = open("ath")
biggest=""
amt=0
for line in ff:
row = line.split("\t")
if int(row[3]) > amt:
biggest=row[0]
amt = int(row[3])
print "new biggest", biggest, "with amount", amt | 18.5 | 50 | 0.605405 | ff = open("ath")
biggest=""
amt=0
for line in ff:
row = line.split("\t")
if int(row[3]) > amt:
biggest=row[0]
amt = int(row[3])
print "new biggest", biggest, "with amount", amt | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b7c89a885f4b2154d1a72382d13f547d7754140f | 25,683 | py | Python | migrations/options/src/python/migrate_config.py | areitz/pants | 9bfb3feb0272c05f36e190c9147091b97ee1950d | [
"Apache-2.0"
] | null | null | null | migrations/options/src/python/migrate_config.py | areitz/pants | 9bfb3feb0272c05f36e190c9147091b97ee1950d | [
"Apache-2.0"
] | null | null | null | migrations/options/src/python/migrate_config.py | areitz/pants | 9bfb3feb0272c05f36e190c9147091b97ee1950d | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import sys
migrati... | 53.617954 | 100 | 0.632675 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import sys
from col... | 0 | 0 | 0 | 0 | 0 | 4,007 | 0 | 74 | 136 |
07e4db0452840cd736ac7ae5d2bb469e277d44ed | 7,970 | py | Python | sdk_liteos/third_party/u-boot-v2019.07/u-boot-v2019.07/test/py/tests/test_efi_selftest.py | openharmony-gitee-mirror/device_bearpi_bearpi_hm_nano | c463575de065aad080f730ffbd479628eb821105 | [
"BSD-3-Clause"
] | 1 | 2022-02-15T08:51:55.000Z | 2022-02-15T08:51:55.000Z | sdk_liteos/third_party/u-boot-v2019.07/u-boot-v2019.07/test/py/tests/test_efi_selftest.py | openharmony-gitee-mirror/device_bearpi_bearpi_hm_nano | c463575de065aad080f730ffbd479628eb821105 | [
"BSD-3-Clause"
] | null | null | null | sdk_liteos/third_party/u-boot-v2019.07/u-boot-v2019.07/test/py/tests/test_efi_selftest.py | openharmony-gitee-mirror/device_bearpi_bearpi_hm_nano | c463575de065aad080f730ffbd479628eb821105 | [
"BSD-3-Clause"
] | 1 | 2021-12-15T09:54:37.000Z | 2021-12-15T09:54:37.000Z | # SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2017, Heinrich Schuchardt <xypron.glpk@gmx.de>
# Test efi API implementation
| 39.261084 | 92 | 0.730991 | # SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2017, Heinrich Schuchardt <xypron.glpk@gmx.de>
# Test efi API implementation
import pytest
import u_boot_utils
@pytest.mark.buildconfigspec('cmd_bootefi_selftest')
def test_efi_selftest(u_boot_console):
"""Test the UEFI implementation
:param u_boot_console: U-Boo... | 0 | 7,691 | 0 | 0 | 0 | 0 | 0 | -10 | 160 |
4aaf204dbdf364bec245a0fd3d86dd2bedfccec0 | 3,685 | py | Python | objects/CSCG/_3d/forms/standard/_3s/main.py | mathischeap/mifem | 3242e253fb01ca205a76568eaac7bbdb99e3f059 | [
"MIT"
] | 1 | 2020-10-14T12:48:35.000Z | 2020-10-14T12:48:35.000Z | objects/CSCG/_3d/forms/standard/_3s/main.py | mathischeap/mifem | 3242e253fb01ca205a76568eaac7bbdb99e3f059 | [
"MIT"
] | null | null | null | objects/CSCG/_3d/forms/standard/_3s/main.py | mathischeap/mifem | 3242e253fb01ca205a76568eaac7bbdb99e3f059 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@author: Yi Zhang.
Department of Aerodynamics
Faculty of Aerospace Engineering
TU Delft, Delft, Netherlands
"""
import sys
if './' not in sys.path: sys.path.append('./')
if __name__ == '__main__':
# mpiexec -n 4 python objects/CSCG/_3d/forms/standard/_3... | 32.324561 | 103 | 0.671642 | # -*- coding: utf-8 -*-
"""
@author: Yi Zhang.
Department of Aerodynamics
Faculty of Aerospace Engineering
TU Delft, Delft, Netherlands
"""
import sys
if './' not in sys.path: sys.path.append('./')
from objects.CSCG._3d.forms.standard._3s.discretize.main import _3dCSCG_Discretize
from obje... | 0 | 475 | 0 | 1,622 | 0 | 75 | 0 | 374 | 209 |
efe570f4490cf6de33bb66a2dd78395ca1ff0595 | 583 | py | Python | bot.py | ImBhashitha/TGraph-Bot | b62ca30ea3a50a593407d1ef7194b1b562463b5c | [
"MIT"
] | 6 | 2021-04-03T10:41:44.000Z | 2021-06-21T12:42:08.000Z | bot.py | v-v-r-official/TGraph-Bot | d3553c7d054682dbc7c7bdcbac516d4df07fc67d | [
"MIT"
] | null | null | null | bot.py | v-v-r-official/TGraph-Bot | d3553c7d054682dbc7c7bdcbac516d4df07fc67d | [
"MIT"
] | 25 | 2021-04-03T10:58:22.000Z | 2022-01-31T07:13:46.000Z | import logging
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
logging.getLogger("pyrogram").setLevel(logging.WARNING)
from config import Config
from pyrogram import Client
if __name__ == "__main__" :
... | 23.32 | 82 | 0.632933 | import logging
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
logging.getLogger("pyrogram").setLevel(logging.WARNING)
import os
from config import Config
from pyrogram import Client
if __name__ == "__mai... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -12 | 22 |
e120916b1062fd4ca62b49c0d5a652f23f23601c | 4,990 | py | Python | fats/test/test_ami.py | BramaBrama/fats | 1c171b004b544b9dc4fc772c3249e1d5b2f497c0 | [
"MIT"
] | null | null | null | fats/test/test_ami.py | BramaBrama/fats | 1c171b004b544b9dc4fc772c3249e1d5b2f497c0 | [
"MIT"
] | null | null | null | fats/test/test_ami.py | BramaBrama/fats | 1c171b004b544b9dc4fc772c3249e1d5b2f497c0 | [
"MIT"
] | null | null | null | # Copyright (c) 2006-2008 Alexander Burtsev
# See LICENSE for details
"""AMI tests
@author: U{Alexander Burtsev<mailto:eburus@gmail.com>}
$Id: test_ami.py 24 2008-02-18 12:22:42Z burus $
"""
FAILURE = 0
SUCCESS = 1
RESPONSE_MAP = {
'Login': {FAILURE:
'Asterisk Call Manager/1.0'
'Resp... | 30.242424 | 72 | 0.530261 | # Copyright (c) 2006-2008 Alexander Burtsev
# See LICENSE for details
"""AMI tests
@author: U{Alexander Burtsev<mailto:eburus@gmail.com>}
$Id: test_ami.py 24 2008-02-18 12:22:42Z burus $
"""
from twisted.trial import unittest
from twisted.internet.protocol import FileWrapper
from twisted.test.test_protocols import S... | 0 | 0 | 0 | 3,019 | 0 | 0 | 0 | 162 | 181 |
a995db823502037346218525f4205cc694ae4b25 | 146 | py | Python | mytest2/packageTest.py | liangjie18430/flask_test_myself | 8923e058d834d6ab7326f869b945601c13674105 | [
"BSD-3-Clause"
] | null | null | null | mytest2/packageTest.py | liangjie18430/flask_test_myself | 8923e058d834d6ab7326f869b945601c13674105 | [
"BSD-3-Clause"
] | null | null | null | mytest2/packageTest.py | liangjie18430/flask_test_myself | 8923e058d834d6ab7326f869b945601c13674105 | [
"BSD-3-Clause"
] | null | null | null |
if __name__ == '__main__':
fuc(1,2)
| 11.230769 | 41 | 0.671233 |
from mytest import *
from mytest.annotationTest import spamrun
@spamrun
def fuc(a,b):
print(a*b)
if __name__ == '__main__':
fuc(1,2)
| 0 | 16 | 0 | 0 | 0 | 0 | 0 | 19 | 69 |
364db17bddedcf9cca80f0ef904066c2a2a31e4d | 909 | py | Python | src/match_pattern/java_source_model.py | elsid/master | b3624a6fb3a007fff005c0811f05c5802344b46b | [
"MIT"
] | null | null | null | src/match_pattern/java_source_model.py | elsid/master | b3624a6fb3a007fff005c0811f05c5802344b46b | [
"MIT"
] | null | null | null | src/match_pattern/java_source_model.py | elsid/master | b3624a6fb3a007fff005c0811f05c5802344b46b | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# coding: utf-8
if __name__ == '__main__':
main()
| 25.25 | 69 | 0.652365 | #!/usr/bin/env python2
# coding: utf-8
import yaml
from argparse import ArgumentParser
from sys import stdout, stderr
from java_source_parser import make_model
def main():
args = parse_args()
model = load_model(args.path, args.external_path_list)
yaml.dump(model, stdout)
def parse_args():
parser = ... | 0 | 0 | 0 | 0 | 0 | 636 | 0 | 33 | 158 |
21978581be874e3143e8dabfb84417cd3c5960c2 | 173 | py | Python | Interface_teste.py | ViniciusRCortez/Flask_test | 4944090cbf9545744a504754a5d2aeeef2e9fc60 | [
"MIT"
] | null | null | null | Interface_teste.py | ViniciusRCortez/Flask_test | 4944090cbf9545744a504754a5d2aeeef2e9fc60 | [
"MIT"
] | null | null | null | Interface_teste.py | ViniciusRCortez/Flask_test | 4944090cbf9545744a504754a5d2aeeef2e9fc60 | [
"MIT"
] | null | null | null |
teste()
| 12.357143 | 36 | 0.606936 | import numpy as np
import matplotlib.pyplot as plt
def teste():
x = np.arange(0, 10, 1)
y = 3*x
plt.plot(x, y)
plt.savefig(r'static\teste.png')
teste()
| 0 | 0 | 0 | 0 | 0 | 88 | 0 | 7 | 67 |
56d420df3e6844ab932e325204f055c1b6cecdc3 | 6,757 | py | Python | sources/musicdata_spop.py | RichVarney/pydPiper3 | 4f8fdacc83f4e7bc9c568eb5e1a61e022cf7f828 | [
"MIT"
] | 1 | 2021-01-16T13:16:55.000Z | 2021-01-16T13:16:55.000Z | sources/musicdata_spop.py | RichVarney/pydPiper3 | 4f8fdacc83f4e7bc9c568eb5e1a61e022cf7f828 | [
"MIT"
] | 1 | 2022-03-30T10:55:27.000Z | 2022-03-30T10:56:13.000Z | sources/musicdata_spop.py | Saiyato/pydPiper3 | 06d65bd8898b51d18861be8c5237e36c2797d8fc | [
"MIT"
] | 2 | 2020-09-25T06:35:37.000Z | 2022-03-01T01:48:18.000Z | #!/usr/bin/python
# coding: UTF-8
# musicdata service to read from SPOP
# Written by: Ron Ritchey
import logging, queue, time, sys, getopt
if __name__ == '__main__':
logging.basicConfig(format='%(asctime)s:%(levelname)s:%(message)s', filename='musicdata_spop.log', level=logging.DEBUG)
logging.getLogger().addHan... | 29 | 147 | 0.672488 | #!/usr/bin/python
# coding: UTF-8
# musicdata service to read from SPOP
# Written by: Ron Ritchey
import threading, logging, queue, time, sys, telnetlib, json, getopt
from . import musicdata
class musicdata_spop(musicdata.musicdata):
def __init__(self, q, server='localhost', port=6602, pwd=''):
super(musicdata... | 0 | 0 | 0 | 5,354 | 0 | 0 | 0 | 30 | 45 |
228536932ce2260b983df0b4cbe428a6147917d2 | 302 | py | Python | tests/context.py | albanb/Tribud | 80904fffa548b7c1f504572d44b17ad7011cfceb | [
"MIT"
] | null | null | null | tests/context.py | albanb/Tribud | 80904fffa548b7c1f504572d44b17ad7011cfceb | [
"MIT"
] | 9 | 2020-07-03T21:32:40.000Z | 2021-06-09T20:01:33.000Z | tests/context.py | albanb/Tribud | 80904fffa548b7c1f504572d44b17ad7011cfceb | [
"MIT"
] | null | null | null | #!/bin/env python
# -*-coding:utf-8 -*
# pylint: disable=missing-module-docstring
# pylint: disable=wrong-import-position
# pylint: disable=unused-import
# flake8: noqa
import os
import sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(
__file__), '../src/tribud')))
| 20.133333 | 61 | 0.721854 | #!/bin/env python
# -*-coding:utf-8 -*
# pylint: disable=missing-module-docstring
# pylint: disable=wrong-import-position
# pylint: disable=unused-import
# flake8: noqa
import os
import sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(
__file__), '../src/tribud')))
import model
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | -9 | 23 |
c48bf6c897d7009d04d06ad650656a3befa50161 | 8,589 | py | Python | depth_prediction/predictor.py | sjyk/deeplens | e8cc8fd60b07025246aded059523b41e6bcc64e3 | [
"MIT"
] | 4 | 2018-08-09T22:05:51.000Z | 2020-03-11T03:09:24.000Z | depth_prediction/predictor.py | sjyk/deeplens | e8cc8fd60b07025246aded059523b41e6bcc64e3 | [
"MIT"
] | null | null | null | depth_prediction/predictor.py | sjyk/deeplens | e8cc8fd60b07025246aded059523b41e6bcc64e3 | [
"MIT"
] | null | null | null | import argparse
import os
import sys
import numpy as np
from matplotlib import pyplot as plt
from PIL import Image
import depth_prediction.models as models
from main import utils
import logging
logger = utils.get_logger(name=__name__)
DEFAULT_MODEL_PATH = "../resources/models/depth_prediction/NYU_" \
... | 36.088235 | 80 | 0.627663 | import argparse
import os
import sys
import numpy as np
import tensorflow as tf
from matplotlib import pyplot as plt
from PIL import Image
from urllib.request import urlretrieve
import depth_prediction.models as models
from main import utils
import glob
import logging
logger = utils.get_logger(name=__name__)
DEFAULT_... | 0 | 0 | 0 | 3,985 | 0 | 0 | 0 | 9 | 89 |
c049c73478a5f3a4a6e050bfdb5a6fd4d5f690d3 | 157 | py | Python | betacore/kafka/schema/__init__.py | beta-core/betacore_kafka_schema | ed16d2f66672e41c80fee717ba4e82c1fbc4b222 | [
"MIT"
] | null | null | null | betacore/kafka/schema/__init__.py | beta-core/betacore_kafka_schema | ed16d2f66672e41c80fee717ba4e82c1fbc4b222 | [
"MIT"
] | null | null | null | betacore/kafka/schema/__init__.py | beta-core/betacore_kafka_schema | ed16d2f66672e41c80fee717ba4e82c1fbc4b222 | [
"MIT"
] | null | null | null | """ Kafka schema
"""
__version__:str = '1.0.0.rc1'
__author__: str ='Brandon Bluemner'
| 15.7 | 36 | 0.707006 | """ Kafka schema
"""
from . import serializer
from . import avro
from . import registry
__version__:str = '1.0.0.rc1'
__author__: str ='Brandon Bluemner'
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 66 |
054fa095a83eb062c91f53fd97291f011686d9bc | 3,771 | py | Python | datasets/vocab.py | naver-ai/pcme | 587aa0de710f3f40eac42cd97657c1a9dcfc6ebc | [
"MIT"
] | 57 | 2021-06-15T05:25:29.000Z | 2022-03-30T03:12:32.000Z | datasets/vocab.py | naver-ai/pcme | 587aa0de710f3f40eac42cd97657c1a9dcfc6ebc | [
"MIT"
] | 5 | 2021-07-05T09:14:05.000Z | 2022-03-22T14:32:21.000Z | datasets/vocab.py | naver-ai/pcme | 587aa0de710f3f40eac42cd97657c1a9dcfc6ebc | [
"MIT"
] | 11 | 2021-06-23T02:25:29.000Z | 2022-01-20T01:10:56.000Z | """ Create a vocabulary wrapper.
Original code:
https://github.com/yalesong/pvse/blob/master/vocab.py
"""
from collections import Counter
import os
import fire
from nltk.tokenize import word_tokenize
ANNOTATIONS = {
'mrw': ['mrw-v1.0.json'],
'tgif': ['tgif-v1.0.tsv'],
'coco': ['annotations/captions_trai... | 26.935714 | 85 | 0.600902 | """ Create a vocabulary wrapper.
Original code:
https://github.com/yalesong/pvse/blob/master/vocab.py
"""
from collections import Counter
import json
import os
import pickle
import fire
from nltk.tokenize import word_tokenize
from pycocotools.coco import COCO
ANNOTATIONS = {
'mrw': ['mrw-v1.0.json'],
'tgif'... | 0 | 0 | 0 | 762 | 0 | 1,212 | 0 | -6 | 204 |
0b2d4c7614855354b7964eb33d813fc2986d342e | 4,227 | py | Python | network/textnet.py | fendaq/TextRSN | 02a6bc06cd64b581414ed5065a8c93e0c68a807a | [
"MIT"
] | 1 | 2020-05-26T01:00:38.000Z | 2020-05-26T01:00:38.000Z | network/textnet.py | fendaq/TextRSN | 02a6bc06cd64b581414ed5065a8c93e0c68a807a | [
"MIT"
] | null | null | null | network/textnet.py | fendaq/TextRSN | 02a6bc06cd64b581414ed5065a8c93e0c68a807a | [
"MIT"
] | 3 | 2020-05-26T01:00:39.000Z | 2021-02-09T16:38:37.000Z | import torch.nn as nn
| 33.816 | 104 | 0.582919 | import torch
import torch.nn as nn
import torch.nn.functional as F
from network.vgg import VggNet
from network.resnet import ResNet
from util.config import config as cfg
class UpBlok(nn.Module):
def __init__(self, in_channels, out_channels):
super().__init__()
self.conv1x1 = nn.Conv2d(in_channels... | 0 | 0 | 0 | 3,961 | 0 | 0 | 0 | 38 | 202 |
c70b947162239fb2f8e8ec9249e5c30a9e8d52bd | 12,790 | py | Python | torchmodels.py | TrustPaul/intwractive_weak | acb7603eb003d3857e21957cb22ae15f20061d51 | [
"MIT"
] | 21 | 2021-02-18T21:18:52.000Z | 2022-03-29T00:32:36.000Z | torchmodels.py | TrustPaul/intwractive_weak | acb7603eb003d3857e21957cb22ae15f20061d51 | [
"MIT"
] | 1 | 2021-03-31T12:49:52.000Z | 2021-03-31T21:00:41.000Z | torchmodels.py | TrustPaul/intwractive_weak | acb7603eb003d3857e21957cb22ae15f20061d51 | [
"MIT"
] | 2 | 2021-04-02T14:31:07.000Z | 2021-08-07T15:38:04.000Z | import torch
import torch.multiprocessing
torch.multiprocessing.set_sharing_strategy('file_system')
| 36.752874 | 111 | 0.493901 | import numpy as np
import torch
from sklearn.utils import resample
import torch.multiprocessing
torch.multiprocessing.set_sharing_strategy('file_system')
def weight_reset(m):
if isinstance(m, torch.nn.Linear):
m.reset_parameters()
class Feedforward(torch.nn.Module):
def __init__(self, input_size... | 0 | 0 | 0 | 9,606 | 0 | 2,858 | 0 | 10 | 209 |
d5287b13e6bb9955b5e70d49c11f89df2e347ffc | 351 | py | Python | conf/conf.py | fabian-hk/Secure-Two-Party-Computation | f7e10a0a5c1b0361dd700391d81cdcc75612666d | [
"BSD-2-Clause"
] | 6 | 2019-05-21T18:40:50.000Z | 2021-10-19T10:27:50.000Z | conf/conf.py | fabian-hk/Secure-Two-Party-Computation | f7e10a0a5c1b0361dd700391d81cdcc75612666d | [
"BSD-2-Clause"
] | null | null | null | conf/conf.py | fabian-hk/Secure-Two-Party-Computation | f7e10a0a5c1b0361dd700391d81cdcc75612666d | [
"BSD-2-Clause"
] | null | null | null | k = 128
input_size = 320 # number of input bits
upper_bound_gates = 11000
# path to the cbmc compiler
cbmc_path = "data/CBMC-GC-2/bin/"
default_output = "cbmc_parser/gate_files/default_output/"
# on Windows it has to be the address of the "Hyper-V Virtual Ethernet Adapter #2" if you use docker
test_server_ip = 'loca... | 29.25 | 100 | 0.763533 | k = 128
input_size = 320 # number of input bits
upper_bound_gates = 11000
# path to the cbmc compiler
cbmc_path = "data/CBMC-GC-2/bin/"
default_output = "cbmc_parser/gate_files/default_output/"
# on Windows it has to be the address of the "Hyper-V Virtual Ethernet Adapter #2" if you use docker
test_server_ip = 'loca... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3524f2a9d729b0a15b1394954ff749c5b02de2c0 | 491 | py | Python | app_test.py | comp30670-Group-Assignment/dublinbikes | 62b60bc953a3001f50bcc448fbdf660820399424 | [
"MIT"
] | null | null | null | app_test.py | comp30670-Group-Assignment/dublinbikes | 62b60bc953a3001f50bcc448fbdf660820399424 | [
"MIT"
] | null | null | null | app_test.py | comp30670-Group-Assignment/dublinbikes | 62b60bc953a3001f50bcc448fbdf660820399424 | [
"MIT"
] | null | null | null | import datetime
from app import predictions
import time
while True:
now = datetime.datetime.now()
hour = now.hour
minute = now.minute
second = now.second
if hour == 1 and minute == 1 and second == 1:
predictions("available_bike_stands")
time.sleep((24*60*60) - 1)... | 20.458333 | 49 | 0.690428 | from flask import Flask, render_template, jsonify
from extractor import extractorv1
import functools
import os
import sqlalchemy as sql
import pandas as pd
import datetime
import pickle
from app import predictions
import time
while True:
now = datetime.datetime.now()
hour = now.hour
minute = now.minut... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 16 | 154 |
2e855caaa8090f18d70d5dd8d9ee0d1b4328ac67 | 20,333 | py | Python | WorkingFileForTesting.py | bpmcdowell11/TXRRC_data_harvest | 16b4e8586780860f2f3c8ffdde62f8764f8b833e | [
"Unlicense"
] | null | null | null | WorkingFileForTesting.py | bpmcdowell11/TXRRC_data_harvest | 16b4e8586780860f2f3c8ffdde62f8764f8b833e | [
"Unlicense"
] | null | null | null | WorkingFileForTesting.py | bpmcdowell11/TXRRC_data_harvest | 16b4e8586780860f2f3c8ffdde62f8764f8b833e | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Aug 4 14:27:23 2020
@author: MBelobraydic
"""
if __name__ == '__main__':
main()
print('WorkingFileForTesting.py complete.')
| 55.40327 | 186 | 0.648207 | # -*- coding: utf-8 -*-
"""
Created on Tue Aug 4 14:27:23 2020
@author: MBelobraydic
"""
import argparse
import sys
import pandas as pd
import json
from dbf900_main_bytes import yield_blocks, parse_record
from dbf900_layouts_bytes import dbf900_layout
from dbf900_formats_bytes import pic_yyyymmdd, pic_numeric, pic_an... | 0 | 0 | 0 | 0 | 0 | 19,870 | 0 | 77 | 200 |
b7f481cc812d402c9b5be26182c97c2390ae611e | 166 | py | Python | makemigrations.py | Govexec/django-formulaic | b9516a963673cb21279a2ecdf62a199b9203d538 | [
"MIT"
] | 1 | 2021-08-20T04:21:20.000Z | 2021-08-20T04:21:20.000Z | makemigrations.py | Govexec/django-formulaic | b9516a963673cb21279a2ecdf62a199b9203d538 | [
"MIT"
] | 4 | 2020-12-05T00:31:40.000Z | 2021-09-22T20:06:53.000Z | makemigrations.py | Govexec/django-formulaic | b9516a963673cb21279a2ecdf62a199b9203d538 | [
"MIT"
] | 1 | 2020-12-04T19:16:36.000Z | 2020-12-04T19:16:36.000Z | #!/usr/bin/env python
from django.core.management import call_command
from boot_django import boot_django
boot_django()
call_command("makemigrations", "formulaic")
| 20.75 | 47 | 0.813253 | #!/usr/bin/env python
from django.core.management import call_command
from boot_django import boot_django
boot_django()
call_command("makemigrations", "formulaic")
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0d66cf0c8e6a932f802a04405a8e3d43d2720c79 | 4,737 | py | Python | EQUATIONS/FOR_RESOLUTION_STUDY/DivFrhoResolutionStudy.py | mmicromegas/ransX | 2faaa786e00cfd14dce0e18f0793cd0252428d2a | [
"BSD-2-Clause"
] | 4 | 2019-04-22T11:43:47.000Z | 2020-09-16T00:28:15.000Z | EQUATIONS/FOR_RESOLUTION_STUDY/DivFrhoResolutionStudy.py | mmicromegas/ransX | 2faaa786e00cfd14dce0e18f0793cd0252428d2a | [
"BSD-2-Clause"
] | 34 | 2019-07-01T09:11:00.000Z | 2022-03-30T13:35:43.000Z | EQUATIONS/FOR_RESOLUTION_STUDY/DivFrhoResolutionStudy.py | mmicromegas/ransX | 2faaa786e00cfd14dce0e18f0793cd0252428d2a | [
"BSD-2-Clause"
] | 1 | 2020-09-16T00:28:17.000Z | 2020-09-16T00:28:17.000Z |
# Theoretical background https://arxiv.org/abs/1401.5176
# Mocak, Meakin, Viallet, Arnett, 2014, Compressible Hydrodynamic Mean-Field #
# Equations in Spherical Geometry and their Application to Turbulent Stellar #
# Convection Data #
| 31.791946 | 167 | 0.565337 | import numpy as np
from scipy import integrate
import matplotlib.pyplot as plt
from UTILS.Calculus import Calculus
from UTILS.SetAxisLimit import SetAxisLimit
from UTILS.Tools import Tools
from UTILS.Errors import Errors
import sys
# Theoretical background https://arxiv.org/abs/1401.5176
# Mocak, Meakin, Viallet, Ar... | 0 | 0 | 0 | 4,244 | 0 | 0 | 0 | 56 | 199 |
b82a5d4feb95b56f622f293569bdecb87237f1b5 | 6,460 | py | Python | breveIDE_windows_2.7.2_2/breveIDE_2.7.2/lib/python2.3/dis.py | Lamouse/Evolutionary-Creativity | 9e9a4094285241d0541e0b87a3bd2c5e4ba804d3 | [
"MIT"
] | null | null | null | breveIDE_windows_2.7.2_2/breveIDE_2.7.2/lib/python2.3/dis.py | Lamouse/Evolutionary-Creativity | 9e9a4094285241d0541e0b87a3bd2c5e4ba804d3 | [
"MIT"
] | null | null | null | breveIDE_windows_2.7.2_2/breveIDE_2.7.2/lib/python2.3/dis.py | Lamouse/Evolutionary-Creativity | 9e9a4094285241d0541e0b87a3bd2c5e4ba804d3 | [
"MIT"
] | null | null | null | """Disassembler of Python byte code into mnemonics."""
import sys
import types
from opcode import __all__ as _opcodes_all
__all__ = ["dis","disassemble","distb","disco"] + _opcodes_all
del _opcodes_all
def dis(x=None):
"""Disassemble classes, methods, functions, or code.
With no argument, disassemble the la... | 28.584071 | 73 | 0.473529 | """Disassembler of Python byte code into mnemonics."""
import sys
import types
from opcode import *
from opcode import __all__ as _opcodes_all
__all__ = ["dis","disassemble","distb","disco"] + _opcodes_all
del _opcodes_all
def dis(x=None):
"""Disassemble classes, methods, functions, or code.
With no argume... | 0 | 0 | 0 | 0 | 0 | 1,272 | 0 | -1 | 46 |
fe451b9bc60802d4dfacb744198865ff2eb5e57e | 717 | py | Python | var/spack/repos/builtin/packages/r-splancs/package.py | varioustoxins/spack | cab0e4cb240f34891a6d753f3393e512f9a99e9a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/r-splancs/package.py | varioustoxins/spack | cab0e4cb240f34891a6d753f3393e512f9a99e9a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 6 | 2022-01-08T08:41:11.000Z | 2022-03-14T19:28:07.000Z | var/spack/repos/builtin/packages/r-splancs/package.py | foeroyingur/spack | 5300cbbb2e569190015c72d0970d25425ea38647 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
| 35.85 | 97 | 0.714086 | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RSplancs(RPackage):
"""Spatial and Space-Time Point Pattern Analysis"""
homepage = "h... | 0 | 0 | 0 | 475 | 0 | 0 | 0 | -2 | 46 |
4cef8c763d2f4ba250a52d66b1b300a8b8f00b2d | 9,584 | py | Python | k2/python/k2/ops.py | drawfish/k2 | acdbb2aeb2bb5edb83fec7e2eb4d4b2c35fd9021 | [
"Apache-2.0"
] | 491 | 2020-09-17T09:05:05.000Z | 2022-03-31T13:38:18.000Z | k2/python/k2/ops.py | drawfish/k2 | acdbb2aeb2bb5edb83fec7e2eb4d4b2c35fd9021 | [
"Apache-2.0"
] | 600 | 2020-09-17T13:55:06.000Z | 2022-03-30T23:23:40.000Z | k2/python/k2/ops.py | drawfish/k2 | acdbb2aeb2bb5edb83fec7e2eb4d4b2c35fd9021 | [
"Apache-2.0"
] | 121 | 2020-09-17T15:44:56.000Z | 2022-03-23T13:22:52.000Z | # Copyright 2020 Mobvoi Inc. (authors: Fangjun Kuang)
# Xiaomi Corp. (author: Haowen Qiu)
#
# See ../../../LICENSE for clarification regarding multiple authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance wit... | 34.599278 | 80 | 0.604236 | # Copyright 2020 Mobvoi Inc. (authors: Fangjun Kuang)
# Xiaomi Corp. (author: Haowen Qiu)
#
# See ../../../LICENSE for clarification regarding multiple authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance wit... | 0 | 1,962 | 0 | 31 | 0 | 0 | 0 | 6 | 121 |
f15a693c895d6fe42499999e78c27ba587b932c2 | 1,222 | py | Python | back/admin/sensor.py | Bash-Air/bashair | 76d07c0cca9323f5089d0c49450470bde887c4ea | [
"MIT"
] | null | null | null | back/admin/sensor.py | Bash-Air/bashair | 76d07c0cca9323f5089d0c49450470bde887c4ea | [
"MIT"
] | null | null | null | back/admin/sensor.py | Bash-Air/bashair | 76d07c0cca9323f5089d0c49450470bde887c4ea | [
"MIT"
] | 1 | 2022-02-14T11:27:50.000Z | 2022-02-14T11:27:50.000Z |
# @admin.register(Sensor)
# class SensorAdmin(admin.ModelAdmin):
# search_fields = ['node__uid', 'description']
# list_display = ['node', 'pin', 'sensor_type',
# 'description', 'created', 'modified']
# list_filter = ['node__owner', 'sensor_type']
| 28.418605 | 84 | 0.636661 | from django.contrib import admin
from back.models.node import *
class SensorInline(admin.TabularInline):
model = Sensor
max_num = 5
extra = 0
@admin.register(Node)
class NodeAdmin(admin.ModelAdmin):
search_fields = ['uid', 'description']
list_display = ['uid', 'owner', 'location',
... | 0 | 712 | 0 | 68 | 0 | 0 | 0 | 20 | 137 |
76225bcdf05a9737b817d82f03b149a7a220c08e | 23,038 | py | Python | path-finding/main.py | matheuspercario/a-star-path-finding | 4a6fe0cd50d638fe9903d69c8b50848f81a841fc | [
"MIT"
] | 1 | 2021-07-02T15:08:23.000Z | 2021-07-02T15:08:23.000Z | path-finding/main.py | matheuspercario/a-star-path-finding | 4a6fe0cd50d638fe9903d69c8b50848f81a841fc | [
"MIT"
] | 3 | 2021-06-23T22:57:24.000Z | 2021-06-23T22:57:47.000Z | path-finding/main.py | matheuspercario/a-star-path-finding | 4a6fe0cd50d638fe9903d69c8b50848f81a841fc | [
"MIT"
] | 2 | 2021-07-03T02:20:03.000Z | 2021-07-21T01:23:52.000Z | import pygame
from queue import PriorityQueue
"""
Path Finding - Buscador de caminhos com A*
um programa em python desenvolvido durante a disciplina de
Inteligncia Artificial da Faculdade de Tecnologia da Unicamp pelos alunos:
1. Kevin Barrios
2. Larissa Benevides
3. Matheus Alves
4. Matheu... | 35.607419 | 164 | 0.552305 | import pygame
from queue import PriorityQueue
"""
Path Finding - Buscador de caminhos com A*
É um programa em python desenvolvido durante a disciplina de
Inteligência Artificial da Faculdade de Tecnologia da Unicamp pelos alunos:
1. Kevin Barrios
2. Larissa Benevides
3. Matheus Alves
4. Math... | 358 | 0 | 0 | 4,200 | 0 | 5,140 | 0 | 0 | 95 |
8765665afd47597fdb4357f3a58708afaf1c5076 | 14,028 | py | Python | tgen/e2e/slot_error.py | AnneBeyer/tgen | f7d7d13a85b8fd35919097c7d11345ddb9775d26 | [
"Apache-2.0"
] | 222 | 2015-06-15T14:39:41.000Z | 2022-03-12T03:45:32.000Z | tgen/e2e/slot_error.py | AnneBeyer/tgen | f7d7d13a85b8fd35919097c7d11345ddb9775d26 | [
"Apache-2.0"
] | 40 | 2015-12-02T10:42:44.000Z | 2021-12-05T17:31:11.000Z | tgen/e2e/slot_error.py | AnneBeyer/tgen | f7d7d13a85b8fd35919097c7d11345ddb9775d26 | [
"Apache-2.0"
] | 72 | 2015-07-27T08:11:48.000Z | 2022-03-24T14:25:37.000Z | #!/usr/bin/env python3
# -"- encoding: utf-8 -"-
import re
from tgen.data import DA
# ----
# BEGIN code copied over from e2e-cleaning -- TODO dependency?
# ----
REALIZATIONS = {
'area': {
'city centre': [
'(?:city|town) cent(?:re|er)',
'cent(?:re|er) of (?:the )?(?:city|town)',
... | 39.294118 | 236 | 0.512047 | #!/usr/bin/env python3
# -"- encoding: utf-8 -"-
import re
import pickle
from tgen.data import DA
from tgen.tfclassif import Reranker
from tgen.logf import log_info
from tgen.futil import file_stream, read_das
# ----
# BEGIN code copied over from e2e-cleaning -- TODO dependency?
# ----
REALIZATIONS = {
'area': ... | 27 | 483 | 0 | 2,350 | 0 | 0 | 0 | 38 | 134 |
5cb8aab3166475072076a853cd2d51a5f85dd9e0 | 3,853 | py | Python | quantfin_bonds/bonds.py | mattange/quantfin_bonds | bb311ccc5ebebf72221b79108f30773573c003bd | [
"MIT"
] | null | null | null | quantfin_bonds/bonds.py | mattange/quantfin_bonds | bb311ccc5ebebf72221b79108f30773573c003bd | [
"MIT"
] | null | null | null | quantfin_bonds/bonds.py | mattange/quantfin_bonds | bb311ccc5ebebf72221b79108f30773573c003bd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Feb 8 10:22:45 2019
@author: mangelon
"""
import numpy as np
import pandas as pd
from scipy.optimize import newton
def price(yield_to_mat, redemption, rate, freq, maturity_dt, settlement_dt,
dcc="30/360 US", eom=False):
"""
Returns the price given the yi... | 34.097345 | 99 | 0.583441 | # -*- coding: utf-8 -*-
"""
Created on Fri Feb 8 10:22:45 2019
@author: mangelon
"""
import numpy as np
import pandas as pd
from scipy.optimize import newton
def price(yield_to_mat, redemption, rate, freq, maturity_dt, settlement_dt,
dcc="30/360 US", eom=False):
"""
Returns the price given the yi... | 0 | 0 | 0 | 0 | 0 | 179 | 0 | 0 | 60 |
c53392e0bf369a149267514819c2bce1ed929992 | 723 | py | Python | gsfpy3_09/gsfScaleFactors.py | irewolepeter/gsfpy_USM_Implementation | c4614ac3f7d833eb86ea38c7708108b130f96612 | [
"MIT"
] | 7 | 2020-07-01T07:12:19.000Z | 2022-01-20T20:39:57.000Z | gsfpy3_09/gsfScaleFactors.py | irewolepeter/gsfpy_USM_Implementation | c4614ac3f7d833eb86ea38c7708108b130f96612 | [
"MIT"
] | 36 | 2020-06-23T09:10:15.000Z | 2022-03-22T10:27:58.000Z | gsfpy3_09/gsfScaleFactors.py | irewolepeter/gsfpy_USM_Implementation | c4614ac3f7d833eb86ea38c7708108b130f96612 | [
"MIT"
] | 2 | 2021-02-07T13:21:52.000Z | 2021-06-24T19:16:16.000Z |
from . import constants
SCALE_INFO_ARRAY = c_gsfScaleInfo * constants.GSF_MAX_PING_ARRAY_SUBRECORDS
| 26.777778 | 84 | 0.665284 | from ctypes import Structure, c_double, c_int, c_ubyte
from . import constants
class c_gsfScaleInfo(Structure):
_fields_ = [
# Specifies bytes of storage in high order nibble and type of compression in
# low order nibble.
("compressionFlag", c_ubyte),
# The scale factor (millionth... | 0 | 0 | 0 | 517 | 0 | 0 | 0 | 33 | 68 |
07942397acbc851edbff840ca9bd3b89333664d5 | 5,093 | py | Python | dev/scripts/ideal_curves.py | tarment10/CoolProp | de465e1cf6755d23231f289c6f7c24fd58eca465 | [
"MIT"
] | null | null | null | dev/scripts/ideal_curves.py | tarment10/CoolProp | de465e1cf6755d23231f289c6f7c24fd58eca465 | [
"MIT"
] | null | null | null | dev/scripts/ideal_curves.py | tarment10/CoolProp | de465e1cf6755d23231f289c6f7c24fd58eca465 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import CoolProp
backend = 'HEOS'
fluid = 'R125'
kwargs = dict(lw = 2)
print('Ideal')
ICT = IdealCurveTracer(backend, fluid, p0 = 1e5, T0 = 900)
T, p = ICT.trace()
plt.plot(T, p, '-', label = 'Ideal Curve', **kwargs)
print('Boyle')
BCT = BoyleCurveTracer(backen... | 32.43949 | 235 | 0.599843 | import numpy as np
import matplotlib.pyplot as plt
import CoolProp, scipy.optimize
class CurveTracer(object):
def __init__(self, backend, fluid, p0, T0):
"""
p0 : Initial pressure [Pa]
T0 : Initial temperatrure [K]
"""
self.P = [p0]
self.T = []
self.AS = Co... | 0 | 0 | 0 | 3,761 | 0 | 0 | 0 | 16 | 115 |
522a7642941c4596eb086c212a60e397b0303dfd | 1,208 | py | Python | unit1/problem_sets/5_1/solution/5_1_2d_3a.py | ga-at-socs/pa-2021-code | 6ba504ad7725d7248f6792975cb20cf3949b2418 | [
"MIT"
] | null | null | null | unit1/problem_sets/5_1/solution/5_1_2d_3a.py | ga-at-socs/pa-2021-code | 6ba504ad7725d7248f6792975cb20cf3949b2418 | [
"MIT"
] | null | null | null | unit1/problem_sets/5_1/solution/5_1_2d_3a.py | ga-at-socs/pa-2021-code | 6ba504ad7725d7248f6792975cb20cf3949b2418 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Practical Algorthns
Problem set: 5.1 - Working with Data Structures
2d and 3a
"""
from timeit import default_timer as timer
import sys
N = 1_000_000
# 2d
"""
Create a list of a million elements, populated with the
first million natural numbers. Using a for loop, (so no direct
formula... | 18.30303 | 66 | 0.654801 | # -*- coding: utf-8 -*-
"""
Practical Algorthns
Problem set: 5.1 - Working with Data Structures
2d and 3a
"""
from timeit import default_timer as timer
import sys
N = 1_000_000
# 2d
"""
Create a list of a million elements, populated with the
first million natural numbers. Using a for loop, (so no direct
formula... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3829478737c54fd8456a48fca09dff4f26238d09 | 1,199 | py | Python | examples/arduino_serial.py | mitag/python-arduino-serial | 6beccc099167a21595c84286a973347a3a903cbd | [
"MIT"
] | 25 | 2018-10-07T13:37:48.000Z | 2022-03-25T07:28:11.000Z | examples/arduino_serial.py | c0qu1/python-arduino-serial | 6beccc099167a21595c84286a973347a3a903cbd | [
"MIT"
] | 1 | 2019-07-10T00:58:33.000Z | 2019-07-10T08:42:39.000Z | examples/arduino_serial.py | c0qu1/python-arduino-serial | 6beccc099167a21595c84286a973347a3a903cbd | [
"MIT"
] | 13 | 2018-10-07T11:53:07.000Z | 2021-05-23T12:41:29.000Z | from __future__ import print_function, division, absolute_import
import time
from robust_serial import write_order, Order, write_i8, write_i16, read_order
from robust_serial.utils import open_serial_port
if __name__ == '__main__':
try:
serial_file = open_serial_port(baudrate=115200, timeout=None)
ex... | 28.547619 | 86 | 0.684737 | from __future__ import print_function, division, absolute_import
import time
from robust_serial import write_order, Order, write_i8, write_i16, read_i8, read_order
from robust_serial.utils import open_serial_port
if __name__ == '__main__':
try:
serial_file = open_serial_port(baudrate=115200, timeout=Non... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 | 0 |
f3b851a29ada71034f0d46c6da1e141b4b45d375 | 3,500 | py | Python | hood_app/migrations/0001_initial.py | petermirithu/my_hoody | 81d2423a7a43cd3e3df548101bbc517927339d89 | [
"MIT"
] | 1 | 2020-01-26T15:09:52.000Z | 2020-01-26T15:09:52.000Z | hood_app/migrations/0001_initial.py | petermirithu/my_hoody | 81d2423a7a43cd3e3df548101bbc517927339d89 | [
"MIT"
] | 11 | 2020-06-06T01:13:23.000Z | 2022-03-12T00:11:03.000Z | hood_app/migrations/0001_initial.py | petermirithu/my_hoody | 81d2423a7a43cd3e3df548101bbc517927339d89 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.8 on 2020-01-16 18:52
| 45.454545 | 123 | 0.582571 | # Generated by Django 2.2.8 on 2020-01-16 18:52
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import pyuploadcare.dj.models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AU... | 0 | 0 | 0 | 3,290 | 0 | 0 | 0 | 49 | 112 |
3414decfd6bb8f94223bb06a6087a7314f8219c2 | 2,896 | py | Python | message_sync/scripts/csv_test2.py | l756302098/ros_practice | 4da8b4ddb25ada2e6f1adb3c0f8b34576aedf6b7 | [
"MIT"
] | null | null | null | message_sync/scripts/csv_test2.py | l756302098/ros_practice | 4da8b4ddb25ada2e6f1adb3c0f8b34576aedf6b7 | [
"MIT"
] | null | null | null | message_sync/scripts/csv_test2.py | l756302098/ros_practice | 4da8b4ddb25ada2e6f1adb3c0f8b34576aedf6b7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#coding=utf-8
import numpy as np
import matplotlib.pyplot as plt
root = "/home/li/bag/0824/02"
if __name__ == '__main__':
x_data = []
y1_data = []
y2_data = []
offset_data = []
# read_csv()
# show_image()
imu_data = load_imu()
imu_x_data = imu_data[:,0]
imu_x... | 31.478261 | 80 | 0.572514 | #!/usr/bin/env python
#coding=utf-8
import cv2
import numpy as np
import matplotlib.pyplot as plt
root = "/home/li/bag/0824/02"
def load_imu():
dlist = np.loadtxt(open(root+"/imu.txt","rb"),delimiter=" ",skiprows=0)
#print(dlist)
#print(dlist.shape)
return dlist
def load_platform():
dlist = np.... | 0 | 0 | 0 | 0 | 0 | 268 | 0 | -11 | 70 |
bf814bc3fca175af2f86191b67256adb86b2372c | 2,926 | py | Python | 11/main.py | maskarb/adventofcode-2021 | 803d4f7128f788b9bc49dc4ba7bbeee2a20c4849 | [
"MIT"
] | null | null | null | 11/main.py | maskarb/adventofcode-2021 | 803d4f7128f788b9bc49dc4ba7bbeee2a20c4849 | [
"MIT"
] | null | null | null | 11/main.py | maskarb/adventofcode-2021 | 803d4f7128f788b9bc49dc4ba7bbeee2a20c4849 | [
"MIT"
] | null | null | null | import os
import sys
if __name__ == '__main__':
if len(sys.argv) < 2 or sys.argv[1] not in ('p1', 'p2'):
print('you done did it wrong')
exit()
filename = os.path.join(sys.argv[0].split('/', 1)[0], 'input.txt')
lines = get_input(filename)
part = sys.argv[1:]
if 'p1' in part:
... | 28.134615 | 116 | 0.452837 | import os
import sys
import numpy as np
def get_input(filename):
with open(filename, 'r') as f:
return f.readlines()
def main_p1(lines):
m = np.array([[int(v) for v in line.strip()] for line in lines]).transpose()
x_max, y_max = m.shape
def increment_value(x, y):
if x >= 0 and y >= 0... | 0 | 0 | 0 | 0 | 0 | 2,458 | 0 | -3 | 92 |
7d0d2e68f1b63c62cf67551c4fd6500a2a079953 | 509 | py | Python | switchboard/helpers.py | juju/switchboard | 1635a0fa18a663a99c97d4c686597a1cd0e48b89 | [
"Apache-2.0"
] | null | null | null | switchboard/helpers.py | juju/switchboard | 1635a0fa18a663a99c97d4c686597a1cd0e48b89 | [
"Apache-2.0"
] | 4 | 2018-03-07T14:42:21.000Z | 2018-03-07T16:27:58.000Z | switchboard/helpers.py | juju/switchboard | 1635a0fa18a663a99c97d4c686597a1cd0e48b89 | [
"Apache-2.0"
] | 1 | 2018-03-07T14:16:56.000Z | 2018-03-07T14:16:56.000Z | """
switchboard.helpers
~~~~~~~~~~~~~~~~
:copyright: (c) 2015 Kyle Adams.
:license: Apache License 2.0, see LICENSE for more details.
"""
| 24.238095 | 59 | 0.644401 | """
switchboard.helpers
~~~~~~~~~~~~~~~~
:copyright: (c) 2015 Kyle Adams.
:license: Apache License 2.0, see LICENSE for more details.
"""
from webob import Request
class MockRequest(Request):
"""
A mock request object which stores a user
instance and the ip address.
"""
def __init__(self, user=No... | 0 | 0 | 0 | 320 | 0 | 0 | 0 | 4 | 46 |
ca0c9bf95123272bd3c407429570c696766e565e | 4,097 | py | Python | share/trick/trickops/tests/ut_WorkflowCommon.py | iamthad/trick | 88ac5b5990228e42a653347c9d7a103acea4d137 | [
"NASA-1.3"
] | 647 | 2015-05-07T16:08:16.000Z | 2022-03-30T02:33:21.000Z | share/trick/trickops/tests/ut_WorkflowCommon.py | tanglemontree/trick | f182c723495185708434e67789457eb29d52ad58 | [
"NASA-1.3"
] | 995 | 2015-04-30T19:44:31.000Z | 2022-03-31T20:14:44.000Z | share/trick/trickops/tests/ut_WorkflowCommon.py | tanglemontree/trick | f182c723495185708434e67789457eb29d52ad58 | [
"NASA-1.3"
] | 251 | 2015-05-15T09:24:34.000Z | 2022-03-22T20:39:05.000Z | import unittest
def suite():
"""Create test suite from WorkflowCommonTestCase unit test class and return"""
return unittest.TestLoader().loadTestsFromTestCase(WorkflowCommonTestCase)
| 40.97 | 101 | 0.660483 | import os, sys
import unittest, time
import pdb
from testconfig import this_trick, tests_dir
from WorkflowCommon import *
def suite():
"""Create test suite from WorkflowCommonTestCase unit test class and return"""
return unittest.TestLoader().loadTestsFromTestCase(WorkflowCommonTestCase)
class WorkflowCommonT... | 0 | 0 | 0 | 3,776 | 0 | 0 | 0 | 18 | 111 |
98fbc4ca756dc05fa6d659df1d5083d26d01a3e8 | 5,493 | py | Python | setup.py | snorfalorpagus/rasterio | 0affcc7dcc38d017ac30d56020faf1558c127edd | [
"BSD-3-Clause"
] | null | null | null | setup.py | snorfalorpagus/rasterio | 0affcc7dcc38d017ac30d56020faf1558c127edd | [
"BSD-3-Clause"
] | null | null | null | setup.py | snorfalorpagus/rasterio | 0affcc7dcc38d017ac30d56020faf1558c127edd | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import logging
import os
import subprocess
import sys
from setuptools import setup
from distutils.extension import Extension
logging.basicConfig()
log = logging.getLogger()
# Parse the version from the fiona module.
with open('rasterio/__init__.py') as f:
for line in f:
if line.find... | 32.696429 | 79 | 0.600218 | #!/usr/bin/env python
import logging
import os
import subprocess
import sys
from setuptools import setup
from distutils.extension import Extension
logging.basicConfig()
log = logging.getLogger()
# Parse the version from the fiona module.
with open('rasterio/__init__.py') as f:
for line in f:
if line.find... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9f77dad9682fb8a26b34615aa72114c1edb74967 | 315 | py | Python | kombu/utils/uuid.py | CountRedClaw/kombu | 14d395aa859b905874d8b4abd677a4c7ac86e10b | [
"BSD-3-Clause"
] | null | null | null | kombu/utils/uuid.py | CountRedClaw/kombu | 14d395aa859b905874d8b4abd677a4c7ac86e10b | [
"BSD-3-Clause"
] | null | null | null | kombu/utils/uuid.py | CountRedClaw/kombu | 14d395aa859b905874d8b4abd677a4c7ac86e10b | [
"BSD-3-Clause"
] | null | null | null | """UUID utilities."""
from __future__ import annotations
from typing import Callable
from uuid import UUID, uuid4
def uuid(_uuid: Callable[[], UUID] = uuid4) -> str:
"""Generate unique id in UUID4 format.
See Also:
For now this is provided by :func:`uuid.uuid4`.
"""
return str(_uuid())
| 21 | 55 | 0.660317 | """UUID utilities."""
from __future__ import annotations
from typing import Callable
from uuid import UUID, uuid4
def uuid(_uuid: Callable[[], UUID] = uuid4) -> str:
"""Generate unique id in UUID4 format.
See Also:
For now this is provided by :func:`uuid.uuid4`.
"""
return str(_uuid())
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
cc043a21d0855500793a31e9fef05be17b7f3e17 | 1,199 | py | Python | shot_detector/filters/sliding_window/debug_swfilter.py | w495/shot_detector | 617ff45c9c3c96bbd9a975aef15f1b2697282b9c | [
"BSD-3-Clause"
] | 18 | 2015-09-27T21:34:18.000Z | 2022-03-24T12:14:51.000Z | shot_detector/filters/sliding_window/debug_swfilter.py | w495/shot_detector | 617ff45c9c3c96bbd9a975aef15f1b2697282b9c | [
"BSD-3-Clause"
] | 6 | 2021-03-18T21:21:35.000Z | 2022-03-11T23:32:55.000Z | shot_detector/filters/sliding_window/debug_swfilter.py | w495/shot_detector | 617ff45c9c3c96bbd9a975aef15f1b2697282b9c | [
"BSD-3-Clause"
] | 3 | 2017-09-14T20:53:26.000Z | 2021-12-18T19:18:18.000Z | # -*- coding: utf8 -*-
"""
This is part of shot detector.
Produced by w495 at 2017.05.04 04:18:27
"""
from __future__ import absolute_import, division, print_function
| 26.065217 | 65 | 0.507089 | # -*- coding: utf8 -*-
"""
This is part of shot detector.
Produced by w495 at 2017.05.04 04:18:27
"""
from __future__ import absolute_import, division, print_function
import logging
from .base_stat_swfilter import BaseSWFilter
class DebugSWFilter(BaseSWFilter):
"""
...
"""
__logger = lo... | 0 | 0 | 0 | 937 | 0 | 0 | 0 | 16 | 69 |
506c997c3834281eb7552793b495c2b4c95385c4 | 12,830 | py | Python | feature/TRAIN_TABLE.py | 151232summerday/IJCAI17_Tianchi_Rank4 | b619f5244a08afab631f537c41c2f72e45b6be98 | [
"MIT"
] | 195 | 2017-06-04T14:40:06.000Z | 2022-03-18T01:39:52.000Z | feature/TRAIN_TABLE.py | lzhbrian/IJCAI17_Tianchi_Rank4 | b619f5244a08afab631f537c41c2f72e45b6be98 | [
"MIT"
] | 5 | 2018-06-20T07:34:09.000Z | 2019-11-22T09:39:36.000Z | feature/TRAIN_TABLE.py | lzhbrian/IJCAI17_Tianchi_Rank4 | b619f5244a08afab631f537c41c2f72e45b6be98 | [
"MIT"
] | 126 | 2017-06-05T04:16:08.000Z | 2021-09-18T09:54:16.000Z | # -*- coding: utf-8 -*-
"""
Created on Thu Feb 16 23:11:56 2017
@author: Flamingo
"""
import pandas as pd
import numpy as np
import datetime
import copy
import sys
sys.path.append('../TOOLS')
#%% readin shop data
HOLI = pd.read_csv('../additional/HOLI.csv')
HOLI = HOLI.set_index(['DATE'],drop = True)
HOLI_TAB = H... | 43.198653 | 166 | 0.672564 | # -*- coding: utf-8 -*-
"""
Created on Thu Feb 16 23:11:56 2017
@author: Flamingo
"""
import pandas as pd
import numpy as np
import datetime
import copy
import sys
sys.path.append('../TOOLS')
from IJCAI2017_TOOL import *
#%% readin shop data
HOLI = pd.read_csv('../additional/HOLI.csv')
HOLI = HOLI.set_index(['DAT... | 0 | 0 | 0 | 0 | 0 | 126 | 0 | 7 | 44 |
e0bcef9c6957c4f0d117454d0f0c3ebc5ba21528 | 1,249 | py | Python | pony/orm/tests/test_random.py | ProgHaj/pony | 52720af1728ab2931364be8615e18ad8714a7c9e | [
"Apache-2.0"
] | 2,628 | 2015-01-02T17:55:28.000Z | 2022-03-31T10:36:42.000Z | pony/orm/tests/test_random.py | ProgHaj/pony | 52720af1728ab2931364be8615e18ad8714a7c9e | [
"Apache-2.0"
] | 525 | 2015-01-03T20:30:08.000Z | 2022-03-23T12:30:01.000Z | pony/orm/tests/test_random.py | ProgHaj/pony | 52720af1728ab2931364be8615e18ad8714a7c9e | [
"Apache-2.0"
] | 256 | 2015-01-02T17:55:31.000Z | 2022-03-20T17:01:37.000Z | import unittest
db = Database()
if __name__ == '__main__':
unittest.main()
| 24.98 | 60 | 0.609287 | import unittest
from pony.orm import *
from pony.orm.tests.testutils import *
from pony.orm.tests import setup_database, teardown_database
db = Database()
class Person(db.Entity):
id = PrimaryKey(int)
name = Required(unicode)
class TestRandom(unittest.TestCase):
@classmethod
def setUpClass(cls):
... | 0 | 817 | 0 | 72 | 0 | 0 | 0 | 57 | 220 |
9c8aef185b95b506531c79656508ec05f28d4f63 | 4,240 | py | Python | pgcontents/checkpoints.py | freedom079215/pgcontents | 38b1f75c23aa68e29fe7997b5f591ffa0f96bf5d | [
"Apache-2.0"
] | 138 | 2015-01-04T07:03:09.000Z | 2021-11-08T13:10:01.000Z | pgcontents/checkpoints.py | freedom079215/pgcontents | 38b1f75c23aa68e29fe7997b5f591ffa0f96bf5d | [
"Apache-2.0"
] | 52 | 2015-02-26T17:34:28.000Z | 2021-10-14T00:19:42.000Z | pgcontents/checkpoints.py | freedom079215/pgcontents | 38b1f75c23aa68e29fe7997b5f591ffa0f96bf5d | [
"Apache-2.0"
] | 73 | 2015-05-04T11:28:15.000Z | 2022-03-07T05:44:10.000Z | """
An IPython FileContentsManager that uses Postgres for checkpoints.
"""
from __future__ import unicode_literals
| 31.176471 | 77 | 0.60566 | """
An IPython FileContentsManager that uses Postgres for checkpoints.
"""
from __future__ import unicode_literals
from .api_utils import (
_decode_unknown_from_base64,
outside_root_to_404,
reads_base64,
to_b64,
writes_base64,
)
from .managerbase import PostgresManagerMixin
from .query import (
... | 0 | 2,638 | 0 | 982 | 0 | 0 | 0 | 392 | 112 |
c58ec190e2d1a06728f2a34e51ff7589073efcb4 | 782 | py | Python | tron/Hub/Command/Encoders/BinaryCmdEncoder.py | sdss/tron | 886c5c5fb6341ad85e4a9f5d6f5ecb6bbc0d8322 | [
"BSD-3-Clause"
] | null | null | null | tron/Hub/Command/Encoders/BinaryCmdEncoder.py | sdss/tron | 886c5c5fb6341ad85e4a9f5d6f5ecb6bbc0d8322 | [
"BSD-3-Clause"
] | null | null | null | tron/Hub/Command/Encoders/BinaryCmdEncoder.py | sdss/tron | 886c5c5fb6341ad85e4a9f5d6f5ecb6bbc0d8322 | [
"BSD-3-Clause"
] | null | null | null | __all__ = ['BinaryCmdEncoder']
| 23.69697 | 96 | 0.578005 | __all__ = ['BinaryCmdEncoder']
import struct
from tron import Misc
from .CommandEncoder import CommandEncoder
class BinaryCmdEncoder(CommandEncoder):
def __init__(self, **argv):
CommandEncoder.__init__(self, **argv)
def encode(self, cmd):
""" Encapsulate an old-style binary command. """
... | 0 | 0 | 0 | 645 | 0 | 0 | 0 | 13 | 92 |
5d77d3b0b614b447a3c3c087bacc901968beb582 | 114 | py | Python | calc.py | hmiyake/my-test-repo-old | 3c6b365861e69a0acd202ee9f520311a98810059 | [
"MIT"
] | null | null | null | calc.py | hmiyake/my-test-repo-old | 3c6b365861e69a0acd202ee9f520311a98810059 | [
"MIT"
] | 1 | 2021-08-04T02:33:32.000Z | 2021-08-04T02:33:51.000Z | calc.py | hmiyake/my-test-repo-old | 3c6b365861e69a0acd202ee9f520311a98810059 | [
"MIT"
] | null | null | null | #!/bin/env python
| 14.25 | 26 | 0.684211 | #!/bin/env python
def calc_wa(val1, val2):
return val1 + val2
def calc_wari(val1, val2):
return val1 / val2
| 0 | 0 | 0 | 0 | 0 | 50 | 0 | 0 | 46 |
6419b882979612cf23abccbfba3bd76711d302b4 | 2,609 | py | Python | ex2-revisited.py | karimjamali/Class7 | 2f8aed311d4fb793639f92c6dec22bc95e5266a7 | [
"Apache-2.0"
] | null | null | null | ex2-revisited.py | karimjamali/Class7 | 2f8aed311d4fb793639f92c6dec22bc95e5266a7 | [
"Apache-2.0"
] | null | null | null | ex2-revisited.py | karimjamali/Class7 | 2f8aed311d4fb793639f92c6dec22bc95e5266a7 | [
"Apache-2.0"
] | null | null | null |
if __name__ == '__main__':
main()
| 32.209877 | 89 | 0.553852 | import pyeapi
from pprint import pprint
import argparse
def check_vlan(a_list,vlan_id):
vlan_data=a_list[0]['result']['vlans']
vlans=vlan_data.keys()
for vlan in vlans:
if int(vlan_id) != int(vlan):
continue
elif int(vlan_id) == int(vlan):
vlan_name=vlan_data[str(vlan)... | 0 | 0 | 0 | 0 | 0 | 2,467 | 0 | -10 | 112 |
76cf76d0f4399aa29f5d8296495b90281eedee2b | 856 | py | Python | test/asi/profiles.py | LifeLaboratory/finopolis_backend | 56aac8e0b92193c627b68f3d029f6f804d001db3 | [
"MIT"
] | null | null | null | test/asi/profiles.py | LifeLaboratory/finopolis_backend | 56aac8e0b92193c627b68f3d029f6f804d001db3 | [
"MIT"
] | null | null | null | test/asi/profiles.py | LifeLaboratory/finopolis_backend | 56aac8e0b92193c627b68f3d029f6f804d001db3 | [
"MIT"
] | null | null | null | import unittest
if __name__ == '__main__':
unittest.main()
| 25.939394 | 49 | 0.577103 | import unittest
import requests as req
from app.config.config import HOST
from app.api.base.base_name import *
class TestAuth(unittest.TestCase):
def test_get_profile(self):
s = req.Session()
r = s.get(HOST + '/profile/1')
print(r.text)
self.assertEqual(r.status_code, 200)
s... | 0 | 0 | 0 | 674 | 0 | 0 | 0 | 29 | 89 |
1f58f746cf4b7544977bd4869c88152deff63916 | 2,998 | py | Python | analysis/GIFnet_pipeline/generate_mpfc_models.py | nauralcodinglab/raphegif | c722875c39e83900c8a0a43f28a16d5336689a97 | [
"MIT"
] | null | null | null | analysis/GIFnet_pipeline/generate_mpfc_models.py | nauralcodinglab/raphegif | c722875c39e83900c8a0a43f28a16d5336689a97 | [
"MIT"
] | null | null | null | analysis/GIFnet_pipeline/generate_mpfc_models.py | nauralcodinglab/raphegif | c722875c39e83900c8a0a43f28a16d5336689a97 | [
"MIT"
] | null | null | null | import pickle
import argparse
import json
from copy import deepcopy
import numpy as np
import grr.GIF_network as gfn
from grr.Tools import check_dict_fields
#%% PARSE COMMANDLINE ARGUMENTS
parser = argparse.ArgumentParser()
parser.add_argument(
'--mods', type=str, required=True, help='Pickled neuron models.'
)... | 22.712121 | 75 | 0.63509 | import pickle
import argparse
import json
from copy import deepcopy
import numpy as np
import grr.GIF_network as gfn
from grr.Tools import check_dict_fields
#%% PARSE COMMANDLINE ARGUMENTS
parser = argparse.ArgumentParser()
parser.add_argument(
'--mods', type=str, required=True, help='Pickled neuron models.'
)... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
21158f2e402fa2836a51386ec4cc089d8b005541 | 2,283 | py | Python | upside/enforcer/upload/cli.py | upsidetravel/enforcer | 05e89c4064b20a1d82ac7f24a574f3aeb0862597 | [
"Apache-2.0"
] | 4 | 2019-09-09T19:59:45.000Z | 2021-01-20T07:24:38.000Z | upside/enforcer/upload/cli.py | upsidetravel/enforcer | 05e89c4064b20a1d82ac7f24a574f3aeb0862597 | [
"Apache-2.0"
] | 1 | 2019-06-27T13:56:35.000Z | 2019-06-27T13:56:35.000Z | upside/enforcer/upload/cli.py | upsidetravel/enforcer | 05e89c4064b20a1d82ac7f24a574f3aeb0862597 | [
"Apache-2.0"
] | 2 | 2019-10-03T03:59:09.000Z | 2021-08-18T06:42:29.000Z | """
Script to upload secrets to AWS SSM Parameter Store and tag them appropriately
This script will read your secret value from the clipboard automagically
"""
from colorama import init
init(autoreset=True)
| 37.42623 | 148 | 0.711783 | """
Script to upload secrets to AWS SSM Parameter Store and tag them appropriately
This script will read your secret value from the clipboard automagically
"""
import click
import pyperclip
from colorama import init, Fore
from upside.enforcer.upload.util import upload_secret, secret_key_pattern
from upside.enforcer.u... | 0 | 1,549 | 0 | 0 | 0 | 273 | 0 | 93 | 158 |
911709d23de64acbbfed72df8335d466bd36fc69 | 247 | py | Python | core/urls.py | basiljose1/mediahost | 0d555e5be6cef61213a6004d826310468c04ff93 | [
"MIT"
] | null | null | null | core/urls.py | basiljose1/mediahost | 0d555e5be6cef61213a6004d826310468c04ff93 | [
"MIT"
] | null | null | null | core/urls.py | basiljose1/mediahost | 0d555e5be6cef61213a6004d826310468c04ff93 | [
"MIT"
] | null | null | null | from django.conf.urls import url
from core.views import MediaUploadView, MediaHierarchyView
urlpatterns = [
url(r'^$', MediaUploadView.as_view(), name='media_upload'),
url(r'^files/$', MediaHierarchyView.as_view(), name='media_view'),
]
| 27.444444 | 70 | 0.728745 | from django.conf.urls import url
from core.views import MediaUploadView, MediaHierarchyView
urlpatterns = [
url(r'^$', MediaUploadView.as_view(), name='media_upload'),
url(r'^files/$', MediaHierarchyView.as_view(), name='media_view'),
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6ec03e0c938bf21ed096ee97510e7d4e7852636c | 7,166 | py | Python | app/generator/computer_text_generator.py | sesmond/data_generator | d8c5cc4a7c2e031319794e12a6b8c14e55d6eb3b | [
"Apache-2.0"
] | null | null | null | app/generator/computer_text_generator.py | sesmond/data_generator | d8c5cc4a7c2e031319794e12a6b8c14e55d6eb3b | [
"Apache-2.0"
] | null | null | null | app/generator/computer_text_generator.py | sesmond/data_generator | d8c5cc4a7c2e031319794e12a6b8c14e55d6eb3b | [
"Apache-2.0"
] | null | null | null | import random
#
def random_rotate(img):
''' ______________
| / /|
| / / |
|/________/__|
points4
'''
w, h = img.size
center = (w // 2, h // 2)
degree = random.uniform(-30, 30) # 0-8
print(":%f" % degree)
return img.rotate(degree, ... | 36.191919 | 104 | 0.532933 | import random
from app.generator.utils import *
from PIL import Image, ImageColor, ImageFont, ImageDraw, ImageFilter
from app.utils import image_utils
# 旋转函数
def random_rotate(img):
''' ______________
| / /|
| / / |
|/________/__|
旋转可能有两种情况,一种是矩形,一种是平行四边形,
但是... | 1,419 | 5,411 | 0 | 15 | 0 | 625 | 0 | 71 | 214 |
ce5b204deeda0c9be84aca0447468d1d3eedd66d | 479 | py | Python | practice2.py | kristenpicard/python-practice | 71e6b7e0af68b1eba5f57ad8c836fe250ab7d6db | [
"MIT"
] | null | null | null | practice2.py | kristenpicard/python-practice | 71e6b7e0af68b1eba5f57ad8c836fe250ab7d6db | [
"MIT"
] | null | null | null | practice2.py | kristenpicard/python-practice | 71e6b7e0af68b1eba5f57ad8c836fe250ab7d6db | [
"MIT"
] | null | null | null |
myList = randomListGenerator()
output = min(myList)
print(myList)
print(output) | 17.107143 | 39 | 0.561587 | import random
def randomListGenerator():
i = 0
myList = []
while(i<10):
myList.append(random.random())
i = i + 1
return myList
def min(aList):
i = 0
while(i < len(aList)):
if i == 0:
smallestNumber = aList[i]
elif aList[i] < smallestNumber:
... | 0 | 0 | 0 | 0 | 0 | 336 | 0 | -8 | 69 |
6085f2aeb3473593ea687bb0f1d9623ae7ceaa10 | 16,666 | py | Python | src/util/util.py | aryanmikaeili/multimodal_pnerf | 541a90cf9b1744838710b8fd2c64c3b452ade190 | [
"BSD-2-Clause"
] | null | null | null | src/util/util.py | aryanmikaeili/multimodal_pnerf | 541a90cf9b1744838710b8fd2c64c3b452ade190 | [
"BSD-2-Clause"
] | null | null | null | src/util/util.py | aryanmikaeili/multimodal_pnerf | 541a90cf9b1744838710b8fd2c64c3b452ade190 | [
"BSD-2-Clause"
] | null | null | null | import cv2
import numpy as np
import torch
from torch import nn
import torch.nn.functional as F
import functools
import math
import warnings
def image_float_to_uint8(img):
"""
Convert a float image (0.0-1.0) to uint8 (0-255)
"""
vmin = np.min(img)
vmax = np.max(img)
if vmax - vmin < 1e-10:
... | 29.654804 | 100 | 0.579443 | import cv2
import numpy as np
import torch
from torchvision import transforms
from torch import nn
from torch.nn import init
import torch.nn.functional as F
import functools
import math
import warnings
def image_float_to_uint8(img):
"""
Convert a float image (0.0-1.0) to uint8 (0-255)
"""
vmin = np.mi... | 0 | 0 | 0 | 0 | 0 | 3,177 | 0 | 17 | 251 |
c3537770fc1182de97f58331261340c09a15e03a | 7,755 | py | Python | tests/test_tools/test_characteristics.py | drjod/tespy | b90508178ff3527665781b99d20d3dddd8cb23a2 | [
"MIT"
] | null | null | null | tests/test_tools/test_characteristics.py | drjod/tespy | b90508178ff3527665781b99d20d3dddd8cb23a2 | [
"MIT"
] | null | null | null | tests/test_tools/test_characteristics.py | drjod/tespy | b90508178ff3527665781b99d20d3dddd8cb23a2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8
"""Module for testing reading charactersitic lines.
This file is part of project TESPy (github.com/oemof/tespy). It's copyrighted
by the contributors recorded in the version control history of the file,
available from its original location
tests/test_tools/test_characteristics.py
SPDX-License-Ide... | 34.932432 | 77 | 0.617021 | # -*- coding: utf-8
"""Module for testing reading charactersitic lines.
This file is part of project TESPy (github.com/oemof/tespy). It's copyrighted
by the contributors recorded in the version control history of the file,
available from its original location
tests/test_tools/test_characteristics.py
SPDX-License-Ide... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
902c0667e39e5f98d0b122d4073acaeb231e4555 | 3,129 | py | Python | src/mqtt.py | hansehe/RabbitMqWithMqtt | d2b8ce5765f5cff39d661f123c90909535d9ecc9 | [
"MIT"
] | null | null | null | src/mqtt.py | hansehe/RabbitMqWithMqtt | d2b8ce5765f5cff39d661f123c90909535d9ecc9 | [
"MIT"
] | null | null | null | src/mqtt.py | hansehe/RabbitMqWithMqtt | d2b8ce5765f5cff39d661f123c90909535d9ecc9 | [
"MIT"
] | null | null | null | import paho.mqtt.client as mqtt
import json
from typing import List
# pip install paho-mqtt
TOPIC = 'myTopic'
QOS = 2 # 0, 1 or 2
# read about qos here: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels/
# and here: https://www.rabbitmq.com/mqtt.html#features
# The callback for when t... | 33.287234 | 105 | 0.707894 | import paho.mqtt.client as mqtt
import uuid
import ssl
import json
from typing import Dict, List
# pip install paho-mqtt
TOPIC = 'myTopic'
QOS = 2 # 0, 1 or 2
# read about qos here: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels/
# and here: https://www.rabbitmq.com/mqtt.html#featur... | 0 | 0 | 0 | 0 | 0 | 1,544 | 0 | -15 | 134 |
71b7c0ffd3ad2617a6966ac091ae6ef782d80cf9 | 1,078 | py | Python | viz/ATMPlotGrayScaleImages.py | automatic-dot-ai/automatic | 39e00547850be2b7697b9331e0239bdbf2903d7e | [
"MIT"
] | null | null | null | viz/ATMPlotGrayScaleImages.py | automatic-dot-ai/automatic | 39e00547850be2b7697b9331e0239bdbf2903d7e | [
"MIT"
] | null | null | null | viz/ATMPlotGrayScaleImages.py | automatic-dot-ai/automatic | 39e00547850be2b7697b9331e0239bdbf2903d7e | [
"MIT"
] | null | null | null | #
# @component {
# "kind" : "viz",
# "language" : "py",
# "description" : "Plots grayscale images",
# "permissions": "public",
# "properties": [
# { "name": "Number to plot" , "field": "count", "kind": "integer", "min": 1, "max": 1000, "required": true, "default": 9 },
# { "name": "Number of columns" , "fiel... | 32.666667 | 128 | 0.595547 | #
# @component {
# "kind" : "viz",
# "language" : "py",
# "description" : "Plots grayscale images",
# "permissions": "public",
# "properties": [
# { "name": "Number to plot" , "field": "count", "kind": "integer", "min": 1, "max": 1000, "required": true, "default": 9 },
# { "name": "Number of columns" , "fiel... | 0 | 0 | 0 | 0 | 0 | 315 | 0 | 10 | 48 |
4879cc9162ef03bbd774bf8db35f5e66555a6230 | 396 | py | Python | app/migrations/0003_alter_news_amount_of_votes.py | kbakhchedzhy/news-api-board | 49cd9e1c34eb7c92e5362a10ead58dd05325e65e | [
"MIT"
] | null | null | null | app/migrations/0003_alter_news_amount_of_votes.py | kbakhchedzhy/news-api-board | 49cd9e1c34eb7c92e5362a10ead58dd05325e65e | [
"MIT"
] | null | null | null | app/migrations/0003_alter_news_amount_of_votes.py | kbakhchedzhy/news-api-board | 49cd9e1c34eb7c92e5362a10ead58dd05325e65e | [
"MIT"
] | null | null | null | # Generated by Django 3.2.4 on 2021-06-13 02:53
| 20.842105 | 51 | 0.608586 | # Generated by Django 3.2.4 on 2021-06-13 02:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("app", "0002_alter_news_amount_of_votes"),
]
operations = [
migrations.AlterField(
model_name="news",
name="amount_of... | 0 | 0 | 0 | 282 | 0 | 0 | 0 | 19 | 46 |
418e7e51cb9ca1b1fde06f9ece3624d5c734b594 | 577 | py | Python | functions/shared/users.py | cppseminar/APC | 2e861c8e260984c9e27c1ffd0156517dc77281a2 | [
"MIT"
] | 4 | 2020-09-17T20:03:42.000Z | 2022-01-28T14:33:39.000Z | functions/shared/users.py | cppseminar/APC | 2e861c8e260984c9e27c1ffd0156517dc77281a2 | [
"MIT"
] | 6 | 2020-08-07T20:56:49.000Z | 2022-03-23T12:32:54.000Z | functions/shared/users.py | cppseminar/APC | 2e861c8e260984c9e27c1ffd0156517dc77281a2 | [
"MIT"
] | 1 | 2021-12-11T22:12:07.000Z | 2021-12-11T22:12:07.000Z | """User support functions and definitions."""
from . import mongo
def get_user(email: str):
"""Return user instance from db. If ne create new one."""
return mongo.MongoUsers.get_user(email)
| 22.192308 | 64 | 0.668977 | """User support functions and definitions."""
import dataclasses
import typing
from . import mongo, core
@dataclasses.dataclass
class User(core.ModelBase):
"""Representation of authenticated user."""
email: str
is_admin: bool = False
roles: typing.List = dataclasses.field(default_factory=list)
d... | 0 | 312 | 0 | 0 | 0 | 0 | 0 | -5 | 67 |
8a62e3f380afd90c33c99ce9cf968571e7c87701 | 129,343 | py | Python | tensorflow/python/framework/ops_test.py | abhaikollara/tensorflow | 4f96df3659696990cb34d0ad07dc67843c4225a9 | [
"Apache-2.0"
] | 26 | 2019-11-10T15:33:34.000Z | 2022-03-24T19:56:57.000Z | tensorflow/python/framework/ops_test.py | abhaikollara/tensorflow | 4f96df3659696990cb34d0ad07dc67843c4225a9 | [
"Apache-2.0"
] | 6 | 2022-01-15T07:17:47.000Z | 2022-02-14T15:28:22.000Z | tensorflow/python/framework/ops_test.py | abhaikollara/tensorflow | 4f96df3659696990cb34d0ad07dc67843c4225a9 | [
"Apache-2.0"
] | 6 | 2020-03-29T11:10:53.000Z | 2021-06-14T05:39:14.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.621582 | 106 | 0.656 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 0 | 44,070 | 0 | 80,402 | 0 | 131 | 0 | 954 | 2,108 |
caf0722eca8f9f2034688029b073fa5cee9c2743 | 4,019 | py | Python | tasks_user/install_snakemake.py | dahak-metagenomics/dahak-yeti | 292b777220a1227715107f1659492a4622814f6e | [
"BSD-3-Clause"
] | null | null | null | tasks_user/install_snakemake.py | dahak-metagenomics/dahak-yeti | 292b777220a1227715107f1659492a4622814f6e | [
"BSD-3-Clause"
] | 8 | 2018-03-04T06:29:59.000Z | 2018-10-24T22:03:33.000Z | tasks_user/install_snakemake.py | dahak-metagenomics/dahak-yeti | 292b777220a1227715107f1659492a4622814f6e | [
"BSD-3-Clause"
] | 1 | 2018-10-25T05:05:54.000Z | 2018-10-25T05:05:54.000Z | #!/usr/bin/env python3
"""
Install Snakemake
This script runs the necessary commands to install Snakemake.
"""
if __name__=="__main__":
install_snakemake_the_slightly_easier_way()
| 28.707143 | 91 | 0.520527 | #!/usr/bin/env python3
import os, sys
import getpass
import tempfile
import subprocess
"""
Install Snakemake
This script runs the necessary commands to install Snakemake.
"""
def install_snakemake_the_slightly_easier_way():
user = getpass.getuser()
if(user=="root"):
raise Exception("You are root - y... | 0 | 0 | 0 | 0 | 0 | 3,701 | 0 | -24 | 134 |
ab414b1993806142139e46dba1360844bacca6cf | 1,007 | py | Python | examples/mark_packets.py | qacafe/cdrouter.py | 34a1b031b0325ec5ed363bf3097f242c8535c824 | [
"MIT"
] | 4 | 2017-10-27T00:29:30.000Z | 2020-05-18T07:39:18.000Z | examples/mark_packets.py | qacafe/cdrouter.py | 34a1b031b0325ec5ed363bf3097f242c8535c824 | [
"MIT"
] | 7 | 2017-07-28T19:29:25.000Z | 2020-09-02T14:44:35.000Z | examples/mark_packets.py | qacafe/cdrouter.py | 34a1b031b0325ec5ed363bf3097f242c8535c824 | [
"MIT"
] | 5 | 2017-07-28T19:15:12.000Z | 2020-08-26T20:09:09.000Z | #!/usr/bin/env python
import sys
from cdrouter import CDRouter
from cdrouter.highlights import Highlight
if len(sys.argv) < 3:
print('usage: <base_url> <token>')
sys.exit(1)
base = sys.argv[1]
token = sys.argv[2]
c = CDRouter(base, token=token)
for r in c.results.iter_list(sort=['-id']):
for tr in c.t... | 23.418605 | 104 | 0.551142 | #!/usr/bin/env python
import sys
from cdrouter import CDRouter
from cdrouter.highlights import Highlight
if len(sys.argv) < 3:
print('usage: <base_url> <token>')
sys.exit(1)
base = sys.argv[1]
token = sys.argv[2]
c = CDRouter(base, token=token)
for r in c.results.iter_list(sort=['-id']):
for tr in c.t... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fe54a0a788dfe55c30e6a72fa9dd91f363728e57 | 665 | py | Python | NAPALM/ex3_napalm.py | ramyacr97/RamyaPython | 27ae8c88ec1459372d422fa5f97baa415898f875 | [
"Apache-2.0"
] | null | null | null | NAPALM/ex3_napalm.py | ramyacr97/RamyaPython | 27ae8c88ec1459372d422fa5f97baa415898f875 | [
"Apache-2.0"
] | 4 | 2021-03-31T19:20:41.000Z | 2021-12-13T20:25:28.000Z | NAPALM/ex3_napalm.py | ramyacr97/RamyaPython | 27ae8c88ec1459372d422fa5f97baa415898f875 | [
"Apache-2.0"
] | null | null | null | from my_devices import device_list
from my_functions import napalm_connect
if __name__ == "__main__":
connection = []
for device in device_list:
conn = napalm_connect(device)
connection.append(conn)
for conn in connection:
print(conn)
conn.load_merge_candidate(filename="{}... | 28.913043 | 81 | 0.646617 | from my_devices import device_list
from my_functions import napalm_connect
if __name__ == "__main__":
connection = []
for device in device_list:
conn = napalm_connect(device)
connection.append(conn)
for conn in connection:
print(conn)
conn.load_merge_candidate(filename="{}... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
aafa88253d572b031467af9894786e806f635f94 | 6,755 | py | Python | py/15/main.py | felixb/advent-of-code-2018 | 11da1c3e397497f8f51e09bdd1d9701a57a3eb27 | [
"MIT"
] | null | null | null | py/15/main.py | felixb/advent-of-code-2018 | 11da1c3e397497f8f51e09bdd1d9701a57a3eb27 | [
"MIT"
] | null | null | null | py/15/main.py | felixb/advent-of-code-2018 | 11da1c3e397497f8f51e09bdd1d9701a57a3eb27 | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
import sys
DIRECTIONS = [(0, -1), (-1, 0), (1, 0), (0, 1)]
if __name__ == '__main__':
if len(sys.argv) != 2:
sys.exit('Usage: %s (1|2)' % sys.argv[0])
if sys.argv[1] == '1':
print(run_1(sys.stdin.read()))
elif sys.argv[1] == '2':
print(run_2(sys... | 28.382353 | 117 | 0.499186 | #! /usr/bin/env python3
import sys
DIRECTIONS = [(0, -1), (-1, 0), (1, 0), (0, 1)]
class Pathfinder:
def __init__(self, field, units, start, targets):
self.__field_width = len(field[0])
self.__field_height = len(field)
self.__field = [row[:] for row in field]
self.__start = start
... | 0 | 0 | 0 | 3,775 | 0 | 2,305 | 0 | 0 | 276 |
7ccf7741d648a050e116ff991475fe996094ddb5 | 632 | py | Python | catalyst/dl/callbacks/__init__.py | denyhoof/catalyst | a340450076f7846007bc5695e5163e15b7ad9575 | [
"Apache-2.0"
] | 2 | 2021-02-22T12:15:41.000Z | 2021-05-02T15:22:24.000Z | catalyst/dl/callbacks/__init__.py | denyhoof/catalyst | a340450076f7846007bc5695e5163e15b7ad9575 | [
"Apache-2.0"
] | null | null | null | catalyst/dl/callbacks/__init__.py | denyhoof/catalyst | a340450076f7846007bc5695e5163e15b7ad9575 | [
"Apache-2.0"
] | null | null | null | # flake8: noqa
| 24.307692 | 57 | 0.787975 | # flake8: noqa
from catalyst.core.callback import *
from catalyst.core.callbacks import *
from .confusion_matrix import ConfusionMatrixCallback
from .inference import InferCallback
from .meter import MeterMetricsCallback
from .metrics import (
AccuracyCallback,
AUCCallback,
ClasswiseIouCallback,
Class... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 402 | 215 |
33bd7e2a0702de8db29e7f0d088cd352f7a2225a | 404 | py | Python | perf_test_2.py | foamliu/Upside-Down | b7d529617ea97c86a6dcc6c27c514ebd40e91182 | [
"MIT"
] | null | null | null | perf_test_2.py | foamliu/Upside-Down | b7d529617ea97c86a6dcc6c27c514ebd40e91182 | [
"MIT"
] | null | null | null | perf_test_2.py | foamliu/Upside-Down | b7d529617ea97c86a6dcc6c27c514ebd40e91182 | [
"MIT"
] | 1 | 2020-12-01T05:46:59.000Z | 2020-12-01T05:46:59.000Z | import time
import cv2
import numpy as np
from tqdm import tqdm
data = np.load('pts.npz')
src_pts = data['src_pts']
dst_pts = data['dst_pts']
num_tests = 100000
start = time.time()
for _ in tqdm(range(num_tests)):
H, mask = cv2.findHomography(src_pts, dst_pts, cv2.RANSAC, 5.0)
elapsed_time = time.time() - star... | 21.263158 | 81 | 0.717822 | import time
import cv2
import numpy as np
from tqdm import tqdm
data = np.load('pts.npz')
src_pts = data['src_pts']
dst_pts = data['dst_pts']
num_tests = 100000
start = time.time()
for _ in tqdm(range(num_tests)):
H, mask = cv2.findHomography(src_pts, dst_pts, cv2.RANSAC, 5.0)
elapsed_time = time.time() - star... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ce2270eb267fd8b10526c05ded6ecb5e6cd30078 | 3,752 | py | Python | nonebug/mixin/call_api/__init__.py | nonebot/nonebug | 40fcd4f3eff8f4b2118e95938fabc3d77ff6819c | [
"MIT"
] | 9 | 2021-10-09T05:19:13.000Z | 2022-03-18T15:18:00.000Z | nonebug/mixin/call_api/__init__.py | AkiraXie/nonebug | 5556f94f3e85a26602fc015013e9fbdda07f8c71 | [
"MIT"
] | 2 | 2021-11-23T06:29:20.000Z | 2022-03-18T15:51:51.000Z | nonebug/mixin/call_api/__init__.py | AkiraXie/nonebug | 5556f94f3e85a26602fc015013e9fbdda07f8c71 | [
"MIT"
] | 1 | 2022-02-19T08:57:50.000Z | 2022-02-19T08:57:50.000Z | from typing import TYPE_CHECKING
if TYPE_CHECKING:
| 34.422018 | 102 | 0.609542 | from queue import Queue
from typing import TYPE_CHECKING, Any, Dict, Type, Union, Optional
import pytest
from nonebug.base import BaseApp, Context
from .model import Api, Send, Model
from .fake import make_fake_bot, make_fake_adapter
if TYPE_CHECKING:
from nonebot.adapters import Bot, Event, Adapter, Message, M... | 0 | 0 | 0 | 3,370 | 0 | 0 | 0 | 143 | 185 |