hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
56df9b9c7c895e66c922414047b575c97d81da14 | 4,711 | py | Python | LAB2/Z0/Z0.py | Yalfoosh/OOUP-Labosi | 568413a3f7dbdcaa9291b7ac7193646e71377b22 | [
"Apache-2.0"
] | null | null | null | LAB2/Z0/Z0.py | Yalfoosh/OOUP-Labosi | 568413a3f7dbdcaa9291b7ac7193646e71377b22 | [
"Apache-2.0"
] | null | null | null | LAB2/Z0/Z0.py | Yalfoosh/OOUP-Labosi | 568413a3f7dbdcaa9291b7ac7193646e71377b22 | [
"Apache-2.0"
] | null | null | null |
# region Old code
"""class Circle:
def __init__(self, e_type: Shape.EType = Shape.EType.square, radius: float = 1, center: Point = None):
self.type_ = e_type
self.radius_ = radius
if center is None:
center = Point(0, 0)
self.center_ = center
class ... | 24.035714 | 107 | 0.548079 | from enum import Enum
from sys import stderr
from typing import List
class Point:
def __init__(self, x : int = 0, y: int = 0):
self.x = x
self.y = y
def __str__(self):
return "({}, {})".format(self.x, self.y)
class Shape:
class EType(Enum):
circle = 0,
... | 0 | 0 | 0 | 1,743 | 0 | 266 | 0 | 3 | 217 |
750564296c51ff3d9293f03037e4da58378f297c | 2,222 | py | Python | facial_recognition.py | greerviau/HackUMass | 25ef2ea9fecbe4bbfa91f0a9f32bd9f2703a176a | [
"MIT"
] | 2 | 2019-10-31T15:18:06.000Z | 2021-02-13T00:14:07.000Z | facial_recognition.py | greerviau/HackUMass | 25ef2ea9fecbe4bbfa91f0a9f32bd9f2703a176a | [
"MIT"
] | 1 | 2019-10-21T21:23:02.000Z | 2019-10-21T21:23:02.000Z | facial_recognition.py | greerviau/HackUMass | 25ef2ea9fecbe4bbfa91f0a9f32bd9f2703a176a | [
"MIT"
] | 3 | 2020-01-20T21:46:10.000Z | 2021-05-27T09:49:54.000Z | import cv2, sys
| 31.742857 | 141 | 0.572907 | import numpy as np
import cv2, math, os, sys
import classify
import sys
import cv2
import preprocess
import time
import cache
class FacialRecognition():
def __init__(self):
self.CONF = 0.7
self.classifier = classify.Classify()
self.preprocessor = preprocess.PreProcessor()
self.c... | 0 | 0 | 0 | 2,051 | 0 | 0 | 0 | -44 | 183 |
0de70dad74537b0d783d0f62184c8a7c4cc1b59d | 1,703 | py | Python | bot1/sensor/imu6050_defs.py | dpm76/Bot1 | a8e4f6cbc6e4f1d5f1a373a8b3c43811df6446f8 | [
"MIT"
] | null | null | null | bot1/sensor/imu6050_defs.py | dpm76/Bot1 | a8e4f6cbc6e4f1d5f1a373a8b3c43811df6446f8 | [
"MIT"
] | null | null | null | bot1/sensor/imu6050_defs.py | dpm76/Bot1 | a8e4f6cbc6e4f1d5f1a373a8b3c43811df6446f8 | [
"MIT"
] | null | null | null | PWR_MGM1 = 0x6b
PWR_MGM2 = 0x6c
GYRO_XOUT = 0x43
GYRO_YOUT = 0x45
GYRO_ZOUT = 0x47
ACC_XOUT = 0x3b
ACC_YOUT = 0x3d
ACC_ZOUT = 0x3f
SMPRT_DIV = 0x19
CONFIG=0x1a
GYRO_CONFIG = 0x1b
ACCEL_CONFIG = 0x1c
#PWR_MGM1 values
RESET=0b10000000
SLEEP=0b01000000
CLK_SEL_X = 1
CLK_SEL_Y = 2
CLK_SEL_Z = 3
... | 29.877193 | 94 | 0.41926 | PWR_MGM1 = 0x6b
PWR_MGM2 = 0x6c
GYRO_XOUT = 0x43
GYRO_YOUT = 0x45
GYRO_ZOUT = 0x47
ACC_XOUT = 0x3b
ACC_YOUT = 0x3d
ACC_ZOUT = 0x3f
SMPRT_DIV = 0x19
CONFIG=0x1a
GYRO_CONFIG = 0x1b
ACCEL_CONFIG = 0x1c
#PWR_MGM1 values
RESET=0b10000000
SLEEP=0b01000000
CLK_SEL_X = 1
CLK_SEL_Y = 2
CLK_SEL_Z = 3
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
268c14c6f3f4a18d3882ec2d8d63b83c7ee4c1e4 | 694 | py | Python | src/histdatacom/__init__.py | dmidlo/histdata.com-tools | dd1f17134711e5588ba019d6575287937936afb7 | [
"MIT"
] | null | null | null | src/histdatacom/__init__.py | dmidlo/histdata.com-tools | dd1f17134711e5588ba019d6575287937936afb7 | [
"MIT"
] | null | null | null | src/histdatacom/__init__.py | dmidlo/histdata.com-tools | dd1f17134711e5588ba019d6575287937936afb7 | [
"MIT"
] | null | null | null | """Entry point for histdatacom api
histdatacom(options)
Returns:
data: returns a data frame or a list of data frames and metadata
"""
import sys
__version__ = "0.76.9"
__author__ = 'David Midlo'
sys.modules[__name__].__class__ = Options
| 25.703704 | 83 | 0.724784 | """Entry point for histdatacom api
histdatacom(options)
Returns:
data: returns a data frame or a list of data frames and metadata
"""
import sys
from . import histdata_com
__version__ = "0.76.9"
__author__ = 'David Midlo'
class Options(sys.modules[__name__].__class__):
"""Options. A Masquerade class.
A... | 0 | 0 | 0 | 399 | 0 | 0 | 0 | 5 | 45 |
84337b1dd467f851fe12be081acb85f85fa1b8d5 | 4,944 | py | Python | tmp_jason_main/sanitycheck/cpp/run.py | truebluejason/autogluon | 9f0aac8453567f7fa57492288cb387d17c06ebe3 | [
"Apache-2.0"
] | null | null | null | tmp_jason_main/sanitycheck/cpp/run.py | truebluejason/autogluon | 9f0aac8453567f7fa57492288cb387d17c06ebe3 | [
"Apache-2.0"
] | null | null | null | tmp_jason_main/sanitycheck/cpp/run.py | truebluejason/autogluon | 9f0aac8453567f7fa57492288cb387d17c06ebe3 | [
"Apache-2.0"
] | null | null | null | import argparse
from autogluon.tabular import TabularPredictor
import os
import pandas as pd
import traceback
parser = argparse.ArgumentParser()
parser.add_argument('-d', '--dataset_dir', help='path to cpp directory', type=str, default='dataset/cpp')
parser.add_argument('-p', '--problem', help='only run this problem i... | 52.042105 | 157 | 0.714199 | import argparse
from autogluon.tabular import TabularDataset, TabularPredictor
from autogluon.tabular.models import CatBoostModel, KNNModel, LGBModel, XGBoostModel, TabularNeuralNetModel, RFModel
import os
from numpy.core.fromnumeric import trace
import pandas as pd
import traceback
parser = argparse.ArgumentParser()
... | 0 | 0 | 0 | 0 | 0 | 675 | 0 | 130 | 90 |
bc4d8519b7c76e7d80526b42c96720d1f8012b9e | 4,447 | py | Python | scripts/diagram_viewer.py | Jothin-kumar/Geometry_app | fe2c43a41b37e249ed57063fe71571447bdd0ba4 | [
"MIT"
] | 12 | 2021-09-28T17:04:02.000Z | 2022-02-15T09:11:05.000Z | scripts/diagram_viewer.py | Jothin-kumar/Geometry_app | fe2c43a41b37e249ed57063fe71571447bdd0ba4 | [
"MIT"
] | null | null | null | scripts/diagram_viewer.py | Jothin-kumar/Geometry_app | fe2c43a41b37e249ed57063fe71571447bdd0ba4 | [
"MIT"
] | 3 | 2021-10-08T05:58:43.000Z | 2021-11-09T10:35:48.000Z | """
View this repository on github: https://github.com/Jothin-kumar/Geometry-app
MIT License
Copyright (c) 2021 B.Jothin kumar
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction... | 51.114943 | 126 | 0.720036 | """
View this repository on github: https://github.com/Jothin-kumar/Geometry-app
MIT License
Copyright (c) 2021 B.Jothin kumar
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction... | 0 | 0 | 0 | 0 | 0 | 2,878 | 0 | 64 | 156 |
a2dabb85bbc0fc00a224ef8be3579148e2fa8711 | 428 | py | Python | Ex026.py | CaioHRombaldo/PythonClasses | 78cd990153ff95c0b4a120550a9e77438008d2d0 | [
"MIT"
] | null | null | null | Ex026.py | CaioHRombaldo/PythonClasses | 78cd990153ff95c0b4a120550a9e77438008d2d0 | [
"MIT"
] | null | null | null | Ex026.py | CaioHRombaldo/PythonClasses | 78cd990153ff95c0b4a120550a9e77438008d2d0 | [
"MIT"
] | null | null | null | phrase = input('Please enter a sentence to do the analysis: ')
numberOfA = phrase.upper().count('A')
firstA = phrase.upper().find('A') + 1
lastA = phrase.upper().rfind('A') + 1
print('In the phrase "{}" appear {} letters "A".'.format(phrase, numberOfA))
print('The letter "A" appears for the first time in the position... | 42.8 | 86 | 0.679907 | phrase = input('Please enter a sentence to do the analysis: ')
numberOfA = phrase.upper().count('A')
firstA = phrase.upper().find('A') + 1
lastA = phrase.upper().rfind('A') + 1
print('In the phrase "{}" appear {} letters "A".'.format(phrase, numberOfA))
print('The letter "A" appears for the first time in the position... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
cc850987145315fe2c39cc865a2afdc1b2f403d8 | 995 | py | Python | tests/test_user.py | AngelLiang/hacking-june | 35791a2329bae2599505f64d75cac8758f61c6e5 | [
"BSD-3-Clause"
] | 680 | 2015-01-02T01:41:43.000Z | 2022-03-04T16:28:51.000Z | tests/test_user.py | xzhxq/june | 36e6c402d877024839ea7a402f39c36d30901162 | [
"BSD-3-Clause"
] | 12 | 2015-01-25T13:54:22.000Z | 2018-10-01T09:51:06.000Z | tests/test_user.py | xzhxq/june | 36e6c402d877024839ea7a402f39c36d30901162 | [
"BSD-3-Clause"
] | 288 | 2015-01-04T08:10:14.000Z | 2021-12-06T09:35:10.000Z | # coding: utf-8
| 27.638889 | 73 | 0.570854 | # coding: utf-8
from .suite import BaseSuite
class TestUser(BaseSuite):
def test_users(self):
url = self.url_for('user.users')
rv = self.client.get(url)
assert '<title>Users' in rv.data
rv = self.client.get(url + '?page=s')
assert rv.status_code == 404
def test_city... | 0 | 0 | 0 | 925 | 0 | 0 | 0 | 7 | 46 |
61036817701ed81b4b9b78d99f86205118227639 | 12,239 | py | Python | event.py | Aues6uen11Z/HonkaiHelper | f3368534e61e075340adb649a8847a1883d48e4f | [
"MIT"
] | 1 | 2022-02-27T01:42:38.000Z | 2022-02-27T01:42:38.000Z | event.py | Aues6uen11Z/HonkaiHelper | f3368534e61e075340adb649a8847a1883d48e4f | [
"MIT"
] | null | null | null | event.py | Aues6uen11Z/HonkaiHelper | f3368534e61e075340adb649a8847a1883d48e4f | [
"MIT"
] | null | null | null |
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
| 42.203448 | 126 | 0.649726 | from datetime import datetime
from anti_detection import *
from config import *
# 登录前有可能要更新数据
def check_update():
if exists(Template(r"img/tpl1646114198037.png", record_pos=(0.002, -0.129), resolution=(1277, 720))):
find_click(Template(r"img/tpl1646114248108.png", record_pos=(0.0, 0.116), resolution=(127... | 762 | 0 | 0 | 0 | 0 | 11,499 | 0 | 14 | 397 |
5f031f14a4a671293492646c6e76fe93f9849190 | 24,780 | py | Python | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_ip_sbfd_oper.py | tkamata-test/ydk-py | b637e7853a8edbbd31fbc05afa3aa4110b31c5f9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_ip_sbfd_oper.py | tkamata-test/ydk-py | b637e7853a8edbbd31fbc05afa3aa4110b31c5f9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_ip_sbfd_oper.py | tkamata-test/ydk-py | b637e7853a8edbbd31fbc05afa3aa4110b31c5f9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | """ Cisco_IOS_XR_ip_sbfd_oper
This module contains a collection of YANG definitions
for Cisco IOS\-XR ip\-sbfd package operational data.
This module contains definitions
for the following management objects\:
sbfd\: Seamless BFD (S\-BFD) operational data
Copyright (c) 2013\-2016 by Cisco Systems, Inc.
All rights ... | 34.512535 | 269 | 0.44427 | """ Cisco_IOS_XR_ip_sbfd_oper
This module contains a collection of YANG definitions
for Cisco IOS\-XR ip\-sbfd package operational data.
This module contains definitions
for the following management objects\:
sbfd\: Seamless BFD (S\-BFD) operational data
Copyright (c) 2013\-2016 by Cisco Systems, Inc.
All rights ... | 0 | 4,430 | 0 | 19,756 | 0 | 0 | 0 | 68 | 183 |
3d8320886ef59dd3ef351e9031bdac4813256d3e | 2,334 | py | Python | lib/python2.7/site-packages/FuncDesigner/examples/eig1.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | 5 | 2017-01-23T16:23:43.000Z | 2022-01-20T16:14:06.000Z | lib/python2.7/site-packages/FuncDesigner/examples/eig1.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2015-04-24T06:46:25.000Z | 2015-04-24T06:46:25.000Z | lib/python2.7/site-packages/FuncDesigner/examples/eig1.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | 8 | 2016-05-30T13:35:17.000Z | 2021-06-15T22:24:29.000Z | # An example of FuncDesigner eigenvalues/eigenvectors for a linear equations system,
# see http://openopt.org/EIG for more examples and details
from numpy import arange
n = 100
# create some variables
a, b, c = oovar('a'), oovar('b', size=n), oovar('c', size=2*n)
# let's construct some linear functions R^i -> R^j
# in... | 43.222222 | 135 | 0.676949 | # An example of FuncDesigner eigenvalues/eigenvectors for a linear equations system,
# see http://openopt.org/EIG for more examples and details
from FuncDesigner import *
from numpy import arange
n = 100
# create some variables
a, b, c = oovar('a'), oovar('b', size=n), oovar('c', size=2*n)
# let's construct some linea... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 22 |
e65ce289b88bbd46da61c9daeacd91dd7447abc9 | 325 | py | Python | dashboard/migrations/0005_remove_job_type.py | muttiopenbts/cascade_spit | 27b722390977cb9bd677789617cf049fc5b90539 | [
"Apache-2.0"
] | null | null | null | dashboard/migrations/0005_remove_job_type.py | muttiopenbts/cascade_spit | 27b722390977cb9bd677789617cf049fc5b90539 | [
"Apache-2.0"
] | null | null | null | dashboard/migrations/0005_remove_job_type.py | muttiopenbts/cascade_spit | 27b722390977cb9bd677789617cf049fc5b90539 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.0.1 on 2018-05-09 19:24
| 18.055556 | 49 | 0.587692 | # Generated by Django 2.0.1 on 2018-05-09 19:24
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('dashboard', '0004_auto_20180508_2219'),
]
operations = [
migrations.RemoveField(
model_name='job',
name='type',
),
... | 0 | 0 | 0 | 219 | 0 | 0 | 0 | 11 | 46 |
8900c2ae0df7584cf0f7b82d744a2cc9de95cf7c | 463 | py | Python | main/applications/palindrome/third.py | catalinprescure/python-pages | 93df3b22df2cfa269127e803a1b6c6a34bae6745 | [
"MIT"
] | null | null | null | main/applications/palindrome/third.py | catalinprescure/python-pages | 93df3b22df2cfa269127e803a1b6c6a34bae6745 | [
"MIT"
] | null | null | null | main/applications/palindrome/third.py | catalinprescure/python-pages | 93df3b22df2cfa269127e803a1b6c6a34bae6745 | [
"MIT"
] | 1 | 2021-12-24T15:58:32.000Z | 2021-12-24T15:58:32.000Z | """Palindrome string
Use incremental development to check if string is palindrome
A palindrome is a word that is spelled the same backward and forward.
Example: noon, redivider
Version 3: test middle
"""
assert is_palindrome("abcba") == True
assert is_palindrome("abca") == False | 25.722222 | 69 | 0.686825 | """Palindrome string
Use incremental development to check if string is palindrome
A palindrome is a word that is spelled the same backward and forward.
Example: noon, redivider
Version 3: test middle
"""
def is_palindrome(word):
if (word[0] != word[-1]):
return False
if (len(word) > 2):
middle... | 0 | 0 | 0 | 0 | 0 | 159 | 0 | 0 | 23 |
9e26e79a7ce18eb00c97de575a2f79d503ae2849 | 3,099 | py | Python | code/actor.py | sovaso/GeneticAlgorithmForHumanoidRobotWalk | b14d7a562226b32dd7b4c5f2b056cf1478700ce3 | [
"MIT"
] | null | null | null | code/actor.py | sovaso/GeneticAlgorithmForHumanoidRobotWalk | b14d7a562226b32dd7b4c5f2b056cf1478700ce3 | [
"MIT"
] | null | null | null | code/actor.py | sovaso/GeneticAlgorithmForHumanoidRobotWalk | b14d7a562226b32dd7b4c5f2b056cf1478700ce3 | [
"MIT"
] | null | null | null | import torch.nn as nn
| 30.99 | 113 | 0.617941 | import torch
import torch.nn as nn
import torch.nn.functional as F
import warnings
from torch.distributions import MultivariateNormal
import numpy as np
class ActorModel(nn.Module):
""" Actor model used for policy function approximation """
def __init__(self, input_dim, output_dim):
""" Initialize th... | 0 | 0 | 0 | 2,898 | 0 | 0 | 0 | 21 | 156 |
58eaf76ba465287f4fe02269b4610e25d4cb154a | 954 | py | Python | bin/gmsh2exo.py | jeanmichelscherer/mef90 | 48b9b7d8bdaccb846a76833853f6ea81ce6fc9b1 | [
"BSD-2-Clause"
] | 9 | 2019-12-04T01:38:56.000Z | 2022-02-13T17:35:06.000Z | bin/gmsh2exo.py | jeanmichelscherer/mef90 | 48b9b7d8bdaccb846a76833853f6ea81ce6fc9b1 | [
"BSD-2-Clause"
] | 1 | 2022-02-19T21:38:52.000Z | 2022-02-19T21:38:52.000Z | bin/gmsh2exo.py | jeanmichelscherer/mef90 | 48b9b7d8bdaccb846a76833853f6ea81ce6fc9b1 | [
"BSD-2-Clause"
] | 7 | 2021-01-20T01:57:25.000Z | 2022-02-17T18:11:38.000Z | #!/usr/bin/env python3
import argparse
import pymef90.mesh
import sys
import os
parser = argparse.ArgumentParser()
parser.add_argument("gmeshFile", help = "The name of the mesh file to be parsed.", type = str)
parser.add_argument("exoFile", help = "The name of the exodus file to be written.", type = str)
parser.add_ar... | 38.16 | 114 | 0.709644 | #!/usr/bin/env python3
import argparse
import pymef90.mesh
import sys
import os
parser = argparse.ArgumentParser()
parser.add_argument("gmeshFile", help = "The name of the mesh file to be parsed.", type = str)
parser.add_argument("exoFile", help = "The name of the exodus file to be written.", type = str)
parser.add_ar... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2f3e0d829e7986ce5ec600d2c718af97a1765602 | 5,441 | py | Python | tests/types/test_time.py | petertriho/prestans | e262e542518fcb765df03ae9aa246de296c044ff | [
"BSD-3-Clause"
] | 12 | 2015-05-20T13:37:48.000Z | 2020-10-07T09:46:46.000Z | tests/types/test_time.py | petertriho/prestans | e262e542518fcb765df03ae9aa246de296c044ff | [
"BSD-3-Clause"
] | 113 | 2015-01-08T01:08:11.000Z | 2018-11-22T03:57:28.000Z | tests/types/test_time.py | petertriho/prestans | e262e542518fcb765df03ae9aa246de296c044ff | [
"BSD-3-Clause"
] | 2 | 2016-03-14T04:19:47.000Z | 2019-02-04T05:59:54.000Z | from datetime import time
NOW = time(12, 34, 11)
UTC_NOW = time(13, 35, 12)
| 40.007353 | 115 | 0.676346 | from datetime import time
from mock import patch
import unittest
from prestans import exception
from prestans.types import Time
NOW = time(12, 34, 11)
UTC_NOW = time(13, 35, 12)
class TimeUnitTest(unittest.TestCase):
def test_default(self):
default_none = Time()
self.assertIsNone(default_none.d... | 0 | 0 | 0 | 5,237 | 0 | 0 | 0 | 14 | 112 |
e2fce73a174ce0bd4f80bbc74a0227be2a40f2e6 | 1,476 | py | Python | eds/rest_app/api/call.py | piyush82/elastest-device-emulator-service | b4d6b393d6042c54a7b3dfb5f58cad5efd00f0e7 | [
"Apache-2.0"
] | null | null | null | eds/rest_app/api/call.py | piyush82/elastest-device-emulator-service | b4d6b393d6042c54a7b3dfb5f58cad5efd00f0e7 | [
"Apache-2.0"
] | null | null | null | eds/rest_app/api/call.py | piyush82/elastest-device-emulator-service | b4d6b393d6042c54a7b3dfb5f58cad5efd00f0e7 | [
"Apache-2.0"
] | null | null | null | # Python 2.7.6
# RestfulClient.py
import re
import requests
from requests.auth import HTTPDigestAuth
import json
from base64 import b64decode
# Replace with the correct URL
url1 = "http://172.18.0.2:8000/onem2m/MemsIPE/sensor_data/x/latest/"
url2 = "http://172.18.0.2:8000/onem2m/MemsIPE/sensor_data/y/latest/"
url3 = "... | 32.086957 | 115 | 0.743225 | # Python 2.7.6
# RestfulClient.py
import re
import requests
from requests.auth import HTTPDigestAuth
import json
from base64 import b64decode
# Replace with the correct URL
url1 = "http://172.18.0.2:8000/onem2m/MemsIPE/sensor_data/x/latest/"
url2 = "http://172.18.0.2:8000/onem2m/MemsIPE/sensor_data/y/latest/"
url3 = "... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4148ccbe476d8ee0c69aab3b5f50f54eec588679 | 13,518 | py | Python | app/align.py | cisnlp/parcoure | 54aa4dee32239b3dd7b8847c3bfbab4ec319dae8 | [
"MIT"
] | 6 | 2021-07-16T13:10:29.000Z | 2022-02-28T11:56:55.000Z | app/align.py | cisnlp/parcoure | 54aa4dee32239b3dd7b8847c3bfbab4ec319dae8 | [
"MIT"
] | null | null | null | app/align.py | cisnlp/parcoure | 54aa4dee32239b3dd7b8847c3bfbab4ec319dae8 | [
"MIT"
] | null | null | null | from flask_restful import reqparse
from app.document_retrieval import DocumentRetriever
from app.lexicon import Lexicon
import app.controler as controler
parser = reqparse.RequestParser()
doc_retriever = DocumentRetriever()
lexicon = Lexicon()
| 43.466238 | 246 | 0.628125 | from flask import render_template, request
from app import app, models, utils
from app.forms import *
from flask_restful import reqparse
import json, requests, os
from app.document_retrieval import DocumentRetriever
from app.lexicon import Lexicon
import app.controler as controler
import app.alignment_controller as ali... | 0 | 10,890 | 0 | 0 | 0 | 1,862 | 0 | 178 | 339 |
4c4eabbb05f654f3026dcb0438122c0301a6ff02 | 1,914 | py | Python | utils/OpenLoopActuator.py | philip-harr/CPULoadGenerator | 6db1ad81d44366296ebf2e35c598d948425691f7 | [
"MIT"
] | 2 | 2018-06-27T10:45:02.000Z | 2020-12-04T10:51:14.000Z | utils/OpenLoopActuator.py | philip-harr/CPULoadGenerator | 6db1ad81d44366296ebf2e35c598d948425691f7 | [
"MIT"
] | null | null | null | utils/OpenLoopActuator.py | philip-harr/CPULoadGenerator | 6db1ad81d44366296ebf2e35c598d948425691f7 | [
"MIT"
] | 1 | 2019-12-03T19:18:57.000Z | 2019-12-03T19:18:57.000Z | # Authors: Gaetano Carlucci
# Giuseppe Cofano
| 29.446154 | 74 | 0.608673 | # Authors: Gaetano Carlucci
# Giuseppe Cofano
import time
from utils.Plot import RealTimePlot
class OpenLoopActuator:
"""
Generates CPU load by tuning the sleep time
"""
def __init__(self, monitor, duration, cpu_core, plot):
self.sleep_time = 0.03
self.monitor = monitor
... | 0 | 0 | 0 | 1,786 | 0 | 0 | 0 | 4 | 69 |
143fe25309a3764ec516b2e383c0c46a9b500e87 | 8,538 | py | Python | st2common/st2common/content/bootstrap.py | UbuntuEvangelist/st2 | 36af04f2caa03b396fb8ab00fd6d700e827fda8d | [
"Apache-2.0"
] | 1 | 2020-11-21T10:11:25.000Z | 2020-11-21T10:11:25.000Z | st2common/st2common/content/bootstrap.py | UbuntuEvangelist/st2 | 36af04f2caa03b396fb8ab00fd6d700e827fda8d | [
"Apache-2.0"
] | 1 | 2015-06-08T15:27:11.000Z | 2015-06-08T15:27:11.000Z | st2common/st2common/content/bootstrap.py | UbuntuEvangelist/st2 | 36af04f2caa03b396fb8ab00fd6d700e827fda8d | [
"Apache-2.0"
] | 13 | 2017-01-12T11:07:20.000Z | 2019-04-19T09:55:49.000Z | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | 39.345622 | 98 | 0.621106 | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | 0 | 0 | 0 | 0 | 0 | 6,900 | 0 | 107 | 318 |
94a74a07d446be060a2a83dbfe96150d412006f8 | 7,170 | py | Python | comet/cli.py | chryssa-zrv/UA_COMET | 527e7c86bd0a0d8ff90efda58e820108a5666b92 | [
"Apache-2.0"
] | null | null | null | comet/cli.py | chryssa-zrv/UA_COMET | 527e7c86bd0a0d8ff90efda58e820108a5666b92 | [
"Apache-2.0"
] | null | null | null | comet/cli.py | chryssa-zrv/UA_COMET | 527e7c86bd0a0d8ff90efda58e820108a5666b92 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
r"""
COMET command line interface (CLI)
==============
Composed by 4 main commands:
train Used to train a machine translation metric.
score Uses COMET to score a list of MT outputs.
download Used to download corpora or pretrained metric.
"""
| 29.02834 | 146 | 0.646444 | # -*- coding: utf-8 -*-
r"""
COMET command line interface (CLI)
==============
Composed by 4 main commands:
train Used to train a machine translation metric.
score Uses COMET to score a list of MT outputs.
download Used to download corpora or pretrained metric.
"""
import json
import os
impo... | 0 | 6,489 | 0 | 0 | 0 | 0 | 0 | 115 | 270 |
7e6f0608f1022838339beb7113bea7d875589d0b | 74 | py | Python | week4/3_pip/ex2.py | skku-overflow/python-2020-2 | def09d9a8ff32ee085edaa5eca89ccc03c29af2a | [
"Apache-2.0"
] | null | null | null | week4/3_pip/ex2.py | skku-overflow/python-2020-2 | def09d9a8ff32ee085edaa5eca89ccc03c29af2a | [
"Apache-2.0"
] | null | null | null | week4/3_pip/ex2.py | skku-overflow/python-2020-2 | def09d9a8ff32ee085edaa5eca89ccc03c29af2a | [
"Apache-2.0"
] | null | null | null | import numpy as np
a1 = np.array([1, 2, 3, 4, 5])
a2 = a1 + 1
print(a2)
| 10.571429 | 30 | 0.554054 | import numpy as np
a1 = np.array([1, 2, 3, 4, 5])
a2 = a1 + 1
print(a2)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d891857daaa4fef708a537b0bbf664fe97fb0969 | 3,375 | py | Python | scripts/LSTM/results-classification.py | georg-wenzel/ml-data-smell-detection | 7dddd401ca1f1a830dfd8b00760659911e5b1086 | [
"MIT"
] | 1 | 2022-03-29T14:46:40.000Z | 2022-03-29T14:46:40.000Z | scripts/LSTM/results-classification.py | georg-wenzel/ml-data-smell-detection | 7dddd401ca1f1a830dfd8b00760659911e5b1086 | [
"MIT"
] | null | null | null | scripts/LSTM/results-classification.py | georg-wenzel/ml-data-smell-detection | 7dddd401ca1f1a830dfd8b00760659911e5b1086 | [
"MIT"
] | 1 | 2021-06-13T08:24:46.000Z | 2021-06-13T08:24:46.000Z | import pandas as pd
import numpy as np
###SCRIPT DESCRIPTION###
# This script provides statistical analysis for LSTM labeled data.
###SCRIPT INPUT###
# The .csv file given to this script should be equivalent to the labeled output generated by the corresponding
# data-generation.py script. This means a "Format" column ... | 42.721519 | 110 | 0.696593 | import pandas as pd
import numpy as np
###SCRIPT DESCRIPTION###
# This script provides statistical analysis for LSTM labeled data.
###SCRIPT INPUT###
# The .csv file given to this script should be equivalent to the labeled output generated by the corresponding
# data-generation.py script. This means a "Format" column ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
183dc6df34c3cd6508f48ce8ccf4a51bdb92b74b | 247 | py | Python | python/easy/intersection-of-two-arrays.py | anidever/leetcode | fd8ac6d9c5e80d03ea6a5e4988502dcffff0ddc7 | [
"WTFPL"
] | null | null | null | python/easy/intersection-of-two-arrays.py | anidever/leetcode | fd8ac6d9c5e80d03ea6a5e4988502dcffff0ddc7 | [
"WTFPL"
] | null | null | null | python/easy/intersection-of-two-arrays.py | anidever/leetcode | fd8ac6d9c5e80d03ea6a5e4988502dcffff0ddc7 | [
"WTFPL"
] | 1 | 2020-12-20T00:52:26.000Z | 2020-12-20T00:52:26.000Z | # question can be found on leetcode.com/problems/intersection-of-two-arrays/
| 30.875 | 76 | 0.724696 | # question can be found on leetcode.com/problems/intersection-of-two-arrays/
from Typing import List
class Solution:
def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]:
return set(nums1).intersection(set(nums2))
| 0 | 0 | 0 | 122 | 0 | 0 | 0 | 2 | 45 |
5567ba43623f930a812dcf91355330eb54748ae2 | 4,304 | py | Python | fixImageOrientation.py | Computational-Plant-Science/DIRT | e3f9418f1ad01c8251f8c58ad592089bb8e90612 | [
"BSD-3-Clause"
] | 16 | 2017-01-27T09:12:58.000Z | 2021-11-29T03:19:50.000Z | fixImageOrientation.py | Computational-Plant-Science/DIRT | e3f9418f1ad01c8251f8c58ad592089bb8e90612 | [
"BSD-3-Clause"
] | 3 | 2018-02-15T19:31:41.000Z | 2020-07-22T18:28:08.000Z | fixImageOrientation.py | Computational-Plant-Science/DIRT | e3f9418f1ad01c8251f8c58ad592089bb8e90612 | [
"BSD-3-Clause"
] | 9 | 2016-10-15T16:25:33.000Z | 2020-02-25T13:10:26.000Z | '''
fixImageOrientation.py
All credits go to Kyle Fox who wrote this EXIF orientation patch.
We just modified tiny pieces. https://github.com/kylefox
The code is free for non-commercial use.
Please contact the author for commercial use.
Please cite the DIRT Paper if you use the code for your scientific project.
Buc... | 38.774775 | 111 | 0.685874 | '''
fixImageOrientation.py
All credits go to Kyle Fox who wrote this EXIF orientation patch.
We just modified tiny pieces. https://github.com/kylefox
The code is free for non-commercial use.
Please contact the author for commercial use.
Please cite the DIRT Paper if you use the code for your scientific project.
Buc... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8718d2d88aaa739d5ea70bf7ac9635563c1174fc | 1,031 | py | Python | monte_carlo.py | jm-wltr/Monte-Carlo-Pi | b235652663acef3c6e78735db0d2c0c7b1ad8489 | [
"MIT"
] | null | null | null | monte_carlo.py | jm-wltr/Monte-Carlo-Pi | b235652663acef3c6e78735db0d2c0c7b1ad8489 | [
"MIT"
] | null | null | null | monte_carlo.py | jm-wltr/Monte-Carlo-Pi | b235652663acef3c6e78735db0d2c0c7b1ad8489 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 12 13:15:18 2022
@author: Jaimew
"""
import numpy as np
import time
import sys
R = 10000000
inside = 0
start_time = time.perf_counter()
for i in range(R):
inside = inside + in_circle()
if i % (R/1000) == 0:
sys.stdout.write("\r... | 18.410714 | 60 | 0.593598 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 12 13:15:18 2022
@author: Jaimew
"""
from random import uniform as rd
import numpy as np
import time
import sys
def in_circle():
if rd(0,1)**2+rd(0,1)**2 <= 1: return 1
else: return 0
R = 10000000
inside = 0
start_time = time.perf_co... | 0 | 0 | 0 | 0 | 0 | 58 | 0 | 11 | 46 |
a1392af854f59c750f83d883b8d69f1b2efa1a87 | 136 | py | Python | address/address.py | felipeit/fdme_kivy | 208a823e2995cb6f5fd7e8ce437a22c5d0571ef6 | [
"MIT"
] | null | null | null | address/address.py | felipeit/fdme_kivy | 208a823e2995cb6f5fd7e8ce437a22c5d0571ef6 | [
"MIT"
] | null | null | null | address/address.py | felipeit/fdme_kivy | 208a823e2995cb6f5fd7e8ce437a22c5d0571ef6 | [
"MIT"
] | null | null | null | ADDRESS_WEBSOCKET = "ws://127.0.0.1/socket"
ADDRESS_API = "https://127.0.0.1/api"
ADDRESS_API_SEARCH = "https://127.0.0.1/api/search/"
| 27.2 | 52 | 0.691176 | ADDRESS_WEBSOCKET = "ws://127.0.0.1/socket"
ADDRESS_API = "https://127.0.0.1/api"
ADDRESS_API_SEARCH = "https://127.0.0.1/api/search/"
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d917c88245fbde15eced6a414e27ff05aebb3cc0 | 1,154 | py | Python | B2G/gecko/ipc/ipdl/ipdl/builtin.py | wilebeast/FireFox-OS | 43067f28711d78c429a1d6d58c77130f6899135f | [
"Apache-2.0"
] | 3 | 2015-08-31T15:24:31.000Z | 2020-04-24T20:31:29.000Z | B2G/gecko/ipc/ipdl/ipdl/builtin.py | wilebeast/FireFox-OS | 43067f28711d78c429a1d6d58c77130f6899135f | [
"Apache-2.0"
] | null | null | null | B2G/gecko/ipc/ipdl/ipdl/builtin.py | wilebeast/FireFox-OS | 43067f28711d78c429a1d6d58c77130f6899135f | [
"Apache-2.0"
] | 3 | 2015-07-29T07:17:15.000Z | 2020-11-04T06:55:37.000Z | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# WARNING: the syntax of the builtin types is not checked, so please
# don't add something syntactically invalid. It wi... | 20.245614 | 77 | 0.601386 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# WARNING: the syntax of the builtin types is not checked, so please
# don't add something syntactically invalid. It wi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7d2c18914401aab779ccd2c9fce8b81824a01a0c | 10,305 | py | Python | particle_swarm_optimization.py | vctrop/ant_colony_for_continuous_domains | a109abfca35be4d0453c7e01f6f755c11ae09473 | [
"MIT"
] | 1 | 2019-06-19T06:32:46.000Z | 2019-06-19T06:32:46.000Z | particle_swarm_optimization.py | vctrop/ant_colony_for_continuous_domains | a109abfca35be4d0453c7e01f6f755c11ae09473 | [
"MIT"
] | null | null | null | particle_swarm_optimization.py | vctrop/ant_colony_for_continuous_domains | a109abfca35be4d0453c7e01f6f755c11ae09473 | [
"MIT"
] | 5 | 2019-05-18T03:04:04.000Z | 2020-03-04T03:23:35.000Z | #!python3
# Copyright (C) 2020 Victor O. Costa
# 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 3 of the License, or
# (at your option) any later version.
# This program is dis... | 51.525 | 185 | 0.625133 | #!python3
# Copyright (C) 2020 Victor O. Costa
# 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 3 of the License, or
# (at your option) any later version.
# This program is dis... | 0 | 0 | 0 | 9,442 | 0 | 0 | 0 | 11 | 102 |
954c4659ef00a9ff38584cddd2b13585040a5d3b | 1,281 | py | Python | tests/unit_tests/controller/test_FGTTool.py | p2irc/friendly_ground_truth | 69415a435ff46d424bf204894a1691dd2e900fc6 | [
"MIT"
] | null | null | null | tests/unit_tests/controller/test_FGTTool.py | p2irc/friendly_ground_truth | 69415a435ff46d424bf204894a1691dd2e900fc6 | [
"MIT"
] | 139 | 2020-02-23T16:42:10.000Z | 2021-07-26T23:19:53.000Z | tests/unit_tests/controller/test_FGTTool.py | p2irc/friendly_ground_truth | 69415a435ff46d424bf204894a1691dd2e900fc6 | [
"MIT"
] | null | null | null | """
File Name: test_FGTTool.py
Authors: Kyle Seidenthal
Date: 11-05-2020
Description: Tests for the FGT Tool Class
"""
| 19.707692 | 73 | 0.57377 | """
File Name: test_FGTTool.py
Authors: Kyle Seidenthal
Date: 11-05-2020
Description: Tests for the FGT Tool Class
"""
import pytest
from friendly_ground_truth.controller.tools import FGTTool
from mock import MagicMock
class TestFGTTool():
"""
Tests for the FGTTool superclass
"""
def test_init... | 0 | 0 | 0 | 1,032 | 0 | 0 | 0 | 34 | 91 |
535c2090b585ef01956090b8e1aa58af2c8d06d4 | 359 | py | Python | tests/worlds/mazeworld/test_finishing_maze_gives_terminal.py | LaudateCorpus1/holodeck | 521c1c828f47abe7fc24b027fb907eaf26495aed | [
"MIT"
] | 518 | 2018-10-05T00:14:50.000Z | 2022-03-06T22:24:47.000Z | tests/worlds/mazeworld/test_finishing_maze_gives_terminal.py | LaudateCorpus1/holodeck | 521c1c828f47abe7fc24b027fb907eaf26495aed | [
"MIT"
] | 240 | 2018-10-05T04:53:18.000Z | 2021-04-29T22:21:30.000Z | tests/worlds/mazeworld/test_finishing_maze_gives_terminal.py | LaudateCorpus1/holodeck | 521c1c828f47abe7fc24b027fb907eaf26495aed | [
"MIT"
] | 36 | 2018-10-05T07:09:58.000Z | 2022-03-09T12:32:44.000Z | """
Make sure that when completing MazeWorld, if the agent navigates to the end, the
state is marked as terminal at some point.
"""
| 23.933333 | 80 | 0.732591 | """
Make sure that when completing MazeWorld, if the agent navigates to the end, the
state is marked as terminal at some point.
"""
import holodeck
def test_finishing_maze_gives_terminal(complete_mazeworld_states):
for _, _, terminal, _ in complete_mazeworld_states:
if terminal:
return
a... | 0 | 0 | 0 | 0 | 0 | 186 | 0 | -6 | 45 |
32115921aa2f70c139f1e8cdeb5805c7059068be | 5,107 | py | Python | timing/migrations/0001_initial.py | uwmadison-chm/breath_web | 751e2281815c88eccd803b862366665ae9e37e1a | [
"MIT"
] | null | null | null | timing/migrations/0001_initial.py | uwmadison-chm/breath_web | 751e2281815c88eccd803b862366665ae9e37e1a | [
"MIT"
] | null | null | null | timing/migrations/0001_initial.py | uwmadison-chm/breath_web | 751e2281815c88eccd803b862366665ae9e37e1a | [
"MIT"
] | null | null | null | # encoding: utf-8
| 56.744444 | 115 | 0.595457 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Participant'
db.create_table('timing_participant', (
('id', self.gf('django.db... | 0 | 0 | 0 | 4,960 | 0 | 0 | 0 | 18 | 111 |
0745599b0e90c193e690bff15f596569faa4e2f1 | 5,712 | py | Python | brightcove/SocialSyndication.py | asha-bc/BrightcovePY | 52e220e8e95221745b4de52ba94689509d27c072 | [
"MIT"
] | 3 | 2020-12-14T23:08:09.000Z | 2021-08-05T05:44:19.000Z | brightcove/SocialSyndication.py | asha-bc/BrightcovePY | 52e220e8e95221745b4de52ba94689509d27c072 | [
"MIT"
] | null | null | null | brightcove/SocialSyndication.py | asha-bc/BrightcovePY | 52e220e8e95221745b4de52ba94689509d27c072 | [
"MIT"
] | 2 | 2021-10-19T15:24:28.000Z | 2022-03-08T08:17:30.000Z | """
Implements wrapper class and methods to work with Brightcove's Social Syndication API.
See: https://apis.support.brightcove.com/social-syndication/getting-started/public-syndication-api-overview.html
"""
| 36.851613 | 112 | 0.737745 | """
Implements wrapper class and methods to work with Brightcove's Social Syndication API.
See: https://apis.support.brightcove.com/social-syndication/getting-started/public-syndication-api-overview.html
"""
from typing import Union
from requests.models import Response
from .Base import Base
from .OAuth import OAuth
... | 0 | 0 | 0 | 5,369 | 0 | 0 | 0 | 22 | 112 |
a4d9e667372ec6858f5326a0a8e9665beedffc4d | 7,280 | py | Python | bot.py | siddhantchimankar/Instagram-bot | 14bf731909fb0a44220e483ea1d2162ccef6fabc | [
"Apache-2.0"
] | null | null | null | bot.py | siddhantchimankar/Instagram-bot | 14bf731909fb0a44220e483ea1d2162ccef6fabc | [
"Apache-2.0"
] | null | null | null | bot.py | siddhantchimankar/Instagram-bot | 14bf731909fb0a44220e483ea1d2162ccef6fabc | [
"Apache-2.0"
] | null | null | null | from selenium.webdriver.chrome.options import Options
options = Options()
options.add_argument("start-maximized")
options.add_argument("disable-infobars")
options.add_argument("--disable-extensions")
totalLikes = 0
hashtags = ["doodlesofinstagram", "sociallyawkward", "millenials", "comicoftheday", "inmy... | 31.244635 | 164 | 0.555907 | from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.we... | 0 | 0 | 0 | 5,496 | 0 | 0 | 0 | 164 | 256 |
8fda75e56ad3584af6a4ded6377a33bfeeb9bf2d | 2,110 | py | Python | wxc_sdk/workspace_settings/__init__.py | jeokrohn/wxc_sdk | e28b7e0f870d17b7f9a79ad9a4b8af221e58f8e9 | [
"MIT"
] | null | null | null | wxc_sdk/workspace_settings/__init__.py | jeokrohn/wxc_sdk | e28b7e0f870d17b7f9a79ad9a4b8af221e58f8e9 | [
"MIT"
] | null | null | null | wxc_sdk/workspace_settings/__init__.py | jeokrohn/wxc_sdk | e28b7e0f870d17b7f9a79ad9a4b8af221e58f8e9 | [
"MIT"
] | 1 | 2022-03-29T18:56:59.000Z | 2022-03-29T18:56:59.000Z | """
Workspace settings, mostly identical to user settings
"""
__all__ = ['WorkspaceSettingsApi']
| 43.061224 | 118 | 0.788626 | """
Workspace settings, mostly identical to user settings
"""
from dataclasses import dataclass
from ..api_child import ApiChild
from ..person_settings.call_intercept import CallInterceptApi
from ..person_settings.call_waiting import CallWaitingApi
from ..person_settings.caller_id import CallerIdApi
from ..person_set... | 0 | 1,414 | 0 | 0 | 0 | 0 | 0 | 330 | 266 |
1abb36793fe016be519eb96eb75623172a21c09a | 287 | py | Python | .binder/streamlit_call.py | op07n/minimal-streamlit-example | 1af747769dee3a5414da57ca3b66ea915d0fd06a | [
"MIT"
] | null | null | null | .binder/streamlit_call.py | op07n/minimal-streamlit-example | 1af747769dee3a5414da57ca3b66ea915d0fd06a | [
"MIT"
] | null | null | null | .binder/streamlit_call.py | op07n/minimal-streamlit-example | 1af747769dee3a5414da57ca3b66ea915d0fd06a | [
"MIT"
] | null | null | null | from subprocess import Popen
def load_jupyter_server_extension(nbapp):
"""serve the bokeh-app directory with bokeh server"""
Popen(["streamlit", "run", "st_runner.py", "apps", "--browser.serverAddress=0.0.0.0", "--server.enableCORS=False", "--browser.gatherUsageStats=False"])
| 41 | 155 | 0.721254 | from subprocess import Popen
def load_jupyter_server_extension(nbapp):
"""serve the bokeh-app directory with bokeh server"""
Popen(["streamlit", "run", "st_runner.py", "apps", "--browser.serverAddress=0.0.0.0", "--server.enableCORS=False", "--browser.gatherUsageStats=False"])
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c247efcb25b56c20b36b8972ee172b33137fd780 | 3,709 | py | Python | daemon.py | kamikat/zoodocker | 4be1ccf5a489e4113230d346afd5197706de5415 | [
"MIT"
] | null | null | null | daemon.py | kamikat/zoodocker | 4be1ccf5a489e4113230d346afd5197706de5415 | [
"MIT"
] | null | null | null | daemon.py | kamikat/zoodocker | 4be1ccf5a489e4113230d346afd5197706de5415 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import logging
from sys import stderr
from kazoo.client import KazooClient
logging.basicConfig()
node_id = '%s/%d' % (os.uname()[1], os.getpid())
print >>stderr, 'Connecting...'
zk = KazooClient(hosts=os.getenv('ZK_HOST', '127.0.0.1:2181'))
service_ns = os.getenv('SERVICE_NAMESPACE... | 28.976563 | 78 | 0.660825 | #!/usr/bin/env python
import os
import logging
from sys import argv, stderr, exit
from os.path import isdir, exists, join, relpath
from os import makedirs, rename
from shutil import rmtree
from time import sleep
from kazoo.client import KazooClient, KazooState
logging.basicConfig()
node_id = '%s/%d' % (os.uname()[1]... | 0 | 276 | 0 | 0 | 0 | 2,567 | 0 | 66 | 249 |
1ccc957f363b1a11bf17584ea029163cee07ea95 | 2,623 | py | Python | modules/meme_factory.py | arvind0598/chatbot | fdea2741e6780d6cec1fae6b139786da61c6f340 | [
"Unlicense"
] | null | null | null | modules/meme_factory.py | arvind0598/chatbot | fdea2741e6780d6cec1fae6b139786da61c6f340 | [
"Unlicense"
] | null | null | null | modules/meme_factory.py | arvind0598/chatbot | fdea2741e6780d6cec1fae6b139786da61c6f340 | [
"Unlicense"
] | null | null | null | import os
# DOCS: https://api.imgflip.com/
dirpath = os.path.dirname(os.path.abspath(__file__))
config_dir = os.path.join(dirpath, "configs")
meme_conf_name = os.path.join(config_dir, "meme_conf.json")
os.makedirs(config_dir, exist_ok=True)
# Method: GET
template_url = "https://api.imgflip.com/get_memes"
# Method:... | 30.149425 | 106 | 0.569196 | import requests
import os
import json
# DOCS: https://api.imgflip.com/
dirpath = os.path.dirname(os.path.abspath(__file__))
config_dir = os.path.join(dirpath, "configs")
meme_conf_name = os.path.join(config_dir, "meme_conf.json")
os.makedirs(config_dir, exist_ok=True)
# Method: GET
template_url = "https://api.imgfl... | 0 | 0 | 0 | 0 | 0 | 1,558 | 0 | -16 | 113 |
3818700d2c854a94cf7f5eaea05e315f75e889a0 | 419 | py | Python | website/Blog-site/site_0.3/server.py | VictorXianwu/Python-Program | 9abe0a3a84a837f863db8a4eb58c913cdba9f6f1 | [
"MIT"
] | 3 | 2017-09-05T02:34:46.000Z | 2019-11-23T01:01:12.000Z | website/Blog-site/site_0.3/server.py | VictorXianwu/Python-Program | 9abe0a3a84a837f863db8a4eb58c913cdba9f6f1 | [
"MIT"
] | null | null | null | website/Blog-site/site_0.3/server.py | VictorXianwu/Python-Program | 9abe0a3a84a837f863db8a4eb58c913cdba9f6f1 | [
"MIT"
] | 1 | 2018-03-13T14:12:42.000Z | 2018-03-13T14:12:42.000Z | #!/usr/bin/python
#!coding: utf-8
import tornado.httpserver
import tornado.ioloop
import tornado.options
from tornado.options import options
from application import Application
if __name__ == '__main__':
tornado.options.parse_command_line()
print "open server!"
http_server = tornado.httpserver.HTTPServer... | 24.647059 | 62 | 0.76611 | #!/usr/bin/python
#!coding: utf-8
import tornado.httpserver
import tornado.ioloop
import tornado.options
from tornado.options import options
from application import Application
if __name__ == '__main__':
tornado.options.parse_command_line()
print "open server!"
http_server = tornado.httpserver.HTTPServe... | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d160e71ff98965caa4d1d0037781382b14e4ea3e | 1,581 | py | Python | config.py | ruiming46zrm/CurricularFace | d853f3d28659f0929469029ec80e29e91e7b24c1 | [
"MIT"
] | 433 | 2020-04-02T04:24:50.000Z | 2022-03-21T12:57:53.000Z | config.py | clscy/CurricularFace | d853f3d28659f0929469029ec80e29e91e7b24c1 | [
"MIT"
] | 35 | 2020-04-09T02:13:52.000Z | 2022-03-07T07:48:10.000Z | config.py | clscy/CurricularFace | d853f3d28659f0929469029ec80e29e91e7b24c1 | [
"MIT"
] | 72 | 2020-04-02T21:57:37.000Z | 2022-01-10T02:50:33.000Z |
configurations = {
1: dict(
SEED = 1337, # random seed for reproduce results
DATA_ROOT = '/data2/yugehuang/data/', # the parent root where your train/val/test data are stored
RECORD_DIR = '/data2/yugehuang/data/refined_ms1m.txt', # the dataset record dir
MODEL_ROOT = './train_log/mo... | 45.171429 | 153 | 0.590765 | import torch
configurations = {
1: dict(
SEED = 1337, # random seed for reproduce results
DATA_ROOT = '/data2/yugehuang/data/', # the parent root where your train/val/test data are stored
RECORD_DIR = '/data2/yugehuang/data/refined_ms1m.txt', # the dataset record dir
MODEL_ROOT = '.... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -9 | 22 |
77d2288b5bd38dadb36d0e83f2940d1495a78687 | 1,020 | py | Python | Python3/368.largest-divisible-subset.py | 610yilingliu/leetcode | 30d071b3685c2131bd3462ba77c6c05114f3f227 | [
"MIT"
] | null | null | null | Python3/368.largest-divisible-subset.py | 610yilingliu/leetcode | 30d071b3685c2131bd3462ba77c6c05114f3f227 | [
"MIT"
] | null | null | null | Python3/368.largest-divisible-subset.py | 610yilingliu/leetcode | 30d071b3685c2131bd3462ba77c6c05114f3f227 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=368 lang=python3
#
# [368] Largest Divisible Subset
#
# @lc code=start
# if __name__ == '__main__':
# a = Solution()
# b = a.largestDivisibleSubset([1,2,4,8,16])
# print(b)
# @lc code=end
| 25.5 | 48 | 0.40098 | #
# @lc app=leetcode id=368 lang=python3
#
# [368] Largest Divisible Subset
#
# @lc code=start
class Solution:
def largestDivisibleSubset(self, nums):
"""
:type nums: List[int]
:rtype: List[int]
"""
if len(nums) == 0:
return []
nums.sort()
dp = [1... | 0 | 0 | 0 | 771 | 0 | 0 | 0 | 0 | 22 |
3b3e4e111d7ce31c37cf7a8ff45725562ae1694b | 1,815 | py | Python | aspen/resources/rendered_resource.py | Acidburn0zzz/aspen-python | 3b25a3ca041bd0bf4d313f7fc3a15cf092903de7 | [
"MIT"
] | null | null | null | aspen/resources/rendered_resource.py | Acidburn0zzz/aspen-python | 3b25a3ca041bd0bf4d313f7fc3a15cf092903de7 | [
"MIT"
] | null | null | null | aspen/resources/rendered_resource.py | Acidburn0zzz/aspen-python | 3b25a3ca041bd0bf4d313f7fc3a15cf092903de7 | [
"MIT"
] | null | null | null | """
aspen.resources.rendered_resource
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Implements rendered resources.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
| 30.25 | 79 | 0.706887 | """
aspen.resources.rendered_resource
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Implements rendered resources.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from aspen.resources.negotiated_resource import NegotiatedReso... | 0 | 0 | 0 | 1,378 | 0 | 0 | 0 | 89 | 90 |
689eeda4edd513c2bdaddbc5ab448c40d883447e | 6,237 | py | Python | bert2tf/__init__.py | xiongma/bert2tf | 105fd1524edb703bf68aec8fde289de5923e1f78 | [
"Apache-2.0"
] | 7 | 2021-08-05T16:35:08.000Z | 2022-01-04T03:26:10.000Z | bert2tf/__init__.py | xiongma/bert2tf | 105fd1524edb703bf68aec8fde289de5923e1f78 | [
"Apache-2.0"
] | 96 | 2021-08-06T08:32:09.000Z | 2022-01-21T11:07:25.000Z | bert2tf/__init__.py | xiongma/bert2tf | 105fd1524edb703bf68aec8fde289de5923e1f78 | [
"Apache-2.0"
] | null | null | null | import os
import sys
from types import SimpleNamespace
if sys.version_info >= (3, 10, 0) or sys.version_info < (3, 8, 0):
raise OSError(f'bert2tf requires Python 3.8/3.9, but yours is {sys.version}')
__proto_version__ = '0.0.22'
BERT2TF_GLOBAL = SimpleNamespace()
BERT2TF_GLOBAL.imported = SimpleNamespace()
BERT2... | 36.905325 | 125 | 0.635241 | import os
import sys
from types import SimpleNamespace
if sys.version_info >= (3, 10, 0) or sys.version_info < (3, 8, 0):
raise OSError(f'bert2tf requires Python 3.8/3.9, but yours is {sys.version}')
__proto_version__ = '0.0.22'
BERT2TF_GLOBAL = SimpleNamespace()
BERT2TF_GLOBAL.imported = SimpleNamespace()
BERT2... | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 578 | 357 |
bd3ecd0d16532c699eca26e0a9ae4ca4b43344fb | 22,107 | py | Python | Project2_AdvanceLaneFinding.py | PrabhaSNR/ND_Project2_AdvancedLaneFinding | e303d71a0c071b0042b72cefe0cedf525d42b407 | [
"MIT"
] | null | null | null | Project2_AdvanceLaneFinding.py | PrabhaSNR/ND_Project2_AdvancedLaneFinding | e303d71a0c071b0042b72cefe0cedf525d42b407 | [
"MIT"
] | null | null | null | Project2_AdvanceLaneFinding.py | PrabhaSNR/ND_Project2_AdvancedLaneFinding | e303d71a0c071b0042b72cefe0cedf525d42b407 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[57]:
get_ipython().run_line_magic('matplotlib', 'qt')
# In[58]:
# In[59]:
# In[60]:
# In[61]:
# In[62]:
# In[63]:
# In[64]:
# In[65]:
# In[66]:
# In[67]:
# In[68]:
# Import everything needed to edit/save/watch video clips
from moviepy.edito... | 38.920775 | 180 | 0.690053 | #!/usr/bin/env python
# coding: utf-8
# In[57]:
import numpy as np
import cv2
import glob
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
get_ipython().run_line_magic('matplotlib', 'qt')
def camera_calibration():
nx=9
ny=6
# prepare object points, like (0,0,0), (1,0,0), (2,0,0) ....,(6,5,0)
obj... | 0 | 0 | 0 | 0 | 0 | 19,972 | 0 | 8 | 508 |
d0980f545267f7627876eee9ea24d377283ef2c2 | 11,801 | py | Python | mindinsight/debugger/common/exceptions/exceptions.py | mindspore-ai/mindinsight | 8c57fdd62eb7f8653662be2208633386ac82e8d7 | [
"Apache-2.0"
] | 216 | 2020-03-28T02:11:56.000Z | 2022-03-31T06:20:09.000Z | mindinsight/debugger/common/exceptions/exceptions.py | mindspore-ai/mindinsight | 8c57fdd62eb7f8653662be2208633386ac82e8d7 | [
"Apache-2.0"
] | 13 | 2020-03-31T03:00:12.000Z | 2021-01-03T13:01:06.000Z | mindinsight/debugger/common/exceptions/exceptions.py | mindspore-ai/mindinsight | 8c57fdd62eb7f8653662be2208633386ac82e8d7 | [
"Apache-2.0"
] | 21 | 2020-03-28T02:41:06.000Z | 2021-11-24T12:20:25.000Z | # Copyright 2020-2021 Huawei Technologies Co., Ltd
#
# 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 agre... | 35.122024 | 116 | 0.698076 | # Copyright 2020-2021 Huawei Technologies Co., Ltd
#
# 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 agre... | 0 | 0 | 0 | 10,203 | 0 | 0 | 0 | 113 | 711 |
229953d153a54b454ca805c1f1feb7f6e3076b67 | 2,110 | py | Python | bluebutton/parsers/_ccda/procedures.py | r4dat/bluebutton_priv | 4acf99605239b79e187009b7de3ecf43b796d6c4 | [
"Apache-2.0"
] | null | null | null | bluebutton/parsers/_ccda/procedures.py | r4dat/bluebutton_priv | 4acf99605239b79e187009b7de3ecf43b796d6c4 | [
"Apache-2.0"
] | null | null | null | bluebutton/parsers/_ccda/procedures.py | r4dat/bluebutton_priv | 4acf99605239b79e187009b7de3ecf43b796d6c4 | [
"Apache-2.0"
] | null | null | null | ###############################################################################
# Copyright 2015 University of Florida. All rights reserved.
# This file is part of the BlueButton.py project.
# Use of this source code is governed by the license found in the LICENSE file.
#################################################... | 29.71831 | 79 | 0.558768 | ###############################################################################
# Copyright 2015 University of Florida. All rights reserved.
# This file is part of the BlueButton.py project.
# Use of this source code is governed by the license found in the LICENSE file.
#################################################... | 0 | 0 | 0 | 0 | 0 | 1,631 | 0 | 7 | 46 |
4eae973957229fc9cc9b6e3a8a2c3ebd00cd984b | 1,956 | py | Python | tests/test_bert_vectorizer.py | wellcometrust/WellcomeML | f7f5427f6dfdc6e5ee1342764263c6411e0f9bdf | [
"MIT"
] | 29 | 2020-01-31T17:05:38.000Z | 2021-12-14T14:17:55.000Z | tests/test_bert_vectorizer.py | wellcometrust/WellcomeML | f7f5427f6dfdc6e5ee1342764263c6411e0f9bdf | [
"MIT"
] | 342 | 2020-02-05T10:40:43.000Z | 2022-03-17T19:50:23.000Z | tests/test_bert_vectorizer.py | wellcometrust/WellcomeML | f7f5427f6dfdc6e5ee1342764263c6411e0f9bdf | [
"MIT"
] | 9 | 2020-06-07T17:01:00.000Z | 2021-11-24T16:03:38.000Z | # encoding: utf-8
EMBEDDING_TYPES = [
"mean_second_to_last",
"mean_last",
"sum_last",
"mean_last_four",
"pooler"
]
| 23.566265 | 63 | 0.642638 | # encoding: utf-8
import pytest
from wellcomeml.ml.bert_vectorizer import BertVectorizer
EMBEDDING_TYPES = [
"mean_second_to_last",
"mean_last",
"sum_last",
"mean_last_four",
"pooler"
]
@pytest.fixture
def vec(scope='module'):
vectorizer = BertVectorizer()
vectorizer.fit()
return ve... | 0 | 1,604 | 0 | 0 | 0 | 0 | 0 | 27 | 183 |
ffccf67da83e274a2b0a1945d6a76e3a88b22a32 | 6,013 | py | Python | Dangerous/Golismero/tools/sqlmap/lib/utils/crawler.py | JeyZeta/Dangerous- | 824ea6b571eda98bb855f176361e9b35dfda578e | [
"MIT"
] | null | null | null | Dangerous/Golismero/tools/sqlmap/lib/utils/crawler.py | JeyZeta/Dangerous- | 824ea6b571eda98bb855f176361e9b35dfda578e | [
"MIT"
] | null | null | null | Dangerous/Golismero/tools/sqlmap/lib/utils/crawler.py | JeyZeta/Dangerous- | 824ea6b571eda98bb855f176361e9b35dfda578e | [
"MIT"
] | 1 | 2018-07-04T18:35:16.000Z | 2018-07-04T18:35:16.000Z | #!/usr/bin/env python
"""
Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
| 40.086667 | 178 | 0.516547 | #!/usr/bin/env python
"""
Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import httplib
import re
import urlparse
import time
from lib.core.common import clearConsoleLine
from lib.core.common import dataToStdout
from lib.core.common import findPag... | 0 | 0 | 0 | 0 | 0 | 5,162 | 0 | 286 | 421 |
330199c38decbcd189a4f867055677d31bfede72 | 489 | py | Python | src/temp_combine.py | relikd/md2tufte | 6de26b83b14d4e4a45d442da185ad553c1a62c4b | [
"MIT"
] | null | null | null | src/temp_combine.py | relikd/md2tufte | 6de26b83b14d4e4a45d442da185ad553c1a62c4b | [
"MIT"
] | null | null | null | src/temp_combine.py | relikd/md2tufte | 6de26b83b14d4e4a45d442da185ad553c1a62c4b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import sys
if len(sys.argv) != 3:
print(' usage: script {template-tmp-file} {body-file}')
exit(1)
temp = sys.argv[1]
body = sys.argv[2]
if not os.path.isfile(temp) or not os.path.isfile(body):
print('Error: file does not exist')
exit(1)
f_temp = ''
f_body = ''
with o... | 21.26087 | 60 | 0.613497 | #!/usr/bin/env python3
import os
import sys
if len(sys.argv) != 3:
print(' usage: script {template-tmp-file} {body-file}')
exit(1)
temp = sys.argv[1]
body = sys.argv[2]
if not os.path.isfile(temp) or not os.path.isfile(body):
print('Error: file does not exist')
exit(1)
f_temp = ''
f_body = ''
with o... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
86130c360719f7aeb43af14057717778a99903b7 | 2,362 | py | Python | pyuploadtool/__main__.py | TheAssassin/pyuploadtool | e56aab1dc2f334038dc30869f0181bd3555ea512 | [
"MIT"
] | 6 | 2020-12-12T14:09:28.000Z | 2021-06-29T06:23:11.000Z | pyuploadtool/__main__.py | TheAssassin/pyuploadtool | e56aab1dc2f334038dc30869f0181bd3555ea512 | [
"MIT"
] | 7 | 2020-12-11T19:50:03.000Z | 2022-01-08T00:24:42.000Z | pyuploadtool/__main__.py | TheAssassin/pyuploadtool | e56aab1dc2f334038dc30869f0181bd3555ea512 | [
"MIT"
] | 3 | 2020-12-12T14:00:49.000Z | 2021-06-19T12:31:11.000Z | """
Commandline interface.
"""
import os
import sys
from pyuploadtool import (update_metadata_with_user_specified_data)
from pyuploadtool.logging import make_logger, setup_logging
setup_logging()
logger = make_logger("cli")
# TODO: use some real CLI library
artifacts = sys.argv[1:]
if not artifacts:
logger.e... | 28.804878 | 94 | 0.757832 | """
Commandline interface.
"""
import os
import sys
from pyuploadtool import (
ReleaseMetadata,
ReleasesHostingProviderFactory,
update_metadata_with_user_specified_data,
BuildSystemFactory,
)
from pyuploadtool.logging import make_logger, setup_logging
setup_logging()
logger = make_logger("cli")
# ... | 0 | 0 | 0 | 0 | 0 | 1,003 | 0 | 88 | 46 |
85dafe936950776d6da3d2c8edf46ba2ab4d7b3a | 76 | py | Python | catnado/utils/__init__.py | tylertrussell/gae-catnado | 91a73e9108bb724fb780cc8dcfca4da579313cb9 | [
"Apache-2.0"
] | null | null | null | catnado/utils/__init__.py | tylertrussell/gae-catnado | 91a73e9108bb724fb780cc8dcfca4da579313cb9 | [
"Apache-2.0"
] | null | null | null | catnado/utils/__init__.py | tylertrussell/gae-catnado | 91a73e9108bb724fb780cc8dcfca4da579313cb9 | [
"Apache-2.0"
] | null | null | null | """Miscellaneous utilities for working within an App Engine environment."""
| 38 | 75 | 0.789474 | """Miscellaneous utilities for working within an App Engine environment."""
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
55e2b94a913f9c1a55be4682485f3a8c8246ff60 | 730 | py | Python | cms_plugin_directory/migrations/0005_auto_20190530_1152.py | HerbyDE/jagdreisencheck-webapp | 9af5deda2423b787da88a0c893f3c474d8e4f73f | [
"BSD-3-Clause"
] | null | null | null | cms_plugin_directory/migrations/0005_auto_20190530_1152.py | HerbyDE/jagdreisencheck-webapp | 9af5deda2423b787da88a0c893f3c474d8e4f73f | [
"BSD-3-Clause"
] | null | null | null | cms_plugin_directory/migrations/0005_auto_20190530_1152.py | HerbyDE/jagdreisencheck-webapp | 9af5deda2423b787da88a0c893f3c474d8e4f73f | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 2.0.13 on 2019-05-30 09:52
| 38.421053 | 374 | 0.710959 | # Generated by Django 2.0.13 on 2019-05-30 09:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cms_plugin_directory', '0004_auto_20190321_1043'),
]
operations = [
migrations.AlterField(
model_name='cardconfig',
... | 0 | 0 | 0 | 615 | 0 | 0 | 0 | 19 | 46 |
76c70b89ba83c33a8df48fa5a8e1d2467601f941 | 8,470 | py | Python | datadog-json-to-terraform/src/utils/datadog_api.py | shashoul/Getting-Started-Terraform | 5340425b5e5b3e69a1ad392c2a5e718ced3f6aed | [
"MIT"
] | null | null | null | datadog-json-to-terraform/src/utils/datadog_api.py | shashoul/Getting-Started-Terraform | 5340425b5e5b3e69a1ad392c2a5e718ced3f6aed | [
"MIT"
] | null | null | null | datadog-json-to-terraform/src/utils/datadog_api.py | shashoul/Getting-Started-Terraform | 5340425b5e5b3e69a1ad392c2a5e718ced3f6aed | [
"MIT"
] | null | null | null | import os, logging, json
from datadog import api, initialize
from datadog_api_client.v2 import Configuration
options = {
'api_key': os.getenv("DD_API_KEY"),
'app_key': os.getenv("DD_APP_KEY")
}
initialize(**options)
configuration = Configuration()
def dd_resource_remove_keys(dd_resource:dict, dd_resource_... | 35 | 129 | 0.605903 | import os, logging, json
from datadog import api, initialize
from datadog_api_client.v2 import ApiClient, ApiException, Configuration
from datadog_api_client.v2.api import logs_metrics_api
options = {
'api_key': os.getenv("DD_API_KEY"),
'app_key': os.getenv("DD_APP_KEY")
}
initialize(**options)
configuratio... | 0 | 0 | 0 | 0 | 0 | 1,900 | 0 | 58 | 68 |
a2369da7b601af490e484f4cc2774c3c99c86dee | 1,623 | py | Python | tests/test_hangman.py | dshulchevskii/hangman | fc7d0676e925f4181f222cc3fd6301e92b5b653e | [
"MIT"
] | null | null | null | tests/test_hangman.py | dshulchevskii/hangman | fc7d0676e925f4181f222cc3fd6301e92b5b653e | [
"MIT"
] | null | null | null | tests/test_hangman.py | dshulchevskii/hangman | fc7d0676e925f4181f222cc3fd6301e92b5b653e | [
"MIT"
] | null | null | null | import hangman.game
WIN_LOG = """
Guess a letter:
a
Missed, mistake 1 out of 5.
The word: *****
Guess a letter:
b
Missed, mistake 2 out of 5.
The word: *****
Guess a letter:
e
Hit!
The word: *e***
Guess a letter:
o
Hit!
The word: *e**o
Guess a letter:
l
Hit!
The word: *ello
Guess a letter:
h
Hit!
The word... | 13.754237 | 59 | 0.64695 | from string import ascii_lowercase
import hangman.game
import hangman
def input_capture(word):
letters = list(reversed(word))
def func():
char = letters.pop()
print(char) # emulate input log
return char
return func
WIN_LOG = """
Guess a letter:
a
Missed, mistake 1 out ... | 0 | 0 | 0 | 0 | 0 | 739 | 0 | 6 | 136 |
e4616d765175fc2b737b5f4444dd1c1364ceebaa | 4,637 | py | Python | graph_learning/src/brain.py | ZhiangChen/vca | 22b7568ac1894a56e7e64443565f7e44e096d778 | [
"MIT"
] | null | null | null | graph_learning/src/brain.py | ZhiangChen/vca | 22b7568ac1894a56e7e64443565f7e44e096d778 | [
"MIT"
] | 2 | 2018-03-11T04:45:21.000Z | 2018-07-04T02:10:36.000Z | graph_learning/src/brain.py | ZhiangChen/vca | 22b7568ac1894a56e7e64443565f7e44e096d778 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
"""
brain.py
Zhiang Chen
4/18/2018
"""
import argparse
import torch
import torch.nn as nn
from torch.optim import Adam
from torch.autograd import Variable
import torch.nn.functional as F
from relationNet import relationNet
from rl.ddpg import DDPG
from rl.naf import Policy
from rl.normalized_ac... | 31.120805 | 88 | 0.656459 | #!/usr/bin/env python2
"""
brain.py
Zhiang Chen
4/18/2018
"""
import argparse
import torch
import torch.nn as nn
from torch.optim import Adam
from torch.autograd import Variable
import torch.nn.functional as F
from relationNet import relationNet
from rl.ddpg import DDPG
from rl.naf import Policy
from rl.normalized_ac... | 0 | 0 | 0 | 2,495 | 0 | 311 | 0 | 0 | 95 |
3a4126d02954f53d399ce743d1ee4173c133f534 | 108 | py | Python | exercises/pyfiles/ex293_listlength.py | TUDelft-AE-Python/ae1205-exercises | 342d1d567b64d3ccb3371ce9826c02a87a155fa8 | [
"MIT"
] | 1 | 2021-10-05T04:49:54.000Z | 2021-10-05T04:49:54.000Z | exercises/pyfiles/ex293_listlength.py | TUDelft-AE1205/ae1205-exercises | 342d1d567b64d3ccb3371ce9826c02a87a155fa8 | [
"MIT"
] | null | null | null | exercises/pyfiles/ex293_listlength.py | TUDelft-AE1205/ae1205-exercises | 342d1d567b64d3ccb3371ce9826c02a87a155fa8 | [
"MIT"
] | null | null | null | values = [[10, 20], [30, 40, 50, 60, 70]]
for i in range(len(values)):
print(len(values[i]), values[i]) | 27 | 41 | 0.574074 | values = [[10, 20], [30, 40, 50, 60, 70]]
for i in range(len(values)):
print(len(values[i]), values[i]) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
812946564aa61de6a8fab41b9c9fbfdae4bc8aeb | 70,004 | py | Python | core/controllers/acl_decorators_test.py | steve7158/oppia | e2cae72fa5d3503c64d195f09d3460507697730c | [
"Apache-2.0"
] | 2 | 2018-12-14T05:46:31.000Z | 2019-01-04T21:52:44.000Z | core/controllers/acl_decorators_test.py | steve7158/oppia | e2cae72fa5d3503c64d195f09d3460507697730c | [
"Apache-2.0"
] | 5 | 2018-06-09T02:05:45.000Z | 2018-09-20T13:53:42.000Z | core/controllers/acl_decorators_test.py | steve7158/oppia | e2cae72fa5d3503c64d195f09d3460507697730c | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2017 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 41.373522 | 132 | 0.685489 | # coding: utf-8
#
# Copyright 2017 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 0 | 3,374 | 0 | 64,830 | 0 | 0 | 0 | 148 | 955 |
e9ea1a8f803106b17e7bc516cc6daf49ec4524ba | 636 | py | Python | greatest_common_divisor/greatest_common_divisor.py | arczan1/my_daily_code | 899951e0243aa1bbc867ec1c2b3c727171843dc8 | [
"MIT"
] | 2 | 2020-05-11T13:31:20.000Z | 2020-07-15T21:07:13.000Z | greatest_common_divisor/greatest_common_divisor.py | arczan1/my_daily_code | 899951e0243aa1bbc867ec1c2b3c727171843dc8 | [
"MIT"
] | null | null | null | greatest_common_divisor/greatest_common_divisor.py | arczan1/my_daily_code | 899951e0243aa1bbc867ec1c2b3c727171843dc8 | [
"MIT"
] | null | null | null | def gcd(a: int, b: int) -> int:
'''
Greates common divisor of two integers(Euclidean algorithm)
Parameters
----------
a, b : int
The algorithm will use abslute values
Example: gcd(-3, 9) == gcd(3, 9)
'''
a, b = abs(a), abs(b)
while b != 0:
b, a = a % b, b
re... | 26.5 | 63 | 0.459119 | def gcd(a: int, b: int) -> int:
'''
Greates common divisor of two integers(Euclidean algorithm)
Parameters
----------
a, b : int
The algorithm will use abslute values
Example: gcd(-3, 9) == gcd(3, 9)
'''
a, b = abs(a), abs(b)
while b != 0:
b, a = a % b, b
re... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
073aafe57e20b338c41c424b37b405e772752f29 | 1,980 | py | Python | source-code/Merge k Sorted Lists 23.py | ttungl/Coding-Interview-Challenge | d80c3e15468d50b42ee53fcc73e9326c6c816495 | [
"MIT"
] | null | null | null | source-code/Merge k Sorted Lists 23.py | ttungl/Coding-Interview-Challenge | d80c3e15468d50b42ee53fcc73e9326c6c816495 | [
"MIT"
] | null | null | null | source-code/Merge k Sorted Lists 23.py | ttungl/Coding-Interview-Challenge | d80c3e15468d50b42ee53fcc73e9326c6c816495 | [
"MIT"
] | null | null | null | # 23. Merge k Sorted Lists
# ttungl@gmail.com
# Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.next = None
| 26.756757 | 53 | 0.460101 | # 23. Merge k Sorted Lists
# ttungl@gmail.com
# Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution(object):
def mergeKLists(self, lists):
"""
:type lists: List[ListNode]
:rtype: ListNode... | 0 | 0 | 0 | 1,748 | 0 | 0 | 0 | 0 | 31 |
fa8c4a838450cf15b3f5effc8ce8de2ec680ece4 | 931 | py | Python | 367.py | wilbertgeng/LeetCode_exercise | f00c08e0d28ffa88d61d4262c6d1f49f1fa91ebc | [
"MIT"
] | null | null | null | 367.py | wilbertgeng/LeetCode_exercise | f00c08e0d28ffa88d61d4262c6d1f49f1fa91ebc | [
"MIT"
] | null | null | null | 367.py | wilbertgeng/LeetCode_exercise | f00c08e0d28ffa88d61d4262c6d1f49f1fa91ebc | [
"MIT"
] | null | null | null | """367. Valid Perfect Square"""
| 20.23913 | 40 | 0.365199 | """367. Valid Perfect Square"""
class Solution(object):
def isPerfectSquare(self, num):
"""
:type num: int
:rtype: bool
"""
##### Practice:
l = 0
r = num
while l <= r:
mid = l + (r-l)//2
if num == mid**2:
return... | 0 | 0 | 0 | 876 | 0 | 0 | 0 | 0 | 23 |
361879042185632483449798cd8f2145b01e3bce | 1,552 | py | Python | project/app.py | mvshalamov/tornado_tpl | 62795706b6c1064748fda4547225644d9acee9ac | [
"MIT"
] | null | null | null | project/app.py | mvshalamov/tornado_tpl | 62795706b6c1064748fda4547225644d9acee9ac | [
"MIT"
] | null | null | null | project/app.py | mvshalamov/tornado_tpl | 62795706b6c1064748fda4547225644d9acee9ac | [
"MIT"
] | null | null | null | import os
from tornado.httpserver import HTTPServer
from tornado.options import parse_command_line
from tornado import web
from tornado.ioloop import IOLoop
from urllib.parse import urlparse
IOLoop.configure('tornado.platform.asyncio.AsyncIOLoop')
import momoko
from .application import handlers as send_handlers
fro... | 27.22807 | 105 | 0.701031 | import os
from raven.contrib.tornado import AsyncSentryClient
from tornado.httpserver import HTTPServer
from tornado.options import parse_command_line
from tornado import web
from tornado.ioloop import IOLoop
from urllib.parse import urlparse
IOLoop.configure('tornado.platform.asyncio.AsyncIOLoop')
import momoko
f... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 30 | 23 |
559ae701524327c4907c36eea23f3ea0a8671cd9 | 12,062 | py | Python | bindings/python/cntk/tests/training_session_test.py | catycaldwell/CNTK | 86a20080b19255b96ada85b6a7ab6b8e7be7465b | [
"RSA-MD"
] | null | null | null | bindings/python/cntk/tests/training_session_test.py | catycaldwell/CNTK | 86a20080b19255b96ada85b6a7ab6b8e7be7465b | [
"RSA-MD"
] | null | null | null | bindings/python/cntk/tests/training_session_test.py | catycaldwell/CNTK | 86a20080b19255b96ada85b6a7ab6b8e7be7465b | [
"RSA-MD"
] | 1 | 2021-01-21T05:58:03.000Z | 2021-01-21T05:58:03.000Z | # Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE.md file in the project root
# for full license information.
# ==============================================================================
from .. import Function
from ..ops import times
from .. import cross_entropy_with_so... | 35.269006 | 127 | 0.675012 | # Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE.md file in the project root
# for full license information.
# ==============================================================================
import os
import math
import re
import numpy as np
from .. import Function
from ..o... | 0 | 0 | 0 | 1,064 | 0 | 9,100 | 0 | 141 | 496 |
8d2594bbc4f46101ef8750faf78302f7833c749b | 255 | py | Python | main.py | aljosa/pyinstaller-streamlit-issues | 291c83ef4a001423e1905759ed1b6824792c9ff6 | [
"MIT"
] | null | null | null | main.py | aljosa/pyinstaller-streamlit-issues | 291c83ef4a001423e1905759ed1b6824792c9ff6 | [
"MIT"
] | null | null | null | main.py | aljosa/pyinstaller-streamlit-issues | 291c83ef4a001423e1905759ed1b6824792c9ff6 | [
"MIT"
] | null | null | null | import sys
from streamlit import cli as stcli
if __name__ == "__main__":
sys.argv = [
"streamlit",
"run",
"hello.py",
"--global.developmentMode=false",
"--server.headless=true"
]
sys.exit(stcli.main())
| 19.615385 | 41 | 0.556863 | import sys
from streamlit import cli as stcli
if __name__ == "__main__":
sys.argv = [
"streamlit",
"run",
"hello.py",
"--global.developmentMode=false",
"--server.headless=true"
]
sys.exit(stcli.main())
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
86e44bce5cc4d1e036f1ad4abc498fe48946e1d8 | 253 | py | Python | language/python/modules/__future__/__future__module.py | bigfoolliu/liu_aistuff | aa661d37c05c257ee293285dd0868fb7e8227628 | [
"MIT"
] | 1 | 2019-11-25T07:23:42.000Z | 2019-11-25T07:23:42.000Z | language/python/modules/__future__/__future__module.py | bigfoolliu/liu_aistuff | aa661d37c05c257ee293285dd0868fb7e8227628 | [
"MIT"
] | 13 | 2020-01-07T16:09:47.000Z | 2022-03-02T12:51:44.000Z | language/python/modules/__future__/__future__module.py | bigfoolliu/liu_aistuff | aa661d37c05c257ee293285dd0868fb7e8227628 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
# author: bigfoolliu
"""
python __future__
- python
- python2.1python, , "from __future__ import *"
"""
| 19.461538 | 124 | 0.754941 | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
# author: bigfoolliu
"""
python __future__ 模块
- 是为了在老版本的python中兼顾新特性的一种方法
- 从python2.1开始以后,当一个新的语言特性首次出现在发行版中时候,如果该新特性与以前旧版本python不兼容, 则该特性将会被默认禁用。如果想启用这个新特性, 则必须使用 "from __future__ import *" 语句进行导入
"""
| 288 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e21badb3a3b1e518e63cd998c4e08e6d5f568ed2 | 877 | py | Python | python/try-catch-finally.py | basanjeev/scripts | d982d18e4532dba7b715c2a7e4735b65381abf5e | [
"Apache-2.0"
] | null | null | null | python/try-catch-finally.py | basanjeev/scripts | d982d18e4532dba7b715c2a7e4735b65381abf5e | [
"Apache-2.0"
] | null | null | null | python/try-catch-finally.py | basanjeev/scripts | d982d18e4532dba7b715c2a7e4735b65381abf5e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
if __name__ == '__main__':
main()
| 17.54 | 70 | 0.633979 | #!/usr/bin/python3
import os;
import nester;
def main():
man = []
other_man = []
try:
file1 = open(os.getcwd() + '/sketch.txt')
print(os.getcwd())
for line in file1:
try:
(role,line_spoken) = line.split(':', 1)
line_spoken = line_spoken.strip()
if role == 'Man':
man.append(line_spoken)
... | 0 | 0 | 0 | 0 | 0 | 768 | 0 | -20 | 70 |
3ca08d90a6dd3d63d0a31755e739191f5d1dc942 | 1,596 | py | Python | 02_code_organisation/CoockieCutter/MyNetworkDay1/src/models/model.py | FKjaeren/dtu_mlops | 34fdff7b64594b99ca10a0e7c6f676b1f2088acd | [
"Apache-2.0"
] | null | null | null | 02_code_organisation/CoockieCutter/MyNetworkDay1/src/models/model.py | FKjaeren/dtu_mlops | 34fdff7b64594b99ca10a0e7c6f676b1f2088acd | [
"Apache-2.0"
] | null | null | null | 02_code_organisation/CoockieCutter/MyNetworkDay1/src/models/model.py | FKjaeren/dtu_mlops | 34fdff7b64594b99ca10a0e7c6f676b1f2088acd | [
"Apache-2.0"
] | null | null | null |
kernel_size = 5
padding = 2
channel_sizes = [1,6,16]
| 35.466667 | 122 | 0.60401 | import torch.nn.functional as F
import torch
from torch import nn, optim
kernel_size = 5
padding = 2
channel_sizes = [1,6,16]
class MyAwesomeModel(nn.Module):
def __init__(self):
#Der mangler convolution layer
super().__init__()
self.conv1 = nn.Conv2d(
in_channels = channel_siz... | 0 | 0 | 0 | 1,446 | 0 | 0 | 0 | 7 | 89 |
08871c13d6db32428b95e1944e8d9ab3a2091d9e | 4,455 | py | Python | 2019/try/current/main.py | rishidevc/stkovrflw | c33dffbce887f32f609a10dd717d594390ceac8b | [
"MIT"
] | null | null | null | 2019/try/current/main.py | rishidevc/stkovrflw | c33dffbce887f32f609a10dd717d594390ceac8b | [
"MIT"
] | 5 | 2020-05-04T03:11:14.000Z | 2021-06-10T20:20:38.000Z | 2019/try/current/main.py | rishidevc/stkovrflw | c33dffbce887f32f609a10dd717d594390ceac8b | [
"MIT"
] | 1 | 2019-07-31T18:28:34.000Z | 2019-07-31T18:28:34.000Z |
if __name__ == "__main__":
token = get_new_json_web_token({'username': 'RR', 'password': 'RR@123'})
print(token)
| 42.836538 | 141 | 0.616611 | import jwt
from django.conf import settings
import base64
from datetime import datetime, timedelta
def get_new_json_web_token(data, expiry_time_in_secs=settings.JWT_EXPIRY_TIME):
secret = settings.JWT_SIGN_SECRET
payload = {
'exp': datetime.utcnow() + timedelta(seconds=expiry_time_in_secs),
'da... | 0 | 0 | 0 | 0 | 0 | 4,164 | 0 | 11 | 157 |
bde3712fc793a0e1b48f56efbf267f8528430dc1 | 7,536 | py | Python | fastapi_versioned/app.py | ccharlesgb/fastapi-versioned | 5488cda86665de5cb2d0cfce7ff5660e90c6358f | [
"MIT"
] | null | null | null | fastapi_versioned/app.py | ccharlesgb/fastapi-versioned | 5488cda86665de5cb2d0cfce7ff5660e90c6358f | [
"MIT"
] | null | null | null | fastapi_versioned/app.py | ccharlesgb/fastapi-versioned | 5488cda86665de5cb2d0cfce7ff5660e90c6358f | [
"MIT"
] | null | null | null | from fastapi.templating import Jinja2Templates
from pkg_resources import resource_filename
__all__ = ["VersionRouter", "FastAPIVersioned"]
templates = Jinja2Templates(directory=resource_filename(__name__, "resources"))
| 34.099548 | 111 | 0.626327 | from itertools import chain, groupby
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
from fastapi import APIRouter, FastAPI
from fastapi.routing import APIRoute
from fastapi.templating import Jinja2Templates
from openapi_schema_pydantic import OpenAPI
from pkg_resources import resource_filename
fr... | 0 | 984 | 0 | 5,741 | 0 | 0 | 0 | 202 | 382 |
085ac39cf5c7259b2a0f2b6ef37568b281f15d74 | 4,372 | py | Python | pretrained.py | M155K4R4/SentimentPy | e94bbd71e5666a7955fb2459df40b3817a3feb71 | [
"BSD-2-Clause"
] | 417 | 2015-01-11T11:54:33.000Z | 2022-03-30T07:20:39.000Z | pretrained.py | M155K4R4/SentimentPy | e94bbd71e5666a7955fb2459df40b3817a3feb71 | [
"BSD-2-Clause"
] | 10 | 2015-10-07T11:20:59.000Z | 2020-05-03T21:10:01.000Z | pretrained.py | M155K4R4/SentimentPy | e94bbd71e5666a7955fb2459df40b3817a3feb71 | [
"BSD-2-Clause"
] | 184 | 2015-01-10T21:06:23.000Z | 2022-02-24T05:23:50.000Z | """
Train a naive Bayes classifier from the IMDb reviews data set
"""
from __future__ import division
from collections import defaultdict
from math import log, exp
from functools import partial
import re
import os
import random
import pickle
import pylab
handle = open("trained", "rb")
sums, positive, negative = pickl... | 31.228571 | 120 | 0.635178 | """
Train a naive Bayes classifier from the IMDb reviews data set
"""
from __future__ import division
from collections import defaultdict
from math import log, exp
from functools import partial
import re
import os
import random
import pickle
import pylab
handle = open("trained", "rb")
sums, positive, negative = pickl... | 0 | 0 | 0 | 0 | 0 | 1,188 | 0 | 0 | 161 |
6785d92e42bfcf9b254251399b14c964ec902105 | 12,832 | py | Python | DeepFilterNet/df/enhance.py | ishine/DeepFilterNet | 797a02a20a10f4bc0c9af1c3bfa41bb0009342fc | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | DeepFilterNet/df/enhance.py | ishine/DeepFilterNet | 797a02a20a10f4bc0c9af1c3bfa41bb0009342fc | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 5 | 2022-02-15T00:29:20.000Z | 2022-03-18T13:07:57.000Z | DeepFilterNet/df/enhance.py | ishine/DeepFilterNet | 797a02a20a10f4bc0c9af1c3bfa41bb0009342fc | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | import os
from typing import Optional, Tuple, Union
import torchaudio as ta
from loguru import logger
from torch import Tensor, nn
from torchaudio.backend.common import AudioMetaData
from df import config
from df.checkpoint import load_model as load_model_cp
from df.logger import init_logger, warn_once
from df.model i... | 36.351275 | 110 | 0.642612 | import argparse
import os
import time
import warnings
from typing import Optional, Tuple, Union
import torch
import torchaudio as ta
from loguru import logger
from numpy import ndarray
from torch import Tensor, nn
from torch.nn import functional as F
from torchaudio.backend.common import AudioMetaData
from df import ... | 0 | 1,547 | 0 | 0 | 0 | 4,803 | 0 | 51 | 294 |
180f08f767c3e9297e43edef35305fc2a7293352 | 1,323 | py | Python | shade/tests/functional/util.py | noironetworks/shade | e46878bae44e7daebf32c0aeaeffea0011542525 | [
"Apache-2.0"
] | 96 | 2015-01-29T20:12:08.000Z | 2019-01-28T22:17:13.000Z | shade/tests/functional/util.py | noironetworks/shade | e46878bae44e7daebf32c0aeaeffea0011542525 | [
"Apache-2.0"
] | 7 | 2015-08-14T18:47:28.000Z | 2019-02-18T16:32:36.000Z | shade/tests/functional/util.py | noironetworks/shade | e46878bae44e7daebf32c0aeaeffea0011542525 | [
"Apache-2.0"
] | 88 | 2015-05-11T17:20:52.000Z | 2019-04-04T03:23:30.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 30.767442 | 75 | 0.66062 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ee663a389a258b8a63b2d8fe765fd47a27323c23 | 2,888 | py | Python | previs/models/baselinetextmodels.py | zutshianand/Previs | dd7113e65d178ad56a46797caadcdc904f4a3051 | [
"MIT"
] | 1 | 2020-11-13T07:06:16.000Z | 2020-11-13T07:06:16.000Z | previs/models/baselinetextmodels.py | zutshianand/Previs | dd7113e65d178ad56a46797caadcdc904f4a3051 | [
"MIT"
] | null | null | null | previs/models/baselinetextmodels.py | zutshianand/Previs | dd7113e65d178ad56a46797caadcdc904f4a3051 | [
"MIT"
] | null | null | null | import numpy as np
import xgboost
from sklearn import decomposition
from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer
from sklearn.linear_model import LogisticRegression
from sklearn.naive_bayes import MultinomialNB
def multiclass_logloss(actual, predicted, eps=1e-15):
"""Multi class v... | 38.506667 | 81 | 0.584141 | import numpy as np
import xgboost
from sklearn import decomposition
from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer
from sklearn.linear_model import LogisticRegression
from sklearn.naive_bayes import MultinomialNB
def multiclass_logloss(actual, predicted, eps=1e-15):
"""Multi class v... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ac5f788dbf7c20af6f82c25622ca944bf79a7a40 | 91,605 | py | Python | cmfrec/__init__.py | wyfoffice/cmfrec | 3f257fb0518d9fecc7c6edc18d18e7439353f6e1 | [
"BSD-2-Clause"
] | null | null | null | cmfrec/__init__.py | wyfoffice/cmfrec | 3f257fb0518d9fecc7c6edc18d18e7439353f6e1 | [
"BSD-2-Clause"
] | null | null | null | cmfrec/__init__.py | wyfoffice/cmfrec | 3f257fb0518d9fecc7c6edc18d18e7439353f6e1 | [
"BSD-2-Clause"
] | null | null | null | import pandas as pd
pd.options.mode.chained_assignment = None
| 48.263962 | 150 | 0.57784 | import pandas as pd, numpy as np, tensorflow as tf, os, warnings
pd.options.mode.chained_assignment = None
class CMF:
"""
Collective matrix factorization model for recommenders systems with explicit data and side info.
Fits a collective matrix factorization model to ratings data along with item and/or... | 0 | 0 | 0 | 91,475 | 0 | 0 | 0 | 45 | 23 |
ec0dd0d94ff59136ff88bf0f3bdaa3656aa21a5d | 3,239 | py | Python | hierarchical/trainer.py | Kshitij-Ambilduke/MedVQA | 6f92f8c73bb30d7e3b226f9e4dd546919bb8ed29 | [
"MIT"
] | 7 | 2021-09-14T05:54:10.000Z | 2021-09-30T06:39:33.000Z | hierarchical/trainer.py | Diksha942/Medical-Visual-Question-Answering | e20f0d29638c5d05e3e0c385fe67a9bfeef0f921 | [
"MIT"
] | null | null | null | hierarchical/trainer.py | Diksha942/Medical-Visual-Question-Answering | e20f0d29638c5d05e3e0c385fe67a9bfeef0f921 | [
"MIT"
] | 1 | 2021-12-24T20:57:15.000Z | 2021-12-24T20:57:15.000Z | import torch
| 35.593407 | 116 | 0.509416 | import math
import numpy as np
from _config import Config as config
import torch
import sys
import json
import torch
import time
class Trainer:
@staticmethod
def train(model, train_loader, valid_loader, answers_dict, optimizer, criterion, scheduler, config, stats_file):
epoch_loss = []
pyt... | 0 | 3,027 | 0 | -7 | 0 | 0 | 0 | -38 | 230 |
5c63ff7c4f414c271e4272211bbb29878486dd46 | 1,433 | py | Python | PointwiseVulnerability_Test.py | df8/coria-hu-2018 | ddb1b5fe4a876bf42ac73725a4aaf87849820953 | [
"MIT"
] | null | null | null | PointwiseVulnerability_Test.py | df8/coria-hu-2018 | ddb1b5fe4a876bf42ac73725a4aaf87849820953 | [
"MIT"
] | null | null | null | PointwiseVulnerability_Test.py | df8/coria-hu-2018 | ddb1b5fe4a876bf42ac73725a4aaf87849820953 | [
"MIT"
] | null | null | null | import unittest
if __name__ == '__main__':
unittest.main()
| 36.74359 | 118 | 0.501745 | import unittest
import networkx as nx
import PointwiseVulnerability as pv
class Test_PointwiseVulnerability_Test(unittest.TestCase):
def setUp(self):
G1 = nx.Graph()
G1.add_nodes_from(list(range(0, 12)))
_a = ord('A')
for v in G1.nodes():
G1.node[v]['name'] = chr(_a ... | 0 | 0 | 0 | 1,288 | 0 | 0 | 0 | 14 | 67 |
0fbfc9c353a6639d1c9531d324e7f4e3ef4c4dcc | 5,932 | py | Python | issue_order/admin.py | jiejiang/courier | 6fdeaf041c77dba0f97e206adb7b0cded9674d3d | [
"Apache-2.0"
] | null | null | null | issue_order/admin.py | jiejiang/courier | 6fdeaf041c77dba0f97e206adb7b0cded9674d3d | [
"Apache-2.0"
] | 13 | 2020-02-12T02:56:24.000Z | 2022-01-13T01:23:08.000Z | issue_order/admin.py | jiejiang/courier | 6fdeaf041c77dba0f97e206adb7b0cded9674d3d | [
"Apache-2.0"
] | null | null | null | # *- coding: utf-8 -*
from django.utils.translation import ugettext as _
from django.contrib import admin
from django.contrib.auth.models import Group
from django.contrib.auth.admin import UserAdmin, GroupAdmin
from mezzanine.accounts.admin import ProfileInline, UserProfileAdmin
from models import Route, PricingRule
... | 37.075 | 117 | 0.724376 | # *- coding: utf-8 -*
import json
from django.contrib.admin import ModelAdmin
from django.utils.html import format_html
from django.utils.translation import ugettext as _
from django.contrib import admin
from django.contrib.auth.models import User, Group
from django.contrib.auth.admin import UserAdmin, GroupAdmin
from... | 181 | 88 | 0 | 2,936 | 0 | 302 | 0 | 222 | 544 |
6c04c81514cf9bb6073b2d586f64dc87f7cc7856 | 4,505 | py | Python | flashtool/flash.py | teknoman117/ts3100-images | 44f3eec9655f32a20320d8d70a9678e724beae9b | [
"BSD-3-Clause"
] | 1 | 2021-07-06T21:31:25.000Z | 2021-07-06T21:31:25.000Z | flashtool/flash.py | teknoman117/ts-3100-images | 2309165da862aea544996828dccdeac6d6d5ec61 | [
"BSD-3-Clause"
] | null | null | null | flashtool/flash.py | teknoman117/ts-3100-images | 2309165da862aea544996828dccdeac6d6d5ec61 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python3.7
#
# Copyright 2020 Nathaniel R. Lewis
#
# Redistribution and use in source and binary forms, with or without modification, are permitted
# provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions
# and t... | 37.857143 | 111 | 0.684795 | #!/usr/bin/python3.7
#
# Copyright 2020 Nathaniel R. Lewis
#
# Redistribution and use in source and binary forms, with or without modification, are permitted
# provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions
# and t... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6c99bb0a17019bfa815b0076ebacc7770497ce78 | 8,421 | py | Python | alf/metrics/metrics_test.py | hnyu/entropy_reward | f3ae1cdd5e893bacfa77c7e1da894b74c288585a | [
"Apache-2.0"
] | null | null | null | alf/metrics/metrics_test.py | hnyu/entropy_reward | f3ae1cdd5e893bacfa77c7e1da894b74c288585a | [
"Apache-2.0"
] | null | null | null | alf/metrics/metrics_test.py | hnyu/entropy_reward | f3ae1cdd5e893bacfa77c7e1da894b74c288585a | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 Horizon Robotics and ALF Contributors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | 36.297414 | 80 | 0.550172 | # Copyright (c) 2020 Horizon Robotics and ALF Contributors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | 0 | 1,936 | 0 | 4,727 | 0 | 487 | 0 | 299 | 272 |
714c90debffb876b64c5f38b4076e549f9556b43 | 762 | py | Python | C03_Iteration.py | lleej/python | f4eff76819cec2c479ec19a4940141406079cb9a | [
"MIT"
] | null | null | null | C03_Iteration.py | lleej/python | f4eff76819cec2c479ec19a4940141406079cb9a | [
"MIT"
] | 2 | 2018-02-01T02:54:17.000Z | 2018-06-14T03:18:51.000Z | C03_Iteration.py | lleej/python | f4eff76819cec2c479ec19a4940141406079cb9a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Iterable
from collections import Iterable
print('[]Iterable? ', isinstance([], Iterable))
print('{}Iterable? ', isinstance({}, Iterable))
print('abcIterable? ', isinstance('abc', Iterable))
print('(x for x in range(10))Iterable? ', isinstance((x for x in range(10)... | 36.285714 | 89 | 0.670604 | # -*- coding: utf-8 -*-
# 迭代器
# 迭代对象Iterable
from collections import Iterable
print('[]是Iterable吗? ', isinstance([], Iterable))
print('{}是Iterable吗? ', isinstance({}, Iterable))
print('abc是Iterable吗? ', isinstance('abc', Iterable))
print('(x for x in range(10))是Iterable吗? ', isinstance((x for... | 105 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
854970862039cdc520cf4f26841f0c734a7c64b6 | 373 | py | Python | bin/salt/modules/environment.py | HenryCook/hubot-scripts | 23bfff92046812ed5593fcb5654b5ce334adbd2d | [
"MIT"
] | null | null | null | bin/salt/modules/environment.py | HenryCook/hubot-scripts | 23bfff92046812ed5593fcb5654b5ce334adbd2d | [
"MIT"
] | null | null | null | bin/salt/modules/environment.py | HenryCook/hubot-scripts | 23bfff92046812ed5593fcb5654b5ce334adbd2d | [
"MIT"
] | 1 | 2016-09-26T18:39:35.000Z | 2016-09-26T18:39:35.000Z | import os
import sys
# Checks to see if the required environment variables had been set
try:
salt_api_endpoint = os.environ['SALT_API_ENDPOINT']
salt_api_user = os.environ['SALT_API_USER']
salt_api_password = os.environ['SALT_API_PASSWORD']
except KeyError as i:
print("Error: The {env} environment vari... | 31.083333 | 81 | 0.742627 | import os
import sys
# Checks to see if the required environment variables had been set
try:
salt_api_endpoint = os.environ['SALT_API_ENDPOINT']
salt_api_user = os.environ['SALT_API_USER']
salt_api_password = os.environ['SALT_API_PASSWORD']
except KeyError as i:
print("Error: The {env} environment vari... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0afb18f616bd2b8cf3fe162ffe49292241248766 | 1,318 | py | Python | company/apps.py | gpauriyal/inventree-python | a49c82cf2a14d8ac7d4d9ee5aa1b23e42ac70102 | [
"MIT"
] | 1 | 2020-11-03T15:46:58.000Z | 2020-11-03T15:46:58.000Z | company/apps.py | gpauriyal/inventree-python | a49c82cf2a14d8ac7d4d9ee5aa1b23e42ac70102 | [
"MIT"
] | null | null | null | company/apps.py | gpauriyal/inventree-python | a49c82cf2a14d8ac7d4d9ee5aa1b23e42ac70102 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
| 31.380952 | 105 | 0.576631 | from __future__ import unicode_literals
import os
from django.apps import AppConfig
from django.db.utils import OperationalError, ProgrammingError
from django.conf import settings
class CompanyConfig(AppConfig):
name = 'company'
def ready(self):
"""
This function is called whenever the Comp... | 0 | 0 | 0 | 1,112 | 0 | 0 | 0 | 52 | 113 |
7eaf5a9d2bb8eba0f64cc33902d68d917f3f4fc0 | 5,398 | py | Python | exampledata.py | aguinane/Solstice | 2b79ce6d38629baa5d8ba5987bff636284aedb3c | [
"MIT"
] | null | null | null | exampledata.py | aguinane/Solstice | 2b79ce6d38629baa5d8ba5987bff636284aedb3c | [
"MIT"
] | null | null | null | exampledata.py | aguinane/Solstice | 2b79ce6d38629baa5d8ba5987bff636284aedb3c | [
"MIT"
] | null | null | null | #!/usr/bin/python3
#System Modules
import random
import time
import os
import os
import sqlite3
def create_example_db():
""" Create a dummy database with metering data
"""
if not os.path.exists('data/'):
os.makedirs('data/')
dbPath = 'data/meters.db'
try:
os.remove(dbPath)
exc... | 35.281046 | 202 | 0.60189 | #!/usr/bin/python3
#System Modules
import random
import time
import os
import csv
import os
import sqlite3
def create_example_db():
""" Create a dummy database with metering data
"""
if not os.path.exists('data/'):
os.makedirs('data/')
dbPath = 'data/meters.db'
try:
os.remove(dbPa... | 0 | 0 | 0 | 0 | 0 | 102 | 0 | -11 | 45 |
3d082999054e9c8c1f99df1bfb1bb2ae3e14576a | 6,301 | py | Python | incense/experiment.py | vnmabus/incense | 6542c7cb082e313f4caa77fdb04be65ebc15bc65 | [
"MIT"
] | 78 | 2019-01-23T10:50:18.000Z | 2022-03-26T15:17:18.000Z | incense/experiment.py | vnmabus/incense | 6542c7cb082e313f4caa77fdb04be65ebc15bc65 | [
"MIT"
] | 59 | 2018-12-31T18:13:13.000Z | 2021-08-25T15:24:28.000Z | incense/experiment.py | vnmabus/incense | 6542c7cb082e313f4caa77fdb04be65ebc15bc65 | [
"MIT"
] | 6 | 2019-06-25T18:48:00.000Z | 2021-04-12T18:51:38.000Z | # -*- coding: future_fstrings -*-
| 35.005556 | 118 | 0.630217 | # -*- coding: future_fstrings -*-
import json
from pathlib import Path
from typing import *
import jsonpickle
import pandas as pd
from incense.artifact import Artifact, content_type_to_artifact_cls
from pyrsistent import freeze, thaw
class Experiment:
def __init__(self, id_, database, grid_filesystem, data, arti... | 0 | 2,504 | 0 | 3,412 | 0 | 78 | 0 | 46 | 224 |
137447cbd03f49abf98a97f9df61ff10119d01d5 | 3,187 | py | Python | src/visualization/InterpretML.py | ashishtele/MLOps | bb887663c5b2563e29dff4ad321b5667d851052e | [
"MIT"
] | 7 | 2021-11-14T23:52:50.000Z | 2022-02-06T12:56:22.000Z | src/visualization/InterpretML.py | ashishtele/MLOps | bb887663c5b2563e29dff4ad321b5667d851052e | [
"MIT"
] | null | null | null | src/visualization/InterpretML.py | ashishtele/MLOps | bb887663c5b2563e29dff4ad321b5667d851052e | [
"MIT"
] | 1 | 2021-12-02T16:14:38.000Z | 2021-12-02T16:14:38.000Z | import yaml
import argparse
import matplotlib.pyplot as plt
from interpret.glassbox import ExplainableBoostingClassifier
from interpret import show
from interpret.provider import InlineProvider
from interpret import set_visualize_provider
set_visualize_provider(InlineProvider())
def read_params(config_path):
"""
... | 34.641304 | 119 | 0.717289 | import numpy as np
import pandas as pd
import yaml
import argparse
import typing
import matplotlib.pyplot as plt
from sklearn.metrics import f1_score,recall_score,accuracy_score,precision_score,confusion_matrix,classification_report
from interpret.glassbox import ExplainableBoostingClassifier
from interpret import show... | 0 | 0 | 0 | 0 | 0 | 1,448 | 0 | 121 | 134 |
23373bdba193e96aef38ee5bdc8ec11f2498813f | 5,464 | py | Python | library/tetration_software_agent.py | chrivand/ansible-module | 219b14e1219b97c181a9ec8bf3e2bc35702b0cb7 | [
"MIT"
] | 6 | 2021-03-18T19:27:03.000Z | 2021-09-10T10:26:15.000Z | library/tetration_software_agent.py | chrivand/ansible-module | 219b14e1219b97c181a9ec8bf3e2bc35702b0cb7 | [
"MIT"
] | 3 | 2021-04-06T07:30:40.000Z | 2021-04-29T17:00:29.000Z | library/tetration_software_agent.py | chrivand/ansible-module | 219b14e1219b97c181a9ec8bf3e2bc35702b0cb7 | [
"MIT"
] | 4 | 2021-04-02T10:08:15.000Z | 2021-11-16T01:26:28.000Z | #!/usr/bin/python
# Copyright: (c) 2018, Terry Jones <terry.jones@example.org>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = '''
---
module: ... | 26.653659 | 92 | 0.689056 | #!/usr/bin/python
# Copyright: (c) 2018, Terry Jones <terry.jones@example.org>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = '''
---
module: ... | 0 | 0 | 0 | 0 | 0 | 896 | 0 | 179 | 136 |
96d9af2ad26ac799cc43b9a7dae99617a1656683 | 177 | py | Python | tests/assets/helpers.py | corneliusroemer/unwetter | 9e27d0382483ba4f238db555c4ec4742f8ce08ae | [
"MIT"
] | 1 | 2020-06-27T09:59:09.000Z | 2020-06-27T09:59:09.000Z | tests/assets/helpers.py | corneliusroemer/unwetter | 9e27d0382483ba4f238db555c4ec4742f8ce08ae | [
"MIT"
] | null | null | null | tests/assets/helpers.py | corneliusroemer/unwetter | 9e27d0382483ba4f238db555c4ec4742f8ce08ae | [
"MIT"
] | null | null | null | from os.path import dirname
from pathlib import Path
ASSETS = Path(dirname(__file__))
| 17.7 | 40 | 0.683616 | from os.path import dirname
from pathlib import Path
ASSETS = Path(dirname(__file__))
def load_asset(name):
with open(ASSETS / name, 'r') as fp:
return fp.read()
| 0 | 0 | 0 | 0 | 0 | 66 | 0 | 0 | 23 |
a2b3867bb8118341a75219b84a595c36239a2341 | 4,980 | py | Python | convert_pipelines.py | armory/spin-dcd-converter | a6bf84c74359790b61b03e0ee5dc759ce56d7697 | [
"Apache-2.0"
] | 16 | 2017-06-22T12:06:36.000Z | 2020-12-29T03:04:38.000Z | convert_pipelines.py | armory/spin-dcd-converter | a6bf84c74359790b61b03e0ee5dc759ce56d7697 | [
"Apache-2.0"
] | 3 | 2017-07-12T07:47:00.000Z | 2019-02-20T19:23:38.000Z | convert_pipelines.py | armory/spin-dcd-converter | a6bf84c74359790b61b03e0ee5dc759ce56d7697 | [
"Apache-2.0"
] | 8 | 2017-07-12T07:47:56.000Z | 2019-02-19T22:44:24.000Z | import os
import sys
import yaml
if __name__ == '__main__':
api_host = os.getenv('API_HOST')
if api_host is None:
print('API_HOST must be set to your Spinnaker API')
sys.exit(1)
if api_host[-1:] == '/':
api_host = api_host[:-1]
args = parser().parse_args()
pipeline_config = get_pipe... | 28.786127 | 127 | 0.693775 | import argparse
import copy
import json
import os
import sys
import pprint
import requests
import yaml
import yaml.dumper
from collections import OrderedDict
class UnsortableList(list):
def sort(self, *args, **kwargs):
pass
class UnsortableOrderedDict(OrderedDict):
"""
Because PyYAML sorts things. Guh.
... | 0 | 0 | 0 | 222 | 0 | 3,916 | 0 | -29 | 432 |
525e6a1bcc164df05eb25916514db7fac1c00bde | 141 | py | Python | library/__init__.py | alhtampouras/library | 6571ecf4a33c77666c36dcc928e21a80b1f8b86d | [
"MIT"
] | null | null | null | library/__init__.py | alhtampouras/library | 6571ecf4a33c77666c36dcc928e21a80b1f8b86d | [
"MIT"
] | null | null | null | library/__init__.py | alhtampouras/library | 6571ecf4a33c77666c36dcc928e21a80b1f8b86d | [
"MIT"
] | null | null | null | from flask import Flask
app = Flask(__name__)
app.config['SECRET_KEY'] = '51ab273a7b16ee7bd10722a5e63cd4c7'
| 23.5 | 62 | 0.780142 | from flask import Flask
app = Flask(__name__)
app.config['SECRET_KEY'] = '51ab273a7b16ee7bd10722a5e63cd4c7'
from library import routes
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 23 |
faa0d17aaeaf59ba807230f41f6aa2b0c090c0d7 | 6,942 | py | Python | face_recognition.py | TheTerminator800/facial-recognition-opencv | 8847219a6d0429a5326189fc1a7aa3e482c8e7e3 | [
"MIT"
] | 1 | 2021-12-01T08:40:33.000Z | 2021-12-01T08:40:33.000Z | face_recognition.py | TheTerminator800/facial-recognition-opencv | 8847219a6d0429a5326189fc1a7aa3e482c8e7e3 | [
"MIT"
] | 2 | 2021-09-12T01:48:06.000Z | 2022-03-12T00:59:38.000Z | face_recognition.py | thearyanmittal/facial-recognition | 8847219a6d0429a5326189fc1a7aa3e482c8e7e3 | [
"MIT"
] | null | null | null | import cv2
import pickle
import os
import numpy as np
import tensorflow as tf
#preprocessing function used for tensorflow
#get labels in .pkl file saved in face_train.py
labels = {}
with open("labels.pkl", 'rb') as f:
og_labels = pickle.load(f)
labels = {v:k for k,v in og_labels.items()} #invert the dictionar... | 37.934426 | 150 | 0.642898 | import cv2
import pickle
import os
import numpy as np
import tensorflow as tf
#preprocessing function used for tensorflow
def preprocess(img):
resized = tf.image.resize(img, (224, 224))
return resized / 255.
#get labels in .pkl file saved in face_train.py
labels = {}
with open("labels.pkl", 'rb') as f:
og... | 0 | 0 | 0 | 0 | 0 | 72 | 0 | 0 | 22 |
2780f5ef3704a807f23bb820cda366ad3d411425 | 630 | py | Python | test/test_cachedtiler.py | marceloandrioni/cartopy-extra-tiles | 81f33bd708dbbe5f0ca0eb8c44b1a864e629e2f6 | [
"MIT"
] | 1 | 2020-06-05T01:03:37.000Z | 2020-06-05T01:03:37.000Z | test/test_cachedtiler.py | marceloandrioni/cartopy-extra-tiles | 81f33bd708dbbe5f0ca0eb8c44b1a864e629e2f6 | [
"MIT"
] | 1 | 2020-06-12T18:08:55.000Z | 2020-06-13T22:00:09.000Z | test/test_cachedtiler.py | marceloandrioni/cartopy-extra-tiles | 81f33bd708dbbe5f0ca0eb8c44b1a864e629e2f6 | [
"MIT"
] | 1 | 2020-06-17T19:44:52.000Z | 2020-06-17T19:44:52.000Z | #!/usr/bin/env python
# ======================================================================
#
# Brad T. Aagaard, U.S. Geological Survey
#
# ======================================================================
"""Test tile caching using GoogleTiles.
"""
import sys
import matplotlib.pyplot as plt
from cartopy.io.i... | 25.2 | 75 | 0.569841 | #!/usr/bin/env python
# ======================================================================
#
# Brad T. Aagaard, U.S. Geological Survey
#
# ======================================================================
"""Test tile caching using GoogleTiles.
"""
import sys
import matplotlib.pyplot as plt
from cartopy.io.i... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
27f6b8dcedb8da48707be84e54dd1fff9b4c0a30 | 3,168 | py | Python | ote_sdk/ote_sdk/usecases/evaluation/metrics_helper.py | vyashina/training_extensions | e7aa33af94a1f8004d3ea2df259d99234dfca046 | [
"Apache-2.0"
] | null | null | null | ote_sdk/ote_sdk/usecases/evaluation/metrics_helper.py | vyashina/training_extensions | e7aa33af94a1f8004d3ea2df259d99234dfca046 | [
"Apache-2.0"
] | null | null | null | ote_sdk/ote_sdk/usecases/evaluation/metrics_helper.py | vyashina/training_extensions | e7aa33af94a1f8004d3ea2df259d99234dfca046 | [
"Apache-2.0"
] | null | null | null | """ This module contains the helper functions which can be called directly by
algorithm implementers to obtain the metrices """
# INTEL CONFIDENTIAL
#
# Copyright (C) 2021 Intel Corporation
#
# This software and the related documents are Intel copyrighted materials, and
# your use of them is governed by the express li... | 39.111111 | 118 | 0.709912 | """ This module contains the helper functions which can be called directly by
algorithm implementers to obtain the metrices """
# INTEL CONFIDENTIAL
#
# Copyright (C) 2021 Intel Corporation
#
# This software and the related documents are Intel copyrighted materials, and
# your use of them is governed by the express li... | 0 | 1,926 | 0 | 175 | 0 | 0 | 0 | 189 | 134 |
ed094f06114626ce713674550eabc42ddc890543 | 2,813 | py | Python | examples/QueryListenerWithMultiThreading.py | WeiZhixiong/ksc-sdk-python | a93237ce376e107eaae644678ef6b99819a9f8eb | [
"Apache-2.0"
] | 53 | 2016-09-21T15:52:14.000Z | 2021-12-23T09:23:00.000Z | examples/QueryListenerWithMultiThreading.py | WeiZhixiong/ksc-sdk-python | a93237ce376e107eaae644678ef6b99819a9f8eb | [
"Apache-2.0"
] | 27 | 2016-09-21T15:24:43.000Z | 2021-11-18T08:38:38.000Z | examples/QueryListenerWithMultiThreading.py | WeiZhixiong/ksc-sdk-python | a93237ce376e107eaae644678ef6b99819a9f8eb | [
"Apache-2.0"
] | 68 | 2016-09-06T10:33:09.000Z | 2021-11-16T07:13:03.000Z | #!/usr/bin/python
#coding=utf-8
import threading
import time
import queue
from kscore.session import get_session
from threading import Lock
'''
->->ID
Semaphore
queue
'''
sem = threading.Semaphore(20)
lock = Lock()
results = []
if __name__ == "__main__":
s = get_session()
region = 'cn-shanghai-2'
sl... | 26.537736 | 72 | 0.531817 | #!/usr/bin/python
#coding=utf-8
import threading
import time
import queue
from kscore.session import get_session
from threading import Lock
'''
当含有大量监听器真实服务器的时候
可以使用这个脚本示例,来规避全量直接查询全量监听器列表过慢的问题
流程:
项目制获取项目->查询负载均衡->并发按照负载均衡ID查询监听器
使用信号量Semaphore做并发量控制
使用queue做多线程排队并发操作
'''
sem = threading.Semaphore(20)
lock = Lock(... | 402 | 0 | 0 | 1,245 | 0 | 0 | 0 | 0 | 23 |
960b57c302a08cc32530cf2cf24ef7c798c4cb76 | 464 | py | Python | MQ/Merge_detection_retrieval.py | emulhall/episodic-memory | 27bafec6e09c108f0efe5ac899eabde9d1ac40cc | [
"MIT"
] | 27 | 2021-10-16T02:39:17.000Z | 2022-03-31T11:16:11.000Z | MQ/Merge_detection_retrieval.py | emulhall/episodic-memory | 27bafec6e09c108f0efe5ac899eabde9d1ac40cc | [
"MIT"
] | 5 | 2022-03-23T04:53:36.000Z | 2022-03-29T23:39:07.000Z | MQ/Merge_detection_retrieval.py | emulhall/episodic-memory | 27bafec6e09c108f0efe5ac899eabde9d1ac40cc | [
"MIT"
] | 13 | 2021-11-25T19:17:29.000Z | 2022-03-25T14:01:47.000Z | import json
result_det = 'output/detections_postNMS.json'
result_rev = 'output/retreival_postNMS.json'
with open(result_det, 'r') as fobj:
data_det = json.load(fobj)
with open(result_rev, 'r') as fobj:
data_rev = json.load(fobj)
data_submission = data_det
data_submission['detection'] = data_submission.pop(... | 25.777778 | 61 | 0.741379 | import json
result_det = 'output/detections_postNMS.json'
result_rev = 'output/retreival_postNMS.json'
with open(result_det, 'r') as fobj:
data_det = json.load(fobj)
with open(result_rev, 'r') as fobj:
data_rev = json.load(fobj)
data_submission = data_det
data_submission['detection'] = data_submission.pop(... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a6d97ec14c046b2511db381c43da0dd3c36b9432 | 2,541 | py | Python | db/article_dao.py | yifei8/spider_blogs | c86ff17bd371694b3e2bae690af434a0be8d9b88 | [
"Apache-2.0"
] | 2 | 2018-06-15T07:55:00.000Z | 2019-01-30T08:36:37.000Z | db/article_dao.py | yifei8/spider_blogs | c86ff17bd371694b3e2bae690af434a0be8d9b88 | [
"Apache-2.0"
] | null | null | null | db/article_dao.py | yifei8/spider_blogs | c86ff17bd371694b3e2bae690af434a0be8d9b88 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
Description [article /// ]
Created by yifei on 2018/2/6.
"""
| 29.206897 | 125 | 0.481307 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
Description [数据库article表 增/删/改/查 操作]
Created by yifei on 2018/2/6.
"""
class ArticleDao:
def __init__(self, connectdb):
self.connected = connectdb
def insert(self, title, des, url, author_id):
db, cursor = self.connected.getCursor()
try... | 264 | 0 | 0 | 2,319 | 0 | 0 | 0 | 0 | 23 |
bc10366dafdd71653d2cdb226f4dff0a6bd2d535 | 4,974 | py | Python | content-csv-to-json/content_csv_to_json.py | ONSdigital/dp-census-atlas | f89a41e04928d4557709ac2d58519018ae64f8e7 | [
"MIT"
] | null | null | null | content-csv-to-json/content_csv_to_json.py | ONSdigital/dp-census-atlas | f89a41e04928d4557709ac2d58519018ae64f8e7 | [
"MIT"
] | 39 | 2022-03-16T16:19:52.000Z | 2022-03-30T11:24:23.000Z | content-csv-to-json/content_csv_to_json.py | ONSdigital/dp-census-atlas | f89a41e04928d4557709ac2d58519018ae64f8e7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import argparse
import pathlib
TAXONOMIC_ORDER = [
"topic",
"variable",
"category",
"sub-category",
]
NESTED_KEYS = {
"topic": "variables",
"variable": "categories",
"category": "sub-categories",
"sub-category": None
}
DESC_PLACEHOLDER = "Lorem ipsum dolor sit am... | 32.723684 | 138 | 0.605348 | #!/usr/bin/env python
import argparse
import datetime
import json
import pathlib
import re
import sys
from csv import DictReader
from typing import Iterator
TAXONOMIC_ORDER = [
"topic",
"variable",
"category",
"sub-category",
]
NESTED_KEYS = {
"topic": "variables",
"variable": "categories",
... | 0 | 0 | 0 | 0 | 0 | 3,992 | 0 | -28 | 271 |
640eb87ae946b66624c83e81f7a7d4c8a6f75cbd | 6,996 | py | Python | src/styles.py | topher-lo/simple-data-flow | b921037c5ef7f65533953d17ab4be9153a3e19a3 | [
"MIT"
] | 7 | 2021-05-04T13:28:49.000Z | 2022-03-26T10:18:06.000Z | src/styles.py | topher-lo/simple-data-flow | b921037c5ef7f65533953d17ab4be9153a3e19a3 | [
"MIT"
] | null | null | null | src/styles.py | topher-lo/simple-data-flow | b921037c5ef7f65533953d17ab4be9153a3e19a3 | [
"MIT"
] | 1 | 2021-05-17T09:16:30.000Z | 2021-05-17T09:16:30.000Z | """Code for custom Altair themes.
Available themes:
- streamlit -- matches theme in Streamlit website
- ggplot2 -- hybrid between Streamlit's and ggplot2's themes.
"""
if __name__ == "__main__":
pass
| 30.819383 | 84 | 0.345483 | """Code for custom Altair themes.
Available themes:
- streamlit -- matches theme in Streamlit website
- ggplot2 -- hybrid between Streamlit's and ggplot2's themes.
"""
def streamlit_theme():
font = "IBM Plex Mono"
primary_color = "#F63366"
font_color = "#262730"
grey_color = "#f0f2f6"
base_size =... | 0 | 0 | 0 | 0 | 0 | 6,741 | 0 | 0 | 46 |
72fcb529fb0e399c9e93de0bf9c3f085cff56a8c | 1,051 | py | Python | base_func/base_plot.py | ken-fu/easy_graph_conv | bbbf4554baa23b04c169e3bdea97fd3c43be1b94 | [
"MIT"
] | null | null | null | base_func/base_plot.py | ken-fu/easy_graph_conv | bbbf4554baa23b04c169e3bdea97fd3c43be1b94 | [
"MIT"
] | null | null | null | base_func/base_plot.py | ken-fu/easy_graph_conv | bbbf4554baa23b04c169e3bdea97fd3c43be1b94 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''Base Class of PlotCanvas'''
| 35.033333 | 80 | 0.647003 | # -*- coding: utf-8 -*-
'''Base Class of PlotCanvas'''
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure
from PyQt5.QtWidgets import QSizePolicy
class PlotCanvas(FigureCanvas):
'''FigureCanvas Class'''
def __init__(self, parent=None, width=4... | 0 | 0 | 0 | 814 | 0 | 0 | 0 | 92 | 89 |
25ec3e410797c33e6887c71f0dc1cd5b4d72de1a | 2,823 | py | Python | apps/log_measure/handlers/metric_collectors/third_party.py | qqqqqie/bk-log | 1765f1901aafaa6fb6a57b8db5d35dd32b3cb5c1 | [
"MIT"
] | 75 | 2021-07-14T09:32:36.000Z | 2022-03-31T15:26:53.000Z | apps/log_measure/handlers/metric_collectors/third_party.py | qqqqqie/bk-log | 1765f1901aafaa6fb6a57b8db5d35dd32b3cb5c1 | [
"MIT"
] | 561 | 2021-07-14T07:45:47.000Z | 2022-03-31T11:41:28.000Z | apps/log_measure/handlers/metric_collectors/third_party.py | qqqqqie/bk-log | 1765f1901aafaa6fb6a57b8db5d35dd32b3cb5c1 | [
"MIT"
] | 41 | 2021-07-14T07:39:50.000Z | 2022-03-25T09:22:18.000Z | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-LOG available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-LOG is licensed under the MIT License.
License for BK-LOG :
------------------------------------------------------------------... | 48.672414 | 118 | 0.698548 | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-LOG 蓝鲸日志平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-LOG 蓝鲸日志平台 is licensed under the MIT License.
License for BK-LOG 蓝鲸日志平台:
------------------------------------------------... | 63 | 1,048 | 0 | 13 | 0 | 0 | 0 | 188 | 204 |
4d480e895b2df11044426e59efa17fd1b9abf9b0 | 6,841 | py | Python | salt/tops/saltclass.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 5 | 2017-02-07T05:39:29.000Z | 2020-06-13T02:07:33.000Z | salt/tops/saltclass.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 86 | 2017-01-27T11:54:46.000Z | 2020-05-20T06:25:26.000Z | salt/tops/saltclass.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 11 | 2017-01-26T19:36:29.000Z | 2021-12-11T07:54:16.000Z | # -*- coding: utf-8 -*-
r'''
Saltclass Configuration
=======================
.. code-block:: yaml
master_tops:
saltclass:
path: /srv/saltclass
Description
===========
This module clones the behaviour of reclass (http://reclass.pantsfullofunix.net/),
without the need of an external app, and add sev... | 25.243542 | 120 | 0.569946 | # -*- coding: utf-8 -*-
r'''
Saltclass Configuration
=======================
.. code-block:: yaml
master_tops:
saltclass:
path: /srv/saltclass
Description
===========
This module clones the behaviour of reclass (http://reclass.pantsfullofunix.net/),
without the need of an external app, and add sev... | 351 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
98c520f0b680791017bd50dcd6e5b0aa0a7f502e | 5,764 | py | Python | GPy/kern/parts/poly.py | rokroskar/GPy | 0f8dbba56d480902c86cfe8bad9e79d9eabae009 | [
"BSD-3-Clause"
] | 1 | 2016-08-04T21:28:11.000Z | 2016-08-04T21:28:11.000Z | GPy/kern/parts/poly.py | rokroskar/GPy | 0f8dbba56d480902c86cfe8bad9e79d9eabae009 | [
"BSD-3-Clause"
] | null | null | null | GPy/kern/parts/poly.py | rokroskar/GPy | 0f8dbba56d480902c86cfe8bad9e79d9eabae009 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2013, GPy authors (see AUTHORS.txt).
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import numpy as np
four_over_tau = 2./np.pi
| 41.467626 | 210 | 0.639313 | # Copyright (c) 2013, GPy authors (see AUTHORS.txt).
# Licensed under the BSD 3-clause license (see LICENSE.txt)
from kernpart import Kernpart
import numpy as np
four_over_tau = 2./np.pi
class POLY(Kernpart):
"""
Polynomial kernel parameter initialisation. Included for completeness, but generally not recomm... | 0 | 0 | 0 | 5,547 | 0 | 0 | 0 | 8 | 46 |