hexsha stringlengths 40 40 | size int64 5 2.06M | ext stringclasses 11
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 251 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | 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 3 251 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 251 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.05M | avg_line_length float64 1 1.02M | max_line_length int64 3 1.04M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b618335f706022104fc8e982cca8ccd5f542436e | 1,894 | py | Python | 123.py | zhirihuixin/wzh_private | b090a1f68093b180b83b4f3146e56d264f63d5bd | [
"MIT"
] | 1 | 2017-03-21T09:07:30.000Z | 2017-03-21T09:07:30.000Z | 123.py | zhirihuixin/wzh_private | b090a1f68093b180b83b4f3146e56d264f63d5bd | [
"MIT"
] | null | null | null | 123.py | zhirihuixin/wzh_private | b090a1f68093b180b83b4f3146e56d264f63d5bd | [
"MIT"
] | null | null | null | import pickle
import numpy as np
pkl_file = open('D:\wangzhihui\\123\wzh\ResNext101_32_4d_faster_rcnn_merge_bn_scale_iter_60000\\detections.pkl', 'rb')
data1 = pickle.load(pkl_file)
def py_cpu_nms(dets, thresh):
"""Pure Python NMS baseline."""
x1 = dets[:, 0]
y1 = dets[:, 1]
x2 = dets[:, 2]
y2 = d... | 23.675 | 118 | 0.534319 |
b618d3e757516d28daaaf4e251eeb45623d8f192 | 1,398 | py | Python | hycu-demo/hycu-centos-8.py | halsayed/calm | 46c93ac2b02227663f0184d149f62d142b2638cc | [
"MIT"
] | null | null | null | hycu-demo/hycu-centos-8.py | halsayed/calm | 46c93ac2b02227663f0184d149f62d142b2638cc | [
"MIT"
] | null | null | null | hycu-demo/hycu-centos-8.py | halsayed/calm | 46c93ac2b02227663f0184d149f62d142b2638cc | [
"MIT"
] | 1 | 2021-11-16T10:28:42.000Z | 2021-11-16T10:28:42.000Z | from calm.dsl.builtins import basic_cred, CalmTask, action
from calm.dsl.builtins import SimpleDeployment, SimpleBlueprint
from calm.dsl.builtins import read_provider_spec
from calm.dsl.builtins import CalmVariable
from calm.dsl.store import Secret
CENTOS = basic_cred('nutanix', 'nutanix/4u', name='CENTOS', default=Tr... | 36.789474 | 90 | 0.73176 |
b619e86dde26d288681bc5bbb637fb6786e9878f | 2,695 | py | Python | lc/0101_SymmetricTree.py | xiangshiyin/coding-challenge | a75a644b96dec1b6c7146b952ca4333263f0a461 | [
"Apache-2.0"
] | null | null | null | lc/0101_SymmetricTree.py | xiangshiyin/coding-challenge | a75a644b96dec1b6c7146b952ca4333263f0a461 | [
"Apache-2.0"
] | null | null | null | lc/0101_SymmetricTree.py | xiangshiyin/coding-challenge | a75a644b96dec1b6c7146b952ca4333263f0a461 | [
"Apache-2.0"
] | null | null | null | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
# class Solution:
# def isSymmetric(self, root: TreeNode) -> bool:
# '''
# long, iterative solution
# ... | 29.615385 | 95 | 0.440074 |
b61b1f4f777fb497c659daccaa184cb2e2a702f6 | 920 | py | Python | checkboxes2.py | PiyushKumar186/programming | 4dc17488a2d197ccdb6acd6f80732da81147bb1b | [
"MIT"
] | null | null | null | checkboxes2.py | PiyushKumar186/programming | 4dc17488a2d197ccdb6acd6f80732da81147bb1b | [
"MIT"
] | null | null | null | checkboxes2.py | PiyushKumar186/programming | 4dc17488a2d197ccdb6acd6f80732da81147bb1b | [
"MIT"
] | null | null | null | #!/usr/bin/python2
from Tkinter import *
if __name__ == '__main__':
root = Tk()
lng = Checkbar(root,['Python','Ruby','Perl','C++'])
tgl = Checkbar(root,['English','German'])
lng.pack(side=TOP,fill=X)
tgl.pack(side=TOP)
lng.config(relief=GROOVE,bd=2)
Button(root,text='Quit',command=root.quit... | 34.074074 | 64 | 0.615217 |
b61b86ab032b9a24da2c37b62cc30d9b56165a99 | 1,447 | py | Python | autodraft/draftHost/importers/positions.py | gnmerritt/autodraft | b4071f9cc5eaf57beb19ba1aec99377afdbfb09a | [
"MIT"
] | null | null | null | autodraft/draftHost/importers/positions.py | gnmerritt/autodraft | b4071f9cc5eaf57beb19ba1aec99377afdbfb09a | [
"MIT"
] | null | null | null | autodraft/draftHost/importers/positions.py | gnmerritt/autodraft | b4071f9cc5eaf57beb19ba1aec99377afdbfb09a | [
"MIT"
] | null | null | null | from draftHost.models import NflPosition, FantasyPosition
# path relative to manage.py
NFL_DATA_FILE = "draftHost/data/nfl_positions.txt"
FANTASY_DATA_FILE = "draftHost/data/fantasy_positions.txt"
| 33.651163 | 73 | 0.54112 |
b61c54672fad12557646d3ef16c482952b01520a | 2,572 | py | Python | code/Experiments/Lasagne_examples/modelzoo/cifar10_nin.py | matthijsvk/convNets | 7e65db7857a4e6abfbcab264953eb7741319de6c | [
"Apache-2.0"
] | 1,034 | 2015-05-21T12:47:50.000Z | 2022-03-17T19:27:29.000Z | modelzoo/cifar10_nin.py | nestyme/Recipes | 553f5cf671f164da71152e33253cd7ed737dd2ac | [
"MIT"
] | 111 | 2015-07-04T11:38:59.000Z | 2022-03-04T01:12:11.000Z | modelzoo/cifar10_nin.py | nestyme/Recipes | 553f5cf671f164da71152e33253cd7ed737dd2ac | [
"MIT"
] | 528 | 2015-07-03T22:15:02.000Z | 2022-03-27T10:01:21.000Z | # Network in Network CIFAR10 Model
# Original source: https://gist.github.com/mavenlin/e56253735ef32c3c296d
# License: unknown
# Download pretrained weights from:
# https://s3.amazonaws.com/lasagne/recipes/pretrained/cifar10/model.pkl
from lasagne.layers import InputLayer, DropoutLayer, FlattenLayer
from lasagne.laye... | 41.483871 | 73 | 0.515552 |
b61d0a638f24888cb68e4936a01c7b39a707cb01 | 2,969 | py | Python | src/backend/models/placeModel.py | oasis-art-project/oasis-server | 63e8093ebafa76c90393eec7828221e255100252 | [
"Artistic-2.0"
] | 3 | 2022-03-07T23:40:29.000Z | 2022-03-07T23:40:35.000Z | src/backend/models/placeModel.py | oasis-art-project/oasis-server | 63e8093ebafa76c90393eec7828221e255100252 | [
"Artistic-2.0"
] | null | null | null | src/backend/models/placeModel.py | oasis-art-project/oasis-server | 63e8093ebafa76c90393eec7828221e255100252 | [
"Artistic-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Part of the OASIS ART PROJECT - https://github.com/orgs/oasis-art-project
Copyright (c) 2019-22 TEAM OASIS
License Artistic-2.0
"""
from marshmallow import fields, validate, post_dump
from sqlalchemy.types import ARRAY
from src.backend.extensions import db
from src.backend.models.model im... | 43.661765 | 175 | 0.689795 |
b61ebeb23f8d54ceaf64080f94bfcc879df1a83f | 8,509 | py | Python | torcharc/module/perceiver_io/preprocessor.py | kengz/torcharc | e17043391c718a161956b4da98f9a7810efe62a2 | [
"MIT"
] | 1 | 2020-06-12T09:55:25.000Z | 2020-06-12T09:55:25.000Z | torcharc/module/perceiver_io/preprocessor.py | kengz/torcharc | e17043391c718a161956b4da98f9a7810efe62a2 | [
"MIT"
] | 5 | 2021-06-26T18:25:39.000Z | 2021-12-31T22:43:22.000Z | torcharc/module/perceiver_io/preprocessor.py | kengz/torcharc | e17043391c718a161956b4da98f9a7810efe62a2 | [
"MIT"
] | null | null | null | from einops import repeat, rearrange
from torch import nn
from torcharc import net_util
import math
import pydash as ps
import sys
import torch
def build_learned_pos_encoding(max_seq_len: int, embed_dim: int):
'''Build learned positional encoding with Deepmind's init'''
# learned position encoding
pos_enc... | 54.197452 | 269 | 0.678106 |
b61f00da589e3e40dcc6ece3e1151abf782ac6ad | 3,027 | py | Python | utils/datafields.py | edgeless634/bilibili_spider | 589bbd029d3db3e9382d2e825250fe21b12edc39 | [
"MIT"
] | null | null | null | utils/datafields.py | edgeless634/bilibili_spider | 589bbd029d3db3e9382d2e825250fe21b12edc39 | [
"MIT"
] | null | null | null | utils/datafields.py | edgeless634/bilibili_spider | 589bbd029d3db3e9382d2e825250fe21b12edc39 | [
"MIT"
] | null | null | null | import os
import random
import logging
import threading
base_path = os.path.dirname(os.path.dirname(__file__))
base_path = os.path.join(base_path, "datafield")
if not os.path.exists(base_path):
os.mkdir(base_path)
datafields = DataField()
if __name__ == '__main__':
print(datafields.fields)
print(data... | 29.105769 | 126 | 0.561612 |
b61f12f0a57f2ac17e29150643fd1a3a0801bb75 | 1,468 | py | Python | 0.mccntt/domain-wide/gmail_quickstart.py | mccntt/googleworkspace-python-samples | c1a24d4e06f2b14af4b494db55ebad04fbf6cf89 | [
"Apache-2.0"
] | null | null | null | 0.mccntt/domain-wide/gmail_quickstart.py | mccntt/googleworkspace-python-samples | c1a24d4e06f2b14af4b494db55ebad04fbf6cf89 | [
"Apache-2.0"
] | null | null | null | 0.mccntt/domain-wide/gmail_quickstart.py | mccntt/googleworkspace-python-samples | c1a24d4e06f2b14af4b494db55ebad04fbf6cf89 | [
"Apache-2.0"
] | null | null | null |
# https://docs.microsoft.com/en-us/windows/python/beginners
# https://developers.google.com/identity/protocols/oauth2/service-account#python
from __future__ import print_function
from pathlib import Path
from googleapiclient.discovery import build
from google.oauth2 import service_account
SCOPES = ['https://www.go... | 28.784314 | 130 | 0.706403 |
b61fa6e0d30b3d5f87bf0ee960be776cf48333dc | 5,575 | py | Python | code/dpp/distributions/logistic_mixture.py | bsouhaib/qf-tpp | a5adf3f7203b920528c1c397329c4afd9039c3b4 | [
"MIT"
] | null | null | null | code/dpp/distributions/logistic_mixture.py | bsouhaib/qf-tpp | a5adf3f7203b920528c1c397329c4afd9039c3b4 | [
"MIT"
] | null | null | null | code/dpp/distributions/logistic_mixture.py | bsouhaib/qf-tpp | a5adf3f7203b920528c1c397329c4afd9039c3b4 | [
"MIT"
] | null | null | null | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.distributions as td
from torch.distributions import constraints
from dpp.nn import BaseModule, Hypernet
from dpp.utils import clamp_preserve_gradients
# Credit: https://github.com/aravindsrinivas/flowpp/blob/master/... | 38.986014 | 103 | 0.636233 |
b61fd88f4b3a01a3aa6ca746cfeb284296cf724d | 15,173 | py | Python | register/urls.py | LucasHiago/pede_ja | 62609a32d045b167a96be79cc93113d32dcfe917 | [
"MIT"
] | null | null | null | register/urls.py | LucasHiago/pede_ja | 62609a32d045b167a96be79cc93113d32dcfe917 | [
"MIT"
] | null | null | null | register/urls.py | LucasHiago/pede_ja | 62609a32d045b167a96be79cc93113d32dcfe917 | [
"MIT"
] | null | null | null | from django.urls import path
from django.conf import settings
from django.conf.urls.static import static
from .views import *
urlpatterns = [
# Urls for authentication on noruh web
path('change_password/', RecoverPasswordByApi.as_view(), name='change_password'),
path('reset_passowrd/complete/', Recove... | 55.375912 | 126 | 0.701114 |
b61fdd250445e3eab4d4df963d8cfba91ce0bd48 | 6,220 | py | Python | model/utils/config_helper.py | aashiqmuhamed/transformer-gan | 1ccc9f251c1b1d054c1acc8be36c1da7bf8cf11c | [
"Apache-2.0"
] | 32 | 2021-06-11T02:03:03.000Z | 2022-03-23T16:12:49.000Z | model/utils/config_helper.py | aashiqmuhamed/transformer-gan | 1ccc9f251c1b1d054c1acc8be36c1da7bf8cf11c | [
"Apache-2.0"
] | 3 | 2021-11-11T06:08:37.000Z | 2022-02-20T14:09:30.000Z | model/utils/config_helper.py | aashiqmuhamed/transformer-gan | 1ccc9f251c1b1d054c1acc8be36c1da7bf8cf11c | [
"Apache-2.0"
] | 7 | 2021-06-11T01:19:56.000Z | 2022-02-17T03:52:15.000Z | from yacs.config import CfgNode as CN
| 37.926829 | 133 | 0.694855 |
b62114fe26c6e23da2c727e699637285d222ecc8 | 832 | py | Python | examples/yaml/main.py | pseeth/argbind | 1b953e370065d9f3c91dee5c93cc6447b72e3744 | [
"MIT"
] | 19 | 2020-10-14T00:00:13.000Z | 2022-02-20T23:21:18.000Z | examples/yaml/main.py | pseeth/argbind | 1b953e370065d9f3c91dee5c93cc6447b72e3744 | [
"MIT"
] | 3 | 2021-03-30T15:56:55.000Z | 2022-03-21T20:52:56.000Z | examples/yaml/main.py | pseeth/argbind | 1b953e370065d9f3c91dee5c93cc6447b72e3744 | [
"MIT"
] | 1 | 2021-04-13T18:51:29.000Z | 2021-04-13T18:51:29.000Z | import argbind
import typing
if __name__ == "__main__":
args = argbind.parse_args()
with argbind.scope(args):
func()
| 22.486486 | 42 | 0.550481 |
b6215c1441983e96ac508f482bf4dc70d993cca3 | 2,585 | py | Python | handlers/article.py | armaaar/Multi-Users-Blog | 8b28b2816337d8f023bc6c1741e91c86d3127874 | [
"MIT"
] | null | null | null | handlers/article.py | armaaar/Multi-Users-Blog | 8b28b2816337d8f023bc6c1741e91c86d3127874 | [
"MIT"
] | null | null | null | handlers/article.py | armaaar/Multi-Users-Blog | 8b28b2816337d8f023bc6c1741e91c86d3127874 | [
"MIT"
] | null | null | null | from handlers import tables, helper, Handler
import time
| 41.693548 | 74 | 0.56441 |
b621e93761f39072896a2d33479068491b0d86fd | 428 | py | Python | Alignment/MuonAlignmentAlgorithms/python/MuonAlignmentPreFilter_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | Alignment/MuonAlignmentAlgorithms/python/MuonAlignmentPreFilter_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | Alignment/MuonAlignmentAlgorithms/python/MuonAlignmentPreFilter_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
MuonAlignmentPreFilter = cms.EDFilter("MuonAlignmentPreFilter",
tracksTag = cms.InputTag("ALCARECOMuAlCalIsolatedMu:GlobalMuon"),
minTrackPt = cms.double(20.),
minTrackP = cms.double(0.),
minTrackerHits = cms.int32(10),
minDTHits = cms.int32(6),
minCSCHits = cms.int... | 28.533333 | 67 | 0.728972 |
b6239675b28fbe08cb92d202a432a29c5c6dfd60 | 13,299 | py | Python | widgets/KeyEvents.py | iubica/wx-portfolio | 12101986db72bcaffd9b744d514d6f9f651ad5a1 | [
"MIT"
] | 3 | 2018-03-19T07:57:10.000Z | 2021-07-05T08:55:14.000Z | widgets/KeyEvents.py | iubica/wx-portfolio | 12101986db72bcaffd9b744d514d6f9f651ad5a1 | [
"MIT"
] | 6 | 2020-03-24T15:40:18.000Z | 2021-12-13T19:46:09.000Z | widgets/KeyEvents.py | iubica/wx-portfolio | 12101986db72bcaffd9b744d514d6f9f651ad5a1 | [
"MIT"
] | 4 | 2018-03-29T21:59:55.000Z | 2019-12-16T14:56:38.000Z | #!/usr/bin/env python
import wx
import wx.lib.mixins.listctrl as listmix
from six import unichr
#----------------------------------------------------------------------
keyMap = {
wx.WXK_BACK : "WXK_BACK",
wx.WXK_TAB : "WXK_TAB",
wx.WXK_RETURN : "WXK_RETURN",
wx.WXK_ESCAPE : "WXK_ESCAPE",
wx.WXK_S... | 31 | 79 | 0.577788 |
b62433cd037f79979cfef4c3c7e8ba4b1fe36dc3 | 373 | py | Python | learner/time_callback.py | remmyzen/nqs-tensorflow2 | 2af5d5ebb108eac4d2daa5082bdef11c8107bd1b | [
"MIT"
] | 4 | 2021-07-29T17:52:54.000Z | 2022-02-15T06:32:15.000Z | learner/time_callback.py | remmyzen/nqs-tensorflow2 | 2af5d5ebb108eac4d2daa5082bdef11c8107bd1b | [
"MIT"
] | null | null | null | learner/time_callback.py | remmyzen/nqs-tensorflow2 | 2af5d5ebb108eac4d2daa5082bdef11c8107bd1b | [
"MIT"
] | null | null | null | import time
import tensorflow
from tensorflow import keras
| 21.941176 | 58 | 0.686327 |
b624ed925fddaa73c150d0b98d5fda740868dd65 | 4,071 | py | Python | app/movies/tests/test_view.py | NicolefAvella/ApiMovie | 4860b312f62dee73de6015c3029e75a6045f79a1 | [
"MIT"
] | null | null | null | app/movies/tests/test_view.py | NicolefAvella/ApiMovie | 4860b312f62dee73de6015c3029e75a6045f79a1 | [
"MIT"
] | null | null | null | app/movies/tests/test_view.py | NicolefAvella/ApiMovie | 4860b312f62dee73de6015c3029e75a6045f79a1 | [
"MIT"
] | null | null | null | from django.urls import reverse
from rest_framework.test import APITestCase, APIClient
from rest_framework.views import status
from movies.models import Movies
from movies.serializers import MoviesSerializer
from user.models import User
import json
| 33.368852 | 123 | 0.590273 |
b625420fbcf257af05779c352e7795a2abfb2733 | 5,426 | py | Python | examples/ConsumptionSaving/example_TractableBufferStockModel.py | HsinYiHung/HARK_HY | 086c46af5bd037fe1ced6906c6ea917ed58b134f | [
"Apache-2.0"
] | null | null | null | examples/ConsumptionSaving/example_TractableBufferStockModel.py | HsinYiHung/HARK_HY | 086c46af5bd037fe1ced6906c6ea917ed58b134f | [
"Apache-2.0"
] | null | null | null | examples/ConsumptionSaving/example_TractableBufferStockModel.py | HsinYiHung/HARK_HY | 086c46af5bd037fe1ced6906c6ea917ed58b134f | [
"Apache-2.0"
] | null | null | null | # %%
import numpy as np # numeric Python
from HARK.utilities import plotFuncs # basic plotting tools
from HARK.ConsumptionSaving.ConsMarkovModel import (
MarkovConsumerType,
) # An alternative, much longer way to solve the TBS model
from time import process_time # timing utility
from HARK.ConsumptionSaving.Trac... | 41.419847 | 116 | 0.71397 |
b625948601304a37edf120d20921eb82fe58c66b | 3,299 | py | Python | util/utils.py | tanghaotommy/Self-supervised-Fewshot-Medical-Image-Segmentation | 9ff8cd2421ee2f7c038d8eec15b0296b365e0c46 | [
"MIT"
] | 176 | 2020-09-10T16:32:16.000Z | 2022-03-30T12:06:02.000Z | util/utils.py | tanghaotommy/Self-supervised-Fewshot-Medical-Image-Segmentation | 9ff8cd2421ee2f7c038d8eec15b0296b365e0c46 | [
"MIT"
] | 14 | 2020-09-18T02:56:53.000Z | 2022-03-16T00:31:12.000Z | util/utils.py | tanghaotommy/Self-supervised-Fewshot-Medical-Image-Segmentation | 9ff8cd2421ee2f7c038d8eec15b0296b365e0c46 | [
"MIT"
] | 29 | 2020-09-13T20:00:00.000Z | 2022-02-11T00:40:00.000Z | """Util functions
Extended from original PANet code
TODO: move part of dataset configurations to data_utils
"""
import random
import torch
import numpy as np
import operator
def set_seed(seed):
"""
Set the random seed
"""
random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed_all(seed... | 27.722689 | 102 | 0.585935 |
b625f6558f2741b2b169d86562822285a1812346 | 289 | py | Python | social/admin.py | ayushnanda21/Zingster | f23e9900b772c2e46f9ea4434a1266daa129b16b | [
"MIT"
] | 3 | 2021-05-11T16:31:34.000Z | 2022-03-08T05:54:30.000Z | social/admin.py | ayushnanda21/Zingster | f23e9900b772c2e46f9ea4434a1266daa129b16b | [
"MIT"
] | null | null | null | social/admin.py | ayushnanda21/Zingster | f23e9900b772c2e46f9ea4434a1266daa129b16b | [
"MIT"
] | 1 | 2021-10-09T18:35:48.000Z | 2021-10-09T18:35:48.000Z | from django.contrib import admin
from . models import Post,UserProfile,Notification,Comment,ThreadModel
# Register your models here.
admin.site.register(Post)
admin.site.register(UserProfile)
admin.site.register(Comment)
admin.site.register(Notification)
admin.site.register(ThreadModel) | 28.9 | 70 | 0.83391 |
b626f7b18fa5d92ee89efc8f742da215c496b617 | 663 | py | Python | src/my_project/medium_problems/from1to50/final_prices_with_special_discount_shop.py | ivan1016017/LeetCodeAlgorithmProblems | 454284b76634cc34ed41f7fa30d857403cedf1bf | [
"MIT"
] | null | null | null | src/my_project/medium_problems/from1to50/final_prices_with_special_discount_shop.py | ivan1016017/LeetCodeAlgorithmProblems | 454284b76634cc34ed41f7fa30d857403cedf1bf | [
"MIT"
] | 1 | 2021-09-22T12:26:14.000Z | 2021-09-22T12:26:14.000Z | src/my_project/medium_problems/from1to50/final_prices_with_special_discount_shop.py | ivan1016017/LeetCodeAlgorithmProblems | 454284b76634cc34ed41f7fa30d857403cedf1bf | [
"MIT"
] | null | null | null | from typing import List
solution = Solution()
print(solution.finalPrices(prices = [1,2,3,4,5])) | 26.52 | 58 | 0.503771 |
b627c5785e80c08378e3b966c7612558816085f7 | 23,226 | py | Python | gammapy/estimators/ts_map.py | vikasj78/gammapy | 46deb872bbcbf36748df71e659dc3fa592f6dc27 | [
"BSD-3-Clause"
] | null | null | null | gammapy/estimators/ts_map.py | vikasj78/gammapy | 46deb872bbcbf36748df71e659dc3fa592f6dc27 | [
"BSD-3-Clause"
] | null | null | null | gammapy/estimators/ts_map.py | vikasj78/gammapy | 46deb872bbcbf36748df71e659dc3fa592f6dc27 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Functions to compute TS images."""
import functools
import logging
import warnings
import numpy as np
import scipy.optimize
from astropy.coordinates import Angle
from gammapy.datasets.map import MapEvaluator
from gammapy.maps import Map, WcsGeom
from ga... | 31.514247 | 94 | 0.592267 |
b62a365f11a3573b0d239a3c19cd065df9a235b5 | 1,048 | py | Python | tests/middleware/test_secure_headers_middleware.py | Abeautifulsnow/masonite | f0ebb5ca05f5d88f21264e1cd0934435bd0a8791 | [
"MIT"
] | 1 | 2022-02-24T06:21:18.000Z | 2022-02-24T06:21:18.000Z | tests/middleware/test_secure_headers_middleware.py | Abeautifulsnow/masonite | f0ebb5ca05f5d88f21264e1cd0934435bd0a8791 | [
"MIT"
] | 1 | 2020-10-26T12:33:05.000Z | 2020-10-26T12:33:05.000Z | tests/middleware/test_secure_headers_middleware.py | Abeautifulsnow/masonite | f0ebb5ca05f5d88f21264e1cd0934435bd0a8791 | [
"MIT"
] | null | null | null | """ Test Secure Headers Midddleware """
from src.masonite.middleware import SecureHeadersMiddleware
from src.masonite.request import Request
from src.masonite.testing import TestCase, generate_wsgi
| 40.307692 | 113 | 0.73187 |
b62a7fea18f8f4556139383b37d4d565e04f0ab2 | 2,195 | py | Python | reporter/factories/slack.py | itsdkey/workreporter | daea921a03f4798c9acd689fc9bc6010e72cf886 | [
"MIT"
] | null | null | null | reporter/factories/slack.py | itsdkey/workreporter | daea921a03f4798c9acd689fc9bc6010e72cf886 | [
"MIT"
] | 21 | 2020-04-04T11:08:20.000Z | 2021-01-29T07:58:40.000Z | reporter/factories/slack.py | itsdkey/workreporter | daea921a03f4798c9acd689fc9bc6010e72cf886 | [
"MIT"
] | null | null | null | import string
from factory import Dict, DictFactory, Faker, List
from factory.fuzzy import FuzzyChoice, FuzzyText
from reporter.apps import __version__
| 24.662921 | 83 | 0.569021 |
b62c2361b51ddd55b0ad6546bce400043a91ee1a | 362 | py | Python | tests/test_generator.py | skalarsystems/fhir-zeug | 19973438823c41247e3efb5b1d35e8942ae01fdb | [
"Apache-2.0"
] | 10 | 2020-04-23T18:13:13.000Z | 2020-11-25T07:45:26.000Z | tests/test_generator.py | skalarsystems/fhir-zeug | 19973438823c41247e3efb5b1d35e8942ae01fdb | [
"Apache-2.0"
] | 71 | 2020-05-20T09:11:22.000Z | 2020-10-26T14:01:03.000Z | tests/test_generator.py | skalarsystems/fhir-zeug | 19973438823c41247e3efb5b1d35e8942ae01fdb | [
"Apache-2.0"
] | 1 | 2020-06-03T11:55:47.000Z | 2020-06-03T11:55:47.000Z | from pathlib import Path
from fhirzeug.generator import generate
from fhirzeug.fhirspec import FHIRSpec
| 30.166667 | 69 | 0.787293 |
b62c3785b8faee0ef4f6c5a2aca7da2f7a1f610d | 4,040 | py | Python | pybrain/inspect_ops.py | Kevinfu510/TridentFrame | 9766b3642ad065662ca428212bfe3f3dca25139d | [
"MIT"
] | null | null | null | pybrain/inspect_ops.py | Kevinfu510/TridentFrame | 9766b3642ad065662ca428212bfe3f3dca25139d | [
"MIT"
] | null | null | null | pybrain/inspect_ops.py | Kevinfu510/TridentFrame | 9766b3642ad065662ca428212bfe3f3dca25139d | [
"MIT"
] | null | null | null | import os
import string
import math
from random import choices
from pprint import pprint
from urllib.parse import urlparse
from PIL import Image
from apng import APNG
from colorama import init, deinit
from hurry.filesize import size, alternative
from .config import IMG_EXTS, STATIC_IMG_EXTS, ANIMATED_IMG_EXTS
def _... | 35.752212 | 107 | 0.630446 |
b62dc7b9f4a6677f9a7cc3ff035bfd06aa2b42eb | 468 | py | Python | mlrun/data_types/__init__.py | yanburman/mlrun | f6d2bb1d99d163ab47774f15b86008bfd76f6ba1 | [
"Apache-2.0"
] | null | null | null | mlrun/data_types/__init__.py | yanburman/mlrun | f6d2bb1d99d163ab47774f15b86008bfd76f6ba1 | [
"Apache-2.0"
] | null | null | null | mlrun/data_types/__init__.py | yanburman/mlrun | f6d2bb1d99d163ab47774f15b86008bfd76f6ba1 | [
"Apache-2.0"
] | null | null | null | # flake8: noqa - this is until we take care of the F401 violations with respect to __all__ & sphinx
from .data_types import ValueType, pd_schema_to_value_type, InferOptions
from .infer import DFDataInfer
| 24.631579 | 100 | 0.737179 |
b62e3b273084a90d44d9b735364ee439b8417ee2 | 164 | py | Python | code/abc117_c_01.py | KoyanagiHitoshi/AtCoder | 731892543769b5df15254e1f32b756190378d292 | [
"MIT"
] | 3 | 2019-08-16T16:55:48.000Z | 2021-04-11T10:21:40.000Z | code/abc117_c_01.py | KoyanagiHitoshi/AtCoder | 731892543769b5df15254e1f32b756190378d292 | [
"MIT"
] | null | null | null | code/abc117_c_01.py | KoyanagiHitoshi/AtCoder | 731892543769b5df15254e1f32b756190378d292 | [
"MIT"
] | null | null | null | N,M=map(int,input().split())
X=sorted(set(list(map(int,input().split()))))
s=[]
for i in range(M-1):
s.append(X[i+1]-X[i])
s=sorted(s)[::-1]
print(sum(s[N-1:])) | 23.428571 | 45 | 0.573171 |
b62e64b939d1bd9c03a4b5b970f6b1625a5fffd7 | 7,942 | py | Python | sanity_test.py | C2SM/clim-sanity-checker | 3d5d610b16ca7e87c841ef7ad06a94d0399b4773 | [
"MIT"
] | null | null | null | sanity_test.py | C2SM/clim-sanity-checker | 3d5d610b16ca7e87c841ef7ad06a94d0399b4773 | [
"MIT"
] | 3 | 2021-07-29T11:26:20.000Z | 2021-07-29T16:01:54.000Z | sanity_test.py | C2SM/clim-sanity-checker | 3d5d610b16ca7e87c841ef7ad06a94d0399b4773 | [
"MIT"
] | null | null | null | # standard modules
import argparse
import os
# aliased standard modules
import pandas as pd
# modules of sanity checker
import add_exp_to_ref
import lib.paths as paths
import lib.utils as utils
import perform_test
import process_data
import lib.logger_config as logger_config
import lib.test_config as test_config
# a... | 33.510549 | 78 | 0.559179 |
b62f88e0203b50c17277370c79cdacb1a42f5adc | 181 | py | Python | Statistics/Mean.py | Ra654/Stats-Calculator | 039ecaba3f8bb3ef69bb29e27f9c32d0fe2096b0 | [
"MIT"
] | null | null | null | Statistics/Mean.py | Ra654/Stats-Calculator | 039ecaba3f8bb3ef69bb29e27f9c32d0fe2096b0 | [
"MIT"
] | null | null | null | Statistics/Mean.py | Ra654/Stats-Calculator | 039ecaba3f8bb3ef69bb29e27f9c32d0fe2096b0 | [
"MIT"
] | null | null | null | from Calculator.Addition import addition
from Calculator.Division import division
| 13.923077 | 40 | 0.718232 |
b62fba3135ecc22de76c3d70195022e9172fe712 | 144 | py | Python | notion2md/color.py | The-Soloist/notion2md | 1fb35b7798b273a89a4d280cd1a86b9cf9de88d5 | [
"MIT"
] | null | null | null | notion2md/color.py | The-Soloist/notion2md | 1fb35b7798b273a89a4d280cd1a86b9cf9de88d5 | [
"MIT"
] | null | null | null | notion2md/color.py | The-Soloist/notion2md | 1fb35b7798b273a89a4d280cd1a86b9cf9de88d5 | [
"MIT"
] | null | null | null | black = "\033[1;30m"
red = "\033[1;31m"
green = "\033[01;32m"
yellow = "\033[01;33m"
blue = "\033[01;34m"
white = "\033[01;37m"
end = "\033[0m"
| 18 | 22 | 0.569444 |
b62ff9e5eec8b6d69d6eaf98f80cfd17b261bf8f | 253,617 | py | Python | src/MSI/optimization/matrix_loader.py | carlylagrotta/MSI | e958beb5df2a2d1018bbb2f96382b5c99b08c3ef | [
"MIT"
] | 1 | 2021-06-25T15:46:06.000Z | 2021-06-25T15:46:06.000Z | src/MSI/optimization/matrix_loader.py | TheBurkeLab/MSI | e958beb5df2a2d1018bbb2f96382b5c99b08c3ef | [
"MIT"
] | null | null | null | src/MSI/optimization/matrix_loader.py | TheBurkeLab/MSI | e958beb5df2a2d1018bbb2f96382b5c99b08c3ef | [
"MIT"
] | 2 | 2019-12-18T23:45:25.000Z | 2021-06-10T20:37:20.000Z | import numpy as np
import pandas as pd
from ..master_equation import master_equation as meq
#import MSI.master_equation.master_equation as meq
import copy
import re
import cantera as ct
... | 62.590573 | 375 | 0.541718 |
b630cb3736e98a7c40bd2693a526558233a1f22d | 745 | py | Python | meiduo_mall/meiduo_mall/utils/authenticate.py | yuluo0809/meiduo | 384935ee44bbbfa82314363ae0b886ca0a5ca70e | [
"MIT"
] | null | null | null | meiduo_mall/meiduo_mall/utils/authenticate.py | yuluo0809/meiduo | 384935ee44bbbfa82314363ae0b886ca0a5ca70e | [
"MIT"
] | null | null | null | meiduo_mall/meiduo_mall/utils/authenticate.py | yuluo0809/meiduo | 384935ee44bbbfa82314363ae0b886ca0a5ca70e | [
"MIT"
] | null | null | null | from django.contrib.auth.backends import ModelBackend
import re
from users.models import User
from django.db.models import Q
| 32.391304 | 97 | 0.591946 |
b6353c0bdb47d9dde56dcc48c5df873e0f1636bc | 1,278 | py | Python | api/rqst_getter.py | Maziar110/api_client_test | 52e5a2ffb0b46be71f34452132b13e5e941ae327 | [
"MIT"
] | null | null | null | api/rqst_getter.py | Maziar110/api_client_test | 52e5a2ffb0b46be71f34452132b13e5e941ae327 | [
"MIT"
] | null | null | null | api/rqst_getter.py | Maziar110/api_client_test | 52e5a2ffb0b46be71f34452132b13e5e941ae327 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from flask import Flask, request
from datetime import datetime
from flask_opentracing import FlaskTracing
from jaeger_client import Config
app = Flask(__name__)
config = Config(config=
{
'sampler': {'type': 'const', 'param': 1},
'local_agent':
{'reporting_host': '172.2.1.5'}
},
... | 22.034483 | 57 | 0.618153 |
b635f0d40cb3101837e75e9dc809c6fe5a254ffe | 149 | py | Python | problems/0493/compute.py | Dynortice/Project-Euler | 99a0201b5d5f147eab77fc52d9db8995045cded0 | [
"MIT"
] | null | null | null | problems/0493/compute.py | Dynortice/Project-Euler | 99a0201b5d5f147eab77fc52d9db8995045cded0 | [
"MIT"
] | null | null | null | problems/0493/compute.py | Dynortice/Project-Euler | 99a0201b5d5f147eab77fc52d9db8995045cded0 | [
"MIT"
] | null | null | null | from math import prod
| 24.833333 | 86 | 0.530201 |
b636dd98793502ba5f717594cef6b13dafcec083 | 799 | py | Python | packages/core/minos-microservice-common/tests/test_common/test_model/test_abc.py | sorasful/minos-python | 1189330eebf6444627a2af6b29f347670f95a4dd | [
"MIT"
] | 247 | 2022-01-24T14:55:30.000Z | 2022-03-25T12:06:17.000Z | packages/core/minos-microservice-common/tests/test_common/test_model/test_abc.py | sorasful/minos-python | 1189330eebf6444627a2af6b29f347670f95a4dd | [
"MIT"
] | 400 | 2021-04-03T08:51:40.000Z | 2022-01-28T11:51:22.000Z | packages/core/minos-microservice-common/tests/test_common/test_model/test_abc.py | sorasful/minos-python | 1189330eebf6444627a2af6b29f347670f95a4dd | [
"MIT"
] | 21 | 2022-02-06T17:25:58.000Z | 2022-03-27T04:50:29.000Z | import unittest
from collections.abc import (
Mapping,
)
from uuid import (
UUID,
uuid4,
)
from minos.common import (
DeclarativeModel,
Field,
Model,
)
from tests.model_classes import (
FooBar,
)
if __name__ == "__main__":
unittest.main()
| 19.487805 | 87 | 0.628285 |
b63706705437012c6dcf007e355dcfa0951e03d3 | 7,197 | py | Python | twitterBattleGame/twitterbattlegame.py | ferrithemaker/makertrends-twitter | 6055a2437cf567f14aa513a906615488f7c35549 | [
"MIT"
] | null | null | null | twitterBattleGame/twitterbattlegame.py | ferrithemaker/makertrends-twitter | 6055a2437cf567f14aa513a906615488f7c35549 | [
"MIT"
] | null | null | null | twitterBattleGame/twitterbattlegame.py | ferrithemaker/makertrends-twitter | 6055a2437cf567f14aa513a906615488f7c35549 | [
"MIT"
] | null | null | null | from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
import json
import threading
import sys
import pygame
import os
if len(sys.argv) == 3:
search_strings = [sys.argv[1],sys.argv[2]]
else:
print("Usage: twitterbattlegame.py [TREND1_STRING] [TREND2_STRING]")
sys.exit... | 25.888489 | 87 | 0.725163 |
b6391b49ca6fcd9413c9bf008da249b350c2a41b | 568 | py | Python | am_instapound_backend/pictures/api/permissions.py | eryknn/am-instapound-backend | b7114ce323229e92b2770403cb72886726a461ef | [
"MIT"
] | null | null | null | am_instapound_backend/pictures/api/permissions.py | eryknn/am-instapound-backend | b7114ce323229e92b2770403cb72886726a461ef | [
"MIT"
] | null | null | null | am_instapound_backend/pictures/api/permissions.py | eryknn/am-instapound-backend | b7114ce323229e92b2770403cb72886726a461ef | [
"MIT"
] | null | null | null | from rest_framework import permissions
| 28.4 | 79 | 0.730634 |
b63a56f5ac4eb798614b96efdd9374c1833b3b4f | 5,597 | py | Python | focus/PhaseretrievalresultsTinyTim.py | sniemi/SamPy | e048756feca67197cf5f995afd7d75d8286e017b | [
"BSD-2-Clause"
] | 5 | 2016-05-28T14:12:28.000Z | 2021-04-22T10:23:12.000Z | focus/PhaseretrievalresultsTinyTim.py | sniemi/SamPy | e048756feca67197cf5f995afd7d75d8286e017b | [
"BSD-2-Clause"
] | null | null | null | focus/PhaseretrievalresultsTinyTim.py | sniemi/SamPy | e048756feca67197cf5f995afd7d75d8286e017b | [
"BSD-2-Clause"
] | 2 | 2015-07-13T10:04:10.000Z | 2021-04-22T10:23:23.000Z | """
TinyTim model PSF phase retrieval results.
HISTORY:
Created on March 3, 2011
:author: Sami-Matias Niemi
:contact: niemi@stsci.edu
:version: 0.1
"""
import matplotlib
matplotlib.use('PDF')
import pylab as P
import glob as G
import numpy as N
import os
from matplotlib import cm
import SamPy.focus.phaseretrievalres... | 31.44382 | 98 | 0.516527 |
b63aa4a552b83a7cbc88ec12fcd658dfebd4cd02 | 9,346 | py | Python | reachyAudio/reachyAudioAnswering.py | sizingservers/ReachyAudio | af91ed57015d693cc942620495541b482728a513 | [
"MIT"
] | 3 | 2021-04-28T15:16:50.000Z | 2021-11-01T17:36:09.000Z | reachyAudio/reachyAudioAnswering.py | sizingservers/Reachy.Audio | 7e515459b72f2bdc05ee73f159d6bcaaabaef6f5 | [
"MIT"
] | null | null | null | reachyAudio/reachyAudioAnswering.py | sizingservers/Reachy.Audio | 7e515459b72f2bdc05ee73f159d6bcaaabaef6f5 | [
"MIT"
] | 2 | 2021-11-22T13:43:37.000Z | 2022-03-03T09:44:16.000Z | """This module defines the ReachyAudioAnswering class."""
import nltk
import json
import torch
import random
import pickle
from nltk.stem.lancaster import LancasterStemmer
stemmer = LancasterStemmer()
CONFIDENCE_THRESHOLD = 0.7
| 39.770213 | 80 | 0.581639 |
b63abdbbcdf468494ec4d6e1649a366257180326 | 4,937 | py | Python | mlp/mlp.py | sovrasov/mlp_sample | c27aa4893960e3531fb3135148a26fdf75a2f1d2 | [
"MIT"
] | null | null | null | mlp/mlp.py | sovrasov/mlp_sample | c27aa4893960e3531fb3135148a26fdf75a2f1d2 | [
"MIT"
] | null | null | null | mlp/mlp.py | sovrasov/mlp_sample | c27aa4893960e3531fb3135148a26fdf75a2f1d2 | [
"MIT"
] | null | null | null | import numpy as np
| 38.570313 | 133 | 0.567956 |
b63d8c3c7c6fd356106b5b059b25964eee3e6080 | 4,858 | py | Python | cap/path.py | ArashLab/CAP | 9e6d413e000ebfcade3020985fdedd9aa703d68a | [
"MIT"
] | null | null | null | cap/path.py | ArashLab/CAP | 9e6d413e000ebfcade3020985fdedd9aa703d68a | [
"MIT"
] | 8 | 2021-06-24T06:08:27.000Z | 2021-07-22T03:47:11.000Z | cap/path.py | ArashLab/CAP | 9e6d413e000ebfcade3020985fdedd9aa703d68a | [
"MIT"
] | null | null | null | import os
import subprocess
from munch import Munch
from .logutil import *
from .decorators import *
if __name__ == '__main__':
print('This module is not executable.')
exit(0)
FileSystems = [
'file',
'hdfs',
's3',
'gs',
'mysql',
'http',
'https'
]
# If a path could match more th... | 27.446328 | 132 | 0.550638 |
b63dbaf072cedc88a4143c750b428be483d16342 | 2,115 | py | Python | docdown/media.py | Mobelux/DocDown-Python | 7f6270dfe17678cc0f2e899f9665342a0784cffb | [
"BSD-3-Clause"
] | 1 | 2016-12-13T19:37:20.000Z | 2016-12-13T19:37:20.000Z | docdown/media.py | Mobelux/DocDown-Python | 7f6270dfe17678cc0f2e899f9665342a0784cffb | [
"BSD-3-Clause"
] | 2 | 2021-04-20T13:52:15.000Z | 2021-04-26T16:26:24.000Z | docdown/media.py | Mobelux/DocDown-Python | 7f6270dfe17678cc0f2e899f9665342a0784cffb | [
"BSD-3-Clause"
] | 4 | 2017-05-21T12:59:09.000Z | 2021-04-19T17:41:32.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals, print_function
from markdown.treeprocessors import Treeprocessor
from markdown.extensions import Extension
def makeExtension(*args, **kwargs):
return MediaExtension(*args, **kwargs)
| 39.166667 | 112 | 0.597636 |
b63f2d5649a160a388ae34356632cd2b5e280e3f | 2,275 | py | Python | kymatio/phaseexp1d/pyscatwave/scatwave/scattering1d/examples/synthetic.py | sixin-zh/kymatio_wph | 237c0d2009766cf83b2145420a14d3c6e90dc983 | [
"BSD-3-Clause"
] | null | null | null | kymatio/phaseexp1d/pyscatwave/scatwave/scattering1d/examples/synthetic.py | sixin-zh/kymatio_wph | 237c0d2009766cf83b2145420a14d3c6e90dc983 | [
"BSD-3-Clause"
] | null | null | null | kymatio/phaseexp1d/pyscatwave/scatwave/scattering1d/examples/synthetic.py | sixin-zh/kymatio_wph | 237c0d2009766cf83b2145420a14d3c6e90dc983 | [
"BSD-3-Clause"
] | null | null | null | import torch
from torch.autograd import Variable
from scatwave import Scattering1D
import matplotlib.pyplot as plt
import numpy as np
from sklearn.utils import check_random_state
def generate_harmonic_signal(T, num_intervals=4, gamma=0.9, random_state=42):
"""
Generates a harmonic signal, which is made of pie... | 32.971014 | 77 | 0.638681 |
b640cb56865053f7246a487959ec18a980db1340 | 1,823 | py | Python | main.py | Vivektp/Image-UploadBot-1 | 01d70d4425d082639e46d954d0b900d478ad29c9 | [
"MIT"
] | null | null | null | main.py | Vivektp/Image-UploadBot-1 | 01d70d4425d082639e46d954d0b900d478ad29c9 | [
"MIT"
] | null | null | null | main.py | Vivektp/Image-UploadBot-1 | 01d70d4425d082639e46d954d0b900d478ad29c9 | [
"MIT"
] | 1 | 2021-01-07T02:26:26.000Z | 2021-01-07T02:26:26.000Z | from pyrogram import Client, filters
import os, shutil
from creds import my
from telegraph import upload_file
import logging
logging.basicConfig(level=logging.INFO)
TGraph = Client(
"Image upload bot",
bot_token = my.BOT_TOKEN,
api_id = my.API_ID,
api_hash = my.API_HASH
)
... | 37.204082 | 302 | 0.64893 |
b64465faae2a9d77dbcd14ac084106824ac896e5 | 1,237 | py | Python | action-server/covidflow/utils/geocoding.py | nuecho/covidflow | 050665c629ea46bfebc0920ba1dba841c2268d08 | [
"MIT"
] | 7 | 2020-05-23T07:07:26.000Z | 2021-11-29T05:58:51.000Z | action-server/covidflow/utils/geocoding.py | dialoguemd/covidflow | b159b76dc68462f272614db4cbf716844872ebca | [
"MIT"
] | 210 | 2020-04-13T17:21:55.000Z | 2021-04-20T15:46:26.000Z | action-server/covidflow/utils/geocoding.py | dialoguemd/covidflow | b159b76dc68462f272614db4cbf716844872ebca | [
"MIT"
] | 3 | 2020-04-09T14:38:09.000Z | 2020-07-29T15:06:11.000Z | import os
from typing import Any, Dict, Optional
import googlemaps
import structlog
from geopy.point import Point
logger = structlog.get_logger()
DEFAULT_COUNTRY = "CA"
GOOGLE_API_KEY_ENV = "GOOGLE_GEOCODING_API_KEY"
GEOMETRY = "geometry"
LOCATION = "location"
LATITUDE = "lat"
LONGITUDE = "lng"
| 26.319149 | 82 | 0.669361 |
b646b8cf155b631e43329c320bbdd520d22b745c | 5,319 | py | Python | calculadora.py | WelberthyGustavo/Calculadora | 2d01dba2db06796c8d237302f3ad024c8be359ea | [
"MIT"
] | 4 | 2020-04-21T01:42:30.000Z | 2020-10-26T01:59:33.000Z | calculadora.py | WelberthyGustavo/Calculadora | 2d01dba2db06796c8d237302f3ad024c8be359ea | [
"MIT"
] | null | null | null | calculadora.py | WelberthyGustavo/Calculadora | 2d01dba2db06796c8d237302f3ad024c8be359ea | [
"MIT"
] | null | null | null | from functools import partial
from tkinter import *
#program by~ Welberthy Gustavo Developer
janela = Tk()
janela.title('Calculadora')
janela.iconbitmap('calculadoraProject/cal.ico')
janela['bg'] = 'gainsboro'
janela.geometry('400x450+400+100')
janela.resizable(0,0)
lbl = Labe... | 29.065574 | 121 | 0.588644 |
b6473eeb720250834546c75004a0f9e6557be8db | 1,928 | py | Python | fastfood/exc.py | enterstudio/fastfood | 6e18500b2d08698f6fa8d9d54daee6aa78f9efd0 | [
"Apache-2.0"
] | null | null | null | fastfood/exc.py | enterstudio/fastfood | 6e18500b2d08698f6fa8d9d54daee6aa78f9efd0 | [
"Apache-2.0"
] | null | null | null | fastfood/exc.py | enterstudio/fastfood | 6e18500b2d08698f6fa8d9d54daee6aa78f9efd0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 26.054054 | 76 | 0.708506 |
b6476924d1d5ed2df7e1b8fbabacbac62cb195f4 | 2,320 | py | Python | script.py | Freakwill/nb-combination | 716227ba22f6c0c404898a00c18362a41ae3c701 | [
"MIT"
] | null | null | null | script.py | Freakwill/nb-combination | 716227ba22f6c0c404898a00c18362a41ae3c701 | [
"MIT"
] | null | null | null | script.py | Freakwill/nb-combination | 716227ba22f6c0c404898a00c18362a41ae3c701 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from nb_comb import *
from sklearn.naive_bayes import *
from sklearn.tree import *
from sklearn.neural_network import *
from sklearn.model_selection import *
import pandas as pd
data = pd.read_csv('dataset.csv', index_col=0)
X, Y = data.iloc[:, :-1], data.iloc[:, -1].va... | 31.351351 | 152 | 0.64181 |
b648270cc7e72988968f45c3ecb5aa68300d62b6 | 397 | py | Python | Python/concatenation.py | aaavinash85/Python | cd58606f6f01c9bdccffb58e0f73825958679125 | [
"MIT"
] | null | null | null | Python/concatenation.py | aaavinash85/Python | cd58606f6f01c9bdccffb58e0f73825958679125 | [
"MIT"
] | null | null | null | Python/concatenation.py | aaavinash85/Python | cd58606f6f01c9bdccffb58e0f73825958679125 | [
"MIT"
] | null | null | null | name='avi'
print(name)
#name[0]='k' here this results in a error because strings are immutable
last_letters=name[1:]
print(last_letters)
print('k'+last_letters) #here is the string concateation
#here we replaced 'a' with 'k'
lname='koshal'
print("the concated string=",'Avinash'+ ln... | 33.083333 | 83 | 0.642317 |
b649d55b955af3b2e169f07a8038551b9e42e9ff | 17,165 | py | Python | placer/placer_lib_test.py | beomyeol/baechi | 796dd45f6db6eb11bb2fba2acfd56f51da024df8 | [
"NCSA"
] | 4 | 2020-09-27T01:32:23.000Z | 2022-03-06T22:49:19.000Z | placer/placer_lib_test.py | beomyeol/baechi | 796dd45f6db6eb11bb2fba2acfd56f51da024df8 | [
"NCSA"
] | null | null | null | placer/placer_lib_test.py | beomyeol/baechi | 796dd45f6db6eb11bb2fba2acfd56f51da024df8 | [
"NCSA"
] | 1 | 2021-11-15T06:36:29.000Z | 2021-11-15T06:36:29.000Z | # Copyright 2020 University of Illinois Board of Trustees. All Rights Reserved.
# Author: Beomyeol Jeon, DPRG (https://dprg.cs.uiuc.edu)
# This file is part of Baechi, which is released under specific terms. See file License.txt file for full license details.
# ==========================================================... | 45.651596 | 122 | 0.55887 |
b64a9935e9810f6c5f1a61a7b125688afb12a906 | 3,073 | py | Python | corehq/blobs/tests/test_export.py | roboton/commcare-hq | 3ccbe59508d98dd1963ca87cf249dd2df8af8ecc | [
"BSD-3-Clause"
] | null | null | null | corehq/blobs/tests/test_export.py | roboton/commcare-hq | 3ccbe59508d98dd1963ca87cf249dd2df8af8ecc | [
"BSD-3-Clause"
] | 1 | 2021-06-02T04:45:16.000Z | 2021-06-02T04:45:16.000Z | corehq/blobs/tests/test_export.py | roboton/commcare-hq | 3ccbe59508d98dd1963ca87cf249dd2df8af8ecc | [
"BSD-3-Clause"
] | null | null | null | import os
import uuid
from io import BytesIO
from tempfile import NamedTemporaryFile
from zipfile import ZipFile
from django.test import TestCase
from corehq.apps.hqmedia.models import CommCareAudio, CommCareVideo, CommCareImage
from corehq.blobs import CODES, get_blob_db
from corehq.blobs.export import EXPORTERS
fro... | 37.024096 | 99 | 0.617312 |
b64f13ebbb17fadf2e674f33e8566118f8aa3dfa | 922 | py | Python | telescope/utils/annotation.py | froy0212/telescope | 05f6f058d8106c86cb4eb62239800ab2261eaaad | [
"MIT"
] | 25 | 2019-05-31T23:27:56.000Z | 2022-03-11T07:43:59.000Z | telescope/utils/annotation.py | jianguozhouzunyimedicaluniversity/telescope | 6cd55256c6016feffdbfe10346bfecfcb1e30965 | [
"MIT"
] | 24 | 2018-12-10T16:44:59.000Z | 2022-03-20T19:58:37.000Z | telescope/utils/annotation.py | jianguozhouzunyimedicaluniversity/telescope | 6cd55256c6016feffdbfe10346bfecfcb1e30965 | [
"MIT"
] | 8 | 2019-09-04T13:45:08.000Z | 2022-03-15T15:57:22.000Z | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import absolute_import
__author__ = 'Matthew L. Bendall'
__copyright__ = "Copyright (C) 2019 Matthew L. Bendall"
def get_annotation_class(annotation_class_name):
""" Get Annotation class matching provided name
Args:
annotat... | 34.148148 | 75 | 0.719089 |
b64f934d0ea49d49f24b9f5e245749b3e6460dfb | 6,012 | py | Python | web/frontend/views/config.py | tcsvn/activity-assistant | eeb0ef72a046a8a781ff31b384edec8243dd22a7 | [
"MIT"
] | 45 | 2020-11-06T20:31:13.000Z | 2022-03-24T06:14:18.000Z | web/frontend/views/config.py | tcsvn/activity-assistant | eeb0ef72a046a8a781ff31b384edec8243dd22a7 | [
"MIT"
] | 10 | 2020-12-14T00:17:11.000Z | 2022-02-06T19:39:01.000Z | web/frontend/views/config.py | tcsvn/activity-assistant | eeb0ef72a046a8a781ff31b384edec8243dd22a7 | [
"MIT"
] | 3 | 2020-12-15T22:50:09.000Z | 2022-03-13T21:12:28.000Z | from backend.models import *
from django.views.generic import TemplateView
from django.shortcuts import render, redirect
import os
import hass_api.rest as hass_rest
from frontend.util import get_server, refresh_hass_token, \
get_device_names, get_activity_names, get_person_hass_names, \
get_person_names, input... | 33.966102 | 83 | 0.614604 |
b650cf8f96e44c66b3acac463da66cefb0635f96 | 1,843 | py | Python | File System/main.py | IRIDIUM-SUB/Sys_Course_Design | 52ec96378e9f9c8d7dc366efcba154df3f1cbc67 | [
"MIT"
] | null | null | null | File System/main.py | IRIDIUM-SUB/Sys_Course_Design | 52ec96378e9f9c8d7dc366efcba154df3f1cbc67 | [
"MIT"
] | null | null | null | File System/main.py | IRIDIUM-SUB/Sys_Course_Design | 52ec96378e9f9c8d7dc366efcba154df3f1cbc67 | [
"MIT"
] | null | null | null | import os
from toolbox import *
import pickle
import logging
import commandresolve
def console(data:dict,logger):
'''
Main console program
'''
consoleobj=commandresolve.commandresolve(data,logger)
flag=True# to mark if it is time to exit
while (flag):
rawcommand=input(">")
flag=c... | 26.710145 | 79 | 0.62344 |
b6511db93d9ed485759c7b0e96ca84109e977890 | 1,428 | py | Python | benchmarks/evaluate.py | benetech/Winnow2.0 | bc428d7f74bd7db71b6d70ab15dc7a5c37786c46 | [
"MIT"
] | 26 | 2019-12-16T21:22:14.000Z | 2022-03-25T16:05:32.000Z | benchmarks/evaluate.py | benetech/Winnow2.0 | bc428d7f74bd7db71b6d70ab15dc7a5c37786c46 | [
"MIT"
] | 325 | 2019-10-28T16:24:45.000Z | 2022-03-31T13:12:15.000Z | benchmarks/evaluate.py | benetech/Winnow2.0 | bc428d7f74bd7db71b6d70ab15dc7a5c37786c46 | [
"MIT"
] | 9 | 2019-10-09T16:20:38.000Z | 2021-12-22T18:44:45.000Z | import pandas as pd
from glob import glob
from utils import evaluate_augmented_dataset, evaluate_landmarks, evaluate_scene_detection
import os
from winnow.utils.config import resolve_config
import click
import numpy as np
import json
pd.options.mode.chained_assignment = None
if __name__ == "__main__":
main()
| 26.444444 | 106 | 0.72549 |
b6513dae72381facd289c7f1890adba74d041c52 | 393 | py | Python | generate_azn.py | brunston/enigma | 3944fade43e100f3f631e308cf70fd28242a7b26 | [
"MIT"
] | null | null | null | generate_azn.py | brunston/enigma | 3944fade43e100f3f631e308cf70fd28242a7b26 | [
"MIT"
] | null | null | null | generate_azn.py | brunston/enigma | 3944fade43e100f3f631e308cf70fd28242a7b26 | [
"MIT"
] | null | null | null | # generate a*z_n = {ax : x in z_n} for any a in z_n
# brupoon
n = int(input("Z_n (integer n)? "))
a = int(input("a for a*Z_n (integer a)?"))
z_n = []
az_n = []
for i in range(n):
# standard set z_n
z_n.append(i)
for x in range(n):
value = (a*x) % n
# find ax in z_n
az_n.append(value)
#az_n = sort... | 18.714286 | 51 | 0.572519 |
b653a28ba11c9bc2e835fdedaf5686ad56584df6 | 909 | py | Python | Symmetric/Stream-Cipher/LFSR/script.py | killua4564/Symmetric | 183ea2ec1d1342e9124e710a2de0fcad8b399f3d | [
"MIT"
] | 1 | 2021-05-05T14:03:10.000Z | 2021-05-05T14:03:10.000Z | Symmetric/Stream-Cipher/LFSR/script.py | killua4564/Symmetric | 183ea2ec1d1342e9124e710a2de0fcad8b399f3d | [
"MIT"
] | null | null | null | Symmetric/Stream-Cipher/LFSR/script.py | killua4564/Symmetric | 183ea2ec1d1342e9124e710a2de0fcad8b399f3d | [
"MIT"
] | null | null | null | from itertools import combinations
register = list(map(int, ('{:08b}'.format(i ^ j) for i, j in zip(b'flag', flag_enc))))
print('register: ', register)
for i in combinations(list(range(16)), 5):
lfsr = LFSR(register[:16], list(i))
if all(bit == lfsr.next() for bit in register):
taps = list(i)
... | 24.567568 | 86 | 0.583058 |
b653fd0336b468f5a851d3b61d250feb356b48bb | 39,571 | py | Python | _build/jupyter_execute/lectures/lecture4.py | hfboyce/tableau_course | 1480600c711bfa91d2169e999bbf194dd0332088 | [
"MIT"
] | null | null | null | _build/jupyter_execute/lectures/lecture4.py | hfboyce/tableau_course | 1480600c711bfa91d2169e999bbf194dd0332088 | [
"MIT"
] | null | null | null | _build/jupyter_execute/lectures/lecture4.py | hfboyce/tableau_course | 1480600c711bfa91d2169e999bbf194dd0332088 | [
"MIT"
] | null | null | null | # SVM with RBF Kernel and Feature Preprocessing
*Hayley Boyce, April 28th 2021*
# Importing our libraries
import pandas as pd
import altair as alt
import numpy as np
from sklearn.tree import DecisionTreeClassifier
from sklearn.dummy import DummyClassifier, DummyRegressor
from sklearn.neighbors import KNeighborsClassi... | 38.795098 | 354 | 0.753329 |
b6547eff1c540120f338f2f7ef9eb6aa040c4692 | 169 | py | Python | HomeWork7.18.py | TiAmolj/Python-By-Joker | df37ddfb58c40d68298b4e862ba23671943de8cf | [
"Apache-2.0"
] | null | null | null | HomeWork7.18.py | TiAmolj/Python-By-Joker | df37ddfb58c40d68298b4e862ba23671943de8cf | [
"Apache-2.0"
] | null | null | null | HomeWork7.18.py | TiAmolj/Python-By-Joker | df37ddfb58c40d68298b4e862ba23671943de8cf | [
"Apache-2.0"
] | null | null | null | # 1
import math
r = float(input(''))
s = 2*r*(math.sin(math.pi/5))
Area = 5*s*s/(4*math.tan(math.pi/5))
print('The area of the pentagon is %.2f'%Area) | 28.166667 | 46 | 0.633136 |
b656698542559160e5320731eda58e8762740f15 | 20,918 | py | Python | app/models.py | LianYun/xing | de0656083133ca78bdbd42c64c2fa3ce1a4fe962 | [
"MIT"
] | 2 | 2015-12-20T15:21:30.000Z | 2016-08-25T08:56:31.000Z | app/models.py | LianYun/xing | de0656083133ca78bdbd42c64c2fa3ce1a4fe962 | [
"MIT"
] | 13 | 2015-12-13T15:57:30.000Z | 2016-03-06T09:46:17.000Z | app/models.py | LianYun/xing | de0656083133ca78bdbd42c64c2fa3ce1a4fe962 | [
"MIT"
] | null | null | null | # _*_ coding: utf-8 _*_
"""
"""
from werkzeug.security import generate_password_hash, check_password_hash
from flask.ext.login import UserMixin, AnonymousUserMixin
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from flask import current_app, url_for
import datetime
from markdown import markdow... | 34.747508 | 126 | 0.563295 |
b656d9867f056795fcb0613d2497677c41ee347e | 395 | py | Python | Curso Python/PythonExercicios/ex020.py | marcos-saba/Cursos | 1c063392867e9ed86d141dad8861a2a35488b1c6 | [
"MIT"
] | null | null | null | Curso Python/PythonExercicios/ex020.py | marcos-saba/Cursos | 1c063392867e9ed86d141dad8861a2a35488b1c6 | [
"MIT"
] | null | null | null | Curso Python/PythonExercicios/ex020.py | marcos-saba/Cursos | 1c063392867e9ed86d141dad8861a2a35488b1c6 | [
"MIT"
] | null | null | null | import random
al1 = input('Digite o nome do(a) primeiro(a) aluno(a): ')
al2 = input('Digite o nome do (a) segundo(a) aluno(a): ')
al3 = input('Digite o nome do(a) terceiro(a) aluno(a): ')
al4 = input('Digite o nome do(a) quarto(a) aluno(a): ')
lista = [al1, al2, al3, al4]
random.shuffle(lista)
print(f'A ordem dos aluno... | 24.6875 | 65 | 0.665823 |
b65918d8d15e00f6bff0edc5207846f79e249686 | 3,058 | py | Python | src/python_cryptography/4.signature.py | sudeep0901/python | 7a50af12e72d21ca4cad7f2afa4c6f929552043f | [
"MIT"
] | null | null | null | src/python_cryptography/4.signature.py | sudeep0901/python | 7a50af12e72d21ca4cad7f2afa4c6f929552043f | [
"MIT"
] | 3 | 2019-12-26T05:13:55.000Z | 2020-03-07T06:59:56.000Z | src/python_cryptography/4.signature.py | sudeep0901/python | 7a50af12e72d21ca4cad7f2afa4c6f929552043f | [
"MIT"
] | null | null | null | # RSA
# RSA Tool generate private public key
from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_OAEP
from Crypto import Random
from Crypto.Hash import SHA256
import base64
from Crypto.Signature import PKCS1_PSS
# CrptyoRSA().generate_keys()
# encrypted_data = CrptyoRSA().encrypt("Hello World".encode(... | 31.854167 | 74 | 0.683126 |
b65951eb0ef82ffdc947697f22310dd635865642 | 4,122 | py | Python | src/mapping/cartographer.py | ThomasRanvier/map_maker | e36ddcc7d5959957d83fae778d8ef715c79712e7 | [
"MIT"
] | null | null | null | src/mapping/cartographer.py | ThomasRanvier/map_maker | e36ddcc7d5959957d83fae778d8ef715c79712e7 | [
"MIT"
] | null | null | null | src/mapping/cartographer.py | ThomasRanvier/map_maker | e36ddcc7d5959957d83fae778d8ef715c79712e7 | [
"MIT"
] | null | null | null | from utils.utils import bresenham_line
from math import hypot, cos, sin
from utils.position import Position
| 56.465753 | 161 | 0.63246 |
b659d814fb65cdd70ff97f52711483193c63f987 | 5,106 | py | Python | demosys/opengl/texture.py | Contraz/demosys-py | 0479e0f3b0a3901f601bffd2d11e155f97b47555 | [
"0BSD"
] | 70 | 2017-03-31T12:01:41.000Z | 2022-01-05T06:30:57.000Z | demosys/opengl/texture.py | Contraz/demosys-py | 0479e0f3b0a3901f601bffd2d11e155f97b47555 | [
"0BSD"
] | 69 | 2017-06-18T22:37:46.000Z | 2020-01-23T04:02:22.000Z | demosys/opengl/texture.py | Contraz/demosys-py | 0479e0f3b0a3901f601bffd2d11e155f97b47555 | [
"0BSD"
] | 9 | 2017-05-13T21:13:02.000Z | 2020-10-01T18:09:49.000Z | """
Draw methods for textures and depth textures
"""
import moderngl
from demosys import context, geometry
def draw_depth(self, texture, near, far, pos=(0.0, 0.0), scale=(1.0, 1.0)):
"""
Draw depth buffer linearized.
By default this will draw the texture as a full screen quad.
... | 32.316456 | 102 | 0.526244 |
b65c498fb47fab313371a80e39143108433be373 | 1,136 | py | Python | avancado/POO/metaclasses.py | Nataliaartini/cursoPython | 01dc9cafd5cef1252ca84503e7a9011bd709ef46 | [
"MIT"
] | null | null | null | avancado/POO/metaclasses.py | Nataliaartini/cursoPython | 01dc9cafd5cef1252ca84503e7a9011bd709ef46 | [
"MIT"
] | null | null | null | avancado/POO/metaclasses.py | Nataliaartini/cursoPython | 01dc9cafd5cef1252ca84503e7a9011bd709ef46 | [
"MIT"
] | null | null | null |
b = B()
b.b_fala()
print(b.attr_classe)
C = type("C", (), {"attr": "ol Mundo!"}) #nome da classe, de quem ela est herdando e o que tem nela.
c = C()
print(c.attr)
print(type(c))
| 25.818182 | 102 | 0.601232 |
b65c6b66aba642829f6360c17136a6c5c24bf822 | 1,787 | py | Python | local_telegramListener/main.py | pratijayguha/AutomatedLightingControl | 0ce3b275b2734deb1695a28e43417784184dde84 | [
"MIT"
] | null | null | null | local_telegramListener/main.py | pratijayguha/AutomatedLightingControl | 0ce3b275b2734deb1695a28e43417784184dde84 | [
"MIT"
] | null | null | null | local_telegramListener/main.py | pratijayguha/AutomatedLightingControl | 0ce3b275b2734deb1695a28e43417784184dde84 | [
"MIT"
] | null | null | null | from utils import *
from bot import telegram_chatbot
from bulb import *
bot = telegram_chatbot(CONFIG_LOCATION)
print('Initialized Bot')
bulb = bulb(IP_RANGE)
print('Connected to bulb. IP address: {}'.format(bulb.address))
while True:
updates = bot.get_updates(offset=update_id)
updates = updates["r... | 36.469388 | 113 | 0.476777 |
b65c74d6a744f8c2e4b55ae69055df5a4d973d76 | 5,365 | py | Python | engines/email_engine.py | dho-IOD/futu_algo | f4bdf5edcc261efbd252e9e9c53a89563b0ed68f | [
"Apache-2.0"
] | 66 | 2020-12-29T15:03:21.000Z | 2022-03-29T01:24:59.000Z | engines/email_engine.py | dho-IOD/futu_algo | f4bdf5edcc261efbd252e9e9c53a89563b0ed68f | [
"Apache-2.0"
] | 22 | 2020-12-29T16:57:03.000Z | 2022-03-01T08:23:37.000Z | engines/email_engine.py | dho-IOD/futu_algo | f4bdf5edcc261efbd252e9e9c53a89563b0ed68f | [
"Apache-2.0"
] | 30 | 2021-01-07T07:33:22.000Z | 2022-03-17T11:37:02.000Z | # Futu Algo: Algorithmic High-Frequency Trading Framework
#
# 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 appli... | 33.742138 | 115 | 0.569618 |
b65d709e70f3299340952e6028e59d6ffbba4e90 | 547 | py | Python | mundo_2/ex066.py | tseiiti/curso_em_video | 59565ce809c1f025fb41ab69de3b8c5b53c8f7b2 | [
"MIT"
] | null | null | null | mundo_2/ex066.py | tseiiti/curso_em_video | 59565ce809c1f025fb41ab69de3b8c5b53c8f7b2 | [
"MIT"
] | null | null | null | mundo_2/ex066.py | tseiiti/curso_em_video | 59565ce809c1f025fb41ab69de3b8c5b53c8f7b2 | [
"MIT"
] | null | null | null | from os import system, name
system('cls' if name == 'nt' else 'clear')
dsc = ('''DESAFIO 066:
Crie um programa que leia vrios nmeros inteiros pelo teclado. O
programa s vai parar quando o usurio digitar o valor 999, que a
condio de parada. No final, mostre quantos nmeros foram
digitados e qual foi a soma entre ele... | 24.863636 | 68 | 0.670932 |
b65ddb5d9166291914db0e277ccb00ba1af84adc | 502 | py | Python | ex03/ex03.py | cheng10/PythonExerciseBook | 11250020995c29e819540de787e91845b1bbbd99 | [
"MIT"
] | null | null | null | ex03/ex03.py | cheng10/PythonExerciseBook | 11250020995c29e819540de787e91845b1bbbd99 | [
"MIT"
] | null | null | null | ex03/ex03.py | cheng10/PythonExerciseBook | 11250020995c29e819540de787e91845b1bbbd99 | [
"MIT"
] | null | null | null | import string
import random
import redis
alpha = string.ascii_uppercase
l = []
while len(l) < 100:
res = ''
for i in range(16):
a = random.choice(alpha)
n = str(random.randrange(10))
rand = random.choice([a, n])
res += rand
if res not in l:
l.append(res)
# ... | 16.733333 | 56 | 0.589641 |
b65e15ab134dbca7c02ad041522ed4d0b673d08e | 355 | py | Python | setup.py | hoogamaphone/world-manager | 8d4515b93d303cf91626f69257e7cf00e200807a | [
"MIT"
] | null | null | null | setup.py | hoogamaphone/world-manager | 8d4515b93d303cf91626f69257e7cf00e200807a | [
"MIT"
] | null | null | null | setup.py | hoogamaphone/world-manager | 8d4515b93d303cf91626f69257e7cf00e200807a | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
with open('requirements.txt') as f:
requirements = f.read()
setup(
name='World-Manager-CLI',
version='0.1.0',
packages=find_packages(),
include_package_data=True,
install_requires=requirements,
entry_points="""
[console_scripts]
w... | 22.1875 | 43 | 0.664789 |
b65f74632dad7cb7cddacb4494d3a9d432840a4d | 1,886 | py | Python | main.py | Jelloeater/8266_web-relay | ac61a21bdfb1d6ff88be095f95059061f273c7b8 | [
"MIT"
] | null | null | null | main.py | Jelloeater/8266_web-relay | ac61a21bdfb1d6ff88be095f95059061f273c7b8 | [
"MIT"
] | null | null | null | main.py | Jelloeater/8266_web-relay | ac61a21bdfb1d6ff88be095f95059061f273c7b8 | [
"MIT"
] | null | null | null | import socket
import ure as re
import time
import machine
try:
run()
except:
time.sleep(3)
machine.reset()
| 25.486486 | 108 | 0.544539 |
b66034e39bac2f1599e4b00ddf1f3159436715fb | 11,943 | py | Python | tools/pnfs_db_restore.py | moibenko/enstore | 6f2ff5b67ff73872a9e68f2a68b0bdaa70cef9b9 | [
"Intel",
"Unlicense"
] | 4 | 2021-10-17T11:17:59.000Z | 2022-02-28T16:58:40.000Z | tools/pnfs_db_restore.py | moibenko/enstore | 6f2ff5b67ff73872a9e68f2a68b0bdaa70cef9b9 | [
"Intel",
"Unlicense"
] | 17 | 2021-10-05T21:44:06.000Z | 2022-03-31T16:58:40.000Z | tools/pnfs_db_restore.py | moibenko/enstore | 6f2ff5b67ff73872a9e68f2a68b0bdaa70cef9b9 | [
"Intel",
"Unlicense"
] | 8 | 2021-09-02T18:55:49.000Z | 2022-03-09T21:05:28.000Z | #!/usr/bin/env python
###############################################################################
#
# This script is to be used to restore and start pnfs from live backup
#
#
# $Id$
###############################################################################
import getopt
import os
import pwd
import re
import s... | 33.928977 | 135 | 0.554635 |
b66267420e208edbe695e88c08255da8fc98c717 | 1,011 | py | Python | baselayer/services/webpack.py | yaowenxi/cesium | b87c8bcafc8a7707877f8b9e9b111a2a99b5aeee | [
"BSD-3-Clause"
] | null | null | null | baselayer/services/webpack.py | yaowenxi/cesium | b87c8bcafc8a7707877f8b9e9b111a2a99b5aeee | [
"BSD-3-Clause"
] | 6 | 2020-07-17T08:50:22.000Z | 2022-02-26T11:56:52.000Z | baselayer/services/webpack.py | yaowenxi/cesium | b87c8bcafc8a7707877f8b9e9b111a2a99b5aeee | [
"BSD-3-Clause"
] | null | null | null | # encoding: utf-8
from baselayer.app.env import load_env
import subprocess
import sys
import time
import os
from pathlib import Path
env, cfg = load_env()
bundle = Path(os.path.dirname(__file__))/'../../static/build/bundle.js'
if env.debug:
print("[service/webpack]: debug mode detected, launching webpack monito... | 25.923077 | 78 | 0.672601 |
b662cf2d0ef7d2f3d75fe691f2648a210b3ef79c | 2,911 | py | Python | tests/test_interfaces/test_to_binary.py | softwareunderground/subsurface | ad5a6d2d24e710ce7a78ec99b2075ddbb9dfeb7d | [
"Apache-2.0"
] | 55 | 2019-05-09T12:26:28.000Z | 2021-11-05T07:35:15.000Z | tests/test_interfaces/test_to_binary.py | softwareunderground/subsurface | ad5a6d2d24e710ce7a78ec99b2075ddbb9dfeb7d | [
"Apache-2.0"
] | 33 | 2019-05-09T16:28:19.000Z | 2022-03-30T13:40:21.000Z | tests/test_interfaces/test_to_binary.py | softwareunderground/subsurface | ad5a6d2d24e710ce7a78ec99b2075ddbb9dfeb7d | [
"Apache-2.0"
] | 14 | 2019-05-09T12:26:33.000Z | 2021-09-01T11:31:27.000Z | import imageio
import pytest
from subsurface.reader.read_netcdf import read_unstruct
import json
try:
import geopandas as gpd
GEOPANDAS_IMPORTED = True
except ImportError:
GEOPANDAS_IMPORTED = False
import pytest
import numpy as np
from subsurface import UnstructuredData, TriSurf, StructuredData
from subs... | 30.010309 | 98 | 0.671591 |
b664480b84ef977aa0b729cdb4d540f18537ee31 | 185 | py | Python | Textual/ver.py | precla/plugins | 3bcfe83295264bc73e6dfe70ae15d9b3d6650f6e | [
"MIT"
] | 93 | 2015-01-05T23:19:59.000Z | 2022-02-16T00:56:50.000Z | Textual/ver.py | FichteForks/tingping-plugins | 85e07ccb3b66b78414dd5aa6f14f3a17bd384a2b | [
"MIT"
] | 7 | 2015-01-21T23:50:08.000Z | 2018-07-26T21:29:38.000Z | Textual/ver.py | FichteForks/tingping-plugins | 85e07ccb3b66b78414dd5aa6f14f3a17bd384a2b | [
"MIT"
] | 53 | 2015-01-19T12:16:58.000Z | 2021-08-30T01:18:29.000Z | #!/usr/bin/env python
import sys
if len(sys.argv) < 3 or not sys.argv[2]:
print('/echo nick required.')
sys.exit()
nick = sys.argv[2]
print('/ctcp {} VERSION'.format(nick))
| 15.416667 | 40 | 0.627027 |
b666f9a2122d3e6d0251d1209907ba2b321af8c4 | 7,243 | py | Python | ticketsplease/ticketsplease/modules/adfs/envelope/sct.py | secureworks/whiskeysamlandfriends | 9334d0959aef64c06a716a5ed2e4f5582ab44a26 | [
"Apache-2.0"
] | 30 | 2021-11-10T16:28:34.000Z | 2022-03-03T19:46:21.000Z | ticketsplease/ticketsplease/modules/adfs/envelope/sct.py | secureworks/whiskeysamlandfriends | 9334d0959aef64c06a716a5ed2e4f5582ab44a26 | [
"Apache-2.0"
] | null | null | null | ticketsplease/ticketsplease/modules/adfs/envelope/sct.py | secureworks/whiskeysamlandfriends | 9334d0959aef64c06a716a5ed2e4f5582ab44a26 | [
"Apache-2.0"
] | 4 | 2021-11-11T19:29:11.000Z | 2021-11-15T15:56:57.000Z | # Copyright 2021 Secureworks
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 35.856436 | 477 | 0.620875 |
b6670f5cb5c8d632fc48bea8d155de2c30d4d414 | 1,014 | py | Python | tests/test_geometry.py | Zepmanbc/cps_workflow | 0926a01c3ef1f163b43edcdae84cc77a1842f3b0 | [
"MIT"
] | 35 | 2019-07-03T16:45:47.000Z | 2022-03-31T16:08:35.000Z | tests/test_geometry.py | Zepmanbc/cps_workflow | 0926a01c3ef1f163b43edcdae84cc77a1842f3b0 | [
"MIT"
] | 42 | 2019-07-03T17:12:34.000Z | 2022-03-17T12:46:40.000Z | tests/test_geometry.py | Zepmanbc/cps_workflow | 0926a01c3ef1f163b43edcdae84cc77a1842f3b0 | [
"MIT"
] | null | null | null | """Geometry testing."""
import creopyson
from .fixtures import mk_creoson_post_dict, mk_creoson_post_None, mk_getactivefile
def test_geometry_bound_box(mk_creoson_post_dict, mk_getactivefile):
"""Test bound_box."""
c = creopyson.Client()
result = c.geometry_bound_box(file_="file")
assert isinstance(re... | 32.709677 | 82 | 0.719921 |
b667207fcb57bd4ec887cd84ed8d9aa150c17bab | 356 | py | Python | answers/Ananya Chandra/day4/question1.py | arc03/30-DaysOfCode-March-2021 | 6d6e11bf70280a578113f163352fa4fa8408baf6 | [
"MIT"
] | 22 | 2021-03-16T14:07:47.000Z | 2021-08-13T08:52:50.000Z | answers/Ananya Chandra/day4/question1.py | arc03/30-DaysOfCode-March-2021 | 6d6e11bf70280a578113f163352fa4fa8408baf6 | [
"MIT"
] | 174 | 2021-03-16T21:16:40.000Z | 2021-06-12T05:19:51.000Z | answers/Ananya Chandra/day4/question1.py | arc03/30-DaysOfCode-March-2021 | 6d6e11bf70280a578113f163352fa4fa8408baf6 | [
"MIT"
] | 135 | 2021-03-16T16:47:12.000Z | 2021-06-27T14:22:38.000Z | #print prime factorisation of a number
n= int(input("enter the number \n"))
i=2
while(n>1):
if (prime(i, 2) == 1):
while n % i == 0:
print(i, ",",end="")
n=n/i
i+=1
| 17.8 | 38 | 0.429775 |
b66835431fc34e47226d3889e3140fdd215f8887 | 1,865 | py | Python | awx/main/tests/functional/api/test_project.py | gitEdouble/awx | 5885654405ccaf465f08df4db998a6dafebd9b4d | [
"Apache-2.0"
] | 2 | 2018-11-12T18:52:24.000Z | 2020-05-22T18:41:21.000Z | awx/main/tests/functional/api/test_project.py | gitEdouble/awx | 5885654405ccaf465f08df4db998a6dafebd9b4d | [
"Apache-2.0"
] | 4 | 2022-02-15T01:33:35.000Z | 2022-03-02T12:47:41.000Z | awx/main/tests/functional/api/test_project.py | gitEdouble/awx | 5885654405ccaf465f08df4db998a6dafebd9b4d | [
"Apache-2.0"
] | 9 | 2019-05-11T00:03:30.000Z | 2021-07-07T16:09:17.000Z | import os
from backports.tempfile import TemporaryDirectory
from django.conf import settings
import pytest
from awx.api.versioning import reverse
| 39.680851 | 97 | 0.716354 |
b6688604687d78d27bb9bf2999491a71b429148b | 761 | py | Python | download codigo fontes/PythonExercicios/ex058.py | tidesjunior2018/Exercicios-da-linguagem-pyhton | 82bb9e7a121ce9fcb12591615120dd9f3a493555 | [
"MIT"
] | null | null | null | download codigo fontes/PythonExercicios/ex058.py | tidesjunior2018/Exercicios-da-linguagem-pyhton | 82bb9e7a121ce9fcb12591615120dd9f3a493555 | [
"MIT"
] | null | null | null | download codigo fontes/PythonExercicios/ex058.py | tidesjunior2018/Exercicios-da-linguagem-pyhton | 82bb9e7a121ce9fcb12591615120dd9f3a493555 | [
"MIT"
] | 1 | 2021-03-13T18:26:50.000Z | 2021-03-13T18:26:50.000Z | '''
58-Melhore o jogo do desafio 028 onde o computador vai "pensar" em um numero
entre 0 e 10.S que agora vai tentar advinhar at acertar mostrando no final
quantos palpites foram necessrios at vencer.
'''
import random
palpite=0
print('\033[33m{:=^40}'.format('JOGO DA ADVINHAO 2.0'))
print('\033[m')
numerosorteado=rand... | 29.269231 | 76 | 0.68594 |
b66b0abcae2e9184f6893e0b8a75687e592b112c | 1,285 | py | Python | build/lib/bandwidth/voice/models/disconnect_cause_enum.py | Spaced-Out/python-bandwidth-sdk | 5332f29d1c093003444384f63a9d4a00843c954f | [
"MIT"
] | null | null | null | build/lib/bandwidth/voice/models/disconnect_cause_enum.py | Spaced-Out/python-bandwidth-sdk | 5332f29d1c093003444384f63a9d4a00843c954f | [
"MIT"
] | null | null | null | build/lib/bandwidth/voice/models/disconnect_cause_enum.py | Spaced-Out/python-bandwidth-sdk | 5332f29d1c093003444384f63a9d4a00843c954f | [
"MIT"
] | 1 | 2020-12-01T15:25:51.000Z | 2020-12-01T15:25:51.000Z | # -*- coding: utf-8 -*-
"""
bandwidth
This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
"""
| 23.363636 | 80 | 0.627237 |
b66b180fc94b3f3077d165f9eba30fc51374504c | 20,727 | py | Python | main.py | HeloiseKatharine/Analise-de-dados | e05e337c0ef03ef68815aa684bdf4466226e02cb | [
"MIT"
] | null | null | null | main.py | HeloiseKatharine/Analise-de-dados | e05e337c0ef03ef68815aa684bdf4466226e02cb | [
"MIT"
] | null | null | null | main.py | HeloiseKatharine/Analise-de-dados | e05e337c0ef03ef68815aa684bdf4466226e02cb | [
"MIT"
] | null | null | null | import pandas as pd
import matplotlib.pyplot as plt
from IPython.display import display
from pymongo import MongoClient
dbname = get_database()
collection_name = dbname["venezuela2021"]
detalhes_itens = collection_name.find()
# consulta o db no Mongo, coloca todos os dados do database nessa variavel.
df = pd.Dat... | 58.716714 | 331 | 0.726444 |
b66d2d5519a0ef3b8c25d34eaafb9a51b73e5edc | 2,235 | py | Python | utils/preprocess_word_embedding.py | JiaqiYao/dynamic_multi_label | dae8b34349f6da80e962fefd5349a29a0f5630f1 | [
"MIT"
] | 2 | 2020-11-29T07:09:29.000Z | 2020-12-22T07:40:24.000Z | utils/preprocess_word_embedding.py | JiaqiYao/dynamic_multi_label | dae8b34349f6da80e962fefd5349a29a0f5630f1 | [
"MIT"
] | null | null | null | utils/preprocess_word_embedding.py | JiaqiYao/dynamic_multi_label | dae8b34349f6da80e962fefd5349a29a0f5630f1 | [
"MIT"
] | null | null | null | import os
import json
from tqdm import tqdm
if __name__ == "__main__":
data_dir = r'/home/yaojq/data/text/reuters'
word2vec_path = "/home/yaojq/data/word_embedding/GoogleNews-vectors-negative300.bin"
print("build vocabulary")
build_vocabulary(data_dir)
get_word_embedding(data_dir, wo... | 39.910714 | 103 | 0.632215 |
b66d60f785036a36c6d1ed53d8206d68665248c2 | 2,797 | py | Python | stories.py | grantat/news-similarity-core | 278399bb215954510fa265ba4bc5b28f7f02e1ee | [
"MIT"
] | null | null | null | stories.py | grantat/news-similarity-core | 278399bb215954510fa265ba4bc5b28f7f02e1ee | [
"MIT"
] | null | null | null | stories.py | grantat/news-similarity-core | 278399bb215954510fa265ba4bc5b28f7f02e1ee | [
"MIT"
] | null | null | null | import requests
import json
import hashlib
import os
import argparse
def get_story(session, uri):
""" Get mementos for html using Internet Archive """
try:
print(uri)
r = session.get(uri, verify=False)
# return entire response
return r
except Exception as e:
print... | 34.530864 | 79 | 0.505899 |
b66d7aa9b11fd773a698acfd6bb25cc487a20615 | 3,564 | py | Python | python/downsample_images_in_rosbag.py | JzHuai0108/vio_common | 2d9c5fce761034cb4e55b3395d259ce392da8ee6 | [
"BSD-3-Clause"
] | 16 | 2017-06-02T07:22:31.000Z | 2022-03-23T02:39:39.000Z | python/downsample_images_in_rosbag.py | JzHuai0108/vio_common | 2d9c5fce761034cb4e55b3395d259ce392da8ee6 | [
"BSD-3-Clause"
] | 2 | 2020-08-10T04:01:35.000Z | 2021-01-18T08:21:17.000Z | python/downsample_images_in_rosbag.py | JzHuai0108/vio_common | 2d9c5fce761034cb4e55b3395d259ce392da8ee6 | [
"BSD-3-Clause"
] | 19 | 2017-08-03T02:23:11.000Z | 2021-09-22T02:17:46.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import argparse
import rosbag
import rospy
from cv_bridge import CvBridge
import cv2
import play_images_in_rosbag
def decide_output_encoding(cv_img):
"""
For 16UC1 input image, we need to use mono16 as output enc... | 33.942857 | 84 | 0.623457 |
b66e79df977dcaa16a976367fddaca5f9d45f186 | 1,770 | py | Python | gen_dataset.py | mantydze/knapsack-problem-py | 15caf65c8abde693f04eae0291933fa426aad1d9 | [
"MIT"
] | null | null | null | gen_dataset.py | mantydze/knapsack-problem-py | 15caf65c8abde693f04eae0291933fa426aad1d9 | [
"MIT"
] | null | null | null | gen_dataset.py | mantydze/knapsack-problem-py | 15caf65c8abde693f04eae0291933fa426aad1d9 | [
"MIT"
] | null | null | null | import json
import random
import sys
import time
sys.setrecursionlimit(2500)
memo = {}
def ks(capacity_left, n):
"""
capacity_left(int): remaining storage capacity of a bag
n(int): current item position
"""
if n == -1 or capacity_left == 0:
# No more items to add
return 0
... | 21.851852 | 82 | 0.564407 |
b66f2f7d9d9618cebbca9ca3940382b757594d51 | 15,629 | py | Python | Juris_Cam.py | eugeniu1994/Stereo-Camera-LiDAR-calibration | 54eec1b911f78ca6b66c35803c47d016b7069499 | [
"Unlicense"
] | 6 | 2021-06-02T03:42:11.000Z | 2022-02-17T12:30:00.000Z | Juris_Cam.py | eugeniu1994/Stereo-Camera-LiDAR-calibration | 54eec1b911f78ca6b66c35803c47d016b7069499 | [
"Unlicense"
] | 1 | 2021-06-09T07:16:09.000Z | 2021-06-09T07:16:09.000Z | Juris_Cam.py | eugeniu1994/Stereo-Camera-LiDAR-calibration | 54eec1b911f78ca6b66c35803c47d016b7069499 | [
"Unlicense"
] | 1 | 2021-08-13T05:20:19.000Z | 2021-08-13T05:20:19.000Z | ''' CONFIDENTIAL
Copyright (c) 2021 Eugeniu Vezeteu,
Department of Remote Sensing and Photogrammetry,
Finnish Geospatial Research Institute (FGI), National Land Survey of Finland (NLS)
PERMISSION IS HEREBY LIMITED TO FGI'S INTERNAL USE ONLY. THE CODE
MAY BE RE-LICENSED, SHARED, OR TAKEN INTO... | 44.274788 | 134 | 0.550259 |
b670fa0f0102d71543d8ccaedc1d30fd90503e7f | 477 | py | Python | payroll/employee_management/migrations/0015_auto_20200302_1717.py | the-krafty-koder/pay-3 | 20426ef00b78c2a65fb4031a7692866bd22a991a | [
"MIT"
] | 1 | 2021-03-26T19:39:30.000Z | 2021-03-26T19:39:30.000Z | payroll/employee_management/migrations/0015_auto_20200302_1717.py | the-krafty-koder/pay-3 | 20426ef00b78c2a65fb4031a7692866bd22a991a | [
"MIT"
] | 12 | 2020-10-27T22:47:01.000Z | 2022-03-12T00:42:49.000Z | payroll/employee_management/migrations/0015_auto_20200302_1717.py | the-krafty-koder/pay-3 | 20426ef00b78c2a65fb4031a7692866bd22a991a | [
"MIT"
] | null | null | null | # Generated by Django 2.2.5 on 2020-03-02 17:17
from django.db import migrations, models
import employee_management.models
| 23.85 | 93 | 0.66457 |
b67168bde4164840416443bfce8934cfcf44c9ab | 364 | py | Python | scripts/say-hello-world.py | OleBo/MathSo | 1f9fa0492d467c0bb0479768c503eee7723ae777 | [
"MIT"
] | 1 | 2022-01-08T23:52:57.000Z | 2022-01-08T23:52:57.000Z | scripts/say-hello-world.py | OleBo/MathSo | 1f9fa0492d467c0bb0479768c503eee7723ae777 | [
"MIT"
] | null | null | null | scripts/say-hello-world.py | OleBo/MathSo | 1f9fa0492d467c0bb0479768c503eee7723ae777 | [
"MIT"
] | 1 | 2022-01-02T21:14:30.000Z | 2022-01-02T21:14:30.000Z | # When your package is installed in editable mode, you can call
# instances of that package from any directory. For example, this
# script may be run by calling
#
# python scripts/say-hello-world.py
#
# and it will call methods inside our python_ml_template project.
from math_so.utils import say_hello_world
if __... | 28 | 65 | 0.760989 |
b6726617c09fe5e7abbd64cdec30ed1653450f24 | 4,851 | py | Python | process_design.py | Multiscale-Genomics/C-HiC | 65e189acc79f5420a276a2f7fd740cb2a3ae8e27 | [
"Apache-2.0"
] | null | null | null | process_design.py | Multiscale-Genomics/C-HiC | 65e189acc79f5420a276a2f7fd740cb2a3ae8e27 | [
"Apache-2.0"
] | 1 | 2018-09-06T12:27:49.000Z | 2018-09-06T12:27:49.000Z | process_design.py | Multiscale-Genomics/CHi-C | 65e189acc79f5420a276a2f7fd740cb2a3ae8e27 | [
"Apache-2.0"
] | 1 | 2021-01-28T23:44:37.000Z | 2021-01-28T23:44:37.000Z | #!/usr/bin/env python
"""
.. See the NOTICE file distributed with this work for additional information
regarding copyright ownership.
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
... | 29.760736 | 76 | 0.59328 |
b6743b740ca63e21a2b17bf0b3f68e580bd80f5d | 353 | py | Python | samples/sample.py | eduardo-vitral/BALRoGO | d4608aa861899fdd447613968fbd53019037bc46 | [
"MIT"
] | null | null | null | samples/sample.py | eduardo-vitral/BALRoGO | d4608aa861899fdd447613968fbd53019037bc46 | [
"MIT"
] | null | null | null | samples/sample.py | eduardo-vitral/BALRoGO | d4608aa861899fdd447613968fbd53019037bc46 | [
"MIT"
] | null | null | null | from balrogo import gaia
# Read HDU
print("Reading input...")
path = r"./samples/SCULPTOR.fits"
# Run sample code
print("Running code...")
final_data, results_sd, var_sd, results_pm, var_pm = gaia.extract_object(path)
print("results_pm:", results_pm)
print("var_pm:", var_pm)
print("results_sd:", result... | 22.0625 | 79 | 0.696884 |
b6746a5b4942abdb9bcb80fa96fed7162930c929 | 5,136 | py | Python | em2/utils/web_push.py | samuelcolvin/em2 | a587eaa80c09a2b44d9c221d09a563aad5b05d78 | [
"MIT"
] | 5 | 2019-03-20T19:07:45.000Z | 2020-10-03T01:16:05.000Z | em2/utils/web_push.py | samuelcolvin/em2 | a587eaa80c09a2b44d9c221d09a563aad5b05d78 | [
"MIT"
] | 51 | 2019-03-12T16:19:46.000Z | 2021-03-09T00:52:24.000Z | em2/utils/web_push.py | samuelcolvin/em2 | a587eaa80c09a2b44d9c221d09a563aad5b05d78 | [
"MIT"
] | 1 | 2019-05-31T14:41:18.000Z | 2019-05-31T14:41:18.000Z | import asyncio
import base64
import hashlib
import logging
import re
import time
from typing import Optional
import http_ece
import ujson
from aiohttp import ClientSession
from arq import ArqRedis
from atoolbox import JsonErrors, RequestError
from cryptography.hazmat.backends import default_backend
from cryptography.h... | 33.350649 | 112 | 0.672702 |
b675c834f4af3a0b82b1bf6826fca2734b7ad156 | 652 | py | Python | app/test.py | erics1996/D5-Video | cb07e211c821e805296f24d28c80ac6fb99bfd5d | [
"Apache-2.0"
] | 1 | 2020-09-26T14:03:48.000Z | 2020-09-26T14:03:48.000Z | app/test.py | erics1996/d5_video | cb07e211c821e805296f24d28c80ac6fb99bfd5d | [
"Apache-2.0"
] | null | null | null | app/test.py | erics1996/d5_video | cb07e211c821e805296f24d28c80ac6fb99bfd5d | [
"Apache-2.0"
] | null | null | null | import redis
# redis
"""
if __name__ == '__main__':
conn = redis.Redis(host='127.0.0.1', port=6379)
if conn:
print('ok')
else:
print('error')
"""
# sessionredis
"""
if __name__ == '__main__':
conn = redis.Redis(host='127.0.0.1', port=6379, password='foobared')
print(conn.keys())
"""... | 27.166667 | 163 | 0.736196 |
b677bba2bd9632d1c8e6d24dee8f3549fac2379b | 14,928 | py | Python | wrapper/utils.py | DaWeSearch/backend | 809e575ed730fce55d0e89a2fbc2031ba116f5e0 | [
"MIT"
] | 1 | 2021-02-15T01:05:22.000Z | 2021-02-15T01:05:22.000Z | wrapper/utils.py | DaWeSearch/backend | 809e575ed730fce55d0e89a2fbc2031ba116f5e0 | [
"MIT"
] | null | null | null | wrapper/utils.py | DaWeSearch/backend | 809e575ed730fce55d0e89a2fbc2031ba116f5e0 | [
"MIT"
] | null | null | null | """Helper functions useful for all wrapper classes."""
import re
from typing import Callable, Optional, Union
from urllib.parse import quote_plus
from requests import exceptions, Response
from .output_format import OUTPUT_FORMAT
def get(nest: Union[dict, list, str], *args, default=None):
"""Get a value in a nes... | 37.507538 | 97 | 0.579448 |
b678945fdf026302149df7f84d03e9bf19062c3e | 8,982 | py | Python | luciferml/supervised/utils/regression_params.py | rahuljaguste/LuciferML | 8ee4449f08bd07da8736be285d8dd0fd99398c28 | [
"MIT"
] | null | null | null | luciferml/supervised/utils/regression_params.py | rahuljaguste/LuciferML | 8ee4449f08bd07da8736be285d8dd0fd99398c28 | [
"MIT"
] | null | null | null | luciferml/supervised/utils/regression_params.py | rahuljaguste/LuciferML | 8ee4449f08bd07da8736be285d8dd0fd99398c28 | [
"MIT"
] | null | null | null | import numpy as np
parameters_svr_1 = [
{'kernel': ['rbf'], 'gamma': [0.1, 0.5, 0.9, 1],
'C': np.logspace(-4, 4, 5)},
]
parameters_svr_2 = [
{'kernel': ['rbf'], 'gamma': [1e-4, 0.1, 0.3,
0.5, 0.7, 0.9, 1], 'C': np.logspace(-4, 4, 10)},
{'kernel': ['linear'], 'gamm... | 29.257329 | 98 | 0.480517 |
b678cfb0be769b12f1acf94c09d18da017d53bfe | 757 | py | Python | ex042.py | ezequielwish/Python3 | a4489d49e6919649437cb9e682614240701e2b68 | [
"MIT"
] | 1 | 2022-01-24T02:01:32.000Z | 2022-01-24T02:01:32.000Z | ex042.py | ezequielwish/Python3 | a4489d49e6919649437cb9e682614240701e2b68 | [
"MIT"
] | null | null | null | ex042.py | ezequielwish/Python3 | a4489d49e6919649437cb9e682614240701e2b68 | [
"MIT"
] | null | null | null | # Refaa o DESAFIO 35 dos tringulos, acrescentando o recurso de mostrar que tipo de tringulo ser formado:
#
# EQUILTERO: todos os lados iguais
#
# ISSCELES: dois lados iguais, um diferente
#
# ESCALENO: todos os lados diferentes
side1 = int(input('Primeiro lado: '))
side2 = int(input('Segundo lado: '))
side3 = int(i... | 31.541667 | 108 | 0.65786 |
b6795fc3685731a886d5d284ea5740aaa1d445a0 | 1,179 | py | Python | serverdensity/proxy/runserver.py | serverdensity/sd-proxy | 3726b391e0e40258a3e58004568c9737898f4b01 | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2016-08-12T17:49:23.000Z | 2016-08-12T17:49:23.000Z | serverdensity/proxy/runserver.py | serverdensity/sd-proxy | 3726b391e0e40258a3e58004568c9737898f4b01 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | serverdensity/proxy/runserver.py | serverdensity/sd-proxy | 3726b391e0e40258a3e58004568c9737898f4b01 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | """Main WSGI server runner for sd-proxy
"""
import os
import logging
from sys import argv, path, stderr, exit
from gevent.wsgi import WSGIServer
if __name__ == '__main__':
path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
exit(main())
| 24.061224 | 79 | 0.679389 |