hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
daa7d26d703b2e6fd2855c3dde932b88c4d35034 | 69,842 | py | Python | ai4water/datasets/camels.py | csiro-hydroinformatics/AI4Water | cdb18bd4bf298f77b381f1829045a1e790146985 | [
"MIT"
] | 12 | 2020-10-13T08:23:17.000Z | 2021-01-22T04:36:21.000Z | ai4water/datasets/camels.py | csiro-hydroinformatics/AI4Water | cdb18bd4bf298f77b381f1829045a1e790146985 | [
"MIT"
] | 1 | 2020-10-15T02:42:52.000Z | 2020-10-15T02:51:07.000Z | ai4water/datasets/camels.py | csiro-hydroinformatics/AI4Water | cdb18bd4bf298f77b381f1829045a1e790146985 | [
"MIT"
] | 2 | 2020-11-23T04:45:38.000Z | 2020-11-26T10:12:34.000Z | import json
import os
import glob
import random
from typing import Union
try:
import xarray as xr
except ModuleNotFoundError:
xr = None
import numpy as np
import pandas as pd
from .datasets import Datasets
from .utils import check_attributes, download, sanity_check
from ai4water.utils.utils import dateandtim... | 40.001145 | 204 | 0.57328 | import json
import os
import glob
import random
from typing import Union
try:
import xarray as xr
except ModuleNotFoundError:
xr = None
import numpy as np
import pandas as pd
from .datasets import Datasets
from .utils import check_attributes, download, sanity_check
from ai4water.utils.utils import dateandtim... | 25,929 | 0 | 2,006 |
788a6282addf87f71248819c2eb6fdbf03f86fd6 | 981 | py | Python | Algorithms/1302_Deepest_Leaves_Sum/Python/Deepest_Leaves_Sum_Solution_1.py | lht19900714/Leetcode_Solutions | dac7a038329a5c1f8a78e86cc6f49116b963f1fb | [
"MIT"
] | null | null | null | Algorithms/1302_Deepest_Leaves_Sum/Python/Deepest_Leaves_Sum_Solution_1.py | lht19900714/Leetcode_Solutions | dac7a038329a5c1f8a78e86cc6f49116b963f1fb | [
"MIT"
] | null | null | null | Algorithms/1302_Deepest_Leaves_Sum/Python/Deepest_Leaves_Sum_Solution_1.py | lht19900714/Leetcode_Solutions | dac7a038329a5c1f8a78e86cc6f49116b963f1fb | [
"MIT"
] | null | null | null |
# Space: O(n)
# Time: O(n)
# BFS approach
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
| 25.815789 | 73 | 0.56473 |
# Space: O(n)
# Time: O(n)
# BFS approach
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def deepestLeavesSum(self, root):
if root is None: ret... | 696 | -6 | 49 |
f31b4a03f3a15378101968d030a27d2340c106bf | 179 | py | Python | configs/TCCC_roi/faster_rcnn_r50_fpn_1x_voc_gc_RoiCC.py | LeoXuZH/CervicalCancerDetection | 0ce682f01c9a428eb73170151c2d8d9efc6ce44f | [
"Apache-2.0"
] | null | null | null | configs/TCCC_roi/faster_rcnn_r50_fpn_1x_voc_gc_RoiCC.py | LeoXuZH/CervicalCancerDetection | 0ce682f01c9a428eb73170151c2d8d9efc6ce44f | [
"Apache-2.0"
] | null | null | null | configs/TCCC_roi/faster_rcnn_r50_fpn_1x_voc_gc_RoiCC.py | LeoXuZH/CervicalCancerDetection | 0ce682f01c9a428eb73170151c2d8d9efc6ce44f | [
"Apache-2.0"
] | null | null | null | _base_ = [
'../_base_/models/faster_rcnn_r50_fpn_gc.py',
'../_base_/datasets/voc0712_RoiCC.py',
'../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
]
| 29.833333 | 72 | 0.681564 | _base_ = [
'../_base_/models/faster_rcnn_r50_fpn_gc.py',
'../_base_/datasets/voc0712_RoiCC.py',
'../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
]
| 0 | 0 | 0 |
00761be2a204eeefb6ca144d14a0ec9670218b4d | 222 | py | Python | pincer/middleware/voice_state_update.py | ashu96902/Pincer | 102ac4ff998cbb3c57a86b252439f69895650cf3 | [
"MIT"
] | null | null | null | pincer/middleware/voice_state_update.py | ashu96902/Pincer | 102ac4ff998cbb3c57a86b252439f69895650cf3 | [
"MIT"
] | null | null | null | pincer/middleware/voice_state_update.py | ashu96902/Pincer | 102ac4ff998cbb3c57a86b252439f69895650cf3 | [
"MIT"
] | null | null | null | # Copyright Pincer 2021-Present
# Full MIT License can be found in `LICENSE` at the project root.
"""
sent when a user's voice state changes in a subscribed voice channel
(mute, volume, etc.)
"""
# TODO: Implement event
| 22.2 | 68 | 0.72973 | # Copyright Pincer 2021-Present
# Full MIT License can be found in `LICENSE` at the project root.
"""
sent when a user's voice state changes in a subscribed voice channel
(mute, volume, etc.)
"""
# TODO: Implement event
| 0 | 0 | 0 |
2e7ed449e36683dcf73ec74879466f4e527de66a | 1,902 | py | Python | hdash/validator/categories.py | inodb/hdash | 829ffbe856af17876343bc81f577fa7ee2118784 | [
"MIT"
] | null | null | null | hdash/validator/categories.py | inodb/hdash | 829ffbe856af17876343bc81f577fa7ee2118784 | [
"MIT"
] | 2 | 2021-05-24T17:15:45.000Z | 2022-03-09T21:44:32.000Z | hdash/validator/categories.py | inodb/hdash | 829ffbe856af17876343bc81f577fa7ee2118784 | [
"MIT"
] | 1 | 2021-11-16T23:15:47.000Z | 2021-11-16T23:15:47.000Z | """Meta Data Categories."""
class Categories:
"""Meta Data Categories."""
BIOSPECIMEN = "Biospecimen"
DEMOGRAPHICS = "Demographics"
SC_RNA_SEQ_LEVEL_1 = "ScRNA-seqLevel1"
SC_RNA_SEQ_LEVEL_2 = "ScRNA-seqLevel2"
SC_RNA_SEQ_LEVEL_3 = "ScRNA-seqLevel3"
SC_RNA_SEQ_LEVEL_4 = "ScRNA-seqLevel4"
... | 44.232558 | 74 | 0.730284 | """Meta Data Categories."""
class Categories:
"""Meta Data Categories."""
BIOSPECIMEN = "Biospecimen"
DEMOGRAPHICS = "Demographics"
SC_RNA_SEQ_LEVEL_1 = "ScRNA-seqLevel1"
SC_RNA_SEQ_LEVEL_2 = "ScRNA-seqLevel2"
SC_RNA_SEQ_LEVEL_3 = "ScRNA-seqLevel3"
SC_RNA_SEQ_LEVEL_4 = "ScRNA-seqLevel4"
... | 0 | 0 | 0 |
200cb2c5a57c4fc4b5cd824529333ee8154744d2 | 7,526 | py | Python | oidc_provider/lib/endpoints/token.py | vvandriichuk/django-oidc-provider | 557da7747a75d9874520bd7016292bb2a1b9530e | [
"MIT"
] | null | null | null | oidc_provider/lib/endpoints/token.py | vvandriichuk/django-oidc-provider | 557da7747a75d9874520bd7016292bb2a1b9530e | [
"MIT"
] | 1 | 2020-06-05T16:38:28.000Z | 2020-06-05T16:38:28.000Z | oidc_provider/lib/endpoints/token.py | vvandriichuk/django-oidc-provider | 557da7747a75d9874520bd7016292bb2a1b9530e | [
"MIT"
] | null | null | null | from base64 import b64decode, urlsafe_b64encode
import hashlib
import logging
import re
try:
from urllib.parse import unquote
except ImportError:
from urllib import unquote
from django.http import JsonResponse
from oidc_provider.lib.errors import *
from oidc_provider.lib.utils.params import *
from oidc_provid... | 35.838095 | 99 | 0.591682 | from base64 import b64decode, urlsafe_b64encode
import hashlib
import logging
import re
try:
from urllib.parse import unquote
except ImportError:
from urllib import unquote
from django.http import JsonResponse
from oidc_provider.lib.errors import *
from oidc_provider.lib.utils.params import *
from oidc_provid... | 5,726 | 1,319 | 23 |
530b502e6aa2c70390c46473f414abb8baf75464 | 1,956 | py | Python | currency_crawler.py | ingyunson/automation | 047eb286cc740127d4136008fbd398916d200365 | [
"MIT"
] | null | null | null | currency_crawler.py | ingyunson/automation | 047eb286cc740127d4136008fbd398916d200365 | [
"MIT"
] | 6 | 2018-09-05T10:19:47.000Z | 2018-10-30T14:09:55.000Z | currency_crawler.py | ingyunson/automation | 047eb286cc740127d4136008fbd398916d200365 | [
"MIT"
] | null | null | null | import requests
import datetime
import json
import telegram
#공공 오픈 API를 이용하여 외환 정보 받아오기
if __name__ == '__main__':
main() | 36.222222 | 127 | 0.615031 | import requests
import datetime
import json
import telegram
#공공 오픈 API를 이용하여 외환 정보 받아오기
def api_set(day):
date = day.strftime('%Y-%m-%d')
api_key = <API KEY>
api = 'https://www.koreaexim.go.kr/site/program/financial/exchangeJSON?authkey={key}&searchdate={date}&data={data}'.format(
key=api_key, date... | 2,276 | 0 | 45 |
15ce68266b98edbf7b79be1b0e0552cbef73bde7 | 58 | py | Python | examples/conditionally_existing_if_else.py | doboy/Underscore | d98273db3144cda79191d2c90f45d81b6d700b1f | [
"MIT"
] | 7 | 2016-09-23T00:44:05.000Z | 2021-10-04T21:19:12.000Z | examples/conditionally_existing_if_else.py | jameswu1991/Underscore | d98273db3144cda79191d2c90f45d81b6d700b1f | [
"MIT"
] | 1 | 2016-09-23T00:45:05.000Z | 2019-02-16T19:05:37.000Z | examples/conditionally_existing_if_else.py | jameswu1991/Underscore | d98273db3144cda79191d2c90f45d81b6d700b1f | [
"MIT"
] | 3 | 2016-09-23T01:13:15.000Z | 2018-07-20T21:22:17.000Z | if False:
x = 3
elif False:
y = 4
else:
z = 5
| 8.285714 | 11 | 0.448276 | if False:
x = 3
elif False:
y = 4
else:
z = 5
| 0 | 0 | 0 |
8e7d46b5fca05f2d980aad7c45a2c48983d7444b | 15 | py | Python | src/spacefarer/shared.py | gaming32/SpaceFarer | 04a8631bc8029202fdb4b87d290dbe27504cb0c1 | [
"MIT"
] | null | null | null | src/spacefarer/shared.py | gaming32/SpaceFarer | 04a8631bc8029202fdb4b87d290dbe27504cb0c1 | [
"MIT"
] | null | null | null | src/spacefarer/shared.py | gaming32/SpaceFarer | 04a8631bc8029202fdb4b87d290dbe27504cb0c1 | [
"MIT"
] | null | null | null | delta_time = 0
| 7.5 | 14 | 0.733333 | delta_time = 0
| 0 | 0 | 0 |
bca2078d279bbc04061518cca958f9f61c6dc73a | 1,380 | py | Python | beacontools/structs/eddystone.py | pibico/beacontools | 513e1c7ff2aaf74b6c7d7b10805c2f6ca4384e3d | [
"MIT"
] | 139 | 2017-06-09T17:15:23.000Z | 2022-03-15T03:02:17.000Z | beacontools/structs/eddystone.py | pibico/beacontools | 513e1c7ff2aaf74b6c7d7b10805c2f6ca4384e3d | [
"MIT"
] | 71 | 2017-06-20T03:20:56.000Z | 2022-02-13T22:47:53.000Z | beacontools/structs/eddystone.py | pibico/beacontools | 513e1c7ff2aaf74b6c7d7b10805c2f6ca4384e3d | [
"MIT"
] | 59 | 2017-06-20T03:10:00.000Z | 2022-03-15T23:54:44.000Z | """All low level structures used for parsing eddystone packets."""
from construct import Struct, Byte, Switch, OneOf, Int8sl, Array, \
GreedyString, Int16ub, Int16ul, Int32ub
from ..const import EDDYSTONE_URL_SCHEMES, EDDYSTONE_TLM_UNENCRYPTED, EDDYSTONE_TLM_ENCRYPTED
# pylint: disable=invalid-n... | 28.163265 | 93 | 0.681884 | """All low level structures used for parsing eddystone packets."""
from construct import Struct, Byte, Switch, OneOf, Int8sl, Array, \
GreedyString, Int16ub, Int16ul, Int32ub
from ..const import EDDYSTONE_URL_SCHEMES, EDDYSTONE_TLM_UNENCRYPTED, EDDYSTONE_TLM_ENCRYPTED
# pylint: disable=invalid-n... | 0 | 0 | 0 |
260163c0f4d9697942b0734e2f470c20101143d0 | 2,887 | py | Python | interpreter.py | amupxm/python_simple_interpreter | 120e387947889cb3707dd33a019eeb6fb99fc6aa | [
"MIT"
] | 2 | 2021-06-05T08:33:19.000Z | 2021-08-10T11:40:06.000Z | interpreter.py | amupxm/python_simple_interpreter | 120e387947889cb3707dd33a019eeb6fb99fc6aa | [
"MIT"
] | null | null | null | interpreter.py | amupxm/python_simple_interpreter | 120e387947889cb3707dd33a019eeb6fb99fc6aa | [
"MIT"
] | null | null | null | #read the program.amup file
raw_file = open("program.amup", "r")
#make empty structure of program
arr = {
"target": "",
"sec_target": "",
"thr_target": "",
"operator": "+",
"A": 0,
"B": 0,
"C": 0,
"D": 0
}
#make empty list of converted to C++ language program
lines = []
#simple functio... | 35.641975 | 98 | 0.420159 | #read the program.amup file
raw_file = open("program.amup", "r")
#make empty structure of program
arr = {
"target": "",
"sec_target": "",
"thr_target": "",
"operator": "+",
"A": 0,
"B": 0,
"C": 0,
"D": 0
}
#make empty list of converted to C++ language program
lines = []
#simple functio... | 30 | 0 | 22 |
f1328c631185034d32e2da1e415c4d60d40d6d58 | 4,081 | py | Python | tests/test_s3.py | mrslow/yandex-s3 | 560a901d8f5c636e268cd2a9f8a2a72841f2cf7e | [
"MIT"
] | 2 | 2021-08-20T15:24:03.000Z | 2021-08-24T14:34:22.000Z | tests/test_s3.py | mrslow/yandex-s3 | 560a901d8f5c636e268cd2a9f8a2a72841f2cf7e | [
"MIT"
] | null | null | null | tests/test_s3.py | mrslow/yandex-s3 | 560a901d8f5c636e268cd2a9f8a2a72841f2cf7e | [
"MIT"
] | null | null | null | import pytest
from datetime import datetime
from uuid import uuid4
from s3.core import RequestError
base_url = 'https://test-bucket.storage.yandexcloud.net'
list_data = (
b'<?xml version="1.0" encoding="UTF-8"?>\n'
b'<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">\n'
b' <Name>flk-tes... | 29.359712 | 76 | 0.620926 | import pytest
from datetime import datetime
from uuid import uuid4
from s3.core import RequestError
base_url = 'https://test-bucket.storage.yandexcloud.net'
list_data = (
b'<?xml version="1.0" encoding="UTF-8"?>\n'
b'<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">\n'
b' <Name>flk-tes... | 1,336 | 0 | 88 |
b21ef3bf467586a5e88eaddad0cbe0a6c0b4f4fb | 2,719 | py | Python | RBFN_bash/Cancer_preprocess.py | afalak94/Radial-Basis-Function-Neural-Network | ff76cd323073e4bec149f4f1b8117da1fe64a42b | [
"CC0-1.0"
] | null | null | null | RBFN_bash/Cancer_preprocess.py | afalak94/Radial-Basis-Function-Neural-Network | ff76cd323073e4bec149f4f1b8117da1fe64a42b | [
"CC0-1.0"
] | null | null | null | RBFN_bash/Cancer_preprocess.py | afalak94/Radial-Basis-Function-Neural-Network | ff76cd323073e4bec149f4f1b8117da1fe64a42b | [
"CC0-1.0"
] | 1 | 2021-02-21T19:09:03.000Z | 2021-02-21T19:09:03.000Z | import numpy as np
import csv
from pandas import read_csv
import pandas as pd
from sklearn.model_selection import train_test_split
with open('cancer-data.csv') as f:
raw_data = f.read()
####PREPROCESS OF THE DATASET######
#def data_preprocess2(filename):
# # Load a CSV file
# dataset = read_csv(filename, header... | 30.211111 | 82 | 0.657595 | import numpy as np
import csv
from pandas import read_csv
import pandas as pd
from sklearn.model_selection import train_test_split
with open('cancer-data.csv') as f:
raw_data = f.read()
####PREPROCESS OF THE DATASET######
def data_preprocess(raw_data):
# Read string files
dataset = list()
csv_reader =... | 1,279 | 0 | 22 |
413837a03cc9be004e0ac42b7ad16f81699bd5ec | 1,337 | py | Python | app/auth/views.py | mishel254/personal-blog | db39299188232ec725ed6f9ed8051a6fa403d355 | [
"MIT"
] | null | null | null | app/auth/views.py | mishel254/personal-blog | db39299188232ec725ed6f9ed8051a6fa403d355 | [
"MIT"
] | null | null | null | app/auth/views.py | mishel254/personal-blog | db39299188232ec725ed6f9ed8051a6fa403d355 | [
"MIT"
] | null | null | null | from flask import render_template, redirect, url_for,flash,request
from flask_login import login_required, current_user, login_user,logout_user
from ..models import Users
from .forms import Loginform,Signupform
from .. import db
from . import auth
@auth.route('/signup', methods=['GET','POST'])
@auth.route('/login... | 31.093023 | 107 | 0.688856 | from flask import render_template, redirect, url_for,flash,request
from flask_login import login_required, current_user, login_user,logout_user
from ..models import Users
from .forms import Loginform,Signupform
from .. import db
from . import auth
@auth.route('/signup', methods=['GET','POST'])
def signup():
form... | 884 | 0 | 66 |
a330fddb281c44e4d5af6c0383a84754087e5ada | 115 | py | Python | tests/python_parser/data/with_statement_multi_items.py | ahupp/pegen | e28fe4fb1972c55af5ddb6a7bdd9cba4ea072b81 | [
"MIT"
] | 106 | 2020-05-14T03:43:47.000Z | 2022-03-26T21:46:47.000Z | tests/python_parser/data/with_statement_multi_items.py | ahupp/pegen | e28fe4fb1972c55af5ddb6a7bdd9cba4ea072b81 | [
"MIT"
] | 60 | 2020-05-07T23:17:46.000Z | 2022-03-30T20:26:25.000Z | tests/python_parser/data/with_statement_multi_items.py | ahupp/pegen | e28fe4fb1972c55af5ddb6a7bdd9cba4ea072b81 | [
"MIT"
] | 20 | 2020-05-22T10:21:30.000Z | 2022-03-26T21:23:44.000Z | with (a, c,):
pass
with (a as b, c):
pass
async with (a, c,):
pass
async with (a as b, c):
pass
| 9.583333 | 23 | 0.486957 | with (a, c,):
pass
with (a as b, c):
pass
async with (a, c,):
pass
async with (a as b, c):
pass
| 0 | 0 | 0 |
6a6e239ceb3a20d68fa017063835507d445742c4 | 141 | py | Python | nyc/mapping/__init__.py | lopez86/NYCDataTools | 9c860545bacd27a7a1106bba3e3d75cd0320e6df | [
"MIT"
] | null | null | null | nyc/mapping/__init__.py | lopez86/NYCDataTools | 9c860545bacd27a7a1106bba3e3d75cd0320e6df | [
"MIT"
] | null | null | null | nyc/mapping/__init__.py | lopez86/NYCDataTools | 9c860545bacd27a7a1106bba3e3d75cd0320e6df | [
"MIT"
] | null | null | null | from .CensusTractMapper import CensusTractMapper
from .NeighborhoodMapper import NeighborhoodMapper
from .BoroughMapper import BoroughMapper
| 35.25 | 50 | 0.893617 | from .CensusTractMapper import CensusTractMapper
from .NeighborhoodMapper import NeighborhoodMapper
from .BoroughMapper import BoroughMapper
| 0 | 0 | 0 |
82132716d68b40cda484559658bbd18b1d8a529e | 1,881 | py | Python | wagtailplus/wagtaillinks/migrations/0002_initial_data.py | DanAtShenTech/wagtailplus | 22cac857175d8a6f77e470751831c14a92ccd768 | [
"BSD-2-Clause"
] | null | null | null | wagtailplus/wagtaillinks/migrations/0002_initial_data.py | DanAtShenTech/wagtailplus | 22cac857175d8a6f77e470751831c14a92ccd768 | [
"BSD-2-Clause"
] | null | null | null | wagtailplus/wagtaillinks/migrations/0002_initial_data.py | DanAtShenTech/wagtailplus | 22cac857175d8a6f77e470751831c14a92ccd768 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import VERSION as DJANGO_VERSION
from django.db import migrations
| 33 | 93 | 0.647528 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import VERSION as DJANGO_VERSION
from django.db import migrations
def add_link_permissions_to_admin_groups(apps, schema_editor):
ContentType = apps.get_model('contenttypes.ContentType')
Permission = apps.get_model('auth.Permission')... | 1,368 | 322 | 46 |
61265805f6fb5ce931146d027f8efa521cac84c1 | 7,057 | py | Python | config/settings.py | epicserve/django-base-site | 7a382d3f74588f45548697e00e2a8a3398c6b526 | [
"MIT"
] | 102 | 2015-01-04T15:48:38.000Z | 2022-03-30T21:39:31.000Z | config/settings.py | epicserve/django-base-site | 7a382d3f74588f45548697e00e2a8a3398c6b526 | [
"MIT"
] | 20 | 2020-03-14T15:20:30.000Z | 2021-09-25T14:52:49.000Z | config/settings.py | epicserve/django-base-site | 7a382d3f74588f45548697e00e2a8a3398c6b526 | [
"MIT"
] | 23 | 2015-05-10T14:22:11.000Z | 2021-09-28T11:32:42.000Z | import os
import socket
import sys
import environs
from apps.base.utils.env import env
BASE_DIR = environs.Path(__file__).parent.parent # type: ignore
READ_DOT_ENV_FILE = env.bool("READ_DOT_ENV_FILE", default=True)
if READ_DOT_ENV_FILE is True:
env.read_env(str(BASE_DIR.joinpath(".env")))
# Quick-start devel... | 33.131455 | 167 | 0.735157 | import os
import socket
import sys
import environs
from apps.base.utils.env import env
BASE_DIR = environs.Path(__file__).parent.parent # type: ignore
READ_DOT_ENV_FILE = env.bool("READ_DOT_ENV_FILE", default=True)
if READ_DOT_ENV_FILE is True:
env.read_env(str(BASE_DIR.joinpath(".env")))
# Quick-start devel... | 0 | 0 | 0 |
af5ce3b397dd38e0b7581aecb120cafaec40ed5b | 6,324 | py | Python | diabolo_play/src/diabolo_play/motion_knot_points.py | omron-sinicx/diabolo | a0258fdf634d27c7cf185b2e40c6b12699417d36 | [
"BSD-3-Clause"
] | 11 | 2021-10-15T15:51:24.000Z | 2021-12-26T16:43:17.000Z | diabolo_play/src/diabolo_play/motion_knot_points.py | omron-sinicx/diabolo | a0258fdf634d27c7cf185b2e40c6b12699417d36 | [
"BSD-3-Clause"
] | null | null | null | diabolo_play/src/diabolo_play/motion_knot_points.py | omron-sinicx/diabolo | a0258fdf634d27c7cf185b2e40c6b12699417d36 | [
"BSD-3-Clause"
] | 1 | 2022-02-01T01:58:37.000Z | 2022-02-01T01:58:37.000Z | #!/usr/bin/env python
import rospy
from interactive_markers.interactive_marker_server import InteractiveMarkerServer
from visualization_msgs.msg import InteractiveMarker, InteractiveMarkerControl, Marker
import copy
class KnotPointsServer:
'''
This class allows setting points with interactive markers
This... | 44.851064 | 136 | 0.636306 | #!/usr/bin/env python
import rospy
from interactive_markers.interactive_marker_server import InteractiveMarkerServer
from visualization_msgs.msg import InteractiveMarker, InteractiveMarkerControl, Marker
import copy
class KnotPointsServer:
'''
This class allows setting points with interactive markers
This... | 2,343 | 0 | 136 |
3d866ab2994647fdaf22f131e04df80d5e796a1f | 17,617 | py | Python | zrp/modeling/pipeline_builder.py | zestai/zrp | 14211cc90857e21a522637c31d42b0b663fcd368 | [
"Apache-2.0"
] | 14 | 2022-02-09T20:58:31.000Z | 2022-03-29T16:32:01.000Z | zrp/modeling/pipeline_builder.py | zestai/zrp | 14211cc90857e21a522637c31d42b0b663fcd368 | [
"Apache-2.0"
] | 3 | 2022-02-04T17:25:38.000Z | 2022-03-15T01:13:32.000Z | zrp/modeling/pipeline_builder.py | zestai/zrp | 14211cc90857e21a522637c31d42b0b663fcd368 | [
"Apache-2.0"
] | null | null | null | from os.path import expanduser, dirname
import pandas as pd
import numpy as np
import os
import re
import sys
import json
import joblib
import pickle
import xgboost
from xgboost import XGBClassifier
from sklearn.pipeline import Pipeline
from sklearn.compose import ColumnTransformer
from sklearn.model_selection import ... | 44.487374 | 503 | 0.605608 | from os.path import expanduser, dirname
import pandas as pd
import numpy as np
import os
import re
import sys
import json
import joblib
import pickle
import xgboost
from xgboost import XGBClassifier
from sklearn.pipeline import Pipeline
from sklearn.compose import ColumnTransformer
from sklearn.model_selection import ... | 13,068 | 0 | 328 |
df8adcb642168abbf747644fc75b1dd0e5af9251 | 53 | py | Python | pasttrec/__init__.py | HADES-Cracovia/pasttrectools | c675da2dc2fa09a55f6d181d85db19b7fe96b8e3 | [
"MIT"
] | null | null | null | pasttrec/__init__.py | HADES-Cracovia/pasttrectools | c675da2dc2fa09a55f6d181d85db19b7fe96b8e3 | [
"MIT"
] | null | null | null | pasttrec/__init__.py | HADES-Cracovia/pasttrectools | c675da2dc2fa09a55f6d181d85db19b7fe96b8e3 | [
"MIT"
] | null | null | null | from .pasttrec import *
from .communication import *
| 17.666667 | 28 | 0.773585 | from .pasttrec import *
from .communication import *
| 0 | 0 | 0 |
f19a82bc90283af620ba726af0d67a2df3d1daf2 | 4,997 | py | Python | mumbleBot.py | zorodc/py-mumbot | 7ca5c2295d786852e5d8bcab50dc582ef5bb1de1 | [
"0BSD"
] | null | null | null | mumbleBot.py | zorodc/py-mumbot | 7ca5c2295d786852e5d8bcab50dc582ef5bb1de1 | [
"0BSD"
] | null | null | null | mumbleBot.py | zorodc/py-mumbot | 7ca5c2295d786852e5d8bcab50dc582ef5bb1de1 | [
"0BSD"
] | null | null | null | #!/usr/bin/env python3
# depends on 'pymumble'
# A mumble bot, plays music, tells fortunes.
# Uses youtube-dl as a backend.
import subprocess
import wave
from pymumble_py3.mumble import Mumble
from pymumble_py3.callbacks import *
from subprocess import call
from sys import argv
from os import remo... | 31.626582 | 101 | 0.61657 | #!/usr/bin/env python3
# depends on 'pymumble'
# A mumble bot, plays music, tells fortunes.
# Uses youtube-dl as a backend.
import subprocess
import wave
from pymumble_py3.mumble import Mumble
from pymumble_py3.callbacks import *
from subprocess import call
from sys import argv
from os import remo... | 2,756 | 0 | 203 |
d9d69ee997a23a52b4855205b3f28386526dabeb | 267 | py | Python | Coursera/Week.7/Task.13.py | v1nnyb0y/Coursera.BasePython | bbfb3184dc27a4cdb16b087123890991afbc5506 | [
"MIT"
] | null | null | null | Coursera/Week.7/Task.13.py | v1nnyb0y/Coursera.BasePython | bbfb3184dc27a4cdb16b087123890991afbc5506 | [
"MIT"
] | null | null | null | Coursera/Week.7/Task.13.py | v1nnyb0y/Coursera.BasePython | bbfb3184dc27a4cdb16b087123890991afbc5506 | [
"MIT"
] | null | null | null | '''
Страны и города
'''
n = int(input())
cities = dict()
for line in range(n):
line = input()
line = line.split()
country = line[0]
for city in line[1:]:
cities[city] = country
m = int(input())
for city in range(m):
print(cities[input()])
| 17.8 | 30 | 0.569288 | '''
Страны и города
'''
n = int(input())
cities = dict()
for line in range(n):
line = input()
line = line.split()
country = line[0]
for city in line[1:]:
cities[city] = country
m = int(input())
for city in range(m):
print(cities[input()])
| 0 | 0 | 0 |
807c2d99123c1b54f4c2ef1d337b46a0661b70cf | 4,936 | py | Python | migrate_locations_to_concepts.py | ecohealthalliance/concept-tools | 865a7ceb94ca8d927eb9a7ed53fcb6c1e1a68f53 | [
"Apache-2.0"
] | null | null | null | migrate_locations_to_concepts.py | ecohealthalliance/concept-tools | 865a7ceb94ca8d927eb9a7ed53fcb6c1e1a68f53 | [
"Apache-2.0"
] | null | null | null | migrate_locations_to_concepts.py | ecohealthalliance/concept-tools | 865a7ceb94ca8d927eb9a7ed53fcb6c1e1a68f53 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
Combine data from the
crosswiki_dictionary
crosswiki_invdict
dbpedia_geo
geoname_links
You'll want to make an index on the geonameid property in the
geoanmes.allCountries collection, e.g.:
db.allCountries.ensureIndex({geonameid: 1})
"""
import sys
import re
import codecs
i... | 30.469136 | 85 | 0.558752 | #!/usr/bin/env python
"""
Combine data from the
crosswiki_dictionary
crosswiki_invdict
dbpedia_geo
geoname_links
You'll want to make an index on the geonameid property in the
geoanmes.allCountries collection, e.g.:
db.allCountries.ensureIndex({geonameid: 1})
"""
import sys
import re
import codecs
i... | 1,694 | 2,762 | 23 |
cb7c406903017ff9130aec1ce2d523b0aadd359c | 841 | py | Python | slack-consumer/slack.py | VirtualSatai/humble-bot | 2f83642a319d933da46427b5b8090149576e2c76 | [
"MIT"
] | null | null | null | slack-consumer/slack.py | VirtualSatai/humble-bot | 2f83642a319d933da46427b5b8090149576e2c76 | [
"MIT"
] | 10 | 2018-05-15T08:07:32.000Z | 2018-05-21T08:04:04.000Z | slack-consumer/slack.py | VirtualSatai/humble-bot | 2f83642a319d933da46427b5b8090149576e2c76 | [
"MIT"
] | 1 | 2018-05-17T13:26:55.000Z | 2018-05-17T13:26:55.000Z | import json
import os
import time
import zmq
from slackclient import SlackClient
from zmq import Context
SLACK_CHANNEL_ID = os.environ["SLACK_CHANNEL_ID"]
SLACK_BOT_TOKEN = os.environ["SLACK_BOT_TOKEN"]
TOPICFILTER = "1"
TIMEOUT = 1
ctx = Context()
print("Connecting to the producer")
socket = ctx.socket(zmq.SUB)
s... | 22.131579 | 92 | 0.69679 | import json
import os
import time
import zmq
from slackclient import SlackClient
from zmq import Context
SLACK_CHANNEL_ID = os.environ["SLACK_CHANNEL_ID"]
SLACK_BOT_TOKEN = os.environ["SLACK_BOT_TOKEN"]
TOPICFILTER = "1"
TIMEOUT = 1
ctx = Context()
print("Connecting to the producer")
socket = ctx.socket(zmq.SUB)
s... | 0 | 0 | 0 |
1c875668018aac49c11b481f81f0470a36e53b7e | 4,548 | py | Python | extract_img.py | JadeMaveric/image-collage-maker | b75bb63460e21e773ed681ad09aad6f3bcd4798e | [
"MIT"
] | 58 | 2018-11-03T23:05:22.000Z | 2022-03-22T20:03:50.000Z | extract_img.py | JadeMaveric/image-collage-maker | b75bb63460e21e773ed681ad09aad6f3bcd4798e | [
"MIT"
] | 6 | 2018-12-01T02:45:08.000Z | 2022-01-30T23:10:52.000Z | extract_img.py | JadeMaveric/image-collage-maker | b75bb63460e21e773ed681ad09aad6f3bcd4798e | [
"MIT"
] | 10 | 2018-11-29T20:59:31.000Z | 2021-11-18T14:28:38.000Z | """
extract_img.py
get images from WeChat friends list.
"""
import itchat
import os
import pickle
from concurrent.futures import *
import concurrent.futures
import time
from tqdm import tqdm
from math import ceil
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser()
... | 33.940299 | 101 | 0.593008 | """
extract_img.py
get images from WeChat friends list.
"""
import itchat
import os
import pickle
from concurrent.futures import *
import concurrent.futures
import time
from tqdm import tqdm
from math import ceil
import argparse
def download_friend(args):
user_name, image_id, download_dir = args
... | 572 | 0 | 75 |
f91dd51da7bac4dbb222349c288f50dcaf097cd6 | 1,337 | py | Python | digsby/src/tests/digsby_unittest.py | ifwe/digsby | f5fe00244744aa131e07f09348d10563f3d8fa99 | [
"Python-2.0"
] | 35 | 2015-08-15T14:32:38.000Z | 2021-12-09T16:21:26.000Z | digsby/src/tests/digsby_unittest.py | niterain/digsby | 16a62c7df1018a49eaa8151c0f8b881c7e252949 | [
"Python-2.0"
] | 4 | 2015-09-12T10:42:57.000Z | 2017-02-27T04:05:51.000Z | digsby/src/tests/digsby_unittest.py | niterain/digsby | 16a62c7df1018a49eaa8151c0f8b881c7e252949 | [
"Python-2.0"
] | 15 | 2015-07-10T23:58:07.000Z | 2022-01-23T22:16:33.000Z | import wx
import unittest
try:
_
except NameError:
import gettext
gettext.install('Digsby')
if getattr(wx, 'WXPY', False):
wx.WindowClass = wx._Window
else:
wx.WindowClass = wx.Window
try:
sentinel
except NameError:
import bootstrap
bootstrap.install_sentinel()
test_main = unittest.... | 21.564516 | 58 | 0.618549 | import wx
import unittest
try:
_
except NameError:
import gettext
gettext.install('Digsby')
if getattr(wx, 'WXPY', False):
wx.WindowClass = wx._Window
else:
wx.WindowClass = wx.Window
try:
sentinel
except NameError:
import bootstrap
bootstrap.install_sentinel()
class TestCase(unittes... | 492 | 497 | 23 |
e280af5bb76f7ca4c74e7ba4975070d6c87d5940 | 12,742 | py | Python | src/wm_interpreter_node.py | WalkingMachine/wm_interpreter | 522864c340886669277d043d385a372c5f86ed5b | [
"Apache-2.0"
] | null | null | null | src/wm_interpreter_node.py | WalkingMachine/wm_interpreter | 522864c340886669277d043d385a372c5f86ed5b | [
"Apache-2.0"
] | null | null | null | src/wm_interpreter_node.py | WalkingMachine/wm_interpreter | 522864c340886669277d043d385a372c5f86ed5b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import roslib
import rospy
import smach
import smach_ros
from smach import StateMachine
import actionlib
import time
import threading
from smach_ros import SimpleActionState
from smach_ros import ActionServerWrapper
from std_msgs.msg import String
from std_msgs.msg import UInt8
from wm_interprete... | 39.32716 | 115 | 0.504473 | #!/usr/bin/env python
import roslib
import rospy
import smach
import smach_ros
from smach import StateMachine
import actionlib
import time
import threading
from smach_ros import SimpleActionState
from smach_ros import ActionServerWrapper
from std_msgs.msg import String
from std_msgs.msg import UInt8
from wm_interprete... | 7,119 | 1,152 | 88 |
ba1712adf36dca6db45053cac63860a745bb6b20 | 5,245 | py | Python | app/modules/passport/login_mobile.py | Eastwu5788/Heron | 646eeaacea77e293c6eccc6dad82a04ece9294a3 | [
"Apache-2.0"
] | 7 | 2018-01-29T02:46:31.000Z | 2018-03-25T11:15:10.000Z | app/modules/passport/login_mobile.py | Eastwu5788/Heron | 646eeaacea77e293c6eccc6dad82a04ece9294a3 | [
"Apache-2.0"
] | 4 | 2021-06-08T19:38:03.000Z | 2022-03-11T23:18:46.000Z | app/modules/passport/login_mobile.py | Eastwu5788/Heron | 646eeaacea77e293c6eccc6dad82a04ece9294a3 | [
"Apache-2.0"
] | 1 | 2021-06-12T14:14:35.000Z | 2021-06-12T14:14:35.000Z | from flask import request, redirect, g
from app import db
from config.setting import MOBILE_WHITE_LIST
from app.modules.vendor.pre_request.flask import filter_params
from app.modules.vendor.pre_request.filter_rules import Rule
from app.modules.passport.register_mobile import RegisterHandler
from app.modules.base.bas... | 34.966667 | 109 | 0.67836 | from flask import request, redirect, g
from app import db
from config.setting import MOBILE_WHITE_LIST
from app.modules.vendor.pre_request.flask import filter_params
from app.modules.vendor.pre_request.filter_rules import Rule
from app.modules.passport.register_mobile import RegisterHandler
from app.modules.base.bas... | 970 | 3,533 | 23 |
1fc88f161d5951322327018aba53bb962870bfe9 | 777 | py | Python | lasier/circuit_breaker/rules/base.py | rafa-acioly/lasier | b518f93207ff15ba32b286f466f3ca3cea231b4c | [
"MIT"
] | 61 | 2019-12-13T20:08:30.000Z | 2022-03-22T11:51:04.000Z | lasier/circuit_breaker/rules/base.py | jairhenrique/lasier | 29bf96cb888493d369a22400bec6acffe345d168 | [
"MIT"
] | 25 | 2019-12-13T17:14:46.000Z | 2022-03-17T18:49:34.000Z | lasier/circuit_breaker/rules/base.py | jairhenrique/lasier | 29bf96cb888493d369a22400bec6acffe345d168 | [
"MIT"
] | 6 | 2020-04-02T21:10:08.000Z | 2022-03-17T15:31:15.000Z | import abc
from typing import Optional
| 26.793103 | 77 | 0.689833 | import abc
from typing import Optional
class BaseRule(metaclass=abc.ABCMeta):
def __init__(
self, failure_cache_key: str, request_cache_key: Optional[str] = None
) -> None:
self.failure_cache_key = failure_cache_key
self.request_cache_key = request_cache_key
@abc.abstractmethod
... | 515 | 199 | 23 |
abcab4ac7876cc5a907987afd65687e37c1abfa3 | 31 | py | Python | snippets/7.py | krrg/python-tutorial | a6ef8865cb46ee48624d7c7451d1894741405cc4 | [
"MIT"
] | null | null | null | snippets/7.py | krrg/python-tutorial | a6ef8865cb46ee48624d7c7451d1894741405cc4 | [
"MIT"
] | null | null | null | snippets/7.py | krrg/python-tutorial | a6ef8865cb46ee48624d7c7451d1894741405cc4 | [
"MIT"
] | null | null | null | x = 42
print x # Outputs `42` | 15.5 | 24 | 0.580645 | x = 42
print x # Outputs `42` | 0 | 0 | 0 |
65ead98804d423c1188a4c86eb90dce421ca20a2 | 6,496 | py | Python | examples/pipeline/match_id_test/pipeline-hetero-lr-feature-engineering.py | rubenlozanoaht3m/DataDogm | cd605e8072cca31e8418830c3300657ae2fa5b16 | [
"Apache-2.0"
] | 715 | 2019-01-24T10:52:03.000Z | 2019-10-31T12:19:22.000Z | examples/pipeline/match_id_test/pipeline-hetero-lr-feature-engineering.py | rubenlozanoaht3m/DataDogm | cd605e8072cca31e8418830c3300657ae2fa5b16 | [
"Apache-2.0"
] | 270 | 2019-02-11T02:57:36.000Z | 2019-08-29T11:22:33.000Z | examples/pipeline/match_id_test/pipeline-hetero-lr-feature-engineering.py | rubenlozanoaht3m/DataDogm | cd605e8072cca31e8418830c3300657ae2fa5b16 | [
"Apache-2.0"
] | 200 | 2019-01-26T14:21:35.000Z | 2019-11-01T01:14:36.000Z | #
# Copyright 2019 The FATE Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 36.088889 | 108 | 0.640702 | #
# Copyright 2019 The FATE Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 4,977 | 0 | 23 |
e0cc96fcb4e8bfe6a1a15a57f29958234eeab877 | 28,270 | py | Python | dataAnalytics/simulatorGraphics/simulatorExtra.py | PeterJWei/EnergyFootprinting | 0396efba7d4e6863452e322f9f7561c6cd756478 | [
"MIT"
] | null | null | null | dataAnalytics/simulatorGraphics/simulatorExtra.py | PeterJWei/EnergyFootprinting | 0396efba7d4e6863452e322f9f7561c6cd756478 | [
"MIT"
] | null | null | null | dataAnalytics/simulatorGraphics/simulatorExtra.py | PeterJWei/EnergyFootprinting | 0396efba7d4e6863452e322f9f7561c6cd756478 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import random
import math
import sys
from graphics import *
_num_bins = 96
win = GraphWin("floorplan", 531, 741)
b = Image(Point(265, 371), "floorplan.gif")
r = Rectangle(Point(20, 0), Point(511, 150))
r.setFill("white")
title = Text(Point(265, 30), "Building Occupant Optimization")
si... | 48.910035 | 162 | 0.652069 | import matplotlib.pyplot as plt
import random
import math
import sys
from graphics import *
_num_bins = 96
win = GraphWin("floorplan", 531, 741)
b = Image(Point(265, 371), "floorplan.gif")
r = Rectangle(Point(20, 0), Point(511, 150))
r.setFill("white")
title = Text(Point(265, 30), "Building Occupant Optimization")
si... | 27,024 | -5 | 706 |
59ff111215f6abac14f607980ea6b1f07a25b20f | 153 | py | Python | case_plaso/__init__.py | casework/CASE-Implementation-Plaso | 37243fce53d2a31388fdb405860955ee443bbe96 | [
"Apache-2.0"
] | 1 | 2019-04-16T17:07:56.000Z | 2019-04-16T17:07:56.000Z | case_plaso/__init__.py | casework/CASE-Implementation-Plaso | 37243fce53d2a31388fdb405860955ee443bbe96 | [
"Apache-2.0"
] | null | null | null | case_plaso/__init__.py | casework/CASE-Implementation-Plaso | 37243fce53d2a31388fdb405860955ee443bbe96 | [
"Apache-2.0"
] | null | null | null |
import rdflib
# Store custom properties and objects not defined in CASE as the PLASO prefix.
PLASO = rdflib.Namespace('http://plaso.example.org/core#') | 30.6 | 78 | 0.771242 |
import rdflib
# Store custom properties and objects not defined in CASE as the PLASO prefix.
PLASO = rdflib.Namespace('http://plaso.example.org/core#') | 0 | 0 | 0 |
0d7d627d1c06671d21f53bcf881ae4e4eabbbf6f | 60 | py | Python | T07-13/program.py | maa76/SSof-Project1920 | 9b4ad9ac41a648c425fcfcd49cd52ff84e528bde | [
"MIT"
] | 2 | 2019-11-20T19:26:07.000Z | 2019-11-22T00:42:23.000Z | T07-13/program.py | maa76/SSof-Project1920 | 9b4ad9ac41a648c425fcfcd49cd52ff84e528bde | [
"MIT"
] | 2 | 2019-11-28T05:21:24.000Z | 2019-11-28T05:21:58.000Z | T07-13/program.py | maa76/SSof-Project1920 | 9b4ad9ac41a648c425fcfcd49cd52ff84e528bde | [
"MIT"
] | 25 | 2019-11-27T01:40:56.000Z | 2019-12-04T23:38:59.000Z | a = source()
b = k
if a:
b = c
elif a:
b = d
sink(b) | 8.571429 | 12 | 0.433333 | a = source()
b = k
if a:
b = c
elif a:
b = d
sink(b) | 0 | 0 | 0 |
15188f66f4181f2f1a482c3e158656cdf1b983a5 | 1,647 | py | Python | authentication/SignupHandler.py | anabarasan/moderator2 | d48389b7dbc0892efaf811ab332e3c7fdb59cec0 | [
"MIT"
] | null | null | null | authentication/SignupHandler.py | anabarasan/moderator2 | d48389b7dbc0892efaf811ab332e3c7fdb59cec0 | [
"MIT"
] | 3 | 2015-10-27T11:20:22.000Z | 2015-10-27T11:31:07.000Z | authentication/SignupHandler.py | anabarasan/moderator2 | d48389b7dbc0892efaf811ab332e3c7fdb59cec0 | [
"MIT"
] | null | null | null | from authentication import BaseHandler
from authentication import app
# from authentication import sendmail
@app.route('/signup', 'signup')
| 33.612245 | 147 | 0.656345 | from authentication import BaseHandler
from authentication import app
# from authentication import sendmail
@app.route('/signup', 'signup')
class SignupHandler(BaseHandler):
def get(self):
self.render_template('signup.html')
def post(self):
user_name = self.request.get('username')
ema... | 1,418 | 12 | 75 |
01dd071fc49f87f71bc4878eb9578d3f0818c006 | 5,004 | py | Python | pentest-scripts/learning-python-for-forensics/Chapter 3/setupapi_parser.py | paulveillard/cybersecurity-penetration-testing | a5afff13ec25afd0cf16ef966d35bddb91518af4 | [
"Apache-2.0"
] | 6 | 2021-12-07T21:02:12.000Z | 2022-03-03T12:08:14.000Z | pentest-scripts/learning-python-for-forensics/Chapter 3/setupapi_parser.py | paulveillard/cybersecurity-penetration-testing | a5afff13ec25afd0cf16ef966d35bddb91518af4 | [
"Apache-2.0"
] | null | null | null | pentest-scripts/learning-python-for-forensics/Chapter 3/setupapi_parser.py | paulveillard/cybersecurity-penetration-testing | a5afff13ec25afd0cf16ef966d35bddb91518af4 | [
"Apache-2.0"
] | 1 | 2022-01-15T23:57:36.000Z | 2022-01-15T23:57:36.000Z | import argparse
import os
import sys
import usb_lookup
__author__ = 'Preston Miller & Chapin Bryce'
__date__ = '20160401'
__version__ = 0.03
__description__ = 'This scripts reads a Windows 7 Setup API log and prints USB Devices to the user'
def main(in_file):
"""
Main function to handle operation
:param ... | 33.583893 | 120 | 0.643086 | import argparse
import os
import sys
import usb_lookup
__author__ = 'Preston Miller & Chapin Bryce'
__date__ = '20160401'
__version__ = 0.03
__description__ = 'This scripts reads a Windows 7 Setup API log and prints USB Devices to the user'
def main(in_file):
"""
Main function to handle operation
:param ... | 0 | 0 | 0 |
b884a674517638e0e6230eed1a55d1d055cedc2f | 2,939 | py | Python | backend/project/app/extension/history/conference_ortho_plastic.py | goodyttoor/tcl_v7 | ceb545fa3f0e3eaf3a1a43c7e4a2102014b82a47 | [
"MIT"
] | null | null | null | backend/project/app/extension/history/conference_ortho_plastic.py | goodyttoor/tcl_v7 | ceb545fa3f0e3eaf3a1a43c7e4a2102014b82a47 | [
"MIT"
] | null | null | null | backend/project/app/extension/history/conference_ortho_plastic.py | goodyttoor/tcl_v7 | ceb545fa3f0e3eaf3a1a43c7e4a2102014b82a47 | [
"MIT"
] | null | null | null | from datetime import datetime
from typing import Optional
from fastapi import APIRouter, Depends
from sqlmodel import Field, SQLModel
from ...db import get_session
from sqlalchemy import select
from sqlalchemy.ext.asyncio import AsyncSession
router = APIRouter()
@router.post("/history_ortho_conference", respo... | 33.022472 | 145 | 0.787683 | from datetime import datetime
from typing import Optional
from fastapi import APIRouter, Depends
from sqlmodel import Field, SQLModel
from ...db import get_session
from sqlalchemy import select
from sqlalchemy.ext.asyncio import AsyncSession
router = APIRouter()
class HistoryOrthoPlasticConference(SQLModel, tabl... | 1,088 | 924 | 201 |
1ffd5d157dc595c86121033df8bd227467261508 | 23 | py | Python | backend/book/models/__init__.py | Mackrage/worm_rage_bot | 7211c0c89ad12714eccdc98c6a84e7309108aabc | [
"MIT"
] | 216 | 2016-02-20T12:46:43.000Z | 2022-02-23T07:07:00.000Z | models/medium/book/__init__.py | billvsme/tvCrawlers | e19111cc48d0a2a44c5245b0ddc9fad0c7a1824d | [
"MIT"
] | 3 | 2016-05-06T05:04:17.000Z | 2021-12-13T19:41:39.000Z | models/medium/book/__init__.py | billvsme/tvCrawlers | e19111cc48d0a2a44c5245b0ddc9fad0c7a1824d | [
"MIT"
] | 99 | 2016-02-20T08:34:00.000Z | 2022-02-10T20:52:01.000Z | from .book import Book
| 11.5 | 22 | 0.782609 | from .book import Book
| 0 | 0 | 0 |
ddbc6ba2496ec92e3e239527842fdb6ed65fd68b | 2,045 | py | Python | sandbox/numpy/tuto1.py | rboman/progs | c60b4e0487d01ccd007bcba79d1548ebe1685655 | [
"Apache-2.0"
] | 2 | 2021-12-12T13:26:06.000Z | 2022-03-03T16:14:53.000Z | sandbox/numpy/tuto1.py | rboman/progs | c60b4e0487d01ccd007bcba79d1548ebe1685655 | [
"Apache-2.0"
] | 5 | 2019-03-01T07:08:46.000Z | 2019-04-28T07:32:42.000Z | sandbox/numpy/tuto1.py | rboman/progs | c60b4e0487d01ccd007bcba79d1548ebe1685655 | [
"Apache-2.0"
] | 2 | 2017-12-13T13:13:52.000Z | 2019-03-13T20:08:15.000Z | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# from https://docs.scipy.org/doc/numpy-dev/user/quickstart.html
import numpy as np
a = np.arange(15).reshape(3, 5)
print("a=",a)
print("\ta.shape =",a.shape)
print("\ta.ndim =",a.ndim)
print("\ta.dtype.name =",a.dtype.name)
print("\ta.itemsize =",a.itemsize)
print("\t... | 22.977528 | 79 | 0.56577 | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# from https://docs.scipy.org/doc/numpy-dev/user/quickstart.html
import numpy as np
a = np.arange(15).reshape(3, 5)
print("a=",a)
print("\ta.shape =",a.shape)
print("\ta.ndim =",a.ndim)
print("\ta.dtype.name =",a.dtype.name)
print("\ta.itemsize =",a.itemsize)
print("\t... | 0 | 0 | 0 |
81ed5c7ba1b5328f5aab207b78f2890ef13dce3e | 6,990 | py | Python | capreolus/extractor/lce_bertpassage.py | nimasadri11/capreolus | 27b081ec1a37d2af6afa6b61eb1cb7cc4ec9db1c | [
"Apache-2.0"
] | null | null | null | capreolus/extractor/lce_bertpassage.py | nimasadri11/capreolus | 27b081ec1a37d2af6afa6b61eb1cb7cc4ec9db1c | [
"Apache-2.0"
] | null | null | null | capreolus/extractor/lce_bertpassage.py | nimasadri11/capreolus | 27b081ec1a37d2af6afa6b61eb1cb7cc4ec9db1c | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
import numpy as np
from capreolus import get_logger
from capreolus.utils.exceptions import MissingDocError
from . import Extractor
from .bertpassage import BertPassage
logger = get_logger(__name__)
@Extractor.register
| 42.883436 | 125 | 0.636767 | import tensorflow as tf
import numpy as np
from capreolus import get_logger
from capreolus.utils.exceptions import MissingDocError
from . import Extractor
from .bertpassage import BertPassage
logger = get_logger(__name__)
@Extractor.register
class LCEBertPassage(BertPassage):
module_name = "LCEbertpassage"
... | 1,530 | 5,192 | 22 |
58ef35ef583db31c3c7e841852d8f66705d8fd70 | 1,254 | py | Python | Back Tracking/n_queen_problem.py | NirupamDebnath/Geeks-DS-Algo | 8482443d095e8eb879c5d4b9c02ff7d04416e7ff | [
"MIT"
] | null | null | null | Back Tracking/n_queen_problem.py | NirupamDebnath/Geeks-DS-Algo | 8482443d095e8eb879c5d4b9c02ff7d04416e7ff | [
"MIT"
] | null | null | null | Back Tracking/n_queen_problem.py | NirupamDebnath/Geeks-DS-Algo | 8482443d095e8eb879c5d4b9c02ff7d04416e7ff | [
"MIT"
] | null | null | null | import unittest
N = 8
count = 0
if __name__ == "__main__":
# unittest.main()
solveNQ()
print(count)
| 20.225806 | 60 | 0.472887 | import unittest
N = 8
count = 0
def solveNQ():
board = [ [0]*N for i in range(N) ]
solveNQUtil(board, 0)
def printSolution(board):
print(*board, sep="\n", end="\n\n")
def is_safe(board, y, x):
for i in range(0,x):
if board[y][i] == 1:
return False
for j, i in zip(range(... | 978 | 16 | 141 |
99ac7b6284da5aab2d36ae755e15b7ee93c0d6c4 | 52 | py | Python | creevey/util/__init__.py | sugi-chan/creevey | 3e62303cf42c307a12c69b8baca9e5f003f91d38 | [
"BSD-3-Clause"
] | null | null | null | creevey/util/__init__.py | sugi-chan/creevey | 3e62303cf42c307a12c69b8baca9e5f003f91d38 | [
"BSD-3-Clause"
] | null | null | null | creevey/util/__init__.py | sugi-chan/creevey | 3e62303cf42c307a12c69b8baca9e5f003f91d38 | [
"BSD-3-Clause"
] | null | null | null | from creevey.util.util import * # noqa: F401, F403
| 26 | 51 | 0.711538 | from creevey.util.util import * # noqa: F401, F403
| 0 | 0 | 0 |
257474e3c97e6cd463cb70df1ac908c23116a4cb | 396 | py | Python | src/layer.py | rlaishra/Privacy-Aware-Friends-Recommendation | a5757ef0b409bbcdebdb4e43b510a8d4d9070230 | [
"MIT"
] | null | null | null | src/layer.py | rlaishra/Privacy-Aware-Friends-Recommendation | a5757ef0b409bbcdebdb4e43b510a8d4d9070230 | [
"MIT"
] | null | null | null | src/layer.py | rlaishra/Privacy-Aware-Friends-Recommendation | a5757ef0b409bbcdebdb4e43b510a8d4d9070230 | [
"MIT"
] | null | null | null | import csv, networkx
class Layer(object):
"""Class representing a layer in the social network"""
| 22 | 65 | 0.755051 | import csv, networkx
class Layer(object):
"""Class representing a layer in the social network"""
def __init__(self, file_network, file_profile, file_interlayer):
super(Layer, self).__init__()
self.__file_network = file_network
self.__file_profile = file_profile
self.__file_interlayer = file_interlayer
self... | 266 | 0 | 23 |
5be8fdf86c89107dca13b25251e87bfd91e65deb | 1,200 | py | Python | applications/RsvpService/controllers/default.py | amaurirg/Web2Py | 235571cd2273a858cbc8f291731672eadf6b8206 | [
"BSD-3-Clause"
] | null | null | null | applications/RsvpService/controllers/default.py | amaurirg/Web2Py | 235571cd2273a858cbc8f291731672eadf6b8206 | [
"BSD-3-Clause"
] | null | null | null | applications/RsvpService/controllers/default.py | amaurirg/Web2Py | 235571cd2273a858cbc8f291731672eadf6b8206 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
@auth.requires_login()
@auth.requires_login()
@auth.requires_login()
| 30.769231 | 96 | 0.645833 | # -*- coding: utf-8 -*-
@auth.requires_login()
def create_event():
if request.args(0):
event = db.event(request.args(0),created_by=auth.user_id) or redirect(URL('index'))
rows = db(db.rsvp.event==event.id).select()
else: event, rows=None, []
form = SQLFORM(db.event,event,deletable=T... | 969 | 0 | 120 |
bb6e8c524502d0817497bc62554b89cc489eb9a9 | 67 | py | Python | hseolymp/2016-17/demo/mars_quick.py | dluschan/olymp | dfbf4352dbc7f6fd7563e7bd19aff6fd67fb50b7 | [
"MIT"
] | null | null | null | hseolymp/2016-17/demo/mars_quick.py | dluschan/olymp | dfbf4352dbc7f6fd7563e7bd19aff6fd67fb50b7 | [
"MIT"
] | null | null | null | hseolymp/2016-17/demo/mars_quick.py | dluschan/olymp | dfbf4352dbc7f6fd7563e7bd19aff6fd67fb50b7 | [
"MIT"
] | 1 | 2018-09-14T18:50:48.000Z | 2018-09-14T18:50:48.000Z | import math
n = int(input())
print(3 + math.ceil(math.log(n/3, 2))) | 22.333333 | 38 | 0.641791 | import math
n = int(input())
print(3 + math.ceil(math.log(n/3, 2))) | 0 | 0 | 0 |
1e7eb35d3cac083196d56984f2f8b0d28800bdf5 | 3,351 | py | Python | test_goldenberg.py | Milad-Rakhsha/Friction-Contact | 59d17b231c5dd764c741c941e5443141d43ec7e8 | [
"BSD-3-Clause"
] | null | null | null | test_goldenberg.py | Milad-Rakhsha/Friction-Contact | 59d17b231c5dd764c741c941e5443141d43ec7e8 | [
"BSD-3-Clause"
] | null | null | null | test_goldenberg.py | Milad-Rakhsha/Friction-Contact | 59d17b231c5dd764c741c941e5443141d43ec7e8 | [
"BSD-3-Clause"
] | null | null | null | # =============================================================================
# SIMULATION-BASED ENGINEERING LAB (SBEL) - http://sbel.wisc.edu
# University of Wisconsin-Madison
#
# Copyright (c) 2020 SBEL
# All rights reserved.
#
# Use of this source code is governed by a BSD-style license that can be found
# at http... | 30.463636 | 100 | 0.541928 | # =============================================================================
# SIMULATION-BASED ENGINEERING LAB (SBEL) - http://sbel.wisc.edu
# University of Wisconsin-Madison
#
# Copyright (c) 2020 SBEL
# All rights reserved.
#
# Use of this source code is governed by a BSD-style license that can be found
# at http... | 2,543 | 0 | 23 |
c0fb29d139badc8b52eaa4a472c58aca3f4360ae | 5,066 | py | Python | vtam/wrapper/FilterCodonStop.py | RaphaelHebert/vtam | 6cbc7e241f9aa4245f5fd000769b9765333d41c2 | [
"MIT"
] | 1 | 2020-11-26T11:25:02.000Z | 2020-11-26T11:25:02.000Z | vtam/wrapper/FilterCodonStop.py | RaphaelHebert/vtam | 6cbc7e241f9aa4245f5fd000769b9765333d41c2 | [
"MIT"
] | 25 | 2020-11-13T13:45:45.000Z | 2022-03-09T08:38:56.000Z | vtam/wrapper/FilterCodonStop.py | RaphaelHebert/vtam | 6cbc7e241f9aa4245f5fd000769b9765333d41c2 | [
"MIT"
] | 4 | 2021-03-25T18:18:52.000Z | 2022-01-08T10:37:39.000Z | from vtam.utils.RunnerFilterCodonStop import RunnerFilterCodonStop
from vtam.utils.Logger import Logger
from vtam.utils.FileSampleInformation import FileSampleInformation
from vtam.utils.VTAMexception import VTAMexception
from vtam.utils.DataframeVariantReadCountLike import DataframeVariantReadCountLike
from wopmars.mo... | 38.090226 | 98 | 0.589814 | from vtam.utils.RunnerFilterCodonStop import RunnerFilterCodonStop
from vtam.utils.Logger import Logger
from vtam.utils.FileSampleInformation import FileSampleInformation
from vtam.utils.VTAMexception import VTAMexception
from vtam.utils.DataframeVariantReadCountLike import DataframeVariantReadCountLike
from wopmars.mo... | 4,091 | 584 | 23 |
d820b838f82f5bc3ceecf210a2278f2a5fd53128 | 732 | py | Python | steganography/utilities/img_manipulation.py | WarrenDevonshire/Steganography | 7a18b0dae7e689198bc946e0611d28376c0b8e47 | [
"MIT"
] | null | null | null | steganography/utilities/img_manipulation.py | WarrenDevonshire/Steganography | 7a18b0dae7e689198bc946e0611d28376c0b8e47 | [
"MIT"
] | 5 | 2019-10-25T00:14:11.000Z | 2019-10-27T17:03:13.000Z | steganography/utilities/img_manipulation.py | WarrenDevonshire/Steganography | 7a18b0dae7e689198bc946e0611d28376c0b8e47 | [
"MIT"
] | null | null | null | from PIL import Image
import numpy as np
def merge_pixels(pixel1, pixel2):
"""
Merge two R or G or B pixels using 4 least significant bits.
INPUT: A string tuple (e.g. ("00101010")),
Another string tuple (e.g. ("00101010"))
OUTPUT: An integer tuple with the two RGB values merged 00100010
... | 22.181818 | 68 | 0.669399 | from PIL import Image
import numpy as np
def to_array(image):
image_arr = np.array(image)
shape = image_arr.shape
flat_arr = image_arr.ravel()
return flat_arr, shape
def to_image(arr, img_shape):
matrix = np.matrix(arr)
reform_matrix = np.asarray(matrix).reshape(img_shape)
new_img = I... | 288 | 0 | 46 |
8b4ee52221cfc328af1f6c573b272bda5e11d8fd | 3,814 | py | Python | back/classification/utils/data_augmentation.py | zqswjtu/graduation | 62686bf6364d1a4a8c164e27b343aa4c85094174 | [
"MIT"
] | null | null | null | back/classification/utils/data_augmentation.py | zqswjtu/graduation | 62686bf6364d1a4a8c164e27b343aa4c85094174 | [
"MIT"
] | null | null | null | back/classification/utils/data_augmentation.py | zqswjtu/graduation | 62686bf6364d1a4a8c164e27b343aa4c85094174 | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
import cv2
import numpy as np
import os.path
# 椒盐噪声
# 高斯噪声
# 昏暗
# 亮度
# 旋转
# 翻转
if __name__ == "__main__":
# 图片文件夹路径
file_dir = r"../dataset/train/Toothbrush/"
for img_name in os.listdir(file_dir):
img_path = file_dir + img_name
img = cv2.imread(img_path)... | 32.598291 | 99 | 0.60173 | # -*- coding: UTF-8 -*-
import cv2
import numpy as np
import os.path
# 椒盐噪声
def salt_and_pepper_noise(src, percentage):
sp_noise_img = src.copy()
sp_noise_img = int(percentage * src.shape[0] * src.shape[1])
for i in range(sp_noise_img):
rand_r = np.random.randint(0, src.shape[0] - 1)
rand_... | 2,147 | 0 | 132 |
3cd57093dc9b2af2c47455784807f52fc20c847a | 3,813 | py | Python | contentcuration/contentcuration/db/models/query.py | d0sadata/studio | ec3b805c0b546fe8884d446152eead90bea4174d | [
"MIT"
] | 60 | 2018-03-29T23:33:29.000Z | 2022-03-19T12:10:56.000Z | contentcuration/contentcuration/db/models/query.py | d0sadata/studio | ec3b805c0b546fe8884d446152eead90bea4174d | [
"MIT"
] | 2,260 | 2018-03-02T23:14:49.000Z | 2022-03-29T20:57:21.000Z | contentcuration/contentcuration/db/models/query.py | d0sadata/studio | ec3b805c0b546fe8884d446152eead90bea4174d | [
"MIT"
] | 86 | 2018-03-19T21:26:35.000Z | 2022-03-28T10:09:17.000Z | from django.db import connections
from django.db.models.expressions import Col
from django.db.models.sql.compiler import SQLCompiler
from django.db.models.sql.constants import INNER
from django.db.models.sql.query import Query
from django_cte import CTEQuerySet
from django_cte import With as CTEWith
from mptt.querysets... | 34.351351 | 112 | 0.65198 | from django.db import connections
from django.db.models.expressions import Col
from django.db.models.sql.compiler import SQLCompiler
from django.db.models.sql.constants import INNER
from django.db.models.sql.query import Query
from django_cte import CTEQuerySet
from django_cte import With as CTEWith
from mptt.querysets... | 278 | 1,206 | 98 |
d9217c1da5fe4ed5e7f0e300cc8bcc84d9e7e882 | 116 | py | Python | explib/explib/__init__.py | jacqueschen1/adam_sgd_heavy_tails | d4ecab6d460fb44ac3fd2b865641b8e47f3848ee | [
"Apache-2.0"
] | 1 | 2021-12-02T21:47:46.000Z | 2021-12-02T21:47:46.000Z | explib/explib/__init__.py | jacqueschen1/adam_sgd_heavy_tails | d4ecab6d460fb44ac3fd2b865641b8e47f3848ee | [
"Apache-2.0"
] | null | null | null | explib/explib/__init__.py | jacqueschen1/adam_sgd_heavy_tails | d4ecab6d460fb44ac3fd2b865641b8e47f3848ee | [
"Apache-2.0"
] | null | null | null | """ExpLib"""
import json
from . import dataset, expmaker, logging, model, optim
from .experiment import Experiment
| 19.333333 | 54 | 0.758621 | """ExpLib"""
import json
from . import dataset, expmaker, logging, model, optim
from .experiment import Experiment
| 0 | 0 | 0 |
f2267cefd1a1d92d51f71964f56d1f81a3c6bf00 | 373 | py | Python | src/Week1/test3.py | dcavar/Py3L | b11d66174e9b5a9e4c372cdd5fa413a790aeb00c | [
"Apache-2.0"
] | 3 | 2018-01-11T22:14:17.000Z | 2019-06-09T22:02:17.000Z | src/Week1/test3.py | dcavar/Py3L | b11d66174e9b5a9e4c372cdd5fa413a790aeb00c | [
"Apache-2.0"
] | null | null | null | src/Week1/test3.py | dcavar/Py3L | b11d66174e9b5a9e4c372cdd5fa413a790aeb00c | [
"Apache-2.0"
] | 1 | 2019-11-24T10:46:52.000Z | 2019-11-24T10:46:52.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
mytext = "hello world"
print(mytext[1])
print(mytext[2:4])
print( mytext[0: : 2 ] )
print(mytext.center(80))
print("Number of es in mytext:", mytext.count("e") )
print("Number of lds in mytext:", mytext.count("ld") )
print(mytext.endswith("ing"))
print(mytext.capit... | 16.217391 | 54 | 0.662198 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
mytext = "hello world"
print(mytext[1])
print(mytext[2:4])
print( mytext[0: : 2 ] )
print(mytext.center(80))
print("Number of es in mytext:", mytext.count("e") )
print("Number of lds in mytext:", mytext.count("ld") )
print(mytext.endswith("ing"))
print(mytext.capit... | 0 | 0 | 0 |
e64cf71ad87338f1cbb3bb0f53a5f90756a867f9 | 26,963 | py | Python | openpose_plus/utils.py | xrtube/openpose-plus | 221806759c46ded8cad84fb3a70658b8e76db73f | [
"Apache-2.0"
] | 4 | 2020-12-23T14:53:45.000Z | 2021-05-17T05:46:07.000Z | openpose_plus/utils.py | YinXiaojieCSDN/openpose-plus | 5a908eabf31c612099a80288550676db3fc19bbb | [
"Apache-2.0"
] | 5 | 2020-01-28T23:10:48.000Z | 2022-02-10T00:41:40.000Z | openpose_plus/utils.py | YinXiaojieCSDN/openpose-plus | 5a908eabf31c612099a80288550676db3fc19bbb | [
"Apache-2.0"
] | 1 | 2020-02-13T13:31:15.000Z | 2020-02-13T13:31:15.000Z | # -*- coding: utf-8 -*-
## xxx
import math
import os
from distutils.dir_util import mkpath
import cv2
import matplotlib.pyplot as plt
import numpy as np
from scipy.spatial.distance import cdist
import tensorflow as tf
from train_config import config
from pycocotools.coco import COCO, maskUtils
from tensorlayer import... | 35.477632 | 176 | 0.572859 | # -*- coding: utf-8 -*-
## xxx
import math
import os
from distutils.dir_util import mkpath
import cv2
import matplotlib.pyplot as plt
import numpy as np
from scipy.spatial.distance import cdist
import tensorflow as tf
from train_config import config
from pycocotools.coco import COCO, maskUtils
from tensorlayer import... | 2,808 | 0 | 215 |
ff58e4450bdd8b5c7f7f6c3cd7210157a63147af | 2,650 | py | Python | passworsd_locker.py | nyamzy/Password_Locker | 6a2352aac527d2e4efe706992af8b310ca6836ad | [
"Unlicense"
] | null | null | null | passworsd_locker.py | nyamzy/Password_Locker | 6a2352aac527d2e4efe706992af8b310ca6836ad | [
"Unlicense"
] | null | null | null | passworsd_locker.py | nyamzy/Password_Locker | 6a2352aac527d2e4efe706992af8b310ca6836ad | [
"Unlicense"
] | null | null | null | class User:
'''
Class that generates new instances of users
'''
users = [] #Empty list that will store users
def __init__(self, first_name, last_name, username, email, password):
'''
init method helps to define the properties for our user objects
'''
self.first_name ... | 23.451327 | 85 | 0.582264 | class User:
'''
Class that generates new instances of users
'''
users = [] #Empty list that will store users
def __init__(self, first_name, last_name, username, email, password):
'''
init method helps to define the properties for our user objects
'''
self.first_name ... | 0 | 0 | 0 |
83216a086de92a242afcc5b4241eace0c6f254a4 | 446 | py | Python | Solutions/Problem_055.py | PraneethJain/Project-Euler | 54fe34da444803ea55c49e4a4cda3ad6d4bca3b8 | [
"MIT"
] | 2 | 2022-03-11T21:31:52.000Z | 2022-03-11T21:37:14.000Z | Solutions/Problem_055.py | PraneethJain/Project-Euler-100 | 54fe34da444803ea55c49e4a4cda3ad6d4bca3b8 | [
"MIT"
] | null | null | null | Solutions/Problem_055.py | PraneethJain/Project-Euler-100 | 54fe34da444803ea55c49e4a4cda3ad6d4bca3b8 | [
"MIT"
] | 1 | 2022-03-07T12:55:36.000Z | 2022-03-07T12:55:36.000Z | from time import time
t1 = time()
print(len([i for i in range(1, 10001) if Lychrel_Check(i)]))
print(f"Process completed in {time()-t1}s")
| 18.583333 | 60 | 0.55157 | from time import time
def palindrome_check(x: int) -> bool:
return str(x) == str(x)[::-1]
def Lychrel_Check(x):
num = x
i = 0
while i < 50:
num = num + int(str(num)[::-1])
if palindrome_check(num):
return False
i += 1
if i == 50:
return True
return... | 257 | 0 | 46 |
d5eb44adf893bfcb8f341289542301edb9f1004b | 1,886 | py | Python | tests/test_status_scripts.py | dem4ply/chibi_lxc | 159acfacf829d0fd182382323905ee3f699dabe0 | [
"WTFPL"
] | null | null | null | tests/test_status_scripts.py | dem4ply/chibi_lxc | 159acfacf829d0fd182382323905ee3f699dabe0 | [
"WTFPL"
] | null | null | null | tests/test_status_scripts.py | dem4ply/chibi_lxc | 159acfacf829d0fd182382323905ee3f699dabe0 | [
"WTFPL"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from chibi_lxc.container import Container
| 26.56338 | 77 | 0.650053 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from chibi_lxc.container import Container
class Centos_test( Container ):
name = 'centos_7_test'
provision_folders = {
'scripts': 'tests/scripts/'
}
status_scripts = (
'script_test.sh',
)
class Centos_one_test( Centos_... | 872 | 790 | 115 |
ad3144a0ebf2e823a28fe10ffea6b82a3c273d48 | 20,989 | py | Python | model.py | KingAndQueen/MemN2N_tensorflow | 05bb97458c36fd6c6085af6ff93f843c29eb35af | [
"MIT"
] | null | null | null | model.py | KingAndQueen/MemN2N_tensorflow | 05bb97458c36fd6c6085af6ff93f843c29eb35af | [
"MIT"
] | null | null | null | model.py | KingAndQueen/MemN2N_tensorflow | 05bb97458c36fd6c6085af6ff93f843c29eb35af | [
"MIT"
] | null | null | null | import os
import math
import random
import numpy as np
import tensorflow as tf
from sklearn import metrics
# from past.builtins import xrange
import pdb
def zero_nil_slot(t, name=None):
"""
Overwrites the nil_slot (first row) of the input Tensor with zeros.
The nil_slot is a dummy slot and should not be ... | 43.636175 | 134 | 0.535328 | import os
import math
import random
import numpy as np
import tensorflow as tf
from sklearn import metrics
# from past.builtins import xrange
import pdb
def zero_nil_slot(t, name=None):
"""
Overwrites the nil_slot (first row) of the input Tensor with zeros.
The nil_slot is a dummy slot and should not be ... | 19,460 | 0 | 238 |
36e2cce34b1c3a892796b24c86bf6dadce858234 | 1,660 | py | Python | workload/dc_workload/plot/bandwidth_sensitivity.py | vishal1303/simulator | c9429cecd1a058b2ab13cbed5c4cb802557bf315 | [
"BSD-3-Clause"
] | 2 | 2019-03-03T02:50:51.000Z | 2020-01-28T05:34:24.000Z | workload/dc_workload/plot/bandwidth_sensitivity.py | vishal1303/simulator | c9429cecd1a058b2ab13cbed5c4cb802557bf315 | [
"BSD-3-Clause"
] | null | null | null | workload/dc_workload/plot/bandwidth_sensitivity.py | vishal1303/simulator | c9429cecd1a058b2ab13cbed5c4cb802557bf315 | [
"BSD-3-Clause"
] | 1 | 2019-10-15T13:31:15.000Z | 2019-10-15T13:31:15.000Z | import sys
import os
workload = sys.argv[1]
dirname = "workload/dc_workload/all-to-all-144-"+workload
protocol = sys.argv[2]
bandwidth = ['40G', '100G']
delay = ['200ns']
load = [0.5, 0.6, 0.7, 0.8]
slowdown_val = []
for d in delay:
for l in load:
slowdown_val = []
for b in bandwidth:
... | 29.122807 | 99 | 0.475904 | import sys
import os
workload = sys.argv[1]
dirname = "workload/dc_workload/all-to-all-144-"+workload
protocol = sys.argv[2]
bandwidth = ['40G', '100G']
delay = ['200ns']
load = [0.5, 0.6, 0.7, 0.8]
slowdown_val = []
for d in delay:
for l in load:
slowdown_val = []
for b in bandwidth:
... | 0 | 0 | 0 |
0060cf8b7cb6ce13fc658ba97409b30dc81e273e | 30,959 | py | Python | amc/models.py | chamaken/django-amc | f5812c71dfde9ddcc286f14170885902a312e8d9 | [
"BSD-3-Clause"
] | null | null | null | amc/models.py | chamaken/django-amc | f5812c71dfde9ddcc286f14170885902a312e8d9 | [
"BSD-3-Clause"
] | null | null | null | amc/models.py | chamaken/django-amc | f5812c71dfde9ddcc286f14170885902a312e8d9 | [
"BSD-3-Clause"
] | null | null | null | import socket, uuid
from django.db import models, transaction
from django.db.models import fields, signals
from django.dispatch import receiver
from django.utils.encoding import force_text
from django.utils.functional import Promise
from django.utils.translation import ugettext_lazy as _
# based on 2017-11-28
# h... | 34.437152 | 154 | 0.626215 | import socket, uuid
from django.db import models, transaction
from django.db.models import fields, signals
from django.dispatch import receiver
from django.utils.encoding import force_text
from django.utils.functional import Promise
from django.utils.translation import ugettext_lazy as _
class AMCFieldMixin(object):... | 2,390 | 630 | 411 |
633f15c74a9cd7f71da97d6441b0df5d693a2420 | 1,066 | py | Python | tests/test_move_drift_to_zero.py | imodpasteur/Brightfield-Drift-Correction-3D | d01dfa272a4e8326d4ac39a0f58bdd9190998836 | [
"MIT"
] | 5 | 2018-10-16T13:29:06.000Z | 2019-12-17T16:41:57.000Z | tests/test_move_drift_to_zero.py | imodpasteur/Brightfield_Drift_Tracking_3D | d01dfa272a4e8326d4ac39a0f58bdd9190998836 | [
"MIT"
] | 2 | 2018-11-09T16:28:55.000Z | 2019-02-19T15:22:03.000Z | tests/test_move_drift_to_zero.py | imodpasteur/Brightfield_Drift_Tracking_3D | d01dfa272a4e8326d4ac39a0f58bdd9190998836 | [
"MIT"
] | null | null | null | from unittest import TestCase
import numpy as np
from bfdc.drift import move_drift_to_zero
| 32.30303 | 56 | 0.641651 | from unittest import TestCase
import numpy as np
from bfdc.drift import move_drift_to_zero
class TestMove_drift_to_zero(TestCase):
def test_move_drift_to_zero(self):
table = np.ones((20,4))
table[:,0] = np.arange(20)
expected = table.copy()
expected[:,1:] = 0
result = move_d... | 826 | 18 | 130 |
716fe86d34c53ffc1782049d4adcf7949d73b419 | 5,083 | py | Python | tests/test_responsetypes.py | atharwa-24/scrapy | 96b22046e1f68243ca380ece7daa0d65aa501697 | [
"BSD-3-Clause"
] | null | null | null | tests/test_responsetypes.py | atharwa-24/scrapy | 96b22046e1f68243ca380ece7daa0d65aa501697 | [
"BSD-3-Clause"
] | null | null | null | tests/test_responsetypes.py | atharwa-24/scrapy | 96b22046e1f68243ca380ece7daa0d65aa501697 | [
"BSD-3-Clause"
] | null | null | null | import unittest
from scrapy.http import Headers
from scrapy.http import HtmlResponse
from scrapy.http import Response
from scrapy.http import TextResponse
from scrapy.http import XmlResponse
from scrapy.responsetypes import responsetypes
if __name__ == "__main__":
unittest.main()
| 37.375 | 84 | 0.516821 | import unittest
from scrapy.http import Headers
from scrapy.http import HtmlResponse
from scrapy.http import Response
from scrapy.http import TextResponse
from scrapy.http import XmlResponse
from scrapy.responsetypes import responsetypes
class ResponseTypesTest(unittest.TestCase):
def test_from_filename(self):
... | 4,577 | 22 | 211 |
dc73fabe1a81b9eaaa8f45f1ec439f200a87964e | 53,706 | py | Python | aiida_yambo_wannier90/workflows/__init__.py | epfl-theos/aiida-yambo-wannier90 | dabfa402e779e9fc797dda15ec748b0c6c25d647 | [
"MIT"
] | null | null | null | aiida_yambo_wannier90/workflows/__init__.py | epfl-theos/aiida-yambo-wannier90 | dabfa402e779e9fc797dda15ec748b0c6c25d647 | [
"MIT"
] | 2 | 2022-02-21T14:59:22.000Z | 2022-02-21T15:57:49.000Z | aiida_yambo_wannier90/workflows/__init__.py | epfl-theos/aiida-yambo-wannier90 | dabfa402e779e9fc797dda15ec748b0c6c25d647 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Base class for Yambo+Wannier90 workflow."""
from email.charset import QP
import pathlib
import typing as ty
import numpy as np
from aiida import orm
from aiida.common import AttributeDict
from aiida.common.lang import type_check
from aiida.engine import ExitCode, ProcessBuilder, ToContext, Wo... | 37.714888 | 131 | 0.615853 | #!/usr/bin/env python
"""Base class for Yambo+Wannier90 workflow."""
from email.charset import QP
import pathlib
import typing as ty
import numpy as np
from aiida import orm
from aiida.common import AttributeDict
from aiida.common.lang import type_check
from aiida.engine import ExitCode, ProcessBuilder, ToContext, Wo... | 0 | 0 | 0 |
c2388909aeb1b544e29775aad8f649fbd2155007 | 1,413 | py | Python | test/file_length_test.py | CheckiePy/CheckiePyCore | 475ae75c4a30e4d7444fef218ffa7928fd4df4e2 | [
"MIT"
] | 2 | 2017-08-27T15:04:09.000Z | 2017-08-27T21:05:44.000Z | test/file_length_test.py | acsproj/acscore | 475ae75c4a30e4d7444fef218ffa7928fd4df4e2 | [
"MIT"
] | 2 | 2017-07-27T13:51:44.000Z | 2017-08-05T06:54:10.000Z | test/file_length_test.py | CheckiePy/CheckiePyCore | 475ae75c4a30e4d7444fef218ffa7928fd4df4e2 | [
"MIT"
] | 3 | 2017-05-31T21:20:18.000Z | 2017-08-03T20:16:47.000Z | import unittest
from unittest.mock import patch
from unittest.mock import mock_open
from acscore import metrics
| 31.4 | 100 | 0.599434 | import unittest
from unittest.mock import patch
from unittest.mock import mock_open
from acscore import metrics
class FileLengthTest(unittest.TestCase):
def setUp(self):
self.file_length = metrics.FileLength()
self.data = {'5': 10, '35': 5, '100': 4, '105': 6}
def test_count(self):
... | 1,149 | 19 | 130 |
427037851f7b1122a9ab4c11e0ee49024ff39e56 | 850 | py | Python | src/biz/item.py | emarinizquierdo/gae-vue-flask-starter | 0fb504653f9391bccd25cc9df1ec1326f1dae159 | [
"MIT"
] | null | null | null | src/biz/item.py | emarinizquierdo/gae-vue-flask-starter | 0fb504653f9391bccd25cc9df1ec1326f1dae159 | [
"MIT"
] | null | null | null | src/biz/item.py | emarinizquierdo/gae-vue-flask-starter | 0fb504653f9391bccd25cc9df1ec1326f1dae159 | [
"MIT"
] | null | null | null | import logging
from google.appengine.ext import ndb
from flask_restplus import abort
from src.beans.item import Item
import uuid
| 15.454545 | 74 | 0.603529 | import logging
from google.appengine.ext import ndb
from flask_restplus import abort
from src.beans.item import Item
import uuid
def create(args):
if(not args.get('id', False)):
args['id'] = str(uuid.uuid4())
item = Item(
**args
)
item.key = ndb.Key(Item, args['id'])
item.... | 604 | 0 | 115 |
60cd8f0f69befb4da854068b393a74d0e5e25a9d | 2,691 | py | Python | mysql_tracer/args_parser.py | anthonyrichir/py-mysql-tracer | bd6623781d8af3ffc4fb0f7cbd4c7deffc55c8d0 | [
"MIT"
] | 1 | 2020-11-23T14:30:53.000Z | 2020-11-23T14:30:53.000Z | mysql_tracer/args_parser.py | anthonyrichir/py-mysql-tracer | bd6623781d8af3ffc4fb0f7cbd4c7deffc55c8d0 | [
"MIT"
] | 3 | 2019-03-11T08:35:26.000Z | 2021-02-04T16:01:45.000Z | mysql_tracer/args_parser.py | anthonyrichir/py-mysql-tracer | bd6623781d8af3ffc4fb0f7cbd4c7deffc55c8d0 | [
"MIT"
] | 1 | 2020-04-18T19:55:43.000Z | 2020-04-18T19:55:43.000Z | """
CLI script to run MySQL SELECT statements
It produces a copy of provided file with additional metadata and an export of results in CSV format
"""
import argparse
def get_main_args_parser(parents, defaults):
"""
Parser for the arguments required to run mysql_tracer.
:param parents: a list of parent a... | 38.442857 | 120 | 0.680788 | """
CLI script to run MySQL SELECT statements
It produces a copy of provided file with additional metadata and an export of results in CSV format
"""
import argparse
def get_main_args_parser(parents, defaults):
"""
Parser for the arguments required to run mysql_tracer.
:param parents: a list of parent a... | 775 | 0 | 23 |
98ef60af778a5360bdf3cd003a34205063618009 | 614 | py | Python | desafio010.py | marcelocmedeiros/RevisaoPython | 04c602bf17e8ab37c9660337a8f8497eb498e10d | [
"MIT"
] | null | null | null | desafio010.py | marcelocmedeiros/RevisaoPython | 04c602bf17e8ab37c9660337a8f8497eb498e10d | [
"MIT"
] | null | null | null | desafio010.py | marcelocmedeiros/RevisaoPython | 04c602bf17e8ab37c9660337a8f8497eb498e10d | [
"MIT"
] | null | null | null | # Marcelo Campos de Medeiros
# ADS UNIFIP
# REVISÃO DE PYTHON
# AULA 07 GUSTAVO GUANABARA
'''
Faça um programa que leia quanto dinheiro uma pessoa tem e mostre o valor em dolares.
Considerando o dolar U$ 1.00 == R$4.50
'''
print('='*30)
print('{:$^30}'.format(' DOLARES '))
print('='*30)
valor = float(input('Qual ... | 30.7 | 115 | 0.680782 | # Marcelo Campos de Medeiros
# ADS UNIFIP
# REVISÃO DE PYTHON
# AULA 07 GUSTAVO GUANABARA
'''
Faça um programa que leia quanto dinheiro uma pessoa tem e mostre o valor em dolares.
Considerando o dolar U$ 1.00 == R$4.50
'''
print('='*30)
print('{:$^30}'.format(' DOLARES '))
print('='*30)
valor = float(input('Qual ... | 0 | 0 | 0 |
f311daaedf6efa986a65ec10a800fd4a629bcf04 | 2,016 | py | Python | aramPredict/aramRecorder.py | beeedy/LOL | 95ed815593a25e7e86d106ddf20e2ce054709ad1 | [
"MIT"
] | null | null | null | aramPredict/aramRecorder.py | beeedy/LOL | 95ed815593a25e7e86d106ddf20e2ce054709ad1 | [
"MIT"
] | null | null | null | aramPredict/aramRecorder.py | beeedy/LOL | 95ed815593a25e7e86d106ddf20e2ce054709ad1 | [
"MIT"
] | null | null | null | import urllib2
import simplejson
import time
from BeautifulSoup import BeautifulSoup
allGames = []
lastGame = []
try:
with open('aramGames.txt', 'r') as gameFile:
allGames = simplejson.load(gameFile)
lastGame = allGames[-1]
except:
print("Could not find list of previously recorded games, making new file now...... | 29.217391 | 166 | 0.681052 | import urllib2
import simplejson
import time
from BeautifulSoup import BeautifulSoup
allGames = []
lastGame = []
def compare_games(game1, game2):
# returns true if the two game are the same, otherwise false
game1 = [name for teams in game1 for player in teams for name in player]
game2 = [name for teams in game2 fo... | 353 | 0 | 23 |
600010543b450b662f293eb38c61a1d45a1f1435 | 1,691 | py | Python | higher_lower_game/server.py | NozomuYoshida/flask_training | bfad76dbecfdee66063e8d2e556002f0e41cf3e7 | [
"MIT"
] | null | null | null | higher_lower_game/server.py | NozomuYoshida/flask_training | bfad76dbecfdee66063e8d2e556002f0e41cf3e7 | [
"MIT"
] | null | null | null | higher_lower_game/server.py | NozomuYoshida/flask_training | bfad76dbecfdee66063e8d2e556002f0e41cf3e7 | [
"MIT"
] | null | null | null | from flask import Flask
from random import randint
app = Flask(__name__)
@app.route('/')
@make_h1
target_number = randint(1, 10)
@app.route('/<int:input_number>')
# Decorator doesn't work so it's uncommented
# @make_h1
if __name__ == '__main__':
app.run(debug=True)from flask import Flask
from random impo... | 22.25 | 95 | 0.661147 | from flask import Flask
from random import randint
app = Flask(__name__)
def make_h1(fn):
def wrapper(*args):
return '<h1>' + fn() + '</h1>'
wrapper.__name__ = fn.__name__
return wrapper
@app.route('/')
@make_h1
def home():
return 'Guess a number between 0 and 9<br>' \
'<img src=... | 996 | 0 | 134 |
d0c445a81d6ae8b0686f0f1e383ba4a8862e94b4 | 349 | py | Python | tester.py | justinmilner1/Connect4-master | 9cd16b1c23c5a0de07177dd332e53d4574269d28 | [
"MIT"
] | null | null | null | tester.py | justinmilner1/Connect4-master | 9cd16b1c23c5a0de07177dd332e53d4574269d28 | [
"MIT"
] | null | null | null | tester.py | justinmilner1/Connect4-master | 9cd16b1c23c5a0de07177dd332e53d4574269d28 | [
"MIT"
] | null | null | null | import sys
from kaggle_environments import evaluate, make, utils
out = sys.stdout
submission = utils.read_file("/kaggle/working/main.py")
agent = utils.get_last_callable(submission)
sys.stdout = out
env = make("connectx", debug=True)
env.run([agent, agent])
print("Success!" if env.state[0].status == env.state[1].statu... | 34.9 | 90 | 0.73639 | import sys
from kaggle_environments import evaluate, make, utils
out = sys.stdout
submission = utils.read_file("/kaggle/working/main.py")
agent = utils.get_last_callable(submission)
sys.stdout = out
env = make("connectx", debug=True)
env.run([agent, agent])
print("Success!" if env.state[0].status == env.state[1].statu... | 0 | 0 | 0 |
7c1a85ac0c22e9d1447e5461c289ad2158878198 | 2,988 | py | Python | lockheed_141310/routes/auth.py | Dr-N0/MASA-141310 | a0eed9f97c730ebe8c3e3455fa501b2fc72cf101 | [
"MIT"
] | null | null | null | lockheed_141310/routes/auth.py | Dr-N0/MASA-141310 | a0eed9f97c730ebe8c3e3455fa501b2fc72cf101 | [
"MIT"
] | null | null | null | lockheed_141310/routes/auth.py | Dr-N0/MASA-141310 | a0eed9f97c730ebe8c3e3455fa501b2fc72cf101 | [
"MIT"
] | null | null | null | from flask import Blueprint, request, jsonify
from flask_jwt_extended import create_access_token, create_refresh_token, set_access_cookies, set_refresh_cookies, \
jwt_required, jwt_refresh_token_required, get_jwt_identity, get_raw_jwt
from flask_cors import cross_origin
from lockheed_141310 import blacklist
from l... | 33.954545 | 117 | 0.683066 | from flask import Blueprint, request, jsonify
from flask_jwt_extended import create_access_token, create_refresh_token, set_access_cookies, set_refresh_cookies, \
jwt_required, jwt_refresh_token_required, get_jwt_identity, get_raw_jwt
from flask_cors import cross_origin
from lockheed_141310 import blacklist
from l... | 52 | 0 | 22 |
585a08a14e6d487f754e1a15bfaed5ccfa344e19 | 185 | py | Python | djaveLogin/superuser_required.py | dasmith2/djaveLogin | 22841cf79eed2b866b69dca7cfd148575c74abc3 | [
"MIT"
] | null | null | null | djaveLogin/superuser_required.py | dasmith2/djaveLogin | 22841cf79eed2b866b69dca7cfd148575c74abc3 | [
"MIT"
] | null | null | null | djaveLogin/superuser_required.py | dasmith2/djaveLogin | 22841cf79eed2b866b69dca7cfd148575c74abc3 | [
"MIT"
] | null | null | null | from djaveLogin.base_login_decorator import base_login_decorator
| 26.428571 | 64 | 0.843243 | from djaveLogin.base_login_decorator import base_login_decorator
class superuser_required(base_login_decorator):
def is_allowed(self, request):
return request.user.is_superuser
| 46 | 26 | 47 |
ff5eba1c8bf80a95e3804ac827016ae303fac31a | 1,000 | py | Python | hypixelio/models/recent_games/recent_games.py | FoxNerdSaysMoo/HypixelIO | aca8fd6535c0afb2bb733172db2dcbd68590118d | [
"MIT"
] | 16 | 2020-10-28T01:49:31.000Z | 2022-03-13T23:19:31.000Z | hypixelio/models/recent_games/recent_games.py | FoxNerdSaysMoo/HypixelIO | aca8fd6535c0afb2bb733172db2dcbd68590118d | [
"MIT"
] | 20 | 2021-03-17T07:32:14.000Z | 2022-03-07T02:48:00.000Z | hypixelio/models/recent_games/recent_games.py | FoxNerdSaysMoo/HypixelIO | aca8fd6535c0afb2bb733172db2dcbd68590118d | [
"MIT"
] | 5 | 2020-10-21T13:53:27.000Z | 2021-09-02T15:47:45.000Z | import typing as t
from .recent_game_info import RecentGameInfo
| 25 | 69 | 0.592 | import typing as t
from .recent_game_info import RecentGameInfo
class RecentGames:
def __init__(self, data: dict) -> None:
"""
Parameters
----------
data: dict
The JSON data received from the Hypixel API.
"""
self.UUID = data["uuid"]
self.GAMES ... | 413 | 498 | 23 |
d2afdcdf348b346003031b19b7ad92ffebb3c6bd | 3,785 | py | Python | io_scene_halo/file_qua/import_qua.py | AerialDave144/Halo-Asset-Blender-Development-Toolset | f1b0c0b22806ebabaf0126ad864896193c02307f | [
"MIT"
] | 36 | 2020-11-29T04:36:19.000Z | 2022-03-16T22:54:45.000Z | io_scene_halo/file_qua/import_qua.py | AerialDave144/Halo-Asset-Blender-Development-Toolset | f1b0c0b22806ebabaf0126ad864896193c02307f | [
"MIT"
] | 18 | 2020-05-24T07:07:55.000Z | 2020-08-24T20:34:14.000Z | io_scene_halo/file_qua/import_qua.py | AerialDave144/Halo-Asset-Blender-Development-Toolset | f1b0c0b22806ebabaf0126ad864896193c02307f | [
"MIT"
] | 15 | 2020-12-02T13:28:52.000Z | 2022-03-12T00:14:10.000Z | # ##### BEGIN MIT LICENSE BLOCK #####
#
# MIT License
#
# Copyright (c) 2021 Steven Garcia
#
# 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, including without limitation ... | 33.495575 | 144 | 0.632232 | # ##### BEGIN MIT LICENSE BLOCK #####
#
# MIT License
#
# Copyright (c) 2021 Steven Garcia
#
# 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, including without limitation ... | 1,980 | 453 | 46 |
c2cb8e361edb618da72b97d79636d8f17f5e347a | 1,879 | py | Python | game.py | Laterus/Onzozo | d0e7cf61f2bffff808a1c6c6b27ec8f2b1733372 | [
"Apache-2.0"
] | null | null | null | game.py | Laterus/Onzozo | d0e7cf61f2bffff808a1c6c6b27ec8f2b1733372 | [
"Apache-2.0"
] | null | null | null | game.py | Laterus/Onzozo | d0e7cf61f2bffff808a1c6c6b27ec8f2b1733372 | [
"Apache-2.0"
] | null | null | null | #!/usr/local/bin/python3
import discord
import asyncio
import core.battle_lobby as battle_lobby
from core.common import SERVSET
CLIENT = discord.Client()
@CLIENT.event
@CLIENT.event
if __name__ == '__main__':
main()
| 28.044776 | 63 | 0.588079 | #!/usr/local/bin/python3
import discord
import asyncio
import core.battle_lobby as battle_lobby
from core.common import SERVSET
CLIENT = discord.Client()
@CLIENT.event
async def on_ready():
print ('Logged in as '+CLIENT.user.name)
await setup_battle_lobby()
@CLIENT.event
async def on_reaction_add(reaction, ... | 1,564 | 0 | 90 |
4a627767e3c0444e52809ca3ac8b06284df2c7e6 | 7,989 | py | Python | setting - backup.py | robintptsai/ms101robin | 8b090d2e4795d8a7ac8bb6011b0704c40cb8af86 | [
"MIT"
] | null | null | null | setting - backup.py | robintptsai/ms101robin | 8b090d2e4795d8a7ac8bb6011b0704c40cb8af86 | [
"MIT"
] | null | null | null | setting - backup.py | robintptsai/ms101robin | 8b090d2e4795d8a7ac8bb6011b0704c40cb8af86 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from datetime import timedelta
from os import environ
import re
from urllib import quote
DOODLE_VERSION = '1.4' # current Doodle version
CHECK_NEW_VERSION = True # whether check the latest version
THREAD_SAFE = environ.get('APPENGINE_RUNTIME') == 'python27' # whether enable thread safe mode,... | 61.930233 | 269 | 0.758042 | # -*- coding: utf-8 -*-
from datetime import timedelta
from os import environ
import re
from urllib import quote
DOODLE_VERSION = '1.4' # current Doodle version
CHECK_NEW_VERSION = True # whether check the latest version
THREAD_SAFE = environ.get('APPENGINE_RUNTIME') == 'python27' # whether enable thread safe mode,... | 0 | 0 | 0 |
1b87dddeb5d3419f3ab313b67e06d648d48d1b1c | 84 | py | Python | config.py | mathur/mushroom_classifier | acc8f5d01b131603f85a0e5ffc8e72a6e686442c | [
"Apache-2.0"
] | 7 | 2016-04-26T21:15:35.000Z | 2019-11-16T22:23:02.000Z | config.py | mathur/mushroom_classifier | acc8f5d01b131603f85a0e5ffc8e72a6e686442c | [
"Apache-2.0"
] | null | null | null | config.py | mathur/mushroom_classifier | acc8f5d01b131603f85a0e5ffc8e72a6e686442c | [
"Apache-2.0"
] | 1 | 2019-01-14T10:41:30.000Z | 2019-01-14T10:41:30.000Z | LEARNING_RATE = 0.2
NUM_TRAINING_ITERATIONS = 50000
CONVERGENCE_THRESHOLD = 0.000001 | 28 | 32 | 0.845238 | LEARNING_RATE = 0.2
NUM_TRAINING_ITERATIONS = 50000
CONVERGENCE_THRESHOLD = 0.000001 | 0 | 0 | 0 |
76e2cf3e2e3f13da61d00dd1332f195aba94446e | 157 | py | Python | py-env/bin/django-admin.py | ipmLessing/dj-cms | ed061e4c33a99f6505d19ce2e0cd54363aa62b0b | [
"MIT"
] | null | null | null | py-env/bin/django-admin.py | ipmLessing/dj-cms | ed061e4c33a99f6505d19ce2e0cd54363aa62b0b | [
"MIT"
] | 5 | 2020-06-06T01:00:13.000Z | 2021-06-09T18:49:18.000Z | py-env/bin/django-admin.py | ipmLessing/dj-cms | ed061e4c33a99f6505d19ce2e0cd54363aa62b0b | [
"MIT"
] | null | null | null | #!/home/kasengchou/git/dj-cms/py-env/bin/python3.6
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| 26.166667 | 50 | 0.770701 | #!/home/kasengchou/git/dj-cms/py-env/bin/python3.6
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| 0 | 0 | 0 |
f77e17739df7045ad055482aa2a1ef729e47ec68 | 10,639 | py | Python | beamlines/nanomax/macro_attenuate.py | Lexelius/contrast | 175a289e33775bc5b7a6a2a65c6b13761c618272 | [
"MIT"
] | 3 | 2021-05-20T07:49:53.000Z | 2021-07-12T11:27:39.000Z | beamlines/nanomax/macro_attenuate.py | alexbjorling/contrast | ef7d6d8c51fb922e89c1c46db734e3c09f88a9fc | [
"MIT"
] | 1 | 2021-04-20T10:09:17.000Z | 2021-04-20T10:09:17.000Z | beamlines/nanomax/macro_attenuate.py | alexbjorling/contrast | ef7d6d8c51fb922e89c1c46db734e3c09f88a9fc | [
"MIT"
] | 2 | 2021-08-03T15:13:06.000Z | 2021-09-02T09:47:37.000Z | """
Module providing a macro to automatically absorb X percent of the
beam using the absorbers at the NanoMAX beamline
"""
import os
import numpy as np
from contrast.environment import env, macro, register_shortcut, runCommand
# ToDo
# - avoid elements with absorption edges close to the current energy
# ... | 43.96281 | 125 | 0.51565 | """
Module providing a macro to automatically absorb X percent of the
beam using the absorbers at the NanoMAX beamline
"""
import os
import numpy as np
from contrast.environment import env, macro, register_shortcut, runCommand
# ToDo
# - avoid elements with absorption edges close to the current energy
# ... | 7,529 | 0 | 324 |
3db73e8c7ab851e3debd47b47d9e8e2c7205a5e1 | 1,004,576 | py | Python | models_SHOT_convex/watercontamination0303r.py | grossmann-group/pyomo-MINLP-benchmarking | 714f0a0dffd61675649a805683c0627af6b4929e | [
"MIT"
] | null | null | null | models_SHOT_convex/watercontamination0303r.py | grossmann-group/pyomo-MINLP-benchmarking | 714f0a0dffd61675649a805683c0627af6b4929e | [
"MIT"
] | null | null | null | models_SHOT_convex/watercontamination0303r.py | grossmann-group/pyomo-MINLP-benchmarking | 714f0a0dffd61675649a805683c0627af6b4929e | [
"MIT"
] | null | null | null | # MINLP written by GAMS Convert at 01/15/21 11:37:41
#
# Equation counts
# Total E G L N X C B
# 557 187 0 370 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc ... | 105.644758 | 120 | 0.517286 | # MINLP written by GAMS Convert at 01/15/21 11:37:41
#
# Equation counts
# Total E G L N X C B
# 557 187 0 370 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc ... | 0 | 0 | 0 |
cde6ac42dd903016ad321671e739158b049c791e | 6,824 | py | Python | instantdl/evaluation/Utils_data_evaluation.py | aliechoes/InstantDL | ce88ff7971c7cd49b4279960cd820b72474daa42 | [
"MIT"
] | 37 | 2020-05-23T16:46:38.000Z | 2022-03-14T12:27:38.000Z | instantdl/evaluation/Utils_data_evaluation.py | ruolinsss/InstantDL | c8c9cce96baafb1bafc3fb021ab37418785c6d8f | [
"MIT"
] | 18 | 2020-06-17T13:34:33.000Z | 2022-02-09T23:47:32.000Z | instantdl/evaluation/Utils_data_evaluation.py | ruolinsss/InstantDL | c8c9cce96baafb1bafc3fb021ab37418785c6d8f | [
"MIT"
] | 6 | 2020-06-17T14:00:54.000Z | 2021-07-27T06:27:08.000Z | """
InstantDL
Utils for data evaluation
Written by Dominik Waibel
"""
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams["font.family"] = "Computer Modern Roman"
from skimage import io
from skimage.io import imread
from skimage.color import gray2rgb, rgb2gray
from skimage.transform import resize
import os... | 41.865031 | 140 | 0.724795 | """
InstantDL
Utils for data evaluation
Written by Dominik Waibel
"""
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams["font.family"] = "Computer Modern Roman"
from skimage import io
from skimage.io import imread
from skimage.color import gray2rgb, rgb2gray
from skimage.transform import resize
import os... | 0 | 0 | 0 |
db7016b7502cf910b5e7181eaba57cbebf2abc58 | 3,908 | py | Python | openmdao.main/src/openmdao/main/test/test_exprmapper.py | MrShoks/OpenMDAO-Framework | 412f34ffe31a95631fbe55ca7d75b84669ae8f8c | [
"Apache-2.0"
] | 1 | 2020-06-28T20:38:56.000Z | 2020-06-28T20:38:56.000Z | openmdao.main/src/openmdao/main/test/test_exprmapper.py | MrShoks/OpenMDAO-Framework | 412f34ffe31a95631fbe55ca7d75b84669ae8f8c | [
"Apache-2.0"
] | null | null | null | openmdao.main/src/openmdao/main/test/test_exprmapper.py | MrShoks/OpenMDAO-Framework | 412f34ffe31a95631fbe55ca7d75b84669ae8f8c | [
"Apache-2.0"
] | null | null | null | import unittest
from openmdao.main.assembly import ExprMapper, Assembly, set_as_top
from openmdao.main.component import Component
from openmdao.main.datatypes.int import Int
from openmdao.main.expreval import ExprEvaluator
nodes = ['A', 'B', 'C', 'D']
if __name__ == "__main__":
unittest.main()
| 31.772358 | 107 | 0.523797 | import unittest
from openmdao.main.assembly import ExprMapper, Assembly, set_as_top
from openmdao.main.component import Component
from openmdao.main.datatypes.int import Int
from openmdao.main.expreval import ExprEvaluator
nodes = ['A', 'B', 'C', 'D']
class Simple(Component):
a = Int(iotype='in')
b = Int(i... | 3,189 | 183 | 231 |
22a11db03a101448d5407d23793a178572bfb3b7 | 885 | py | Python | SoftLayer/CLI/sshkey/list.py | dvzrv/softlayer-python | 9a5f6c6981bcc370084537b4d1769383499ce90d | [
"MIT"
] | 126 | 2015-01-05T05:09:22.000Z | 2021-07-02T00:16:35.000Z | SoftLayer/CLI/sshkey/list.py | dvzrv/softlayer-python | 9a5f6c6981bcc370084537b4d1769383499ce90d | [
"MIT"
] | 969 | 2015-01-05T15:55:31.000Z | 2022-03-31T19:55:20.000Z | SoftLayer/CLI/sshkey/list.py | dvzrv/softlayer-python | 9a5f6c6981bcc370084537b4d1769383499ce90d | [
"MIT"
] | 176 | 2015-01-22T11:23:40.000Z | 2022-02-11T13:16:58.000Z | """List SSH keys."""
# :license: MIT, see LICENSE for more details.
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import formatting
@click.command()
@click.option('--sortby',
help='Column to sort by',
type=click.Choice(['id',
... | 25.285714 | 69 | 0.515254 | """List SSH keys."""
# :license: MIT, see LICENSE for more details.
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import formatting
@click.command()
@click.option('--sortby',
help='Column to sort by',
type=click.Choice(['id',
... | 0 | 0 | 0 |
5f511edbc1c5ee755c4dc2d1720e1d22c5f8a152 | 503 | py | Python | core/crypter.py | DtxdF/reverse-shell-sdc | d03554561166067407331a4c728a975df03c9614 | [
"MIT"
] | 1 | 2019-01-26T20:02:00.000Z | 2019-01-26T20:02:00.000Z | crypter.py | DtxdF/sdc | c1ca8b7be6de42b1e5197f98414db05fd2657f1e | [
"MIT"
] | null | null | null | crypter.py | DtxdF/sdc | c1ca8b7be6de42b1e5197f98414db05fd2657f1e | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
from Crypto.Cipher import AES
from Crypto import Random
iv = Random.new().read(AES.block_size)
| 29.588235 | 57 | 0.725646 | # -*- coding: UTF-8 -*-
from Crypto.Cipher import AES
from Crypto import Random
iv = Random.new().read(AES.block_size)
def encrypt(text, key, inicialization_vector=iv):
ces = AES.new(key, AES.MODE_CFB, inicialization_vector)
cipher_end = inicialization_vector + ces.encrypt(text)
return cipher_end.en... | 327 | 0 | 50 |
eb8bf5b97c0067c20c0d042bcf77ff6052931c07 | 11,588 | py | Python | fastreid/utils/get_st_matrix.py | weleen/MGH.pytorch | 69f2830f6bd60fe3b33c80c04540c0c800d26de1 | [
"Apache-2.0"
] | 4 | 2021-10-06T15:57:29.000Z | 2021-12-21T12:46:19.000Z | fastreid/utils/get_st_matrix.py | weleen/MGH.pytorch | 69f2830f6bd60fe3b33c80c04540c0c800d26de1 | [
"Apache-2.0"
] | 1 | 2022-02-14T06:36:19.000Z | 2022-02-24T08:18:39.000Z | fastreid/utils/get_st_matrix.py | weleen/MGH.pytorch | 69f2830f6bd60fe3b33c80c04540c0c800d26de1 | [
"Apache-2.0"
] | null | null | null | import glob
import math
import os
import numpy as np
if __name__ == "__main__":
data_dir = "/data/wuyiming/reid/msmt/MSMT17_V1/train/"
imgs_path = glob.glob(os.path.join(data_dir, '*', '*.jpg'))
matrix = get_st_matrix(imgs_path, pseudo_labels=None)
| 37.993443 | 179 | 0.569382 | import glob
import math
import os
import numpy as np
def joint_similarity(q_cam, q_frame, g_cam, g_frame, distribution, score=None):
gamma = 5
interval = 100
score_st = np.zeros((len(q_cam), len(g_cam)))
for i in range(len(q_cam)):
for j in range(len(g_cam)):
if q_frame[i] > g_fra... | 11,115 | 0 | 207 |
82b5b7b8f5f9224c7b5fcaf67ab14cb67482b2bc | 5,787 | py | Python | python/Lib/site-packages/tensorflow/contrib/nccl/ops/gen_nccl_ops.py | LiquidInkCo/ImageClassifier | c0d471a55a70b3118178488db3c005a9277baade | [
"Apache-2.0"
] | 1 | 2018-01-20T15:08:00.000Z | 2018-01-20T15:08:00.000Z | python/Lib/site-packages/tensorflow/contrib/nccl/ops/gen_nccl_ops.py | LiquidInkCo/ImageClassifier | c0d471a55a70b3118178488db3c005a9277baade | [
"Apache-2.0"
] | null | null | null | python/Lib/site-packages/tensorflow/contrib/nccl/ops/gen_nccl_ops.py | LiquidInkCo/ImageClassifier | c0d471a55a70b3118178488db3c005a9277baade | [
"Apache-2.0"
] | null | null | null | """Python wrappers around TensorFlow ops.
This file is MACHINE GENERATED! Do not edit.
"""
import collections as _collections
from google.protobuf import text_format as _text_format
from tensorflow.core.framework import op_def_pb2 as _op_def_pb2
# Needed to trigger the call to _set_call_cpp_shape_fn.
from tensorfl... | 26.18552 | 98 | 0.658027 | """Python wrappers around TensorFlow ops.
This file is MACHINE GENERATED! Do not edit.
"""
import collections as _collections
from google.protobuf import text_format as _text_format
from tensorflow.core.framework import op_def_pb2 as _op_def_pb2
# Needed to trigger the call to _set_call_cpp_shape_fn.
from tensorfl... | 244 | 0 | 23 |
91cfa64f5eaebcc6371e8bfbd6095f967a21bd64 | 52 | py | Python | python/testData/resolve/TypeUndeclaredClassAttr.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/resolve/TypeUndeclaredClassAttr.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/resolve/TypeUndeclaredClassAttr.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z |
print(A.my_attr)
# <ref> | 8.666667 | 16 | 0.5 | class A:
pass
print(A.my_attr)
# <ref> | 0 | -4 | 22 |
9e78a464d85758a6410cf9ef2916db721432642c | 4,860 | py | Python | radar_label_convert_kitti_format.py | wzan0001/Astyx-radar-dataset-convert-to-kitti-format | f0e6bf04fc9cd7b49c96f09803598a2c8561bf5a | [
"MIT"
] | 12 | 2019-11-04T08:56:41.000Z | 2022-03-29T05:47:14.000Z | radar_label_convert_kitti_format.py | paland3/Astyx-radar-dataset-convert-to-kitti-format | f0e6bf04fc9cd7b49c96f09803598a2c8561bf5a | [
"MIT"
] | 3 | 2019-12-04T18:19:06.000Z | 2020-10-08T12:34:21.000Z | radar_label_convert_kitti_format.py | paland3/Astyx-radar-dataset-convert-to-kitti-format | f0e6bf04fc9cd7b49c96f09803598a2c8561bf5a | [
"MIT"
] | 3 | 2019-12-04T18:06:37.000Z | 2020-10-01T09:25:10.000Z | #####################################################
##将radar 数据转为kitti格式 ##
#####################################################
import json
import math
import os
import numpy as np
import utils
| 37.384615 | 122 | 0.480864 | #####################################################
##将radar 数据转为kitti格式 ##
#####################################################
import json
import math
import os
import numpy as np
import utils
def rotMat2quatern(R):
# transform the rotation matrix into quatern
q = np.zeros... | 4,519 | 0 | 115 |
130d8cea94163011e3019f8d2e8e7db66b3df129 | 2,522 | py | Python | python/sparknlp/__init__.py | rohannng/spark-nlp | ea1b78a54223c2c94b506312367f0ac678c26228 | [
"Apache-2.0"
] | 1 | 2020-04-09T03:35:27.000Z | 2020-04-09T03:35:27.000Z | python/sparknlp/__init__.py | rohannng/spark-nlp | ea1b78a54223c2c94b506312367f0ac678c26228 | [
"Apache-2.0"
] | 2 | 2020-02-26T00:51:15.000Z | 2021-09-27T22:38:55.000Z | python/sparknlp/__init__.py | rohannng/spark-nlp | ea1b78a54223c2c94b506312367f0ac678c26228 | [
"Apache-2.0"
] | null | null | null | import sys
from pyspark.sql import SparkSession
from sparknlp import annotator
from sparknlp.base import DocumentAssembler, Finisher, TokenAssembler, Chunk2Doc, Doc2Chunk
sys.modules['com.johnsnowlabs.nlp.annotators'] = annotator
sys.modules['com.johnsnowlabs.nlp.annotators.tokenizer'] = annotator
sys.modules['com.joh... | 46.703704 | 182 | 0.758128 | import sys
from pyspark.sql import SparkSession
from sparknlp import annotator
from sparknlp.base import DocumentAssembler, Finisher, TokenAssembler, Chunk2Doc, Doc2Chunk
sys.modules['com.johnsnowlabs.nlp.annotators'] = annotator
sys.modules['com.johnsnowlabs.nlp.annotators.tokenizer'] = annotator
sys.modules['com.joh... | 683 | 0 | 46 |
6b12d7c010c6f962cecef9162c031dc86f92b8cb | 1,567 | py | Python | cigale_all.py | wisemanp/DESSNHosts | 882c0b81b5164fe16c234366e52e99c167e948a8 | [
"MIT"
] | null | null | null | cigale_all.py | wisemanp/DESSNHosts | 882c0b81b5164fe16c234366e52e99c167e948a8 | [
"MIT"
] | null | null | null | cigale_all.py | wisemanp/DESSNHosts | 882c0b81b5164fe16c234366e52e99c167e948a8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
import subprocess
import glob
import matplotlib.pyplot as plt
import seaborn as sns
import logging
import os
import argparse
import astropy.io.fits as fits
from astropy.coordinates import SkyCoord
from astropy.table import Table
from astropy import units a... | 35.613636 | 104 | 0.708998 | # -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
import subprocess
import glob
import matplotlib.pyplot as plt
import seaborn as sns
import logging
import os
import argparse
import astropy.io.fits as fits
from astropy.coordinates import SkyCoord
from astropy.table import Table
from astropy import units a... | 1,014 | 0 | 46 |
4de3db5fce1fe180f827eb981705a978e547069e | 1,705 | py | Python | tests/stix_translation/test_maas360_stix_to_query.py | rkchaudhary/stix-shifter | 96985773382e8bd1730df84c4089e620b4eb3939 | [
"Apache-2.0"
] | null | null | null | tests/stix_translation/test_maas360_stix_to_query.py | rkchaudhary/stix-shifter | 96985773382e8bd1730df84c4089e620b4eb3939 | [
"Apache-2.0"
] | null | null | null | tests/stix_translation/test_maas360_stix_to_query.py | rkchaudhary/stix-shifter | 96985773382e8bd1730df84c4089e620b4eb3939 | [
"Apache-2.0"
] | null | null | null | from stix_shifter.stix_translation import stix_translation
import unittest
translation = stix_translation.StixTranslation()
class TestStixToQuery(unittest.TestCase):
"""
class to perform unit test case guardium translate query
"""
def _test_query_assertions(self, query, queries):
"""
... | 46.081081 | 193 | 0.677419 | from stix_shifter.stix_translation import stix_translation
import unittest
translation = stix_translation.StixTranslation()
class TestStixToQuery(unittest.TestCase):
"""
class to perform unit test case guardium translate query
"""
def _test_query_assertions(self, query, queries):
"""
... | 882 | 0 | 81 |
77dfe6ceccd70bce06d70a820cbf8fa3dec8473f | 2,185 | py | Python | subcircuit/devices/isense.py | joehood/SubCircuit | 0097735f71b19a4d3f95696d3af0a3df4a620e25 | [
"Apache-2.0"
] | 6 | 2016-03-29T02:04:05.000Z | 2021-11-09T00:26:20.000Z | subcircuit/devices/isense.py | joehood/SubCircuit | 0097735f71b19a4d3f95696d3af0a3df4a620e25 | [
"Apache-2.0"
] | null | null | null | subcircuit/devices/isense.py | joehood/SubCircuit | 0097735f71b19a4d3f95696d3af0a3df4a620e25 | [
"Apache-2.0"
] | null | null | null | """Current Scope Device.
Copyright 2014 Joe Hood
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 w... | 29.133333 | 72 | 0.637986 | """Current Scope Device.
Copyright 2014 Joe Hood
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 w... | 818 | 37 | 185 |
f4084514a406d6266af2d042d121afe74ab07c77 | 594 | py | Python | plugins/Cowsay/__init__.py | ecumene/Automata | f34a329d161111ee42caaf5fd2bca8d3a202ed39 | [
"MIT"
] | 11 | 2019-07-11T12:53:45.000Z | 2022-01-19T21:11:38.000Z | plugins/Cowsay/__init__.py | ecumene/Automata | f34a329d161111ee42caaf5fd2bca8d3a202ed39 | [
"MIT"
] | 36 | 2019-10-03T18:48:15.000Z | 2022-02-01T16:01:07.000Z | plugins/Cowsay/__init__.py | ecumene/Automata | f34a329d161111ee42caaf5fd2bca8d3a202ed39 | [
"MIT"
] | 21 | 2019-12-09T03:42:34.000Z | 2022-01-30T22:48:58.000Z | import urllib.parse
from nextcord.ext import commands
import nextcord
import httpx
from Plugin import AutomataPlugin
COWSAY_API = "https://cowsay.morecode.org/say"
class Cowsay(AutomataPlugin):
"""
Cowsay
Made using https://cowsay.morecode.org/
"""
@commands.command()
async def cowsay(self... | 22.846154 | 87 | 0.6633 | import urllib.parse
from nextcord.ext import commands
import nextcord
import httpx
from Plugin import AutomataPlugin
COWSAY_API = "https://cowsay.morecode.org/say"
class Cowsay(AutomataPlugin):
"""
Cowsay
Made using https://cowsay.morecode.org/
"""
@commands.command()
async def cowsay(self... | 0 | 0 | 0 |
35b767e2a5ac0d888b05fcff65cdefe560265a12 | 33,847 | py | Python | garch.py | Brigittecasro1/armagarch | dc9967363b9eeba0510540a34e1d5e987542334a | [
"MIT"
] | null | null | null | garch.py | Brigittecasro1/armagarch | dc9967363b9eeba0510540a34e1d5e987542334a | [
"MIT"
] | null | null | null | garch.py | Brigittecasro1/armagarch | dc9967363b9eeba0510540a34e1d5e987542334a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Mar 2 20:08:14 2018
@author: Ian
"""
from basicFun import hessian_2sided
from basicFun import getLag
import numpy as np
import scipy
import shutil
import datetime
from scipy.optimize import brute
from scipy.special import gamma
from statsmodels.tsa.arima_mode... | 36.87037 | 104 | 0.429344 | # -*- coding: utf-8 -*-
"""
Created on Fri Mar 2 20:08:14 2018
@author: Ian
"""
from basicFun import hessian_2sided
from basicFun import getLag
import numpy as np
import scipy
import shutil
import datetime
from scipy.optimize import brute
from scipy.special import gamma
from statsmodels.tsa.arima_mode... | 26,134 | 7,355 | 24 |
7263ff6f028f606b22e4e4cb3a16f0f68dc018bf | 2,465 | py | Python | objconf/config.py | milosta/objconf | 7d8ffbe0cd89cc1330b6228d3a59c0d7fe41a648 | [
"Apache-2.0"
] | 3 | 2021-08-28T08:06:39.000Z | 2021-10-01T18:05:05.000Z | objconf/config.py | milosta/objconf | 7d8ffbe0cd89cc1330b6228d3a59c0d7fe41a648 | [
"Apache-2.0"
] | null | null | null | objconf/config.py | milosta/objconf | 7d8ffbe0cd89cc1330b6228d3a59c0d7fe41a648 | [
"Apache-2.0"
] | null | null | null | import configparser
import inspect
import json
import warnings
from enum import Enum, auto
from typing import Dict, Set, TextIO, Any, Optional, Iterable
import yaml
from objconf import attributes
class Config:
"""
`Config` is a base class for your configuration class.
Inherit from Config when defining ... | 32.866667 | 100 | 0.637728 | import configparser
import inspect
import json
import warnings
from enum import Enum, auto
from typing import Dict, Set, TextIO, Any, Optional, Iterable
import yaml
from objconf import attributes
class ExtraVals(Enum):
IGNORE = auto()
WARNING = auto()
ERROR = auto()
class Config:
"""
`Config` ... | 1,797 | 61 | 153 |
606368de9fea1a94e44707b87c87a602d81fa160 | 7,358 | py | Python | src/ralph/data_center/tests/factories.py | DoNnMyTh/ralph | 97b91639fa68965ad3fd9d0d2652a6545a2a5b72 | [
"Apache-2.0"
] | 1,668 | 2015-01-01T12:51:20.000Z | 2022-03-29T09:05:35.000Z | src/ralph/data_center/tests/factories.py | hq-git/ralph | e2448caf02d6e5abfd81da2cff92aefe0a534883 | [
"Apache-2.0"
] | 2,314 | 2015-01-02T13:26:26.000Z | 2022-03-29T04:06:03.000Z | src/ralph/data_center/tests/factories.py | hq-git/ralph | e2448caf02d6e5abfd81da2cff92aefe0a534883 | [
"Apache-2.0"
] | 534 | 2015-01-05T12:40:28.000Z | 2022-03-29T21:10:12.000Z | from datetime import datetime, timedelta
import factory
from factory.django import DjangoModelFactory
from factory.fuzzy import FuzzyDecimal, FuzzyInteger
from ralph.assets.models.choices import AssetSource
from ralph.assets.tests.factories import (
AssetHolderFactory,
BaseObjectFactory,
BudgetInfoFactory... | 29.432 | 80 | 0.71514 | from datetime import datetime, timedelta
import factory
from factory.django import DjangoModelFactory
from factory.fuzzy import FuzzyDecimal, FuzzyInteger
from ralph.assets.models.choices import AssetSource
from ralph.assets.tests.factories import (
AssetHolderFactory,
BaseObjectFactory,
BudgetInfoFactory... | 138 | 3,920 | 348 |
6448bef424e00a080c08c631644ca96fc804f43a | 1,926 | py | Python | 6_survival_analysis/data_utilities.py | jjc2718/mutation-fn | e6bab15109a79c7d42dcdbedb1b949a6289d8958 | [
"BSD-3-Clause"
] | null | null | null | 6_survival_analysis/data_utilities.py | jjc2718/mutation-fn | e6bab15109a79c7d42dcdbedb1b949a6289d8958 | [
"BSD-3-Clause"
] | null | null | null | 6_survival_analysis/data_utilities.py | jjc2718/mutation-fn | e6bab15109a79c7d42dcdbedb1b949a6289d8958 | [
"BSD-3-Clause"
] | null | null | null | """
Utilities for loading and preprocessing relevant data.
"""
import pandas as pd
def load_cnv_data(cnv_file, copy_samples, threshold='moderate'):
"""Load and threshold CNV data file from GDC."""
# load raw copy info tsv file
copy_thresh_df = (
pd.read_csv(cnv_file, sep='\t', index_col=0)
... | 34.392857 | 72 | 0.611111 | """
Utilities for loading and preprocessing relevant data.
"""
import pandas as pd
def load_cnv_data(cnv_file, copy_samples, threshold='moderate'):
"""Load and threshold CNV data file from GDC."""
# load raw copy info tsv file
copy_thresh_df = (
pd.read_csv(cnv_file, sep='\t', index_col=0)
... | 0 | 0 | 0 |
b569ffa3d70d74180c922aef3a4e0e8b51d61ceb | 2,856 | py | Python | data/test/python/d7a86a2141a7402bd2a6b7fe2a5021a5e47898e7test_RobotController.py | harshp8l/deep-learning-lang-detection | 2a54293181c1c2b1a2b840ddee4d4d80177efb33 | [
"MIT"
] | 84 | 2017-10-25T15:49:21.000Z | 2021-11-28T21:25:54.000Z | data/test/python/d7a86a2141a7402bd2a6b7fe2a5021a5e47898e7test_RobotController.py | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 5 | 2018-03-29T11:50:46.000Z | 2021-04-26T13:33:18.000Z | data/test/python/d7a86a2141a7402bd2a6b7fe2a5021a5e47898e7test_RobotController.py | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 24 | 2017-11-22T08:31:00.000Z | 2022-03-27T01:22:31.000Z | #Tests for RobotController
#Author: Witold Wasilewski 2011
from RoboticFramework.RobotController.RobotController import RobotController
from RoboticFramework.RobotModelBounder import RobotModelBounder
from RoboticFramework.RobotArm import RobotArm
from config import Config
from RoboticFramework.RobotController.Delegat... | 38.08 | 119 | 0.723389 | #Tests for RobotController
#Author: Witold Wasilewski 2011
from RoboticFramework.RobotController.RobotController import RobotController
from RoboticFramework.RobotModelBounder import RobotModelBounder
from RoboticFramework.RobotArm import RobotArm
from config import Config
from RoboticFramework.RobotController.Delegat... | 2,097 | 5 | 275 |
0e23a2ee6bb3711665ea38b27a094f8f0a270862 | 12,696 | py | Python | mirdata/annotations.py | chrisdonahue/mirdata | c9906e0948adcc75183f5246e7baa879022efcdb | [
"BSD-3-Clause"
] | 1 | 2021-02-24T08:31:14.000Z | 2021-02-24T08:31:14.000Z | mirdata/annotations.py | chrisdonahue/mirdata | c9906e0948adcc75183f5246e7baa879022efcdb | [
"BSD-3-Clause"
] | 1 | 2021-03-15T20:37:41.000Z | 2021-03-19T10:35:33.000Z | mirdata/annotations.py | chrisdonahue/mirdata | c9906e0948adcc75183f5246e7baa879022efcdb | [
"BSD-3-Clause"
] | 1 | 2021-05-03T19:34:46.000Z | 2021-05-03T19:34:46.000Z | """mirdata annotation data types
"""
import numpy as np
class Annotation(object):
"""Annotation base class"""
class BeatData(Annotation):
"""BeatData class
Attributes:
times (np.ndarray): array of time stamps (as floats) in seconds
with positive, strictly increasing values
p... | 31.503722 | 90 | 0.658239 | """mirdata annotation data types
"""
import numpy as np
class Annotation(object):
"""Annotation base class"""
def __repr__(self):
attributes = [v for v in dir(self) if not v.startswith("_")]
repr_str = f"{self.__class__.__name__}({', '.join(attributes)})"
return repr_str
class BeatD... | 4,043 | 0 | 297 |
262bb9619caacedf94868b2f81681a4d5f616beb | 583 | py | Python | day01/ex02/test.py | agelloz/42AI-python-bootcamp | 843099a6f6ea088f7c2f415ed0a33e9decd20641 | [
"MIT"
] | 1 | 2019-11-11T10:37:49.000Z | 2019-11-11T10:37:49.000Z | day01/ex02/test.py | agelloz/42AI-python-bootcamp | 843099a6f6ea088f7c2f415ed0a33e9decd20641 | [
"MIT"
] | null | null | null | day01/ex02/test.py | agelloz/42AI-python-bootcamp | 843099a6f6ea088f7c2f415ed0a33e9decd20641 | [
"MIT"
] | null | null | null | from vector import Vector
v1 = Vector([0.0, 1.0, 2.0, 3.0])
v2 = Vector(3)
v3 = Vector((10, 15))
v4 = Vector(5)
v5 = Vector([5.0])
print(v1)
print(v2)
print(v3)
print(v4)
print(v5)
print(repr(v5))
print("\nadd")
v6 = v1 + v2
v6 = v3 + v4
v6 = v5 + 4
v6 = 7 + v5
v6 = v2 + 5
v6 = 12 + v1
print("\nsub")
v6 = v1 - v2
v6 =... | 13.55814 | 33 | 0.533448 | from vector import Vector
v1 = Vector([0.0, 1.0, 2.0, 3.0])
v2 = Vector(3)
v3 = Vector((10, 15))
v4 = Vector(5)
v5 = Vector([5.0])
print(v1)
print(v2)
print(v3)
print(v4)
print(v5)
print(repr(v5))
print("\nadd")
v6 = v1 + v2
v6 = v3 + v4
v6 = v5 + 4
v6 = 7 + v5
v6 = v2 + 5
v6 = 12 + v1
print("\nsub")
v6 = v1 - v2
v6 =... | 0 | 0 | 0 |