hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | 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 125 | 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 125 | 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.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1820e413024564a4aab74a55fd9bc9b780e0d8f1 | 3,035 | py | Python | src/others/JVMDescriptorToJSON.py | RRua/AnaDroid | 7417b117a50149a6f210cd334de71b814db8d6c7 | [
"MIT"
] | 7 | 2019-01-17T18:37:59.000Z | 2020-11-16T13:42:29.000Z | src/others/JVMDescriptorToJSON.py | RRua/AnaDroid | 7417b117a50149a6f210cd334de71b814db8d6c7 | [
"MIT"
] | null | null | null | src/others/JVMDescriptorToJSON.py | RRua/AnaDroid | 7417b117a50149a6f210cd334de71b814db8d6c7 | [
"MIT"
] | null | null | null |
import re,sys, json
knownRetTypes = {
"V" : "Void" ,
"Z" : "boolean",
"B" : "byte",
"S" : "short",
"C" : "char",
"I" : "int",
"J" : "long",
"F" :"float",
"D" : "double"
}
if __name__== "__main__":
if len(sys.argv) > 1:
print("parsing descriptors of file " + sys.argv[1] )
parseDescriptorsFile(sy... | 24.674797 | 107 | 0.611203 |
import re,sys, json
knownRetTypes = {
"V" : "Void" ,
"Z" : "boolean",
"B" : "byte",
"S" : "short",
"C" : "char",
"I" : "int",
"J" : "long",
"F" :"float",
"D" : "double"
}
def inferType(st):
if(len(st)>0):
if "[" in st:
#array . ex: I[]
return "[" + inferType(st[1:]) + "]"
if len(st) >1:
retur... | 2,495 | 0 | 161 |
b9747b0736b980260aab984b289f61d68e837926 | 3,878 | py | Python | tests/render2/test_logging.py | ace-ecosystem/ACE | d17b5ef4bccf923ec6be5115fabe40f0627dab2d | [
"Apache-2.0"
] | 24 | 2019-09-21T21:09:45.000Z | 2022-03-15T19:48:13.000Z | tests/render2/test_logging.py | ace-ecosystem/ACE | d17b5ef4bccf923ec6be5115fabe40f0627dab2d | [
"Apache-2.0"
] | 54 | 2019-09-16T20:06:30.000Z | 2021-08-18T22:22:08.000Z | tests/render2/test_logging.py | ace-ecosystem/ACE | d17b5ef4bccf923ec6be5115fabe40f0627dab2d | [
"Apache-2.0"
] | 9 | 2019-09-08T13:35:55.000Z | 2021-01-03T15:23:37.000Z | import pytest
from render2.src.shared.shared_logging import get_logger, truncate, prep_for_logging, TRUNCATE_TEXT, TRUNCATE_LENGTH
LONG_STRING = "zxcvbnmasdfghjklqwertyuiop1234567890zxcvbnmasdfghjklqwertyu" \
"iop1234567890zxcvbnmasdzxcvkjapeorijfaldkcfjadfjapsoeifjadf"
TRUNCATED_STRING = f"{LONG_STRING... | 33.145299 | 116 | 0.689273 | import pytest
from render2.src.shared.shared_logging import get_logger, truncate, prep_for_logging, TRUNCATE_TEXT, TRUNCATE_LENGTH
LONG_STRING = "zxcvbnmasdfghjklqwertyuiop1234567890zxcvbnmasdfghjklqwertyu" \
"iop1234567890zxcvbnmasdzxcvkjapeorijfaldkcfjadfjapsoeifjadf"
TRUNCATED_STRING = f"{LONG_STRING... | 0 | 0 | 0 |
83b6e2c42dd3d476585d45a2415bd9a8cdd1ad0d | 558 | py | Python | src/auditlog/serializers.py | softcodesInt/softcode-admin-api | 697c1c6c3c9a3dc524a3e7c2271071e7c9c1f03f | [
"MIT"
] | null | null | null | src/auditlog/serializers.py | softcodesInt/softcode-admin-api | 697c1c6c3c9a3dc524a3e7c2271071e7c9c1f03f | [
"MIT"
] | null | null | null | src/auditlog/serializers.py | softcodesInt/softcode-admin-api | 697c1c6c3c9a3dc524a3e7c2271071e7c9c1f03f | [
"MIT"
] | null | null | null | from rest_framework import serializers
from .models import StaffLog, CompanyLog
from accounts.serializers import UserSerializer
from company.serializers import CompanySerializer
| 23.25 | 56 | 0.738351 | from rest_framework import serializers
from .models import StaffLog, CompanyLog
from accounts.serializers import UserSerializer
from company.serializers import CompanySerializer
class StaffLogSerializer(serializers.ModelSerializer):
blamer = UserSerializer()
staff = UserSerializer()
class Meta:
... | 0 | 331 | 46 |
1360b1509138f330e4ce58ff72522720d598c5e7 | 546 | py | Python | atmcorr/reflectance/worldview.py | DHI-GRAS/atmcorr | 55e584c7971009065b47ece9d3d215bfe8335d04 | [
"MIT"
] | 5 | 2019-09-03T17:13:57.000Z | 2021-12-01T03:22:11.000Z | atmcorr/reflectance/worldview.py | DHI-GRAS/atmcorr | 55e584c7971009065b47ece9d3d215bfe8335d04 | [
"MIT"
] | 1 | 2021-04-28T08:11:37.000Z | 2021-04-28T09:52:02.000Z | atmcorr/reflectance/worldview.py | DHI-GRAS/atmcorr | 55e584c7971009065b47ece9d3d215bfe8335d04 | [
"MIT"
] | 1 | 2021-03-31T02:13:08.000Z | 2021-03-31T02:13:08.000Z | from dg_calibration import reflectance
def toa_reflectance(radata, mtdFile, band_ids):
"""Estimate toa reflectance from radiometric data
ignoring atmospheric, topographic and BRDF effects
Parameters
----------
radata : ndarray shape (nbands, ny, nx)
radiance data
mtdFile : str
... | 23.73913 | 82 | 0.663004 | from dg_calibration import reflectance
def toa_reflectance(radata, mtdFile, band_ids):
"""Estimate toa reflectance from radiometric data
ignoring atmospheric, topographic and BRDF effects
Parameters
----------
radata : ndarray shape (nbands, ny, nx)
radiance data
mtdFile : str
... | 0 | 0 | 0 |
7f68299122102c1ee4f94f3c756c5f55a44708b9 | 5,897 | py | Python | urbansprawl/population/data_extract.py | Oslandia/urbansprawl | afbc1da6ce640569571d26900a2cc97a063fb0a9 | [
"MIT"
] | 7 | 2019-01-07T14:41:48.000Z | 2020-07-01T06:50:17.000Z | urbansprawl/population/data_extract.py | Oslandia/urbansprawl | afbc1da6ce640569571d26900a2cc97a063fb0a9 | [
"MIT"
] | 6 | 2019-01-08T10:16:36.000Z | 2019-03-01T18:33:14.000Z | urbansprawl/population/data_extract.py | Oslandia/urbansprawl | afbc1da6ce640569571d26900a2cc97a063fb0a9 | [
"MIT"
] | 1 | 2019-01-21T08:51:49.000Z | 2019-01-21T08:51:49.000Z | ###############
# Repository: https://github.com/lgervasoni/urbansprawl
# MIT License
###############
from shapely.geometry import GeometryCollection
import geopandas as gpd
import pandas as pd
import os
import numpy as np
import osmnx as ox
from osmnx import log
from .utils import get_population_extract_filename
D... | 31.875676 | 87 | 0.624216 | ###############
# Repository: https://github.com/lgervasoni/urbansprawl
# MIT License
###############
from shapely.geometry import GeometryCollection
import geopandas as gpd
import pandas as pd
import os
import numpy as np
import osmnx as ox
from osmnx import log
from .utils import get_population_extract_filename
D... | 0 | 0 | 0 |
219f55a5acb6cf2f6e7f670cfe0a6f221de36ff3 | 3,591 | py | Python | lib/datasets/referit.py | BryanPlummer/phrase_detection | febe4d2e02a0467850cdf97fb3d3c3c5592be9a2 | [
"MIT"
] | 7 | 2019-11-15T13:16:55.000Z | 2021-11-10T18:19:58.000Z | lib/datasets/referit.py | BryanPlummer/phrase_detection | febe4d2e02a0467850cdf97fb3d3c3c5592be9a2 | [
"MIT"
] | 1 | 2021-09-07T13:28:49.000Z | 2021-09-07T13:28:49.000Z | lib/datasets/referit.py | BryanPlummer/phrase_detection | febe4d2e02a0467850cdf97fb3d3c3c5592be9a2 | [
"MIT"
] | null | null | null | # --------------------------------------------------------
# Tensorflow Phrase Detection
# Licensed under The MIT License [see LICENSE for details]
# Written by Bryan Plummer based on code from Ross Girshick
# --------------------------------------------------------
from __future__ import absolute_import
from __future_... | 32.645455 | 85 | 0.67335 | # --------------------------------------------------------
# Tensorflow Phrase Detection
# Licensed under The MIT License [see LICENSE for details]
# Written by Bryan Plummer based on code from Ross Girshick
# --------------------------------------------------------
from __future__ import absolute_import
from __future_... | 586 | 2,279 | 23 |
f1bb3279a0638f314a5a5053219e49caf2ab56fb | 1,319 | py | Python | utils/radiate_dataset.py | BerensRWU/Radiate-Complex-YOLO | f9d7ccfe585f4285b6fb195e8211072ef433879b | [
"MIT"
] | null | null | null | utils/radiate_dataset.py | BerensRWU/Radiate-Complex-YOLO | f9d7ccfe585f4285b6fb195e8211072ef433879b | [
"MIT"
] | null | null | null | utils/radiate_dataset.py | BerensRWU/Radiate-Complex-YOLO | f9d7ccfe585f4285b6fb195e8211072ef433879b | [
"MIT"
] | null | null | null | from __future__ import division
import glob, os
import numpy as np
import cv2
import torch.utils.data as torch_data
import yaml
import utils.radiate_utils as radiate_utils
from utils.calibration import Calibration
| 29.977273 | 69 | 0.679303 | from __future__ import division
import glob, os
import numpy as np
import cv2
import torch.utils.data as torch_data
import yaml
import utils.radiate_utils as radiate_utils
from utils.calibration import Calibration
class RadiateDataset(torch_data.Dataset):
def __init__(self, root_dir, split='train'):
self.... | 849 | 20 | 236 |
c44f44e958d4dc3376cab2ae19d9ac874ece080f | 518 | py | Python | examples/full/app/api/pilots/controllers.py | rbw0/flask-journey | 6181f59a7b5eef6a85b86ce6ed7d03c91f6bd285 | [
"MIT"
] | 14 | 2018-03-10T05:55:04.000Z | 2018-06-18T09:14:53.000Z | examples/full/app/api/pilots/controllers.py | rbw/flask-journey | 6181f59a7b5eef6a85b86ce6ed7d03c91f6bd285 | [
"MIT"
] | 6 | 2018-03-11T01:24:08.000Z | 2018-03-12T16:13:44.000Z | examples/full/app/api/pilots/controllers.py | rbw/flask-journey | 6181f59a7b5eef6a85b86ce6ed7d03c91f6bd285 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from flask import Blueprint
from flask_journey import route
from .services import get_pilots, get_pilot
from .schemas import pilot, pilots, query
bp = Blueprint('pilots', __name__)
@route(bp, '/<pilot_id>', methods=['GET'], marshal_with=pilot)
@route(bp, '/', methods=['GET'], _query=quer... | 22.521739 | 83 | 0.720077 | # -*- coding: utf-8 -*-
from flask import Blueprint
from flask_journey import route
from .services import get_pilots, get_pilot
from .schemas import pilot, pilots, query
bp = Blueprint('pilots', __name__)
@route(bp, '/<pilot_id>', methods=['GET'], marshal_with=pilot)
def get_one(pilot_id):
return get_pilot(pi... | 113 | 0 | 44 |
8fccc2b51a05ade08d1e523b5d619126a0c84acf | 220 | py | Python | setup.py | IdanAtias/redis-on-k8s | a20acaf44f37adcd41a1fc5c360fba1bacd2528e | [
"MIT"
] | null | null | null | setup.py | IdanAtias/redis-on-k8s | a20acaf44f37adcd41a1fc5c360fba1bacd2528e | [
"MIT"
] | null | null | null | setup.py | IdanAtias/redis-on-k8s | a20acaf44f37adcd41a1fc5c360fba1bacd2528e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from setuptools import find_packages, setup
setup(
name="redisfe",
version="0.0.1",
packages=find_packages(),
entry_points={"console_scripts": ("redisfe=redisfe.main:main",)},
)
| 20 | 69 | 0.654545 | # -*- coding: utf-8 -*-
from setuptools import find_packages, setup
setup(
name="redisfe",
version="0.0.1",
packages=find_packages(),
entry_points={"console_scripts": ("redisfe=redisfe.main:main",)},
)
| 0 | 0 | 0 |
84d4a220f29f0e0bd994f0f18dd49fb101ca5d4f | 2,752 | py | Python | code/introduction/matplotlib-timeline.py | geo7/scientific-visualization-book | 71f6bac4db7ee2f26e88052fe7faa800303d8b00 | [
"BSD-2-Clause"
] | 2 | 2021-11-17T15:10:09.000Z | 2021-12-24T13:31:10.000Z | code/introduction/matplotlib-timeline.py | WuShichao/scientific-visualization-book | 389766215aa6b234ed1cf560a3768437d41d1d37 | [
"BSD-2-Clause"
] | 1 | 2021-12-12T11:37:48.000Z | 2021-12-12T11:39:00.000Z | code/introduction/matplotlib-timeline.py | WuShichao/scientific-visualization-book | 389766215aa6b234ed1cf560a3768437d41d1d37 | [
"BSD-2-Clause"
] | 2 | 2021-12-30T12:20:07.000Z | 2022-02-24T06:36:41.000Z | # ----------------------------------------------------------------------------
# Title: Scientific Visualisation - Python & Matplotlib
# Author: Nicolas P. Rougier
# License: BSD
# ----------------------------------------------------------------------------
import numpy as np
import matplotlib.pyplot as plt
fig =... | 31.632184 | 86 | 0.560683 | # ----------------------------------------------------------------------------
# Title: Scientific Visualisation - Python & Matplotlib
# Author: Nicolas P. Rougier
# License: BSD
# ----------------------------------------------------------------------------
import numpy as np
import matplotlib.pyplot as plt
def an... | 552 | 0 | 23 |
50bcb74ff72e68b78833e7e63920662728bd17d0 | 4,798 | py | Python | src/_speedup.py | Kefan-pauline/HER-CPRAND | 131a284a486ecc34baa7d1d766836ab7dda12087 | [
"MIT"
] | null | null | null | src/_speedup.py | Kefan-pauline/HER-CPRAND | 131a284a486ecc34baa7d1d766836ab7dda12087 | [
"MIT"
] | null | null | null | src/_speedup.py | Kefan-pauline/HER-CPRAND | 131a284a486ecc34baa7d1d766836ab7dda12087 | [
"MIT"
] | null | null | null | import tensorly as tl
import numpy as np
from src._als import als,nn_als
from src._herals import her_Als,nn_her_Als
from src._cprand import CPRAND, nn_CPRAND
from src._hercprand import her_CPRAND,nn_her_CPRAND
from src._base import init_factors,random_init_fac
import copy
import matplotlib.pyplot as plt
def speedup(li... | 42.460177 | 198 | 0.626928 | import tensorly as tl
import numpy as np
from src._als import als,nn_als
from src._herals import her_Als,nn_her_Als
from src._cprand import CPRAND, nn_CPRAND
from src._hercprand import her_CPRAND,nn_her_CPRAND
from src._base import init_factors,random_init_fac
import copy
import matplotlib.pyplot as plt
def speedup(li... | 0 | 0 | 0 |
07062acf91bc80ff83e15bd2102da27551a695f9 | 586 | py | Python | main.py | pizen/liturgical-today | bb141173bd37c2f2409dc74ce222dc62bfad844f | [
"MIT"
] | null | null | null | main.py | pizen/liturgical-today | bb141173bd37c2f2409dc74ce222dc62bfad844f | [
"MIT"
] | null | null | null | main.py | pizen/liturgical-today | bb141173bd37c2f2409dc74ce222dc62bfad844f | [
"MIT"
] | null | null | null | from datetime import date
from flask import abort, Flask, Response
import json
from pyliturgical import calendar
app = Flask(__name__)
@app.route('/reformed/<date_str>')
if __name__ == '__main__':
app.run(host='127.0.0.1', port=8080, debug=True)
| 20.928571 | 52 | 0.667235 | from datetime import date
from flask import abort, Flask, Response
import json
from pyliturgical import calendar
app = Flask(__name__)
@app.route('/reformed/<date_str>')
def reformed(date_str):
try:
d = date.fromisoformat(date_str)
except Exception:
abort(400)
resp = Response(
js... | 309 | 0 | 22 |
46974bc9e27f73be1af4d1ab4cde572896bb9a44 | 9,212 | py | Python | code_captioning/class_ende.py | 201528014227051/ARNet | e7779d6af1a8990712d8e8e4a72e4c1ed138f60e | [
"MIT"
] | 9 | 2018-07-11T11:34:09.000Z | 2021-11-21T15:37:18.000Z | code_captioning/class_ende.py | 201528014227051/ARNet | e7779d6af1a8990712d8e8e4a72e4c1ed138f60e | [
"MIT"
] | null | null | null | code_captioning/class_ende.py | 201528014227051/ARNet | e7779d6af1a8990712d8e8e4a72e4c1ed138f60e | [
"MIT"
] | 2 | 2018-10-19T03:57:51.000Z | 2018-12-01T17:13:36.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import ipdb
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import *
from classLSTMCore import LSTMCore
| 41.309417 | 119 | 0.606057 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import ipdb
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import *
from classLSTMCore import LSTMCore
class EncodeDecode(nn.Module):
... | 8,697 | 9 | 238 |
5d2fae479dc054bce8a8026cf03aca7d52d024b4 | 996 | py | Python | tests/test_graph_io.py | rhysnewell/spacegraphcats | e4d8b29171af0d1c8507066021be3b6a50c7802b | [
"BSD-3-Clause"
] | 96 | 2016-05-13T12:13:07.000Z | 2021-12-17T21:01:17.000Z | tests/test_graph_io.py | rhysnewell/spacegraphcats | e4d8b29171af0d1c8507066021be3b6a50c7802b | [
"BSD-3-Clause"
] | 421 | 2016-05-17T20:47:16.000Z | 2022-03-08T00:35:32.000Z | tests/test_graph_io.py | rhysnewell/spacegraphcats | e4d8b29171af0d1c8507066021be3b6a50c7802b | [
"BSD-3-Clause"
] | 17 | 2016-10-13T17:13:17.000Z | 2021-06-02T18:19:34.000Z | import unittest
from io import StringIO
from spacegraphcats.catlas.graph_io import read_from_gxt, write_to_gxt
from spacegraphcats.catlas.graph import Graph
if __name__ == "__main__":
unittest.main()
| 24.9 | 70 | 0.63755 | import unittest
from io import StringIO
from spacegraphcats.catlas.graph_io import read_from_gxt, write_to_gxt
from spacegraphcats.catlas.graph import Graph
class IOTest(unittest.TestCase):
def test_writing_and_reading(self):
f = StringIO()
graph = Graph(5)
graph.add_arc(1, 0).add_arc(2,... | 701 | 11 | 76 |
e8bd989197609c3dd25e513b44bbf56175e59919 | 16,715 | py | Python | models/bidi_rnn_iou_predictor_model.py | maksay/seq-train | 1af93c6e8e5db93a88c872a66546f6f4bd921551 | [
"MIT"
] | 11 | 2019-07-08T07:40:56.000Z | 2020-10-12T08:27:21.000Z | models/bidi_rnn_iou_predictor_model.py | maksay/seq-train | 1af93c6e8e5db93a88c872a66546f6f4bd921551 | [
"MIT"
] | 1 | 2019-07-09T02:23:08.000Z | 2019-07-09T02:23:08.000Z | models/bidi_rnn_iou_predictor_model.py | maksay/seq-train | 1af93c6e8e5db93a88c872a66546f6f4bd921551 | [
"MIT"
] | 3 | 2019-07-08T08:20:38.000Z | 2021-02-03T15:16:39.000Z | from models.base_model import BaseModel
import tensorflow as tf
import numpy as np
from label_storage import LabelStorage
from tqdm import tqdm
import time
from copy import deepcopy
# Three heads acting on the rnn output of size batchxlengthxoutput_size
# They predict IoU, whether the Gt exists, and the shift to GT b... | 45.544959 | 80 | 0.494167 | from models.base_model import BaseModel
import tensorflow as tf
import numpy as np
from label_storage import LabelStorage
from tqdm import tqdm
import time
from copy import deepcopy
def sequence_embedding(input_seq,
feat_dim,
embedding_size,
rnn_cel... | 16,022 | 21 | 243 |
46e6f5da826b8c139db5aa3d6a375bea6c1783d2 | 701 | py | Python | multauth/api/urls.py | andrenerd/django-multiform-authentication | 4a8b94ebd660cc7afc7dcdedcc12344ef85e6615 | [
"MIT"
] | 7 | 2020-08-28T16:17:02.000Z | 2021-11-11T18:01:20.000Z | multauth/api/urls.py | andrenerd/django-multiform-authentication | 4a8b94ebd660cc7afc7dcdedcc12344ef85e6615 | [
"MIT"
] | null | null | null | multauth/api/urls.py | andrenerd/django-multiform-authentication | 4a8b94ebd660cc7afc7dcdedcc12344ef85e6615 | [
"MIT"
] | 2 | 2021-01-06T04:11:28.000Z | 2021-05-19T14:43:52.000Z | from django.urls import include, path
from .me import views as me_views
from .auth import views as auth_views
from .services import urls as services_urls
app_name = 'multauth'
urlpatterns = [
path('me/', me_views.MeView.as_view(), name='me'),
path('me/password/', me_views.MePasswordView.as_view(), name='me-... | 35.05 | 106 | 0.71612 | from django.urls import include, path
from .me import views as me_views
from .auth import views as auth_views
from .services import urls as services_urls
app_name = 'multauth'
urlpatterns = [
path('me/', me_views.MeView.as_view(), name='me'),
path('me/password/', me_views.MePasswordView.as_view(), name='me-... | 0 | 0 | 0 |
759471eca6eb7bbbb400247ad8d624471bce9b4f | 979 | py | Python | tests/packerlicious/test_post_processor_docker.py | gnewson/packerlicious | 9a5373bc3a63f949e7912dad0214340d5fddbd85 | [
"Apache-2.0"
] | 109 | 2017-07-17T03:32:09.000Z | 2022-02-27T18:24:18.000Z | tests/packerlicious/test_post_processor_docker.py | gnewson/packerlicious | 9a5373bc3a63f949e7912dad0214340d5fddbd85 | [
"Apache-2.0"
] | 175 | 2017-07-16T21:41:40.000Z | 2021-03-19T22:28:19.000Z | tests/packerlicious/test_post_processor_docker.py | gnewson/packerlicious | 9a5373bc3a63f949e7912dad0214340d5fddbd85 | [
"Apache-2.0"
] | 68 | 2017-07-16T20:52:38.000Z | 2022-01-08T18:24:17.000Z | import pytest
import packerlicious.post_processor as post_processor
| 23.309524 | 53 | 0.694586 | import pytest
import packerlicious.post_processor as post_processor
class TestDockerImportPostProcessor(object):
def test_required_fields_missing(self):
b = post_processor.DockerImport()
with pytest.raises(ValueError) as excinfo:
b.to_dict()
assert 'required' in str(excinfo.... | 621 | 85 | 200 |
c52b8d9492fbb8787f001b52ab150ed32d5cac19 | 35 | py | Python | labs/hello_world.py | MHSRoboticsCode/2015 | 410f427439d1641146329bfdd74667054a21a658 | [
"MIT"
] | null | null | null | labs/hello_world.py | MHSRoboticsCode/2015 | 410f427439d1641146329bfdd74667054a21a658 | [
"MIT"
] | null | null | null | labs/hello_world.py | MHSRoboticsCode/2015 | 410f427439d1641146329bfdd74667054a21a658 | [
"MIT"
] | null | null | null | # 2015 lab 1
print('Hello World')
| 8.75 | 20 | 0.657143 | # 2015 lab 1
print('Hello World')
| 0 | 0 | 0 |
5390903a6433e996b8622a4a7cf13953e3adb482 | 1,834 | py | Python | addons/easyship_delivery/models/easyship_service_charge.py | marionumza/vocal_v12 | 480990e919c9410903e06e7813ee92800bd6a569 | [
"Unlicense"
] | null | null | null | addons/easyship_delivery/models/easyship_service_charge.py | marionumza/vocal_v12 | 480990e919c9410903e06e7813ee92800bd6a569 | [
"Unlicense"
] | null | null | null | addons/easyship_delivery/models/easyship_service_charge.py | marionumza/vocal_v12 | 480990e919c9410903e06e7813ee92800bd6a569 | [
"Unlicense"
] | 1 | 2021-05-05T07:59:08.000Z | 2021-05-05T07:59:08.000Z | from odoo import models, fields, api, _
from odoo.exceptions import ValidationError, Warning
| 52.4 | 133 | 0.735005 | from odoo import models, fields, api, _
from odoo.exceptions import ValidationError, Warning
class EasyshipServiceCharge(models.Model):
_name = "es.service.charge"
_description = 'EasyShip Service'
_order = 'total_charge, min_delivery_time, max_delivery_time'
_rec_name = 'courier_name'
@api.depen... | 458 | 1,259 | 23 |
4ba48eedc7d1435806e6452e35a6fdf621660ae9 | 34,930 | py | Python | contents/character/generator/CharacterOccupation.py | jakenjarvis/Lakshmi | de805f7488c1a6b3a4e0d3804be7ecd6c814b446 | [
"Apache-2.0"
] | 1 | 2020-08-24T01:31:20.000Z | 2020-08-24T01:31:20.000Z | contents/character/generator/CharacterOccupation.py | jakenjarvis/Lakshmi | de805f7488c1a6b3a4e0d3804be7ecd6c814b446 | [
"Apache-2.0"
] | null | null | null | contents/character/generator/CharacterOccupation.py | jakenjarvis/Lakshmi | de805f7488c1a6b3a4e0d3804be7ecd6c814b446 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from typing import List, Dict
import math
import random
import aiohttp
import asyncio
import discord
from discord.ext import commands, tasks
from contents.character.Investigator import Investigator
| 50.696662 | 191 | 0.378586 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from typing import List, Dict
import math
import random
import aiohttp
import asyncio
import discord
from discord.ext import commands, tasks
from contents.character.Investigator import Investigator
class CharacterOccupation():
def __init__(self, occupa... | 44,066 | 7 | 226 |
16dedf6977b981f036df8a226d0c212ce61fd47e | 4,570 | py | Python | src/passutil/pu.py | aaronstanek/password-generator | 68f6f2ea1721a2ed52333eff842580db3b0a5307 | [
"MIT"
] | 3 | 2020-08-16T22:55:38.000Z | 2022-01-24T23:31:01.000Z | src/passutil/pu.py | aaronstanek/password-generator | 68f6f2ea1721a2ed52333eff842580db3b0a5307 | [
"MIT"
] | null | null | null | src/passutil/pu.py | aaronstanek/password-generator | 68f6f2ea1721a2ed52333eff842580db3b0a5307 | [
"MIT"
] | null | null | null | # Copyright Aaron Stanek 2021
# See LICENSE for more details
import sys
if sys.version_info[0] != 3 or sys.version_info[1] < 6:
raise Exception("Python Password Utility requires Python 3.6 or later. Compatibility with any major versions after Python 3 is not guaranteed.")
import hashlib
import secrets
... | 40.803571 | 149 | 0.645733 | # Copyright Aaron Stanek 2021
# See LICENSE for more details
import sys
if sys.version_info[0] != 3 or sys.version_info[1] < 6:
raise Exception("Python Password Utility requires Python 3.6 or later. Compatibility with any major versions after Python 3 is not guaranteed.")
import hashlib
import secrets
... | 3,664 | 7 | 129 |
632ddc4d9d2feb4191d7326623588355a5544aa5 | 12,824 | py | Python | dl_multi/archive/tfrecord.py | wbrandenburger/MTPIA | 02c773ce60b7efd5b15f270f047a6da5a8f00b7e | [
"MIT"
] | 1 | 2020-04-14T10:19:37.000Z | 2020-04-14T10:19:37.000Z | dl_multi/archive/tfrecord.py | wbrandenburger/MTPIA | 02c773ce60b7efd5b15f270f047a6da5a8f00b7e | [
"MIT"
] | null | null | null | dl_multi/archive/tfrecord.py | wbrandenburger/MTPIA | 02c773ce60b7efd5b15f270f047a6da5a8f00b7e | [
"MIT"
] | null | null | null | # ===========================================================================
# tfrecords_utils.py-------------------------------------------------------
# ===========================================================================
""" The following functions can be used to convert a value to a type compatible with ... | 42.889632 | 265 | 0.523316 | # ===========================================================================
# tfrecords_utils.py-------------------------------------------------------
# ===========================================================================
""" The following functions can be used to convert a value to a type compatible with ... | 2,016 | 0 | 110 |
fe6bb1216cba74208ecaf186e28830bf6199ceab | 298 | py | Python | TAO/Firewall/EXPLOITS/ELCO/fosho/requests/packages/oreos/core.py | dendisuhubdy/grokmachine | 120a21a25c2730ed356739231ec8b99fc0575c8b | [
"BSD-3-Clause"
] | 46 | 2017-05-15T11:15:08.000Z | 2018-07-02T03:32:52.000Z | TAO/Firewall/EXPLOITS/ELCO/fosho/requests/packages/oreos/core.py | dendisuhubdy/grokmachine | 120a21a25c2730ed356739231ec8b99fc0575c8b | [
"BSD-3-Clause"
] | null | null | null | TAO/Firewall/EXPLOITS/ELCO/fosho/requests/packages/oreos/core.py | dendisuhubdy/grokmachine | 120a21a25c2730ed356739231ec8b99fc0575c8b | [
"BSD-3-Clause"
] | 24 | 2017-05-17T03:26:17.000Z | 2018-07-09T07:00:50.000Z | # -*- coding: utf-8 -*-
"""
oreos.core
~~~~~~~~~~
The creamy white center.
"""
from .monkeys import SimpleCookie
def dict_from_string(s):
''''''
cookies = dict()
c = SimpleCookie()
c.load(s)
for k,v in c.items():
cookies.update({k: v.value})
return cookies | 11.92 | 36 | 0.550336 | # -*- coding: utf-8 -*-
"""
oreos.core
~~~~~~~~~~
The creamy white center.
"""
from .monkeys import SimpleCookie
def dict_from_string(s):
''''''
cookies = dict()
c = SimpleCookie()
c.load(s)
for k,v in c.items():
cookies.update({k: v.value})
return cookies | 0 | 0 | 0 |
73087379e75dba0f7af39e96d3b3fb511649fe52 | 1,189 | py | Python | tests/spec/Spec/get_op_for_request_test.py | terencehonles/bravado-core | 382db874b7b838dcfd169b0ce490d6a447ad6ff2 | [
"BSD-3-Clause"
] | 122 | 2015-04-22T17:31:18.000Z | 2021-11-08T10:29:57.000Z | tests/spec/Spec/get_op_for_request_test.py | terencehonles/bravado-core | 382db874b7b838dcfd169b0ce490d6a447ad6ff2 | [
"BSD-3-Clause"
] | 364 | 2015-04-10T22:19:23.000Z | 2022-02-25T08:55:10.000Z | tests/spec/Spec/get_op_for_request_test.py | terencehonles/bravado-core | 382db874b7b838dcfd169b0ce490d6a447ad6ff2 | [
"BSD-3-Clause"
] | 118 | 2015-04-20T15:11:53.000Z | 2021-12-09T10:03:34.000Z | # -*- coding: utf-8 -*-
from bravado_core.spec import Spec
| 34.970588 | 73 | 0.748528 | # -*- coding: utf-8 -*-
from bravado_core.spec import Spec
def test_found_with_no_basepath(petstore_dict):
del petstore_dict['basePath']
petstore_spec = Spec.from_dict(petstore_dict)
op = petstore_spec.get_op_for_request('GET', '/pet/{petId}')
assert op == petstore_spec.resources['pet'].operations['ge... | 1,010 | 0 | 115 |
c2c13dd46a699d262d613a09feddc7cbd6846840 | 26,334 | py | Python | btk20_src/lib/mkBeamforming.py | musiclvme/distant_speech_recognition | 60f867383488ac45c2fa3a5433736fdf00dd4f1d | [
"MIT"
] | 136 | 2018-12-06T06:35:44.000Z | 2022-03-27T15:07:42.000Z | btk20_src/lib/mkBeamforming.py | musiclvme/distant_speech_recognition | 60f867383488ac45c2fa3a5433736fdf00dd4f1d | [
"MIT"
] | 25 | 2018-12-03T04:33:24.000Z | 2021-07-28T22:01:37.000Z | btk20_src/lib/mkBeamforming.py | musiclvme/distant_speech_recognition | 60f867383488ac45c2fa3a5433736fdf00dd4f1d | [
"MIT"
] | 68 | 2019-01-08T06:33:30.000Z | 2021-11-17T09:33:10.000Z | import sys
import string
import numpy
from numpy import *
import os.path
import pickle
import re
from types import FloatType
import getopt, sys
import copy
import gzip
from btk.common import *
from btk.stream import *
from btk.feature import *
from btk.matrix import *
from btk.utils import *
#from pygsl import *
from... | 39.9 | 156 | 0.57853 | import sys
import string
import numpy
from numpy import *
import os.path
import pickle
import re
from types import FloatType
import getopt, sys
import copy
import gzip
from btk.common import *
from btk.stream import *
from btk.feature import *
from btk.matrix import *
from btk.utils import *
#from pygsl import *
from... | 18,654 | 5,728 | 135 |
729aa5c6d73fb9c3f5750c80708fb9fd5acd69bc | 312 | py | Python | esuits/answer_history/forms.py | junkhp/esuits_junki | 88293381d80184130adf5f6f96c47b9c79c294f2 | [
"MIT"
] | 2 | 2021-01-24T14:27:36.000Z | 2021-01-24T16:15:43.000Z | esuits/answer_history/forms.py | junkhp/esuits_junki | 88293381d80184130adf5f6f96c47b9c79c294f2 | [
"MIT"
] | 9 | 2021-02-01T03:20:59.000Z | 2021-03-06T08:15:04.000Z | esuits/answer_history/forms.py | junkhp/esuiets_junki | 88293381d80184130adf5f6f96c47b9c79c294f2 | [
"MIT"
] | 1 | 2021-02-07T03:41:01.000Z | 2021-02-07T03:41:01.000Z | # -*- coding: utf-8 -*-
from django import forms
| 22.285714 | 46 | 0.564103 | # -*- coding: utf-8 -*-
from django import forms
class AnswerHistoryCheckForm(forms.Form):
select = forms.ChoiceField(
required=True,
disabled=False,
widget=forms.RadioSelect(attrs={
'id': 'hisradio',
'class': 'ans-history-radio-input'
})
)
| 0 | 239 | 23 |
804b636892a7fa4562d5a1284dc781a81b3adfd3 | 1,433 | py | Python | splitter_bulk.py | rainyleaf/Lexical-Diversity | 8b01e9ab2661e0485e9079a7927f31701065c001 | [
"MIT"
] | null | null | null | splitter_bulk.py | rainyleaf/Lexical-Diversity | 8b01e9ab2661e0485e9079a7927f31701065c001 | [
"MIT"
] | null | null | null | splitter_bulk.py | rainyleaf/Lexical-Diversity | 8b01e9ab2661e0485e9079a7927f31701065c001 | [
"MIT"
] | null | null | null | import os
target_names = ['-to-process.txt.subbed', '_to_process.txt.subbed', '_to-process.txt.subbed', '-to_process.txt.subbed', '-tp.txt.subbed', '_tp.txt.subbed']
target = "-Processing"
for dirname, dirs, files in os.walk('.'):
if target in dirname and 'tagged' not in dirname:
for filename in f... | 49.413793 | 158 | 0.545708 | import os
target_names = ['-to-process.txt.subbed', '_to_process.txt.subbed', '_to-process.txt.subbed', '-to_process.txt.subbed', '-tp.txt.subbed', '_tp.txt.subbed']
target = "-Processing"
for dirname, dirs, files in os.walk('.'):
if target in dirname and 'tagged' not in dirname:
for filename in f... | 0 | 0 | 0 |
ade430af24e23c85d8a37decc033be928a493686 | 4,600 | py | Python | src/xinput.py | ypar/treqtl | 7c8ab7310edd83bc7f7950b45d4338341da07ce2 | [
"MIT"
] | null | null | null | src/xinput.py | ypar/treqtl | 7c8ab7310edd83bc7f7950b45d4338341da07ce2 | [
"MIT"
] | null | null | null | src/xinput.py | ypar/treqtl | 7c8ab7310edd83bc7f7950b45d4338341da07ce2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
###
# YoSon
# @treqtl/xinput.py
# produce xtreqtl input files by matching rs numbers from trait and iv summary statistics
###
import pandas as pd
import numpy as np
import os, sys
from sys import argv
from os import walk
from treqtl_input import read_dir
if __name__ == '__main__':
# i... | 50 | 356 | 0.619565 | #!/usr/bin/env python3
###
# YoSon
# @treqtl/xinput.py
# produce xtreqtl input files by matching rs numbers from trait and iv summary statistics
###
import pandas as pd
import numpy as np
import os, sys
from sys import argv
from os import walk
from treqtl_input import read_dir
def xinput(ewkdir, efile, gwkdir):
... | 4,116 | 0 | 23 |
26538207d5f5a691a112b07bba26c641ec81cf61 | 265 | py | Python | aioli_openapi/__init__.py | jimorie/aioli-openapi | 5a5ea6471d332adc8361ad39af7421e4686811fd | [
"MIT"
] | null | null | null | aioli_openapi/__init__.py | jimorie/aioli-openapi | 5a5ea6471d332adc8361ad39af7421e4686811fd | [
"MIT"
] | null | null | null | aioli_openapi/__init__.py | jimorie/aioli-openapi | 5a5ea6471d332adc8361ad39af7421e4686811fd | [
"MIT"
] | null | null | null | from aioli import Package
from .controller import HttpController
from .service import OpenApiService
from .config import ConfigSchema
export = Package(
controllers=[HttpController],
services=[OpenApiService],
config=ConfigSchema,
auto_meta=True
)
| 20.384615 | 38 | 0.777358 | from aioli import Package
from .controller import HttpController
from .service import OpenApiService
from .config import ConfigSchema
export = Package(
controllers=[HttpController],
services=[OpenApiService],
config=ConfigSchema,
auto_meta=True
)
| 0 | 0 | 0 |
e4919b9cf916abaae343f9577cf24c5bd7884722 | 4,629 | py | Python | nlptasks/task_classification_cnn_roc_prf.py | allenwind/tf2bert | 9820223559543529d4dcc703e2742ab8fd14d58e | [
"Apache-2.0"
] | 4 | 2021-06-16T02:26:18.000Z | 2021-09-24T11:06:51.000Z | nlptasks/task_classification_cnn_roc_prf.py | allenwind/tf2bert | 9820223559543529d4dcc703e2742ab8fd14d58e | [
"Apache-2.0"
] | null | null | null | nlptasks/task_classification_cnn_roc_prf.py | allenwind/tf2bert | 9820223559543529d4dcc703e2742ab8fd14d58e | [
"Apache-2.0"
] | null | null | null | import matplotlib.pyplot as plt
from sklearn.metrics import roc_auc_score
from sklearn.metrics import roc_curve, auc
import itertools
import numpy as np
import tensorflow as tf
from tensorflow.keras.preprocessing import sequence
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Input
from te... | 27.885542 | 110 | 0.680709 | import matplotlib.pyplot as plt
from sklearn.metrics import roc_auc_score
from sklearn.metrics import roc_curve, auc
import itertools
import numpy as np
import tensorflow as tf
from tensorflow.keras.preprocessing import sequence
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Input
from te... | 0 | 0 | 0 |
5059b12edbc2fec8ad15300670e5c0628bc4149c | 534 | py | Python | botx/clients/types/options.py | ExpressApp/pybotx | 97c8b1ce5d45a05567ed01d545cb43174a2dcbb9 | [
"MIT"
] | 13 | 2021-01-21T12:43:10.000Z | 2022-03-23T11:11:59.000Z | botx/clients/types/options.py | ExpressApp/pybotx | 97c8b1ce5d45a05567ed01d545cb43174a2dcbb9 | [
"MIT"
] | 259 | 2020-02-26T08:51:03.000Z | 2022-03-23T11:08:36.000Z | botx/clients/types/options.py | ExpressApp/pybotx | 97c8b1ce5d45a05567ed01d545cb43174a2dcbb9 | [
"MIT"
] | 5 | 2019-12-02T16:19:22.000Z | 2021-11-22T20:33:34.000Z | """Special options for messages from bot."""
from pydantic import BaseModel
from botx.models.messages.sending.options import NotificationOptions
class ResultOptions(BaseModel):
"""Configuration for command result or notification that is send to BotX API."""
#: send message only when stealth mode is enabled.... | 29.666667 | 84 | 0.754682 | """Special options for messages from bot."""
from pydantic import BaseModel
from botx.models.messages.sending.options import NotificationOptions
class ResultOptions(BaseModel):
"""Configuration for command result or notification that is send to BotX API."""
#: send message only when stealth mode is enabled.... | 0 | 0 | 0 |
48ece775f281cd9e1431d40945120826992d65c2 | 2,877 | py | Python | source/reports/orderReports.py | MatheusDiass/BOBs_Pizzaria_Anchieta | b52188cb6411a07b67a76b0e53f3828f9cf0012d | [
"MIT"
] | 2 | 2020-05-23T21:57:29.000Z | 2020-05-23T22:03:06.000Z | source/reports/orderReports.py | MatheusDiass/BOBs_Pizzaria_Anchieta | b52188cb6411a07b67a76b0e53f3828f9cf0012d | [
"MIT"
] | 1 | 2020-05-31T18:15:47.000Z | 2020-05-31T18:15:47.000Z | source/reports/orderReports.py | MatheusDiass/BOBs_Pizzaria_Anchieta | b52188cb6411a07b67a76b0e53f3828f9cf0012d | [
"MIT"
] | null | null | null | # Import sqlite3 para tratar os erros
import _sqlite3
# Importado para formatar a data
from datetime import date, datetime
# Importa a função de relatório de pedidos
from source.db.tblOrder import selectAllOrderInformation, selectAllOrderBetweenDate
# Exibe todos os pedidos
# Exibe todos os pedidos de acordo com o ... | 36.884615 | 93 | 0.572471 | # Import sqlite3 para tratar os erros
import _sqlite3
# Importado para formatar a data
from datetime import date, datetime
# Importa a função de relatório de pedidos
from source.db.tblOrder import selectAllOrderInformation, selectAllOrderBetweenDate
# Exibe todos os pedidos
def allOrderInformationReports():
try:... | 2,506 | 0 | 44 |
c16d2c47c38fca8e0f6ebf2f386d6e9af8743901 | 596 | py | Python | pa/db/bank.py | sannidhiteredesai/PersonalAccountant | 5609ad979edc690604eee5131c034029e595ccde | [
"MIT"
] | 3 | 2018-08-05T15:29:16.000Z | 2019-05-23T18:09:42.000Z | pa/db/bank.py | sannidhiteredesai/PersonalAccountant | 5609ad979edc690604eee5131c034029e595ccde | [
"MIT"
] | null | null | null | pa/db/bank.py | sannidhiteredesai/PersonalAccountant | 5609ad979edc690604eee5131c034029e595ccde | [
"MIT"
] | null | null | null | from tinydb import Query, where
from pa import get_db
from pa.config import Config
| 29.8 | 67 | 0.629195 | from tinydb import Query, where
from pa import get_db
from pa.config import Config
class BankDB:
def __init__(self, config=Config):
self.db = get_db(config).table('banks')
def add(self, new_bank):
self.db.insert(new_bank)
def get_all_banks(self, for_user):
return self.db.search(Q... | 390 | -8 | 130 |
2c65584e8066d874578c2f9877a23e7292123209 | 1,480 | py | Python | files/029 - distinct powers.py | farukara/Project-Euler-problems | 806fdbd797edd9929728b43cc428a55df50e1c01 | [
"MIT"
] | null | null | null | files/029 - distinct powers.py | farukara/Project-Euler-problems | 806fdbd797edd9929728b43cc428a55df50e1c01 | [
"MIT"
] | null | null | null | files/029 - distinct powers.py | farukara/Project-Euler-problems | 806fdbd797edd9929728b43cc428a55df50e1c01 | [
"MIT"
] | null | null | null | #!python3
# coding: utf-8
# Consider all integer combinations of ab for 2 ≤ a ≤ 5 and 2 ≤ b ≤ 5:
#
# 22=4, 23=8, 24=16, 25=32
# 32=9, 33=27, 34=81, 35=243
# 42=16, 43=64, 44=256, 45=1024
# 52=25, 53=125, 54=625, 55=3125
# If they are then placed in numerical order, with any repeats removed, we get the following sequen... | 24.666667 | 123 | 0.608784 | #!python3
# coding: utf-8
# Consider all integer combinations of ab for 2 ≤ a ≤ 5 and 2 ≤ b ≤ 5:
#
# 22=4, 23=8, 24=16, 25=32
# 32=9, 33=27, 34=81, 35=243
# 42=16, 43=64, 44=256, 45=1024
# 52=25, 53=125, 54=625, 55=3125
# If they are then placed in numerical order, with any repeats removed, we get the following sequen... | 295 | 0 | 46 |
810cfa4617bed038850f4e916bdda3f059ac8f5c | 2,029 | py | Python | lib/dawet.py | riandakarizal/ITeung | 2d3fc7e4974c9a9b67ff61f2a77a528988b55820 | [
"MIT"
] | null | null | null | lib/dawet.py | riandakarizal/ITeung | 2d3fc7e4974c9a9b67ff61f2a77a528988b55820 | [
"MIT"
] | 37 | 2020-03-22T23:21:14.000Z | 2020-09-16T15:07:06.000Z | lib/dawet.py | riandakarizal/ITeung | 2d3fc7e4974c9a9b67ff61f2a77a528988b55820 | [
"MIT"
] | 1 | 2020-09-08T11:31:30.000Z | 2020-09-08T11:31:30.000Z | import gspread
import time
from oauth2client.service_account import ServiceAccountCredentials | 37.574074 | 178 | 0.584524 | import gspread
import time
from oauth2client.service_account import ServiceAccountCredentials
class Dawet(object):
def __init__(self, filename):
self.filename = filename
self.opendb()
def opendb(self):
scope = ['https://spreadsheets.google.com/feeds', 'https://www.googleapis.com/auth/... | 1,752 | -1 | 184 |
d6fffbc360e40f3fa206c22120a91856dbfad8a1 | 167 | py | Python | build.py | findgriffin/quotesforclare | 5433e9b3b3a8b42133069ff91a902ff0d53cf0da | [
"MIT"
] | null | null | null | build.py | findgriffin/quotesforclare | 5433e9b3b3a8b42133069ff91a902ff0d53cf0da | [
"MIT"
] | null | null | null | build.py | findgriffin/quotesforclare | 5433e9b3b3a8b42133069ff91a902ff0d53cf0da | [
"MIT"
] | null | null | null | import markdown
with open("index.md", 'r') as md:
output = markdown.markdown(md.read())
with open("public/index.html", 'w') as out:
out.write(output)
| 23.857143 | 47 | 0.628743 | import markdown
with open("index.md", 'r') as md:
output = markdown.markdown(md.read())
with open("public/index.html", 'w') as out:
out.write(output)
| 0 | 0 | 0 |
b7c908fd071d0ff5c30f1ca4c527eb71f4aa62d3 | 10,342 | py | Python | MCFundamental.py | aaleti/NeighboursSimilarFitness | bf087bfb8e77c79f085388fccf8aa63088f8d610 | [
"Unlicense"
] | null | null | null | MCFundamental.py | aaleti/NeighboursSimilarFitness | bf087bfb8e77c79f085388fccf8aa63088f8d610 | [
"Unlicense"
] | null | null | null | MCFundamental.py | aaleti/NeighboursSimilarFitness | bf087bfb8e77c79f085388fccf8aa63088f8d610 | [
"Unlicense"
] | null | null | null | from numpy.linalg import inv
import numpy as np
import pykov
import matplotlib.pyplot as plt
import matplotlib.cbook as cbook
from itertools import cycle
import matplotlib
from matplotlib.pyplot import *
import brewer2mpl
import seaborn as sns
from scipy.stats import ks_2samp
from scipy.stats import mode
import pandas ... | 47.009091 | 127 | 0.314929 | from numpy.linalg import inv
import numpy as np
import pykov
import matplotlib.pyplot as plt
import matplotlib.cbook as cbook
from itertools import cycle
import matplotlib
from matplotlib.pyplot import *
import brewer2mpl
import seaborn as sns
from scipy.stats import ks_2samp
from scipy.stats import mode
import pandas ... | 0 | 0 | 0 |
ddf6603ab028bfe68570d800eb542a92f989c9b8 | 6,947 | py | Python | goal-depth-detection-host/main.py | jonathandao0/depthai-frc | 9f1b4fc9e049f252e5f8fc53da02b9ed43d80b5a | [
"MIT"
] | 3 | 2021-11-23T17:00:55.000Z | 2022-02-17T20:23:50.000Z | goal-depth-detection-host/main.py | jonathandao0/depthai-frc | 9f1b4fc9e049f252e5f8fc53da02b9ed43d80b5a | [
"MIT"
] | null | null | null | goal-depth-detection-host/main.py | jonathandao0/depthai-frc | 9f1b4fc9e049f252e5f8fc53da02b9ed43d80b5a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
import cv2
import depthai as dai
import socket
from pipelines import goal_edge_depth_detection
import logging
from common import target_finder
from common.mjpeg_stream import MjpegStream
from networktables.util import NetworkTables
from common.utils import FPSHandler
parser = ... | 37.349462 | 137 | 0.57622 | #!/usr/bin/env python3
import argparse
import cv2
import depthai as dai
import socket
from pipelines import goal_edge_depth_detection
import logging
from common import target_finder
from common.mjpeg_stream import MjpegStream
from networktables.util import NetworkTables
from common.utils import FPSHandler
parser = ... | 6,078 | -9 | 208 |
0a7c1e873279235adff584e3ef7cbd71c9b3326c | 2,020 | py | Python | app/repositories/cardRepository.py | faradayyg/card-token-generator | 272907e086b12ebed580fe018dae7152ee94dcf7 | [
"MIT"
] | null | null | null | app/repositories/cardRepository.py | faradayyg/card-token-generator | 272907e086b12ebed580fe018dae7152ee94dcf7 | [
"MIT"
] | null | null | null | app/repositories/cardRepository.py | faradayyg/card-token-generator | 272907e086b12ebed580fe018dae7152ee94dcf7 | [
"MIT"
] | null | null | null | from Crypto.Cipher import AES
import base64, hashlib, json
from app.services import payment
from app.models import Vault
from app.utils import further_processing, standardize_response
| 38.113208 | 92 | 0.64703 | from Crypto.Cipher import AES
import base64, hashlib, json
from app.services import payment
from app.models import Vault
from app.utils import further_processing, standardize_response
class CardRepo:
gateway = 'briantree'
available_gateways = ['stripe', 'briantree']
def __init__(self, gateway = None):
... | 1,636 | 177 | 23 |
9a28ad71df48836ad852013ab4decef7364b3e68 | 2,513 | py | Python | ruspy/test/estimation_tests/test_estimation.py | MaxBlesch/ruspy | 5e7fb9e584c7e0d4935f4669e108bbf4e05209c6 | [
"MIT"
] | 13 | 2019-09-10T12:00:16.000Z | 2022-03-19T13:30:12.000Z | ruspy/test/estimation_tests/test_estimation.py | MaxBlesch/ruspy | 5e7fb9e584c7e0d4935f4669e108bbf4e05209c6 | [
"MIT"
] | 45 | 2019-02-17T19:39:00.000Z | 2021-08-23T17:38:40.000Z | ruspy/test/estimation_tests/test_estimation.py | MaxBlesch/ruspy | 5e7fb9e584c7e0d4935f4669e108bbf4e05209c6 | [
"MIT"
] | 9 | 2019-05-03T03:48:37.000Z | 2022-03-19T13:30:13.000Z | """
This module contains unit tests, for the most important functions of
ruspy.estimation.estimation_cost_parameters. The values to compare the results with
are saved in resources/estimation_test. The setting of the test is documented in the
inputs section in test module.
"""
import numpy as np
import pytest
from numpy... | 31.024691 | 87 | 0.712296 | """
This module contains unit tests, for the most important functions of
ruspy.estimation.estimation_cost_parameters. The values to compare the results with
are saved in resources/estimation_test. The setting of the test is documented in the
inputs section in test module.
"""
import numpy as np
import pytest
from numpy... | 1,548 | 0 | 159 |
eb4c17d2f6bc5d50a6467e03c3892b0132914fb1 | 6,123 | py | Python | exercises/adaboost_scenario.py | dani3lwinter/IML.HUJI | 46b5e001b92d7bac3b7efa2278d0236b69159895 | [
"MIT"
] | null | null | null | exercises/adaboost_scenario.py | dani3lwinter/IML.HUJI | 46b5e001b92d7bac3b7efa2278d0236b69159895 | [
"MIT"
] | null | null | null | exercises/adaboost_scenario.py | dani3lwinter/IML.HUJI | 46b5e001b92d7bac3b7efa2278d0236b69159895 | [
"MIT"
] | null | null | null | from itertools import product
import numpy as np
from typing import Tuple
from IMLearn.learners.classifiers import DecisionStump
from IMLearn.metalearners import AdaBoost
from utils import *
import plotly.graph_objects as go
from plotly.subplots import make_subplots
pio.renderers.default = "browser"
def generate_da... | 41.09396 | 117 | 0.594317 | from itertools import product
import numpy as np
from typing import Tuple
from IMLearn.learners.classifiers import DecisionStump
from IMLearn.metalearners import AdaBoost
from utils import *
import plotly.graph_objects as go
from plotly.subplots import make_subplots
pio.renderers.default = "browser"
def generate_da... | 3,329 | 0 | 23 |
47a3628be6d06fce60c6aa3b96f418edd831bdb8 | 2,375 | py | Python | test.py | yhZhai/wtalc-pytorch | e8016e7849b026132d16f64852711083d735edf2 | [
"MIT"
] | 1 | 2020-05-11T00:28:47.000Z | 2020-05-11T00:28:47.000Z | test.py | yhZhai/wtalc-pytorch | e8016e7849b026132d16f64852711083d735edf2 | [
"MIT"
] | null | null | null | test.py | yhZhai/wtalc-pytorch | e8016e7849b026132d16f64852711083d735edf2 | [
"MIT"
] | null | null | null | import torch
import torch.nn.functional as F
import torch.optim as optim
from model import Model
from video_dataset import Dataset
from tensorboard_logger import log_value
import utils
import numpy as np
from torch.autograd import Variable
from classificationMAP import getClassificationMAP as cmAP
from detect... | 38.934426 | 116 | 0.664842 | import torch
import torch.nn.functional as F
import torch.optim as optim
from model import Model
from video_dataset import Dataset
from tensorboard_logger import log_value
import utils
import numpy as np
from torch.autograd import Variable
from classificationMAP import getClassificationMAP as cmAP
from detect... | 1,909 | 0 | 25 |
7fe3b91986972c5ce11f9efef5923c262ae5e073 | 38,655 | py | Python | Steel/bolts_IC_gui.py | hotmailbox/Structural-Engineering | f34dcaec728fbb3e3a05c6f29ed5dabc621550cb | [
"BSD-3-Clause"
] | 152 | 2017-08-14T10:06:19.000Z | 2022-03-07T04:48:49.000Z | Steel/bolts_IC_gui.py | hotmailbox/Structural-Engineering | f34dcaec728fbb3e3a05c6f29ed5dabc621550cb | [
"BSD-3-Clause"
] | 15 | 2017-08-13T23:30:18.000Z | 2021-03-25T05:08:49.000Z | Steel/bolts_IC_gui.py | hotmailbox/Structural-Engineering | f34dcaec728fbb3e3a05c6f29ed5dabc621550cb | [
"BSD-3-Clause"
] | 52 | 2017-11-09T09:58:07.000Z | 2022-02-09T16:58:38.000Z | '''
BSD 3-Clause License
Copyright (c) 2019, Donald N. Bockoven III
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
l... | 45.31653 | 464 | 0.543837 | '''
BSD 3-Clause License
Copyright (c) 2019, Donald N. Bockoven III
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
l... | 36,189 | 624 | 57 |
04a9f8fe3911032dc6684bf8e345fde7a20c24c1 | 3,355 | py | Python | python/surf/devices/silabs/_Si5345Lite.py | qarlosalberto/surf | 69df91296d77efc9e812da051841545e320ebf69 | [
"BSD-3-Clause-LBNL"
] | 2 | 2021-05-13T19:56:51.000Z | 2021-05-21T13:33:02.000Z | python/surf/devices/silabs/_Si5345Lite.py | qarlosalberto/surf | 69df91296d77efc9e812da051841545e320ebf69 | [
"BSD-3-Clause-LBNL"
] | null | null | null | python/surf/devices/silabs/_Si5345Lite.py | qarlosalberto/surf | 69df91296d77efc9e812da051841545e320ebf69 | [
"BSD-3-Clause-LBNL"
] | null | null | null | #-----------------------------------------------------------------------------
# This file is part of 'SLAC Firmware Standard Library'.
# It is subject to the license terms in the LICENSE.txt file found in the
# top-level directory of this distribution and at:
# https://confluence.slac.stanford.edu/display/ppareg/LI... | 37.277778 | 96 | 0.491803 | #-----------------------------------------------------------------------------
# This file is part of 'SLAC Firmware Standard Library'.
# It is subject to the license terms in the LICENSE.txt file found in the
# top-level directory of this distribution and at:
# https://confluence.slac.stanford.edu/display/ppareg/LI... | 2,601 | 7 | 49 |
1453a426e851b72a4844eed7230b164334c62ea5 | 620 | py | Python | thinkpython_allen_downey/exercise_6_2.py | alirkaya/programming-textbook-solutions | 7362dce474b8a881d654f95604e09d1d0e76aec2 | [
"MIT"
] | null | null | null | thinkpython_allen_downey/exercise_6_2.py | alirkaya/programming-textbook-solutions | 7362dce474b8a881d654f95604e09d1d0e76aec2 | [
"MIT"
] | null | null | null | thinkpython_allen_downey/exercise_6_2.py | alirkaya/programming-textbook-solutions | 7362dce474b8a881d654f95604e09d1d0e76aec2 | [
"MIT"
] | null | null | null | # def hypotenuse(x, y):
# return 0.0
#
# print(hypotenuse(3, 4))
#
# def hypotenuse(x, y):
# square_x = x**2
# square_y = y**2
# print('square_x is', square_x)
# print('square_y is', square_y)
# return 0.0
#
# print(hypotenuse(3, 4))
#
# def hypotenuse(x, y):
# from math import sqrt
# sq... | 20 | 45 | 0.58871 | # def hypotenuse(x, y):
# return 0.0
#
# print(hypotenuse(3, 4))
#
# def hypotenuse(x, y):
# square_x = x**2
# square_y = y**2
# print('square_x is', square_x)
# print('square_y is', square_y)
# return 0.0
#
# print(hypotenuse(3, 4))
#
# def hypotenuse(x, y):
# from math import sqrt
# sq... | 55 | 0 | 23 |
d7e66a021ecddeb23f0dbeb0f0551cb3b5f1cf3d | 1,074 | py | Python | ecosystem/plot_stargazers.py | sealuzh/docker-ecosystem-paper | 5c8b253062796baf5d154bc6f9660a7d05d3dad5 | [
"Apache-2.0"
] | 5 | 2017-05-19T15:41:46.000Z | 2021-08-03T16:52:56.000Z | ecosystem/plot_stargazers.py | sealuzh/docker-ecosystem-paper | 5c8b253062796baf5d154bc6f9660a7d05d3dad5 | [
"Apache-2.0"
] | 1 | 2019-11-18T09:26:23.000Z | 2019-11-18T09:26:23.000Z | ecosystem/plot_stargazers.py | sealuzh/docker-ecosystem-paper | 5c8b253062796baf5d154bc6f9660a7d05d3dad5 | [
"Apache-2.0"
] | 1 | 2017-05-20T13:54:14.000Z | 2017-05-20T13:54:14.000Z | #!/usr/bin/env python
# Plots stargazers of repositories.
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from sklearn.neighbors import KernelDensity
# Based on: https://jakevdp.github.io/blog/2013/12/01/kernel-density-estimation/
def kde_sklearn(x, x_grid, bandwidth=0.2, **kwargs):
"""Kerne... | 28.263158 | 83 | 0.72905 | #!/usr/bin/env python
# Plots stargazers of repositories.
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from sklearn.neighbors import KernelDensity
# Based on: https://jakevdp.github.io/blog/2013/12/01/kernel-density-estimation/
def kde_sklearn(x, x_grid, bandwidth=0.2, **kwargs):
"""Kerne... | 0 | 0 | 0 |
bcd58dc314a69f1b85201cceac9b86fb58297c42 | 21,978 | py | Python | contrail-topology/contrail_topology/controller.py | biswajit-mandal/contrail-analytics | 393157153c223925d1dabdc2e173da90ab61aa50 | [
"Apache-2.0"
] | null | null | null | contrail-topology/contrail_topology/controller.py | biswajit-mandal/contrail-analytics | 393157153c223925d1dabdc2e173da90ab61aa50 | [
"Apache-2.0"
] | null | null | null | contrail-topology/contrail_topology/controller.py | biswajit-mandal/contrail-analytics | 393157153c223925d1dabdc2e173da90ab61aa50 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2015 Juniper Networks, Inc. All rights reserved.
#
from analytic_client import AnalyticApiClient
import time, socket, os
from topology_uve import LinkUve
import gevent
from gevent.lock import Semaphore
from opserver.consistent_schdlr import ConsistentScheduler
from topology_config_handler import Topol... | 47.16309 | 105 | 0.503231 | #
# Copyright (c) 2015 Juniper Networks, Inc. All rights reserved.
#
from analytic_client import AnalyticApiClient
import time, socket, os
from topology_uve import LinkUve
import gevent
from gevent.lock import Semaphore
from opserver.consistent_schdlr import ConsistentScheduler
from topology_config_handler import Topol... | 20,135 | 1,191 | 72 |
f31a318e5b8203dfd8fa0fa413989c87bccad9bd | 2,821 | py | Python | scratch.py | derekvantilborg/molml_tools | 5a5baaa21a4b3b91e59c1a350d04db3fd5102e4e | [
"MIT"
] | null | null | null | scratch.py | derekvantilborg/molml_tools | 5a5baaa21a4b3b91e59c1a350d04db3fd5102e4e | [
"MIT"
] | null | null | null | scratch.py | derekvantilborg/molml_tools | 5a5baaa21a4b3b91e59c1a350d04db3fd5102e4e | [
"MIT"
] | null | null | null | # conda install scikit-learn
# conda install -c conda-forge scikit-optimize
# conda install -c conda-forge rdkit
import pandas as pd
# from Tools.Clustering.butina import cluster_molecules
from molml.Datastructures.molecule import Dataset
from molml.Data import read_csv
from molml.Representations.descriptors import ec... | 28.785714 | 125 | 0.720312 | # conda install scikit-learn
# conda install -c conda-forge scikit-optimize
# conda install -c conda-forge rdkit
import pandas as pd
# from Tools.Clustering.butina import cluster_molecules
from molml.Datastructures.molecule import Dataset
from molml.Data import read_csv
from molml.Representations.descriptors import ec... | 17 | 0 | 23 |
8a643272ae06be634a32e0ab7072e549a34dede7 | 2,217 | py | Python | 4/vendor/gistfile1.py | JarryShaw/HelloWorld | 669984fa415e9bb65f5b7c261ec4f87ffbe56c6d | [
"Apache-2.0"
] | 1 | 2017-12-22T14:15:08.000Z | 2017-12-22T14:15:08.000Z | 4/vendor/gistfile1.py | JarryShaw/HelloWorld | 669984fa415e9bb65f5b7c261ec4f87ffbe56c6d | [
"Apache-2.0"
] | 1 | 2018-01-16T09:22:52.000Z | 2018-01-16T09:22:52.000Z | 4/vendor/gistfile1.py | JarryShaw/HelloWorld | 669984fa415e9bb65f5b7c261ec4f87ffbe56c6d | [
"Apache-2.0"
] | 1 | 2018-01-16T07:50:00.000Z | 2018-01-16T07:50:00.000Z | alphabet = "0123456789."
code = input()
grid = []
variables = []
loops = 10
for i in range(100):
grid.append(00)
while code[0] != "3" or code[1] != "." or code[-1] != "4":
code = input("Code invalid. ")
code += "000000"
i = 2
while i < len(code) - 6:
variables = []
variables.append(int(code[i+1] + ... | 28.063291 | 71 | 0.412269 | alphabet = "0123456789."
code = input()
grid = []
variables = []
loops = 10
for i in range(100):
grid.append(00)
while code[0] != "3" or code[1] != "." or code[-1] != "4":
code = input("Code invalid. ")
code += "000000"
i = 2
while i < len(code) - 6:
variables = []
variables.append(int(code[i+1] + ... | 0 | 0 | 0 |
faaa8707ba2e3914afcd146434676d67944dc037 | 7,959 | py | Python | paasta_tools/paastaapi/models/marathon_autoscaling_info.py | rohangulati/paasta | 4539e39159424bfbdeddcb243ca337bcd1eb1a06 | [
"Apache-2.0"
] | null | null | null | paasta_tools/paastaapi/models/marathon_autoscaling_info.py | rohangulati/paasta | 4539e39159424bfbdeddcb243ca337bcd1eb1a06 | [
"Apache-2.0"
] | null | null | null | paasta_tools/paastaapi/models/marathon_autoscaling_info.py | rohangulati/paasta | 4539e39159424bfbdeddcb243ca337bcd1eb1a06 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Paasta API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from... | 33.868085 | 181 | 0.650333 | # coding: utf-8
"""
Paasta API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from... | 0 | 0 | 0 |
7851d839dad479e83abf6f0e090c76610a28cb3d | 5,100 | py | Python | pymvg/test/test_first_principles.py | hop-soellingeraj/pymvg | 2b99ccb459063f34dbe801bdbbfcf1209b1fb3e5 | [
"MIT"
] | 84 | 2015-04-23T02:22:08.000Z | 2022-02-22T01:58:53.000Z | pymvg/test/test_first_principles.py | hop-soellingeraj/pymvg | 2b99ccb459063f34dbe801bdbbfcf1209b1fb3e5 | [
"MIT"
] | 8 | 2019-10-23T00:04:01.000Z | 2021-11-22T18:58:08.000Z | pymvg/test/test_first_principles.py | hop-soellingeraj/pymvg | 2b99ccb459063f34dbe801bdbbfcf1209b1fb3e5 | [
"MIT"
] | 18 | 2015-10-12T23:14:24.000Z | 2021-11-22T18:46:38.000Z | #!/usr/bin/env python
import numpy as np
from pymvg.test.utils import _build_points_3d, make_M
import os
from pymvg.util import normalize
from pymvg.camera_model import CameraModel
DRAW=int(os.environ.get('DRAW','0'))
if DRAW:
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from p... | 32.075472 | 80 | 0.604706 | #!/usr/bin/env python
import numpy as np
from pymvg.test.utils import _build_points_3d, make_M
import os
from pymvg.util import normalize
from pymvg.camera_model import CameraModel
DRAW=int(os.environ.get('DRAW','0'))
if DRAW:
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from p... | 4,580 | 0 | 92 |
a9795bb69cedbf18f80dc8b60dec3a74eb7e7217 | 23 | py | Python | colored_graph/__init__.py | SyrianSpock/colored-graph | dd182bcff8f09b7e38b73142c713abdc0e276919 | [
"MIT"
] | null | null | null | colored_graph/__init__.py | SyrianSpock/colored-graph | dd182bcff8f09b7e38b73142c713abdc0e276919 | [
"MIT"
] | null | null | null | colored_graph/__init__.py | SyrianSpock/colored-graph | dd182bcff8f09b7e38b73142c713abdc0e276919 | [
"MIT"
] | null | null | null | name = "colored_graph"
| 11.5 | 22 | 0.73913 | name = "colored_graph"
| 0 | 0 | 0 |
6f94639bb7da81753f9a1947683bcad48ae1179f | 7,143 | py | Python | Connect4/bot.py | iridia-ulb/AI-book | 965c6e217a8d2371c64a7e01e7b9145302bcf40f | [
"MIT"
] | 2 | 2021-12-24T21:08:46.000Z | 2022-03-16T20:30:14.000Z | Connect4/bot.py | iridia-ulb/AI-book | 965c6e217a8d2371c64a7e01e7b9145302bcf40f | [
"MIT"
] | null | null | null | Connect4/bot.py | iridia-ulb/AI-book | 965c6e217a8d2371c64a7e01e7b9145302bcf40f | [
"MIT"
] | null | null | null | import random
import math
from common import (
ROW_COUNT,
COLUMN_COUNT,
MINIMAX,
MONTE_CARLO,
RANDOM,
RANDOM_IMPR,
Observer,
)
YELLOW_PLAYER = 1
RED_PLAYER = -1
PLAYERS = {1: "Yellow", -1: "Red"}
class Bot(Observer):
"""
This class handles the different bots that were used.
I... | 32.766055 | 105 | 0.557749 | import random
import math
from common import (
ROW_COUNT,
COLUMN_COUNT,
MINIMAX,
MONTE_CARLO,
RANDOM,
RANDOM_IMPR,
Observer,
)
YELLOW_PLAYER = 1
RED_PLAYER = -1
PLAYERS = {1: "Yellow", -1: "Red"}
class Bot(Observer):
"""
This class handles the different bots that were used.
I... | 270 | 0 | 81 |
4db5922ca0eda76dacac4a88ee4dc802601c0259 | 1,501 | py | Python | ML Services/03.VS Code の利用/01.NativeScoreing_Linux.py | MasayukiOzawa/SQLServer-Util | 7dd1f9ab411955b85026c78e6e901ea4c57788f8 | [
"MIT"
] | 64 | 2016-06-15T07:39:40.000Z | 2022-03-22T02:19:50.000Z | ML Services/03.VS Code の利用/01.NativeScoreing_Linux.py | MasayukiOzawa/SQLServer-Util | 7dd1f9ab411955b85026c78e6e901ea4c57788f8 | [
"MIT"
] | 1 | 2016-09-24T17:41:04.000Z | 2016-11-09T01:31:17.000Z | ML Services/03.VS Code の利用/01.NativeScoreing_Linux.py | MasayukiOzawa/SQLServer-Util | 7dd1f9ab411955b85026c78e6e901ea4c57788f8 | [
"MIT"
] | 20 | 2017-03-07T19:20:00.000Z | 2022-03-22T02:34:50.000Z | from revoscalepy import rx_lin_mod, rx_serialize_model, rx_summary
import pandas as pd
import pyodbc
import os
conn_str = 'Driver=SQL Server;Server=<Server Name>;Database=MLDB;Uid=<User Name>;Pwd=<Password>;'
cnxn = pyodbc.connect(conn_str)
cnxn.setencoding("utf-8")
inputsql = 'select "RentalCount", "Year", "Month", "... | 40.567568 | 138 | 0.756163 | from revoscalepy import rx_lin_mod, rx_serialize_model, rx_summary
import pandas as pd
import pyodbc
import os
conn_str = 'Driver=SQL Server;Server=<Server Name>;Database=MLDB;Uid=<User Name>;Pwd=<Password>;'
cnxn = pyodbc.connect(conn_str)
cnxn.setencoding("utf-8")
inputsql = 'select "RentalCount", "Year", "Month", "... | 0 | 0 | 0 |
b08b481c6d54dd8f5ce2e1219e53ea74e1b33134 | 1,625 | py | Python | mushroom_rl/utils/features.py | PuzeLiu/mushroom-rl | 99942b425e66b4ddcc26009d7105dde23841e95d | [
"MIT"
] | 344 | 2020-01-10T09:45:02.000Z | 2022-03-30T09:48:28.000Z | mushroom_rl/utils/features.py | AmmarFahmy/mushroom-rl | 2625ee7f64d5613b3b9fba00f0b7a39fece88ca5 | [
"MIT"
] | 44 | 2020-01-23T03:00:56.000Z | 2022-03-25T17:14:22.000Z | mushroom_rl/utils/features.py | AmmarFahmy/mushroom-rl | 2625ee7f64d5613b3b9fba00f0b7a39fece88ca5 | [
"MIT"
] | 93 | 2020-01-10T21:17:58.000Z | 2022-03-31T17:58:52.000Z | import numpy as np
def uniform_grid(n_centers, low, high):
"""
This function is used to create the parameters of uniformly spaced radial
basis functions with 25% of overlap. It creates a uniformly spaced grid of
``n_centers[i]`` points in each ``ranges[i]``. Also returns a vector
containing the ap... | 27.083333 | 78 | 0.547077 | import numpy as np
def uniform_grid(n_centers, low, high):
"""
This function is used to create the parameters of uniformly spaced radial
basis functions with 25% of overlap. It creates a uniformly spaced grid of
``n_centers[i]`` points in each ``ranges[i]``. Also returns a vector
containing the ap... | 0 | 0 | 0 |
c9d22a7bf9b5dc1a732883747a14d59630652d12 | 16,528 | py | Python | inquiry_artifacts.py | saadxan/ExchangeBuddy | 5fa8b67feb8517fcb170b5207af6dbee864921d5 | [
"MIT"
] | null | null | null | inquiry_artifacts.py | saadxan/ExchangeBuddy | 5fa8b67feb8517fcb170b5207af6dbee864921d5 | [
"MIT"
] | null | null | null | inquiry_artifacts.py | saadxan/ExchangeBuddy | 5fa8b67feb8517fcb170b5207af6dbee864921d5 | [
"MIT"
] | null | null | null | from PyQt5.QtChart import *
import PyQt5.QtCore as QtCore
import PyQt5.QtGui as QtGui
import PyQt5.QtWidgets as QtWidgets
import config
import nav
import yfinance as yf
| 35.391863 | 120 | 0.615138 | from PyQt5.QtChart import *
import PyQt5.QtCore as QtCore
import PyQt5.QtGui as QtGui
import PyQt5.QtWidgets as QtWidgets
import config
import nav
import yfinance as yf
class ReturnButton(QtWidgets.QPushButton):
def __init__(self):
super(ReturnButton, self).__init__("Return")
self.clicked.connec... | 14,809 | 214 | 1,321 |
ac895a9dfd95f6ee6833018750b52a1c10056528 | 2,206 | py | Python | tryalgo/dinic.py | xcarcelle/tryalgo | c159fbffbea0a4e8b70e8898c31c62c7e08a3865 | [
"MIT"
] | null | null | null | tryalgo/dinic.py | xcarcelle/tryalgo | c159fbffbea0a4e8b70e8898c31c62c7e08a3865 | [
"MIT"
] | null | null | null | tryalgo/dinic.py | xcarcelle/tryalgo | c159fbffbea0a4e8b70e8898c31c62c7e08a3865 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Maximum flow by Dinic
# jill-jênn vie et christoph dürr - 2015-2018
from collections import deque
from sys import setrecursionlimit
from tryalgo.graph import add_reverse_arcs
setrecursionlimit(5010) # necessary for big graphs
# snip{
def dinic(graph, capacity, sou... | 31.070423 | 76 | 0.560743 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Maximum flow by Dinic
# jill-jênn vie et christoph dürr - 2015-2018
from collections import deque
from sys import setrecursionlimit
from tryalgo.graph import add_reverse_arcs
setrecursionlimit(5010) # necessary for big graphs
# snip{
def dinic(graph, capacity, sou... | 0 | 0 | 0 |
6a518aff98243781610501ac5c19e19219a5d6bf | 17,572 | py | Python | examples/pytorch/text-classification/run_xnli.py | bugface/transformers | ba286fe7d51db12ad663effac83bed8199dd7141 | [
"Apache-2.0"
] | 5 | 2020-09-01T09:15:48.000Z | 2020-09-15T03:25:05.000Z | examples/pytorch/text-classification/run_xnli.py | bugface/transformers | ba286fe7d51db12ad663effac83bed8199dd7141 | [
"Apache-2.0"
] | 2 | 2022-03-08T04:58:59.000Z | 2022-03-19T03:45:14.000Z | examples/pytorch/text-classification/run_xnli.py | bugface/transformers | ba286fe7d51db12ad663effac83bed8199dd7141 | [
"Apache-2.0"
] | 3 | 2020-08-20T04:46:25.000Z | 2020-10-14T08:39:13.000Z | #!/usr/bin/env python
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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.
... | 39.665914 | 119 | 0.66936 | #!/usr/bin/env python
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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.
... | 11,527 | 0 | 23 |
718bfd06695d1397dd6982ff8bd6f08d63a8642e | 2,059 | py | Python | tests/test_vlan.py | nazarii-gnydyn/sonic-swss | 00ea0ab01fe2877c0c8d5aba3d1e57497a48da80 | [
"Apache-2.0"
] | null | null | null | tests/test_vlan.py | nazarii-gnydyn/sonic-swss | 00ea0ab01fe2877c0c8d5aba3d1e57497a48da80 | [
"Apache-2.0"
] | null | null | null | tests/test_vlan.py | nazarii-gnydyn/sonic-swss | 00ea0ab01fe2877c0c8d5aba3d1e57497a48da80 | [
"Apache-2.0"
] | null | null | null | from swsscommon import swsscommon
import time
import re
import json
| 27.824324 | 79 | 0.609519 | from swsscommon import swsscommon
import time
import re
import json
def test_VlanMemberCreation(dvs):
db = swsscommon.DBConnector(4, dvs.redis_sock, 0)
adb = swsscommon.DBConnector(1, dvs.redis_sock, 0)
# create vlan in config db
tbl = swsscommon.Table(db, "VLAN", '|')
fvs = swsscommon.FieldValu... | 1,965 | 0 | 26 |
0d6a499f18fa307168dbe254580e20c8d352547c | 2,243 | py | Python | spar_python/data_generation/progress_reporters.py | nathanawmk/SPARTA | 6eeb28b2dd147088b6e851876b36eeba3e700f16 | [
"BSD-2-Clause"
] | 37 | 2017-06-09T13:55:23.000Z | 2022-01-28T12:51:17.000Z | spar_python/data_generation/progress_reporters.py | nathanawmk/SPARTA | 6eeb28b2dd147088b6e851876b36eeba3e700f16 | [
"BSD-2-Clause"
] | null | null | null | spar_python/data_generation/progress_reporters.py | nathanawmk/SPARTA | 6eeb28b2dd147088b6e851876b36eeba3e700f16 | [
"BSD-2-Clause"
] | 5 | 2017-06-09T13:55:26.000Z | 2021-11-11T03:51:56.000Z | # *****************************************************************
# Copyright 2015 MIT Lincoln Laboratory
# Project: SPAR
# Authors: JCH
# Description: Various classes to inform user of progress
#
# Modifications:
# Date Name Modification
# ---- ---- ... | 32.507246 | 75 | 0.544806 | # *****************************************************************
# Copyright 2015 MIT Lincoln Laboratory
# Project: SPAR
# Authors: JCH
# Description: Various classes to inform user of progress
#
# Modifications:
# Date Name Modification
# ---- ---- ... | 1,217 | 23 | 147 |
9902f0b6820f734ff15a736daf7d31ba2b2b9405 | 10,053 | py | Python | better_storylines/src/models.py | pedersor/google-research | 6fa751dd261b3f6d918fd2cd35efef5d8bf3eea6 | [
"Apache-2.0"
] | null | null | null | better_storylines/src/models.py | pedersor/google-research | 6fa751dd261b3f6d918fd2cd35efef5d8bf3eea6 | [
"Apache-2.0"
] | null | null | null | better_storylines/src/models.py | pedersor/google-research | 6fa751dd261b3f6d918fd2cd35efef5d8bf3eea6 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# 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 applicab... | 38.079545 | 79 | 0.693723 | # coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# 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 applicab... | 2,236 | 0 | 77 |
a31127b72b7d21ee24259615b6d11002355968cb | 1,513 | py | Python | Structural/composite.py | TheVikingGent/DesignPatterns4Python | ace9f577d9700fe290d80822230acb8e87833bc2 | [
"MIT"
] | null | null | null | Structural/composite.py | TheVikingGent/DesignPatterns4Python | ace9f577d9700fe290d80822230acb8e87833bc2 | [
"MIT"
] | null | null | null | Structural/composite.py | TheVikingGent/DesignPatterns4Python | ace9f577d9700fe290d80822230acb8e87833bc2 | [
"MIT"
] | null | null | null | import abc
# Good old composite pattern
# This is used when we want to create a hierachy of instances that contain other instances,
# but we want to operate on all instances somewhat equally
# Here the composite instances can contain other composites or leafs
# All implement the operation method, where the composite w... | 26.086207 | 91 | 0.682089 | import abc
# Good old composite pattern
# This is used when we want to create a hierachy of instances that contain other instances,
# but we want to operate on all instances somewhat equally
# Here the composite instances can contain other composites or leafs
# All implement the operation method, where the composite w... | 444 | 10 | 344 |
31da67c90663432016d6bb3ba1113b4ff12e3c5a | 3,435 | py | Python | tests/request_prep.py | cmd410/genki | cbe1435d2c7423fe56dfc3302c69a4808d95c3c2 | [
"MIT"
] | 2 | 2020-10-02T06:55:48.000Z | 2020-10-02T12:21:20.000Z | tests/request_prep.py | cmd410/genki | cbe1435d2c7423fe56dfc3302c69a4808d95c3c2 | [
"MIT"
] | 3 | 2020-10-15T20:20:58.000Z | 2020-10-15T20:26:22.000Z | tests/request_prep.py | cmd410/genki | cbe1435d2c7423fe56dfc3302c69a4808d95c3c2 | [
"MIT"
] | null | null | null | from unittest import TestCase
from itertools import product
from genki.http.url.parse import parse_url, url_parse_result
from genki.http.request import RequestBuilder
from genki.http.constants import Scheme
from genki.http.url.exceptions import InvalidURL
| 27.926829 | 69 | 0.445997 | from unittest import TestCase
from itertools import product
from genki.http.url.parse import parse_url, url_parse_result
from genki.http.request import RequestBuilder
from genki.http.constants import Scheme
from genki.http.url.exceptions import InvalidURL
def generate_url():
protos = ('http', 'https', '')
do... | 1,279 | 1,851 | 46 |
0931f806ba3567f0c3f9807d5366398745b76ddd | 4,292 | py | Python | gen/tests/test_adminrouter_tls_conf.py | Chewie/dcos | e2da3c7abf02d258b5b3292338f69dc4d59d34c5 | [
"Apache-2.0"
] | null | null | null | gen/tests/test_adminrouter_tls_conf.py | Chewie/dcos | e2da3c7abf02d258b5b3292338f69dc4d59d34c5 | [
"Apache-2.0"
] | 1 | 2020-02-09T11:37:07.000Z | 2020-02-09T11:37:07.000Z | gen/tests/test_adminrouter_tls_conf.py | Chewie/dcos | e2da3c7abf02d258b5b3292338f69dc4d59d34c5 | [
"Apache-2.0"
] | null | null | null | from textwrap import dedent
from typing import List
import pytest
import gen
from gen.tests.utils import make_arguments, true_false_msg, validate_error
class TestAdminRouterTLSConfig:
"""
Tests for the Admin Router TLS Config creation.
"""
def test_default(self):
"""
By default, the... | 35.471074 | 97 | 0.629077 | from textwrap import dedent
from typing import List
import pytest
import gen
from gen.tests.utils import make_arguments, true_false_msg, validate_error
class TestAdminRouterTLSConfig:
"""
Tests for the Admin Router TLS Config creation.
"""
def test_default(self):
"""
By default, the... | 0 | 0 | 0 |
d6b0e492861296d87420523ace08720910f389af | 735 | py | Python | bin/change_table_engine.py | Osso/dotfiles | 26a079e140f9f9ba8117d42aa25a049807965093 | [
"MIT"
] | 3 | 2017-04-21T20:56:10.000Z | 2019-06-10T09:24:14.000Z | bin/change_table_engine.py | Osso/dotfiles | 26a079e140f9f9ba8117d42aa25a049807965093 | [
"MIT"
] | null | null | null | bin/change_table_engine.py | Osso/dotfiles | 26a079e140f9f9ba8117d42aa25a049807965093 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
engine = 'innodb'
host = 'localhost'
db_name = ''
user = ''
passwd = ''
skip_tables = ()
import MySQLdb
db = MySQLdb.connect(user=user, passwd=passwd, db=db_name, host=host)
c = db.cursor()
c.execute("show tables")
row = c.fetchone()
while row:
table = row[0]
print 'Converting Table: %... | 23.709677 | 116 | 0.623129 | #!/usr/bin/env python
engine = 'innodb'
host = 'localhost'
db_name = ''
user = ''
passwd = ''
skip_tables = ()
import MySQLdb
db = MySQLdb.connect(user=user, passwd=passwd, db=db_name, host=host)
c = db.cursor()
c.execute("show tables")
row = c.fetchone()
while row:
table = row[0]
print 'Converting Table: %... | 0 | 0 | 0 |
470d276d504c478d5495528219b996f256618f93 | 37 | py | Python | bsdict/__init__.py | andrei-dubovik/bsdict | d3c4d3c9cab4710de2f26d6d8bd7be7c3a03789e | [
"BSD-3-Clause"
] | null | null | null | bsdict/__init__.py | andrei-dubovik/bsdict | d3c4d3c9cab4710de2f26d6d8bd7be7c3a03789e | [
"BSD-3-Clause"
] | null | null | null | bsdict/__init__.py | andrei-dubovik/bsdict | d3c4d3c9cab4710de2f26d6d8bd7be7c3a03789e | [
"BSD-3-Clause"
] | null | null | null | from .bsdict import bsdict, memoizer
| 18.5 | 36 | 0.810811 | from .bsdict import bsdict, memoizer
| 0 | 0 | 0 |
b72d18c6f62c214e3983921081d4f4cd19c26629 | 247 | py | Python | codechef/may_long_challenge/bella-ciao.py | abhishek-parashar/Right-From-Scratch | e596344b0db95cfdeba876676885f062ef5f7c23 | [
"Apache-2.0"
] | null | null | null | codechef/may_long_challenge/bella-ciao.py | abhishek-parashar/Right-From-Scratch | e596344b0db95cfdeba876676885f062ef5f7c23 | [
"Apache-2.0"
] | null | null | null | codechef/may_long_challenge/bella-ciao.py | abhishek-parashar/Right-From-Scratch | e596344b0db95cfdeba876676885f062ef5f7c23 | [
"Apache-2.0"
] | null | null | null | t = int(input())
while(t>0):
a=list(map(int,input().split(' ')))
D=a[0]
d=a[1]
p=a[2]
q=a[3]
remainder=D%d
n=D//d
value=(n*p*d) + (d*q*(n*(n-1)//2))+(p*remainder+(remainder*q*n))
print(value,"\n")
t=t-1
| 19 | 68 | 0.453441 | t = int(input())
while(t>0):
a=list(map(int,input().split(' ')))
D=a[0]
d=a[1]
p=a[2]
q=a[3]
remainder=D%d
n=D//d
value=(n*p*d) + (d*q*(n*(n-1)//2))+(p*remainder+(remainder*q*n))
print(value,"\n")
t=t-1
| 0 | 0 | 0 |
d5d81698fcf1a5e331071733b775c2a1cf01aa4e | 1,277 | py | Python | cajas/boxes/models/box_daily_square.py | dmontoya1/cajas | 5eb3d5835250d5dafae398082200b79c1ca8063b | [
"MIT"
] | null | null | null | cajas/boxes/models/box_daily_square.py | dmontoya1/cajas | 5eb3d5835250d5dafae398082200b79c1ca8063b | [
"MIT"
] | null | null | null | cajas/boxes/models/box_daily_square.py | dmontoya1/cajas | 5eb3d5835250d5dafae398082200b79c1ca8063b | [
"MIT"
] | null | null | null | from django.db import models
from cajas.users.models.user import User
from cajas.office.models.officeCountry import OfficeCountry
class BoxDailySquare(models.Model):
"""Modelo para la caja de un cuadre diario
"""
user = models.ForeignKey(
User,
verbose_name='Usuario',
on_delete=m... | 25.54 | 84 | 0.624119 | from django.db import models
from cajas.users.models.user import User
from cajas.office.models.officeCountry import OfficeCountry
class BoxDailySquare(models.Model):
"""Modelo para la caja de un cuadre diario
"""
user = models.ForeignKey(
User,
verbose_name='Usuario',
on_delete=m... | 143 | 92 | 54 |
0c5c224024b11fee0b68ab1b9509d0c08386838c | 600 | py | Python | src/state.py | JovialKnoll/monsters | 15d969d0220fd003c2c28ae690f66633da370682 | [
"MIT"
] | 2 | 2017-05-14T06:37:14.000Z | 2022-03-07T02:25:32.000Z | src/state.py | JovialKnoll/monsters | 15d969d0220fd003c2c28ae690f66633da370682 | [
"MIT"
] | 2 | 2017-10-08T19:41:18.000Z | 2021-04-08T04:40:50.000Z | src/state.py | JovialKnoll/monsters | 15d969d0220fd003c2c28ae690f66633da370682 | [
"MIT"
] | null | null | null | from monster import Monster
| 22.222222 | 58 | 0.583333 | from monster import Monster
class State(object):
__slots__ = (
'protag_mon',
'fight_results',
)
def __init__(self):
# start with a random monster
self.protag_mon = Monster()
self.fight_results = []
def save(self):
return {
'protag_mon': sel... | 380 | 168 | 23 |
717a3ae15beb8d819244f7e8f3b22e2b9d7c3d30 | 107 | py | Python | verpy/pybin3/tb.py | avielazari/vlsistuff | 34304dc64437fc849d74addd09963dca587df537 | [
"MIT"
] | 26 | 2018-03-17T18:14:22.000Z | 2022-03-14T07:23:13.000Z | verpy/pybin3/tb.py | psumesh/vlsistuff | 1fe64b093d0581d99c7d826b74c31b8655fa0b31 | [
"MIT"
] | 1 | 2019-10-16T10:31:11.000Z | 2019-10-17T04:14:53.000Z | verpy/pybin3/tb.py | psumesh/vlsistuff | 1fe64b093d0581d99c7d826b74c31b8655fa0b31 | [
"MIT"
] | 7 | 2018-07-16T07:51:25.000Z | 2022-02-15T14:22:54.000Z |
import dump_instance
| 11.888889 | 32 | 0.691589 |
import dump_instance
def help_main(Env):
Env.params['-tb'] = True
dump_instance.help_main(Env)
| 60 | 0 | 23 |
42a0c1b65965757cd699b5f4010098cef1cf0aa6 | 1,506 | py | Python | twoject/urls.py | Daniel-Muruthi/poladapi | 6a7c6d7a78f66c3ae2a2fdf6bebfc68c009aee36 | [
"MIT"
] | null | null | null | twoject/urls.py | Daniel-Muruthi/poladapi | 6a7c6d7a78f66c3ae2a2fdf6bebfc68c009aee36 | [
"MIT"
] | null | null | null | twoject/urls.py | Daniel-Muruthi/poladapi | 6a7c6d7a78f66c3ae2a2fdf6bebfc68c009aee36 | [
"MIT"
] | null | null | null | """twoject URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based... | 41.833333 | 82 | 0.73838 | """twoject URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based... | 0 | 0 | 0 |
4017feb743106024d7f6df30d888f397fc590313 | 1,640 | py | Python | src/stat_logger.py | Waterkin/stocknet-code | 6df878b599963e9fe31603dd55f78fd56e92f7d9 | [
"MIT"
] | null | null | null | src/stat_logger.py | Waterkin/stocknet-code | 6df878b599963e9fe31603dd55f78fd56e92f7d9 | [
"MIT"
] | null | null | null | src/stat_logger.py | Waterkin/stocknet-code | 6df878b599963e9fe31603dd55f78fd56e92f7d9 | [
"MIT"
] | null | null | null | '''
Date: 2022-01-11 16:05:39
LastEditors: Waterking
LastEditTime: 2022-01-12 18:21:49
FilePath: /stocknet-code/src/stat_logger.py
'''
#!/usr/local/bin/python
import metrics as metrics
from ConfigLoader import logger
| 38.139535 | 142 | 0.681707 | '''
Date: 2022-01-11 16:05:39
LastEditors: Waterking
LastEditTime: 2022-01-12 18:21:49
FilePath: /stocknet-code/src/stat_logger.py
'''
#!/usr/local/bin/python
import metrics as metrics
from ConfigLoader import logger
def print_batch_stat(n_iter, train_batch_loss, train_batch_n_acc, train_batch_size):
iter_str = '... | 1,351 | 0 | 69 |
6b3f6344429debb4b2157d0a395536e9054d9037 | 59,437 | py | Python | rpm_s3/vendor/createrepo/createrepo/__init__.py | stackstate-lab/rpm-s3 | 6c7929fc6034a93787ab5596876c8d00826486db | [
"BSD-2-Clause"
] | null | null | null | rpm_s3/vendor/createrepo/createrepo/__init__.py | stackstate-lab/rpm-s3 | 6c7929fc6034a93787ab5596876c8d00826486db | [
"BSD-2-Clause"
] | null | null | null | rpm_s3/vendor/createrepo/createrepo/__init__.py | stackstate-lab/rpm-s3 | 6c7929fc6034a93787ab5596876c8d00826486db | [
"BSD-2-Clause"
] | null | null | null | # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# bu... | 41.88654 | 536 | 0.549876 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# bu... | 28,559 | 26,581 | 366 |
0eeccddff39a938a9bf70a0b4760664618aed5eb | 11,176 | py | Python | BERT/bert_utils.py | HenryPaik1/paper_implement | fe1204209ab0830d8c58618218a8f2c0a1325721 | [
"MIT"
] | null | null | null | BERT/bert_utils.py | HenryPaik1/paper_implement | fe1204209ab0830d8c58618218a8f2c0a1325721 | [
"MIT"
] | null | null | null | BERT/bert_utils.py | HenryPaik1/paper_implement | fe1204209ab0830d8c58618218a8f2c0a1325721 | [
"MIT"
] | null | null | null | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import Dataset, DataLoader
import json
def create_pretrain_mask(tokens, mask_cnt, vocab_list):
"""
masking subwords(15% of entire subwords)
- mask_cnt: len(subwords) * 0.15
- [MASK]: 80% of maski... | 38.013605 | 114 | 0.548676 | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import Dataset, DataLoader
import json
def create_pretrain_mask(tokens, mask_cnt, vocab_list):
"""
masking subwords(15% of entire subwords)
- mask_cnt: len(subwords) * 0.15
- [MASK]: 80% of maski... | 2,113 | 0 | 111 |
bda34656d83aebce4f85163d20f15b0987373b21 | 735 | py | Python | covidscholar_web/scraping/journal_prediction.py | COVID-19-Text-Mining/website | d0314290d61431ddf694d64d96fb15fc872110cd | [
"MIT"
] | null | null | null | covidscholar_web/scraping/journal_prediction.py | COVID-19-Text-Mining/website | d0314290d61431ddf694d64d96fb15fc872110cd | [
"MIT"
] | null | null | null | covidscholar_web/scraping/journal_prediction.py | COVID-19-Text-Mining/website | d0314290d61431ddf694d64d96fb15fc872110cd | [
"MIT"
] | null | null | null | from matscholar import Rester
import bson
import tqdm
import os
import pymongo
client = pymongo.MongoClient('mongodb+srv://%s:%s@matstract-kve41.mongodb.net/test:27017' %
(os.getenv('ATLAS_USER_RW'), os.getenv('ATLAS_USER_PASSWORD_RW')), authSource='admin')
db = client['matstract_db']
c = ... | 26.25 | 115 | 0.647619 | from matscholar import Rester
import bson
import tqdm
import os
import pymongo
client = pymongo.MongoClient('mongodb+srv://%s:%s@matstract-kve41.mongodb.net/test:27017' %
(os.getenv('ATLAS_USER_RW'), os.getenv('ATLAS_USER_PASSWORD_RW')), authSource='admin')
db = client['matstract_db']
c = ... | 0 | 0 | 0 |
637ffeeae8697f699c352d40c502c391e37f239e | 6,353 | py | Python | opensnips/old/docker-images/rasa/snips_services/rasa_snips_extensions.py | syntithenai/opensnips | dd3dc629082ab8400da6fcdbf7d4ad5baf877848 | [
"BSD-2-Clause"
] | 57 | 2017-12-28T22:50:20.000Z | 2022-01-25T16:05:36.000Z | opensnips/old/docker-images/rasa/snips_services/rasa_snips_extensions.py | syntithenai/opensnips | dd3dc629082ab8400da6fcdbf7d4ad5baf877848 | [
"BSD-2-Clause"
] | 28 | 2018-04-18T06:45:20.000Z | 2022-03-08T22:50:50.000Z | opensnips/old/docker-images/rasa/snips_services/rasa_snips_extensions.py | syntithenai/opensnips | dd3dc629082ab8400da6fcdbf7d4ad5baf877848 | [
"BSD-2-Clause"
] | 18 | 2017-12-27T01:57:14.000Z | 2021-03-02T14:13:06.000Z | #!/usr/local/bin/python
# -*-: coding utf-8 -*-
""" Snips core and nlu server. """
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from rasa_core.agent import Agent
import os
import os.path
import re
from rasa_core.do... | 43.217687 | 186 | 0.668031 | #!/usr/local/bin/python
# -*-: coding utf-8 -*-
""" Snips core and nlu server. """
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from rasa_core.agent import Agent
import os
import os.path
import re
from rasa_core.do... | 3,758 | 1,446 | 75 |
e5cfb5b96c3a2c5050fcd36081bb94d65aafd6f9 | 6,407 | py | Python | loldib/getratings/models/NA/na_brand/na_brand_mid.py | koliupy/loldib | c9ab94deb07213cdc42b5a7c26467cdafaf81b7f | [
"Apache-2.0"
] | null | null | null | loldib/getratings/models/NA/na_brand/na_brand_mid.py | koliupy/loldib | c9ab94deb07213cdc42b5a7c26467cdafaf81b7f | [
"Apache-2.0"
] | null | null | null | loldib/getratings/models/NA/na_brand/na_brand_mid.py | koliupy/loldib | c9ab94deb07213cdc42b5a7c26467cdafaf81b7f | [
"Apache-2.0"
] | null | null | null | from getratings.models.ratings import Ratings
| 15.364508 | 46 | 0.761667 | from getratings.models.ratings import Ratings
class NA_Brand_Mid_Aatrox(Ratings):
pass
class NA_Brand_Mid_Ahri(Ratings):
pass
class NA_Brand_Mid_Akali(Ratings):
pass
class NA_Brand_Mid_Alistar(Ratings):
pass
class NA_Brand_Mid_Amumu(Ratings):
pass
class NA_Brand_Mid_Anivia(Ratings):
pass
... | 0 | 2,908 | 3,450 |
5d0af14cacf81bc84d5e76077f5732b56de324b1 | 4,688 | py | Python | mainBIDIRLSTM.py | SqrtPapere/SentimentAnalysis_CNN | e802780c8f7b6747832cb53b9a4391e9494c73a7 | [
"MIT"
] | 17 | 2018-02-02T14:09:23.000Z | 2020-08-06T21:02:49.000Z | mainBIDIRLSTM.py | SqrtPapere/SentimentAnalysis_CNN | e802780c8f7b6747832cb53b9a4391e9494c73a7 | [
"MIT"
] | null | null | null | mainBIDIRLSTM.py | SqrtPapere/SentimentAnalysis_CNN | e802780c8f7b6747832cb53b9a4391e9494c73a7 | [
"MIT"
] | 1 | 2018-09-10T21:33:14.000Z | 2018-09-10T21:33:14.000Z |
# https://machinelearningmastery.com/predict-sentiment-movie-reviews-using-deep-learning/
import os
import numpy as np
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
from keras.utils import to_categorical
from keras.callbacks import EarlyStopping, TensorBoard, Mo... | 32.783217 | 337 | 0.760666 |
# https://machinelearningmastery.com/predict-sentiment-movie-reviews-using-deep-learning/
import os
import numpy as np
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
from keras.utils import to_categorical
from keras.callbacks import EarlyStopping, TensorBoard, Mo... | 484 | 0 | 23 |
db1ac4b09e1eda87653b1a76cc69bb491c457300 | 602 | py | Python | atools/lib/moieties/multiple_ports/nh.py | dubosese/atools | 9d6f9e08310f3abb62aa6ec9e6003dcf9b87b513 | [
"MIT"
] | null | null | null | atools/lib/moieties/multiple_ports/nh.py | dubosese/atools | 9d6f9e08310f3abb62aa6ec9e6003dcf9b87b513 | [
"MIT"
] | null | null | null | atools/lib/moieties/multiple_ports/nh.py | dubosese/atools | 9d6f9e08310f3abb62aa6ec9e6003dcf9b87b513 | [
"MIT"
] | 3 | 2020-05-11T15:56:03.000Z | 2021-08-19T01:16:26.000Z | import mbuild as mb
class NH(mb.Compound):
"""A nitrogen with a hydrogen and two open ports. """
if __name__ == '__main__':
nh = NH()
| 27.363636 | 76 | 0.518272 | import mbuild as mb
class NH(mb.Compound):
"""A nitrogen with a hydrogen and two open ports. """
def __init__(self):
super(NH, self).__init__()
mb.load('nh.pdb', compound=self, relative_to_module=self.__module__)
self.translate(-self[0].pos)
self.add(mb.Port(anchor=self[0],
... | 431 | 0 | 26 |
68ba827dc155847247b30954d6c05b08b801fa7d | 1,287 | py | Python | ThreeBotPackages/threebot/blog/package.py | Pishoy/jumpscaleX_threebot | 781e839857fecfa601a31d98d86d304e3a6b3b4e | [
"Apache-2.0"
] | null | null | null | ThreeBotPackages/threebot/blog/package.py | Pishoy/jumpscaleX_threebot | 781e839857fecfa601a31d98d86d304e3a6b3b4e | [
"Apache-2.0"
] | null | null | null | ThreeBotPackages/threebot/blog/package.py | Pishoy/jumpscaleX_threebot | 781e839857fecfa601a31d98d86d304e3a6b3b4e | [
"Apache-2.0"
] | null | null | null | from Jumpscale import j
import os
__version__ = "0.0.1"
| 27.382979 | 65 | 0.609169 | from Jumpscale import j
import os
__version__ = "0.0.1"
class Package(j.baseclasses.threebot_package):
def _init(self, **kwargs):
self.branch = kwargs["package"].branch or "master"
os.environ["dev"] = "0"
self.DEV = os.environ.get("dev")
def prepare(self):
j.builders.runtimes... | 457 | 749 | 23 |
b4bb3da2bc5ad348643bcaf9d44ca34ee09b2c5d | 15,534 | py | Python | instrosetta/interfaces/optomechanics/filter_wheel_pb2_grpc.py | jmosbacher/instrosetta-python | b323ee4d3db0b7d8e22ec731dac521c967e5323d | [
"MIT"
] | null | null | null | instrosetta/interfaces/optomechanics/filter_wheel_pb2_grpc.py | jmosbacher/instrosetta-python | b323ee4d3db0b7d8e22ec731dac521c967e5323d | [
"MIT"
] | null | null | null | instrosetta/interfaces/optomechanics/filter_wheel_pb2_grpc.py | jmosbacher/instrosetta-python | b323ee4d3db0b7d8e22ec731dac521c967e5323d | [
"MIT"
] | null | null | null | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from instrosetta.interfaces.optomechanics import filter_wheel_pb2 as instrosetta_dot_interfaces_dot_optomechanics_dot_filter__wheel__pb2
| 57.962687 | 143 | 0.810609 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from instrosetta.interfaces.optomechanics import filter_wheel_pb2 as instrosetta_dot_interfaces_dot_optomechanics_dot_filter__wheel__pb2
class FilterWheelStub(object):
# missing associated documentation comment in .proto file
pass
... | 8,926 | 6,316 | 69 |
fa6cf6b2736d1fc6ebd9c3b07176a84c77cb8f2b | 3,274 | py | Python | Discrete_Structures/Exams/Exam_Ch_05_Sequences/Fibo_Exam.py | DoctorOac/SwosuCsPythonExamples | 07476b9b4ef9a6f8bd68921aef19e8f00183b1e7 | [
"Apache-2.0"
] | null | null | null | Discrete_Structures/Exams/Exam_Ch_05_Sequences/Fibo_Exam.py | DoctorOac/SwosuCsPythonExamples | 07476b9b4ef9a6f8bd68921aef19e8f00183b1e7 | [
"Apache-2.0"
] | null | null | null | Discrete_Structures/Exams/Exam_Ch_05_Sequences/Fibo_Exam.py | DoctorOac/SwosuCsPythonExamples | 07476b9b4ef9a6f8bd68921aef19e8f00183b1e7 | [
"Apache-2.0"
] | null | null | null | print('hello')
"""
Compare the number of operations and the time needed
to compute Fibonacci numbers recursively versus that
needed to compute them iteratively
"""
# recursive work
# Python program to display the Fibonacci sequence
import time
recursive_data = Data_tracker()
number_of_terms = 40
recursive_data.s... | 27.745763 | 87 | 0.703726 | print('hello')
"""
Compare the number of operations and the time needed
to compute Fibonacci numbers recursively versus that
needed to compute them iteratively
"""
class Data_tracker:
def __init__(self):
self.data = []
self.number_of_times_function_called = 0
self.if_count = 0
self... | 1,281 | -2 | 234 |
2bc0aff7c339f85f8d7761d9cc25bcfe9cb86616 | 23,532 | py | Python | commands/arch/network.py | naterh/openstack-guest-agents-unix | b6262b190d355f6469d95f462be0db53e3eb7ede | [
"Apache-2.0"
] | 15 | 2015-01-06T21:58:24.000Z | 2018-11-27T09:34:14.000Z | commands/arch/network.py | naterh/openstack-guest-agents-unix | b6262b190d355f6469d95f462be0db53e3eb7ede | [
"Apache-2.0"
] | 9 | 2015-03-06T02:11:29.000Z | 2021-03-13T07:13:45.000Z | commands/arch/network.py | naterh/openstack-guest-agents-unix | b6262b190d355f6469d95f462be0db53e3eb7ede | [
"Apache-2.0"
] | 18 | 2015-03-05T21:28:09.000Z | 2020-09-16T11:07:21.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (c) 2011 Openstack, LLC.
# 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... | 31.8 | 91 | 0.582738 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (c) 2011 Openstack, LLC.
# 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... | 11,829 | 0 | 184 |
59a26a64c2087146b79e13ddeb5f087f09ca346a | 405 | py | Python | 2019/day8/day8p2.py | darkterbear/advent-of-code-2015 | 543d5a70c4b4c84081602cfa3d0ba05fe0693e54 | [
"MIT"
] | null | null | null | 2019/day8/day8p2.py | darkterbear/advent-of-code-2015 | 543d5a70c4b4c84081602cfa3d0ba05fe0693e54 | [
"MIT"
] | 2 | 2019-12-01T20:03:18.000Z | 2021-05-11T22:41:00.000Z | 2019/day8/day8p2.py | darkterbear/advent-of-code-2015 | 543d5a70c4b4c84081602cfa3d0ba05fe0693e54 | [
"MIT"
] | null | null | null | file = open('./input')
w = 25
h = 6
ppl = 25 * 6
line = file.readline()
layers = []
for start in range(0, len(line), ppl):
layer = line[start:start+ppl]
layers.append([int(pixel) for pixel in layer])
img = []
for i in range(ppl):
for layer in layers:
if layer[i] != 2:
img.append(lay... | 16.875 | 50 | 0.548148 | file = open('./input')
w = 25
h = 6
ppl = 25 * 6
line = file.readline()
layers = []
for start in range(0, len(line), ppl):
layer = line[start:start+ppl]
layers.append([int(pixel) for pixel in layer])
img = []
for i in range(ppl):
for layer in layers:
if layer[i] != 2:
img.append(lay... | 0 | 0 | 0 |
1341ac4d38b8fda3bf9982fdf4b559b6ffc792e4 | 7,383 | py | Python | sdk/python/pulumi_azure_native/media/v20200201preview/media_graph.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/media/v20200201preview/media_graph.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/media/v20200201preview/media_graph.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 40.565934 | 372 | 0.63592 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 175 | 6,774 | 23 |
b7f149b954644c463a51e9ebf379826302cf2926 | 3,210 | py | Python | Algo and DSA/LeetCode-Solutions-master/Python/word-ladder-ii.py | Sourav692/FAANG-Interview-Preparation | f523e5c94d582328b3edc449ea16ac6ab28cdc81 | [
"Unlicense"
] | 3,269 | 2018-10-12T01:29:40.000Z | 2022-03-31T17:58:41.000Z | Algo and DSA/LeetCode-Solutions-master/Python/word-ladder-ii.py | Sourav692/FAANG-Interview-Preparation | f523e5c94d582328b3edc449ea16ac6ab28cdc81 | [
"Unlicense"
] | 53 | 2018-12-16T22:54:20.000Z | 2022-02-25T08:31:20.000Z | Algo and DSA/LeetCode-Solutions-master/Python/word-ladder-ii.py | Sourav692/FAANG-Interview-Preparation | f523e5c94d582328b3edc449ea16ac6ab28cdc81 | [
"Unlicense"
] | 1,236 | 2018-10-12T02:51:40.000Z | 2022-03-30T13:30:37.000Z | # Time: O(b^(d/2)), b is the branch factor of bfs, d is the result depth
# Space: O(w * l), w is the number of words, l is the max length of words
from collections import defaultdict
from string import ascii_lowercase
# Time: O(b^d), b is the branch factor of bfs, d is the result depth
# Space: O(w * l), w is the... | 36.477273 | 153 | 0.523364 | # Time: O(b^(d/2)), b is the branch factor of bfs, d is the result depth
# Space: O(w * l), w is the number of words, l is the max length of words
from collections import defaultdict
from string import ascii_lowercase
class Solution(object):
def findLadders(self, beginWord, endWord, wordList):
"""
... | 489 | 2,309 | 45 |
8c896bbcec49b232e565de5d2c577d39e4071374 | 347 | py | Python | video/write.py | TakeshiKishita/python_util | a05c4922699b4fd4545f5792d280bdbaec5a2dce | [
"Apache-2.0"
] | null | null | null | video/write.py | TakeshiKishita/python_util | a05c4922699b4fd4545f5792d280bdbaec5a2dce | [
"Apache-2.0"
] | null | null | null | video/write.py | TakeshiKishita/python_util | a05c4922699b4fd4545f5792d280bdbaec5a2dce | [
"Apache-2.0"
] | null | null | null | from abc import ABCMeta
class Writer(metaclass=ABCMeta):
"""
動画書き込みの、抽象基底クラス
"""
def open(self, **kwargs):
"""
書き込み機能を開く
"""
pass
def write(self, **kwargs):
"""
出力する
"""
pass
def close(self, **kwargs):
"""
処理を終了す... | 13.88 | 32 | 0.420749 | from abc import ABCMeta
class Writer(metaclass=ABCMeta):
"""
動画書き込みの、抽象基底クラス
"""
def open(self, **kwargs):
"""
書き込み機能を開く
"""
pass
def write(self, **kwargs):
"""
出力する
"""
pass
def close(self, **kwargs):
"""
処理を終了す... | 0 | 0 | 0 |
7ff8c4529b858969915797f2aee76fbced4479f9 | 1,064 | py | Python | npipes/utils/autodeleter.py | praxik/nPipes | 4edf8fa0d0467e3455941c46e960fdf3f43e2d31 | [
"Apache-2.0"
] | null | null | null | npipes/utils/autodeleter.py | praxik/nPipes | 4edf8fa0d0467e3455941c46e960fdf3f43e2d31 | [
"Apache-2.0"
] | null | null | null | npipes/utils/autodeleter.py | praxik/nPipes | 4edf8fa0d0467e3455941c46e960fdf3f43e2d31 | [
"Apache-2.0"
] | null | null | null | from contextlib import contextmanager, ExitStack
from pathlib import Path
from typing import Iterator
from npipes.utils.typeshed import pathlike
@contextmanager
def autoDeleteFile(path:pathlike) -> Iterator[pathlike]:
"""Context manager that deletes a single file when the context ends
"""
try:
yie... | 28 | 85 | 0.669173 | from contextlib import contextmanager, ExitStack
from pathlib import Path
from typing import Iterator
from npipes.utils.typeshed import pathlike
@contextmanager
def autoDeleteFile(path:pathlike) -> Iterator[pathlike]:
"""Context manager that deletes a single file when the context ends
"""
try:
yie... | 0 | 0 | 0 |
52fc3fbf8e15f41bb79aedf817ef0eba6c4362d9 | 551 | py | Python | app.py | patbahls/simple-slash-commands | feba84924db94d478c104108a245a4e120009a6a | [
"Apache-2.0"
] | null | null | null | app.py | patbahls/simple-slash-commands | feba84924db94d478c104108a245a4e120009a6a | [
"Apache-2.0"
] | null | null | null | app.py | patbahls/simple-slash-commands | feba84924db94d478c104108a245a4e120009a6a | [
"Apache-2.0"
] | null | null | null | from bottle import run,post,request,response,route
import os
import urllib
@post('/test')
@route('/path',method="post")
if __name__ == '__main__':
port_config = int(os.getenv('PORT', 5000))
run(host='0.0.0.0', port=port_config)
| 26.238095 | 79 | 0.678766 | from bottle import run,post,request,response,route
import os
import urllib
@post('/test')
def simple_test():
return "Hello World!"
@route('/path',method="post")
def gen_path_3():
postdata = request.forms.get("text")
output_path = str("sndwserv:/" + urllib.quote(postdata))
package = {"response_type": "... | 267 | 0 | 44 |
99037d2d3a9ce73ad64ac10eb1f078ef701d0abc | 921 | py | Python | main.py | Fabricio872/popcorn-detector | 7ebf92a05d9761632ef63db5ebfbe61791b25e1f | [
"MIT"
] | null | null | null | main.py | Fabricio872/popcorn-detector | 7ebf92a05d9761632ef63db5ebfbe61791b25e1f | [
"MIT"
] | null | null | null | main.py | Fabricio872/popcorn-detector | 7ebf92a05d9761632ef63db5ebfbe61791b25e1f | [
"MIT"
] | null | null | null | import time as time_lib
import numpy as np
import sounddevice as sd
duration = 50 # in seconds
warmup_time = 2 # in seconds
max_pop_time = 3 # in seconds time
pop_threshold = 15 # in volume units
min_pop_time = 512 # in milliseconds
pop_times = []
if __name__ == '__main__':
main()
| 24.236842 | 88 | 0.648208 | import time as time_lib
import numpy as np
import sounddevice as sd
duration = 50 # in seconds
warmup_time = 2 # in seconds
max_pop_time = 3 # in seconds time
pop_threshold = 15 # in volume units
min_pop_time = 512 # in milliseconds
pop_times = []
def pop_time():
return time_lib.time() - pop_times[-1]
de... | 554 | 0 | 69 |
13b4db6faf2877c8928a23eab3d719532df2d032 | 2,076 | py | Python | RBM/Function.py | Shoeboxam/Neural_Network | 61da4c2e4f6603a08042612d5ff2fe334ee7b20f | [
"MIT"
] | 3 | 2017-03-11T07:21:46.000Z | 2017-09-01T20:12:06.000Z | RBM/Function.py | Shoeboxam/Neural_Network | 61da4c2e4f6603a08042612d5ff2fe334ee7b20f | [
"MIT"
] | null | null | null | RBM/Function.py | Shoeboxam/Neural_Network | 61da4c2e4f6603a08042612d5ff2fe334ee7b20f | [
"MIT"
] | null | null | null | # Functions specific to restricted boltzmann machines
# Adapted from MFP/Functions.py
import numpy as np
# BASIS FUNCTIONS: Regression
# Diagonalize first dimension of an n-dimensional array
tau = 1 # Sigmoid threshold unit
basis_logistic = Function('basis', 'logistic', # Commonly known as 'Sigmoid'
... | 31.454545 | 107 | 0.545279 | # Functions specific to restricted boltzmann machines
# Adapted from MFP/Functions.py
import numpy as np
class Function(object):
def __init__(self, usage, name, evaluators):
self.usage = usage
self.name = name
self._evaluator = evaluators
def __call__(self, *args, d=0):
# The... | 374 | 2 | 152 |
5d50bf14a02af4c7549f9d42e27dbbd297324aa3 | 367 | py | Python | manet/data/__init__.py | jonasteuwen/manet-old | fb20c98f7e5c89a5ffe89d851ee84e7b65c5e229 | [
"BSD-2-Clause"
] | 1 | 2021-02-23T04:51:19.000Z | 2021-02-23T04:51:19.000Z | manet/data/__init__.py | jonasteuwen/manet-old | fb20c98f7e5c89a5ffe89d851ee84e7b65c5e229 | [
"BSD-2-Clause"
] | null | null | null | manet/data/__init__.py | jonasteuwen/manet-old | fb20c98f7e5c89a5ffe89d851ee84e7b65c5e229 | [
"BSD-2-Clause"
] | 1 | 2021-02-23T04:51:20.000Z | 2021-02-23T04:51:20.000Z | # encoding: utf-8
from manet.utils import read_image
import os
| 22.9375 | 77 | 0.683924 | # encoding: utf-8
from manet.utils import read_image
import os
def curr_path(fn):
dirname = os.path.dirname(os.path.realpath(__file__))
return os.path.join(dirname, fn)
def prob_map(name='one'):
prob, metadata = read_image(curr_path('prediction_{}.nrrd'.format(name)))
prob = prob[0]
metadata['sp... | 256 | 0 | 46 |
b495ccf1b957e21addfca760421b5119c0becc52 | 2,094 | py | Python | app/user/utils.py | vanwt/cmdb | c1539140ab0a20d8e2be98e5d878b46848122316 | [
"MIT"
] | 1 | 2019-12-15T05:20:42.000Z | 2019-12-15T05:20:42.000Z | app/user/utils.py | vanwt/cmdb | c1539140ab0a20d8e2be98e5d878b46848122316 | [
"MIT"
] | 12 | 2020-02-12T03:10:46.000Z | 2022-02-26T21:21:46.000Z | app/user/utils.py | vanwt/cmdb | c1539140ab0a20d8e2be98e5d878b46848122316 | [
"MIT"
] | null | null | null | from .models import Menu
| 31.727273 | 70 | 0.363419 | from .models import Menu
def jwt_response(token, user=None, request=None):
if user.is_superuser:
menus = Menu.objects.all()
user_menu = []
for menu in menus:
if menu.is_parent:
c = {
"name": menu.name,
"icon": menu.icon,
... | 2,057 | 0 | 23 |
01695a3f6dfb24dd21ee39aa1da81801ab132d5e | 621 | py | Python | src/cogs/ide/ide.py | Kraots/Jarvide | 75d8405dc836b1acf9c4b2abaf85fd769e6e424a | [
"MIT"
] | null | null | null | src/cogs/ide/ide.py | Kraots/Jarvide | 75d8405dc836b1acf9c4b2abaf85fd769e6e424a | [
"MIT"
] | null | null | null | src/cogs/ide/ide.py | Kraots/Jarvide | 75d8405dc836b1acf9c4b2abaf85fd769e6e424a | [
"MIT"
] | null | null | null | from .dialogs import OpenView
from src.utils import EmbedFactory
from disnake.ext import commands
class Ide(commands.Cog):
"""Ide cog"""
@commands.command()
@commands.max_concurrency(1, commands.BucketType.channel)
def setup(bot: commands.Bot) -> None:
"""Setup Ide cog"""
bot.add_cog(Ide(bot))... | 24.84 | 80 | 0.671498 | from .dialogs import OpenView
from src.utils import EmbedFactory
from disnake.ext import commands
class Ide(commands.Cog):
"""Ide cog"""
def __init__(self, bot: commands.Bot):
self.bot = bot
@commands.command()
@commands.max_concurrency(1, commands.BucketType.channel)
async def ide(self,... | 247 | 0 | 53 |
7ed307be5ec1a721f724f1bc0d44636969fa0963 | 957 | py | Python | deps/cmark/tools/make_entities_inc.py | cboettig/hash-archive | 2f50fdc2929f60447b00561901d59c4ce83651c3 | [
"MIT"
] | 1,212 | 2015-03-26T19:08:16.000Z | 2022-01-10T08:32:45.000Z | SymbolExtractorAndRenamer/cmark/tools/make_entities_inc.py | PolideaPlayground/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | [
"Apache-2.0"
] | 114 | 2015-03-26T18:30:53.000Z | 2017-07-21T16:25:36.000Z | SymbolExtractorAndRenamer/cmark/tools/make_entities_inc.py | PolideaPlayground/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | [
"Apache-2.0"
] | 76 | 2015-07-29T14:39:04.000Z | 2021-04-12T07:31:47.000Z | # Creates C data structures for binary lookup table of entities,
# using python's html5 entity data.
# Usage: python3 tools/make_entities_inc.py > src/entities.inc
import html
entities5 = html.entities.html5
# remove keys without semicolons. For some reason the list
# has duplicates of a few things, like auml, one ... | 29 | 101 | 0.69697 | # Creates C data structures for binary lookup table of entities,
# using python's html5 entity data.
# Usage: python3 tools/make_entities_inc.py > src/entities.inc
import html
entities5 = html.entities.html5
# remove keys without semicolons. For some reason the list
# has duplicates of a few things, like auml, one ... | 0 | 0 | 0 |
3b0460cc9b63041c3382b63ad2dae215e4a417a0 | 1,128 | py | Python | Python/LearnPythonTheHardWay/ex31.py | bryarcole/The-Portfolio | 62c2573ce4f007dccf5be1d67daf97286d6b4a5e | [
"MIT"
] | null | null | null | Python/LearnPythonTheHardWay/ex31.py | bryarcole/The-Portfolio | 62c2573ce4f007dccf5be1d67daf97286d6b4a5e | [
"MIT"
] | null | null | null | Python/LearnPythonTheHardWay/ex31.py | bryarcole/The-Portfolio | 62c2573ce4f007dccf5be1d67daf97286d6b4a5e | [
"MIT"
] | null | null | null | print "You enter a dark room with two doors. Do you go thorugh door #1 or door # 2"
door = raw_input(">" )
if door == "1":
print "Theres a giant bear here earting a cheescake. What do you do?"
print "Option '1'. Take the cake"
print "Option '2'. Scream at the bear."
bear = raw_input("> ")
if bea... | 34.181818 | 83 | 0.636525 | print "You enter a dark room with two doors. Do you go thorugh door #1 or door # 2"
door = raw_input(">" )
if door == "1":
print "Theres a giant bear here earting a cheescake. What do you do?"
print "Option '1'. Take the cake"
print "Option '2'. Scream at the bear."
bear = raw_input("> ")
if bea... | 0 | 0 | 0 |
216c7186aa0df89e03e4f63334c276700d96765c | 2,881 | py | Python | settings/Julich_chopper_modes_settings.py | bopopescu/Lauecollect | 60ae2b05ea8596ba0decf426e37aeaca0bc8b6be | [
"MIT"
] | null | null | null | settings/Julich_chopper_modes_settings.py | bopopescu/Lauecollect | 60ae2b05ea8596ba0decf426e37aeaca0bc8b6be | [
"MIT"
] | 1 | 2019-10-22T21:28:31.000Z | 2019-10-22T21:39:12.000Z | settings/Julich_chopper_modes_settings.py | bopopescu/Lauecollect | 60ae2b05ea8596ba0decf426e37aeaca0bc8b6be | [
"MIT"
] | 2 | 2019-06-06T15:06:46.000Z | 2020-07-20T02:03:22.000Z | line0.timing_system.channels.hsc.delay = 4.97e-06
line0.Phase [s] = 5.4527e-06
line0.ChopX = 36.78
line0.ChopY = 30.11
line0.description = 'S-1t'
line0.updated = '2019-05-30 14:18:48'
line1.timing_system.channels.hsc.delay = 0.0
line1.ChopX = 36.78
line1.ChopY = 31.136
line1.description = 'S-1'
line1.updated = '2019-05... | 33.5 | 94 | 0.737244 | line0.timing_system.channels.hsc.delay = 4.97e-06
line0.Phase [s] = 5.4527e-06
line0.ChopX = 36.78
line0.ChopY = 30.11
line0.description = 'S-1t'
line0.updated = '2019-05-30 14:18:48'
line1.timing_system.channels.hsc.delay = 0.0
line1.ChopX = 36.78
line1.ChopY = 31.136
line1.description = 'S-1'
line1.updated = '2019-05... | 0 | 0 | 0 |
0f65b48452a107e448f515377b6c8ebc0545e05b | 1,520 | py | Python | example/classifier_shogun.py | vishalbelsare/jubakit | f6252ba627ce4e2e42eb9aafaaf05c882bc1c678 | [
"MIT"
] | 12 | 2016-04-11T04:49:08.000Z | 2019-02-08T01:43:46.000Z | example/classifier_shogun.py | vishalbelsare/jubakit | f6252ba627ce4e2e42eb9aafaaf05c882bc1c678 | [
"MIT"
] | 138 | 2016-04-11T05:57:48.000Z | 2020-09-26T03:09:31.000Z | example/classifier_shogun.py | vishalbelsare/jubakit | f6252ba627ce4e2e42eb9aafaaf05c882bc1c678 | [
"MIT"
] | 10 | 2016-04-11T03:18:45.000Z | 2018-04-14T10:11:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
"""
Using Classifier and String Features
========================================
This is a famous `shogun` classifier example that predicts family name
of Shogun from his first name.
"""
... | 27.142857 | 110 | 0.710526 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
"""
Using Classifier and String Features
========================================
This is a famous `shogun` classifier example that predicts family name
of Shogun from his first name.
"""
... | 0 | 0 | 0 |
e48653b6767ad90aa0abfd6ebe35c13ae15166f0 | 1,024 | py | Python | labs/lab-10/fileScale.py | schnur/oss-repo-template | d9e3ea7cae43dd1dd1ff7acef8b1249f3a95a848 | [
"MIT"
] | null | null | null | labs/lab-10/fileScale.py | schnur/oss-repo-template | d9e3ea7cae43dd1dd1ff7acef8b1249f3a95a848 | [
"MIT"
] | null | null | null | labs/lab-10/fileScale.py | schnur/oss-repo-template | d9e3ea7cae43dd1dd1ff7acef8b1249f3a95a848 | [
"MIT"
] | null | null | null | from PIL import Image
import matplotlib.pyplot as plt
import numpy as np
from PIL import ImageOps
'''def turnWhite(imageName, newName):
img = Image.open(imageName+'.png')
img = img.convert("RGBA")
datas = img.getdata()
newData = []
for item in datas:
if item[3]!=0:
newData.appe... | 22.26087 | 66 | 0.636719 | from PIL import Image
import matplotlib.pyplot as plt
import numpy as np
from PIL import ImageOps
'''def turnWhite(imageName, newName):
img = Image.open(imageName+'.png')
img = img.convert("RGBA")
datas = img.getdata()
newData = []
for item in datas:
if item[3]!=0:
newData.appe... | 0 | 0 | 0 |
a636144d3d5c2b26863dc0a67f5fc0f3e314319a | 1,813 | py | Python | hemp/web/services/nso.py | nobuhikosekiya/sbx_multi_ios | 9a8e540617d46fd98f466d89e1f9af4f8a1797aa | [
"MIT"
] | 64 | 2018-08-18T01:13:18.000Z | 2021-12-09T17:46:35.000Z | hemp/web/services/nso.py | nobuhikosekiya/sbx_multi_ios | 9a8e540617d46fd98f466d89e1f9af4f8a1797aa | [
"MIT"
] | 45 | 2018-08-16T21:26:11.000Z | 2021-12-13T19:58:20.000Z | hemp/web/services/nso.py | nobuhikosekiya/sbx_multi_ios | 9a8e540617d46fd98f466d89e1f9af4f8a1797aa | [
"MIT"
] | 37 | 2018-09-23T04:09:53.000Z | 2021-11-11T16:39:37.000Z | import os
import requests
from base64 import b64encode
from flask import render_template
BASE_URL = os.getenv("NSO_URL", "http://localhost:8080")
API_ROOT = BASE_URL + '/api/running'
NSO_USERNAME = os.getenv("NSO_USERNAME", "admin")
NSO_PASSWORD = os.getenv("NSO_PASSWORD", "admin")
HEADERS = {
'Content-Type': "a... | 32.375 | 73 | 0.599559 | import os
import requests
from base64 import b64encode
from flask import render_template
BASE_URL = os.getenv("NSO_URL", "http://localhost:8080")
API_ROOT = BASE_URL + '/api/running'
NSO_USERNAME = os.getenv("NSO_USERNAME", "admin")
NSO_PASSWORD = os.getenv("NSO_PASSWORD", "admin")
HEADERS = {
'Content-Type': "a... | 740 | 0 | 69 |