hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c4ad0de484852ef9a59a8447411a80386935077c | 443 | py | Python | lims/shared/apps.py | sqilz/LIMS-Backend | b64e1fa512f89e4492803d44c6b8c35e4d4724cc | [
"MIT"
] | null | null | null | lims/shared/apps.py | sqilz/LIMS-Backend | b64e1fa512f89e4492803d44c6b8c35e4d4724cc | [
"MIT"
] | null | null | null | lims/shared/apps.py | sqilz/LIMS-Backend | b64e1fa512f89e4492803d44c6b8c35e4d4724cc | [
"MIT"
] | null | null | null | import sys
from django.apps import AppConfig
from django.db.models.signals import post_save
| 29.533333 | 95 | 0.68623 | import sys
from django.apps import AppConfig
from django.db.models.signals import post_save
class SharedConfig(AppConfig):
name = 'lims.shared'
def ready(self):
if ('runserver' in sys.argv or '/usr/local/bin/daphne' in sys.argv
or 'runworker' in sys.argv):
from lims.share... | 265 | 61 | 23 |
b2b0e485d14a0baf41773f90c2eb52cdc85221e1 | 10,595 | py | Python | src/patterns.py | KathTheDragon/SCE | f1ade0a0d40582b68b59cf9725e67ab6358d0237 | [
"MIT"
] | 1 | 2020-12-23T07:53:56.000Z | 2020-12-23T07:53:56.000Z | src/patterns.py | KathTheDragon/SCE | f1ade0a0d40582b68b59cf9725e67ab6358d0237 | [
"MIT"
] | null | null | null | src/patterns.py | KathTheDragon/SCE | f1ade0a0d40582b68b59cf9725e67ab6358d0237 | [
"MIT"
] | null | null | null | from dataclasses import dataclass
from typing import overload
from .words import Word
@overload
@overload
@dataclass
@dataclass(repr=False)
@dataclass(repr=False)
@dataclass(repr=False)
@dataclass(repr=False)
@dataclass(repr=False)
@dataclass(repr=False)
@dataclass(repr=False)
@dataclass(repr=False... | 36.916376 | 161 | 0.612742 | from dataclasses import dataclass
from typing import overload
from .words import Word
class MatchFailed(Exception):
pass
@overload
def advance(word: Word, length: int, start: int, stop: None) -> tuple[int, None]:
...
@overload
def advance(word: Word, length: int, start: None, stop: int) -> tuple[None, int]:
... | 8,552 | 871 | 762 |
0f8ca47744a52c3f1507469b5558e68c1be7b0d4 | 23,813 | py | Python | pysnmp-with-texts/SYMME1T1.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/SYMME1T1.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/SYMME1T1.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module SYMME1T1 (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/neermitt/Dev/kusanagi/mibs.snmplabs.com/asn1/SYMME1T1
# Produced by pysmi-0.3.4 at Tue Jul 30 11:34:59 2019
# On host NEERMITT-M-J0NV platform Darwin version 18.6.0 by user neermitt
# Using Python version 3.7.4 (default, Jul 9 2019... | 123.38342 | 2,082 | 0.754504 | #
# PySNMP MIB module SYMME1T1 (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/neermitt/Dev/kusanagi/mibs.snmplabs.com/asn1/SYMME1T1
# Produced by pysmi-0.3.4 at Tue Jul 30 11:34:59 2019
# On host NEERMITT-M-J0NV platform Darwin version 18.6.0 by user neermitt
# Using Python version 3.7.4 (default, Jul 9 2019... | 0 | 3,021 | 205 |
773f3d414053d1514aceb10d5e3941b04bd8e910 | 989 | py | Python | alertlistener/main.py | ashleykelham/shift-your-alert-polcies-left | 1e5124b76d2ec5c6d4556d1730ea5a1bb3e6c797 | [
"Apache-2.0"
] | null | null | null | alertlistener/main.py | ashleykelham/shift-your-alert-polcies-left | 1e5124b76d2ec5c6d4556d1730ea5a1bb3e6c797 | [
"Apache-2.0"
] | null | null | null | alertlistener/main.py | ashleykelham/shift-your-alert-polcies-left | 1e5124b76d2ec5c6d4556d1730ea5a1bb3e6c797 | [
"Apache-2.0"
] | null | null | null | from google.cloud import datastore
import os
import json
client = datastore.Client()
| 28.257143 | 59 | 0.548028 | from google.cloud import datastore
import os
import json
client = datastore.Client()
def alerts(request):
kind = 'alerts-' + os.environ['ENV']
if request.method == 'POST' or request.method == 'PUT':
print(request.data)
request_json = request.get_json()
incident = request_json['inciden... | 880 | 0 | 23 |
126955d7d8c5255831ba84354f634ab3187c2a5a | 1,787 | py | Python | 02.py | anttuov/adventofcode-2017 | 36288be78479cc5309a59e09b6db87afcd4940cb | [
"MIT"
] | null | null | null | 02.py | anttuov/adventofcode-2017 | 36288be78479cc5309a59e09b6db87afcd4940cb | [
"MIT"
] | null | null | null | 02.py | anttuov/adventofcode-2017 | 36288be78479cc5309a59e09b6db87afcd4940cb | [
"MIT"
] | null | null | null | # http://adventofcode.com/2017/day/2
code = """5048 177 5280 5058 4504 3805 5735 220 4362 1809 1521 230 772 1088 178 1794
6629 3839 258 4473 5961 6539 6870 4140 4638 387 7464 229 4173 5706 185 271
5149 2892 5854 2000 256 3995 5250 249 3916 184 2497 210 4601 3955 1110 5340
153 468 550 126 495 142 385 144 165 188 609... | 40.613636 | 84 | 0.69446 | # http://adventofcode.com/2017/day/2
def checksum_1(code):
checksum = 0
for line in code.split("\n"):
numbers = list(map(int, line.split("\t")))
checksum += max(numbers) - min(numbers)
return checksum
def checksum_2(code):
checksum = 0
for line in code.split("\n"):
number... | 495 | 0 | 46 |
f15605049ae96ff1cf8f150412910b416ecdc828 | 723 | py | Python | Tensile/Tests/nightly/convolution_config/test_yaml.py | zjunweihit/Tensile | 68b73083c92eecc1b04eec1f006f28aea5628030 | [
"MIT"
] | null | null | null | Tensile/Tests/nightly/convolution_config/test_yaml.py | zjunweihit/Tensile | 68b73083c92eecc1b04eec1f006f28aea5628030 | [
"MIT"
] | null | null | null | Tensile/Tests/nightly/convolution_config/test_yaml.py | zjunweihit/Tensile | 68b73083c92eecc1b04eec1f006f28aea5628030 | [
"MIT"
] | null | null | null | import logging
from Tensile.SolutionStructs import Convolution
from YamlBuilder.YamlBuilder import YamlBuilder
log =logging.getLogger("testlog")
| 34.428571 | 82 | 0.676349 | import logging
from Tensile.SolutionStructs import Convolution
from YamlBuilder.YamlBuilder import YamlBuilder
log =logging.getLogger("testlog")
def test_yaml(request, tensile_client_dir, tmp_path):
z={} # problemType definition
conv = Convolution(z, 'ConvolutionForward',
config={'TensorAFormat'... | 554 | 0 | 23 |
ebd882d2681a13494693917b2277401b35c97a33 | 16,311 | py | Python | search_web/__init__.py | Ankitsinghprograms/search_web | 108aa097f89b4b393cb9c844d8e490920a0557ed | [
"MIT"
] | 3 | 2021-01-14T15:27:38.000Z | 2021-12-20T09:53:04.000Z | search_web/__init__.py | Ankitsinghprograms/search_web | 108aa097f89b4b393cb9c844d8e490920a0557ed | [
"MIT"
] | 1 | 2021-02-04T20:36:40.000Z | 2021-02-04T20:36:40.000Z | search_web/__init__.py | Ankitsinghprograms/search_web | 108aa097f89b4b393cb9c844d8e490920a0557ed | [
"MIT"
] | 1 | 2021-02-04T19:52:55.000Z | 2021-02-04T19:52:55.000Z | """
This module will Help You to Search on Different Websites like Google,Youtube,etc.
You can search on more than 25 websites very easily by just 2 lines of code.
Websites Supported:-
1.Google -google_search("Python")
2.Youtube -youtube_search("Python")
3.Bing -bing_search("Python")
4.Quora -quora_search("5 P... | 14.195822 | 109 | 0.639691 | """
This module will Help You to Search on Different Websites like Google,Youtube,etc.
You can search on more than 25 websites very easily by just 2 lines of code.
Websites Supported:-
1.Google -google_search("Python")
2.Youtube -youtube_search("Python")
3.Bing -bing_search("Python")
4.Quora -quora_search("5 P... | 0 | 0 | 0 |
87a3c0f164fbcc6a42b29d8f101106b4ea766cfe | 4,696 | py | Python | common/files.py | LordKBX/EbookCollection | 3e6ba33fb012b1dbb371704094b02cece66a7e80 | [
"MIT"
] | 1 | 2021-06-03T01:44:50.000Z | 2021-06-03T01:44:50.000Z | common/files.py | LordKBX/eBookCollection | 3e6ba33fb012b1dbb371704094b02cece66a7e80 | [
"MIT"
] | null | null | null | common/files.py | LordKBX/eBookCollection | 3e6ba33fb012b1dbb371704094b02cece66a7e80 | [
"MIT"
] | null | null | null | import os, sys, shutil
import hashlib
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
from common.vars import *
from common.MIME import *
def get_file_size(file_name: str, human_readable: bool = True):
"""
Get file in size in given unit like KB, MB or GB
:param file_name... | 31.945578 | 121 | 0.631814 | import os, sys, shutil
import hashlib
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
from common.vars import *
from common.MIME import *
def get_file_size(file_name: str, human_readable: bool = True):
"""
Get file in size in given unit like KB, MB or GB
:param file_name... | 2,876 | 0 | 230 |
f82d31f5b5597ffa1c312d086ef484f89b54b43b | 4,017 | py | Python | uformer/test.py | lulsheng/-AI-8- | 562365379c3e0191436537958a2519e4be905d4b | [
"Apache-2.0"
] | null | null | null | uformer/test.py | lulsheng/-AI-8- | 562365379c3e0191436537958a2519e4be905d4b | [
"Apache-2.0"
] | null | null | null | uformer/test.py | lulsheng/-AI-8- | 562365379c3e0191436537958a2519e4be905d4b | [
"Apache-2.0"
] | null | null | null | import numpy as np
import os, sys
import argparse
from tqdm import tqdm
import paddle.nn as nn
import paddle
from x2paddle.torch2paddle import DataLoader
import paddle.nn.functional as F
sys.path.append('/home/aistudio')
import scipy.io as sio
from utils.loader import get_validation_data, get_testA_data
import utils
fr... | 42.284211 | 109 | 0.744088 | import numpy as np
import os, sys
import argparse
from tqdm import tqdm
import paddle.nn as nn
import paddle
from x2paddle.torch2paddle import DataLoader
import paddle.nn.functional as F
sys.path.append('/home/aistudio')
import scipy.io as sio
from utils.loader import get_validation_data, get_testA_data
import utils
fr... | 0 | 0 | 0 |
80583d6ca6373271e97855d720a33839feef7440 | 20,630 | py | Python | server.py | Leslie-Fang/Seq2Seq-Vis | 71be2e246a7bc4c7a27912d3a735cbcf13b908ef | [
"Apache-2.0"
] | 436 | 2018-04-26T00:57:57.000Z | 2022-03-28T07:26:40.000Z | server.py | Leslie-Fang/Seq2Seq-Vis | 71be2e246a7bc4c7a27912d3a735cbcf13b908ef | [
"Apache-2.0"
] | 24 | 2018-04-28T08:09:04.000Z | 2022-02-26T03:35:37.000Z | server.py | Leslie-Fang/Seq2Seq-Vis | 71be2e246a7bc4c7a27912d3a735cbcf13b908ef | [
"Apache-2.0"
] | 72 | 2018-04-27T00:25:22.000Z | 2021-09-30T14:16:43.000Z | #!/usr/bin/env python3
import argparse
import os
import time
os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE"
import connexion
import logging
# import umap
from flask import send_from_directory, redirect, json
import numpy as np
from sklearn.decomposition import PCA
from sklearn.manifold import MDS, TSNE
from copy impor... | 33.49026 | 80 | 0.55269 | #!/usr/bin/env python3
import argparse
import os
import time
os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE"
import connexion
import logging
# import umap
from flask import send_from_directory, redirect, json
import numpy as np
from sklearn.decomposition import PCA
from sklearn.manifold import MDS, TSNE
from copy impor... | 15,299 | 0 | 388 |
652cec0c60fd17c92973aec0fbbe1a9e68631d80 | 13,761 | py | Python | build_and_train.py | akshaysharma21/Genre_Classification | 4a5a8f875ba77241a1241b995b304ed895d576a5 | [
"CC0-1.0"
] | null | null | null | build_and_train.py | akshaysharma21/Genre_Classification | 4a5a8f875ba77241a1241b995b304ed895d576a5 | [
"CC0-1.0"
] | null | null | null | build_and_train.py | akshaysharma21/Genre_Classification | 4a5a8f875ba77241a1241b995b304ed895d576a5 | [
"CC0-1.0"
] | null | null | null | #imports
import pandas as pd
import os
import ast
import sklearn as skl
import sklearn.utils, sklearn.preprocessing, sklearn.decomposition, sklearn.svm
import matplotlib.pyplot as plt
import numpy as np
import pylab
import librosa
import ffmpeg
import audioread
import sklearn
import librosa.display
import datetime
... | 35.55814 | 147 | 0.594506 | #imports
import pandas as pd
import os
import ast
import sklearn as skl
import sklearn.utils, sklearn.preprocessing, sklearn.decomposition, sklearn.svm
import matplotlib.pyplot as plt
import numpy as np
import pylab
import librosa
import ffmpeg
import audioread
import sklearn
import librosa.display
import datetime
... | 11,993 | 0 | 111 |
b3e541794ca93c4f765c5a04c082c60d42c8e272 | 4,667 | py | Python | get_embeddings_ML.py | pauhsg/PS_SentimentAnalysis | fb7ebe4d2b05e1f86205708a13b5e238a0e1cba9 | [
"Apache-1.1"
] | null | null | null | get_embeddings_ML.py | pauhsg/PS_SentimentAnalysis | fb7ebe4d2b05e1f86205708a13b5e238a0e1cba9 | [
"Apache-1.1"
] | null | null | null | get_embeddings_ML.py | pauhsg/PS_SentimentAnalysis | fb7ebe4d2b05e1f86205708a13b5e238a0e1cba9 | [
"Apache-1.1"
] | null | null | null | #!/usr/bin/env python3
import numpy as np
import pandas as pd
import re
regex = re.compile('[^A-Za-zÀ-ÿ]')
def extract_mean_word_vectors(data, vocabulary, embeddings):
'''
extracts mean of word vectors for each tweet
'''
print('> extracting mean of word vectors')
# get vocab equivalence to twe... | 40.938596 | 139 | 0.686737 | #!/usr/bin/env python3
import numpy as np
import pandas as pd
import re
regex = re.compile('[^A-Za-zÀ-ÿ]')
def extract_mean_word_vectors(data, vocabulary, embeddings):
'''
extracts mean of word vectors for each tweet
'''
print('> extracting mean of word vectors')
# get vocab equivalence to twe... | 0 | 0 | 0 |
b23ea33c7149b1654de0bad4da0b73703df6ace9 | 1,861 | py | Python | parametrize/utils.py | MrMrRobat/parametrize | 3da69a3695bf9af66f194d21e0596d31e958dfa9 | [
"MIT"
] | 7 | 2021-05-09T22:31:08.000Z | 2021-10-20T12:27:40.000Z | parametrize/utils.py | Bobronium/parametrize | 3da69a3695bf9af66f194d21e0596d31e958dfa9 | [
"MIT"
] | 2 | 2021-05-15T19:22:42.000Z | 2021-11-21T11:24:10.000Z | parametrize/utils.py | Bobronium/parametrize | 3da69a3695bf9af66f194d21e0596d31e958dfa9 | [
"MIT"
] | 1 | 2021-11-21T11:01:16.000Z | 2021-11-21T11:01:16.000Z | import sys
from inspect import Signature
from types import CodeType, FunctionType
from typing import Any, Tuple
if sys.version_info >= (3, 8):
copy_code = CodeType.replace
else:
PY_36_37_CODE_ARGS: Tuple[str, ...] = (
"co_argcount",
"co_kwonlyargcount",
"co_nlocals",
"co_stacks... | 29.078125 | 86 | 0.619022 | import sys
from inspect import Signature
from types import CodeType, FunctionType
from typing import Any, Tuple
if sys.version_info >= (3, 8):
copy_code = CodeType.replace
else:
PY_36_37_CODE_ARGS: Tuple[str, ...] = (
"co_argcount",
"co_kwonlyargcount",
"co_nlocals",
"co_stacks... | 0 | 0 | 0 |
7aedf0c8817932b2eee18bc17c9088890bda9cdb | 1,839 | py | Python | personalcrm/inventory/views.py | carlossgv/personalcrm-repo | 2fbe824a62d8976ce09817d75dfac7291ca3d28d | [
"MIT"
] | 2 | 2021-02-11T12:46:06.000Z | 2021-02-22T01:32:35.000Z | personalcrm/inventory/views.py | carlossgv/personalcrm-repo | 2fbe824a62d8976ce09817d75dfac7291ca3d28d | [
"MIT"
] | null | null | null | personalcrm/inventory/views.py | carlossgv/personalcrm-repo | 2fbe824a62d8976ce09817d75dfac7291ca3d28d | [
"MIT"
] | null | null | null | from .forms import NewProductForm
from django.db import models
from django.shortcuts import render, resolve_url
from django.http.response import JsonResponse
from quote.models import Product, Brand, User
# ! INVENTORY VIEWS
| 27.863636 | 82 | 0.612289 | from .forms import NewProductForm
from django.db import models
from django.shortcuts import render, resolve_url
from django.http.response import JsonResponse
from quote.models import Product, Brand, User
# ! INVENTORY VIEWS
def home(request):
return render(request, "inventory/index.html")
def get_inventory_inde... | 1,521 | 0 | 91 |
72ff98015af5b3f8f31a269e778f01cf72613909 | 4,336 | py | Python | utils/tif.py | anhp95/forest_attr_segment | 51a412efc6f78d3c7ce90da59b348a3cabc3cb09 | [
"MIT"
] | null | null | null | utils/tif.py | anhp95/forest_attr_segment | 51a412efc6f78d3c7ce90da59b348a3cabc3cb09 | [
"MIT"
] | null | null | null | utils/tif.py | anhp95/forest_attr_segment | 51a412efc6f78d3c7ce90da59b348a3cabc3cb09 | [
"MIT"
] | null | null | null | from osgeo import gdal
import glob
import os
import numpy as np
| 31.882353 | 159 | 0.65429 | from osgeo import gdal
import glob
import os
import numpy as np
def read_tif(path_):
ds = gdal.Open(path_)
nodata_value = 65535
ds.GetRasterBand(1).SetNoDataValue(nodata_value)
band = ds.GetRasterBand(1)
arr = band.ReadAsArray()
[rows, cols] = arr.shape
metadata = {
"transform": d... | 4,080 | 0 | 184 |
75bcdef2b0e596ed34971c0c6c64a759413453a2 | 39 | py | Python | python/dlr/metadata.py | ylc/neo-ai-dlr | a8afcafbcc8c43b734faf092b2f4dd7e8fe40ea0 | [
"Apache-2.0"
] | 446 | 2019-01-24T02:04:17.000Z | 2022-03-16T13:45:32.000Z | python/dlr/metadata.py | ylc/neo-ai-dlr | a8afcafbcc8c43b734faf092b2f4dd7e8fe40ea0 | [
"Apache-2.0"
] | 179 | 2019-01-24T10:03:34.000Z | 2022-03-19T02:06:56.000Z | python/dlr/metadata.py | ylc/neo-ai-dlr | a8afcafbcc8c43b734faf092b2f4dd7e8fe40ea0 | [
"Apache-2.0"
] | 111 | 2019-01-24T20:51:45.000Z | 2022-02-18T06:22:40.000Z | NAME = ['DLRModel']
VERSION = "1.9.1"
| 9.75 | 19 | 0.564103 | NAME = ['DLRModel']
VERSION = "1.9.1"
| 0 | 0 | 0 |
0471a7c04e04c6ff309ba4131754c43b9d7d3c93 | 591 | py | Python | src/tests/test_example_task.py | kazqvaizer/arq-sqlalchemy-boilerplate | c14596ed358a061e6eb2a380f4bd962242b123f3 | [
"MIT"
] | 6 | 2021-12-20T14:49:14.000Z | 2022-03-21T14:32:49.000Z | src/tests/test_example_task.py | kazqvaizer/arq-sqlalchemy-boilerplate | c14596ed358a061e6eb2a380f4bd962242b123f3 | [
"MIT"
] | null | null | null | src/tests/test_example_task.py | kazqvaizer/arq-sqlalchemy-boilerplate | c14596ed358a061e6eb2a380f4bd962242b123f3 | [
"MIT"
] | null | null | null | import pytest
from sqlalchemy import func
from sqlalchemy.future import select
from app.models import ExampleModel
from app.tasks import example_task
pytestmark = pytest.mark.asyncio
| 24.625 | 81 | 0.756345 | import pytest
from sqlalchemy import func
from sqlalchemy.future import select
from app.models import ExampleModel
from app.tasks import example_task
pytestmark = pytest.mark.asyncio
async def test_creates_new_entry(session):
await example_task()
count = (await session.execute(select(func.count(ExampleMode... | 358 | 0 | 46 |
eab37f54fd7dbe0be73d3f145040820fb90e8486 | 1,529 | py | Python | features_fixer/scaler/abstract.py | LudwikBielczynski/features_fixer | 43114e3d986265a1e6e34644d3734a361d3fa926 | [
"MIT"
] | null | null | null | features_fixer/scaler/abstract.py | LudwikBielczynski/features_fixer | 43114e3d986265a1e6e34644d3734a361d3fa926 | [
"MIT"
] | null | null | null | features_fixer/scaler/abstract.py | LudwikBielczynski/features_fixer | 43114e3d986265a1e6e34644d3734a361d3fa926 | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
from typing import TYPE_CHECKING, Optional
import pandas as pd
if TYPE_CHECKING:
from sklearn.base import TransformerMixin
| 28.849057 | 95 | 0.561805 | from abc import ABC, abstractmethod
from typing import TYPE_CHECKING, Optional
import pandas as pd
if TYPE_CHECKING:
from sklearn.base import TransformerMixin
class ScalerAbstract(ABC):
@property
@abstractmethod
def scaler(self) -> 'TransformerMixin':
pass
# TODO: Scale only numeric col... | 1,154 | 187 | 23 |
d174b348a6a886e5ebfeb1998bd2eefa9286562d | 34,287 | py | Python | savu/plugins/plugin_tools.py | nghia-vo/Savu | 1cf7343c141224643b2e1fb2f05e74448bc4fd58 | [
"Apache-2.0"
] | null | null | null | savu/plugins/plugin_tools.py | nghia-vo/Savu | 1cf7343c141224643b2e1fb2f05e74448bc4fd58 | [
"Apache-2.0"
] | null | null | null | savu/plugins/plugin_tools.py | nghia-vo/Savu | 1cf7343c141224643b2e1fb2f05e74448bc4fd58 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Diamond Light Source Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | 38.9625 | 85 | 0.593082 | # Copyright 2014 Diamond Light Source Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | 2,216 | 0 | 467 |
91c4447f40df9a13e4fd627871df6a5b7f822dad | 6,370 | py | Python | pylib/cqlshlib/test/ansi_colors.py | tomitakazutaka/cassandra | 5a04115973932202203d479db37eedc5a2d81778 | [
"Apache-2.0"
] | null | null | null | pylib/cqlshlib/test/ansi_colors.py | tomitakazutaka/cassandra | 5a04115973932202203d479db37eedc5a2d81778 | [
"Apache-2.0"
] | null | null | null | pylib/cqlshlib/test/ansi_colors.py | tomitakazutaka/cassandra | 5a04115973932202203d479db37eedc5a2d81778 | [
"Apache-2.0"
] | null | null | null | # 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 ... | 32.5 | 104 | 0.574411 | # 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 ... | 3,182 | 644 | 148 |
e0beb0bdd73cc0eda15d5ef0ac50d51f281f3f2e | 3,022 | py | Python | CNN/utils.py | ostrowskaaa/ReDust | e9ed30dd13f8b7dc32e4d9099df2bb22aa1d2ecb | [
"MIT"
] | 1 | 2020-12-27T22:09:32.000Z | 2020-12-27T22:09:32.000Z | CNN/utils.py | ostrowskaaa/ReDust | e9ed30dd13f8b7dc32e4d9099df2bb22aa1d2ecb | [
"MIT"
] | 5 | 2020-11-13T17:53:07.000Z | 2021-03-30T09:36:02.000Z | CNN/utils.py | ostrowskaaa/ReDust | e9ed30dd13f8b7dc32e4d9099df2bb22aa1d2ecb | [
"MIT"
] | null | null | null | import os
import numpy as np
from cv2 import cv2
from PIL import Image
import matplotlib.pyplot as plt
from tensorflow import keras
from keras.preprocessing.image import array_to_img, img_to_array, load_img
PATH = os.getcwd()
## ----- LOAD DATA ------
## ----- IMAGE AUGMENTATION -----
| 36.409639 | 136 | 0.605228 | import os
import numpy as np
from cv2 import cv2
from PIL import Image
import matplotlib.pyplot as plt
from tensorflow import keras
from keras.preprocessing.image import array_to_img, img_to_array, load_img
PATH = os.getcwd()
## ----- LOAD DATA ------
def load_data(folderName, photoType):
folderPath... | 2,614 | 0 | 96 |
ad176cf21c5302e22fe80155ad9383c77b3bf96b | 4,093 | py | Python | taobao_spider/taobao_spider/taobao_spider/spiders/TaobaoSpider.py | lj28478416/Taobao_Spider | d18675efc4bf8938bfe08f9f0e5de2e26d58a390 | [
"Apache-2.0"
] | null | null | null | taobao_spider/taobao_spider/taobao_spider/spiders/TaobaoSpider.py | lj28478416/Taobao_Spider | d18675efc4bf8938bfe08f9f0e5de2e26d58a390 | [
"Apache-2.0"
] | null | null | null | taobao_spider/taobao_spider/taobao_spider/spiders/TaobaoSpider.py | lj28478416/Taobao_Spider | d18675efc4bf8938bfe08f9f0e5de2e26d58a390 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import scrapy
import json
from jsonpath import jsonpath
import re
from ..items import TaobaoSpiderItem
from ..settings import cookies
from urllib import parse
error_num = 0
| 44.978022 | 118 | 0.524554 | # -*- coding: utf-8 -*-
import scrapy
import json
from jsonpath import jsonpath
import re
from ..items import TaobaoSpiderItem
from ..settings import cookies
from urllib import parse
error_num = 0
class TaobaospiderSpider(scrapy.Spider):
name = 'TaobaoSpider'
# allowed_domains = ['taobao.com', 'tmall.com']
... | 3,386 | 493 | 22 |
76abd7e5c30c875c4d15aacee98dd95000ad0604 | 360 | py | Python | django_cbtools/signals.py | smarttradeapp/django_couchbase | d96b32977bdb0dbf1a6e891ab29ea7b69ac6bed4 | [
"BSD-3-Clause"
] | 6 | 2016-06-23T08:21:43.000Z | 2018-07-19T09:42:32.000Z | django_cbtools/signals.py | smarttradeapp/django_cbtools | d96b32977bdb0dbf1a6e891ab29ea7b69ac6bed4 | [
"BSD-3-Clause"
] | 26 | 2015-10-17T08:59:36.000Z | 2021-06-10T17:48:41.000Z | django_cbtools/signals.py | smarttradeapp/django_couchbase | d96b32977bdb0dbf1a6e891ab29ea7b69ac6bed4 | [
"BSD-3-Clause"
] | 8 | 2015-11-28T13:47:19.000Z | 2020-12-15T12:58:00.000Z | from django.db.models.signals import ModelSignal
cb_pre_save = ModelSignal(providing_args=["instance"], use_caching=True)
cb_post_save = ModelSignal(providing_args=["instance", "created"], use_caching=True)
cb_pre_delete = ModelSignal(providing_args=["instance"], use_caching=True)
cb_post_delete = ModelSignal(providi... | 45 | 84 | 0.808333 | from django.db.models.signals import ModelSignal
cb_pre_save = ModelSignal(providing_args=["instance"], use_caching=True)
cb_post_save = ModelSignal(providing_args=["instance", "created"], use_caching=True)
cb_pre_delete = ModelSignal(providing_args=["instance"], use_caching=True)
cb_post_delete = ModelSignal(providi... | 0 | 0 | 0 |
6b3f7a1b7b9bdbaf348944e853bd1155f8a549ef | 1,540 | py | Python | app/auth/views.py | annaadhiambo/The-Last-Pitch | cf611b846059df57f6f02ff69d9029946487aa6d | [
"MIT"
] | null | null | null | app/auth/views.py | annaadhiambo/The-Last-Pitch | cf611b846059df57f6f02ff69d9029946487aa6d | [
"MIT"
] | null | null | null | app/auth/views.py | annaadhiambo/The-Last-Pitch | cf611b846059df57f6f02ff69d9029946487aa6d | [
"MIT"
] | null | null | null | from flask import render_template,redirect,url_for, flash,request
from flask_login import login_user,logout_user,login_required
from . import auth
from ..models import User
from .forms import LoginForm,RegistrationForm
from .. import db
from ..email import mail_message
from flask_http_response import success, result, ... | 38.5 | 104 | 0.719481 | from flask import render_template,redirect,url_for, flash,request
from flask_login import login_user,logout_user,login_required
from . import auth
from ..models import User
from .forms import LoginForm,RegistrationForm
from .. import db
from ..email import mail_message
from flask_http_response import success, result, ... | 1,008 | 0 | 66 |
edb742b662287057e388a5535dd4c2d409e7dfb8 | 356 | py | Python | build/lib/django_simple_file_handler/urls.py | jonathanrickard/django-simple-file-handler | f714b93b941b3a677a8fd2a2eb425afaaa0a2d62 | [
"MIT"
] | 5 | 2020-09-17T16:41:01.000Z | 2021-05-21T22:42:56.000Z | build/lib/django_simple_file_handler/urls.py | jonathanrickard/django-simple-file-handler | f714b93b941b3a677a8fd2a2eb425afaaa0a2d62 | [
"MIT"
] | null | null | null | build/lib/django_simple_file_handler/urls.py | jonathanrickard/django-simple-file-handler | f714b93b941b3a677a8fd2a2eb425afaaa0a2d62 | [
"MIT"
] | 1 | 2021-01-09T13:04:38.000Z | 2021-01-09T13:04:38.000Z | from django.urls import (
path,
)
from .views import (
proxy_document,
proxy_pdf,
)
app_name = 'django_simple_file_handler'
urlpatterns = [
path(
'documents/<proxy_slug>',
proxy_document,
name='proxy_document',
),
path(
'pdf/<proxy_slug>',
proxy_pdf,... | 13.185185 | 39 | 0.564607 | from django.urls import (
path,
)
from .views import (
proxy_document,
proxy_pdf,
)
app_name = 'django_simple_file_handler'
urlpatterns = [
path(
'documents/<proxy_slug>',
proxy_document,
name='proxy_document',
),
path(
'pdf/<proxy_slug>',
proxy_pdf,... | 0 | 0 | 0 |
8f19b7cff4fb05679aff138284ee6c3240db012b | 3,209 | py | Python | conversationinsights-mynlu/mynlu/parsers/__init__.py | osswangxining/iot-app-enabler-conversation | 7c40a89072b1730869260320d77aa9856412424a | [
"Apache-2.0"
] | 4 | 2017-10-19T05:11:52.000Z | 2018-06-26T02:54:55.000Z | mynlu/parsers/__init__.py | osswangxining/conversationinsights-mynlu | d2a174af770a496ef220330cb6d5428f5f0114f6 | [
"Apache-2.0"
] | null | null | null | mynlu/parsers/__init__.py | osswangxining/conversationinsights-mynlu | d2a174af770a496ef220330cb6d5428f5f0114f6 | [
"Apache-2.0"
] | 1 | 2018-06-26T02:54:57.000Z | 2018-06-26T02:54:57.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import datetime
import io
import json
import logging
import os
import copy
from builtins import object
from builtins import str
from typing import Any
from typing import... | 35.263736 | 104 | 0.682456 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import datetime
import io
import json
import logging
import os
import copy
from builtins import object
from builtins import str
from typing import Any
from typing import... | 1,382 | 1,097 | 23 |
1895571fa5dca0d9aea1f7538b31f47d0d2ee10a | 4,699 | py | Python | AutomatedTesting/Gem/PythonTests/physics/TestSuite_Main.py | aaarsene/o3de | 37e3b0226958974defd14dd6d808e8557dcd7345 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-09-13T00:01:12.000Z | 2021-09-13T00:01:12.000Z | AutomatedTesting/Gem/PythonTests/physics/TestSuite_Main.py | aaarsene/o3de | 37e3b0226958974defd14dd6d808e8557dcd7345 | [
"Apache-2.0",
"MIT"
] | null | null | null | AutomatedTesting/Gem/PythonTests/physics/TestSuite_Main.py | aaarsene/o3de | 37e3b0226958974defd14dd6d808e8557dcd7345 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-07-20T11:07:25.000Z | 2021-07-20T11:07:25.000Z | """
Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
# This suite consists of all test cases that are passing and have been verified.
import pytest
import os
impo... | 52.211111 | 184 | 0.786125 | """
Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
# This suite consists of all test cases that are passing and have been verified.
import pytest
import os
impo... | 2,888 | 910 | 22 |
2bbc5d5059204941b3bf3be674c045711a8fd26f | 690 | py | Python | tests/dataaccess/test_dataaccess.py | sebastian-lemke/tt | 2ff1ec23d206632446b08e56add1a8852af7415a | [
"MIT"
] | 13 | 2020-06-23T18:05:14.000Z | 2022-01-26T17:37:59.000Z | tests/dataaccess/test_dataaccess.py | sebastian-lemke/tt | 2ff1ec23d206632446b08e56add1a8852af7415a | [
"MIT"
] | 6 | 2020-03-26T00:47:52.000Z | 2022-02-15T13:03:05.000Z | tests/dataaccess/test_dataaccess.py | sebastian-lemke/tt | 2ff1ec23d206632446b08e56add1a8852af7415a | [
"MIT"
] | 5 | 2021-02-12T15:58:39.000Z | 2021-11-17T09:27:26.000Z | from unittest import TestCase
from tt.dataaccess.utils import *
| 34.5 | 92 | 0.711594 | from unittest import TestCase
from tt.dataaccess.utils import *
class TestDataaccess(TestCase):
def test_basic_json_datastore_creation(self):
datastore = get_data_store()
self.assertIsNotNone(datastore, 'Should not be none, but is')
def test_loading_json_datastore(self):
datastore = ... | 511 | 10 | 104 |
85b2a7b8b24924295f931bb9285470d455b9b0b0 | 346 | py | Python | lib/algo/quark/test.py | tuaris/TidePool | 5d44fa11a7de3f5c05130d0ad4030671806cd501 | [
"BSD-3-Clause"
] | 3 | 2018-06-30T12:10:50.000Z | 2021-09-18T16:10:12.000Z | lib/algo/max_hash/test.py | tuaris/TidePool | 5d44fa11a7de3f5c05130d0ad4030671806cd501 | [
"BSD-3-Clause"
] | null | null | null | lib/algo/max_hash/test.py | tuaris/TidePool | 5d44fa11a7de3f5c05130d0ad4030671806cd501 | [
"BSD-3-Clause"
] | 9 | 2017-04-12T22:59:49.000Z | 2021-09-18T16:10:25.000Z | import quark_hash
import weakref
import binascii
import StringIO
from binascii import unhexlify
teststart = '700000005d385ba114d079970b29a9418fd0549e7d68a95c7f168621a314201000000000578586d149fd07b22f3a8a347c516de7052f034d2b76ff68e0d6ecff9b77a45489e3fd511732011df0731000';
testbin = unhexlify(teststart)
hash_bin = quar... | 34.6 | 175 | 0.904624 | import quark_hash
import weakref
import binascii
import StringIO
from binascii import unhexlify
teststart = '700000005d385ba114d079970b29a9418fd0549e7d68a95c7f168621a314201000000000578586d149fd07b22f3a8a347c516de7052f034d2b76ff68e0d6ecff9b77a45489e3fd511732011df0731000';
testbin = unhexlify(teststart)
hash_bin = quar... | 0 | 0 | 0 |
9e8f3ff788d8e8c6f67d82306f60aa368476c03b | 2,898 | py | Python | responsibility/responsibility.py | guwenbo/DesignPattern-Python | 3b7228595e9dd6ae5cb0df06b2b8a74ce2d774a9 | [
"Apache-2.0"
] | null | null | null | responsibility/responsibility.py | guwenbo/DesignPattern-Python | 3b7228595e9dd6ae5cb0df06b2b8a74ce2d774a9 | [
"Apache-2.0"
] | null | null | null | responsibility/responsibility.py | guwenbo/DesignPattern-Python | 3b7228595e9dd6ae5cb0df06b2b8a74ce2d774a9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
责任链模式
"""
if __name__ == '__main__':
hb = ConcreteHandlerB(Level(2))
ha = ConcreteHandlerA(Level(1), hb)
req = Request(Level(2), "Request with Level 2")
ha.handle_request(req)
| 21 | 83 | 0.612491 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
责任链模式
"""
class Level(object):
def __init__(self, value=None):
self._value = value
def __str__(self):
return str(self.value)
def equals(self, level):
if isinstance(level, Level):
return self.value == level.value... | 1,546 | 846 | 246 |
fb78fdfa960004a592bf5e8ced007003751dcda2 | 6,671 | py | Python | csalt/CASA_scripts/format_data.py | seanandrews/dsalt | 797c6c085b6cd0c82fa2a7c8b47d39d49815e7a6 | [
"MIT"
] | 2 | 2021-04-28T23:12:09.000Z | 2021-05-11T19:56:07.000Z | csalt/CASA_scripts/format_data.py | seanandrews/dsalt | 797c6c085b6cd0c82fa2a7c8b47d39d49815e7a6 | [
"MIT"
] | null | null | null | csalt/CASA_scripts/format_data.py | seanandrews/dsalt | 797c6c085b6cd0c82fa2a7c8b47d39d49815e7a6 | [
"MIT"
] | 1 | 2021-08-11T19:07:23.000Z | 2021-08-11T19:07:23.000Z | """
This CASA script (optionally) reduces an available (concatenated) MS by
time-averaging and sub-selecting a given velocity range. It is called
inside csalt.synthesize.make_data(), or can be used as a standalone script
for a real dataset as
casa -c format_data.py configs/gen_<cfg_file> <a... | 32.227053 | 80 | 0.640534 | """
This CASA script (optionally) reduces an available (concatenated) MS by
time-averaging and sub-selecting a given velocity range. It is called
inside csalt.synthesize.make_data(), or can be used as a standalone script
for a real dataset as
casa -c format_data.py configs/gen_<cfg_file> <a... | 0 | 0 | 0 |
d44d5ec5c5d6b32d6e144b89c329e7a0745bad9a | 2,776 | py | Python | examples.py | ofirmanor/nicetable | a0110161657dc9da66ffb334677132f7f3af8511 | [
"MIT"
] | 6 | 2019-01-10T16:15:11.000Z | 2022-03-28T01:42:37.000Z | examples.py | ofirmanor/nicetable | a0110161657dc9da66ffb334677132f7f3af8511 | [
"MIT"
] | 1 | 2021-01-08T06:25:29.000Z | 2021-01-08T06:25:29.000Z | examples.py | ofirmanor/nicetable | a0110161657dc9da66ffb334677132f7f3af8511 | [
"MIT"
] | 1 | 2021-01-07T23:58:20.000Z | 2021-01-07T23:58:20.000Z | # Example: printing the list of builtin layouts
import json
from nicetable.nicetable import NiceTable
# from __future__ import annotations # only for Python 3.7 and up?
out = NiceTable(['Layout', 'Description'])
for layout in NiceTable.builtin_layouts():
out.append(layout)
print(out)
# Example: printi... | 34.271605 | 120 | 0.668588 | # Example: printing the list of builtin layouts
import json
from nicetable.nicetable import NiceTable
# from __future__ import annotations # only for Python 3.7 and up?
out = NiceTable(['Layout', 'Description'])
for layout in NiceTable.builtin_layouts():
out.append(layout)
print(out)
# Example: printi... | 0 | 252 | 23 |
824a966bc3f98387de4dd6b19297de88ea1261a3 | 505 | py | Python | forwarding_bot/vk/_bot.py | dhvcc/VK-TG-transfer-bot | 4a1570ca6f2b905bc015412b527ac58039eb2cef | [
"MIT"
] | 4 | 2020-09-19T18:59:01.000Z | 2020-10-13T13:34:45.000Z | forwarding_bot/vk/_bot.py | dhvcc/VK-TG-transfer-bot | 4a1570ca6f2b905bc015412b527ac58039eb2cef | [
"MIT"
] | 11 | 2020-09-24T09:07:06.000Z | 2022-03-10T12:21:34.000Z | forwarding_bot/vk/_bot.py | dhvcc/VK-TG-transfer-bot | 4a1570ca6f2b905bc015412b527ac58039eb2cef | [
"MIT"
] | 2 | 2020-10-11T13:30:09.000Z | 2020-10-22T07:08:21.000Z | import logging
from vkbottle import User
from forwarding_bot.vk._middleware import middleware_bp
from ._blueprint import bot_bp
logger = logging.getLogger(__name__)
| 22.954545 | 55 | 0.667327 | import logging
from vkbottle import User
from forwarding_bot.vk._middleware import middleware_bp
from ._blueprint import bot_bp
logger = logging.getLogger(__name__)
class VKBot:
def __init__(self, token: str):
self.bot = User(token)
self.bot.set_blueprints(middleware_bp, bot_bp)
def start(... | 269 | -9 | 76 |
dc0c6eb6c805d3ba32f728bbde54860ebb404adc | 5,022 | py | Python | choicesenum/django/fields.py | gustavo-depaula/python-choicesenum | f0ed55da28c444a99595137f3a60ed9d900c3312 | [
"BSD-3-Clause"
] | null | null | null | choicesenum/django/fields.py | gustavo-depaula/python-choicesenum | f0ed55da28c444a99595137f3a60ed9d900c3312 | [
"BSD-3-Clause"
] | null | null | null | choicesenum/django/fields.py | gustavo-depaula/python-choicesenum | f0ed55da28c444a99595137f3a60ed9d900c3312 | [
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
from __future__ import absolute_import, unicode_literals
from django.core import checks
from django.db import models
from django.utils.translation import gettext_lazy as _
try:
from django.utils.module_loading import import_string
except ImportError: # pragma: no cover, Django 1.6 compat
from... | 34.163265 | 95 | 0.579052 | # coding: utf-8
from __future__ import absolute_import, unicode_literals
from django.core import checks
from django.db import models
from django.utils.translation import gettext_lazy as _
try:
from django.utils.module_loading import import_string
except ImportError: # pragma: no cover, Django 1.6 compat
from... | 3,790 | 408 | 358 |
eae86aa1429fe11b7f7053d2e37f0b1844ebbabd | 79 | py | Python | src/ssg/__init__.py | a-rokay/static-site-generator | f44a6951beeb68bd5ae5cc3b02e71c636d853dc2 | [
"MIT"
] | 1 | 2021-09-21T22:45:17.000Z | 2021-09-21T22:45:17.000Z | src/ssg/__init__.py | a-rokay/static-site-generator | f44a6951beeb68bd5ae5cc3b02e71c636d853dc2 | [
"MIT"
] | 11 | 2021-09-13T14:12:34.000Z | 2021-10-04T21:09:18.000Z | src/ssg/__init__.py | a-rokay/static-site-generator | f44a6951beeb68bd5ae5cc3b02e71c636d853dc2 | [
"MIT"
] | 5 | 2021-09-14T19:29:43.000Z | 2021-11-04T19:58:06.000Z | import pathlib
import sys
sys.path.append(str(pathlib.Path(__file__).parent))
| 15.8 | 51 | 0.797468 | import pathlib
import sys
sys.path.append(str(pathlib.Path(__file__).parent))
| 0 | 0 | 0 |
6263e624ebab3c675c7c6fecb0b26b6fa51802dc | 2,288 | py | Python | hatch_vcs/version_source.py | ofek/hatch-vcs | c5388d67192d9bf88191927a35f51705121784a1 | [
"MIT"
] | null | null | null | hatch_vcs/version_source.py | ofek/hatch-vcs | c5388d67192d9bf88191927a35f51705121784a1 | [
"MIT"
] | 1 | 2022-03-08T04:07:09.000Z | 2022-03-18T05:41:17.000Z | hatch_vcs/version_source.py | ofek/hatch-vcs | c5388d67192d9bf88191927a35f51705121784a1 | [
"MIT"
] | null | null | null | # SPDX-FileCopyrightText: 2022-present Ofek Lev <oss@ofek.dev>
#
# SPDX-License-Identifier: MIT
from hatchling.version.source.plugin.interface import VersionSourceInterface
| 32.685714 | 77 | 0.668706 | # SPDX-FileCopyrightText: 2022-present Ofek Lev <oss@ofek.dev>
#
# SPDX-License-Identifier: MIT
from hatchling.version.source.plugin.interface import VersionSourceInterface
class VCSVersionSource(VersionSourceInterface):
PLUGIN_NAME = 'vcs'
def __init__(self, *args, **kwargs):
super(VCSVersionSource,... | 1,864 | 227 | 23 |
d73ac3c9452edba0b0b59e8de232220b9ef33e42 | 1,087 | py | Python | scripts/find_zone.py | MrCerealKiller/agros_paths | afbae25280541ddef2dff0bba69b052068d998d0 | [
"MIT"
] | null | null | null | scripts/find_zone.py | MrCerealKiller/agros_paths | afbae25280541ddef2dff0bba69b052068d998d0 | [
"MIT"
] | null | null | null | scripts/find_zone.py | MrCerealKiller/agros_paths | afbae25280541ddef2dff0bba69b052068d998d0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import rospy
from geodesy.utm import gridZone
def main():
"""
Simple utility script to find the UTM zone of WGS84 coords
"""
TAG = "[find_zone.main] "
lat = rospy.get_param('~lat', None)
lon = rospy.get_param('~lon', None)
# Check that at least lat and lon are provided
missing_args =... | 20.903846 | 60 | 0.636615 | #!/usr/bin/env python
import rospy
from geodesy.utm import gridZone
def main():
"""
Simple utility script to find the UTM zone of WGS84 coords
"""
TAG = "[find_zone.main] "
lat = rospy.get_param('~lat', None)
lon = rospy.get_param('~lon', None)
# Check that at least lat and lon are provided
missing_args =... | 0 | 0 | 0 |
7ac35ca1f56e6121c03a2f94c88ea62eb273c365 | 417 | py | Python | gcloud/filter_functions.py | pantheon-ci-bot/etl-framework | 36d4c0d5c26ddd7c0bb2d2b99e3138b50a21c46f | [
"MIT"
] | 2 | 2017-03-01T20:09:06.000Z | 2019-02-08T17:10:16.000Z | gcloud/filter_functions.py | pantheon-ci-bot/etl-framework | 36d4c0d5c26ddd7c0bb2d2b99e3138b50a21c46f | [
"MIT"
] | 40 | 2015-10-10T15:02:21.000Z | 2020-03-17T22:32:04.000Z | gcloud/filter_functions.py | pantheon-ci-bot/etl-framework | 36d4c0d5c26ddd7c0bb2d2b99e3138b50a21c46f | [
"MIT"
] | 2 | 2018-11-14T21:50:58.000Z | 2022-03-07T20:59:27.000Z | """set of filter functions"""
import datetime
import uuid
def choose_current_date_partition():
"""gets the parition for current date"""
return datetime.date.today().strftime('$%Y%m%d')
def add_bigquery_insert_uuid(row):
"""formats output_row and adds a uuid to be inserted"""
output_row = dict()
... | 20.85 | 59 | 0.688249 | """set of filter functions"""
import datetime
import uuid
def choose_current_date_partition():
"""gets the parition for current date"""
return datetime.date.today().strftime('$%Y%m%d')
def add_bigquery_insert_uuid(row):
"""formats output_row and adds a uuid to be inserted"""
output_row = dict()
... | 0 | 0 | 0 |
4e8f4745274985a263ec4883d895332a482b971e | 2,937 | py | Python | server/problem_server/ocr_server.py | jun0911-cmyk/s-class-version-3.0 | b485b643f2cc62e81ca15bce52e6aff843f3459d | [
"MIT"
] | null | null | null | server/problem_server/ocr_server.py | jun0911-cmyk/s-class-version-3.0 | b485b643f2cc62e81ca15bce52e6aff843f3459d | [
"MIT"
] | null | null | null | server/problem_server/ocr_server.py | jun0911-cmyk/s-class-version-3.0 | b485b643f2cc62e81ca15bce52e6aff843f3459d | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
import pytesseract
import cv2
import json
import time
from tensorflow import keras
pytesseract.pytesseract.tesseract_cmd = r'C:/Program Files/Tesseract-OCR/tesseract.exe'
img_height = 180
img_width = 180
image_name = 'test1.jpg'
model_name = '1627062415'
class_names = ['dr... | 31.580645 | 149 | 0.695267 | import tensorflow as tf
import numpy as np
import pytesseract
import cv2
import json
import time
from tensorflow import keras
pytesseract.pytesseract.tesseract_cmd = r'C:/Program Files/Tesseract-OCR/tesseract.exe'
img_height = 180
img_width = 180
image_name = 'test1.jpg'
model_name = '1627062415'
class_names = ['dr... | 1,409 | 0 | 184 |
77ff6b6bfaabc0cad8a99a72c1b833c554b753c8 | 11,240 | py | Python | spy/compiler.py | pcostesi/spy | 6a352df1053fea60dd6bbc9932bc946e8fae1e3e | [
"OLDAP-2.6"
] | 1 | 2017-09-01T21:21:24.000Z | 2017-09-01T21:21:24.000Z | spy/compiler.py | pcostesi/spy | 6a352df1053fea60dd6bbc9932bc946e8fae1e3e | [
"OLDAP-2.6"
] | null | null | null | spy/compiler.py | pcostesi/spy | 6a352df1053fea60dd6bbc9932bc946e8fae1e3e | [
"OLDAP-2.6"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2011, 2012 Pablo A. Costesich <pcostesi@alu.itba.edu.ar>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of... | 36.258065 | 89 | 0.589057 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2011, 2012 Pablo A. Costesich <pcostesi@alu.itba.edu.ar>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of... | 4,852 | 289 | 300 |
2c4bbed56d2060a94133f5d39838f35c71f142a4 | 3,003 | py | Python | fMRI Tasks/WASABI bodymap/Stimulus Timing Test.py | canlab/WASABI_public | c10a33fcd8959ff9798eeec099a3f8954531661d | [
"MIT"
] | 1 | 2021-11-16T09:59:14.000Z | 2021-11-16T09:59:14.000Z | fMRI Tasks/WASABI bodymap/Stimulus Timing Test.py | canlab/WASABI_public | c10a33fcd8959ff9798eeec099a3f8954531661d | [
"MIT"
] | null | null | null | fMRI Tasks/WASABI bodymap/Stimulus Timing Test.py | canlab/WASABI_public | c10a33fcd8959ff9798eeec099a3f8954531661d | [
"MIT"
] | null | null | null | import timeit
# from datetime import datetime
from medocControl import *
from psychopy import core
import random
while True:
# startTime = timeit.default_timer()
# poll_for_change('IDLE')
# core.wait(5)
# command = random.randint(101,171)
command = 117
if poll_for_change('IDLE', poll_max=-1): ... | 48.435484 | 156 | 0.651682 | import timeit
# from datetime import datetime
from medocControl import *
from psychopy import core
import random
while True:
# startTime = timeit.default_timer()
# poll_for_change('IDLE')
# core.wait(5)
# command = random.randint(101,171)
command = 117
if poll_for_change('IDLE', poll_max=-1): ... | 0 | 0 | 0 |
e038dd34934518811ef8ccaa09dd09f2275f1656 | 5,351 | py | Python | saefportal/analyzer/analyzers/analyzer_comparison_dataset.py | harry-consulting/SAEF1 | 055d6e492ba76f90e3248b9da2985fdfe0c6b430 | [
"BSD-2-Clause"
] | null | null | null | saefportal/analyzer/analyzers/analyzer_comparison_dataset.py | harry-consulting/SAEF1 | 055d6e492ba76f90e3248b9da2985fdfe0c6b430 | [
"BSD-2-Clause"
] | null | null | null | saefportal/analyzer/analyzers/analyzer_comparison_dataset.py | harry-consulting/SAEF1 | 055d6e492ba76f90e3248b9da2985fdfe0c6b430 | [
"BSD-2-Clause"
] | 1 | 2020-12-16T15:02:52.000Z | 2020-12-16T15:02:52.000Z | from __future__ import absolute_import, unicode_literals
from saefportal.settings import COMPARISON_PROFILE_THRESHOLD
from .analyzer import Analyzer
from analyzer.models import ActualColumnProfile, ExpectedColumnProfile
from analyzer.enums import Column
| 44.966387 | 116 | 0.646982 | from __future__ import absolute_import, unicode_literals
from saefportal.settings import COMPARISON_PROFILE_THRESHOLD
from .analyzer import Analyzer
from analyzer.models import ActualColumnProfile, ExpectedColumnProfile
from analyzer.enums import Column
def _calculate_change(ratio):
result = 0
for value in r... | 4,854 | 21 | 214 |
73365aad101d42d6fcbe4ac64ca9be0306fcea28 | 1,977 | py | Python | utils/metrics.py | ishine/TensorflowASR-1 | c0bcaec124dd96138ac401dfbde0b8c795737bb1 | [
"Apache-2.0"
] | 1 | 2021-06-15T01:19:21.000Z | 2021-06-15T01:19:21.000Z | utils/metrics.py | ishine/TensorflowASR-1 | c0bcaec124dd96138ac401dfbde0b8c795737bb1 | [
"Apache-2.0"
] | null | null | null | utils/metrics.py | ishine/TensorflowASR-1 | c0bcaec124dd96138ac401dfbde0b8c795737bb1 | [
"Apache-2.0"
] | 1 | 2020-12-29T01:26:14.000Z | 2020-12-29T01:26:14.000Z |
import numpy as np
import tensorflow as tf
from utils.xer import wer
from utils.tools import bytes_to_string
class ErrorRate(tf.keras.metrics.Metric):
""" Metric for WER and CER """
| 37.301887 | 97 | 0.643399 |
import numpy as np
import tensorflow as tf
from utils.xer import wer
from utils.tools import bytes_to_string
def wer(decode: np.ndarray, target: np.ndarray) -> (tf.Tensor, tf.Tensor):
decode = bytes_to_string(decode)
target = bytes_to_string(target)
dis = 0.0
length = 0.0
for dec, tar... | 1,638 | 0 | 137 |
2ddd4fdcd5f09910c9beb02228c810ec663b635d | 10,536 | py | Python | tests/environments/test_views.py | waqaskhan540/bullet-train-api | bd0d9ba9c8e4a05a2bd498ce4e69a4f33e1c4199 | [
"BSD-3-Clause"
] | null | null | null | tests/environments/test_views.py | waqaskhan540/bullet-train-api | bd0d9ba9c8e4a05a2bd498ce4e69a4f33e1c4199 | [
"BSD-3-Clause"
] | null | null | null | tests/environments/test_views.py | waqaskhan540/bullet-train-api | bd0d9ba9c8e4a05a2bd498ce4e69a4f33e1c4199 | [
"BSD-3-Clause"
] | null | null | null | from unittest import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from environments.models import Environment, Identity
from features.models import Feature, FeatureState
from organisations.models import Organisation
from projects.models import Project
from tests.utils import He... | 47.674208 | 95 | 0.576784 | from unittest import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from environments.models import Environment, Identity
from features.models import Feature, FeatureState
from organisations.models import Organisation
from projects.models import Project
from tests.utils import He... | 9,227 | 937 | 46 |
7ba651cd035605544502236d142bdb383f2797b4 | 16,843 | py | Python | mpython_conn.py | labplus-cn/mpython_conn | 566a281afed56cac0adad3885cb51d748be63e73 | [
"MIT"
] | 1 | 2020-06-16T08:03:56.000Z | 2020-06-16T08:03:56.000Z | mpython_conn.py | labplus-cn/mpython_conn | 566a281afed56cac0adad3885cb51d748be63e73 | [
"MIT"
] | null | null | null | mpython_conn.py | labplus-cn/mpython_conn | 566a281afed56cac0adad3885cb51d748be63e73 | [
"MIT"
] | 2 | 2020-09-24T05:23:03.000Z | 2020-11-25T06:39:15.000Z | # -*- coding:utf-8 -*-
# @Time : 2020/06/10
# @Author : Wu Wen Jie(6692776@qq.com)
# @FileName : mpython_conn.py
# @Description : A transfer protocol between mPython board and PC python
# @Version : 0.3.2
from serial.tools.list_ports import comports as list_serial_ports
from serial import Serial
import threading... | 34.026263 | 117 | 0.48869 | # -*- coding:utf-8 -*-
# @Time : 2020/06/10
# @Author : Wu Wen Jie(6692776@qq.com)
# @FileName : mpython_conn.py
# @Description : A transfer protocol between mPython board and PC python
# @Version : 0.3.2
from serial.tools.list_ports import comports as list_serial_ports
from serial import Serial
import threading... | 8,664 | 7,393 | 68 |
c6496b78286a6cb875dc7d76cb7bb13bb97a0c5d | 5,069 | py | Python | data.py | zxr931120/WGAN-for-studying | be05f7d0a32b571f899e4aa82135465262a0a7f7 | [
"MIT"
] | 132 | 2019-06-28T02:39:19.000Z | 2022-03-05T10:04:17.000Z | data.py | zxr931120/WGAN-for-studying | be05f7d0a32b571f899e4aa82135465262a0a7f7 | [
"MIT"
] | 1 | 2019-11-14T00:49:50.000Z | 2019-11-15T09:36:52.000Z | data.py | zxr931120/WGAN-for-studying | be05f7d0a32b571f899e4aa82135465262a0a7f7 | [
"MIT"
] | 32 | 2019-08-03T20:43:31.000Z | 2021-09-22T03:23:31.000Z | import torchlib
from torch.utils.data import DataLoader, Dataset
from torchvision import datasets, transforms
# ==============================================================================
# = custom dataset =
# =======================================... | 37.272059 | 151 | 0.580588 | import torchlib
from torch.utils.data import DataLoader, Dataset
from torchvision import datasets, transforms
class OnlyImage(Dataset):
def __init__(self, img_label_dataset):
self.img_label_dataset = img_label_dataset
def __len__(self):
return len(self.img_label_dataset)
def __getitem_... | 3,943 | 4 | 196 |
4a8006cc1715e24a963b1356d0f168161b4b4b96 | 2,150 | py | Python | dependencies/src/4Suite-XML-1.0.2/test/Xml/Xslt/Borrowed/mb_20030223.py | aleasims/Peach | bb56841e943d719d5101fee0a503ed34308eda04 | [
"MIT"
] | null | null | null | dependencies/src/4Suite-XML-1.0.2/test/Xml/Xslt/Borrowed/mb_20030223.py | aleasims/Peach | bb56841e943d719d5101fee0a503ed34308eda04 | [
"MIT"
] | null | null | null | dependencies/src/4Suite-XML-1.0.2/test/Xml/Xslt/Borrowed/mb_20030223.py | aleasims/Peach | bb56841e943d719d5101fee0a503ed34308eda04 | [
"MIT"
] | 1 | 2020-07-26T03:57:45.000Z | 2020-07-26T03:57:45.000Z | # a pretty straightforward Muenchian grouping test
from Xml.Xslt import test_harness
sheet_1 = """<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes"/>
<xsl:key name="skills-by-mark" match="skill" use="@m... | 29.054054 | 80 | 0.587907 | # a pretty straightforward Muenchian grouping test
from Xml.Xslt import test_harness
sheet_1 = """<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes"/>
<xsl:key name="skills-by-mark" match="skill" use="@m... | 245 | 0 | 23 |
9fa78deb2a18cf18221d0916963fbbc9bcac1a13 | 1,255 | py | Python | cheatsheet-startup-python/example-basic/advance/iteration-fun.py | seniortesting/cheatsheet-startup-parent | de0047d58e245427efa992f0f19c30bdec4f70f4 | [
"MIT"
] | null | null | null | cheatsheet-startup-python/example-basic/advance/iteration-fun.py | seniortesting/cheatsheet-startup-parent | de0047d58e245427efa992f0f19c30bdec4f70f4 | [
"MIT"
] | null | null | null | cheatsheet-startup-python/example-basic/advance/iteration-fun.py | seniortesting/cheatsheet-startup-parent | de0047d58e245427efa992f0f19c30bdec4f70f4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from collections.abc import Iterable
if __name__ == '__main__':
# 字典
d = {'a': 1, 'b': 2, 'c': 3}
for key in d:
print(key,d[key])
# 字符串
for x in 'abc':
print(x)
# 对象是否客迭代
iter=isinstance(['a','b','c'], Iterable)
print(it... | 20.916667 | 50 | 0.508367 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from collections.abc import Iterable
def findMinAndMax(L):
if L is None:
raise TypeError('不能为空')
if len(L)==0:
return None,None
# 采用循环得到对应的最小值最大值
max=min=L[0]
for i in range(len(L)):
if L[i]>=max:
max= L[i]
... | 328 | 0 | 23 |
607f482de3979ae3f1e14134f8ff6f16b946d08b | 2,182 | py | Python | utils/convert_to_xz.py | glebkuznetsov/cloudbiolinux | ec47b90ce72f6cd1bc4e5422231f19d41378b122 | [
"MIT"
] | 122 | 2015-01-04T13:23:27.000Z | 2022-01-18T22:52:12.000Z | utils/convert_to_xz.py | glebkuznetsov/cloudbiolinux | ec47b90ce72f6cd1bc4e5422231f19d41378b122 | [
"MIT"
] | 170 | 2015-02-09T18:03:49.000Z | 2021-11-14T02:32:09.000Z | utils/convert_to_xz.py | glebkuznetsov/cloudbiolinux | ec47b90ce72f6cd1bc4e5422231f19d41378b122 | [
"MIT"
] | 107 | 2015-01-06T06:10:04.000Z | 2022-02-10T17:25:34.000Z | #!/usr/bin/env python
"""Convert gzipped files on s3 biodata to xz compression format.
This conversion is designed to save time and space for download.
Some download utilities to speed things up:
axel, aria2, lftp
"""
import os
import sys
import socket
import subprocess
import boto
import fabric.api as fabric
if __... | 34.634921 | 85 | 0.64253 | #!/usr/bin/env python
"""Convert gzipped files on s3 biodata to xz compression format.
This conversion is designed to save time and space for download.
Some download utilities to speed things up:
axel, aria2, lftp
"""
import os
import sys
import socket
import subprocess
import boto
import fabric.api as fabric
def m... | 1,698 | 0 | 92 |
ef8c27e1cefe34dc5b34a9efd165229c09281d61 | 8,381 | py | Python | wyze_sdk/service/scale_service.py | RebelTat/wyze-sdk | 249b1df71e80c97fc2e5fb5977431b887f7361c2 | [
"Unlicense"
] | 132 | 2021-05-03T12:33:58.000Z | 2022-03-31T18:03:26.000Z | wyze_sdk/service/scale_service.py | RebelTat/wyze-sdk | 249b1df71e80c97fc2e5fb5977431b887f7361c2 | [
"Unlicense"
] | 51 | 2021-05-01T20:24:20.000Z | 2022-03-30T20:37:05.000Z | wyze_sdk/service/scale_service.py | RebelTat/wyze-sdk | 249b1df71e80c97fc2e5fb5977431b887f7361c2 | [
"Unlicense"
] | 21 | 2021-05-05T14:01:38.000Z | 2022-03-29T02:58:39.000Z | from __future__ import annotations
from datetime import datetime
from typing import Optional, Sequence, Tuple, Union
from wyze_sdk.models import datetime_to_epoch
from .base import ExServiceClient, WyzeResponse
class ScaleServiceClient(ExServiceClient):
"""
Scale service client is the wrapper on the reques... | 40.293269 | 206 | 0.635485 | from __future__ import annotations
from datetime import datetime
from typing import Optional, Sequence, Tuple, Union
from wyze_sdk.models import datetime_to_epoch
from .base import ExServiceClient, WyzeResponse
class ScaleServiceClient(ExServiceClient):
"""
Scale service client is the wrapper on the reques... | 735 | 0 | 54 |
9a240829f2fd3ac6b2f5b53c6e23ecb372c84fb8 | 2,343 | py | Python | api/migrations/0001_initial.py | lirandepira/winccoa-web | cf1eef22937956c46bbc4ef0e0ab1cc88cdea4b1 | [
"MIT"
] | null | null | null | api/migrations/0001_initial.py | lirandepira/winccoa-web | cf1eef22937956c46bbc4ef0e0ab1cc88cdea4b1 | [
"MIT"
] | null | null | null | api/migrations/0001_initial.py | lirandepira/winccoa-web | cf1eef22937956c46bbc4ef0e0ab1cc88cdea4b1 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.7 on 2018-07-06 14:37
from django.db import migrations, models
import django.db.models.deletion
| 42.6 | 114 | 0.556978 | # Generated by Django 2.0.7 on 2018-07-06 14:37
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Elements',
fields=[
... | 0 | 2,196 | 23 |
7d6eb927a7acd0fcfeabf330830474d337f8fc64 | 429 | py | Python | setup.py | msaltz96/wigs | 35b6bedbac670d48a5d0b088f681daf38756abfa | [
"Apache-2.0"
] | null | null | null | setup.py | msaltz96/wigs | 35b6bedbac670d48a5d0b088f681daf38756abfa | [
"Apache-2.0"
] | null | null | null | setup.py | msaltz96/wigs | 35b6bedbac670d48a5d0b088f681daf38756abfa | [
"Apache-2.0"
] | null | null | null | from setuptools import setup, find_packages
setup(
name="pre_wigs_validation",
version="0.1.0",
description="Pre-WIG Validator for Linux",
author="steno",
author_email="steno@amazon.com",
packages=find_packages(exclude=["tests"]),
include_package_data=True,
install_requires=... | 28.6 | 74 | 0.682984 | from setuptools import setup, find_packages
setup(
name="pre_wigs_validation",
version="0.1.0",
description="Pre-WIG Validator for Linux",
author="steno",
author_email="steno@amazon.com",
packages=find_packages(exclude=["tests"]),
include_package_data=True,
install_requires=... | 0 | 0 | 0 |
07391be648f1e47b967aff8fdaf3134d1e0d69b5 | 54,550 | py | Python | OED/cnn_seq2seq.py | adrianomundo/II2202-research-methodology-scientific-writing | 39a7a07e1dabbd988f9b3e0c5c41a36a6d292df8 | [
"Apache-2.0"
] | 1 | 2021-01-30T11:03:05.000Z | 2021-01-30T11:03:05.000Z | OED/cnn_seq2seq.py | adrianomundo/II2202-research-methodology-scientific-writing | 39a7a07e1dabbd988f9b3e0c5c41a36a6d292df8 | [
"Apache-2.0"
] | null | null | null | OED/cnn_seq2seq.py | adrianomundo/II2202-research-methodology-scientific-writing | 39a7a07e1dabbd988f9b3e0c5c41a36a6d292df8 | [
"Apache-2.0"
] | null | null | null | import pathlib
import sys
import tensorflow as tf
import numpy as np
from tensorflow.python.ops import init_ops
from tensorflow.python.ops.rnn_cell_impl import _Linear, LSTMStateTuple
from tensorflow.python.ops import variable_scope as vs
from utils import *
if __name__ == '__main__':
batch_num = 1
hidden_n... | 60.949721 | 201 | 0.486893 | import pathlib
import sys
import tensorflow as tf
import numpy as np
from tensorflow.python.ops import init_ops
from tensorflow.python.ops.rnn_cell_impl import _Linear, LSTMStateTuple
from tensorflow.python.ops import variable_scope as vs
from utils import *
def conv1d_relu(_x, _w, _b):
return tf.nn.relu(tf.nn.bi... | 5,232 | 0 | 92 |
7c3a1e64eb7f90975d8a37e4689e534e9971ded6 | 9,746 | py | Python | tests/parsers/sqlite_plugins/firefox.py | Defense-Cyber-Crime-Center/plaso | 4f3a85fbea10637c1cdbf0cde9fc539fdcea9c47 | [
"Apache-2.0"
] | 2 | 2016-02-18T12:46:29.000Z | 2022-03-13T03:04:59.000Z | tests/parsers/sqlite_plugins/firefox.py | Defense-Cyber-Crime-Center/plaso | 4f3a85fbea10637c1cdbf0cde9fc539fdcea9c47 | [
"Apache-2.0"
] | null | null | null | tests/parsers/sqlite_plugins/firefox.py | Defense-Cyber-Crime-Center/plaso | 4f3a85fbea10637c1cdbf0cde9fc539fdcea9c47 | [
"Apache-2.0"
] | 6 | 2016-12-18T08:05:36.000Z | 2021-04-06T14:19:11.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the Mozilla Firefox history database plugin."""
import collections
import unittest
from plaso.formatters import firefox as _ # pylint: disable=unused-import
from plaso.lib import eventdata
from plaso.lib import timelib
from plaso.parsers import sqlite
from plaso... | 37.057034 | 80 | 0.736199 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the Mozilla Firefox history database plugin."""
import collections
import unittest
from plaso.formatters import firefox as _ # pylint: disable=unused-import
from plaso.lib import eventdata
from plaso.lib import timelib
from plaso.parsers import sqlite
from plaso... | 0 | 0 | 0 |
b2ca930e892e3b76aaffe81353c72803618798b2 | 1,826 | py | Python | mgz/body/embedded.py | Namek/aoc-mgz | 0c8196dccb550a48ecc375d7861138ef88b53716 | [
"MIT"
] | 117 | 2015-03-07T10:55:58.000Z | 2022-03-18T18:22:01.000Z | mgz/body/embedded.py | Namek/aoc-mgz | 0c8196dccb550a48ecc375d7861138ef88b53716 | [
"MIT"
] | 71 | 2015-10-02T00:05:07.000Z | 2022-03-25T16:47:56.000Z | mgz/body/embedded.py | Namek/aoc-mgz | 0c8196dccb550a48ecc375d7861138ef88b53716 | [
"MIT"
] | 41 | 2015-03-07T02:50:59.000Z | 2021-09-13T06:16:12.000Z | """Embedded Structures.
Various structure can be embedded in the body, without an operation header.
Saved Chapters:
A saved chapter is a header structure embedded in the body.
There is no command identifier, so the command type is actually
the first field of the header - length/offset. Applying the `subheader`
struc... | 25.71831 | 77 | 0.651698 | """Embedded Structures.
Various structure can be embedded in the body, without an operation header.
Saved Chapters:
A saved chapter is a header structure embedded in the body.
There is no command identifier, so the command type is actually
the first field of the header - length/offset. Applying the `subheader`
struc... | 0 | 0 | 0 |
20fab8022fd83af53ea7e0c5365056dc64940d56 | 302 | py | Python | Alphabet/Small_Alphabet/Static_Small_Letters_For_Loop/FOR_LOOP_p.py | Polamreddykrishnareddy/PatternPackage | 893ab468a637cd70a0dd8f6d60f7f5c75a3db58f | [
"MIT"
] | null | null | null | Alphabet/Small_Alphabet/Static_Small_Letters_For_Loop/FOR_LOOP_p.py | Polamreddykrishnareddy/PatternPackage | 893ab468a637cd70a0dd8f6d60f7f5c75a3db58f | [
"MIT"
] | null | null | null | Alphabet/Small_Alphabet/Static_Small_Letters_For_Loop/FOR_LOOP_p.py | Polamreddykrishnareddy/PatternPackage | 893ab468a637cd70a0dd8f6d60f7f5c75a3db58f | [
"MIT"
] | null | null | null | #p
for row in range(13):
for col in range(6):
if (col==0 or row==0 and col!=5) or (row==1 and col==5)or (row==2 and col==5)or (row==3 and col==5)or (row==4 and col==5) or (row==5 and col!=5):#p
print("*",end=" ")
else:
print(" ",end=" ")
print()
| 33.555556 | 156 | 0.463576 | #p
for row in range(13):
for col in range(6):
if (col==0 or row==0 and col!=5) or (row==1 and col==5)or (row==2 and col==5)or (row==3 and col==5)or (row==4 and col==5) or (row==5 and col!=5):#p
print("*",end=" ")
else:
print(" ",end=" ")
print()
| 0 | 0 | 0 |
50300afeadf136fdce23a714dcbd8df510dd386c | 1,817 | py | Python | pdf_with_js/plugin.py | vuquangtrong/mkdocs-pdf-with-js-plugin | 38053565854f5322ecec34775c956f353011f895 | [
"MIT"
] | 1 | 2022-01-21T13:43:32.000Z | 2022-01-21T13:43:32.000Z | pdf_with_js/plugin.py | vuquangtrong/mkdocs-pdf-with-js-plugin | 38053565854f5322ecec34775c956f353011f895 | [
"MIT"
] | null | null | null | pdf_with_js/plugin.py | vuquangtrong/mkdocs-pdf-with-js-plugin | 38053565854f5322ecec34775c956f353011f895 | [
"MIT"
] | 1 | 2021-07-10T17:19:19.000Z | 2021-07-10T17:19:19.000Z |
from mkdocs.config import config_options
from mkdocs.plugins import BasePlugin
from pdf_with_js.printer import Printer
import random
| 28.390625 | 88 | 0.600991 |
from mkdocs.config import config_options
from mkdocs.plugins import BasePlugin
from pdf_with_js.printer import Printer
import random
class PdfWithJS(BasePlugin):
config_scheme = (
('enable', config_options.Type(bool, default=True)),
('add_download_button', config_options.Type(bool, de... | 1,057 | 595 | 24 |
29f37d595042f56159568888fa71e6a5a6d64268 | 1,110 | py | Python | prediction/src/tests/test_classification.py | yasiriqbal1/concept-to-clinic-1 | 3b7d34a6b31e8d3924934f3e5c990c49813c670e | [
"MIT"
] | 346 | 2017-08-04T12:26:11.000Z | 2018-10-16T06:51:45.000Z | prediction/src/tests/test_classification.py | yasiriqbal1/concept-to-clinic-1 | 3b7d34a6b31e8d3924934f3e5c990c49813c670e | [
"MIT"
] | 296 | 2017-08-02T10:17:05.000Z | 2018-07-31T05:29:43.000Z | prediction/src/tests/test_classification.py | yasiriqbal1/concept-to-clinic-1 | 3b7d34a6b31e8d3924934f3e5c990c49813c670e | [
"MIT"
] | 159 | 2017-08-04T07:34:52.000Z | 2018-10-16T18:34:08.000Z | from ..algorithms.classify import trained_model
| 37 | 99 | 0.744144 | from ..algorithms.classify import trained_model
def test_classify_predict_load(metaimage_path, model_path):
assert not trained_model.predict(metaimage_path, [], model_path)
def test_classify_dicom(dicom_paths, nodule_locations, model_path):
predicted = trained_model.predict(dicom_paths[0], nodule_locations,... | 942 | 0 | 115 |
51d712db70f6674f1a70dd0d199f6f41778c599a | 2,014 | py | Python | data_masking_methods/mask_the_info.py | GeorgeManakanatas/PPDM | 9e6af80681db497447197cac14b26b99e588f231 | [
"MIT",
"Unlicense"
] | 3 | 2016-11-18T07:24:39.000Z | 2019-07-06T07:45:15.000Z | data_masking_methods/mask_the_info.py | GeorgeManakanatas/PPDM | 9e6af80681db497447197cac14b26b99e588f231 | [
"MIT",
"Unlicense"
] | 2 | 2017-02-14T15:24:34.000Z | 2019-11-25T19:18:05.000Z | data_masking_methods/mask_the_info.py | GeorgeManakanatas/PPDM | 9e6af80681db497447197cac14b26b99e588f231 | [
"MIT",
"Unlicense"
] | 3 | 2017-12-19T07:04:24.000Z | 2021-08-20T15:42:13.000Z | '''
information masking section
'''
import logging
import timeit
from . import encrypt_the_info
from . import null_the_info
def masking_method_selection(start_dataframe, mask_col, mask_method,
save_to_file, masked_file, logger):
'''
Basic check that all input is properly provided ... | 38.730769 | 79 | 0.695631 | '''
information masking section
'''
import logging
import timeit
from . import encrypt_the_info
from . import null_the_info
def masking_method_selection(start_dataframe, mask_col, mask_method,
save_to_file, masked_file, logger):
'''
Basic check that all input is properly provided ... | 0 | 0 | 0 |
b7a2b031b62930c8b996cd893bd4bcce4bd6e6ea | 2,398 | py | Python | domains/deliver/problems/manual/problem5_OF.py | patras91/rae_release | 0e5faffb7eb732fdb8e3bbf2c6d2f2cbd520aa30 | [
"BSD-3-Clause"
] | 1 | 2021-09-28T12:56:56.000Z | 2021-09-28T12:56:56.000Z | domains/deliver/problems/manual/problem5_OF.py | patras91/rae_release | 0e5faffb7eb732fdb8e3bbf2c6d2f2cbd520aa30 | [
"BSD-3-Clause"
] | null | null | null | domains/deliver/problems/manual/problem5_OF.py | patras91/rae_release | 0e5faffb7eb732fdb8e3bbf2c6d2f2cbd520aa30 | [
"BSD-3-Clause"
] | 1 | 2022-03-31T16:30:39.000Z | 2022-03-31T16:30:39.000Z | __author__ = 'mason'
from domain_orderFulfillment import *
from timer import DURATION
from state import state
import numpy as np
'''
Several objects to choose from, need to consider weights
Same as problem 4 but only 1 robot
'''
DURATION.TIME = {
'lookupDB': GetCostOfLookup,
'wrap': GetCostOfWrap,
... | 24.469388 | 96 | 0.584654 | __author__ = 'mason'
from domain_orderFulfillment import *
from timer import DURATION
from state import state
import numpy as np
'''
Several objects to choose from, need to consider weights
Same as problem 4 but only 1 robot
'''
def GetCostOfMove(id, r, loc1, loc2, dist):
return 1 + dist
def GetCostOfLookup(i... | 893 | 0 | 161 |
d682a95c426da85437977b5f33eeeb297e0afda2 | 1,754 | py | Python | trackpal/visu.py | sommerc/trackpal | f62e6a4467af8a5988b5bce0c20872bc3e325cae | [
"BSD-3-Clause"
] | 1 | 2022-01-10T16:48:23.000Z | 2022-01-10T16:48:23.000Z | trackpal/visu.py | sommerc/trackpal | f62e6a4467af8a5988b5bce0c20872bc3e325cae | [
"BSD-3-Clause"
] | null | null | null | trackpal/visu.py | sommerc/trackpal | f62e6a4467af8a5988b5bce0c20872bc3e325cae | [
"BSD-3-Clause"
] | null | null | null | """Track visualization"""
from matplotlib import pyplot as plt
def plot_trj(
trj,
coords=None,
ax=None,
scale=None,
line_fmt="x:",
line_color=None,
line_label="Trajectory",
line_width=None,
marker_size=None,
alpha=None,
start_end=(True, True),
):
"""[summary]
Args... | 26.179104 | 98 | 0.566135 | """Track visualization"""
from matplotlib import pyplot as plt
def plot_trj(
trj,
coords=None,
ax=None,
scale=None,
line_fmt="x:",
line_color=None,
line_label="Trajectory",
line_width=None,
marker_size=None,
alpha=None,
start_end=(True, True),
):
"""[summary]
Args... | 0 | 0 | 0 |
9ade5536cc926d194f758f83ecb6495530677c35 | 6,136 | py | Python | src/gluonts/model/testutil.py | dotgc/gluon-ts | e14ad69058e58e1ce51c40551674318341781331 | [
"Apache-2.0"
] | 1 | 2021-08-03T09:09:31.000Z | 2021-08-03T09:09:31.000Z | src/gluonts/model/testutil.py | Happiness20/gluon-ts | e14ad69058e58e1ce51c40551674318341781331 | [
"Apache-2.0"
] | null | null | null | src/gluonts/model/testutil.py | Happiness20/gluon-ts | e14ad69058e58e1ce51c40551674318341781331 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... | 31.792746 | 79 | 0.636082 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... | 3,078 | 0 | 212 |
a55c169171ded7deb8167391e08f38271824a4d9 | 1,610 | py | Python | examples/oauth.py | Code-in-the-House/foursquare_api | 47f710802bad581d36c7e8ec28612bccf1f9fe41 | [
"MIT"
] | null | null | null | examples/oauth.py | Code-in-the-House/foursquare_api | 47f710802bad581d36c7e8ec28612bccf1f9fe41 | [
"MIT"
] | null | null | null | examples/oauth.py | Code-in-the-House/foursquare_api | 47f710802bad581d36c7e8ec28612bccf1f9fe41 | [
"MIT"
] | null | null | null | import pyfoursquare as foursquare
# == OAuth2 Authentication ==
#
# This mode of authentication is the required one for Foursquare
# The client id and client secret can be found on your application's Details
# page located at https://foursquare.com/oauth/
client_id = "E50NJYAFUAPXPAKU5XQNBTXPGKRRSNUGAYWTUUH3RKJ22HH4"... | 29.272727 | 76 | 0.77205 | import pyfoursquare as foursquare
# == OAuth2 Authentication ==
#
# This mode of authentication is the required one for Foursquare
# The client id and client secret can be found on your application's Details
# page located at https://foursquare.com/oauth/
client_id = "E50NJYAFUAPXPAKU5XQNBTXPGKRRSNUGAYWTUUH3RKJ22HH4"... | 0 | 0 | 0 |
2547d96a6a4b442bf0ff50913fed0095c52574cf | 438 | py | Python | Handin/handin2.py | thesombady/Fytb14 | e630e8d9ff4512849d124426b5754b6b44d89069 | [
"MIT"
] | null | null | null | Handin/handin2.py | thesombady/Fytb14 | e630e8d9ff4512849d124426b5754b6b44d89069 | [
"MIT"
] | null | null | null | Handin/handin2.py | thesombady/Fytb14 | e630e8d9ff4512849d124426b5754b6b44d89069 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
mg = 10
xlist = np.linspace(0,np.pi/2,100)
f1 = 3*mg/2*(np.sin(xlist)*np.cos(xlist)*3/2-np.cos(xlist))
f2 = 3*mg/2*(-np.sin(xlist)+(3*np.sin(xlist)**2-1)/2) + mg
plt.plot(xlist, f1, '-', markersize=1, label = r"$F_x$")
plt.plot(xlist, f2, '-', markersize=1, label = ... | 24.333333 | 59 | 0.643836 | import numpy as np
import matplotlib.pyplot as plt
mg = 10
xlist = np.linspace(0,np.pi/2,100)
f1 = 3*mg/2*(np.sin(xlist)*np.cos(xlist)*3/2-np.cos(xlist))
f2 = 3*mg/2*(-np.sin(xlist)+(3*np.sin(xlist)**2-1)/2) + mg
plt.plot(xlist, f1, '-', markersize=1, label = r"$F_x$")
plt.plot(xlist, f2, '-', markersize=1, label = ... | 0 | 0 | 0 |
c0d954c3b6047cbbc2c0a18b91acaa42bdc69750 | 1,323 | py | Python | graphs/tests/test_graphs.py | Sewar-web/data-structures-and-algorithms1 | d94f706fb3a30c114bd08a6c2d9b7ed269bc9a21 | [
"MIT"
] | null | null | null | graphs/tests/test_graphs.py | Sewar-web/data-structures-and-algorithms1 | d94f706fb3a30c114bd08a6c2d9b7ed269bc9a21 | [
"MIT"
] | null | null | null | graphs/tests/test_graphs.py | Sewar-web/data-structures-and-algorithms1 | d94f706fb3a30c114bd08a6c2d9b7ed269bc9a21 | [
"MIT"
] | 1 | 2021-06-26T09:19:43.000Z | 2021-06-26T09:19:43.000Z | from graphs import __version__
from graphs.graph import Vertix ,Edge,Graph
graph = Graph()
| 22.810345 | 104 | 0.568405 | from graphs import __version__
from graphs.graph import Vertix ,Edge,Graph
def test_version():
assert __version__ == '0.1.0'
graph = Graph()
def test_add_node():
graph.add_node('a')
assert graph.get_nodes()=={'a': []}
def test_edge():
graph=Graph()
graph.add_node('a')
graph.add_node('b')
... | 1,044 | 0 | 183 |
e065295369c34fdafb30ecef1f98567848098232 | 1,332 | py | Python | core/test.py | fazilaltinel/pytorch-dann-resnet | fe6abb274065c26c918d71c38babe2ec894d8293 | [
"MIT"
] | 4 | 2021-02-08T10:32:48.000Z | 2021-09-15T05:43:20.000Z | core/test.py | fazilaltinel/pytorch-dann-resnet | fe6abb274065c26c918d71c38babe2ec894d8293 | [
"MIT"
] | null | null | null | core/test.py | fazilaltinel/pytorch-dann-resnet | fe6abb274065c26c918d71c38babe2ec894d8293 | [
"MIT"
] | 2 | 2021-02-25T20:17:41.000Z | 2021-08-29T08:06:39.000Z | import torch.utils.data
import torch.nn as nn
def test(model, data_loader, device, loggi, flag):
"""Evaluate model for dataset."""
# set eval state for Dropout and BN layers
model.eval()
# init loss and accuracy
loss_ = 0.0
acc_ = 0.0
acc_domain_ = 0.0
n_total = 0
# set loss funct... | 29.6 | 149 | 0.605105 | import torch.utils.data
import torch.nn as nn
def test(model, data_loader, device, loggi, flag):
"""Evaluate model for dataset."""
# set eval state for Dropout and BN layers
model.eval()
# init loss and accuracy
loss_ = 0.0
acc_ = 0.0
acc_domain_ = 0.0
n_total = 0
# set loss funct... | 0 | 0 | 0 |
ab16331c01263b1f5184c5ed899245585e948a04 | 6,467 | py | Python | tests/licensedcode/data/datadriven/lic2/2206-misc-python/interval.py | s4-2/scancode-toolkit | 8931b42e2630b94d0cabc834dfb3c16f01f82321 | [
"Apache-2.0",
"CC-BY-4.0"
] | 1,511 | 2015-07-01T15:29:03.000Z | 2022-03-30T13:40:05.000Z | tests/licensedcode/data/datadriven/lic2/2206-misc-python/interval.py | s4-2/scancode-toolkit | 8931b42e2630b94d0cabc834dfb3c16f01f82321 | [
"Apache-2.0",
"CC-BY-4.0"
] | 2,695 | 2015-07-01T16:01:35.000Z | 2022-03-31T19:17:44.000Z | backend/env/lib/python3.7/site-packages/aniso8601/interval.py | US579/Seddit | 116a676efd0fa31c8cc6fe4c723b739203d9428b | [
"MIT"
] | 540 | 2015-07-01T15:08:19.000Z | 2022-03-31T12:13:11.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2019, Brandon Nielsen
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the BSD license. See the LICENSE file for details.
from aniso8601.builders import TupleBuilder
from aniso8601.builders.python import PythonTimeBuilder
from aniso... | 40.41875 | 79 | 0.613422 | # -*- coding: utf-8 -*-
# Copyright (c) 2019, Brandon Nielsen
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the BSD license. See the LICENSE file for details.
from aniso8601.builders import TupleBuilder
from aniso8601.builders.python import PythonTimeBuilder
from aniso... | 5,914 | 0 | 69 |
ee4087c26b6609704e5da238bf4a0da044dbb850 | 1,602 | py | Python | run.py | bri25yu/jiant | 88a21a9fed7f5e9d6a42a8129d2c63a2f8e0f30a | [
"MIT"
] | null | null | null | run.py | bri25yu/jiant | 88a21a9fed7f5e9d6a42a8129d2c63a2f8e0f30a | [
"MIT"
] | null | null | null | run.py | bri25yu/jiant | 88a21a9fed7f5e9d6a42a8129d2c63a2f8e0f30a | [
"MIT"
] | null | null | null | import argparse
from jiant.proj.simple import runscript as run
import jiant.scripts.download_data.runscript as downloader
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("-t", "--task_name")
parser.add_argument("-d", "--data_dir")
parser.add_argument("-e", "--exp_d... | 25.83871 | 75 | 0.6598 | import argparse
from jiant.proj.simple import runscript as run
import jiant.scripts.download_data.runscript as downloader
def main(
task_name,
data_dir,
exp_dir,
model_name_or_path,
compression_type,
compression_config,
learning_rate,
seed,
):
downloader.download_data([task_name],... | 693 | 0 | 23 |
98670a49ae2d29567afb74eef9cd125362c57e38 | 10,350 | py | Python | main/views.py | sirodoht/oscarator.com | 5c20e38a0db4d8937e849e493c698767ce49d2ba | [
"MIT"
] | 1 | 2022-02-16T21:47:20.000Z | 2022-02-16T21:47:20.000Z | main/views.py | sirodoht/oscarator.com | 5c20e38a0db4d8937e849e493c698767ce49d2ba | [
"MIT"
] | 3 | 2022-02-16T13:40:59.000Z | 2022-02-16T13:42:23.000Z | main/views.py | sirodoht/oscarator.com | 5c20e38a0db4d8937e849e493c698767ce49d2ba | [
"MIT"
] | null | null | null | from django.contrib import messages
from django.contrib.auth import authenticate, login as dj_login, logout as dj_logout
from django.contrib.auth.decorators import login_required
from django.contrib.auth.forms import (
AuthenticationForm,
PasswordChangeForm,
PasswordResetForm,
SetPasswordForm,
)
from dj... | 35.204082 | 129 | 0.608986 | from django.contrib import messages
from django.contrib.auth import authenticate, login as dj_login, logout as dj_logout
from django.contrib.auth.decorators import login_required
from django.contrib.auth.forms import (
AuthenticationForm,
PasswordChangeForm,
PasswordResetForm,
SetPasswordForm,
)
from dj... | 8,999 | 0 | 198 |
101fcee678ce67d5dc1b945bc5521cc6e6232b86 | 98 | py | Python | clitooltester/__init__.py | dfirlabs/clitooltester | ffe23b7b7458212d150390f476cda74e89fc97e1 | [
"Apache-2.0"
] | null | null | null | clitooltester/__init__.py | dfirlabs/clitooltester | ffe23b7b7458212d150390f476cda74e89fc97e1 | [
"Apache-2.0"
] | null | null | null | clitooltester/__init__.py | dfirlabs/clitooltester | ffe23b7b7458212d150390f476cda74e89fc97e1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Command line tool tester (CLIToolTester)."""
__version__ = '20191217'
| 19.6 | 47 | 0.642857 | # -*- coding: utf-8 -*-
"""Command line tool tester (CLIToolTester)."""
__version__ = '20191217'
| 0 | 0 | 0 |
5c1f339722fbcdb5287bb5f5decebeea9ca758b7 | 331 | py | Python | users/migrations/0004_remove_profile_user.py | piotrzegarek/Numerical-computational-Site | 3c18ca1086135eddb23dfbe015882708e1e0c321 | [
"MIT"
] | 1 | 2021-12-03T15:51:49.000Z | 2021-12-03T15:51:49.000Z | users/migrations/0004_remove_profile_user.py | piotrzegarek/Numerical-computational-Site | 3c18ca1086135eddb23dfbe015882708e1e0c321 | [
"MIT"
] | null | null | null | users/migrations/0004_remove_profile_user.py | piotrzegarek/Numerical-computational-Site | 3c18ca1086135eddb23dfbe015882708e1e0c321 | [
"MIT"
] | 1 | 2021-12-03T15:52:37.000Z | 2021-12-03T15:52:37.000Z | # Generated by Django 3.2.9 on 2021-12-20 20:36
from django.db import migrations
| 18.388889 | 51 | 0.595166 | # Generated by Django 3.2.9 on 2021-12-20 20:36
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0003_delete_user_profile_user'),
]
operations = [
migrations.RemoveField(
model_name='profile',
name='user',
... | 0 | 225 | 23 |
6dfdc54ff94e2ff04365c1be87003f5d42e21011 | 6,657 | py | Python | dci_downloader/api.py | redhat-cip/dci-downloader | d7ad184f502e145b9ccf2618b8af6d82ac7daa8a | [
"Apache-2.0"
] | null | null | null | dci_downloader/api.py | redhat-cip/dci-downloader | d7ad184f502e145b9ccf2618b8af6d82ac7daa8a | [
"Apache-2.0"
] | 3 | 2019-10-30T20:39:06.000Z | 2021-03-31T07:55:00.000Z | dci_downloader/api.py | redhat-cip/dci-downloader | d7ad184f502e145b9ccf2618b8af6d82ac7daa8a | [
"Apache-2.0"
] | 2 | 2020-01-12T05:27:00.000Z | 2020-06-19T02:39:24.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import requests
import sys
import time
from functools import wraps
from multiprocessing import Pool
from dci_downloader.fs import create_parent_dir
from dciclient.v1.api.context import build_signature_context
from dciclient.v1.api import component as dci_compone... | 29.852018 | 87 | 0.633018 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import requests
import sys
import time
from functools import wraps
from multiprocessing import Pool
from dci_downloader.fs import create_parent_dir
from dciclient.v1.api.context import build_signature_context
from dciclient.v1.api import component as dci_compone... | 5,698 | 0 | 342 |
d5ff2fd7abf3a164f7893984f9e9753ff69d86e5 | 56 | py | Python | apps/categories/__init__.py | ExpoAshique/ProveBanking__s | f0b45fffea74d00d14014be27aa50fe5f42f6903 | [
"MIT"
] | null | null | null | apps/categories/__init__.py | ExpoAshique/ProveBanking__s | f0b45fffea74d00d14014be27aa50fe5f42f6903 | [
"MIT"
] | null | null | null | apps/categories/__init__.py | ExpoAshique/ProveBanking__s | f0b45fffea74d00d14014be27aa50fe5f42f6903 | [
"MIT"
] | null | null | null | default_app_config = 'categories.apps.CategoriesConfig'
| 28 | 55 | 0.857143 | default_app_config = 'categories.apps.CategoriesConfig'
| 0 | 0 | 0 |
bfc96a64d5994b6250f5d552e7ec22eab2022391 | 108 | py | Python | rbcz/__init__.py | smcl/rbcz.py | 2bcdea1e12d3800d4b9b3e1d3523dec43bf3026b | [
"MIT"
] | null | null | null | rbcz/__init__.py | smcl/rbcz.py | 2bcdea1e12d3800d4b9b3e1d3523dec43bf3026b | [
"MIT"
] | null | null | null | rbcz/__init__.py | smcl/rbcz.py | 2bcdea1e12d3800d4b9b3e1d3523dec43bf3026b | [
"MIT"
] | 2 | 2016-10-11T16:04:15.000Z | 2022-03-02T10:26:42.000Z | # flake8: noqa
from .rbcz import (
read_statement,
read_statements,
read_statements_from_imap
)
| 15.428571 | 29 | 0.722222 | # flake8: noqa
from .rbcz import (
read_statement,
read_statements,
read_statements_from_imap
)
| 0 | 0 | 0 |
01d9136911dbdb303db7d50afa63b120f335fc5a | 405 | py | Python | 1017/main.py | pauvrepetit/leetcode | 6ad093cf543addc4dfa52d72a8e3c0d05a23b771 | [
"MIT"
] | null | null | null | 1017/main.py | pauvrepetit/leetcode | 6ad093cf543addc4dfa52d72a8e3c0d05a23b771 | [
"MIT"
] | null | null | null | 1017/main.py | pauvrepetit/leetcode | 6ad093cf543addc4dfa52d72a8e3c0d05a23b771 | [
"MIT"
] | null | null | null | # 1017. 负二进制转换
#
# 20200801
# huao
# 观察奇数位上的1,如果该位置为1,那么使用负二进制表示时,会比实际二进制时少2**(i+1)
# 把这个差值加进去,并进行处理加完以后的值
# 处理完以后,得到的数字的二进制表示就是原数的负二进制表示
sol = Solution()
print(sol.baseNeg2(4))
| 19.285714 | 50 | 0.511111 | # 1017. 负二进制转换
#
# 20200801
# huao
# 观察奇数位上的1,如果该位置为1,那么使用负二进制表示时,会比实际二进制时少2**(i+1)
# 把这个差值加进去,并进行处理加完以后的值
# 处理完以后,得到的数字的二进制表示就是原数的负二进制表示
class Solution:
def baseNeg2(self, N: int) -> str:
i = 0
while N >= (1 << i):
if i % 2 == 1 and (N & (1 << i) != 0):
N += (2 << i)
... | 182 | -6 | 49 |
4006b5f5866aa4c23e9a2b16b930191035e700e8 | 287 | py | Python | back/utils/types/chat.py | azakharau/chatify | 8e85285ecbac8e1dac5b14af7b2b591ba3ccc1c2 | [
"MIT"
] | null | null | null | back/utils/types/chat.py | azakharau/chatify | 8e85285ecbac8e1dac5b14af7b2b591ba3ccc1c2 | [
"MIT"
] | null | null | null | back/utils/types/chat.py | azakharau/chatify | 8e85285ecbac8e1dac5b14af7b2b591ba3ccc1c2 | [
"MIT"
] | null | null | null | import typing
from dataclasses import dataclass
from utils.mixins import DataMixin
@dataclass()
| 22.076923 | 43 | 0.738676 | import typing
from dataclasses import dataclass
from utils.mixins import DataMixin
@dataclass()
class Chat(DataMixin):
id: typing.Optional[int] = None
username: typing.Optional[str] = None
first_name: typing.Optional[str] = None
last_name: typing.Optional[str] = None
| 0 | 166 | 22 |
ae37de956d3521db164fb139cc78bd28636dc393 | 4,194 | py | Python | fmfexporter/adapters/polarion/connectors/jira/fmf_jira.py | rh-messaging-qe/fmfexporter | a2db70bf5d3e89d418063b1890924e6ec7cbeed6 | [
"Apache-2.0"
] | 4 | 2019-02-15T11:44:01.000Z | 2021-08-20T16:46:30.000Z | fmfexporter/adapters/polarion/connectors/jira/fmf_jira.py | rh-messaging-qe/fmfexporter | a2db70bf5d3e89d418063b1890924e6ec7cbeed6 | [
"Apache-2.0"
] | 14 | 2019-02-14T18:51:04.000Z | 2020-01-16T14:12:45.000Z | fmfexporter/adapters/polarion/connectors/jira/fmf_jira.py | rh-messaging-qe/fmfexporter | a2db70bf5d3e89d418063b1890924e6ec7cbeed6 | [
"Apache-2.0"
] | 2 | 2019-02-25T10:06:54.000Z | 2019-05-06T20:26:16.000Z | import configparser
import jira
class JiraConfig(object):
"""
PolarionConfig represents data that must be provided through
config (ini) file (to enable communication with the polarion importer APIs)
"""
KEY_SECTION = 'jira'
KEY_PROJECT = 'project'
KEY_URL = 'url'
KEY_USERNAME = 'username... | 34.377049 | 120 | 0.584883 | import configparser
import jira
class JiraConfig(object):
"""
PolarionConfig represents data that must be provided through
config (ini) file (to enable communication with the polarion importer APIs)
"""
KEY_SECTION = 'jira'
KEY_PROJECT = 'project'
KEY_URL = 'url'
KEY_USERNAME = 'username... | 1,934 | 176 | 50 |
77527d7a3513596852d1eb0ff8d8935a98e0cc26 | 67 | py | Python | Lib/ensurepip/__main__.py | Hadron/python | 73137f499ed658169f49273eee46845e3b53e800 | [
"PSF-2.0"
] | 2,557 | 2016-07-19T22:20:45.000Z | 2022-01-25T10:53:35.000Z | build/cmd/win32/Python27/Lib/ensurepip/__main__.py | IamBaoMouMou/AliOS-Things | 195a9160b871b3d78de6f8cf6c2ab09a71977527 | [
"Apache-2.0"
] | 1,360 | 2016-07-20T02:06:42.000Z | 2021-07-27T12:46:40.000Z | build/cmd/win32/Python27/Lib/ensurepip/__main__.py | IamBaoMouMou/AliOS-Things | 195a9160b871b3d78de6f8cf6c2ab09a71977527 | [
"Apache-2.0"
] | 607 | 2016-07-20T03:34:04.000Z | 2022-01-05T14:57:09.000Z | import ensurepip
if __name__ == "__main__":
ensurepip._main()
| 13.4 | 26 | 0.701493 | import ensurepip
if __name__ == "__main__":
ensurepip._main()
| 0 | 0 | 0 |
a84cd8dc54134f048fe048f26a419cfc349e13ac | 1,742 | py | Python | configuration.py | sayatul/trytond-sale-payment-gateway | 7ddcc77d946f4e3a71944477c3e83d7d06866cf7 | [
"BSD-3-Clause"
] | null | null | null | configuration.py | sayatul/trytond-sale-payment-gateway | 7ddcc77d946f4e3a71944477c3e83d7d06866cf7 | [
"BSD-3-Clause"
] | 6 | 2015-09-05T00:18:30.000Z | 2016-11-14T07:57:14.000Z | configuration.py | sayatul/trytond-sale-payment-gateway | 7ddcc77d946f4e3a71944477c3e83d7d06866cf7 | [
"BSD-3-Clause"
] | 15 | 2015-08-11T13:01:31.000Z | 2017-07-14T06:36:21.000Z | # -*- coding: utf-8 -*-
from trytond.model import fields
from trytond.pool import PoolMeta
__metaclass__ = PoolMeta
__all__ = ['SaleConfiguration']
| 27.650794 | 69 | 0.633754 | # -*- coding: utf-8 -*-
from trytond.model import fields
from trytond.pool import PoolMeta
__metaclass__ = PoolMeta
__all__ = ['SaleConfiguration']
class SaleConfiguration:
__name__ = "sale.configuration"
payment_authorize_on = fields.Selection(
"get_authorize_options", "Authorize payments", require... | 1,000 | 569 | 23 |
c8d43407f8c0512e2138628dadf82f2039fd8241 | 3,383 | py | Python | polimorfo/utils/maskutils.py | ciuffredaluca/polimorfo | 3a18b9fe95c5843c2f9528812109a40412db6ba9 | [
"Apache-2.0"
] | 3 | 2020-02-03T09:29:55.000Z | 2020-10-29T16:38:01.000Z | polimorfo/utils/maskutils.py | ciuffredaluca/polimorfo | 3a18b9fe95c5843c2f9528812109a40412db6ba9 | [
"Apache-2.0"
] | 164 | 2020-02-06T16:09:34.000Z | 2022-03-01T14:44:09.000Z | polimorfo/utils/maskutils.py | ciuffredaluca/polimorfo | 3a18b9fe95c5843c2f9528812109a40412db6ba9 | [
"Apache-2.0"
] | 5 | 2020-02-19T15:04:44.000Z | 2021-11-17T15:31:48.000Z | import cv2
import numpy as np
import pycocotools.mask as mask_util
from matplotlib.pyplot import contour
__all__ = [
"mask_to_polygon",
"polygons_to_mask",
"area",
"bbox",
"coco_poygons_to_mask",
]
def mask_to_polygon(
mask, min_score: float = 0.5, approx: float = 0.0, relative: bool = True
)... | 27.958678 | 146 | 0.618386 | import cv2
import numpy as np
import pycocotools.mask as mask_util
from matplotlib.pyplot import contour
__all__ = [
"mask_to_polygon",
"polygons_to_mask",
"area",
"bbox",
"coco_poygons_to_mask",
]
def mask_to_polygon(
mask, min_score: float = 0.5, approx: float = 0.0, relative: bool = True
)... | 610 | 0 | 69 |
14fb4704b2aa70285eb22f68b4c42da396f281c5 | 340 | py | Python | configs/local_variables.py | AhmedStohy/EagerMOT | 59569a5f8ab350c82ac4b45216571c780a444fc1 | [
"MIT"
] | null | null | null | configs/local_variables.py | AhmedStohy/EagerMOT | 59569a5f8ab350c82ac4b45216571c780a444fc1 | [
"MIT"
] | null | null | null | configs/local_variables.py | AhmedStohy/EagerMOT | 59569a5f8ab350c82ac4b45216571c780a444fc1 | [
"MIT"
] | null | null | null | MOUNT_PATH = "" # in case you are mounting data storage externally
SPLIT = 'training'
KITTI_WORK_DIR = "./"
KITTI_DATA_DIR = "../input/kitti-3d-object-detection-dataset"
NUSCENES_WORK_DIR = MOUNT_PATH + "/storage/slurm/kimal/eagermot_workspace/nuscenes"
NUSCENES_DATA_DIR = MOUNT_PATH + "/storage/slurm/kimal/datasets... | 37.777778 | 83 | 0.779412 | MOUNT_PATH = "" # in case you are mounting data storage externally
SPLIT = 'training'
KITTI_WORK_DIR = "./"
KITTI_DATA_DIR = "../input/kitti-3d-object-detection-dataset"
NUSCENES_WORK_DIR = MOUNT_PATH + "/storage/slurm/kimal/eagermot_workspace/nuscenes"
NUSCENES_DATA_DIR = MOUNT_PATH + "/storage/slurm/kimal/datasets... | 0 | 0 | 0 |
86159c4cd3091b817a2ba5bb813ab8ddb70374f0 | 12,566 | py | Python | src/prism-fruit/Games-DQL/examples/games/car/networkx/algorithms/isomorphism/matchhelpers.py | kushgrover/apt-vs-dift | 250f64e6c442f6018cab65ec6979d9568a842f57 | [
"MIT"
] | null | null | null | src/prism-fruit/Games-DQL/examples/games/car/networkx/algorithms/isomorphism/matchhelpers.py | kushgrover/apt-vs-dift | 250f64e6c442f6018cab65ec6979d9568a842f57 | [
"MIT"
] | null | null | null | src/prism-fruit/Games-DQL/examples/games/car/networkx/algorithms/isomorphism/matchhelpers.py | kushgrover/apt-vs-dift | 250f64e6c442f6018cab65ec6979d9568a842f57 | [
"MIT"
] | null | null | null | """Functions which help end users define customize node_match and
edge_match functions to use during isomorphism checks.
"""
from itertools import permutations
import types
import networkx as nx
__all__ = ['categorical_node_match',
'categorical_edge_match',
'categorical_multiedge_match',... | 36.213256 | 87 | 0.614993 | """Functions which help end users define customize node_match and
edge_match functions to use during isomorphism checks.
"""
from itertools import permutations
import types
import networkx as nx
__all__ = ['categorical_node_match',
'categorical_edge_match',
'categorical_multiedge_match',... | 4,777 | 0 | 187 |
0fecc9d9f31301ad24bcca0b4ce46445f90eacb9 | 2,471 | py | Python | xyzspaces/exceptions.py | isaac-philip/xyz-spaces-python | 67b06efdc4a76934c54c1a828087a27cad26aa5d | [
"Apache-2.0"
] | 1 | 2021-02-20T10:14:36.000Z | 2021-02-20T10:14:36.000Z | xyzspaces/exceptions.py | GhostUser/xyz-spaces-python | 646aaa74a180871318f3e9aa12acc8e25a1f3b33 | [
"Apache-2.0"
] | null | null | null | xyzspaces/exceptions.py | GhostUser/xyz-spaces-python | 646aaa74a180871318f3e9aa12acc8e25a1f3b33 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2019-2020 HERE Europe B.V.
#
# 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 t... | 33.391892 | 80 | 0.673007 | # Copyright (C) 2019-2020 HERE Europe B.V.
#
# 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 t... | 0 | 0 | 0 |
4f6b026bc1bf782ffd0f6ba994d47f95685a42c3 | 1,482 | py | Python | utils/parse_action.py | liu4lin/UniRE | fb31801161758e50762f9a70820b71aefb5c5515 | [
"MIT"
] | 87 | 2021-07-12T02:35:50.000Z | 2022-03-31T12:44:49.000Z | utils/parse_action.py | liu4lin/UniRE | fb31801161758e50762f9a70820b71aefb5c5515 | [
"MIT"
] | 10 | 2021-07-29T01:35:50.000Z | 2022-03-03T04:05:42.000Z | utils/parse_action.py | liu4lin/UniRE | fb31801161758e50762f9a70820b71aefb5c5515 | [
"MIT"
] | 12 | 2021-07-18T09:06:07.000Z | 2022-03-31T12:44:51.000Z | import configargparse
import logging
import os
class StoreLoggingLevelAction(configargparse.Action):
"""This class converts string into logging level
"""
LEVELS = {
'CRITICAL': logging.CRITICAL,
'ERROR': logging.ERROR,
'WARNING': logging.WARNING,
'INFO': logging.INFO,
... | 31.531915 | 79 | 0.645074 | import configargparse
import logging
import os
class StoreLoggingLevelAction(configargparse.Action):
"""This class converts string into logging level
"""
LEVELS = {
'CRITICAL': logging.CRITICAL,
'ERROR': logging.ERROR,
'WARNING': logging.WARNING,
'INFO': logging.INFO,
... | 218 | 0 | 54 |
6d88e4a24d0a05e8b054112c932ce362d81cabbe | 7,811 | py | Python | neutron_lbaas_dashboard/dashboards/project/loadbalancersv2/workflows/update_lb.py | mail2nsrajesh/neutron-lbaas-dashboard | 789e7cea2d949960114754614a63c4a4ef2f0c11 | [
"Apache-2.0"
] | null | null | null | neutron_lbaas_dashboard/dashboards/project/loadbalancersv2/workflows/update_lb.py | mail2nsrajesh/neutron-lbaas-dashboard | 789e7cea2d949960114754614a63c4a4ef2f0c11 | [
"Apache-2.0"
] | null | null | null | neutron_lbaas_dashboard/dashboards/project/loadbalancersv2/workflows/update_lb.py | mail2nsrajesh/neutron-lbaas-dashboard | 789e7cea2d949960114754614a63c4a4ef2f0c11 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015, eBay Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 40.682292 | 79 | 0.547433 | # Copyright 2015, eBay Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 3,222 | 3,599 | 161 |
82b8b737fabe070987bf8bb0715e662f67642ee9 | 40,874 | py | Python | BootloaderCorePkg/Tools/CfgDataTool.py | liux2085/slimbootloader | 24a16ac20eb86b64135843074f9a85d6e60ab54a | [
"BSD-2-Clause-NetBSD",
"PSF-2.0",
"BSD-2-Clause",
"Apache-2.0",
"MIT",
"BSD-2-Clause-Patent"
] | 1 | 2021-12-30T17:05:53.000Z | 2021-12-30T17:05:53.000Z | BootloaderCorePkg/Tools/CfgDataTool.py | liux2085/slimbootloader | 24a16ac20eb86b64135843074f9a85d6e60ab54a | [
"BSD-2-Clause-NetBSD",
"PSF-2.0",
"BSD-2-Clause",
"Apache-2.0",
"MIT",
"BSD-2-Clause-Patent"
] | null | null | null | BootloaderCorePkg/Tools/CfgDataTool.py | liux2085/slimbootloader | 24a16ac20eb86b64135843074f9a85d6e60ab54a | [
"BSD-2-Clause-NetBSD",
"PSF-2.0",
"BSD-2-Clause",
"Apache-2.0",
"MIT",
"BSD-2-Clause-Patent"
] | null | null | null | ## @ CfgDataTool.py
#
# Copyright (c) 2017 - 2020, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
import sys
import collections
sys.dont_write_bytecode = True
from IfwiUtility import *
from CommonUtility import *
CFGDATA_INT_GUID = b'\xD0\x6C\x6E\x01\x34\x48\x7E\x4... | 42.844864 | 261 | 0.589103 | ## @ CfgDataTool.py
#
# Copyright (c) 2017 - 2020, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
import sys
import collections
sys.dont_write_bytecode = True
from IfwiUtility import *
from CommonUtility import *
CFGDATA_INT_GUID = b'\xD0\x6C\x6E\x01\x34\x48\x7E\x4... | 38,250 | 2,010 | 207 |
4c3038da2879a528c4bde532c6d49541704ed5cb | 1,182 | py | Python | src/eve_utils/skel/win-svc/win_service.py | pointw-dev/eve-utils | 2af7d28232e0d22975cc8141fda27a3870694223 | [
"MIT"
] | null | null | null | src/eve_utils/skel/win-svc/win_service.py | pointw-dev/eve-utils | 2af7d28232e0d22975cc8141fda27a3870694223 | [
"MIT"
] | null | null | null | src/eve_utils/skel/win-svc/win_service.py | pointw-dev/eve-utils | 2af7d28232e0d22975cc8141fda27a3870694223 | [
"MIT"
] | null | null | null | import win32serviceutil
import win32service
import win32event
import servicemanager
from eve_service import EveService
if __name__ == '__main__':
win32serviceutil.HandleCommandLine(EveWindowsService)
| 31.945946 | 107 | 0.709814 | import win32serviceutil
import win32service
import win32event
import servicemanager
from eve_service import EveService
class EveWindowsService(win32serviceutil.ServiceFramework):
_svc_name_ = "{$project_name}"
_svc_display_name_ = "{$project_name} API"
# _svc_description_ = "Service description goes here... | 649 | 302 | 23 |
711ca7392e0cd8dddd20d6ed9ebbcc510f934cf0 | 212 | py | Python | dyrapy/tests/test_load_ouvidoria.py | rafasgj/dyrapy | 14e1af5ee05c98e2e2aaf0e5c58525161a19e81c | [
"BSD-3-Clause"
] | null | null | null | dyrapy/tests/test_load_ouvidoria.py | rafasgj/dyrapy | 14e1af5ee05c98e2e2aaf0e5c58525161a19e81c | [
"BSD-3-Clause"
] | 15 | 2020-12-10T17:56:13.000Z | 2020-12-24T20:45:56.000Z | dyrapy/tests/test_load_ouvidoria.py | rafasgj/dyrapy | 14e1af5ee05c98e2e2aaf0e5c58525161a19e81c | [
"BSD-3-Clause"
] | 1 | 2021-01-10T23:46:22.000Z | 2021-01-10T23:46:22.000Z | # Copyright (c) 2020 Marco Mangan <marco.mangan@gmail.com>
# License: BSD 3 clause
from dyrapy.datasets import load_ouvidoria
| 21.2 | 58 | 0.745283 | # Copyright (c) 2020 Marco Mangan <marco.mangan@gmail.com>
# License: BSD 3 clause
from dyrapy.datasets import load_ouvidoria
def test_load_ouvidoria():
data = load_ouvidoria()
assert data is not None
| 61 | 0 | 23 |
c2f1ebc02477d71494c8090daa7cd99f87a2a44c | 3,698 | py | Python | tests/test_core.py | beasteers/tflit | 4fec6255c9fc6d406ec4df3df70dfc282eca0c46 | [
"MIT"
] | 7 | 2020-11-22T08:08:56.000Z | 2022-03-18T13:00:43.000Z | tests/test_core.py | beasteers/tflit | 4fec6255c9fc6d406ec4df3df70dfc282eca0c46 | [
"MIT"
] | 2 | 2021-07-06T07:56:30.000Z | 2021-10-05T21:11:21.000Z | tests/test_core.py | beasteers/tflit | 4fec6255c9fc6d406ec4df3df70dfc282eca0c46 | [
"MIT"
] | 2 | 2020-12-06T19:33:47.000Z | 2021-03-11T11:34:56.000Z | import os
import glob
import json
import tflit
import pytest
import numpy as np
model_dir = os.path.join(os.path.dirname(__file__), 'models')
model_file = os.path.join(model_dir, '{}.tflite')
model_info_file = os.path.join(model_dir, '{}.json')
@pytest.mark.parametrize('name', [
os.path.splitext(os.path.basena... | 31.606838 | 104 | 0.688751 | import os
import glob
import json
import tflit
import pytest
import numpy as np
model_dir = os.path.join(os.path.dirname(__file__), 'models')
model_file = os.path.join(model_dir, '{}.tflite')
model_info_file = os.path.join(model_dir, '{}.json')
@pytest.mark.parametrize('name', [
os.path.splitext(os.path.basena... | 3,208 | 0 | 91 |
7a7b2acdee66b15f486f0fa8d28ad92cce760ee9 | 518 | py | Python | game.py | chirag1992m/AdversarialShortestPathGame | 0af125eb17aa3c4587a314486e9a6854c771e119 | [
"MIT"
] | 2 | 2017-10-01T11:05:12.000Z | 2017-10-05T22:36:29.000Z | game.py | chirag1992m/AdversarialShortestPathGame | 0af125eb17aa3c4587a314486e9a6854c771e119 | [
"MIT"
] | null | null | null | game.py | chirag1992m/AdversarialShortestPathGame | 0af125eb17aa3c4587a314486e9a6854c771e119 | [
"MIT"
] | null | null | null | import argparse
from core.game_looper import GameLooper
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Run the Adversarial Game Server.")
parser.add_argument('--port', '--p', type=int, default=8080, help='Port to run the server on')
parser.add_argument('--game-file', default='sa... | 32.375 | 98 | 0.677606 | import argparse
from core.game_looper import GameLooper
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Run the Adversarial Game Server.")
parser.add_argument('--port', '--p', type=int, default=8080, help='Port to run the server on')
parser.add_argument('--game-file', default='sa... | 0 | 0 | 0 |
19626e7eeaefb2748ef981d8cb658a323ff5ccdd | 11,615 | py | Python | lib_auth.py | kwinkunks/modelr_app | 3ada397e562b5c7e43048b3fa4b632bad9ab1dda | [
"Apache-2.0"
] | null | null | null | lib_auth.py | kwinkunks/modelr_app | 3ada397e562b5c7e43048b3fa4b632bad9ab1dda | [
"Apache-2.0"
] | null | null | null | lib_auth.py | kwinkunks/modelr_app | 3ada397e562b5c7e43048b3fa4b632bad9ab1dda | [
"Apache-2.0"
] | 1 | 2020-06-29T05:06:10.000Z | 2020-06-29T05:06:10.000Z | """
Functions related user logins, signups, password authentications,
logouts, etc ...
"""
from lib_db import User, UserID, Group, VerifyUser
from google.appengine.api import mail
import hashlib
import random
import re
import string
import stripe
PASS_RE = re.compile(r"^.{3,20}$")
EMAIL_RE = re.compile(r"^[\S]+@[\S]+\... | 27.920673 | 109 | 0.606974 | """
Functions related user logins, signups, password authentications,
logouts, etc ...
"""
from lib_db import User, UserID, Group, VerifyUser
from google.appengine.api import mail
import hashlib
import random
import re
import string
import stripe
PASS_RE = re.compile(r"^.{3,20}$")
EMAIL_RE = re.compile(r"^[\S]+@[\S]+\... | 938 | 47 | 98 |
c50c7e581651abdcce05c979c772b57ce8ec489d | 689 | py | Python | MODBUS_RTU_3.py | pratikgharte/Python_GUI_EC_PH | 5dd6a166ffc59a55a45e711481261644879a3d8a | [
"MIT"
] | null | null | null | MODBUS_RTU_3.py | pratikgharte/Python_GUI_EC_PH | 5dd6a166ffc59a55a45e711481261644879a3d8a | [
"MIT"
] | null | null | null | MODBUS_RTU_3.py | pratikgharte/Python_GUI_EC_PH | 5dd6a166ffc59a55a45e711481261644879a3d8a | [
"MIT"
] | null | null | null | from pymodbus.client.sync import ModbusSerialClient
client = ModbusSerialClient(
method='rtu',
port='/dev/ttyS0',
baudrate=9600,
timeout=3,
parity='N',
stopbits=1,
bytesize=8
)
if client.connect(): # Trying for connect to Modbus Server/Slave
'''Reading from a holding register with the... | 26.5 | 67 | 0.674891 | from pymodbus.client.sync import ModbusSerialClient
client = ModbusSerialClient(
method='rtu',
port='/dev/ttyS0',
baudrate=9600,
timeout=3,
parity='N',
stopbits=1,
bytesize=8
)
if client.connect(): # Trying for connect to Modbus Server/Slave
'''Reading from a holding register with the... | 0 | 0 | 0 |
1b04120573fe644b3ee867b0c0f0d3fb5ecc57f5 | 74,685 | py | Python | subject/tests/integration/legacy_functional/test_v1_api.py | laoyigrace/subject | e6ed989fdc250917a19788112b22322b73b3550f | [
"Apache-2.0"
] | null | null | null | subject/tests/integration/legacy_functional/test_v1_api.py | laoyigrace/subject | e6ed989fdc250917a19788112b22322b73b3550f | [
"Apache-2.0"
] | null | null | null | subject/tests/integration/legacy_functional/test_v1_api.py | laoyigrace/subject | e6ed989fdc250917a19788112b22322b73b3550f | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 43.070934 | 83 | 0.581255 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 34,972 | 38,619 | 180 |
da4c3a059b82cec21a272172a71fea3e27b71ddf | 14,056 | py | Python | runexp.py | behzadhaghgoo/roper | c420f468d869c3a3ad3c6cc0b4dcb74049eba302 | [
"MIT"
] | null | null | null | runexp.py | behzadhaghgoo/roper | c420f468d869c3a3ad3c6cc0b4dcb74049eba302 | [
"MIT"
] | null | null | null | runexp.py | behzadhaghgoo/roper | c420f468d869c3a3ad3c6cc0b4dcb74049eba302 | [
"MIT"
] | null | null | null | import random
import math
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import torch.optim as optim
import torch.autograd as autograd
from tqdm import tqdm
from ray.tune import run, Trainable, sample_from
from dqn import DQN, update_target
from loss import TDLoss, StableTDLoss
from pbuffer ... | 36.509091 | 161 | 0.575982 | import random
import math
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import torch.optim as optim
import torch.autograd as autograd
from tqdm import tqdm
from ray.tune import run, Trainable, sample_from
from dqn import DQN, update_target
from loss import TDLoss, StableTDLoss
from pbuffer ... | 6,881 | 16 | 131 |
0ed859f4957ad6b26162065f01fc1831972bca3f | 2,517 | py | Python | tests/ions/test_quintic_spline.py | shankar1729/qimpy | 5a4c1ea1fedc88909d426ce54101d6d07fa82e8c | [
"BSD-3-Clause"
] | 3 | 2021-05-25T00:11:50.000Z | 2022-01-30T21:49:00.000Z | tests/ions/test_quintic_spline.py | shankar1729/qimpy | 5a4c1ea1fedc88909d426ce54101d6d07fa82e8c | [
"BSD-3-Clause"
] | 2 | 2021-09-28T19:18:38.000Z | 2021-11-23T13:23:17.000Z | tests/ions/test_quintic_spline.py | shankar1729/qimpy | 5a4c1ea1fedc88909d426ce54101d6d07fa82e8c | [
"BSD-3-Clause"
] | null | null | null | import qimpy as qp
import torch
import pytest
@pytest.mark.mpi_skip
def main():
"""Run test and additionally plot for visual inspection."""
import matplotlib.pyplot as plt
qp.utils.log_config()
qp.rc.init()
# Plot a single blip function for testing:
plt.figure()
coeff = torch.zeros(12)... | 27.659341 | 84 | 0.564164 | import qimpy as qp
import torch
import pytest
@pytest.mark.mpi_skip
def test_interpolator():
def f_test(x):
"""Non-trivial test function with correct symmetries"""
return torch.exp(-torch.sin(0.01 * x * x)) * torch.cos(0.1 * x)
def f_test_prime(x):
"""Analytical derivative of above.""... | 1,001 | 0 | 22 |
19c9b4b16e51705aa897a6210e587cdfaf2db4bc | 285 | py | Python | TreeNode/models.py | huzing2524/myScripts | 3cf1cfe84bd911cf04ff5c557c8fd6420978bb21 | [
"MIT"
] | 2 | 2021-02-23T04:28:18.000Z | 2021-06-07T23:11:03.000Z | TreeNode/models.py | huzing2524/myScripts | 3cf1cfe84bd911cf04ff5c557c8fd6420978bb21 | [
"MIT"
] | null | null | null | TreeNode/models.py | huzing2524/myScripts | 3cf1cfe84bd911cf04ff5c557c8fd6420978bb21 | [
"MIT"
] | null | null | null | from django.db import models
# Create your models here.
| 25.909091 | 67 | 0.74386 | from django.db import models
# Create your models here.
class IndexTree(models.Model):
name = models.CharField(max_length=50, verbose_name='名称')
parent_id = models.IntegerField(null=True, verbose_name='父类id')
remark = models.CharField(max_length=50, verbose_name='备注')
| 0 | 215 | 23 |
bbb6c6787b96b5631dde0a84acddef3a760c2122 | 19,293 | py | Python | mamosa/synthetic/synthetic.py | sindrehenriksen/mamosa | 477131ff82550701753c1950128b3191ee37bebb | [
"MIT"
] | 1 | 2021-11-01T16:43:17.000Z | 2021-11-01T16:43:17.000Z | mamosa/synthetic/synthetic.py | sindrehenriksen/mamosa | 477131ff82550701753c1950128b3191ee37bebb | [
"MIT"
] | null | null | null | mamosa/synthetic/synthetic.py | sindrehenriksen/mamosa | 477131ff82550701753c1950128b3191ee37bebb | [
"MIT"
] | null | null | null | import numpy as np
import bruges
import scipy.stats
import scipy.linalg
import warnings
from scipy.ndimage import gaussian_filter
from typing import Tuple, Union, List, Optional, Callable, Any
# TODO: Add support for horizons that "stop"/"vanish" (i.e. a layer is eroded).
class SyntheticData:
"""Class for genera... | 39.616016 | 88 | 0.584616 | import numpy as np
import bruges
import scipy.stats
import scipy.linalg
import warnings
from scipy.ndimage import gaussian_filter
from typing import Tuple, Union, List, Optional, Callable, Any
# TODO: Add support for horizons that "stop"/"vanish" (i.e. a layer is eroded).
class SyntheticData:
"""Class for genera... | 791 | 0 | 93 |
72b783b94092542b07e16ea1a17cad1c4d010de7 | 2,046 | py | Python | Lib/encodings/iso8859_8.py | marcosptf/cpython-2.0.1 | 73c739a764e8b1dc84640e73b880bc66e1916bca | [
"PSF-2.0"
] | 5 | 2022-03-26T21:53:36.000Z | 2022-03-30T21:47:20.000Z | Lib/encodings/iso8859_8.py | marcosptf/cpython-2.0.1 | 73c739a764e8b1dc84640e73b880bc66e1916bca | [
"PSF-2.0"
] | 6 | 2020-11-18T15:48:14.000Z | 2021-05-03T21:20:50.000Z | Lib/encodings/iso8859_8.py | marcosptf/cpython-2.0.1 | 73c739a764e8b1dc84640e73b880bc66e1916bca | [
"PSF-2.0"
] | 2 | 2015-07-16T08:14:13.000Z | 2022-03-27T01:55:17.000Z | """ Python Character Mapping Codec generated from '8859-8.TXT'.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""#"
import codecs
### Codec APIs
### encodings module API
### Decoding Map
decoding_map = {
0x00aa: 0x00d7, # MULTIPLICATION SIGN
0x00af: ... | 26.230769 | 68 | 0.709677 | """ Python Character Mapping Codec generated from '8859-8.TXT'.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(i... | 233 | 73 | 162 |
cc3465e8b6a7b04d148b0d77d9ac749acd991189 | 4,161 | py | Python | simulated_uploaders/simulate_upload_rnaseq_fastq.py | BD2KGenomics/dcc-spinnaker-client | 72a6cb94a8db4be707cb1f63513b2f2712edb663 | [
"Apache-2.0"
] | null | null | null | simulated_uploaders/simulate_upload_rnaseq_fastq.py | BD2KGenomics/dcc-spinnaker-client | 72a6cb94a8db4be707cb1f63513b2f2712edb663 | [
"Apache-2.0"
] | 36 | 2016-11-21T17:05:18.000Z | 2020-10-12T15:19:52.000Z | simulated_uploaders/simulate_upload_rnaseq_fastq.py | BD2KGenomics/dcc-spinnaker-client | 72a6cb94a8db4be707cb1f63513b2f2712edb663 | [
"Apache-2.0"
] | 6 | 2016-12-12T19:37:13.000Z | 2021-10-10T21:24:54.000Z | import argparse
import subprocess
import os
import time
import random
if __name__ == "__main__":
main()
| 62.104478 | 480 | 0.694545 | import argparse
import subprocess
import os
import time
import random
def getOptions():
parser = argparse.ArgumentParser(description='Directory that contains Json files.')
parser.add_argument("-f1", "--fastq-r1-path", default="https://s3.amazonaws.com/oconnor-test-bucket/sample-data/ERR030886_1.fastq.gz", he... | 4,006 | 0 | 46 |
3683ba322d5167e3d034bb48b5b53e0c6869da79 | 2,026 | py | Python | Python/tdw/FBOutput/EnvironmentColliderIntersection.py | ricklentz/tdw | da40eec151acae20b28d6486defb4358d96adb0e | [
"BSD-2-Clause"
] | null | null | null | Python/tdw/FBOutput/EnvironmentColliderIntersection.py | ricklentz/tdw | da40eec151acae20b28d6486defb4358d96adb0e | [
"BSD-2-Clause"
] | null | null | null | Python/tdw/FBOutput/EnvironmentColliderIntersection.py | ricklentz/tdw | da40eec151acae20b28d6486defb4358d96adb0e | [
"BSD-2-Clause"
] | null | null | null | # automatically generated by the FlatBuffers compiler, do not modify
# namespace: FBOutput
import tdw.flatbuffers
| 39.72549 | 163 | 0.715202 | # automatically generated by the FlatBuffers compiler, do not modify
# namespace: FBOutput
import tdw.flatbuffers
class EnvironmentColliderIntersection(object):
__slots__ = ['_tab']
@classmethod
def GetRootAsEnvironmentColliderIntersection(cls, buf, offset):
n = tdw.flatbuffers.encode.Get(tdw.fl... | 1,422 | 354 | 134 |