hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3ad9502ed7ba9edef122cbc544bdebb3ece3107a | 1,067 | py | Python | timekeeper/slice.py | jmcph4/timekeeper | 1ab850739c7071ebd8a4d1a63795d014bfa9c41b | [
"MIT"
] | null | null | null | timekeeper/slice.py | jmcph4/timekeeper | 1ab850739c7071ebd8a4d1a63795d014bfa9c41b | [
"MIT"
] | 5 | 2017-07-19T10:09:32.000Z | 2017-07-30T03:32:56.000Z | timekeeper/slice.py | jmcph4/timekeeper | 1ab850739c7071ebd8a4d1a63795d014bfa9c41b | [
"MIT"
] | null | null | null |
MINUTES_IN_DAY = 60 * 24
SECONDS_IN_MINUTE = 60
| 20.921569 | 83 | 0.575445 | from datetime import datetime
MINUTES_IN_DAY = 60 * 24
SECONDS_IN_MINUTE = 60
class Slice(object):
"""
A period of time with a start and an end
"""
DT_FMT = "%Y-%m-%d %H:%M"
def __init__(self, start, end, category, description):
self._start = start
self._end = end
self... | 0 | 158 | 0 | 807 | 0 | 0 | 0 | 8 | 45 |
07950f4fe308fa50f028e08ebc260033356e3745 | 524 | py | Python | IB_Api/ibapi/enum_implem.py | candypantsnola/QTS_Research | d62ecb1ecc5d5429f58b9f566cdd052e491bae28 | [
"MIT"
] | 20 | 2017-03-05T22:15:29.000Z | 2022-02-18T11:45:50.000Z | IB_Api/ibapi/enum_implem.py | candypantsnola/QTS_Research | d62ecb1ecc5d5429f58b9f566cdd052e491bae28 | [
"MIT"
] | null | null | null | IB_Api/ibapi/enum_implem.py | candypantsnola/QTS_Research | d62ecb1ecc5d5429f58b9f566cdd052e491bae28 | [
"MIT"
] | 14 | 2017-03-05T22:49:04.000Z | 2022-01-02T21:34:19.000Z | """
Copyright (C) 2016 Interactive Brokers LLC. All rights reserved. This code is
subject to the terms and conditions of the IB API Non-Commercial License or the
IB API Commercial License, as applicable.
"""
"""
Simple enum implementation
"""
| 21.833333 | 79 | 0.639313 | """
Copyright (C) 2016 Interactive Brokers LLC. All rights reserved. This code is
subject to the terms and conditions of the IB API Non-Commercial License or the
IB API Commercial License, as applicable.
"""
"""
Simple enum implementation
"""
class Enum:
def __init__(self, *args):
self.idx2name ... | 0 | 0 | 0 | 245 | 0 | 0 | 0 | 0 | 23 |
53a6bc66369df992bd355662eb62da394d93b5c7 | 7,243 | py | Python | scripts/geoCorrection.py | young-oct/Cochlear_Implant | e9b1c10a2596209030c9b88537109e3e42a549b5 | [
"MIT"
] | null | null | null | scripts/geoCorrection.py | young-oct/Cochlear_Implant | e9b1c10a2596209030c9b88537109e3e42a549b5 | [
"MIT"
] | null | null | null | scripts/geoCorrection.py | young-oct/Cochlear_Implant | e9b1c10a2596209030c9b88537109e3e42a549b5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @Time : 2021-12-03 1:12 p.m.
# @Author : young wang
# @FileName: geoCorrection.py
# @Software: PyCharm
import pydicom
import numpy as np
from OssiviewBufferReader import OssiviewBufferReader
from os.path import join, isfile
from pydicom.uid import generate_uid
from matplotlib import pypl... | 34.327014 | 110 | 0.581389 | # -*- coding: utf-8 -*-
# @Time : 2021-12-03 1:12 p.m.
# @Author : young wang
# @FileName: geoCorrection.py
# @Software: PyCharm
import pydicom
import numpy as np
from OssiviewBufferReader import OssiviewBufferReader
from os.path import join, isfile
from pydicom.uid import generate_uid
import os
from matplotlib i... | 3 | 0 | 0 | 0 | 0 | 229 | 0 | 5 | 67 |
46229f227661a2e0ee158752515d8a125dc96e9c | 6,908 | py | Python | nicos/services/daemon/pyctl.py | ess-dmsc/nicos | 755d61d403ff7123f804c45fc80c7ff4d762993b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 1 | 2021-03-26T10:30:45.000Z | 2021-03-26T10:30:45.000Z | nicos/services/daemon/pyctl.py | ess-dmsc/nicos | 755d61d403ff7123f804c45fc80c7ff4d762993b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 91 | 2020-08-18T09:20:26.000Z | 2022-02-01T11:07:14.000Z | nicos/services/daemon/pyctl.py | ess-dmsc/nicos | 755d61d403ff7123f804c45fc80c7ff4d762993b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 3 | 2020-08-04T18:35:05.000Z | 2021-04-16T11:22:08.000Z | # -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the t... | 40.635294 | 80 | 0.676173 | # -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the t... | 0 | 0 | 0 | 5,063 | 0 | 0 | 0 | 61 | 117 |
be973d364076cfe16697f8ef2e65e048455a24ad | 662 | py | Python | scripts/features/vectorize_glove.py | jfajkowski/stock-market-forecasting | 6a0ae5a0cfe39263a0f448f062cd01283281a0d8 | [
"MIT"
] | null | null | null | scripts/features/vectorize_glove.py | jfajkowski/stock-market-forecasting | 6a0ae5a0cfe39263a0f448f062cd01283281a0d8 | [
"MIT"
] | null | null | null | scripts/features/vectorize_glove.py | jfajkowski/stock-market-forecasting | 6a0ae5a0cfe39263a0f448f062cd01283281a0d8 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import spacy
# %% Load spaCy model
nlp = spacy.load("en_core_web_lg")
# %% Load cleaned data
df = pd.read_csv('./data/interim/Corpus_Cleaned.csv')
# %% Extract document vectors
df['Vector'] = df.loc[:, 'Top1':'Top25'].apply(lambda x: nlp(' '.join([str(s) for s in x])).vector, a... | 33.1 | 107 | 0.681269 | import numpy as np
import pandas as pd
import spacy
# %% Load spaCy model
nlp = spacy.load("en_core_web_lg")
# %% Load cleaned data
df = pd.read_csv('./data/interim/Corpus_Cleaned.csv')
# %% Extract document vectors
df['Vector'] = df.loc[:, 'Top1':'Top25'].apply(lambda x: nlp(' '.join([str(s) for s in x])).vector, a... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4af3d4bb1190be6fbe80860108d9b52cb30ba440 | 9,165 | py | Python | cogdl/models/nn/pyg_deepergcn.py | xssstory/cogdl | ae8de495c365993f19f04774f083960fd282c2a3 | [
"MIT"
] | 1 | 2021-03-24T10:37:20.000Z | 2021-03-24T10:37:20.000Z | cogdl/models/nn/pyg_deepergcn.py | xssstory/cogdl | ae8de495c365993f19f04774f083960fd282c2a3 | [
"MIT"
] | null | null | null | cogdl/models/nn/pyg_deepergcn.py | xssstory/cogdl | ae8de495c365993f19f04774f083960fd282c2a3 | [
"MIT"
] | null | null | null | import scipy.sparse as sparse
import torch.nn as nn
from .. import register_model, BaseModel
| 33.571429 | 128 | 0.543044 | import numpy as np
import scipy.sparse as sparse
from typing import Any
from torch.utils.checkpoint import checkpoint
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch_scatter import scatter_max
from .. import register_model, BaseModel
from cogdl.utils import mul_edge_softmax, spmm, get_a... | 0 | 4,251 | 0 | 4,450 | 0 | 0 | 0 | 120 | 247 |
1c0321f9d7d668c68212cb3de8330ca46190e2c0 | 9,523 | py | Python | qiskit/providers/ibmq/api/rest/runtime.py | yoshida-ryuhei/qiskit-ibmq-provider | 2ef10178dcd242dd38971e43749dcc49b8e9dd0d | [
"Apache-2.0"
] | null | null | null | qiskit/providers/ibmq/api/rest/runtime.py | yoshida-ryuhei/qiskit-ibmq-provider | 2ef10178dcd242dd38971e43749dcc49b8e9dd0d | [
"Apache-2.0"
] | null | null | null | qiskit/providers/ibmq/api/rest/runtime.py | yoshida-ryuhei/qiskit-ibmq-provider | 2ef10178dcd242dd38971e43749dcc49b8e9dd0d | [
"Apache-2.0"
] | 1 | 2022-03-24T04:59:34.000Z | 2022-03-24T04:59:34.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | 28.426866 | 93 | 0.543001 | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | 0 | 0 | 0 | 8,688 | 0 | 0 | 0 | 70 | 202 |
e25f96dcc37af7a60c2acf75e4cab66c40c2fd43 | 13,214 | py | Python | Scripts/simulation/sims/outfits/outfit_picker_interactions.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | Scripts/simulation/sims/outfits/outfit_picker_interactions.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | Scripts/simulation/sims/outfits/outfit_picker_interactions.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | # uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\sims\outfits\outfit_picker_interactions.py
# Compiled at: 2017-06-14 00:32:50
# Size of source mod 2... | 56.712446 | 314 | 0.673831 | # uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\sims\outfits\outfit_picker_interactions.py
# Compiled at: 2017-06-14 00:32:50
# Size of source mod 2... | 0 | 3,461 | 0 | 8,513 | 0 | 0 | 0 | 550 | 353 |
175fdff3f17d392973721d815f9bc9ba4d353264 | 16,088 | py | Python | pic2vec/feature_preprocessing.py | datarobot/pic2vec | 2dae5093d10414456ca2210c78dc5c3392b70c8e | [
"BSD-3-Clause"
] | 33 | 2017-08-10T01:12:02.000Z | 2021-06-05T01:49:39.000Z | pic2vec/feature_preprocessing.py | datarobot/pic2vec | 2dae5093d10414456ca2210c78dc5c3392b70c8e | [
"BSD-3-Clause"
] | 22 | 2017-07-24T15:04:29.000Z | 2021-11-15T17:46:59.000Z | pic2vec/feature_preprocessing.py | datarobot/pic2vec | 2dae5093d10414456ca2210c78dc5c3392b70c8e | [
"BSD-3-Clause"
] | 15 | 2017-08-10T15:46:00.000Z | 2021-01-21T08:12:15.000Z | """
This file deals with preprocessing the images for the featurizer.
It gives the user 3 options:
1. Upload a CSV with URL pointers.
2. Upload an image directory with no CSV. The featurizer will generate a CSV automatically.
3. Upload a CSV with an image directory. The CSV will contain pointers to image in the direct... | 33.586639 | 99 | 0.62587 | """
This file deals with preprocessing the images for the featurizer.
It gives the user 3 options:
1. Upload a CSV with URL pointers.
2. Upload an image directory with no CSV. The featurizer will generate a CSV automatically.
3. Upload a CSV with an image directory. The CSV will contain pointers to image in the direct... | 0 | 4,665 | 0 | 0 | 0 | 237 | 0 | -1 | 82 |
ddb21650c29931a8a6f99ec0513a50ecae5bdc94 | 4,545 | py | Python | tidalclassifier/general_metrics/performance_by_class.py | RustyPanda/tidal-features-classifier | 32e1aa0c074528ed04419d596c2014f78448e11b | [
"MIT"
] | 1 | 2021-05-01T06:08:53.000Z | 2021-05-01T06:08:53.000Z | tidalclassifier/general_metrics/performance_by_class.py | RustyPanda/tidal-features-classifier | 32e1aa0c074528ed04419d596c2014f78448e11b | [
"MIT"
] | null | null | null | tidalclassifier/general_metrics/performance_by_class.py | RustyPanda/tidal-features-classifier | 32e1aa0c074528ed04419d596c2014f78448e11b | [
"MIT"
] | null | null | null | """
Use previous output catalogs to investigate correct and incorrect images
"""
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import seaborn as sns
def visualise_error_by_class(df, save_loc):
"""Show performance on each pure tidal class based on predictions
Args:
df (... | 36.36 | 120 | 0.683168 | """
Use previous output catalogs to investigate correct and incorrect images
"""
import logging
import os
import json
import pandas as pd
import numpy as np
from astropy.io import fits
from PIL import Image
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import seaborn as sns
from tidalclassi... | 0 | 0 | 0 | 0 | 0 | 2,413 | 0 | 55 | 270 |
8f43736ec96add1b000086e3ab3c9121c0835928 | 3,867 | py | Python | Final Project/dataProcessor.py | DesirY/Machine-Learning-Library | b4ccb8182b0b748ac2ce9b669bcc0a9386829511 | [
"OLDAP-2.5",
"OLDAP-2.4"
] | null | null | null | Final Project/dataProcessor.py | DesirY/Machine-Learning-Library | b4ccb8182b0b748ac2ce9b669bcc0a9386829511 | [
"OLDAP-2.5",
"OLDAP-2.4"
] | null | null | null | Final Project/dataProcessor.py | DesirY/Machine-Learning-Library | b4ccb8182b0b748ac2ce9b669bcc0a9386829511 | [
"OLDAP-2.5",
"OLDAP-2.4"
] | null | null | null | '''
1. complete the missing data
2. convert the continous feature into discrete feature
3. one-hot encondes the discrete feature generated by the continous feature
4. one-hot encode all discrete feature
'''
import pandas as pd
MISSING_DATA = ['?']
CONTINUOUS_ATTR = ['fnlwgt']
INTEGER_ATTR = ['age', 'education.num', ... | 33.921053 | 103 | 0.603051 | '''
1. complete the missing data
2. convert the continous feature into discrete feature
3. one-hot encondes the discrete feature generated by the continous feature
4. one-hot encode all discrete feature
'''
import csv
import numpy as np
from numpy import fabs, random
from numpy.lib.function_base import percentile, sor... | 0 | 0 | 0 | 3,018 | 0 | 0 | 0 | 77 | 157 |
39c497d9a21f5def2807346f1891489cbba240ec | 5,096 | py | Python | regeng.py | tonisidneimc/Regex-Engine | df3b485c27a54a530ed4c85b7911a1779567d655 | [
"MIT"
] | 1 | 2021-11-15T12:03:15.000Z | 2021-11-15T12:03:15.000Z | regeng.py | tonisidneimc/Regex-Engine | df3b485c27a54a530ed4c85b7911a1779567d655 | [
"MIT"
] | null | null | null | regeng.py | tonisidneimc/Regex-Engine | df3b485c27a54a530ed4c85b7911a1779567d655 | [
"MIT"
] | null | null | null |
#operator precedence table
Precedence = {
'|' : 0, #NFA Union Operator
'.' : 1, #NFA Concat Operator
'?' : 2, #NFA zero or one Operator
'*' : 2, #NFA Closure Operator
'+' : 2 #NFA one or more Operator
}
| 20.548387 | 68 | 0.631279 | import sys
def makeRange(start, end):
out = ['(']
for s in range(ord(start), ord(end)) :
out.append(chr(s))
out.append('|')
out.append(end)
return out
def preProcess(expr : str) -> list:
#add . (NFA Concat operator)
#add range
out = []
i = 0
while i < len(expr) :
if expr[i] == '[':
... | 0 | 0 | 0 | 490 | 0 | 4,015 | 0 | -11 | 390 |
9d750eb0d05a0f3fdcf2b80586d947184b6a211f | 1,953 | py | Python | bvid2aid/bvid2aid.py | davidli218/Bilibili-Convert-AV-BV | 24995a8e4facfa021ad47aacf56ab5400a7a4d52 | [
"MIT"
] | 2 | 2020-03-29T13:43:04.000Z | 2020-03-29T13:43:06.000Z | bvid2aid/bvid2aid.py | davidli218/Bilibili-Convert-AV-BV | 24995a8e4facfa021ad47aacf56ab5400a7a4d52 | [
"MIT"
] | null | null | null | bvid2aid/bvid2aid.py | davidli218/Bilibili-Convert-AV-BV | 24995a8e4facfa021ad47aacf56ab5400a7a4d52 | [
"MIT"
] | null | null | null | import tkinter as tk
import tkinter.font as tkf
if __name__ == '__main__':
#
window = tk.Tk()
window.title('B AV/BV')
window.geometry('450x300')
window.iconbitmap('BVid2Aid.ico')
window.resizable(width=False, height=False)
# &
font_main = tkf.Font(family="Lucida Grande", size=20)
... | 36.166667 | 98 | 0.646185 | import converter
import tkinter as tk
from tkinter import messagebox as tkm
import tkinter.font as tkf
if __name__ == '__main__':
def convert():
var_result.set('')
input_id = var_input.get()
if input_id[:2].upper() == 'AV' and len(input_id) >= 3 and input_id[2:].isdigit():
var_r... | 78 | 0 | 0 | 0 | 0 | 441 | 0 | 11 | 70 |
4260ae3291140cae1b6a76bad3a86ec24370aec1 | 2,371 | py | Python | usecases/screen/databuilder.py | aboulay/goyave.py | ce46f582d87a9fc5a455e7f5e1b0103a4571f157 | [
"MIT"
] | null | null | null | usecases/screen/databuilder.py | aboulay/goyave.py | ce46f582d87a9fc5a455e7f5e1b0103a4571f157 | [
"MIT"
] | null | null | null | usecases/screen/databuilder.py | aboulay/goyave.py | ce46f582d87a9fc5a455e7f5e1b0103a4571f157 | [
"MIT"
] | null | null | null |
STATUS_OK = "OK"
STATUS_FAILED = "KO"
INFORMATION_MISSING = "N/A"
| 33.394366 | 79 | 0.574019 | import requests
from usecases.screen.exceptions import UnknownResponseFormat
STATUS_OK = "OK"
STATUS_FAILED = "KO"
INFORMATION_MISSING = "N/A"
class ScreenDataBuilder():
def build(self, screen):
response = self.call_endpoint(screen.get_url(), screen.get_format())
if response["status_code"] != 20... | 0 | 0 | 0 | 2,202 | 0 | 0 | 0 | 33 | 68 |
443d7f2ae6abbd0de6e079c5c5992d6fc450dc36 | 20,808 | py | Python | dataloaders/jets_loader.py | maamdaad/Set2GraphPaper | 883a87f41192e926b45916542cb3c7e24e0be20b | [
"Apache-2.0"
] | null | null | null | dataloaders/jets_loader.py | maamdaad/Set2GraphPaper | 883a87f41192e926b45916542cb3c7e24e0be20b | [
"Apache-2.0"
] | null | null | null | dataloaders/jets_loader.py | maamdaad/Set2GraphPaper | 883a87f41192e926b45916542cb3c7e24e0be20b | [
"Apache-2.0"
] | null | null | null | import torch.nn as nn
data_dir = 'data/'
node_features_list = ['trk_d0', 'trk_z0', 'trk_phi', 'trk_ctgtheta', 'trk_pt', 'trk_charge']
jet_features_list = ['jet_pt', 'jet_eta', 'jet_phi', 'jet_M']
node_features_list_real_data = ['Track_dxy', 'Track_dz', 'Track_phi', 'Track_eta', 'Track_pt', 'Track_charge']
jet_feature... | 42.292683 | 279 | 0.600634 | import os
import uproot3 as uproot
import torch
import torch.nn as nn
import numpy as np
from torch.utils.data import Dataset, DataLoader, Sampler
from datetime import datetime
from tqdm import tqdm
data_dir = 'data/'
node_features_list = ['trk_d0', 'trk_z0', 'trk_phi', 'trk_ctgtheta', 'trk_pt', 'trk_charge']
jet_feat... | 0 | 0 | 0 | 19,291 | 0 | 658 | 0 | 23 | 292 |
59171f89e75d587b6e8d21be1950eeee43eaff00 | 3,082 | py | Python | scripts/training/mlp_rxn_classification_schneider.py | reymond-group/drfp | 921f476f9c4a37d1bce08ae6de5abb1b1589dbbb | [
"MIT"
] | 22 | 2021-07-06T15:02:16.000Z | 2022-02-28T05:36:34.000Z | scripts/training/mlp_rxn_classification_schneider.py | reymond-group/drfp | 921f476f9c4a37d1bce08ae6de5abb1b1589dbbb | [
"MIT"
] | 3 | 2022-01-07T21:17:04.000Z | 2022-02-13T17:07:23.000Z | scripts/training/mlp_rxn_classification_schneider.py | reymond-group/drfp | 921f476f9c4a37d1bce08ae6de5abb1b1589dbbb | [
"MIT"
] | 2 | 2021-12-30T15:33:32.000Z | 2022-02-15T18:28:25.000Z | # Adapted from: https://github.com/rxn4chemistry/rxnfp/blob/master/nbs/10_results_uspto_1k_tpl.ipynb
import pickle
import tensorflow as tf
from tensorflow import keras
import numpy as np
from pycm import ConfusionMatrix
def get_pred(
train_X: np.array, train_y: np.array, eval_X: np.array, n_classes: int
) -> lis... | 29.075472 | 100 | 0.680727 | # Adapted from: https://github.com/rxn4chemistry/rxnfp/blob/master/nbs/10_results_uspto_1k_tpl.ipynb
import pickle
import click
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from sklearn.neural_network import MLPClassifier
import numpy as np
from pathlib import Path
from typi... | 0 | 1,507 | 0 | 0 | 0 | 0 | 0 | 76 | 177 |
c33b788d599ba547e10262fcdde3ade831b5af74 | 108 | py | Python | iiifAPI/urls.py | utlib/utl_iiif_api | e2d77ad5a677487e205b840cc800af46b4697eab | [
"Apache-2.0"
] | 4 | 2019-12-08T18:39:37.000Z | 2021-11-09T19:35:44.000Z | iiifAPI/urls.py | utlib/utl_iiif_api | e2d77ad5a677487e205b840cc800af46b4697eab | [
"Apache-2.0"
] | 2 | 2020-06-05T16:45:31.000Z | 2021-06-10T17:30:00.000Z | iiifAPI/urls.py | utlib/utl_iiif_api | e2d77ad5a677487e205b840cc800af46b4697eab | [
"Apache-2.0"
] | 1 | 2019-12-08T18:45:52.000Z | 2019-12-08T18:45:52.000Z | from django.conf.urls import url, include
urlpatterns = [
url(r'', include("iiif_api_services.urls")),
]
| 15.428571 | 45 | 0.712963 | from django.conf.urls import url, include
urlpatterns = [
url(r'', include("iiif_api_services.urls")),
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
63af9ed62f00431048a636068510051e35630850 | 11,355 | py | Python | satsearch/scene.py | moegoldberg/sat-search | bb41641423b493e959cca60939b93cd5a2e7e06a | [
"MIT"
] | null | null | null | satsearch/scene.py | moegoldberg/sat-search | bb41641423b493e959cca60939b93cd5a2e7e06a | [
"MIT"
] | null | null | null | satsearch/scene.py | moegoldberg/sat-search | bb41641423b493e959cca60939b93cd5a2e7e06a | [
"MIT"
] | null | null | null | import logging
import satsearch.utils as utils
import satsearch.config as config
logger = logging.getLogger(__name__)
| 33.694362 | 103 | 0.547952 | import os
import logging
import requests
import json
from string import Formatter, Template
from datetime import datetime
import satsearch.utils as utils
import satsearch.config as config
import traceback
logger = logging.getLogger(__name__)
class SatSceneError(Exception):
pass
class Scene(object):
def _... | 0 | 3,017 | 0 | 8,022 | 0 | 0 | 0 | -8 | 201 |
345139fc335ea7fad4a568bf6162b0f24dcce035 | 2,093 | py | Python | task/AddFactoryConfiguration.py | wookiee2187/vc3-login-pod | 3c0f5490c094bf0b4587a743efac68d722ea5ee2 | [
"MIT"
] | 1 | 2019-07-17T19:01:34.000Z | 2019-07-17T19:01:34.000Z | task/AddFactoryConfiguration.py | wookiee2187/vc3-login-pod | 3c0f5490c094bf0b4587a743efac68d722ea5ee2 | [
"MIT"
] | null | null | null | task/AddFactoryConfiguration.py | wookiee2187/vc3-login-pod | 3c0f5490c094bf0b4587a743efac68d722ea5ee2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
| 25.839506 | 68 | 0.491161 | #!/usr/bin/env python
import json
from vc3master.task import VC3Task
class AddFactoryConfiguration(VC3Task):
def runtask(self):
self.log.info("Running task %s" % self.section)
self.infoclient = self.parent.parent.infoclient
doc = self._getdoc()
doc = self._updatedoc(doc)
... | 0 | 0 | 0 | 1,988 | 0 | 0 | 0 | 3 | 69 |
260c58da8bb16fbbd43ee64ea6de2696eba50546 | 178 | py | Python | LeetCode/1108. Defanging an IP Address/solution.py | InnoFang/algorithms | 01847903f757722b6c877e1631e5413b9376c82e | [
"Apache-2.0"
] | null | null | null | LeetCode/1108. Defanging an IP Address/solution.py | InnoFang/algorithms | 01847903f757722b6c877e1631e5413b9376c82e | [
"Apache-2.0"
] | null | null | null | LeetCode/1108. Defanging an IP Address/solution.py | InnoFang/algorithms | 01847903f757722b6c877e1631e5413b9376c82e | [
"Apache-2.0"
] | null | null | null | """
62 / 62 test cases passed.
Runtime: 32 ms
Memory Usage: 15 MB
"""
| 19.777778 | 48 | 0.617978 | """
62 / 62 test cases passed.
Runtime: 32 ms
Memory Usage: 15 MB
"""
class Solution:
def defangIPaddr(self, address: str) -> str:
return address.replace('.', '[.]')
| 0 | 0 | 0 | 86 | 0 | 0 | 0 | 0 | 22 |
9d1ed8633a3787aa071f7fd2e1b64d4b1c3e54b5 | 276 | py | Python | PyMOTW/source/gettext/gettext_app_builtin.py | axetang/AxePython | 3b517fa3123ce2e939680ad1ae14f7e602d446a6 | [
"Apache-2.0"
] | 1 | 2019-01-04T05:47:50.000Z | 2019-01-04T05:47:50.000Z | PyMOTW/source/gettext/gettext_app_builtin.py | axetang/AxePython | 3b517fa3123ce2e939680ad1ae14f7e602d446a6 | [
"Apache-2.0"
] | 1 | 2020-07-18T03:52:03.000Z | 2020-07-18T04:18:01.000Z | PyMOTW/source/gettext/gettext_app_builtin.py | axetang/AxePython | 3b517fa3123ce2e939680ad1ae14f7e602d446a6 | [
"Apache-2.0"
] | 2 | 2021-03-06T04:28:32.000Z | 2021-03-06T04:59:17.000Z | #!/usr/bin/env python3
# encoding: utf-8
#
# Copyright (c) 2009 Doug Hellmann All rights reserved.
#
"""
"""
# flake8: noqa
#end_pymotw_header
import gettext
gettext.install(
'example',
'locale',
names=['ngettext'],
)
print(_('This message is in the script.'))
| 13.8 | 55 | 0.655797 | #!/usr/bin/env python3
# encoding: utf-8
#
# Copyright (c) 2009 Doug Hellmann All rights reserved.
#
"""
"""
# flake8: noqa
#end_pymotw_header
import gettext
gettext.install(
'example',
'locale',
names=['ngettext'],
)
print(_('This message is in the script.'))
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9106eea7d831de9c1bd56257c4526b6b5172cb43 | 1,153 | py | Python | setup.py | antoan-angelov/SPACESHIP | 80c5ebf270446433cfbbacc76a6668bad1755cd0 | [
"MIT"
] | 13 | 2015-07-13T22:18:20.000Z | 2017-10-02T20:57:58.000Z | setup.py | antoan-angelov/spaceship | 80c5ebf270446433cfbbacc76a6668bad1755cd0 | [
"MIT"
] | null | null | null | setup.py | antoan-angelov/spaceship | 80c5ebf270446433cfbbacc76a6668bad1755cd0 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(
name="spaceship",
version="0.8.2",
packages=find_packages(),
install_requires=[
'netifaces'
],
url = 'https://github.com/antoan-angelov/spaceship/',
author="Antoan Angelov",
author_email="antoan.angelov+spaceship@gmail.com",
... | 33.911765 | 98 | 0.613183 | from setuptools import setup, find_packages
setup(
name="spaceship",
version="0.8.2",
packages=find_packages(),
install_requires=[
'netifaces'
],
url = 'https://github.com/antoan-angelov/spaceship/',
author="Antoan Angelov",
author_email="antoan.angelov+spaceship@gmail.com",
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3737a05c404ea61b4bb08bc6acbc66a7b4fb5a76 | 5,324 | py | Python | 06/hack_assembler.py | linstantnoodles/nand2tetris-solutions | 96f59ca1b444b434decb74d13621bb93b4384d00 | [
"MIT"
] | 1 | 2021-07-12T16:29:05.000Z | 2021-07-12T16:29:05.000Z | 06/hack_assembler.py | linstantnoodles/nand2tetris-solutions | 96f59ca1b444b434decb74d13621bb93b4384d00 | [
"MIT"
] | null | null | null | 06/hack_assembler.py | linstantnoodles/nand2tetris-solutions | 96f59ca1b444b434decb74d13621bb93b4384d00 | [
"MIT"
] | null | null | null | # simplest case: takes a single line and convert it to binary
import sys
# 15 bit addresses
predefined_symbols = {
'THAT': '000000000000100',
'R14': '000000000001110',
'R15': '000000000001111',
'R12': '000000000001100',
'R13': '000000000001101',
'R10': '000000000001010',
'R11': '00000000000... | 28.169312 | 104 | 0.577761 | # simplest case: takes a single line and convert it to binary
import sys
import re
# 15 bit addresses
predefined_symbols = {
'THAT': '000000000000100',
'R14': '000000000001110',
'R15': '000000000001111',
'R12': '000000000001100',
'R13': '000000000001101',
'R10': '000000000001010',
'R11': '0... | 0 | 0 | 0 | 0 | 0 | 3,015 | 0 | -12 | 324 |
93fe983b799470740412429819f66363e9417974 | 303 | py | Python | exercise/package2_test.py | progzc/PythonDemo | 0515fee3511bc132bfddf480014f61ce52080616 | [
"Apache-2.0"
] | null | null | null | exercise/package2_test.py | progzc/PythonDemo | 0515fee3511bc132bfddf480014f61ce52080616 | [
"Apache-2.0"
] | null | null | null | exercise/package2_test.py | progzc/PythonDemo | 0515fee3511bc132bfddf480014f61ce52080616 | [
"Apache-2.0"
] | null | null | null | # import
# import
import calc2
# import
import package.module_a
# import +
import package.module_b as mb
# from import
# from...import
from package import module_a
print(package.module_a.a)
print(mb.b)
print(module_a.a)
print(calc2.add(10, 20))
| 18.9375 | 33 | 0.775578 | # 使用import方式进行导入时,只能跟包名或模块名称
# import 包名
import calc2
# import 模块名
import package.module_a
# import 包名+取别名
import package.module_b as mb
# from 包名 import 模块名
# 使用from...import方式可以导入包、模块、函数、变量
from package import module_a
print(package.module_a.a)
print(mb.b)
print(module_a.a)
print(calc2.add(10, 20))
| 159 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4062cdd9c6f4598150444c52457ccc4c69d36780 | 6,261 | py | Python | numba_dppy/ocl/ocldecl.py | Rubtsowa/numba-dppy | 20f9825b144913ebe1f7635c785b334f3743c4cb | [
"Apache-2.0"
] | null | null | null | numba_dppy/ocl/ocldecl.py | Rubtsowa/numba-dppy | 20f9825b144913ebe1f7635c785b334f3743c4cb | [
"Apache-2.0"
] | null | null | null | numba_dppy/ocl/ocldecl.py | Rubtsowa/numba-dppy | 20f9825b144913ebe1f7635c785b334f3743c4cb | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Intel Corporation
#
# 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 wr... | 26.871245 | 87 | 0.679125 | # Copyright 2021 Intel Corporation
#
# 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 wr... | 0 | 4,219 | 0 | 0 | 0 | 0 | 0 | 212 | 434 |
d2ef915d3c44cbcbe44de23fb202e1982762712e | 2,234 | py | Python | setup.py | bfemery-sandia/pvOps | fcdf47443041b3deb70f675481a70e7cf0b3dc93 | [
"BSD-3-Clause"
] | 2 | 2021-04-21T23:42:36.000Z | 2021-05-06T16:18:48.000Z | setup.py | bfemery-sandia/pvOps | fcdf47443041b3deb70f675481a70e7cf0b3dc93 | [
"BSD-3-Clause"
] | 13 | 2021-03-16T17:52:31.000Z | 2021-05-20T21:19:56.000Z | setup.py | bfemery-sandia/pvOps | fcdf47443041b3deb70f675481a70e7cf0b3dc93 | [
"BSD-3-Clause"
] | 4 | 2021-05-26T13:49:21.000Z | 2021-12-17T16:35:06.000Z | #!/usr/bin/env python
try:
from setuptools import setup, find_packages
except ImportError:
raise RuntimeError('setuptools is required')
DESCRIPTION = ('pvops is a python library for the analysis of ' +
'field collected operational data for photovoltaic systems.')
LONG_DESCRIPTION = """
pvops i... | 24.021505 | 78 | 0.691585 | #!/usr/bin/env python
try:
from setuptools import setup, find_packages
except ImportError:
raise RuntimeError('setuptools is required')
DESCRIPTION = ('pvops is a python library for the analysis of ' +
'field collected operational data for photovoltaic systems.')
LONG_DESCRIPTION = """
pvops i... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
73ef5f3120097a8cdf5bcb0606b463078e309cf1 | 6,202 | py | Python | awsudo/rotate.py | numerai/awsudo | a18c1e0a8faceae51361e010d6eee895e08465a6 | [
"MIT"
] | null | null | null | awsudo/rotate.py | numerai/awsudo | a18c1e0a8faceae51361e010d6eee895e08465a6 | [
"MIT"
] | null | null | null | awsudo/rotate.py | numerai/awsudo | a18c1e0a8faceae51361e010d6eee895e08465a6 | [
"MIT"
] | null | null | null | from __future__ import print_function
from textwrap import dedent
ACCESS_KEY_DOCS = 'http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html'
try:
from configparser import RawConfigParser
except ImportError:
def deleteOldKeys(iam, currentKeyId, userName):
"""Delete all keys ex... | 30.253659 | 99 | 0.671396 | from __future__ import print_function
import os
import sys
import getopt
from os import path
from textwrap import dedent
from retrying import retry
from awsudo.config import CredentialResolver
from awsudo.main import cleanEnvironment
from boto.iam.connection import IAMConnection
from boto.exception import BotoServerEr... | 0 | 615 | 0 | 1,065 | 0 | 2,703 | 0 | 78 | 409 |
a38b95d160fc8a0e45dcc5bce56d2d8e8fa78398 | 3,464 | py | Python | frontend/tests/sauce_connect.py | connectthefuture/calc | 7f0dc01d9265f26a36c2b9b5ee779fe876e4a494 | [
"CC0-1.0"
] | null | null | null | frontend/tests/sauce_connect.py | connectthefuture/calc | 7f0dc01d9265f26a36c2b9b5ee779fe876e4a494 | [
"CC0-1.0"
] | 1 | 2021-06-10T23:13:04.000Z | 2021-06-10T23:13:04.000Z | frontend/tests/sauce_connect.py | connectthefuture/calc | 7f0dc01d9265f26a36c2b9b5ee779fe876e4a494 | [
"CC0-1.0"
] | null | null | null | import os
import sys
if False:
# This is just needed so mypy will work; it's never executed.
MY_DIR = os.path.abspath(os.path.dirname(__file__))
SAUCE_CONNECT_SH_PATH = os.path.join(MY_DIR, 'sauce_connect.sh')
LOAD_SAUCE_CONNECT = 'source {}'.format(SAUCE_CONNECT_SH_PATH)
PROMPT = "BASH IS READY > "
TIMEOUT =... | 24.742857 | 75 | 0.58545 | import os
import sys
import subprocess
import traceback
import pexpect
if False:
# This is just needed so mypy will work; it's never executed.
from typing import Optional # NOQA
MY_DIR = os.path.abspath(os.path.dirname(__file__))
SAUCE_CONNECT_SH_PATH = os.path.join(MY_DIR, 'sauce_connect.sh')
LOAD_SAUCE_C... | 0 | 0 | 0 | 1,674 | 0 | 1,101 | 0 | -10 | 192 |
5d93574711f60399841cfe595d62241e936dfb9a | 20,898 | py | Python | xfel/command_line/striping.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 155 | 2016-11-23T12:52:16.000Z | 2022-03-31T15:35:44.000Z | xfel/command_line/striping.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 590 | 2016-12-10T11:31:18.000Z | 2022-03-30T23:10:09.000Z | xfel/command_line/striping.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 115 | 2016-11-15T08:17:28.000Z | 2022-02-09T15:30:14.000Z | from __future__ import absolute_import, division, print_function
# -*- Mode: Python; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*-
#
# LIBTBX_SET_DISPATCHER_NAME cctbx.xfel.stripe_experiment
#
# Given an LCLS experiment results directory and a trial, group results by
# run group and then distrbute each run... | 36.792254 | 125 | 0.681405 | from __future__ import absolute_import, division, print_function
from six.moves import range
# -*- Mode: Python; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*-
#
# LIBTBX_SET_DISPATCHER_NAME cctbx.xfel.stripe_experiment
#
# Given an LCLS experiment results directory and a trial, group results by
# run group... | 0 | 0 | 0 | 7,245 | 0 | 4,699 | 0 | 83 | 201 |
09d3f7a4cbc0a08c36ab107b2e9a993b4875da64 | 253 | py | Python | todoapp/todos/urls.py | kiburualex/Django-Rest-Example | 0208c4cc3e4b1f8189028af77ec5d1714ca98f3f | [
"MIT"
] | null | null | null | todoapp/todos/urls.py | kiburualex/Django-Rest-Example | 0208c4cc3e4b1f8189028af77ec5d1714ca98f3f | [
"MIT"
] | null | null | null | todoapp/todos/urls.py | kiburualex/Django-Rest-Example | 0208c4cc3e4b1f8189028af77ec5d1714ca98f3f | [
"MIT"
] | null | null | null | from django.conf.urls import url
from todos.views import TodoListCreateAPIView, TodoDetailAPIView
urlpatterns = [
url(r'^$', TodoListCreateAPIView.as_view(), name="list"),
url(r'^(?P<pk>[0-9]+)/$', TodoDetailAPIView.as_view(), name="detail"),
] | 36.142857 | 74 | 0.70751 | from django.conf.urls import url
from todos.views import TodoListCreateAPIView, TodoDetailAPIView
urlpatterns = [
url(r'^$', TodoListCreateAPIView.as_view(), name="list"),
url(r'^(?P<pk>[0-9]+)/$', TodoDetailAPIView.as_view(), name="detail"),
] | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d6016da7b2c4dbdcf86911bd54a3d9dd1f73a7d5 | 1,860 | py | Python | Beginner/2/notes.py | Matthew1906/100DaysOfPython | 94ffff8f5535ce5d574f49c0d7971d64a4575aad | [
"MIT"
] | 1 | 2021-12-25T02:19:18.000Z | 2021-12-25T02:19:18.000Z | Beginner/2/notes.py | Matthew1906/100DaysOfPython | 94ffff8f5535ce5d574f49c0d7971d64a4575aad | [
"MIT"
] | null | null | null | Beginner/2/notes.py | Matthew1906/100DaysOfPython | 94ffff8f5535ce5d574f49c0d7971d64a4575aad | [
"MIT"
] | 1 | 2021-11-25T10:31:47.000Z | 2021-11-25T10:31:47.000Z | # DATA TYPES, NUMBERS, OPERATIONS, TYPE CONVERSION, f-Strings
# 1. Data Types
# a. String
# pulling out an element from the string = subscripting
# the index starts from 0 to length-1
print("Hello"[3])
# b. Integer
# large integers can be separated with _
print(199_000) # show 199000, but it makes it more readable... | 25.479452 | 72 | 0.694086 | # DATA TYPES, NUMBERS, OPERATIONS, TYPE CONVERSION, f-Strings
# 1. Data Types
# a. String
# pulling out an element from the string = subscripting
# the index starts from 0 to length-1
print("Hello"[3])
# b. Integer
# large integers can be separated with _
print(199_000) # show 199000, but it makes it more readable... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7259758223c1ea78c65b92b87ea2211bfa4cb851 | 399 | py | Python | fusion/migrations/0009_image_probability.py | manoharganta256/Chest-Xray-Prediction | 24d0130a90b9cdbcc2d283fb0e1b5a5df88ed869 | [
"MIT"
] | 1 | 2020-06-23T09:23:54.000Z | 2020-06-23T09:23:54.000Z | fusion/migrations/0009_image_probability.py | manoharganta256/Chest-Xray-Prediction | 24d0130a90b9cdbcc2d283fb0e1b5a5df88ed869 | [
"MIT"
] | 13 | 2020-01-28T22:26:55.000Z | 2022-03-11T23:27:43.000Z | fusion/migrations/0009_image_probability.py | manoharganta256/Chest-Xray-Prediction | 24d0130a90b9cdbcc2d283fb0e1b5a5df88ed869 | [
"MIT"
] | 2 | 2019-02-20T06:40:26.000Z | 2019-10-01T14:07:18.000Z | # Generated by Django 2.0.7 on 2018-08-14 12:53
| 21 | 62 | 0.60401 | # Generated by Django 2.0.7 on 2018-08-14 12:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fusion', '0008_auto_20180731_1925'),
]
operations = [
migrations.AddField(
model_name='image',
name='probability',
... | 0 | 0 | 0 | 285 | 0 | 0 | 0 | 19 | 46 |
4d42b2279a7e82f48d1b603cbe16c8fb292bfdab | 17,144 | py | Python | utils/convert_logs.py | seemantk/gentoo-viz | fbdf4946528c49ceb568a60b908f4140c4df9c9a | [
"MIT"
] | 1 | 2015-11-05T07:24:28.000Z | 2015-11-05T07:24:28.000Z | utils/convert_logs.py | seemantk/gentoo-viz | fbdf4946528c49ceb568a60b908f4140c4df9c9a | [
"MIT"
] | null | null | null | utils/convert_logs.py | seemantk/gentoo-viz | fbdf4946528c49ceb568a60b908f4140c4df9c9a | [
"MIT"
] | null | null | null | #!/usr/bin/python
# Standard library imports
from datetime import datetime
from optparse import OptionParser
import os
import sys
import time
from xml.sax.saxutils import escape as h
# Some global variables
svn_sep = "------------------------------------------------------------------------"
cvs_sep = "----------------... | 38.963636 | 112 | 0.491367 | #!/usr/bin/python
# Standard library imports
from datetime import datetime
from optparse import OptionParser
import os
import sys
import time
from xml.sax.saxutils import escape as h
# Some global variables
svn_sep = "------------------------------------------------------------------------"
cvs_sep = "----------------... | 0 | 0 | 0 | 420 | 0 | 257 | 0 | 0 | 45 |
15042f5cfa508b9c66e924c9b72c910b5f285e51 | 2,777 | py | Python | setup.py | platform9/express-cli | a653223a129774a05b9f70efd9c4ecbe930beb7b | [
"Apache-2.0"
] | 4 | 2019-12-06T20:39:53.000Z | 2021-01-05T07:01:35.000Z | setup.py | platform9/express-cli | a653223a129774a05b9f70efd9c4ecbe930beb7b | [
"Apache-2.0"
] | 42 | 2019-09-20T20:35:09.000Z | 2021-09-23T23:28:05.000Z | setup.py | platform9/express-cli | a653223a129774a05b9f70efd9c4ecbe930beb7b | [
"Apache-2.0"
] | 5 | 2019-11-19T02:36:01.000Z | 2021-01-05T04:46:48.000Z | """Packaging settings."""
import sys
import os
from codecs import open
from setuptools import find_packages, setup
from pf9 import __version__
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.... | 29.860215 | 96 | 0.594526 | """Packaging settings."""
import sys
import os
from codecs import open
from subprocess import call
from setuptools import Command, find_packages, setup
from pf9 import __version__
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='ut... | 0 | 0 | 0 | 287 | 0 | 0 | 0 | 15 | 45 |
335d9e38e51aafded1aae038d7380620f7af624f | 364 | py | Python | python-practice/fib_memo.py | davemungo/various | ed7c17f8b75a27fc59b0a5cad6125d64d00cd3ce | [
"MIT"
] | 1 | 2020-01-19T01:21:56.000Z | 2020-01-19T01:21:56.000Z | python-practice/fib_memo.py | davemungo/various | ed7c17f8b75a27fc59b0a5cad6125d64d00cd3ce | [
"MIT"
] | null | null | null | python-practice/fib_memo.py | davemungo/various | ed7c17f8b75a27fc59b0a5cad6125d64d00cd3ce | [
"MIT"
] | 1 | 2021-07-02T14:40:01.000Z | 2021-07-02T14:40:01.000Z | memo = {0:0, 1:1}
if __name__ == "__main__":
print(f"\n0: {fib(0)}")
print(f"\n1: {fib(1)}")
print(f"\n5: {fib(5)}")
print(f"\n10: {fib(10)}")
#for k,v in memo.items(): print(f"{k}: {v}")
| 18.2 | 49 | 0.458791 | memo = {0:0, 1:1}
def fib(n):
#if n == 0: return 0
#if n == 1: return 1
if n not in memo:
memo[n] = fib(n - 1) + fib(n - 2)
return memo[n]
if __name__ == "__main__":
print(f"\n0: {fib(0)}")
print(f"\n1: {fib(1)}")
print(f"\n5: {fib(5)}")
print(f"\n10: {fib(10)}")
#f... | 0 | 0 | 0 | 0 | 0 | 129 | 0 | 0 | 23 |
8e1b6f6dab45af95d9530bb78f0966a8f4fb001b | 9,280 | py | Python | tools/badges/badges.py | hiliang-cmu/ARENA-py | 724e14f4e37112b96d90e94d9e521800bdea0997 | [
"BSD-3-Clause"
] | 4 | 2021-01-22T23:49:52.000Z | 2022-03-04T06:01:18.000Z | tools/badges/badges.py | hiliang-cmu/ARENA-py | 724e14f4e37112b96d90e94d9e521800bdea0997 | [
"BSD-3-Clause"
] | 50 | 2020-08-14T22:24:36.000Z | 2022-03-18T20:41:12.000Z | tools/badges/badges.py | hiliang-cmu/ARENA-py | 724e14f4e37112b96d90e94d9e521800bdea0997 | [
"BSD-3-Clause"
] | 10 | 2019-10-28T20:15:18.000Z | 2021-06-29T18:02:06.000Z | # badges.py
#
# Application responds to users in the scene and updates the user avatar with name and badge updates.
from gstable import GoogleSheetTable
DFT_CONFIG_FILENAME = './config.yaml'
ACTUSERS = {} # actual users by camera id
config = {}
data = []
# parse args and config
init_args()
# establish shared ... | 36.825397 | 113 | 0.553125 | # badges.py
#
# Application responds to users in the scene and updates the user avatar with name and badge updates.
import argparse
import yaml
from arena import *
from gstable import GoogleSheetTable
DFT_CONFIG_FILENAME = './config.yaml'
ACTUSERS = {} # actual users by camera id
config = {}
data = []
def init_ar... | 0 | 0 | 0 | 0 | 0 | 8,298 | 0 | -18 | 182 |
5b24e95bac4721bbeba7a874eba9aebbddb7a81e | 22,159 | py | Python | legit/cli.py | mycozycloud/legit | 8a0d5abaf430bcfb415ad485c692a91a0d2119ec | [
"BSD-3-Clause"
] | 1 | 2015-12-01T10:28:15.000Z | 2015-12-01T10:28:15.000Z | legit/cli.py | mycozycloud/legit | 8a0d5abaf430bcfb415ad485c692a91a0d2119ec | [
"BSD-3-Clause"
] | null | null | null | legit/cli.py | mycozycloud/legit | 8a0d5abaf430bcfb415ad485c692a91a0d2119ec | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
legit.cli
~~~~~~~~~
This module povides the CLI interface to legit.
"""
import os
import sys
from subprocess import call
from time import sleep
import clint.resources
from clint import args
from clint.eng import join as eng_join
from clint.textui import colored, puts, columns
from .core... | 26.633413 | 118 | 0.60296 | # -*- coding: utf-8 -*-
"""
legit.cli
~~~~~~~~~
This module povides the CLI interface to legit.
"""
import os
import sys
from subprocess import call
from time import sleep
import clint.resources
from clint import args
from clint.eng import join as eng_join
from clint.textui import colored, puts, columns
from .core... | 3 | 512 | 0 | 408 | 0 | 1,600 | 0 | -3 | 229 |
d0a7a9fab93499d68229c9a9670fb4673b7d71b9 | 4,508 | py | Python | trafic_monitor/server_bandwidth/serverbwinfo.py | lehoanghoa/system-resources-monitor | e9f92f326b152a25b2b7097d0ae9642e6d52c24d | [
"BSD-3-Clause"
] | null | null | null | trafic_monitor/server_bandwidth/serverbwinfo.py | lehoanghoa/system-resources-monitor | e9f92f326b152a25b2b7097d0ae9642e6d52c24d | [
"BSD-3-Clause"
] | null | null | null | trafic_monitor/server_bandwidth/serverbwinfo.py | lehoanghoa/system-resources-monitor | e9f92f326b152a25b2b7097d0ae9642e6d52c24d | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import sys
import memcache
import time
if __name__ == '__main__':
mc = memcache.Client(['10.30.22.49:11216'], debug=0)
timestamp = int(time.time())
# year = datetime.datetime.now().strftime("%y")
# month = datetime.datetime.now().strftime("%m")
# day = datetime.datetime.now(... | 42.933333 | 153 | 0.566992 | #!/usr/bin/env python
import sys
import netsnmp
import re
import memcache
import datetime
import MySQLdb
import time
def insert_db(server_ip, interface, update_date):
db = MySQLdb.connect(host="10.30.12.110", user="rs_monitor", passwd="QIM1NQ0G3rij", db="resource_monitor")
cur = db.cursor()
query = """REPL... | 0 | 0 | 0 | 0 | 0 | 3,710 | 0 | -32 | 134 |
8200473171315e86cf9de8c108bdf997d0ad4336 | 5,002 | py | Python | nptime.py | jcatw/subtime | 9ac679f7030aa33825e98139b3786f5c0c750470 | [
"MIT"
] | 1 | 2021-02-23T18:05:38.000Z | 2021-02-23T18:05:38.000Z | nptime.py | jcatw/subtime | 9ac679f7030aa33825e98139b3786f5c0c750470 | [
"MIT"
] | null | null | null | nptime.py | jcatw/subtime | 9ac679f7030aa33825e98139b3786f5c0c750470 | [
"MIT"
] | 1 | 2016-02-01T07:33:51.000Z | 2016-02-01T07:33:51.000Z | #!/usr/bin/env python
"""Non-Pedantic Time
=================
.. moduleauthor:: Thomas Grenfell Smith <thomathom@gmail.com>
Python's :mod:`datetime` module has many uses, but it has a difficulty: you
can't do any arithmetic with :class:`datetime.time`. Only with
:class:`datetime.datetime`. Now, there are good reason... | 37.051852 | 82 | 0.677329 | #!/usr/bin/env python
"""Non-Pedantic Time
=================
.. moduleauthor:: Thomas Grenfell Smith <thomathom@gmail.com>
Python's :mod:`datetime` module has many uses, but it has a difficulty: you
can't do any arithmetic with :class:`datetime.time`. Only with
:class:`datetime.datetime`. Now, there are good reason... | 0 | 536 | 0 | 2,170 | 0 | 0 | 0 | 1 | 46 |
012e6ff2e4096516df48feb91883691ca3c04b01 | 2,402 | py | Python | library/get_driver.py | batu1579/NCUT-library-auto-answer | d8b8a37548e3b58b6e030323b116450cc4c3178a | [
"MIT"
] | 1 | 2021-08-12T15:45:06.000Z | 2021-08-12T15:45:06.000Z | library/get_driver.py | batu1579/NCUT-library-auto-answer | d8b8a37548e3b58b6e030323b116450cc4c3178a | [
"MIT"
] | null | null | null | library/get_driver.py | batu1579/NCUT-library-auto-answer | d8b8a37548e3b58b6e030323b116450cc4c3178a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
'''
Author: BATU1579
Date: 2021-08-11 15:20:04
LastEditors: BATU1579
LastEditTime: 2021-08-16 22:33:54
Description: file content
'''
import library.const as g
#
if g.BROWSER == "edge":
# edge
from msedge.selenium_tools import Edge as Driver
from library.webdriver_man... | 26.988764 | 88 | 0.696503 | #!/usr/bin/env python
# coding=utf-8
'''
Author: BATU1579
Date: 2021-08-11 15:20:04
LastEditors: BATU1579
LastEditTime: 2021-08-16 22:33:54
Description: file content
'''
import logging
import library.const as g
from time import sleep
def set_github_token():
if g.GH_TOKEN != "":
# 设置github访问令牌
impo... | 324 | 0 | 0 | 268 | 0 | 658 | 0 | 75 | 188 |
a2516bc95d05407a9066a94b9a0eb3017a0b9dc9 | 1,507 | py | Python | src/util.py | rucm/GameOfLife | c89b555e5e0b3278625ca98fca6e5b3ef3a1218b | [
"MIT"
] | null | null | null | src/util.py | rucm/GameOfLife | c89b555e5e0b3278625ca98fca6e5b3ef3a1218b | [
"MIT"
] | null | null | null | src/util.py | rucm/GameOfLife | c89b555e5e0b3278625ca98fca6e5b3ef3a1218b | [
"MIT"
] | null | null | null | import os
import sys
import glob
from kivy.lang import Builder
def resource_path():
"""
PyInstaller
"""
if hasattr(sys, '_MEIPASS'):
return os.path.join(sys._MEIPASS)
return os.path.join(os.path.dirname(os.path.abspath(__file__)))
def load_style(dir_path):
"""
kv... | 24.306452 | 75 | 0.608494 | import os
import sys
import glob
import re
from kivy.lang import Builder
from kivy.event import EventDispatcher
def resource_path():
"""
PyInstaller対策。
"""
if hasattr(sys, '_MEIPASS'):
return os.path.join(sys._MEIPASS)
return os.path.join(os.path.dirname(os.path.abspath(__fil... | 189 | 0 | 0 | 0 | 0 | 680 | 0 | 5 | 100 |
f1210db225d632bc4264838d79bbf50c705a8bfb | 11,965 | py | Python | tests/user_test.py | bibby/radula | 3f5d248f1a670cd8adb9fbad6f5df000b9e0ef77 | [
"MIT"
] | 16 | 2015-09-08T23:50:56.000Z | 2021-11-15T14:31:41.000Z | tests/user_test.py | bibby/radula | 3f5d248f1a670cd8adb9fbad6f5df000b9e0ef77 | [
"MIT"
] | 14 | 2015-09-09T00:23:25.000Z | 2020-04-13T19:50:03.000Z | tests/user_test.py | bibby/radula | 3f5d248f1a670cd8adb9fbad6f5df000b9e0ef77 | [
"MIT"
] | 9 | 2015-11-02T21:47:13.000Z | 2019-11-13T10:18:10.000Z | import os
TEST_BUCKET = "tests"
here = os.path.dirname(os.path.realpath(__file__))
TEST_FILE = os.path.join(here, "testdata.txt")
REMOTE_FILE = os.path.join(TEST_BUCKET, os.path.basename(TEST_FILE))
PRIMARY_USER = 'test-user'
ALT_USER = 'alt-user'
aws_url = "http://acs.amazonaws.com/groups/global"
aws_auth = aws_url... | 29.987469 | 81 | 0.529043 | import os
import sys
import boto
from nose.tools import assert_in, assert_not_in, raises
from moto import mock_s3
from radula import RadulaProxy, _parse_args, Radula, RadulaError
TEST_BUCKET = "tests"
here = os.path.dirname(os.path.realpath(__file__))
TEST_FILE = os.path.join(here, "testdata.txt")
REMOTE_FILE = os.p... | 0 | 4,302 | 0 | 0 | 6,876 | 0 | 0 | 59 | 341 |
0cfc4a82118b050f98695e3f06958e7fa67805e3 | 10,033 | py | Python | trax/rl/policy_tasks.py | OmarAlsaqa/trax | 2de928fbfc952084fcfebee8dc0b6fc308fa7ad4 | [
"Apache-2.0"
] | null | null | null | trax/rl/policy_tasks.py | OmarAlsaqa/trax | 2de928fbfc952084fcfebee8dc0b6fc308fa7ad4 | [
"Apache-2.0"
] | null | null | null | trax/rl/policy_tasks.py | OmarAlsaqa/trax | 2de928fbfc952084fcfebee8dc0b6fc308fa7ad4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2021 The Trax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 38.737452 | 80 | 0.708661 | # coding=utf-8
# Copyright 2021 The Trax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 0 | 1,256 | 0 | 7,460 | 0 | 0 | 0 | 49 | 158 |
4a85eb6c8af532bd1cd1d89406418ddd3d548cf2 | 2,369 | py | Python | Bitcoin/BitcoinPricesAnalyzer.py | shankarganesh1234/MLProjects | 7a9273f0f0d43994dfdee6dc44214f0dd2d92352 | [
"MIT"
] | null | null | null | Bitcoin/BitcoinPricesAnalyzer.py | shankarganesh1234/MLProjects | 7a9273f0f0d43994dfdee6dc44214f0dd2d92352 | [
"MIT"
] | null | null | null | Bitcoin/BitcoinPricesAnalyzer.py | shankarganesh1234/MLProjects | 7a9273f0f0d43994dfdee6dc44214f0dd2d92352 | [
"MIT"
] | null | null | null | import datetime as dt
import BitcoinNewsProcessor as bitcoin_news
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import Imputer
# read data
path = "/Users/shankarganesh/files/bitcoin/bitcoin_dataset.csv"
data = pd.read_csv(path, parse_dates=["Date"])
# get the new... | 36.446154 | 103 | 0.769101 | import datetime as dt
import BitcoinNewsProcessor as bitcoin_news
import pandas as pd
from matplotlib import pyplot as plt
from sklearn import linear_model
from sklearn.metrics import mean_absolute_error, explained_variance_score
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import Im... | 0 | 0 | 0 | 0 | 0 | 497 | 0 | 78 | 89 |
a66ee7f929306619db7387d9118056d4fa383382 | 2,303 | py | Python | house_prices/tensorflow/predict.py | pallogu/kaggle_competitions | 4389e4cdfb1fb491f37852abff5bced371505d4a | [
"MIT"
] | null | null | null | house_prices/tensorflow/predict.py | pallogu/kaggle_competitions | 4389e4cdfb1fb491f37852abff5bced371505d4a | [
"MIT"
] | null | null | null | house_prices/tensorflow/predict.py | pallogu/kaggle_competitions | 4389e4cdfb1fb491f37852abff5bced371505d4a | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
import os
import csv
from tensorflow.python.framework import ops
import warnings
from sklearn.model_selection import train_test_split
import loadCleanup
warnings.filterwarnings("ignore")
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
ops.reset_default_graph()
tf.flags.DEFINE_bo... | 37.754098 | 108 | 0.715588 | import tensorflow as tf
import numpy as np
import os
import csv
from tensorflow.python.framework import ops
import warnings
from sklearn.model_selection import train_test_split
import loadCleanup
warnings.filterwarnings("ignore")
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
ops.reset_default_graph()
tf.flags.DEFINE_bo... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fe78c2a6691c843604c6b86447a8efb489bdc1df | 1,787 | py | Python | myscripts/tropopause/ridge_trough_pdf.py | LSaffin/scripts | 100fc442229ea11f8766a6d78b4db8790c607326 | [
"MIT"
] | 1 | 2020-03-16T13:54:28.000Z | 2020-03-16T13:54:28.000Z | myscripts/tropopause/ridge_trough_pdf.py | LSaffin/scripts | 100fc442229ea11f8766a6d78b4db8790c607326 | [
"MIT"
] | null | null | null | myscripts/tropopause/ridge_trough_pdf.py | LSaffin/scripts | 100fc442229ea11f8766a6d78b4db8790c607326 | [
"MIT"
] | 1 | 2021-01-16T04:54:53.000Z | 2021-01-16T04:54:53.000Z | from datetime import timedelta as dt
import numpy as np
import matplotlib.pyplot as plt
from irise import convert, grid
from irise.diagnostics import rossby_waves
from myscripts.models.um import case_studies
def main(cubes, xbins, ybins, xlabel, ylabel, **kwargs):
"""
"""
# Load variables
thetapv2 = c... | 30.810345 | 77 | 0.663123 | from datetime import timedelta as dt
import numpy as np
import matplotlib.pyplot as plt
from irise import convert, grid
from irise.diagnostics import rossby_waves
from myscripts.models.um import case_studies
def main(cubes, xbins, ybins, xlabel, ylabel, **kwargs):
"""
"""
# Load variables
thetapv2 = c... | 0 | 0 | 0 | 0 | 0 | 408 | 0 | 0 | 46 |
04efc7458bcf26c3c83635e1145b7e8a3492fdc2 | 432 | py | Python | Forming a Magic Square.py | adi-797/Algorithms-Hackerrank | 660694c722c2e2e136e1bc1009482a1699dc5759 | [
"MIT"
] | 2 | 2018-08-31T16:58:57.000Z | 2018-08-31T17:03:50.000Z | Forming a Magic Square.py | adi-797/Algorithms-Hackerrank | 660694c722c2e2e136e1bc1009482a1699dc5759 | [
"MIT"
] | null | null | null | Forming a Magic Square.py | adi-797/Algorithms-Hackerrank | 660694c722c2e2e136e1bc1009482a1699dc5759 | [
"MIT"
] | null | null | null |
X = []
X.extend(list(map(int,input().split())))
X.extend(list(map(int,input().split())))
X.extend(list(map(int,input().split())))
Ans = 81
for P in permutations(range(1,10)):
if sum(P[0:3]) == 15 and sum(P[3:6]) == 15 and sum(P[0::3]) == 15 and sum(P[1::3]) == 15 and P[0] + P[4] + P[8] == 15 and (P[2] + P[4] + P[... | 33.230769 | 153 | 0.548611 | from itertools import *
X = []
X.extend(list(map(int,input().split())))
X.extend(list(map(int,input().split())))
X.extend(list(map(int,input().split())))
Ans = 81
for P in permutations(range(1,10)):
if sum(P[0:3]) == 15 and sum(P[3:6]) == 15 and sum(P[0::3]) == 15 and sum(P[1::3]) == 15 and P[0] + P[4] + P[8] == ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 22 |
293f85974fbfe09092b414855c3687a685e5e88a | 7,409 | py | Python | internal/notes/builtin-SAVE/packages/git/package.py | HPCToolkit/hpctest | 5ff4455582bf39e75530a31badcf6142081b386b | [
"BSD-3-Clause"
] | 1 | 2019-01-17T20:07:19.000Z | 2019-01-17T20:07:19.000Z | internal/notes/builtin-SAVE/packages/git/package.py | HPCToolkit/hpctest | 5ff4455582bf39e75530a31badcf6142081b386b | [
"BSD-3-Clause"
] | null | null | null | internal/notes/builtin-SAVE/packages/git/package.py | HPCToolkit/hpctest | 5ff4455582bf39e75530a31badcf6142081b386b | [
"BSD-3-Clause"
] | 2 | 2019-08-06T18:13:57.000Z | 2021-11-05T18:19:49.000Z | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | 36.678218 | 93 | 0.578621 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | 0 | 556 | 0 | 5,522 | 0 | 0 | 0 | 6 | 89 |
d3b468c863340c2a3985524cb649f540f305da8d | 1,768 | py | Python | vcf/filter-vcf-gnomAD+InDel.py | taejoonlab/CINDELA-toolbox | c57e3c99bfeb81aa3ace0a00fbb1dca4095bab49 | [
"Apache-2.0"
] | 1 | 2022-03-23T02:52:47.000Z | 2022-03-23T02:52:47.000Z | vcf/filter-vcf-gnomAD+InDel.py | taejoonlab/CINDELA-toolbox | c57e3c99bfeb81aa3ace0a00fbb1dca4095bab49 | [
"Apache-2.0"
] | null | null | null | vcf/filter-vcf-gnomAD+InDel.py | taejoonlab/CINDELA-toolbox | c57e3c99bfeb81aa3ace0a00fbb1dca4095bab49 | [
"Apache-2.0"
] | 2 | 2022-02-28T14:29:08.000Z | 2022-03-23T02:52:50.000Z | #!/usr/bin/env python3
import os
import gzip
import sys
filename_vcf = sys.argv[1]
gnomAD_list = dict()
dirname_gnomAD = os.path.join(os.path.dirname(os.path.realpath(__file__)),
'..', 'data')
for tmp_filename in os.listdir(dirname_gnomAD):
if not tmp_filename.endswith('vcf.gz'):
... | 28.516129 | 79 | 0.625 | #!/usr/bin/env python3
import os
import gzip
import sys
filename_vcf = sys.argv[1]
gnomAD_list = dict()
dirname_gnomAD = os.path.join(os.path.dirname(os.path.realpath(__file__)),
'..', 'data')
for tmp_filename in os.listdir(dirname_gnomAD):
if not tmp_filename.endswith('vcf.gz'):
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c39f576dd12774b1f0f1098699862c1ef5efd31c | 621 | py | Python | 2017/day04.py | kyz/adventofcode | b3dd544624a8fc313ca1fad0d2f02f53bd79ce3d | [
"MIT"
] | null | null | null | 2017/day04.py | kyz/adventofcode | b3dd544624a8fc313ca1fad0d2f02f53bd79ce3d | [
"MIT"
] | null | null | null | 2017/day04.py | kyz/adventofcode | b3dd544624a8fc313ca1fad0d2f02f53bd79ce3d | [
"MIT"
] | null | null | null |
with open("day04.txt") as f:
data = [line for line in f]
identity = lambda s: s
anagram = lambda s: "".join(sorted(s))
print("2017 day 4 part 1: %d" % count_good_passwords(data, identity))
print("2017 day 4 part 2: %d" % count_good_passwords(data, anagram))
| 32.684211 | 76 | 0.647343 | def count_good_passwords(passwords, transform):
return sum([1 if good_password(p, transform) else 0 for p in passwords])
def good_password(password, transform=None):
seen = set()
for word in password.split():
word = transform(word)
if word in seen:
return False
seen.add(... | 0 | 0 | 0 | 0 | 0 | 297 | 0 | 0 | 45 |
2b61197ecd52523417ae8ac8e81d3a201e2cc0e9 | 2,973 | py | Python | flask_cc_api/app.py | suAdminWen/cc-api | a00d9b82583fae57a3cd92ec0478d434f141f172 | [
"MIT"
] | 6 | 2019-03-04T03:08:07.000Z | 2019-07-16T13:43:12.000Z | flask_cc_api/app.py | suAdminWen/cc-api | a00d9b82583fae57a3cd92ec0478d434f141f172 | [
"MIT"
] | 1 | 2021-11-22T15:02:09.000Z | 2021-11-22T15:02:09.000Z | flask_cc_api/app.py | suAdminWen/cc-api | a00d9b82583fae57a3cd92ec0478d434f141f172 | [
"MIT"
] | 1 | 2019-07-01T01:01:27.000Z | 2019-07-01T01:01:27.000Z | import os
_default_instance_path = '%(instance_path)s/instance' % \
{'instance_path': os.path.dirname(os.path.realpath(__file__))}
| 25.62931 | 94 | 0.705684 | import os
from flask import Flask, got_request_exception
from flask_jwt_extended.exceptions import JWTExtendedException
from jwt.exceptions import PyJWTError
from werkzeug.exceptions import HTTPException
from sqlalchemy.exc import OperationalError
from .apis import urls
from .config.celery_config import CeleryConfig
... | 0 | 0 | 0 | 177 | 0 | 1,841 | 0 | 364 | 427 |
8c4fa6b54bc174987598510143da6dbc727f1b1b | 226 | py | Python | setup.py | Filippo125/k8s-deploy-external-dns | b83c74c7e00c9566088a232ce0c5da98b23f8198 | [
"MIT"
] | null | null | null | setup.py | Filippo125/k8s-deploy-external-dns | b83c74c7e00c9566088a232ce0c5da98b23f8198 | [
"MIT"
] | null | null | null | setup.py | Filippo125/k8s-deploy-external-dns | b83c74c7e00c9566088a232ce0c5da98b23f8198 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name='k8s-deploy-external-dns',
version='1.0.0',
packages=['provider'],
url='',
license='',
author='Filippo Ferrazini',
author_email='filippo.ferrazini@gmail.com',
description=''
)
| 17.384615 | 44 | 0.70354 | from setuptools import setup
setup(
name='k8s-deploy-external-dns',
version='1.0.0',
packages=['provider'],
url='',
license='',
author='Filippo Ferrazini',
author_email='filippo.ferrazini@gmail.com',
description=''
)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
461171ab862215c08d538c44cd65be4e041ebf5b | 209 | py | Python | PythonExercicios/ex097.py | cedricgenaro/Python | 2ba952b42a9c49efaeb064e230db8d4426cd5ca8 | [
"MIT"
] | null | null | null | PythonExercicios/ex097.py | cedricgenaro/Python | 2ba952b42a9c49efaeb064e230db8d4426cd5ca8 | [
"MIT"
] | null | null | null | PythonExercicios/ex097.py | cedricgenaro/Python | 2ba952b42a9c49efaeb064e230db8d4426cd5ca8 | [
"MIT"
] | null | null | null |
#Programa Principal
escreva('Gustavo Guanabar')
escreva('Curso de Python no YouTube')
escreva('CeV') | 19 | 37 | 0.62201 | def escreva(text):
tam = len(text)+4
print('~' * tam)
print(f' {text}')
print('~' * tam)
#Programa Principal
escreva('Gustavo Guanabará')
escreva('Curso de Python no YouTube')
escreva('CeV') | 2 | 0 | 0 | 0 | 0 | 84 | 0 | 0 | 22 |
8ee341c7ba93d62e611021658c3c6b2a85f2f2ad | 2,006 | py | Python | application/reg.py | RB387/GorbInDocks | e7a76eeae5e2bb781f5465fcbb67ed99dba7bafe | [
"Unlicense"
] | null | null | null | application/reg.py | RB387/GorbInDocks | e7a76eeae5e2bb781f5465fcbb67ed99dba7bafe | [
"Unlicense"
] | 1 | 2019-10-29T17:24:53.000Z | 2019-10-29T17:25:52.000Z | application/reg.py | RB387/GorbInDocks | e7a76eeae5e2bb781f5465fcbb67ed99dba7bafe | [
"Unlicense"
] | 1 | 2019-10-19T12:33:01.000Z | 2019-10-19T12:33:01.000Z | from flask import Blueprint
page = Blueprint('reg', __name__,
template_folder='templates')
| 35.192982 | 92 | 0.683948 | from application import app
from application import decorators
from flask import Blueprint, render_template
from flask import request, session, redirect, url_for
from run import gt
from config import BOT_TOKEN
from push_notifications import notification
import gorbin_tools2
page = Blueprint('reg', __name__,
... | 0 | 1,621 | 0 | 0 | 0 | 0 | 0 | 93 | 177 |
2cf05109d5cdb588c5f43f4adf0fe63fb4214a91 | 337 | py | Python | generators.py | daviddamilola/python-initial-gra-gra | 9978bfda18f12c87601b110f297da2cb13872d27 | [
"MIT"
] | 1 | 2019-11-07T21:30:21.000Z | 2019-11-07T21:30:21.000Z | generators.py | daviddamilola/python-initial-gra-gra | 9978bfda18f12c87601b110f297da2cb13872d27 | [
"MIT"
] | 2 | 2021-04-06T18:19:09.000Z | 2021-06-02T03:27:18.000Z | generators.py | daviddamilola/python-initial-gra-gra | 9978bfda18f12c87601b110f297da2cb13872d27 | [
"MIT"
] | null | null | null | #A generator is a programming object that produces (that is, generates) a sequence of values
if __name__ == '__main__':
main() | 22.466667 | 92 | 0.611276 | #A generator is a programming object that produces (that is, generates) a sequence of values
def generate_multiples(m, n):
count = 0
while count < n :
yield m * count
count += 1
def main():
for mult in generate_multiples(3, 6):
print(mult, end=' ')
print()
if __name__ == '__ma... | 0 | 0 | 0 | 0 | 87 | 73 | 0 | 0 | 46 |
8ca74d38e3f43575457a1a4fc366c79e05e230c2 | 1,158 | py | Python | builder/minisetting.py | d12y12/DocGenerator | 9e9db94fd80c3099b4c847328b3a0fb33c0159e1 | [
"MIT"
] | null | null | null | builder/minisetting.py | d12y12/DocGenerator | 9e9db94fd80c3099b4c847328b3a0fb33c0159e1 | [
"MIT"
] | null | null | null | builder/minisetting.py | d12y12/DocGenerator | 9e9db94fd80c3099b4c847328b3a0fb33c0159e1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
| 31.297297 | 88 | 0.585492 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from os.path import join, dirname, abspath
class Setting:
def __init__(self):
self.attribute = {
"CMD": abspath(join(dirname(dirname(abspath(__file__))), "docbuilder.py")),
"VERSION": join(dirname(dirname(abspath(__file__))), "VERSION... | 0 | 0 | 0 | 1,043 | 0 | 0 | 0 | 21 | 46 |
f66e254413e77da7985a605ab9983934c2652e01 | 3,859 | py | Python | crash_course/ch13/exec/stars.py | dantin/python-by-example | 5769c7a332ebd60fd54e477b6813f2f2a0f3f37f | [
"BSD-3-Clause"
] | null | null | null | crash_course/ch13/exec/stars.py | dantin/python-by-example | 5769c7a332ebd60fd54e477b6813f2f2a0f3f37f | [
"BSD-3-Clause"
] | null | null | null | crash_course/ch13/exec/stars.py | dantin/python-by-example | 5769c7a332ebd60fd54e477b6813f2f2a0f3f37f | [
"BSD-3-Clause"
] | null | null | null |
import pygame
import sys
from pygame.sprite import Group
def check_keydown_events(event, settings, screen):
"""Respond to key presses."""
if event.key == pygame.K_q:
sys.exit()
def check_keyup_events(event):
"""Respond to key releases."""
pass
def check_events(settings, screen):
""... | 28.798507 | 73 | 0.664939 |
import pygame
import sys
from pygame.sprite import Group
from pygame.sprite import Sprite
class Settings():
"""A class that stores all settings."""
def __init__(self):
"""Initialize the game's settings."""
# Screen settings
self.screen_width = 1200
self.screen_height = 800
... | 0 | 0 | 0 | 901 | 0 | 0 | 0 | 11 | 68 |
1e41eae05c698b105ef493b49cca2dea4fd5f0ca | 649 | py | Python | gpu_label_start.py | Ruilkyu/kubernetes_start | 9e88a7f1c64899454af8f9be1dd9653ba435e21f | [
"Apache-2.0"
] | 2 | 2020-07-24T14:19:57.000Z | 2020-08-10T18:30:08.000Z | gpu_label_start.py | Ruilkyu/kubernetes_start | 9e88a7f1c64899454af8f9be1dd9653ba435e21f | [
"Apache-2.0"
] | null | null | null | gpu_label_start.py | Ruilkyu/kubernetes_start | 9e88a7f1c64899454af8f9be1dd9653ba435e21f | [
"Apache-2.0"
] | 1 | 2021-07-09T10:29:11.000Z | 2021-07-09T10:29:11.000Z | """
2020/9/22
lurui
k8sGPU
"""
import os
import sys
basedir = os.path.abspath('.')
a = sys.argv[1]
b = sys.argv[2]
start_label_gpu(a, b)
| 23.178571 | 119 | 0.548536 | """
时间:2020/9/22
作者:lurui
功能:k8s集群GPU节点打标签
"""
import os
import sys
basedir = os.path.abspath('.')
def start_label_gpu(k, v):
nodes_name = basedir + '/cfg/nodes.txt'
nodes = open(nodes_name, mode="r", encoding='utf-8')
for i in nodes.readlines():
a = i.strip('\n').split('.')
try:
... | 48 | 0 | 0 | 0 | 0 | 469 | 0 | 0 | 23 |
cd9f98d9d08fbc57ec77d4c67169791536eb23b8 | 198 | py | Python | src/tsgettoolbox/ulmo/usgs/eddn/__init__.py | timcera/tsgettoolbox | 828306aefaa097a74abd8e71605bd19eeda29058 | [
"BSD-3-Clause"
] | 4 | 2017-11-21T20:22:47.000Z | 2021-09-27T13:27:05.000Z | src/tsgettoolbox/ulmo/usgs/eddn/__init__.py | timcera/tsgettoolbox | 828306aefaa097a74abd8e71605bd19eeda29058 | [
"BSD-3-Clause"
] | 21 | 2016-04-28T16:52:18.000Z | 2021-12-16T17:00:27.000Z | src/tsgettoolbox/ulmo/usgs/eddn/__init__.py | timcera/tsgettoolbox | 828306aefaa097a74abd8e71605bd19eeda29058 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
`USGS Emergency Data Distribution Network`_ services
.. _USGS Emergency Data Distribution Network: http://eddn.usgs.gov/
"""
| 22 | 71 | 0.681818 | # -*- coding: utf-8 -*-
"""
`USGS Emergency Data Distribution Network`_ services
.. _USGS Emergency Data Distribution Network: http://eddn.usgs.gov/
"""
from .core import decode, get_data
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 13 | 22 |
ce9a1d77d810583c0061ab865254759e04e3abf2 | 2,052 | py | Python | efls-data/deploy/network/grpc_ingress_test.py | universe-hcy/Elastic-Federated-Learning-Solution | 4e047fbbe6ae9809cd631499b7d3a3855dfe2208 | [
"Apache-2.0"
] | 65 | 2021-09-30T01:54:34.000Z | 2022-03-26T13:57:15.000Z | efls-data/deploy/network/grpc_ingress_test.py | universe-hcy/Elastic-Federated-Learning-Solution | 4e047fbbe6ae9809cd631499b7d3a3855dfe2208 | [
"Apache-2.0"
] | 24 | 2021-09-30T09:25:43.000Z | 2022-03-29T06:33:44.000Z | efls-data/deploy/network/grpc_ingress_test.py | universe-hcy/Elastic-Federated-Learning-Solution | 4e047fbbe6ae9809cd631499b7d3a3855dfe2208 | [
"Apache-2.0"
] | 18 | 2021-09-30T09:04:08.000Z | 2022-03-31T10:17:27.000Z | from __future__ import print_function
import argparse
import json
service_config_json = json.dumps({
"methodConfig": [{
"name": [{
"service": "helloworld.Greeter",
"method": "SayHello"
}],
"retryPolicy": {
"maxAttempts": 5,
"initialBackoff": ... | 32.0625 | 90 | 0.617934 | from __future__ import print_function
import argparse
import time
import json
import grpc
import helloworld_pb2
import helloworld_pb2_grpc
service_config_json = json.dumps({
"methodConfig": [{
"name": [{
"service": "helloworld.Greeter",
"method": "SayHello"
}],
"re... | 0 | 0 | 0 | 0 | 0 | 977 | 0 | -15 | 112 |
5037fd7e01010f6788da82654e4ab87623d668dc | 50 | py | Python | adfly/__init__.py | fulcanelly/adfly-api | 26cee094822dbe9050eeeb99e63added94f9ca9f | [
"MIT"
] | 4 | 2020-12-07T22:26:56.000Z | 2021-10-23T00:35:53.000Z | adfly/__init__.py | fulcanelly/adfly-api | 26cee094822dbe9050eeeb99e63added94f9ca9f | [
"MIT"
] | 2 | 2022-01-06T15:59:17.000Z | 2022-01-09T17:51:30.000Z | adfly/__init__.py | fulcanelly/adfly-api | 26cee094822dbe9050eeeb99e63added94f9ca9f | [
"MIT"
] | 2 | 2021-03-24T01:28:26.000Z | 2022-01-06T16:09:40.000Z | from .api import AdflyApi
__all__ = ['AdflyApi']
| 12.5 | 25 | 0.72 | from .api import AdflyApi
__all__ = ['AdflyApi']
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c7fcd22b33b0552a1a6f399c0084af8c3108b0a6 | 2,637 | py | Python | auth.py | MaksimsVisockis01/-Site_Osta_MV_DK_KI_DP1-1 | 8be88887d8eb0815696d1961ef0a97f47eb1eabd | [
"MIT"
] | null | null | null | auth.py | MaksimsVisockis01/-Site_Osta_MV_DK_KI_DP1-1 | 8be88887d8eb0815696d1961ef0a97f47eb1eabd | [
"MIT"
] | null | null | null | auth.py | MaksimsVisockis01/-Site_Osta_MV_DK_KI_DP1-1 | 8be88887d8eb0815696d1961ef0a97f47eb1eabd | [
"MIT"
] | null | null | null |
### LOGIN ###
### LOGIN end ###
### REGISTER ###
### REGISTER end ###
| 20.129771 | 96 | 0.506636 | from __main__ import (
app,
session,
redirect,
render_template,
request,
jsonify,
uuid4,
USERS,
)
from json import (
dumps,
) # https://stackoverflow.com/questions/11994325/how-to-divide-flask-app-into-multiple-py-files
### LOGIN ###
@app.route("/login")
def login():
if "user" ... | 0 | 2,187 | 0 | 0 | 0 | 0 | 0 | 118 | 252 |
1fcb29ce051a689e8b1da1db6a53f2202c91ea20 | 1,728 | py | Python | 7-assets/past-student-repos/LambdaSchool-master/m6/62a1/queue/queue.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m6/62a1/queue/queue.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m6/62a1/queue/queue.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | """
A queue is a data structure whose primary purpose is to store and
return elements in First In First Out order.
1. [X] Implement the Queue class using an array as the underlying storage structure.
Make sure the Queue tests pass.
2. [X] Re-implement the Queue class, this time using the linked list implementation
... | 41.142857 | 455 | 0.693287 | """
A queue is a data structure whose primary purpose is to store and
return elements in First In First Out order.
1. [X] Implement the Queue class using an array as the underlying storage structure.
Make sure the Queue tests pass.
2. [X] Re-implement the Queue class, this time using the linked list implementation
... | 0 | 0 | 0 | 390 | 0 | 0 | 0 | 20 | 46 |
8bdaf9e443330d1be5535c174629736a02bf181c | 1,009 | py | Python | Ninja/Leetcode/52_N-Queens_II.py | cyandterry/Python-Study | b40e6c4db10da417e72247f61146f7570621106a | [
"MIT"
] | 61 | 2015-02-03T20:25:55.000Z | 2021-05-17T19:33:40.000Z | Ninja/Leetcode/52_N-Queens_II.py | cyandterry/Python-Study | b40e6c4db10da417e72247f61146f7570621106a | [
"MIT"
] | null | null | null | Ninja/Leetcode/52_N-Queens_II.py | cyandterry/Python-Study | b40e6c4db10da417e72247f61146f7570621106a | [
"MIT"
] | 37 | 2015-02-04T07:12:52.000Z | 2020-05-16T18:47:16.000Z | """
Follow up for N-Queens problem.
Now, instead outputting board configurations, return the total number of distinct solutions.
"""
| 28.828571 | 92 | 0.553023 | """
Follow up for N-Queens problem.
Now, instead outputting board configurations, return the total number of distinct solutions.
"""
class Solution:
# @return an integer
def totalNQueens(self, n):
self.ret = 0
self.totalNQueens_helper(n, [])
return self.ret
def totalNQueens_helper... | 0 | 0 | 0 | 852 | 0 | 0 | 0 | 0 | 23 |
ea7eef11d8266f47e72773c29c0acb7c0a5755e0 | 60,874 | py | Python | tibiapy/bazaar.py | vitorruiz/tibia.py | cc0e4be326138c27004b5081c9bf2054032f0e34 | [
"Apache-2.0"
] | null | null | null | tibiapy/bazaar.py | vitorruiz/tibia.py | cc0e4be326138c27004b5081c9bf2054032f0e34 | [
"Apache-2.0"
] | null | null | null | tibiapy/bazaar.py | vitorruiz/tibia.py | cc0e4be326138c27004b5081c9bf2054032f0e34 | [
"Apache-2.0"
] | null | null | null | """Contains all classes related to the Character Bazaar sections in Tibia.com"""
import logging
import re
__all__ = (
"AchievementEntry",
"Auction",
"AuctionFilters",
"CharacterBazaar",
"CharmEntry",
"BestiaryEntry",
"BlessingEntry",
"DisplayItem",
"DisplayMount",
"DisplayOutfit... | 35.187283 | 120 | 0.614959 | """Contains all classes related to the Character Bazaar sections in Tibia.com"""
import datetime
import logging
import re
import urllib.parse
from typing import Dict, List, Optional
import bs4
from tibiapy import InvalidContent, Sex, Vocation, abc
from tibiapy.abc import BaseCharacter
from tibiapy.enums import (Aucti... | 0 | 21,437 | 0 | 37,489 | 0 | 0 | 0 | 410 | 661 |
9acc6b832455cb06239e05470f0f2deb4e416c73 | 649 | py | Python | aula_17/ex81.py | Matheus-Pontes/Curso-Python-3 | a55f6730112ee58d6b23158d50b9d3051dce4448 | [
"MIT"
] | null | null | null | aula_17/ex81.py | Matheus-Pontes/Curso-Python-3 | a55f6730112ee58d6b23158d50b9d3051dce4448 | [
"MIT"
] | null | null | null | aula_17/ex81.py | Matheus-Pontes/Curso-Python-3 | a55f6730112ee58d6b23158d50b9d3051dce4448 | [
"MIT"
] | null | null | null |
num = list()
pos = 0
while True:
num.append(int(input("Digite um valor: ")))
option = " "
while option not in "SN":
option = str(input("Quer continuar? [S/N]: ")).upper().strip()[0]
if option == "N":
break
print("="*30)
print(f"Voc digitou a seguinte lista {num}")
print(f"Foram digit... | 21.633333 | 73 | 0.557781 |
num = list()
pos = 0
while True:
num.append(int(input("Digite um valor: ")))
option = " "
while option not in "SN":
option = str(input("Quer continuar? [S/N]: ")).upper().strip()[0]
if option == "N":
break
print("="*30)
print(f"Você digitou a seguinte lista {num}")
print(f"Foram digi... | 12 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e12e9626b148792de7e636b74228c5cb296b7d06 | 5,880 | py | Python | myproject/settings.py | iBlackDev/django-project-template | 44de354c560f3a2b22f3c753c1278a2f49aec75e | [
"MIT"
] | null | null | null | myproject/settings.py | iBlackDev/django-project-template | 44de354c560f3a2b22f3c753c1278a2f49aec75e | [
"MIT"
] | null | null | null | myproject/settings.py | iBlackDev/django-project-template | 44de354c560f3a2b22f3c753c1278a2f49aec75e | [
"MIT"
] | null | null | null | """
Django settings for myproject project.
Generated by 'django-admin startproject' using Django 2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
im... | 28 | 85 | 0.654762 | """
Django settings for myproject project.
Generated by 'django-admin startproject' using Django 2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
im... | 24 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c723db5e68044742e79e7b2b263a886a68201121 | 2,931 | py | Python | scripts/postprocess/counterfactual.py | jjbrophy47/tree_influence | 245ff369ed3f4df3ddba243c7e3172423f385505 | [
"Apache-2.0"
] | null | null | null | scripts/postprocess/counterfactual.py | jjbrophy47/tree_influence | 245ff369ed3f4df3ddba243c7e3172423f385505 | [
"Apache-2.0"
] | null | null | null | scripts/postprocess/counterfactual.py | jjbrophy47/tree_influence | 245ff369ed3f4df3ddba243c7e3172423f385505 | [
"Apache-2.0"
] | null | null | null | """
Evaluate min. no. train examples to edit to flip test prediction.
"""
import os
import sys
here = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, here + '/../')
from config import post_args
if __name__ == '__main__':
main(post_args.get_counterfactual_args().parse_args())
| 29.606061 | 100 | 0.633231 | """
Evaluate min. no. train examples to edit to flip test prediction.
"""
import os
import sys
import time
import hashlib
import argparse
import resource
from datetime import datetime
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from scipy.stats import sem
from sklearn.metrics import log_lo... | 0 | 0 | 0 | 0 | 0 | 2,305 | 0 | 16 | 311 |
673349708e69589dca1a2433eb9dd83be423fb39 | 3,105 | py | Python | run_create_sqs.py | HardBoiledSmith/johanna | 0443a9040f0248f0a800c9d4b062e375f997bb6f | [
"MIT"
] | 64 | 2016-11-03T11:20:25.000Z | 2021-05-24T03:08:57.000Z | run_create_sqs.py | HardBoiledSmith/johanna | 0443a9040f0248f0a800c9d4b062e375f997bb6f | [
"MIT"
] | 69 | 2016-11-03T14:09:35.000Z | 2022-02-07T12:52:05.000Z | run_create_sqs.py | HardBoiledSmith/johanna | 0443a9040f0248f0a800c9d4b062e375f997bb6f | [
"MIT"
] | 19 | 2016-11-03T11:04:51.000Z | 2020-06-12T10:40:57.000Z | #!/usr/bin/env python3
from env import env
from run_common import print_session
options, args = dict(), list()
if __name__ == "__main__":
from run_common import parse_args
options, args = parse_args()
################################################################################
#
# start
#
###########... | 29.018692 | 85 | 0.609018 | #!/usr/bin/env python3
import json
import time
from env import env
from run_common import AWSCli
from run_common import print_message
from run_common import print_session
options, args = dict(), list()
if __name__ == "__main__":
from run_common import parse_args
options, args = parse_args()
def run_create... | 0 | 0 | 0 | 0 | 0 | 2,018 | 0 | 3 | 111 |
9c776bf4a18f41ddacb95d8d9ad98e2307bf1add | 852 | py | Python | starboost_up/line_searchers.py | NogaMudrik/starboost | 3ba139b3c4a193bda32c860ad019c263ef3c8a3f | [
"MIT"
] | 22 | 2018-12-01T10:20:41.000Z | 2022-01-02T01:29:31.000Z | starboost_up/line_searchers.py | NogaMudrik/starboost | 3ba139b3c4a193bda32c860ad019c263ef3c8a3f | [
"MIT"
] | 1 | 2021-09-21T03:45:56.000Z | 2021-09-21T10:52:55.000Z | starboost_up/line_searchers.py | NogaMudrik/starboost | 3ba139b3c4a193bda32c860ad019c263ef3c8a3f | [
"MIT"
] | 9 | 2019-02-06T18:56:36.000Z | 2022-01-02T01:29:58.000Z |
__all__ = ['LeafLineSearcher']
| 20.780488 | 94 | 0.634977 | import abc
import numpy as np
__all__ = ['LeafLineSearcher']
class LineSearcher(abc.ABC):
@abc.abstractmethod
def fit(self, y_true, y_pred, gradient, direction):
pass
@abc.abstractmethod
def update(self, direction):
pass
class LeafLineSearcher(LineSearcher):
def __init__(se... | 0 | 111 | 0 | 575 | 0 | 0 | 0 | -14 | 145 |
43d84b2a5867b9924f3397a506987d8ee53174b1 | 5,411 | py | Python | tests/test_max_count.py | writerai/replaCy | 00a5ff923ebc876165805b267ae8a69d7fdc6405 | [
"MIT"
] | 18 | 2021-11-09T04:19:46.000Z | 2022-03-16T11:18:04.000Z | tests/test_max_count.py | weisisheng/replaCy | 00a5ff923ebc876165805b267ae8a69d7fdc6405 | [
"MIT"
] | 69 | 2020-02-27T19:37:07.000Z | 2021-07-02T17:19:50.000Z | tests/test_max_count.py | weisisheng/replaCy | 00a5ff923ebc876165805b267ae8a69d7fdc6405 | [
"MIT"
] | 4 | 2020-06-11T23:54:26.000Z | 2021-03-18T21:29:59.000Z | import spacy
from replacy import ReplaceMatcher
nlp = spacy.load("en_core_web_sm")
# They read us the stories they themselves had written.
match_dict = {
"match-1": {
"patterns": [[
{"LOWER": {"IN": ["they", "she"]}},
{"LEMMA": "read", "TEMPLATE_ID": 1},
{"LOWER": "us... | 29.895028 | 83 | 0.576973 | import pytest
import spacy
from replacy import ReplaceMatcher
nlp = spacy.load("en_core_web_sm")
# They read us the stories they themselves had written.
match_dict = {
"match-1": {
"patterns": [[
{"LOWER": {"IN": ["they", "she"]}},
{"LEMMA": "read", "TEMPLATE_ID": 1},
... | 0 | 0 | 0 | 0 | 0 | 1,428 | 0 | -8 | 114 |
fc89fbbde6018de372f3bc875a96d91d65f826c6 | 2,847 | py | Python | exfi/find_exons.py | jlanga/exfi | 6cd28423213aba0ab8ac191e002396ddc84c4be3 | [
"MIT"
] | 2 | 2017-11-02T11:31:41.000Z | 2020-11-28T07:42:27.000Z | exfi/find_exons.py | jlanga/exfi | 6cd28423213aba0ab8ac191e002396ddc84c4be3 | [
"MIT"
] | 36 | 2017-04-26T09:36:54.000Z | 2021-04-16T12:35:52.000Z | exfi/find_exons.py | jlanga/exon_finder | 6cd28423213aba0ab8ac191e002396ddc84c4be3 | [
"MIT"
] | 2 | 2017-07-23T23:03:36.000Z | 2017-09-29T15:30:55.000Z | #!/usr/bin/env python3
"""
Module to compute positive exons in the bloom filter as follos:
- abyss-bloom kmers to get bed coordinates of each transcriptomic kmer in the BF
- bedtools merge to join overlapping consecutive intervals by k-1bases
- awk to throw away too short intervales (to avoid FPs)
- bedtools merge to ... | 30.287234 | 81 | 0.653319 | #!/usr/bin/env python3
"""
Module to compute positive exons in the bloom filter as follos:
- abyss-bloom kmers to get bed coordinates of each transcriptomic kmer in the BF
- bedtools merge to join overlapping consecutive intervals by k-1bases
- awk to throw away too short intervales (to avoid FPs)
- bedtools merge to ... | 0 | 0 | 0 | 0 | 500 | 0 | 0 | 0 | 23 |
0a4d1093dfd7fd491c45884c8eaeb237327ffb53 | 6,924 | py | Python | littlelambocoin/consensus/vdf_info_computation.py | Tony4467/littlelambocoin-blockchain | 3d4f2b577cd5a2feb324fca50e0981a728583aee | [
"Apache-2.0"
] | 6 | 2021-07-15T16:52:46.000Z | 2021-09-27T16:57:08.000Z | littlelambocoin/consensus/vdf_info_computation.py | Tony4467/littlelambocoin-blockchain | 3d4f2b577cd5a2feb324fca50e0981a728583aee | [
"Apache-2.0"
] | 6 | 2021-07-27T08:17:34.000Z | 2021-11-30T11:39:19.000Z | littlelambocoin/consensus/vdf_info_computation.py | Tony4467/littlelambocoin-blockchain | 3d4f2b577cd5a2feb324fca50e0981a728583aee | [
"Apache-2.0"
] | 7 | 2021-08-15T15:10:58.000Z | 2021-10-04T16:47:39.000Z | from typing import List, Optional
from littlelambocoin.consensus.block_record import BlockRecord
from littlelambocoin.consensus.blockchain_interface import BlockchainInterface
from littlelambocoin.consensus.constants import ConsensusConstants
from littlelambocoin.types.blockchain_format.classgroup import ClassgroupEle... | 44.670968 | 117 | 0.661034 | from typing import List, Optional
from littlelambocoin.consensus.block_record import BlockRecord
from littlelambocoin.consensus.blockchain_interface import BlockchainInterface
from littlelambocoin.consensus.constants import ConsensusConstants
from littlelambocoin.types.blockchain_format.classgroup import ClassgroupEle... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c507e6adaf03cd522d3dbd03d630d7c0e13c6898 | 5,327 | py | Python | project01/fetch.py | uva-sp2021-cs5010-g6/finalproject | 28de55b5b4f1117e019b2b4462d28357fa264d40 | [
"MIT"
] | 1 | 2021-12-03T13:09:05.000Z | 2021-12-03T13:09:05.000Z | project01/fetch.py | uva-sp2021-cs5010-g6/finalproject | 28de55b5b4f1117e019b2b4462d28357fa264d40 | [
"MIT"
] | null | null | null | project01/fetch.py | uva-sp2021-cs5010-g6/finalproject | 28de55b5b4f1117e019b2b4462d28357fa264d40 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Data fetching utility for USDA datasets.
This module provides the primary support functions for downloading datasets from
a text file. Each line in the text file is expected to be a complete URL. Lines
that begin with '#' are ignored.
Example:
This module can be run directly with th... | 37.251748 | 103 | 0.568425 | # -*- coding: utf-8 -*-
"""Data fetching utility for USDA datasets.
This module provides the primary support functions for downloading datasets from
a text file. Each line in the text file is expected to be a complete URL. Lines
that begin with '#' are ignored.
Example:
This module can be run directly with th... | 0 | 457 | 0 | 3,398 | 0 | 74 | 0 | -42 | 158 |
8ff7ad33d527b024371f2a14d237166846f79aee | 1,880 | py | Python | doc/examples/constrainedtutorial.py | sroet/regreg | 299ff18b8680872d4d85447953793bf438f78bba | [
"BSD-3-Clause"
] | 11 | 2016-02-25T01:53:03.000Z | 2020-11-30T00:59:46.000Z | doc/examples/constrainedtutorial.py | sroet/regreg | 299ff18b8680872d4d85447953793bf438f78bba | [
"BSD-3-Clause"
] | 21 | 2015-09-17T19:18:09.000Z | 2021-04-28T06:15:02.000Z | doc/examples/constrainedtutorial.py | sroet/regreg | 299ff18b8680872d4d85447953793bf438f78bba | [
"BSD-3-Clause"
] | 8 | 2016-03-24T00:03:03.000Z | 2019-08-25T23:40:42.000Z | import numpy as np
import pylab
from scipy import sparse
import regreg.api as rr
Y = np.random.standard_normal(500); Y[100:150] += 7; Y[250:300] += 14
loss = rr.quadratic.shift(-Y, coef=0.5)
sparsity = rr.l1norm(len(Y), 1.4)
# TODO should make a module to compute typical Ds
D = sparse.csr_matrix((np.identity(500) +... | 39.166667 | 97 | 0.778723 | import numpy as np
import pylab
from scipy import sparse
import regreg.api as rr
Y = np.random.standard_normal(500); Y[100:150] += 7; Y[250:300] += 14
loss = rr.quadratic.shift(-Y, coef=0.5)
sparsity = rr.l1norm(len(Y), 1.4)
# TODO should make a module to compute typical Ds
D = sparse.csr_matrix((np.identity(500) +... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
da62af548f22f44a721cd325cc6da0ebf80d1858 | 1,034 | py | Python | inject_version.py | Open-Security-Tools/security_model_tw_plugin | 86ec04bf161ce0484362786bdc7e9ea0c5c3785e | [
"MIT"
] | 1 | 2022-03-07T11:03:48.000Z | 2022-03-07T11:03:48.000Z | inject_version.py | paulopensecuritytools/security_model_tw_plugin | aea955880afb8cbebf06f1c6a2132200a1accda9 | [
"MIT"
] | 4 | 2022-03-13T20:40:12.000Z | 2022-03-13T21:02:27.000Z | inject_version.py | paulopensecuritytools/security_model_tw_plugin | aea955880afb8cbebf06f1c6a2132200a1accda9 | [
"MIT"
] | 2 | 2022-03-07T10:56:55.000Z | 2022-03-07T18:49:32.000Z | #!/usr/bin/env python
TID_FILE = "src/tiddlers/system/plugins/security_tools/twsm.tid"
VERSION_FILE = "VERSION"
if __name__ == "__main__":
main() | 29.542857 | 96 | 0.583172 | #!/usr/bin/env python
import os
import subprocess
TID_FILE = "src/tiddlers/system/plugins/security_tools/twsm.tid"
VERSION_FILE = "VERSION"
def get_commit_count():
return int(subprocess.check_output(["git", "rev-list", "--count", "HEAD"]).decode('utf-8'))
def main():
with open(VERSION_FILE, "r") as f:
... | 0 | 0 | 0 | 0 | 0 | 809 | 0 | -16 | 90 |
478fb4e795e1b6bd9e1b186fa0b56db2798d0412 | 910 | py | Python | OuTimer.py | ouyangjunqiu/ou.py | fe9faf76e5726b61d322a25cad3beacb8a291483 | [
"MIT"
] | null | null | null | OuTimer.py | ouyangjunqiu/ou.py | fe9faf76e5726b61d322a25cad3beacb8a291483 | [
"MIT"
] | null | null | null | OuTimer.py | ouyangjunqiu/ou.py | fe9faf76e5726b61d322a25cad3beacb8a291483 | [
"MIT"
] | null | null | null | # coding=utf-8
"""
@author: oShine <oyjqdlp@126.com>
@link: https://github.com/ouyangjunqiu/ou.py
"""
| 23.947368 | 77 | 0.583516 | # coding=utf-8
"""
@author: oShine <oyjqdlp@126.com>
@link: https://github.com/ouyangjunqiu/ou.py
定时器,每隔一段时间执行一次
"""
import threading
class Timer(threading.Thread):
def __init__(self, interval, function, args=[], kwargs={}):
threading.Thread.__init__(self)
self.interval = interval
self.... | 42 | 0 | 0 | 750 | 0 | 0 | 0 | -5 | 46 |
ec0fa68cf9cc1766bd49b5d29a11fe28e91e8d09 | 158 | py | Python | PartI/Lab_1_1/PY/Factorial.py | DmitrTRC/LabTraining | 9c689e5965d0fbdeacd2e991945c05e4b06c6928 | [
"Apache-2.0"
] | null | null | null | PartI/Lab_1_1/PY/Factorial.py | DmitrTRC/LabTraining | 9c689e5965d0fbdeacd2e991945c05e4b06c6928 | [
"Apache-2.0"
] | 1 | 2021-12-11T16:51:56.000Z | 2021-12-11T16:51:56.000Z | PartI/Lab_1_1/PY/Factorial.py | DmitrTRC/LabTraining | 9c689e5965d0fbdeacd2e991945c05e4b06c6928 | [
"Apache-2.0"
] | 1 | 2021-12-27T15:30:29.000Z | 2021-12-27T15:30:29.000Z |
for n in range(10):
print(n, factorial(n))
| 15.8 | 29 | 0.556962 | def factorial(n):
result = 1
for x in range(1, n + 1):
result = result * x
return result
for n in range(10):
print(n, factorial(n))
| 0 | 0 | 0 | 0 | 0 | 87 | 0 | 0 | 22 |
5e1005b0831231fec5f3422dae56261f92942f04 | 1,686 | py | Python | 09WebFramework/day02/basic01.py | HaoZhang95/PythonAndMachineLearning | b897224b8a0e6a5734f408df8c24846a98c553bf | [
"MIT"
] | 937 | 2019-05-08T08:46:25.000Z | 2022-03-31T12:56:07.000Z | 09WebFramework/day02/basic01.py | Sakura-gh/Python24 | b97e18867264a0647d5645c7d757a0040e755577 | [
"MIT"
] | 47 | 2019-09-17T10:06:02.000Z | 2022-03-11T23:46:52.000Z | 09WebFramework/day02/basic01.py | Sakura-gh/Python24 | b97e18867264a0647d5645c7d757a0040e755577 | [
"MIT"
] | 354 | 2019-05-10T02:15:26.000Z | 2022-03-30T05:52:57.000Z |
if __name__ == '__main__':
main()
| 21.341772 | 77 | 0.576512 | def set_log(log_level):
def super_set_func(func):
def call_func(*args, **kwargs):
log_level_info_dict = {
1: "Warning",
2: "Error"
}
# 根据闭包内存空间的log——level的不同,处理不同业务
print("****Log日志:%s****" % log_level_info_dict[log_level])
... | 1,068 | 286 | 0 | 436 | 0 | 426 | 0 | 0 | 137 |
6355d20d8eeada5c93a95b1bf589b1629cd420ef | 3,128 | py | Python | tests/test_layer.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | tests/test_layer.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | tests/test_layer.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of fionautil.
# http://github.com/fitnr/fionautil
# Licensed under the GPLv3 license:
# http://http://opensource.org/licenses/GPL-3.0
# Copyright (c) 2015, Neil Freeman <contact@fakeisthenewreal.org>
import unittest.main
import os.path
shp = os.path.j... | 33.634409 | 103 | 0.612212 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of fionautil.
# http://github.com/fitnr/fionautil
# Licensed under the GPLv3 license:
# http://http://opensource.org/licenses/GPL-3.0
# Copyright (c) 2015, Neil Freeman <contact@fakeisthenewreal.org>
import collections
from unittest import TestCase as... | 0 | 0 | 0 | 2,511 | 0 | 0 | 0 | 24 | 90 |
ffa2ba8542bbb2f4dda70dc14aadfbd1f8734d95 | 4,466 | py | Python | pdftables/pdftables_analysis.py | pombredanne/pdftables | 3bd927cc2d045de116780267c4b4a5bbc1a17714 | [
"BSD-2-Clause"
] | 2 | 2015-06-15T15:18:04.000Z | 2016-08-12T19:02:46.000Z | pdftables/pdftables_analysis.py | pombredanne/pdftables | 3bd927cc2d045de116780267c4b4a5bbc1a17714 | [
"BSD-2-Clause"
] | null | null | null | pdftables/pdftables_analysis.py | pombredanne/pdftables | 3bd927cc2d045de116780267c4b4a5bbc1a17714 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# ScraperWiki Limited
# Ian Hopkinson, 2013-06-20
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sys
import codecs
sys.stdout = codecs.getwriter('utf-8')(sys.stdout)
"""
Analysis and visualisation library for pdftables
"""
import matplotlib.pyplot as plt
from mpl_toolkit... | 31.673759 | 140 | 0.62584 | #!/usr/bin/env python
# ScraperWiki Limited
# Ian Hopkinson, 2013-06-20
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sys
import codecs
sys.stdout = codecs.getwriter('utf-8')(sys.stdout)
"""
Analysis and visualisation library for pdftables
"""
import pdftables as pt
import matplotlib.pyplot... | 0 | 0 | 0 | 0 | 0 | 1,563 | 0 | 11 | 91 |
9234cfcb3f24c5650d265a803fde31fb6be53cf9 | 344 | py | Python | pyunit_idcard/__init__.py | PyUnit/pyunit-idCard | 73ba98e62e71ece45315951fea0edaf46f2d9d4a | [
"Apache-2.0"
] | 5 | 2020-06-25T19:24:19.000Z | 2021-06-27T10:31:33.000Z | pyunit_idcard/__init__.py | PyUnit/pyunit-idCard | 73ba98e62e71ece45315951fea0edaf46f2d9d4a | [
"Apache-2.0"
] | null | null | null | pyunit_idcard/__init__.py | PyUnit/pyunit-idCard | 73ba98e62e71ece45315951fea0edaf46f2d9d4a | [
"Apache-2.0"
] | 1 | 2021-09-28T05:24:21.000Z | 2021-09-28T05:24:21.000Z | # !/usr/bin/python3.7
# -*- coding: utf-8 -*-
# @Time : 2020/6/22 9:58
# @Author: Jtyoui@qq.com
# @Notes :
__version__ = '2020.6.22'
__author__ = 'Jtyoui'
__description__ = ''
__email__ = 'jtyoui@qq.com'
__names__ = 'pyUnit_idCard'
__url__ = 'https://github.com/PyUnit/pyunit-idCard'
| 24.571429 | 51 | 0.694767 | # !/usr/bin/python3.7
# -*- coding: utf-8 -*-
# @Time : 2020/6/22 上午9:58
# @Author: Jtyoui@qq.com
# @Notes : 身份证检查
from .idcard import IdCard
__version__ = '2020.6.22'
__author__ = 'Jtyoui'
__description__ = '身份证实体抽取,身份证补全,身份证检测等功能。'
__email__ = 'jtyoui@qq.com'
__names__ = 'pyUnit_idCard'
__url__ = 'https://github.co... | 90 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 22 |
47ec389ae010bc11002a26931d2d23167e7da0a7 | 2,720 | py | Python | petastorm/tests/test_pyarrow_serializer.py | xiaohanhuang/petastorm | 9a903d9885759674f81b412dc133aeb9577e00dd | [
"Apache-2.0"
] | 1 | 2019-07-02T23:50:49.000Z | 2019-07-02T23:50:49.000Z | petastorm/tests/test_pyarrow_serializer.py | xiaohanhuang/petastorm | 9a903d9885759674f81b412dc133aeb9577e00dd | [
"Apache-2.0"
] | 18 | 2020-02-20T17:50:41.000Z | 2020-03-10T10:57:29.000Z | petastorm/tests/test_pyarrow_serializer.py | xiaohanhuang/petastorm | 9a903d9885759674f81b412dc133aeb9577e00dd | [
"Apache-2.0"
] | 3 | 2020-04-16T18:25:24.000Z | 2020-05-08T17:59:43.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2017-2018 Uber Technologies, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 35.324675 | 112 | 0.65625 | # -*- coding: utf-8 -*-
# Copyright (c) 2017-2018 Uber Technologies, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 6 | 0 | 0 | 0 | 0 | 1,434 | 0 | 6 | 91 |
e9ec181413a9e9cb8f16bd5c0931f7424447337d | 1,626 | py | Python | rhoci/db/cli.py | dsariel/rhoci | 76734fefc495fe7d2e5b5b38d8eeb3bd6b156aa7 | [
"Apache-2.0"
] | null | null | null | rhoci/db/cli.py | dsariel/rhoci | 76734fefc495fe7d2e5b5b38d8eeb3bd6b156aa7 | [
"Apache-2.0"
] | null | null | null | rhoci/db/cli.py | dsariel/rhoci | 76734fefc495fe7d2e5b5b38d8eeb3bd6b156aa7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Arie Bregman
#
# 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 agree... | 31.882353 | 78 | 0.702952 | # Copyright 2017 Arie Bregman
#
# 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 agree... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3e2dc2e2f1d1a664ac76556b3f85d8801cbe1e88 | 5,585 | py | Python | tests/integrated_recognizers/test_phone_number_recognizer.py | openredact/pii-identifier | 97eaef56d6de59718501095d631a0fb49700e45a | [
"MIT"
] | 14 | 2020-07-31T18:45:29.000Z | 2022-02-21T13:24:00.000Z | tests/integrated_recognizers/test_phone_number_recognizer.py | openredact/pii-identifier | 97eaef56d6de59718501095d631a0fb49700e45a | [
"MIT"
] | 7 | 2020-07-31T06:17:21.000Z | 2021-05-23T08:40:24.000Z | tests/integrated_recognizers/test_phone_number_recognizer.py | openredact/pii-identifier | 97eaef56d6de59718501095d631a0fb49700e45a | [
"MIT"
] | 1 | 2020-09-30T01:42:57.000Z | 2020-09-30T01:42:57.000Z |
# DIN 5008
# Microsoft's canonical format
# E.123
# Others
# Non-standard
# US style
# Not phone numbers
| 29.240838 | 115 | 0.710295 | import pytest
from nerwhal.integrated_recognizers.phone_number_recognizer import PhoneNumberRecognizer
@pytest.fixture(scope="module")
def backend(setup_backend):
recognizer = PhoneNumberRecognizer
backend = setup_backend(recognizer.BACKEND)
backend.register_recognizer(recognizer)
return backend
# ... | 4 | 188 | 0 | 0 | 0 | 4,524 | 0 | 59 | 666 |
2b90b0219ec4f978b9c98124f19912ea51efc6a7 | 9,811 | py | Python | tests/test_torchvision.py | L-Net-1992/sahi | 43f008948419ebff1e0c1861c3cee4ead23fcad1 | [
"MIT"
] | null | null | null | tests/test_torchvision.py | L-Net-1992/sahi | 43f008948419ebff1e0c1861c3cee4ead23fcad1 | [
"MIT"
] | null | null | null | tests/test_torchvision.py | L-Net-1992/sahi | 43f008948419ebff1e0c1861c3cee4ead23fcad1 | [
"MIT"
] | null | null | null | # OBSS SAHI Tool
# Code written by Kadir Nar, 2022.
import unittest
MODEL_DEVICE = "cpu"
CONFIDENCE_THRESHOLD = 0.5
IMAGE_SIZE = 320
if __name__ == "__main__":
unittest.main()
| 38.175097 | 105 | 0.68729 | # OBSS SAHI Tool
# Code written by Kadir Nar, 2022.
import unittest
from sahi.utils.cv import read_image
from sahi.utils.torchvision import TorchVisionTestConstants
MODEL_DEVICE = "cpu"
CONFIDENCE_THRESHOLD = 0.5
IMAGE_SIZE = 320
class TestTorchVisionDetectionModel(unittest.TestCase):
def test_load_model(self... | 0 | 0 | 0 | 9,504 | 0 | 0 | 0 | 53 | 68 |
f150b468fc5a4677db999329c6f07b5a5287c396 | 594 | py | Python | tool/urls.py | borislavstoychev/RecrutmentTool | 80cc8db9b653c05dcafe3b79b6da8847111e92f9 | [
"MIT"
] | null | null | null | tool/urls.py | borislavstoychev/RecrutmentTool | 80cc8db9b653c05dcafe3b79b6da8847111e92f9 | [
"MIT"
] | null | null | null | tool/urls.py | borislavstoychev/RecrutmentTool | 80cc8db9b653c05dcafe3b79b6da8847111e92f9 | [
"MIT"
] | null | null | null | from django.urls import path, include
from tool import views
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register('candidates', views.CandidatesViewSet)
router.register('jobs', views.JobViewSet)
urlpatterns = [
path('', include(router.urls)),
path('recruiters/', views.Rec... | 37.125 | 79 | 0.728956 | from django.urls import path, include
from tool import views
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register('candidates', views.CandidatesViewSet)
router.register('jobs', views.JobViewSet)
urlpatterns = [
path('', include(router.urls)),
path('recruiters/', views.Rec... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9c1f567ad31a45b2467adb5d9a636e985095e04e | 2,826 | py | Python | tests/python/unittest/test_tvm_op.py | niallomahony93/mxnet | 31164c59de97607d6b24ed03bed5074bbc86c5d4 | [
"Apache-2.0"
] | 5 | 2018-02-08T01:53:43.000Z | 2019-01-08T07:39:32.000Z | tests/python/unittest/test_tvm_op.py | LXL1314/incubator-mxnet | d8b6e47b91a737d29c0589bda8640aee69d8599b | [
"Apache-2.0"
] | 10 | 2017-05-27T01:00:48.000Z | 2019-10-20T20:38:11.000Z | tests/python/unittest/test_tvm_op.py | LXL1314/incubator-mxnet | d8b6e47b91a737d29c0589bda8640aee69d8599b | [
"Apache-2.0"
] | 2 | 2019-10-03T21:00:55.000Z | 2020-07-30T06:44:06.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 38.189189 | 87 | 0.584572 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 0 | 1,775 | 0 | 0 | 0 | 0 | 0 | 29 | 112 |
23fe8c70dfacbc77988ed88e654337d760f4624f | 2,960 | py | Python | app/settings/ssl_setting.py | hirossan4049/Schreen | 9f00fff45a1a92b96df98aa6996aa2eeba72cc69 | [
"MIT"
] | null | null | null | app/settings/ssl_setting.py | hirossan4049/Schreen | 9f00fff45a1a92b96df98aa6996aa2eeba72cc69 | [
"MIT"
] | 30 | 2020-03-22T13:12:07.000Z | 2022-03-12T00:19:40.000Z | app/settings/ssl_setting.py | hirossan4049/Schreen | 9f00fff45a1a92b96df98aa6996aa2eeba72cc69 | [
"MIT"
] | 1 | 2020-06-13T07:46:53.000Z | 2020-06-13T07:46:53.000Z |
#csk = CreateSSLKey()
#csk.start()
| 29.89899 | 209 | 0.592905 | import pexpect
import timeout_decorator
class OpenSSLNotFoundError(Exception):
pass
def getOpenSSLVersion():
getversion = pexpect.run("openssl version").decode("utf-8")
whatSSL = getversion.split(" ")[0]
if whatSSL == "LibreSSL":
return getversion
elif whatSSL == "OpenSSL":
r... | 30 | 507 | 0 | 1,958 | 0 | 290 | 0 | -4 | 147 |
4dc039663206e0b82700e923905f52c317ad41f3 | 9,884 | py | Python | run_single_model.py | ECNU-ICA/ECNU-SenseMaker | 24f829c3dfefccea5fecbbe75904858ec1fefffb | [
"MIT"
] | 16 | 2020-07-29T06:31:15.000Z | 2021-08-08T13:06:19.000Z | run_single_model.py | ECNU-ICA/ECNU-SenseMaker | 24f829c3dfefccea5fecbbe75904858ec1fefffb | [
"MIT"
] | 1 | 2020-11-30T10:09:07.000Z | 2020-12-10T16:28:39.000Z | run_single_model.py | ECNU-ICA/ECNU-SenseMaker | 24f829c3dfefccea5fecbbe75904858ec1fefffb | [
"MIT"
] | 5 | 2020-12-14T12:29:21.000Z | 2021-11-04T09:15:46.000Z | import torch
import torch.utils.data.distributed
import pprint
from utils.MyDataset import MyDataLoader
from config import args as default_args, project_root_path
from models import (SOTA_goal_model, RobertaForMultipleChoiceWithLM, RobertaForMultipleChoice)
from model_modify import (create_datasets_with_kbert, train_an... | 53.139785 | 117 | 0.681303 | import argparse
import torch
import torch.utils.data.distributed
import pprint
from utils.MyDataset import MyDataLoader, MyDataset
from config import args as default_args, project_root_path
import numpy as np
import pandas as pd
import os
from models import (
SOTA_goal_model,
AlbertForMultipleChoice,
Robert... | 54 | 0 | 0 | 0 | 0 | 3,533 | 0 | 81 | 111 |
3afcfbfacf166c45b411c3b091cd1bc8b5fc8edf | 4,559 | py | Python | mqtt/publisher/publisher.py | smartx-usman/IIoT-SDP2-Apps | 58371d4d7fd8d39ddf0e47ba8cc3d2e7ad6a3aab | [
"MIT"
] | null | null | null | mqtt/publisher/publisher.py | smartx-usman/IIoT-SDP2-Apps | 58371d4d7fd8d39ddf0e47ba8cc3d2e7ad6a3aab | [
"MIT"
] | null | null | null | mqtt/publisher/publisher.py | smartx-usman/IIoT-SDP2-Apps | 58371d4d7fd8d39ddf0e47ba8cc3d2e7ad6a3aab | [
"MIT"
] | null | null | null | # python 3.6
import logging
import os
logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s', level=logging.INFO)
mqtt_broker = os.environ['MQTT_BROKER']
mqtt_topic = os.environ['MQTT_TOPIC']
value_type = os.environ['VALUE_TYPE']
invalid_value_occurrence = int(os.environ['INVALID_VALUE_OCCURRENCE'])
m... | 29.038217 | 131 | 0.631498 | # python 3.6
import logging
import os
import random
import time
from threading import Thread
from paho.mqtt import client as mqtt_client
logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s', level=logging.INFO)
mqtt_broker = os.environ['MQTT_BROKER']
mqtt_topic = os.environ['MQTT_TOPIC']
value_type... | 0 | 0 | 0 | 0 | 0 | 3,104 | 0 | 11 | 222 |
3285a935e3d8ddc6ff997c57eaf99b8988eba617 | 303 | py | Python | Snippets and Basic Functions/File Operations/CSV/buffer-to-csv.py | sckulkarni246/python-snippets-for-embedded-programmers | 9dfd0b193f86a6de54598917f3d7088a60ec4abc | [
"MIT"
] | null | null | null | Snippets and Basic Functions/File Operations/CSV/buffer-to-csv.py | sckulkarni246/python-snippets-for-embedded-programmers | 9dfd0b193f86a6de54598917f3d7088a60ec4abc | [
"MIT"
] | null | null | null | Snippets and Basic Functions/File Operations/CSV/buffer-to-csv.py | sckulkarni246/python-snippets-for-embedded-programmers | 9dfd0b193f86a6de54598917f3d7088a60ec4abc | [
"MIT"
] | null | null | null |
buffer = []
for i in range(0,100):
buffer.append(i)
print("Writing buffer to buffer.csv now...")
data_logger_csv(buffer,"buffer.csv") | 23.307692 | 46 | 0.719472 | import csv
def data_logger_csv(buffer,fileName):
with open(fileName,"w+") as my_csv:
csvWriter = csv.writer(my_csv,delimiter=',')
csvWriter.writerow(buffer)
buffer = []
for i in range(0,100):
buffer.append(i)
print("Writing buffer to buffer.csv now...")
data_logger_csv(buffer,"buffer.csv") | 0 | 0 | 0 | 0 | 0 | 129 | 0 | -11 | 46 |
6f89caaaf10f882f2c5f619564d22f9b69db3230 | 1,699 | py | Python | omnipresence/plugins/mstranslate/test_mstranslate.py | kxz/omnipresence | ffb3dbc30d36331a68e8dea3a85db6a4d2928cd7 | [
"BSD-3-Clause"
] | null | null | null | omnipresence/plugins/mstranslate/test_mstranslate.py | kxz/omnipresence | ffb3dbc30d36331a68e8dea3a85db6a4d2928cd7 | [
"BSD-3-Clause"
] | 10 | 2016-04-05T04:36:15.000Z | 2018-03-25T00:15:47.000Z | omnipresence/plugins/mstranslate/test_mstranslate.py | kxz/omnipresence | ffb3dbc30d36331a68e8dea3a85db6a4d2928cd7 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8
"""Unit tests for the mstranslate event plugin."""
# pylint: disable=missing-docstring,too-few-public-methods
| 33.313725 | 77 | 0.721012 | # -*- coding: utf-8
"""Unit tests for the mstranslate event plugin."""
# pylint: disable=missing-docstring,too-few-public-methods
from twisted.internet.defer import inlineCallbacks
from twisted.trial.unittest import TestCase
from ...test.helpers import CommandTestMixin
from . import Default
class MicrosoftTransla... | 33 | 1,034 | 0 | 334 | 0 | 0 | 0 | 74 | 114 |
80fabec1ff1e4a6c005789471136c5024f97c954 | 2,416 | py | Python | src/pyramid_torque_engine/traverse.py | thruflo/pyramid_torque_engine | 3797c11d4fcc85cdad126b4a11d505279a7345a1 | [
"Unlicense"
] | 1 | 2015-06-23T12:51:43.000Z | 2015-06-23T12:51:43.000Z | src/pyramid_torque_engine/traverse.py | thruflo/pyramid_torque_engine | 3797c11d4fcc85cdad126b4a11d505279a7345a1 | [
"Unlicense"
] | 3 | 2019-12-26T16:36:59.000Z | 2022-03-21T22:16:06.000Z | src/pyramid_torque_engine/traverse.py | thruflo/pyramid_torque_engine | 3797c11d4fcc85cdad126b4a11d505279a7345a1 | [
"Unlicense"
] | 3 | 2015-06-24T10:25:35.000Z | 2015-12-19T18:28:44.000Z | # -*- coding: utf-8 -*-
"""Provide a traversal root that looks up registered resources."""
__all__ = [
'EngineRoot',
]
import logging
logger = logging.getLogger(__name__)
import zope.interface as zi
from . import util
QUERY_SPEC = {
'property_name': 'id',
'validator': util.id_validator,
}
def add_engi... | 29.463415 | 80 | 0.695778 | # -*- coding: utf-8 -*-
"""Provide a traversal root that looks up registered resources."""
__all__ = [
'EngineRoot',
]
import logging
logger = logging.getLogger(__name__)
import zope.interface as zi
import pyramid_basemodel as bm
from pyramid_basemodel import container
from pyramid_basemodel import tree
from ... | 0 | 116 | 0 | 229 | 0 | 116 | 0 | 37 | 162 |
7d7e43646f9d564913eda04a91de6bceb3b055b4 | 883 | py | Python | near200.py | Logic-gate/datasig | 7199a85f54877f1f5c03720eed34742c2afc3052 | [
"BSD-3-Clause"
] | 3 | 2017-07-14T14:30:18.000Z | 2018-05-19T10:58:17.000Z | near200.py | Logic-gate/datasig | 7199a85f54877f1f5c03720eed34742c2afc3052 | [
"BSD-3-Clause"
] | null | null | null | near200.py | Logic-gate/datasig | 7199a85f54877f1f5c03720eed34742c2afc3052 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import urllib2
httpCode = http_code()
uri = ["https://www.digitalocean.com/community/tutorials/how-to-import-and-export-databases-in-mysql-or-mariadb/lkajsklas/90/laksjkjas/alsjhkahskjas/asjhakjshkjas/aslkjakslj"]
for i in uri:
httpCode.error(i)
print '\n'
| 23.236842 | 175 | 0.604757 | #!/usr/bin/env python
import urllib2
class http_code:
def append_http(self, url):
url = url + '/../..'
self.error(url)
def error(self, url):
code = str(self.urlOpen(url))
print url, code
client_error = set(['401', '403', '404', '405']) #add as much as you like
... | 0 | 0 | 0 | 558 | 0 | 0 | 0 | 0 | 23 |
953bc88512fafb4107b9253d52fe392ea8f7bc19 | 183 | py | Python | url/cli-open-url.py | rawswift/python-collections | 05b61611473a15c666058de3bd5f2707f82d9a4d | [
"MIT"
] | null | null | null | url/cli-open-url.py | rawswift/python-collections | 05b61611473a15c666058de3bd5f2707f82d9a4d | [
"MIT"
] | null | null | null | url/cli-open-url.py | rawswift/python-collections | 05b61611473a15c666058de3bd5f2707f82d9a4d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
response = urllib2.urlopen("https://www.python.org/")
html = response.read()
# print out the HTML response
print(html)
| 16.636364 | 53 | 0.68306 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
response = urllib2.urlopen("https://www.python.org/")
html = response.read()
# print out the HTML response
print(html)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
afda7eaae1dfe7212fc26cbf35ca428db941d626 | 961 | py | Python | prep.py | michalsn13/Python-Flashcards | d51dea28811e430385962b7a2d768ee882a23d8c | [
"MIT"
] | null | null | null | prep.py | michalsn13/Python-Flashcards | d51dea28811e430385962b7a2d768ee882a23d8c | [
"MIT"
] | null | null | null | prep.py | michalsn13/Python-Flashcards | d51dea28811e430385962b7a2d768ee882a23d8c | [
"MIT"
] | null | null | null | # LOCAL IMPORTS
from Connection.connection import Connection # connecting to SQL database
"""
It's meant to be run only before using the project for the first time (or at least for the first time in
a certain database (make sure you changed parameters in Connection/'con_parameters.py' file.
"""
with C... | 32.033333 | 127 | 0.670135 | # LOCAL IMPORTS
from Connection.connection import Connection # connecting to SQL database
"""
It's meant to be run only before using the project for the first time (or at least for the first time in
a certain database (make sure you changed parameters in Connection/'con_parameters.py' file.
"""
with C... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
82dafd6d77e556704f95a3230fe6f0e16c2cdd87 | 664 | py | Python | MaximumLikelihoodEstimation.py | Puneethnaik/Generative-Adversarial-Networks | 283abe2caaccbb99e1516b2a3f251cd8d005a386 | [
"MIT"
] | null | null | null | MaximumLikelihoodEstimation.py | Puneethnaik/Generative-Adversarial-Networks | 283abe2caaccbb99e1516b2a3f251cd8d005a386 | [
"MIT"
] | null | null | null | MaximumLikelihoodEstimation.py | Puneethnaik/Generative-Adversarial-Networks | 283abe2caaccbb99e1516b2a3f251cd8d005a386 | [
"MIT"
] | null | null | null | import sys
sys.path.insert(0, "/home/puneeth/Projects/GAN/GenerativeAdversarialNetworks/utilities")
import mini_batch_gradient_descent as gd
import plotting_functions as pf
import numpy as np
X = np.transpose(np.random.random_sample(10) * 2.0)
obj = [X]
mle = gd.GradientDescentOptimizer(X, 10**-4, 1)
theta = mle.optimi... | 34.947368 | 95 | 0.691265 | import sys
sys.path.insert(0, "/home/puneeth/Projects/GAN/GenerativeAdversarialNetworks/utilities")
import mini_batch_gradient_descent as gd
import plotting_functions as pf
import numpy as np
def gaussian(X, theta):
res = (1 / (np.sqrt(2 * np.pi * theta[1]))) * np.exp(-(X - theta[0]) ** 2 / (2 * theta[1]))
retu... | 0 | 0 | 0 | 0 | 0 | 113 | 0 | 0 | 22 |
8f44b2b8007e951ec71898b33e27eafd9b4f8cff | 5,283 | py | Python | Code_Versions/climate_app-backup.py | robgauer/sqlalchemy-challenge | ba4ace59bd06d953760b98395b5599e9728b81f7 | [
"ADSL"
] | null | null | null | Code_Versions/climate_app-backup.py | robgauer/sqlalchemy-challenge | ba4ace59bd06d953760b98395b5599e9728b81f7 | [
"ADSL"
] | null | null | null | Code_Versions/climate_app-backup.py | robgauer/sqlalchemy-challenge | ba4ace59bd06d953760b98395b5599e9728b81f7 | [
"ADSL"
] | null | null | null | # Import Setup and Dependancies
from sqlalchemy.ext.automap import automap_base
from sqlalchemy import create_engine
from flask import Flask
########## Database Setup ###########
engine = create_engine("sqlite:///Resources/hawaii.sqlite")
# Reflect an existing database and tables
Base = automap_base()
# Reflect the... | 30.715116 | 183 | 0.625781 | # Import Setup and Dependancies
import numpy as np
import datetime as dt
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func
from flask import Flask, jsonify
########## Database Setup ###########
engine = create_engine("sql... | 0 | 4,411 | 0 | 0 | 0 | 0 | 0 | 21 | 228 |
1418e793952352dd30d391cb7e26480664b52705 | 1,922 | py | Python | vsf_erpnext/cart.py | vijaywm/vsf-erpnext | 84a566fb9af8208696b11690d01a160a0da0250c | [
"MIT"
] | 2 | 2019-11-30T07:30:41.000Z | 2019-12-19T08:33:59.000Z | vsf_erpnext/cart.py | vijaywm/vsf-erpnext | 84a566fb9af8208696b11690d01a160a0da0250c | [
"MIT"
] | 1 | 2020-01-04T06:13:17.000Z | 2020-01-04T06:13:17.000Z | vsf_erpnext/cart.py | vijaywm/vsf-erpnext | 84a566fb9af8208696b11690d01a160a0da0250c | [
"MIT"
] | 6 | 2020-06-07T09:55:42.000Z | 2022-03-17T16:53:51.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
__version__ = '0.0.1'
| 32.033333 | 111 | 0.59001 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from werkzeug.wrappers import Response
import frappe
import json
__version__ = '0.0.1'
@frappe.whitelist(allow_guest=True)
# api url: http://<site_name>/api/method/vsf_erpnext.cart.update?token=&cartId=
def update(token=None, cartId=None,):
# https:/... | 0 | 1,723 | 0 | 0 | 0 | 0 | 0 | -1 | 112 |