hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | 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 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3d63a676f62f397501daa765ef6e26164f7bb466 | 228 | py | Python | leonardo_otavio_telefone.py | aldrinhronchi/python_regex_tarefa | fc008b3b65ac02b561ea113afd9e5074aa813360 | [
"MIT"
] | 1 | 2021-07-15T07:05:01.000Z | 2021-07-15T07:05:01.000Z | leonardo_otavio_telefone.py | aldrinhronchi/python_regex_tarefa | fc008b3b65ac02b561ea113afd9e5074aa813360 | [
"MIT"
] | null | null | null | leonardo_otavio_telefone.py | aldrinhronchi/python_regex_tarefa | fc008b3b65ac02b561ea113afd9e5074aa813360 | [
"MIT"
] | 8 | 2019-09-11T23:56:24.000Z | 2019-09-12T00:21:40.000Z | # coding: utf-8
import re
telefone = input('Digite seu telefone: ')
pattern = re.compile(r"(\([0-9]{2}\)?\s)?([0-9]{4,5}\-?[0-9]{4})")
if pattern.match(telefone):
print("telefone valido!")
else:
print("telefone invalido!") | 19 | 66 | 0.622807 |
97dcb559abdaa29d2a3d2b4366d889fb198f159d | 8,349 | py | Python | plugin.video.yatp/site-packages/hachoir_metadata/register.py | mesabib/kodi.yatp | d874df43047b5b58f84cb3760fc891d9a133a69f | [
"CNRI-Python"
] | 194 | 2016-12-23T19:11:09.000Z | 2020-12-07T04:04:10.000Z | lib/hachoir_metadata/register.py | nosmokingbandit/Autolycus | 37b376ba2fc27aa7e98f0071b457ebfbc605d4ab | [
"ECL-2.0",
"Apache-2.0"
] | 236 | 2016-11-20T07:56:15.000Z | 2017-04-12T12:10:00.000Z | lib/hachoir_metadata/register.py | nosmokingbandit/Autolycus | 37b376ba2fc27aa7e98f0071b457ebfbc605d4ab | [
"ECL-2.0",
"Apache-2.0"
] | 51 | 2016-11-20T08:05:33.000Z | 2021-01-26T13:22:40.000Z | from hachoir_core.i18n import _
from hachoir_core.tools import (
humanDuration, humanBitRate,
humanFrequency, humanBitSize, humanFilesize,
humanDatetime)
from hachoir_core.language import Language
from hachoir_metadata.filter import Filter, NumberFilter, DATETIME_FILTER
from datetime import date, datetime, ... | 64.223077 | 172 | 0.709067 |
7365b70b5ccfcc8ab11470a5aa33d0cf98ef4f5f | 1,829 | py | Python | _1327/polls/migrations/0001_initial.py | Nef10/1327 | 71fb83a3c12ba24a7638acebeeffed80825e0101 | [
"MIT"
] | null | null | null | _1327/polls/migrations/0001_initial.py | Nef10/1327 | 71fb83a3c12ba24a7638acebeeffed80825e0101 | [
"MIT"
] | null | null | null | _1327/polls/migrations/0001_initial.py | Nef10/1327 | 71fb83a3c12ba24a7638acebeeffed80825e0101 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... | 36.58 | 120 | 0.559322 |
d13e245c30a533081d4ca09061b28be55ee28c4e | 59 | py | Python | tests/i18n/other/locale/fr/formats.py | ni-ning/django | 2e7ba6057cfc82a15a22b6021cd60cf307152e2d | [
"CNRI-Python-GPL-Compatible",
"BSD-3-Clause"
] | 61,676 | 2015-01-01T00:05:13.000Z | 2022-03-31T20:37:54.000Z | tests/i18n/other/locale/fr/formats.py | ni-ning/django | 2e7ba6057cfc82a15a22b6021cd60cf307152e2d | [
"CNRI-Python-GPL-Compatible",
"BSD-3-Clause"
] | 8,884 | 2015-01-01T00:12:05.000Z | 2022-03-31T19:53:11.000Z | tests/i18n/other/locale/fr/formats.py | mustafa0x/django | d7394cfa13a4d1a02356e3a83e10ec100fbb9948 | [
"BSD-3-Clause",
"0BSD"
] | 33,143 | 2015-01-01T02:04:52.000Z | 2022-03-31T19:42:46.000Z | # A user-defined format
CUSTOM_DAY_FORMAT = 'd/m/Y CUSTOM'
| 19.666667 | 34 | 0.745763 |
0f3a2c02367282969f333efedd2f44fd4d4f3dae | 4,085 | py | Python | accelbyte_py_sdk/api/sessionbrowser/models/models_matching_ally.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | null | null | null | accelbyte_py_sdk/api/sessionbrowser/models/models_matching_ally.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | 1 | 2021-10-13T03:46:58.000Z | 2021-10-13T03:46:58.000Z | accelbyte_py_sdk/api/sessionbrowser/models/models_matching_ally.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | null | null | null | # Copyright (c) 2021 AccelByte Inc. All Rights Reserved.
# This is licensed software from AccelByte Inc, for limitations
# and restrictions contact your company contract manager.
#
# Code generated. DO NOT EDIT!
# template file: justice_py_sdk_codegen/__main__.py
# justice-session-browser-service ()
# pylint: disab... | 33.760331 | 175 | 0.682742 |
2bdd6522855852247d41887b08197cc17f7dd13b | 1,561 | py | Python | common_api/eval.py | ntuliuteam/EDLAB | 453451e3d6673f872e8f8cf44038fda2768a802b | [
"Apache-2.0"
] | null | null | null | common_api/eval.py | ntuliuteam/EDLAB | 453451e3d6673f872e8f8cf44038fda2768a802b | [
"Apache-2.0"
] | null | null | null | common_api/eval.py | ntuliuteam/EDLAB | 453451e3d6673f872e8f8cf44038fda2768a802b | [
"Apache-2.0"
] | null | null | null |
# Copyright (c) HP-NTU Digital Manufacturing Corporate Lab, Nanyang Technological University, Singapore.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# import matplotlib.pyplot as plt
from pycocotools.coco import COCO
from pycoco... | 33.212766 | 112 | 0.734785 |
dedfa4a421ab36a262c97c582324ad3d87717618 | 1,156 | py | Python | get_fav_tracks.py | bathulas/spotifyListeningTrends | 8f42a9bbade430096a807a7aa8b90cb0ab8a3770 | [
"MIT"
] | null | null | null | get_fav_tracks.py | bathulas/spotifyListeningTrends | 8f42a9bbade430096a807a7aa8b90cb0ab8a3770 | [
"MIT"
] | null | null | null | get_fav_tracks.py | bathulas/spotifyListeningTrends | 8f42a9bbade430096a807a7aa8b90cb0ab8a3770 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import json
import time
import requests
offset = 0
limit = 50
total_tracks = []
def get_data(url, offset, limit):
token = "{token}"
#Your token goes here
headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"Authorization": "Bearer {}".format... | 31.243243 | 97 | 0.658304 |
bc76dad292f350bcdb06200bf7758909d5464b93 | 1,428 | py | Python | test/test_api_result_my_account_balance.py | parruc/bondora_api | f36ea8d7149d75a2e5f14a695e5a4e57f0a3518d | [
"Apache-2.0"
] | 8 | 2019-03-09T20:38:27.000Z | 2021-02-10T20:44:22.000Z | test/test_api_result_my_account_balance.py | parruc/bondora_api | f36ea8d7149d75a2e5f14a695e5a4e57f0a3518d | [
"Apache-2.0"
] | 1 | 2018-03-06T09:44:21.000Z | 2018-03-06T09:44:21.000Z | test/test_api_result_my_account_balance.py | parruc/bondora_api | f36ea8d7149d75a2e5f14a695e5a4e57f0a3518d | [
"Apache-2.0"
] | 3 | 2019-06-03T13:44:05.000Z | 2020-11-16T13:17:38.000Z | # coding: utf-8
"""
Bondora API V1
Bondora API version 1
OpenAPI spec version: v1
Contact: investor@bondora.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance ... | 26.444444 | 92 | 0.733894 |
442dcddd9f4f612f3ee6c379f139b3869ea14f68 | 15,358 | py | Python | SCRM/audit/auditor_service.py | prakashar11/secure-cloud-native-fabric | 8a6c51d8744c33afb8edc1455caaccb011f7e1de | [
"Apache-2.0"
] | 2 | 2019-07-30T05:53:36.000Z | 2019-10-26T20:11:52.000Z | SCRM/audit/auditor_service.py | prakashar11/secure-cloud-native-fabric | 8a6c51d8744c33afb8edc1455caaccb011f7e1de | [
"Apache-2.0"
] | 6 | 2019-06-17T05:22:32.000Z | 2021-06-10T21:36:22.000Z | SCRM/audit/auditor_service.py | prakashar11/secure-cloud-native-fabric | 8a6c51d8744c33afb8edc1455caaccb011f7e1de | [
"Apache-2.0"
] | 3 | 2019-10-26T21:20:02.000Z | 2020-06-01T14:25:17.000Z | #
# Copyright 2019 Altran. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 39.278772 | 281 | 0.617138 |
09e59add6929b12ed1898742c534770bea5dffb1 | 2,181 | py | Python | selection/sampling/randomized/norms/base.py | Xiaoying-Tian/selective-inference | a20c5ad3f527beb709d5b8d7301016640738b092 | [
"BSD-3-Clause"
] | null | null | null | selection/sampling/randomized/norms/base.py | Xiaoying-Tian/selective-inference | a20c5ad3f527beb709d5b8d7301016640738b092 | [
"BSD-3-Clause"
] | null | null | null | selection/sampling/randomized/norms/base.py | Xiaoying-Tian/selective-inference | a20c5ad3f527beb709d5b8d7301016640738b092 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from regreg.atoms.seminorms import seminorm
class selective_penalty(seminorm):
def setup_sampling(self,
gradient,
soln,
linear_randomization,
quadratic_coef):
"""
Should store quadrat... | 30.291667 | 69 | 0.608895 |
6c909d916cbbb13f84607aa3c345938882d9f430 | 21,555 | py | Python | gvsoc/runner/python/runner/stim_utils.py | 00-01/gap_sdk | 25444d752b26ccf0b848301c381692d77172852c | [
"Apache-2.0"
] | 118 | 2018-05-22T08:45:59.000Z | 2022-03-30T07:00:45.000Z | gvsoc/runner/python/runner/stim_utils.py | 00-01/gap_sdk | 25444d752b26ccf0b848301c381692d77172852c | [
"Apache-2.0"
] | 213 | 2018-07-25T02:37:32.000Z | 2022-03-30T18:04:01.000Z | gvsoc/runner/python/runner/stim_utils.py | 00-01/gap_sdk | 25444d752b26ccf0b848301c381692d77172852c | [
"Apache-2.0"
] | 76 | 2018-07-04T08:19:27.000Z | 2022-03-24T09:58:05.000Z | #!/usr/bin/env python3
#
# Copyright (C) 2018 ETH Zurich, University of Bologna and GreenWaves Technologies
#
# 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/lice... | 33.470497 | 120 | 0.524379 |
8b42d6cb3ff1dcf9e7aac289acee3db5b98db927 | 7,343 | py | Python | matrix-methods/frame2d/Frame2D/Tables.py | nholtz/structural-analysis | 246d6358355bd9768e30075d1f6af282ceb995be | [
"CC0-1.0"
] | 3 | 2016-05-26T07:01:51.000Z | 2019-05-31T23:48:11.000Z | matrix-methods/frame2d/Frame2D/Tables.py | nholtz/structural-analysis | 246d6358355bd9768e30075d1f6af282ceb995be | [
"CC0-1.0"
] | null | null | null | matrix-methods/frame2d/Frame2D/Tables.py | nholtz/structural-analysis | 246d6358355bd9768e30075d1f6af282ceb995be | [
"CC0-1.0"
] | 1 | 2016-08-30T06:08:03.000Z | 2016-08-30T06:08:03.000Z | ## Compiled from Tables.ipynb on Sun Dec 10 12:51:08 2017
## DO NOT EDIT THIS FILE. YOUR CHANGES WILL BE LOST!!
## In [1]:
from salib import extend
import pandas as pd
import os, os.path
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
import hashlib
from IPython.core.magic import... | 31.926087 | 121 | 0.58137 |
2811350cc9b273bd0453e50d83f3384ffca8e0ba | 5,345 | py | Python | ParsersClasses/LuleshParser.py | UFRGS-CAROL/radiation-benchmarks-parsers | a39844ed3ed511f4f2672bc2e0c7e6f920dc7f2b | [
"Apache-2.0"
] | null | null | null | ParsersClasses/LuleshParser.py | UFRGS-CAROL/radiation-benchmarks-parsers | a39844ed3ed511f4f2672bc2e0c7e6f920dc7f2b | [
"Apache-2.0"
] | null | null | null | ParsersClasses/LuleshParser.py | UFRGS-CAROL/radiation-benchmarks-parsers | a39844ed3ed511f4f2672bc2e0c7e6f920dc7f2b | [
"Apache-2.0"
] | null | null | null | import re
import sys
from Parser import Parser
class LuleshParser(Parser):
_box = 50
_hasThirdDimention = True
_iterations = None
def _jaccardCoefficient(self, errListJaccard):
return 0
def parseErrMethod(self, errString):
if self._box is None:
print ("box is None!!... | 33.198758 | 208 | 0.449579 |
c87e62bd97d388c6386bdfd8c0ca8aa158b4a1d5 | 1,105 | py | Python | tests/at_destructor.py | microsoft/svirl | 8d0da6a03ad20315a690a3c65bb8b60c196c3f3d | [
"MIT"
] | 6 | 2020-12-21T20:11:13.000Z | 2022-03-21T07:55:33.000Z | tests/at_destructor.py | ivan-sadovsky/svirl | 523abe9fcf2a5e9d192782d7aeb7093c86ef4036 | [
"MIT"
] | 4 | 2021-07-15T20:12:55.000Z | 2021-08-07T22:11:18.000Z | tests/at_destructor.py | ivan-sadovsky/svirl | 523abe9fcf2a5e9d192782d7aeb7093c86ef4036 | [
"MIT"
] | 9 | 2020-12-22T06:06:16.000Z | 2022-03-25T17:26:55.000Z | import numpy as np
import sys, os
sys.path.append(os.path.abspath("../"))
from svirl import GLSolver
from common import *
cd_test_number, cd_test_passed = 0, 0
for i in range(10):
try:
gl = GLSolver(
Nx = np.random.randint(4, 1024),
Ny = np.random.randint(4, 1024),
dx = ... | 29.078947 | 80 | 0.580995 |
89e9f1b999404241218ce5d90d90b4adfa184b3f | 1,295 | py | Python | Defect_Prediction/gradient_descent.py | pujahabibi/SDP-Bayes | ae0fdba8b457a589be048af7c0c116923e56b19d | [
"MIT"
] | null | null | null | Defect_Prediction/gradient_descent.py | pujahabibi/SDP-Bayes | ae0fdba8b457a589be048af7c0c116923e56b19d | [
"MIT"
] | null | null | null | Defect_Prediction/gradient_descent.py | pujahabibi/SDP-Bayes | ae0fdba8b457a589be048af7c0c116923e56b19d | [
"MIT"
] | null | null | null | __author__ = 'Kiki Rizki Arpiandi'
import numpy as np
import random
import matplotlib.pyplot as plt
class model:
def __init__(self, x,y):
self.y = y
self.x = x
self.theta0 = random.randrange(-5, 5, 1)
self.theta1 = random.randrange(-5, 5, 1)
def prediksi(self, x):
retu... | 28.152174 | 68 | 0.59305 |
d359e5670f8d135c72c5a7bf15964619d926d86b | 209 | py | Python | radiomics/__init__.py | dchansen/radiomics | ea34882df0127c0921f6f412fbb708d1c49b4f29 | [
"Apache-2.0"
] | 11 | 2017-06-23T14:23:43.000Z | 2020-09-04T01:36:58.000Z | radiomics/__init__.py | dchansen/radiomics | ea34882df0127c0921f6f412fbb708d1c49b4f29 | [
"Apache-2.0"
] | null | null | null | radiomics/__init__.py | dchansen/radiomics | ea34882df0127c0921f6f412fbb708d1c49b4f29 | [
"Apache-2.0"
] | 11 | 2017-11-30T06:40:38.000Z | 2020-12-31T12:44:52.000Z | from radiomics.features import *
__all__ = ['group1_features', 'tumour_features', 'wavelet_features', 'calculate_all_features',
'gray_level_cooccurrence_features', 'gray_level_runlength_features']
| 41.8 | 94 | 0.779904 |
d738c678fecd05f2450ff9c9d059e834960f0041 | 2,498 | py | Python | doc/conf.py | carstenblank/qiskit-aws-braket-provider | 539f0c75c2ccf1f6e5e981b92ea74f497fcba237 | [
"Apache-2.0"
] | 7 | 2020-09-25T17:16:54.000Z | 2021-05-20T10:42:52.000Z | doc/conf.py | carstenblank/qiskit-aws-braket-provider | 539f0c75c2ccf1f6e5e981b92ea74f497fcba237 | [
"Apache-2.0"
] | 4 | 2020-09-21T19:33:39.000Z | 2020-09-22T12:21:11.000Z | doc/conf.py | carstenblank/qiskit-aws-braket-provider | 539f0c75c2ccf1f6e5e981b92ea74f497fcba237 | [
"Apache-2.0"
] | 1 | 2020-09-21T19:32:16.000Z | 2020-09-21T19:32:16.000Z | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 32.025641 | 79 | 0.681345 |
c6c2a118cec0d4fd745d1c6fa0bd6c57aba8fd8b | 241 | py | Python | examples/models/openvino_imagenet_ensemble/resources/combiner/ImageNetCombiner.py | masroorhasan/seldon-core | 674e00cd4b740ee21ac3de00ab145ebd6ebf8b9e | [
"Apache-2.0"
] | null | null | null | examples/models/openvino_imagenet_ensemble/resources/combiner/ImageNetCombiner.py | masroorhasan/seldon-core | 674e00cd4b740ee21ac3de00ab145ebd6ebf8b9e | [
"Apache-2.0"
] | null | null | null | examples/models/openvino_imagenet_ensemble/resources/combiner/ImageNetCombiner.py | masroorhasan/seldon-core | 674e00cd4b740ee21ac3de00ab145ebd6ebf8b9e | [
"Apache-2.0"
] | null | null | null | import logging
logger = logging.getLogger(__name__)
class ImageNetCombiner(object):
def aggregate(self, Xs, features_names):
print("ImageNet Combiner aggregate called")
logger.info(Xs)
return (Xs[0]+Xs[1])/2.0
| 21.909091 | 51 | 0.680498 |
7c08996f378827459d8a8041c178c1fb5e0846cc | 896 | bzl | Python | xls/build/pybind11.bzl | ted-xie/xls | ef48ade3403fffc6481ffd779e49aa7082ee268f | [
"Apache-2.0"
] | null | null | null | xls/build/pybind11.bzl | ted-xie/xls | ef48ade3403fffc6481ffd779e49aa7082ee268f | [
"Apache-2.0"
] | null | null | null | xls/build/pybind11.bzl | ted-xie/xls | ef48ade3403fffc6481ffd779e49aa7082ee268f | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC
#
# 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, ... | 37.333333 | 74 | 0.737723 |
b6431949684815d73defeb67511e3a9e91fbe497 | 3,850 | py | Python | majestic-monolith-django/auth/docs.py | kokospapa8/majestic-monolith-django | a0879989a651ecef6761ee7fce619ab17738bb35 | [
"Apache-2.0"
] | 1 | 2022-03-12T09:55:36.000Z | 2022-03-12T09:55:36.000Z | majestic-monolith-django/auth/docs.py | kokospapa8/majestic-monolith-django | a0879989a651ecef6761ee7fce619ab17738bb35 | [
"Apache-2.0"
] | 6 | 2022-03-09T10:42:44.000Z | 2022-03-31T08:27:25.000Z | majestic-monolith-django/auth/docs.py | kokospapa8/majestic-monolith-django | a0879989a651ecef6761ee7fce619ab17738bb35 | [
"Apache-2.0"
] | null | null | null | from drf_yasg.utils import swagger_auto_schema
from core.docs import dict_response_schema
from .serializers import (
PhonenumberCheckSerializer,
SignupTokenRequestSerializer
)
doc_auth_check_phonenumber = swagger_auto_schema(
operation_id='auth_check_phonenumber',
operation_description='Called on fir... | 32.905983 | 87 | 0.605455 |
cf06ababc8ebc620cc2ee570a4f9fc54b26c892b | 1,023 | py | Python | terminfo/v/vt52.py | darkelf44/PyUtils | 4072ff31d2b89dd604ef0e09eb90b7f3b5cf23df | [
"MIT"
] | null | null | null | terminfo/v/vt52.py | darkelf44/PyUtils | 4072ff31d2b89dd604ef0e09eb90b7f3b5cf23df | [
"MIT"
] | null | null | null | terminfo/v/vt52.py | darkelf44/PyUtils | 4072ff31d2b89dd604ef0e09eb90b7f3b5cf23df | [
"MIT"
] | null | null | null | # Imports
from terminfo import TerminalModule
# Terminal: dec vt52
TerminalModule(['vt52'], use=[], backspaces_with_bs=True, init_tabs=8, lines=24, acs_chars=b'+h.k0affggolpnqprrss', cursor_home=b'\x1bH', key_backspace=b'\x08', newline=b'\r\n', scroll_reverse=b'\x1bI', exit_alt_charset_mode=b'\x1bG', keypad_local=b'\x... | 170.5 | 954 | 0.690127 |
5ed61e55314a04e20ea0d7cc33bcdcb98684b368 | 4,100 | py | Python | lib/report_base/assets_base/chamber.py | JinIgarashi/postgis2inventoryreport | 5f1d595b889779137bfbef72c5d8814031a2d33c | [
"MIT"
] | null | null | null | lib/report_base/assets_base/chamber.py | JinIgarashi/postgis2inventoryreport | 5f1d595b889779137bfbef72c5d8814031a2d33c | [
"MIT"
] | 3 | 2020-04-15T13:01:33.000Z | 2021-12-13T20:31:08.000Z | lib/report_base/assets_base/chamber.py | WASAC/postgis2inventoryreport | 5f1d595b889779137bfbef72c5d8814031a2d33c | [
"MIT"
] | null | null | null | from lib.report_base.assets_base.assets_base import AssetsBase
class Chambers(AssetsBase):
class Chamber(object):
def __init__(self, params):
self.id = params[0]
self.x = params[1]
self.y = params[2]
self.z = params[3]
self.chamber_size = params[... | 45.555556 | 108 | 0.540244 |
ae676549583491345a2bcbe4f67e98b71cc55663 | 1,741 | py | Python | cctbx/omz/bfgs.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | cctbx/omz/bfgs.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | cctbx/omz/bfgs.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | from __future__ import division
def h0_scaling(sk, yk):
"Nocedal & Wright (1999) Eq. 8.20; same as Eq. 9.6"
yty = yk.dot(yk)
assert yty > 0
return yk.dot(sk) / yty
def h_update(hk, sk, yk):
"""Nocedal & Wright (1999) Eq. 9.2
Pre-condition: hk must be positive definite"""
yts = yk.dot(sk)
assert yts... | 24.871429 | 77 | 0.607697 |
da167431956a9f0b2d474f736b78875af8f2dfdd | 27,102 | py | Python | src/torch_core/vibo.py | gpoesia/variational-item-response-theory-public | 6a0db81068695422dddec8832ce353879c5acb82 | [
"MIT"
] | null | null | null | src/torch_core/vibo.py | gpoesia/variational-item-response-theory-public | 6a0db81068695422dddec8832ce353879c5acb82 | [
"MIT"
] | null | null | null | src/torch_core/vibo.py | gpoesia/variational-item-response-theory-public | 6a0db81068695422dddec8832ce353879c5acb82 | [
"MIT"
] | 1 | 2022-01-06T01:16:10.000Z | 2022-01-06T01:16:10.000Z | import os
import time
import math
import numpy as np
from tqdm import tqdm
import sys
import csv
import json
import torch
from torch import optim
import torch.distributions as dist
import torch.nn.functional as F
from src.torch_core.models import (
VIBO_1PL,
VIBO_2PL,
VIBO_3PL,
)
from src.datasets impor... | 40.511211 | 115 | 0.564017 |
ab0990d1278d2dae7dbf0cd9583de5a29291acba | 2,335 | py | Python | users/utils.py | ashbc/tgrsite | 180e5eb9c72a7a331276fe3de150ea2eea2db51e | [
"ISC"
] | 1 | 2019-06-29T15:25:05.000Z | 2019-06-29T15:25:05.000Z | users/utils.py | ashbc/tgrsite | 180e5eb9c72a7a331276fe3de150ea2eea2db51e | [
"ISC"
] | 70 | 2017-06-21T13:13:57.000Z | 2019-03-20T22:14:56.000Z | users/utils.py | ashbc/tgrsite | 180e5eb9c72a7a331276fe3de150ea2eea2db51e | [
"ISC"
] | null | null | null | import requests
from django.http import HttpRequest
from django.template import loader
from .models import Membership, Member
from .achievements import give_achievement, give_achievement_once
from premailer import Premailer
try:
from xml.etree.cElementTree import ElementTree, fromstring
except ImportError:
f... | 34.850746 | 115 | 0.652248 |
10f8e186cbafa1579125b7b983e983fa06639308 | 5,834 | py | Python | asyncdagpi/http.py | mysistersbrother/asyncdagpi | 17859e67c51fbcc6b1e3eb719d4269db39a7f612 | [
"MIT"
] | null | null | null | asyncdagpi/http.py | mysistersbrother/asyncdagpi | 17859e67c51fbcc6b1e3eb719d4269db39a7f612 | [
"MIT"
] | null | null | null | asyncdagpi/http.py | mysistersbrother/asyncdagpi | 17859e67c51fbcc6b1e3eb719d4269db39a7f612 | [
"MIT"
] | null | null | null | import asyncio
import logging
from typing import Dict
import aiohttp
from . import errors
from .image import Image
log = logging.getLogger(__name__)
error_dict = {
400: errors.ParameterError("Parameters passed were incorrect"),
413: errors.FileTooLarge("The Image Passed is too large"),
500... | 37.63871 | 80 | 0.480288 |
46b8fed961089fbad47cbb8adc035ce78c1ad4b8 | 146 | py | Python | summary/apps.py | ossteam8/oss8_proj | 341ba45ed47d633665f9a8337cd8df7227cb16c2 | [
"MIT"
] | 3 | 2021-06-08T08:38:13.000Z | 2021-06-08T08:38:58.000Z | summary/apps.py | ossteam8/K-news_keyword | 341ba45ed47d633665f9a8337cd8df7227cb16c2 | [
"MIT"
] | 15 | 2021-06-04T16:33:34.000Z | 2021-06-06T10:05:17.000Z | summary/apps.py | ossteam8/oss8_proj | 341ba45ed47d633665f9a8337cd8df7227cb16c2 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class SummaryConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'summary'
| 20.857143 | 56 | 0.760274 |
d5e1234eb57dbf45453528152123f7479b515139 | 718 | py | Python | dynamics_learning/training/configs.py | wuphilipp/replay-overshooting | 184b1537c22ebc2f614677be8fe171de785bda42 | [
"MIT"
] | null | null | null | dynamics_learning/training/configs.py | wuphilipp/replay-overshooting | 184b1537c22ebc2f614677be8fe171de785bda42 | [
"MIT"
] | null | null | null | dynamics_learning/training/configs.py | wuphilipp/replay-overshooting | 184b1537c22ebc2f614677be8fe171de785bda42 | [
"MIT"
] | 1 | 2022-03-01T07:51:20.000Z | 2022-03-01T07:51:20.000Z | from dataclasses import dataclass
from typing import Callable, Optional
from dynamics_learning.networks.estimator import EstimatorConfig
LearningRateScheduler = Callable[[int, float], float]
@dataclass(frozen=True)
class ExpConfig:
"""All parameters for training.
This must be serializable.
"""
mod... | 25.642857 | 66 | 0.743733 |
2d3a15e126c060fc06d2b68ca1a73685769cde7b | 510 | py | Python | get_board_dict.py | sen-lee/detection_license_plate | 940772656d014da20006b077a4264b3f7ace80f9 | [
"Apache-2.0"
] | null | null | null | get_board_dict.py | sen-lee/detection_license_plate | 940772656d014da20006b077a4264b3f7ace80f9 | [
"Apache-2.0"
] | null | null | null | get_board_dict.py | sen-lee/detection_license_plate | 940772656d014da20006b077a4264b3f7ace80f9 | [
"Apache-2.0"
] | null | null | null | import json
from detectron2.structures import BoxMode
def get_board_dicts(imgdir):
json_file = imgdir+"/dataset.json" #Fetch the json file
with open(json_file) as f:
dataset_dicts = json.load(f)
for i in dataset_dicts:
filename = i["file_name"]
i["file_name"] = imgdir+"/"+filename
... | 36.428571 | 76 | 0.647059 |
91330e9d19630f924c0ffddbeaf6997c352f38d5 | 27,185 | py | Python | docformatter.py | JimArnow/docformatter | 3d7e92b3de82600f30d422c4f57a7b8566e24325 | [
"MIT"
] | null | null | null | docformatter.py | JimArnow/docformatter | 3d7e92b3de82600f30d422c4f57a7b8566e24325 | [
"MIT"
] | null | null | null | docformatter.py | JimArnow/docformatter | 3d7e92b3de82600f30d422c4f57a7b8566e24325 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (C) 2012-2019 Steven Myint
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, m... | 33.520345 | 106 | 0.594703 |
d35571ec1dd03c551813734d086259ed2f4a9ae0 | 1,736 | py | Python | teleavon_examples/assistant.py | GramaBell/Teleavon | 8377399f726dc8cee76accb303b26be669fe3a0a | [
"MIT"
] | null | null | null | teleavon_examples/assistant.py | GramaBell/Teleavon | 8377399f726dc8cee76accb303b26be669fe3a0a | [
"MIT"
] | null | null | null | teleavon_examples/assistant.py | GramaBell/Teleavon | 8377399f726dc8cee76accb303b26be669fe3a0a | [
"MIT"
] | null | null | null | """
This file is only the "core" of the bot. It is responsible for loading the
plugins module and initializing it. You may obtain the plugins by running:
git clone https://github.com/Lonami/TeleavonianBotExt plugins
In the same folder where this file lives. As a result, the directory should
look like the followin... | 24.450704 | 76 | 0.636521 |
b4f65cba3fd3f434a90d78b838f9f414ec9d8035 | 3,152 | py | Python | BasicModule.py | birm/HistoQC | 1384a69b7f37bae59191302c0a8283e79d9f502b | [
"BSD-3-Clause-Clear"
] | null | null | null | BasicModule.py | birm/HistoQC | 1384a69b7f37bae59191302c0a8283e79d9f502b | [
"BSD-3-Clause-Clear"
] | null | null | null | BasicModule.py | birm/HistoQC | 1384a69b7f37bae59191302c0a8283e79d9f502b | [
"BSD-3-Clause-Clear"
] | null | null | null | import logging
import os
from BaseImage import printMaskHelper
from skimage.morphology import remove_small_objects, binary_opening, disk
from skimage import io, color
import matplotlib.pyplot as plt
def getBasicStats(s, params):
logging.info(f"{s['filename']} - \tgetBasicStats")
osh = s["os_handle"]
s.ad... | 43.777778 | 148 | 0.688452 |
318fd7db85f7c971cea2b0f26fd29d04e0649e20 | 872 | py | Python | request-management-api/migrations/versions/fc26a7b65a2a_.py | bcgov/foi-flow | 7f9897b3aad4ba91fbc8edcb8f526906efb490df | [
"Apache-2.0"
] | null | null | null | request-management-api/migrations/versions/fc26a7b65a2a_.py | bcgov/foi-flow | 7f9897b3aad4ba91fbc8edcb8f526906efb490df | [
"Apache-2.0"
] | 1,579 | 2021-04-14T18:27:45.000Z | 2022-03-31T23:49:42.000Z | request-management-api/migrations/versions/fc26a7b65a2a_.py | bcgov/foi-flow | 7f9897b3aad4ba91fbc8edcb8f526906efb490df | [
"Apache-2.0"
] | 1 | 2022-03-01T20:17:47.000Z | 2022-03-01T20:17:47.000Z | """empty message
Revision ID: fc26a7b65a2a
Revises: 1347453b75e6
Create Date: 2021-11-10 19:07:40.807103
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'fc26a7b65a2a'
down_revision = '1347453b75e6'
branch_labels = None
depends_on = None
def upgrade():
op... | 26.424242 | 110 | 0.728211 |
559d0f020eff118f42190da00de8eccd81003ea9 | 4,212 | py | Python | apps/win/xplorer2/xplorer2.py | PetrKryslUCSD/knausj_talon_pk | 6612adb1794e0b02ce8b1c2b478b74cd6858954b | [
"MIT"
] | 1 | 2020-11-13T18:02:12.000Z | 2020-11-13T18:02:12.000Z | apps/win/xplorer2/xplorer2.py | PetrKryslUCSD/knausj_talon_pk | 6612adb1794e0b02ce8b1c2b478b74cd6858954b | [
"MIT"
] | null | null | null | apps/win/xplorer2/xplorer2.py | PetrKryslUCSD/knausj_talon_pk | 6612adb1794e0b02ce8b1c2b478b74cd6858954b | [
"MIT"
] | null | null | null | from talon import Context, Module, actions, imgui, settings, ui, app
import os
mod = Module()
apps = mod.apps
# An explanation on how to get the title set up:
# Petr Krysl 2021
# Q: Could I also ask about the title bar of the window: could I set
# it to whatever I want?
# A: There is a registry tweak called DPF_NOT... | 31.2 | 101 | 0.63509 |
b1d4b12d5701901c8149ba73bdd34cf1c6d9ec4a | 1,069 | py | Python | src/rewrite_event_states.py | matpalm/drivebot | 2b6c30209f7a50e289fa70b68fdc93f5e2bd7e88 | [
"MIT"
] | 70 | 2016-02-20T02:59:14.000Z | 2021-12-30T04:19:09.000Z | src/rewrite_event_states.py | matpalm/drivebot | 2b6c30209f7a50e289fa70b68fdc93f5e2bd7e88 | [
"MIT"
] | 1 | 2016-05-03T15:57:58.000Z | 2016-05-04T13:55:53.000Z | src/rewrite_event_states.py | matpalm/drivebot | 2b6c30209f7a50e289fa70b68fdc93f5e2bd7e88 | [
"MIT"
] | 17 | 2016-02-20T03:53:46.000Z | 2021-03-17T07:38:18.000Z | #!/usr/bin/env python
import json, sys
import states
#sonar_to_state = states.FurthestSonar() # OrderingSonars()
#sonar_to_state = states.OrderingSonars()
#sonar_to_state = states.StateHistory(states.FurthestSonar(), history_length=4)
sonar_to_state = states.StateHistory(states.StandardisedSonars(mean=59.317, std=37.6... | 32.393939 | 89 | 0.674462 |
e527e8fa048bfbb1c71a79954ac8e25291068120 | 1,767 | py | Python | lc/0946_ValidStackSequences.py | xiangshiyin/coding-challenge | a75a644b96dec1b6c7146b952ca4333263f0a461 | [
"Apache-2.0"
] | null | null | null | lc/0946_ValidStackSequences.py | xiangshiyin/coding-challenge | a75a644b96dec1b6c7146b952ca4333263f0a461 | [
"Apache-2.0"
] | null | null | null | lc/0946_ValidStackSequences.py | xiangshiyin/coding-challenge | a75a644b96dec1b6c7146b952ca4333263f0a461 | [
"Apache-2.0"
] | null | null | null | # class Solution:
# def validateStackSequences(self, pushed: List[int], popped: List[int]) -> bool:
# n = len(pushed)
# # exception
# if n == 0:
# return True
# # create a hash table of value-index pairs
# tb = {v:i for i,v in enumerate(pushed)}
# ... | 32.127273 | 85 | 0.372949 |
9531e990d630dfc72004cf478725ba022da17c93 | 7,132 | py | Python | designate/backend/impl_akamai_v2.py | ChukwuemekaAham/designate | 2f17dd20e260c3b8a36a5034077275c796abb60b | [
"Apache-2.0"
] | 1 | 2022-02-18T11:19:35.000Z | 2022-02-18T11:19:35.000Z | designate/backend/impl_akamai_v2.py | sapcc/designate | c3f084751006a2fe7562f137930542c4759d6fd9 | [
"Apache-2.0"
] | null | null | null | designate/backend/impl_akamai_v2.py | sapcc/designate | c3f084751006a2fe7562f137930542c4759d6fd9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Cloudification GmbH
#
# Author: Sergey Kraynev <contact@cloudification.io>
#
# 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... | 35.66 | 79 | 0.616938 |
633af3d20fdc7ca8b4999959744a84bb7858d995 | 5,969 | py | Python | dicodile/update_z/distributed_sparse_encoder.py | rprimet/dicodile | ad30e87b7797fd0083d7cb4edc3fade9825c8339 | [
"BSD-3-Clause"
] | null | null | null | dicodile/update_z/distributed_sparse_encoder.py | rprimet/dicodile | ad30e87b7797fd0083d7cb4edc3fade9825c8339 | [
"BSD-3-Clause"
] | null | null | null | dicodile/update_z/distributed_sparse_encoder.py | rprimet/dicodile | ad30e87b7797fd0083d7cb4edc3fade9825c8339 | [
"BSD-3-Clause"
] | 1 | 2021-01-13T13:31:21.000Z | 2021-01-13T13:31:21.000Z | import weakref
import numpy as np
from mpi4py import MPI
from ..utils import constants
from ..utils.csc import compute_objective
from ..workers.mpi_workers import MPIWorkers
from ..utils import debug_flags as flags
from ..utils.debugs import main_check_beta
from ..utils.shape_helpers import get_valid_support
from .d... | 38.019108 | 79 | 0.628581 |
c828ef55fcd574dc6365093301b878c63bfb8567 | 8,543 | py | Python | tests/components/vera/test_init.py | edofullin/core | 106dc4d28ad59cb192c60fc7a354cafa86899ea4 | [
"Apache-2.0"
] | 4 | 2020-08-10T20:02:24.000Z | 2022-01-31T02:14:22.000Z | tests/components/vera/test_init.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 78 | 2020-07-23T07:13:08.000Z | 2022-03-31T06:02:04.000Z | tests/components/vera/test_init.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 4 | 2017-01-10T04:17:33.000Z | 2021-09-02T16:37:24.000Z | """Vera tests."""
from unittest.mock import MagicMock
import pytest
import pyvera as pv
from requests.exceptions import RequestException
from homeassistant.components.vera import (
CONF_CONTROLLER,
CONF_EXCLUDE,
CONF_LIGHTS,
DOMAIN,
)
from homeassistant.config_entries import ENTRY_STATE_NOT_LOADED
fro... | 34.035857 | 86 | 0.721292 |
536ed0c53782dfd193aba23e9d9ecf208d008823 | 2,202 | py | Python | speech/setup.py | omaray/gcloud-python | 87a13aaa140842111df2f76529a1b9ce4b6d28a6 | [
"Apache-2.0"
] | null | null | null | speech/setup.py | omaray/gcloud-python | 87a13aaa140842111df2f76529a1b9ce4b6d28a6 | [
"Apache-2.0"
] | null | null | null | speech/setup.py | omaray/gcloud-python | 87a13aaa140842111df2f76529a1b9ce4b6d28a6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 31.014085 | 74 | 0.66485 |
8e352b73dbab2896ca5f0681999fc552fd149c6a | 766 | py | Python | IQR.py | Elonisme/Bigdates | 55459fe060d2ce0696fd9df43e0a07fc21550bd7 | [
"Apache-2.0"
] | null | null | null | IQR.py | Elonisme/Bigdates | 55459fe060d2ce0696fd9df43e0a07fc21550bd7 | [
"Apache-2.0"
] | null | null | null | IQR.py | Elonisme/Bigdates | 55459fe060d2ce0696fd9df43e0a07fc21550bd7 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
import scipy.stats
class IQR:
def Calculate_IQR(selfs):
Q1 = scipy.stats.norm(0,1).ppf(0.25)
Q3 = scipy.stats.norm(0,1).ppf(0.75)
Upperfence = scipy.stats.norm(0,1).cdf(Q3+1.5*(Q3-Q1))
Lowerfence = scipy.stats.norm(0,1).cdf(Q1-1.5*(Q3-Q1))
probUL = round(Uppe... | 34.818182 | 62 | 0.570496 |
9889e66d6a69e3ab731ccf0f87ca35bb9ce918bd | 3,788 | py | Python | src/regnet/data/kitti/image_rescale.py | markrofail/multi-modal-deep-learning-for-vehicle-sensor-data-abstraction-and-attack-detection | 2f252c072f3091bb27506978dd90311f7f82f386 | [
"MIT"
] | null | null | null | src/regnet/data/kitti/image_rescale.py | markrofail/multi-modal-deep-learning-for-vehicle-sensor-data-abstraction-and-attack-detection | 2f252c072f3091bb27506978dd90311f7f82f386 | [
"MIT"
] | 6 | 2020-09-25T22:41:00.000Z | 2021-06-08T21:50:37.000Z | src/regnet/data/kitti/image_rescale.py | markrofail/multi-modal-deep-learning-for-vehicle-sensor-data-abstraction-and-attack-detection | 2f252c072f3091bb27506978dd90311f7f82f386 | [
"MIT"
] | null | null | null | import multiprocessing
from pathlib import Path
import numpy as np
from joblib import Parallel, delayed
from PIL import Image as im
from scipy.stats import entropy as entropy_helper
from tqdm import tqdm
from src.helpers import paths
from src.helpers.flags import Verbose
config = paths.config.read(paths.config.regne... | 30.548387 | 89 | 0.734952 |
f8731136926d5b5bb762c6ae855de2811f1a2c7a | 2,288 | py | Python | stashed/_appindicator.py | PlayerG9/PySysTray | 7bd98fbc75c815551edbf27efa031cad8643ecdd | [
"MIT"
] | 1 | 2022-01-13T21:51:04.000Z | 2022-01-13T21:51:04.000Z | stashed/_appindicator.py | PlayerG9/PySysTray | 7bd98fbc75c815551edbf27efa031cad8643ecdd | [
"MIT"
] | null | null | null | stashed/_appindicator.py | PlayerG9/PySysTray | 7bd98fbc75c815551edbf27efa031cad8643ecdd | [
"MIT"
] | null | null | null | # coding=utf-8
r"""
pystray
Copyright (C) 2021 PlayerG9
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option) any
later version.
This program is... | 29.333333 | 77 | 0.706731 |
0831dab47fc59cac578c67ad57ae418e88ca6388 | 5,361 | py | Python | spirit/extra/project_template/project_name/settings/base.py | xingetouzi/Spirit | 0d298f0b608c3f3a2dbbc152a8da042eef6d2e05 | [
"MIT"
] | 1 | 2020-12-08T01:09:30.000Z | 2020-12-08T01:09:30.000Z | spirit/extra/project_template/project_name/settings/base.py | xingetouzi/Spirit | 0d298f0b608c3f3a2dbbc152a8da042eef6d2e05 | [
"MIT"
] | 1 | 2018-03-26T07:11:52.000Z | 2018-03-26T07:11:52.000Z | spirit/extra/project_template/project_name/settings/base.py | xingetouzi/Spirit | 0d298f0b608c3f3a2dbbc152a8da042eef6d2e05 | [
"MIT"
] | 6 | 2018-06-25T02:17:53.000Z | 2020-12-08T01:09:32.000Z | # -*- coding: utf-8 -*-
"""
Django settings for {{ project_name }} project.
Generated by 'django-admin startproject' using Django {{ django_version }}.
For more information on this file, see
https://docs.djangoproject.com/en/{{ docs_version }}/topics/settings/
For the full list of settings and their values, see
http... | 27.492308 | 86 | 0.641671 |
7d0cbaf7d7eb01d3365004b46f88713faaacb07b | 438 | py | Python | kernel/__init__.py | omarsou/kernel_method_kaggle_challenge | 0f2e85166112b231699d9c9f7e3ae894e5ff7766 | [
"Apache-2.0"
] | 1 | 2021-03-26T08:40:07.000Z | 2021-03-26T08:40:07.000Z | kernel/__init__.py | omarsou/kernel_method_kaggle_challenge | 0f2e85166112b231699d9c9f7e3ae894e5ff7766 | [
"Apache-2.0"
] | null | null | null | kernel/__init__.py | omarsou/kernel_method_kaggle_challenge | 0f2e85166112b231699d9c9f7e3ae894e5ff7766 | [
"Apache-2.0"
] | null | null | null | from kernel.local_alignment_kernel import LocalAlignmentKernel
from kernel.spectrum_kernel import SpectrumKernel, SumSpectrumKernel
from kernel.substring_kernel import SubstringKernel
from kernel.base_kernel import KernelIPImplicit, KernelIPExplicit, SumKernelIPExplicit
__all__ = ["LocalAlignmentKernel", "SpectrumKern... | 62.571429 | 91 | 0.842466 |
7d0424d33e2eb7d4e5540ab4e5e895a5f07c6779 | 2,011 | py | Python | frame_grabber.py | brix4dayz/TRiCAM2.0 | 716f154403c8c0aa903d7391bf4c14d45c778a22 | [
"MIT"
] | 1 | 2015-08-11T20:50:36.000Z | 2015-08-11T20:50:36.000Z | frame_grabber.py | brix4dayz/TRiCAM2.0 | 716f154403c8c0aa903d7391bf4c14d45c778a22 | [
"MIT"
] | null | null | null | frame_grabber.py | brix4dayz/TRiCAM2.0 | 716f154403c8c0aa903d7391bf4c14d45c778a22 | [
"MIT"
] | null | null | null | """
frame_grabber.py
>>> python frame_grabber.py [from dir] [to dir] [frame capture rate]
"""
import hpidol as hp
import cv2, sys, shutil
import numpy as np
import scipy.misc, os
import pandas as pd
from collections import Counter
from PIL import Image
def post_img(image):
return hp.recognize_logos(image)
def get... | 25.782051 | 71 | 0.671308 |
7bdd1e0032319806b6c7e8699633bb3daf220ab1 | 5,855 | py | Python | django/contrib/databrowse/plugins/calendars.py | Miserlou/django | 35ddeee45573de57ae3c791bf36496b4a7028ddf | [
"BSD-3-Clause"
] | 2 | 2015-08-03T22:04:14.000Z | 2015-08-03T22:04:16.000Z | django/contrib/databrowse/plugins/calendars.py | econchick/django | 86c5c0154f69728eba4aad6204621f07cdd3459d | [
"BSD-3-Clause"
] | null | null | null | django/contrib/databrowse/plugins/calendars.py | econchick/django | 86c5c0154f69728eba4aad6204621f07cdd3459d | [
"BSD-3-Clause"
] | 1 | 2019-07-15T02:35:16.000Z | 2019-07-15T02:35:16.000Z | from __future__ import unicode_literals
from django import http
from django.db import models
from django.contrib.databrowse.datastructures import EasyModel
from django.contrib.databrowse.sites import DatabrowsePlugin
from django.shortcuts import render_to_response
from django.utils.html import format_html, format_html... | 39.560811 | 132 | 0.570111 |
c5d235a4bc7f8a2aa2247a25e8a3f9e53b5e53cc | 2,453 | py | Python | docs/conf.py | Golman-Rahmanifar/desdeo-problem | ed2ab8d2d1d831692c21ec7956dd9380a3dc45aa | [
"MIT"
] | null | null | null | docs/conf.py | Golman-Rahmanifar/desdeo-problem | ed2ab8d2d1d831692c21ec7956dd9380a3dc45aa | [
"MIT"
] | null | null | null | docs/conf.py | Golman-Rahmanifar/desdeo-problem | ed2ab8d2d1d831692c21ec7956dd9380a3dc45aa | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 32.706667 | 79 | 0.674684 |
987d340cc7ccfdbc45ff4766c970e8b01b722c80 | 7,334 | py | Python | garminexport/backup.py | Wave89/garminexport | 248de4b26ed63bac4477044c4ec2a382eaea98ed | [
"Apache-2.0"
] | null | null | null | garminexport/backup.py | Wave89/garminexport | 248de4b26ed63bac4477044c4ec2a382eaea98ed | [
"Apache-2.0"
] | null | null | null | garminexport/backup.py | Wave89/garminexport | 248de4b26ed63bac4477044c4ec2a382eaea98ed | [
"Apache-2.0"
] | null | null | null | """Module with methods useful when backing up activities.
"""
import codecs
import json
import logging
import os
from datetime import datetime
log = logging.getLogger(__name__)
supported_export_formats = ["json_summary", "json_details", "gpx", "tcx", "fit"]
"""The range of supported export formats for activities."""
... | 43.141176 | 89 | 0.663621 |
cf01d655e9bc9ff3305d3daf9e8af5668c611fdf | 2,626 | py | Python | lib/toute/utils/payload/filters.py | luiscastilho/toute | 56207d3d92b8bc1066e115c285cf79f96be3e249 | [
"MIT"
] | 3 | 2021-01-04T02:12:33.000Z | 2021-09-22T14:41:39.000Z | lib/toute/utils/payload/filters.py | luiscastilho/toute | 56207d3d92b8bc1066e115c285cf79f96be3e249 | [
"MIT"
] | 6 | 2020-08-04T22:34:12.000Z | 2020-10-10T12:40:14.000Z | lib/toute/utils/payload/filters.py | luiscastilho/toute | 56207d3d92b8bc1066e115c285cf79f96be3e249 | [
"MIT"
] | 1 | 2020-08-04T21:59:43.000Z | 2020-08-04T21:59:43.000Z | from toute.utils.payload.meta import BaseFilterQuery, MetaFilterQuery
from toute.utils.payload.exception import NoFilter
from six import with_metaclass
FILTERS = {
'and_': ['_filter'],
'bool': {
'kwargs': ({('must', 'must_not', 'should'): ['_filter']},)
},
'exists': {
'args': ('field'... | 22.834783 | 69 | 0.436786 |
432801469906a143c19b7d124c3c05e063e8ab94 | 9,913 | py | Python | hydrogit/compilation.py | gydrogen/hydrogen | 6c448b67471ce2bbef12a36a0182b58ac56a7da3 | [
"MIT"
] | null | null | null | hydrogit/compilation.py | gydrogen/hydrogen | 6c448b67471ce2bbef12a36a0182b58ac56a7da3 | [
"MIT"
] | null | null | null | hydrogit/compilation.py | gydrogen/hydrogen | 6c448b67471ce2bbef12a36a0182b58ac56a7da3 | [
"MIT"
] | null | null | null | from pathlib import Path
import subprocess
import os
import fileinput
import re
import shutil
cmake_utils_dir = (Path(__file__).parent /
'llvm-ir-cmake-utils' / 'cmake').resolve()
assert cmake_utils_dir.exists()
hydrogit_target_tag = '_hydrogit'
class CompileManager:
def __init__(self, languag... | 34.301038 | 111 | 0.562494 |
dda9cf04d933f7a81d10c2233682bcea27c7aaaf | 12,660 | py | Python | exchangelib/version.py | mishmashclone/ecederstrand-exchangelib | 1bbae0e527dc82a45bf3b5946b438d69de96c20f | [
"BSD-2-Clause"
] | null | null | null | exchangelib/version.py | mishmashclone/ecederstrand-exchangelib | 1bbae0e527dc82a45bf3b5946b438d69de96c20f | [
"BSD-2-Clause"
] | null | null | null | exchangelib/version.py | mishmashclone/ecederstrand-exchangelib | 1bbae0e527dc82a45bf3b5946b438d69de96c20f | [
"BSD-2-Clause"
] | null | null | null | import logging
import re
from .errors import TransportError, ResponseMessageError, InvalidTypeError
from .util import xml_to_str, TNS
log = logging.getLogger(__name__)
# Legend for dict:
# Key: shortname
# Values: (EWS API version ID, full name)
# 'shortname' comes from types.xsd and is the official version of ... | 44.734982 | 120 | 0.661769 |
35061f85dd455fa6d43f89bc51f8a39d6bf57f88 | 17,867 | py | Python | intersight/model/thermal_policy.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 5 | 2021-12-16T15:13:32.000Z | 2022-03-29T16:09:54.000Z | intersight/model/thermal_policy.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 4 | 2022-01-25T19:05:51.000Z | 2022-03-29T20:18:37.000Z | intersight/model/thermal_policy.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 2 | 2020-07-07T15:01:08.000Z | 2022-01-31T04:27:35.000Z | """
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advan... | 54.639144 | 1,678 | 0.638663 |
09de13b3106b2432757a59c7a617d8b0f59c24dd | 5,784 | py | Python | detectron2/modeling/da_heads/da_roi_head.py | Sage0116/detectron2 | 34c70af9e561269b016196d87f30d80f5d61fa3c | [
"Apache-2.0"
] | null | null | null | detectron2/modeling/da_heads/da_roi_head.py | Sage0116/detectron2 | 34c70af9e561269b016196d87f30d80f5d61fa3c | [
"Apache-2.0"
] | null | null | null | detectron2/modeling/da_heads/da_roi_head.py | Sage0116/detectron2 | 34c70af9e561269b016196d87f30d80f5d61fa3c | [
"Apache-2.0"
] | null | null | null | from typing import Dict, List, Optional
from detectron2.layers import ShapeSpec
from detectron2.modeling.roi_heads import StandardROIHeads, ROI_HEADS_REGISTRY, FastRCNNOutputLayers, build_box_head
from detectron2.modeling.poolers import ROIPooler
from detectron2.structures import Instances, Boxes
from detectron2.config... | 46.645161 | 178 | 0.674447 |
4bf1e0a69edadc4ced7923335f702f39adf315bb | 2,561 | py | Python | evmoscan/app.py | onlyalt/evmos_contribution | bdd76957d79c2041da46e51c7d2b4102da03da83 | [
"MIT"
] | null | null | null | evmoscan/app.py | onlyalt/evmos_contribution | bdd76957d79c2041da46e51c7d2b4102da03da83 | [
"MIT"
] | null | null | null | evmoscan/app.py | onlyalt/evmos_contribution | bdd76957d79c2041da46e51c7d2b4102da03da83 | [
"MIT"
] | 2 | 2021-12-13T21:52:15.000Z | 2022-02-25T16:02:15.000Z | import sqlite3
import time
import os
from flask import Flask, render_template, jsonify
from evmoscan.etl.utils import *
DB_FILE_PATH = os.getenv('DB_FILE_PATH')
def creat_app():
app = Flask(__name__)
if DB_FILE_PATH:
dbconn = sqlite3.connect(DB_FILE_PATH, isolation_level=None) # autocommits
... | 31.231707 | 189 | 0.728622 |
8160ee5d1fe0ec45377fb18709a7d93d35ca021c | 491 | py | Python | models/coattention/__init__.py | Minys233/GCN-BMP | 21b64a3c8cc9bc33718ae09c65aa917e575132eb | [
"MIT"
] | null | null | null | models/coattention/__init__.py | Minys233/GCN-BMP | 21b64a3c8cc9bc33718ae09c65aa917e575132eb | [
"MIT"
] | null | null | null | models/coattention/__init__.py | Minys233/GCN-BMP | 21b64a3c8cc9bc33718ae09c65aa917e575132eb | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/5/2019 5:41 PM
# @Author : chinshin
# @FileName: __init__.py.
import sys
from os.path import abspath, dirname
ROOT_PATH = dirname(dirname(dirname(abspath(__file__))))
sys.path.insert(0, ROOT_PATH)
from models.coattention.alternating_coattention ... | 35.071429 | 78 | 0.771894 |
9cda899e4191f987bbb2038fd7d44a11d0e3b890 | 1,844 | py | Python | cross3d/studiomax/_Py3dsMax_setup/site-packages/py3dsMax_startup.py | vedantirb/cross3d | e27c2dc80bf607ef7ccf3970b713bfea8211228b | [
"MIT"
] | 129 | 2016-07-26T16:00:56.000Z | 2021-08-07T03:44:41.000Z | cross3d/studiomax/_Py3dsMax_setup/site-packages/py3dsMax_startup.py | vedantirb/cross3d | e27c2dc80bf607ef7ccf3970b713bfea8211228b | [
"MIT"
] | 3 | 2016-08-26T01:37:03.000Z | 2019-08-13T01:46:01.000Z | cross3d/studiomax/_Py3dsMax_setup/site-packages/py3dsMax_startup.py | vedantirb/cross3d | e27c2dc80bf607ef7ccf3970b713bfea8211228b | [
"MIT"
] | 33 | 2016-07-30T00:26:00.000Z | 2022-03-09T07:10:54.000Z | ##
# \namespace __startup__.py
#
# \remarks Call any python initialization code
#
# \author beta@blur.com
# \author Blur Studio
# \date 12/05/08
#
# initialize the Py3dsMax system
import os
import Py3dsMax
from Py3dsMax import mxs
# At some point in initialization the install path is r... | 30.733333 | 125 | 0.7218 |
e52255614e7ac4a867af5c78256fad59dc7fab33 | 9,729 | py | Python | dm_control/composer/observation/updater.py | willwhitney/dm_control | f2568f59970f3c895f21e0c4278f1723d79b0933 | [
"Apache-2.0"
] | 1 | 2019-05-29T15:49:15.000Z | 2019-05-29T15:49:15.000Z | dm_control/composer/observation/updater.py | willwhitney/dm_control | f2568f59970f3c895f21e0c4278f1723d79b0933 | [
"Apache-2.0"
] | null | null | null | dm_control/composer/observation/updater.py | willwhitney/dm_control | f2568f59970f3c895f21e0c4278f1723d79b0933 | [
"Apache-2.0"
] | 1 | 2021-01-24T20:28:15.000Z | 2021-01-24T20:28:15.000Z | # Copyright 2018 The dm_control Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 38.30315 | 80 | 0.705622 |
eaee32f541d711b6f1177c4d84077bb921ea1a33 | 2,531 | py | Python | alvm_tools/binutils.py | Achi-Coin/alvm_tools | 93632f6647e1066b9ee85b0af1da6e43a43c5769 | [
"Apache-2.0"
] | null | null | null | alvm_tools/binutils.py | Achi-Coin/alvm_tools | 93632f6647e1066b9ee85b0af1da6e43a43c5769 | [
"Apache-2.0"
] | null | null | null | alvm_tools/binutils.py | Achi-Coin/alvm_tools | 93632f6647e1066b9ee85b0af1da6e43a43c5769 | [
"Apache-2.0"
] | 2 | 2021-09-02T07:26:45.000Z | 2021-11-08T19:55:37.000Z | import string
from alvm import KEYWORD_FROM_ATOM, KEYWORD_TO_ATOM
from alvm.casts import int_from_bytes, int_to_bytes
from ir.reader import read_ir
from ir.writer import write_ir
from ir.utils import (
ir_as_symbol, ir_cons, ir_first, ir_listp, ir_null,
ir_nullp, ir_rest, ir_symbol, ir_val, is_ir
)
from ir.Ty... | 27.813187 | 92 | 0.650336 |
237e4d858b21a8dfbab2a8f61ae53005c317dc90 | 78 | py | Python | certbot_dns_namesilo/_internal/__init__.py | mateste/certbot-dns-namesilo | da27eacaabac394f4c5fd9ffb5e436bb2be0e79d | [
"Apache-2.0"
] | null | null | null | certbot_dns_namesilo/_internal/__init__.py | mateste/certbot-dns-namesilo | da27eacaabac394f4c5fd9ffb5e436bb2be0e79d | [
"Apache-2.0"
] | null | null | null | certbot_dns_namesilo/_internal/__init__.py | mateste/certbot-dns-namesilo | da27eacaabac394f4c5fd9ffb5e436bb2be0e79d | [
"Apache-2.0"
] | null | null | null | """Internal implementation of `~certbot_dns_namesilo.dns_namesilo` plugin."""
| 39 | 77 | 0.794872 |
df59c102fc3dce19b64a7b5a7419a09cec230344 | 17,973 | py | Python | hydeengine/siteinfo.py | gulBAC/gulBAC-oldsite | 0da5e13934a855194ffb00fac20d935b8d3173c0 | [
"MIT"
] | null | null | null | hydeengine/siteinfo.py | gulBAC/gulBAC-oldsite | 0da5e13934a855194ffb00fac20d935b8d3173c0 | [
"MIT"
] | 4 | 2018-10-08T20:01:40.000Z | 2018-10-08T20:02:43.000Z | hydeengine/siteinfo.py | gulBAC/gulBAC-oldsite | 0da5e13934a855194ffb00fac20d935b8d3173c0 | [
"MIT"
] | 1 | 2021-09-08T10:00:17.000Z | 2021-09-08T10:00:17.000Z | import sys
import re
import time as sleeper
import operator
from datetime import date, datetime, time
from threading import Thread, Event
from hydeengine import url
from hydeengine.file_system import File, Folder
class SiteResource(object):
def __init__(self, a_file, node):
super(SiteResource, self).__in... | 29.463934 | 81 | 0.580148 |
0612e84df528013af102ae9e3983a7cb1bf7f8fb | 9,493 | py | Python | flexure/flexure.py | landlab/flexure-component | 3672faa181172e1be62e4431b04f57c9666411ad | [
"MIT"
] | null | null | null | flexure/flexure.py | landlab/flexure-component | 3672faa181172e1be62e4431b04f57c9666411ad | [
"MIT"
] | null | null | null | flexure/flexure.py | landlab/flexure-component | 3672faa181172e1be62e4431b04f57c9666411ad | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Deform the lithosphere with 1D or 2D flexure.
Landlab component that implements a 1 and 2D lithospheric flexure
model.
Examples
--------
Create a grid on which we will run the flexure calculations.
>>> from landlab import RasterModelGrid
>>> from landlab.components.flexure import Flexure
>>... | 29.946372 | 82 | 0.615717 |
08e52da7b0c290c43076d82d574d3fbb00407549 | 16,071 | py | Python | code/models.py | taipahuchu/language-Identification- | 68660bc110d374f0d8802b942792b15f8782e647 | [
"Unlicense"
] | 13 | 2016-10-12T17:20:55.000Z | 2021-07-13T10:19:23.000Z | code/models.py | taipahuchu/language-Identification- | 68660bc110d374f0d8802b942792b15f8782e647 | [
"Unlicense"
] | 2 | 2019-03-28T03:06:54.000Z | 2019-04-04T20:54:43.000Z | code/models.py | taipahuchu/language-Identification- | 68660bc110d374f0d8802b942792b15f8782e647 | [
"Unlicense"
] | 4 | 2018-07-05T05:50:34.000Z | 2019-09-01T20:21:50.000Z | import tensorflow as tf
import numpy as np
class BaseModel(object):
"""Holds code shared between all the different model variants."""
def __init__(self, batch_size, max_sequence_len, out_vocab_size, c2v,
dropout_keep_prob=0.0):
self._batch_size = batch_size
self._dropout_keep_prob = dropou... | 39.681481 | 115 | 0.65136 |
72178f3068bc85d4bc5185a5ed749e4877532ce9 | 165,362 | py | Python | redis/client.py | malinaa96/redis-py | 435759aa008c12c379130636561ec854ad961390 | [
"MIT"
] | null | null | null | redis/client.py | malinaa96/redis-py | 435759aa008c12c379130636561ec854ad961390 | [
"MIT"
] | null | null | null | redis/client.py | malinaa96/redis-py | 435759aa008c12c379130636561ec854ad961390 | [
"MIT"
] | null | null | null | from itertools import chain
import datetime
import warnings
import time
import threading
import time as mod_time
import re
import hashlib
from redis.connection import (ConnectionPool, UnixDomainSocketConnection,
SSLConnection)
from redis.lock import Lock
from redis.exceptions import (
... | 38.136993 | 79 | 0.598807 |
2c4210251ffd4f4ccc77067905e9ed648f40329c | 2,570 | py | Python | main/arm-none-eabi/lib/thumb/v6-m/libstdc++.a-gdb.py | aliosthings/gcc-arm-none-eabi-linux | 94f74be42c74052ff500070b1d41d15fce76967a | [
"MIT"
] | 4 | 2019-11-15T17:27:46.000Z | 2020-09-28T21:03:15.000Z | main/arm-none-eabi/lib/thumb/v6-m/libstdc++.a-gdb.py | aliosthings/gcc-arm-none-eabi-linux | 94f74be42c74052ff500070b1d41d15fce76967a | [
"MIT"
] | 1 | 2020-06-22T19:20:36.000Z | 2020-07-15T03:55:41.000Z | main/arm-none-eabi/lib/thumb/v6-m/libstdc++.a-gdb.py | aliosthings/gcc-arm-none-eabi-linux | 94f74be42c74052ff500070b1d41d15fce76967a | [
"MIT"
] | 3 | 2020-06-11T22:32:45.000Z | 2022-03-21T15:18:19.000Z | # -*- python -*-
# Copyright (C) 2009-2017 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later versio... | 41.451613 | 128 | 0.732685 |
fc549891e8c93ae154122f4fdd7716669de5cd92 | 9,228 | py | Python | src/data/make_dataset.py | amuta/ambev-data-challenge | d5817b80be4dc419d76cdd40bafeee515fbf6f38 | [
"MIT"
] | null | null | null | src/data/make_dataset.py | amuta/ambev-data-challenge | d5817b80be4dc419d76cdd40bafeee515fbf6f38 | [
"MIT"
] | 2 | 2021-04-30T20:37:11.000Z | 2021-06-01T22:51:15.000Z | src/data/make_dataset.py | amuta/ambev-data-challenge | d5817b80be4dc419d76cdd40bafeee515fbf6f38 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# import click
import logging
import os
from pathlib import Path
from dotenv import find_dotenv, load_dotenv
import pandas as pd
import numpy as np
import re
from datetime import datetime
from sklearn.preprocessing import LabelEncoder
# @click.command()
# @click.argument('data_step', type=click... | 34.561798 | 114 | 0.607174 |
bbc52f49bde2eb0a292aaa6544bf1d50bd38659e | 2,369 | py | Python | logbook/phone/gps/__init__.py | PREDICT-DPACC/logbook | 2eb3ecf4bdac16bcd79fcb25ff40c5bfe580617a | [
"BSD-3-Clause"
] | null | null | null | logbook/phone/gps/__init__.py | PREDICT-DPACC/logbook | 2eb3ecf4bdac16bcd79fcb25ff40c5bfe580617a | [
"BSD-3-Clause"
] | 2 | 2021-03-31T13:28:48.000Z | 2021-03-31T14:43:27.000Z | logbook/phone/gps/__init__.py | PREDICT-DPACC/logbook | 2eb3ecf4bdac16bcd79fcb25ff40c5bfe580617a | [
"BSD-3-Clause"
] | 1 | 2021-03-29T21:20:40.000Z | 2021-03-29T21:20:40.000Z | import os
import re
import gzip
import pandas as pd
import logging
from datetime import datetime
from dateutil import tz
logger = logging.getLogger(__name__)
FILE_REGEX = re.compile(r'(?P<year>[0-9]{4})-(?P<month>[0-9]{2})-(?P<day>[0-9]{2})\s(?P<hour>[0-9]{2})_(?P<minute>[0-9]{2})_(?P<second>[0-9]{2})(?P<extension>\.... | 32.013514 | 165 | 0.622203 |
0836990d068baef290bd8c5c12bfee5d862e7d17 | 4,001 | py | Python | autoflow/tests/base.py | auto-flow/autoflow | f5903424ad8694d57741a0bd6dfeaba320ea6517 | [
"BSD-3-Clause"
] | 49 | 2020-04-16T11:17:28.000Z | 2020-05-06T01:32:44.000Z | autoflow/tests/base.py | auto-flow/autoflow | f5903424ad8694d57741a0bd6dfeaba320ea6517 | [
"BSD-3-Clause"
] | null | null | null | autoflow/tests/base.py | auto-flow/autoflow | f5903424ad8694d57741a0bd6dfeaba320ea6517 | [
"BSD-3-Clause"
] | 3 | 2020-04-17T00:53:24.000Z | 2020-04-23T03:04:26.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author : qichun tang
# @Contact : tqichun@gmail.com
import os
import re
import shutil
import unittest
from pathlib import Path
from typing import Iterator, Tuple
import joblib
import numpy as np
import pandas as pd
from sklearn.impute import SimpleImputer
from sklea... | 39.22549 | 112 | 0.642839 |
284c150909e4f70a1b0ca3601f6fa53614266ea9 | 600 | py | Python | docs/#11_numeric/#2_fractions.py | gymcoding/learning-python | 5c211e10a0e97e0fab51ee49b03d74b417ee76ff | [
"MIT"
] | 1 | 2020-07-29T23:59:28.000Z | 2020-07-29T23:59:28.000Z | docs/#11_numeric/#2_fractions.py | sodragon/learning-python | 5c211e10a0e97e0fab51ee49b03d74b417ee76ff | [
"MIT"
] | null | null | null | docs/#11_numeric/#2_fractions.py | sodragon/learning-python | 5c211e10a0e97e0fab51ee49b03d74b417ee76ff | [
"MIT"
] | null | null | null | #-- Fraction 클래스
# ● 유리수와 관련된 연산을 효율적으로 처리할 수 있는 분수(fractions)모듈
# ● Fraction 클래스의 생성자
# ○ fraction Fraction(분자=0, 분모=1)
# ○ fraction Fraction(Fraction 객체)
# ○ fraction Fraction(문자열)
import fractions
fraction_obj1 = fractions.Fraction(4, 16)
print(fraction_obj1)
fraction_obj2 = fractions.Fraction(3)
print(fractio... | 27.272727 | 66 | 0.735 |
56ee841ab644aa0a9b89cb5bc3ebaa80e95ffca2 | 82 | py | Python | py_tdlib/constructors/update_user.py | Mr-TelegramBot/python-tdlib | 2e2d21a742ebcd439971a32357f2d0abd0ce61eb | [
"MIT"
] | 24 | 2018-10-05T13:04:30.000Z | 2020-05-12T08:45:34.000Z | py_tdlib/constructors/update_user.py | MrMahdi313/python-tdlib | 2e2d21a742ebcd439971a32357f2d0abd0ce61eb | [
"MIT"
] | 3 | 2019-06-26T07:20:20.000Z | 2021-05-24T13:06:56.000Z | py_tdlib/constructors/update_user.py | MrMahdi313/python-tdlib | 2e2d21a742ebcd439971a32357f2d0abd0ce61eb | [
"MIT"
] | 5 | 2018-10-05T14:29:28.000Z | 2020-08-11T15:04:10.000Z | from ..factory import Type
class updateUser(Type):
user = None # type: "user"
| 13.666667 | 28 | 0.682927 |
452885063057c221cf93fda8f88039b4fba914f0 | 1,791 | py | Python | resolve/plot_lat.py | bojieli/ipc-bench | 76c03e880477666b1e2275607dd62a74f02b6daf | [
"MIT"
] | 56 | 2015-02-24T15:44:58.000Z | 2022-01-25T04:09:10.000Z | resolve/plot_lat.py | shekkbuilder/ipc-bench | 76c03e880477666b1e2275607dd62a74f02b6daf | [
"MIT"
] | 1 | 2019-12-29T19:05:37.000Z | 2020-01-09T12:05:48.000Z | resolve/plot_lat.py | shekkbuilder/ipc-bench | 76c03e880477666b1e2275607dd62a74f02b6daf | [
"MIT"
] | 24 | 2015-04-02T16:57:58.000Z | 2020-07-05T07:11:38.000Z | import sys, os
import numpy as np
import numpy.random
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import pylab
def get_data(filename):
data = np.loadtxt(filename)
x_tmp = []
y_tmp = []
v_tmp = []
retdata = {}
for i in range(0, len(data)):
for j ... | 22.3875 | 91 | 0.658291 |
12a74aec086d763ab97c3f33c3d50453bee16c71 | 11,101 | py | Python | test.py | columbia-robovision/dsr | f34d60f885cd01e6b562e799d7c81eafda3ae765 | [
"MIT"
] | 20 | 2020-11-11T21:18:17.000Z | 2021-03-28T09:09:52.000Z | test.py | columbia-robovision/dsr | f34d60f885cd01e6b562e799d7c81eafda3ae765 | [
"MIT"
] | null | null | null | test.py | columbia-robovision/dsr | f34d60f885cd01e6b562e799d7c81eafda3ae765 | [
"MIT"
] | 5 | 2020-11-24T08:49:52.000Z | 2021-03-29T14:20:41.000Z | import numpy as np
import torch
import argparse
from tqdm import tqdm
import os.path as osp
from data import Data
from torch.utils.data import DataLoader
from model import ModelDSR
import itertools
parser = argparse.ArgumentParser()
parser.add_argument('--resume', type=str, help='path to model')
parser.add_argument(... | 44.762097 | 134 | 0.597874 |
620cd740fd2575d89776a769e4b92024ea1d4a38 | 1,104 | py | Python | PacoteDownload/ex084.py | NataliaNasu/cursoemvideo-python3 | 7c206a5ff347416cd83c7a665a7acaffe088f7e7 | [
"MIT"
] | null | null | null | PacoteDownload/ex084.py | NataliaNasu/cursoemvideo-python3 | 7c206a5ff347416cd83c7a665a7acaffe088f7e7 | [
"MIT"
] | null | null | null | PacoteDownload/ex084.py | NataliaNasu/cursoemvideo-python3 | 7c206a5ff347416cd83c7a665a7acaffe088f7e7 | [
"MIT"
] | null | null | null | #leia nome e peso de varias pessoas. mostre qntas foram cadastradas.
# crie uma listagem das mais pesadas e, das mais leves.
pessoas = list()
temporario = list()
maior = menor = 0
print(' \033[31mCADASTRO:\033[m ')
while True:
temporario.append(str(input('Nome: ')))
temporario.append(float(input('Peso: ')))
... | 31.542857 | 68 | 0.588768 |
30c4e9d091ea95a64e1ffed5eb661c60003a021b | 56,478 | py | Python | trac/versioncontrol/web_ui/changeset.py | trac-ja/trac-ja | 8defc74c222e3dbe154dfb5eb34e8c1a1f663558 | [
"BSD-3-Clause"
] | 1 | 2017-08-03T07:04:40.000Z | 2017-08-03T07:04:40.000Z | trac/versioncontrol/web_ui/changeset.py | trac-ja/trac-ja | 8defc74c222e3dbe154dfb5eb34e8c1a1f663558 | [
"BSD-3-Clause"
] | null | null | null | trac/versioncontrol/web_ui/changeset.py | trac-ja/trac-ja | 8defc74c222e3dbe154dfb5eb34e8c1a1f663558 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2003-2009 Edgewall Software
# Copyright (C) 2003-2005 Jonas Borgström <jonas@edgewall.com>
# Copyright (C) 2004-2006 Christopher Lenz <cmlenz@gmx.de>
# Copyright (C) 2005-2006 Christian Boos <cboos@edgewall.org>
# All rights reserved.
#
# This software is licensed as described ... | 45.400322 | 79 | 0.519724 |
7109031a45a0b1008e4a0e0fbbd0864cbbcc6653 | 3,289 | py | Python | invenio_records_resources/services/records/schema.py | tzubaki/invenio-records-resources | 82e77d5f6e89abf38c871e912cc97b4bdf289c20 | [
"MIT"
] | null | null | null | invenio_records_resources/services/records/schema.py | tzubaki/invenio-records-resources | 82e77d5f6e89abf38c871e912cc97b4bdf289c20 | [
"MIT"
] | null | null | null | invenio_records_resources/services/records/schema.py | tzubaki/invenio-records-resources | 82e77d5f6e89abf38c871e912cc97b4bdf289c20 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CERN.
# Copyright (C) 2022 TU Wien.
#
# Invenio-Records-Resources is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see LICENSE file for more
# details.
"""Record schema."""
from datetime import timezone
from marshmallow im... | 33.907216 | 79 | 0.658559 |
1b9e47518916743488b6231b346970ed8db70359 | 2,050 | py | Python | pytorch_lightning/plugins/precision/ipu_precision.py | alessiobonfiglio/pytorch-lightning | c453caf57e8ee65aaf82d4d42b26d7634dbf7046 | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/plugins/precision/ipu_precision.py | alessiobonfiglio/pytorch-lightning | c453caf57e8ee65aaf82d4d42b26d7634dbf7046 | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/plugins/precision/ipu_precision.py | alessiobonfiglio/pytorch-lightning | c453caf57e8ee65aaf82d4d42b26d7634dbf7046 | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning team.
#
# 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 i... | 38.679245 | 114 | 0.73122 |
3521b6eb31f823907d1d76262e1772f431ef4113 | 15,426 | py | Python | molo/forms/tests/test_utils.py | praekeltfoundation/molo.forms | 746abf9d48e6adc73f9544f7211328cfcfef0410 | [
"BSD-3-Clause"
] | null | null | null | molo/forms/tests/test_utils.py | praekeltfoundation/molo.forms | 746abf9d48e6adc73f9544f7211328cfcfef0410 | [
"BSD-3-Clause"
] | 4 | 2019-10-28T13:09:47.000Z | 2020-12-22T12:32:49.000Z | molo/forms/tests/test_utils.py | praekeltfoundation/molo.forms | 746abf9d48e6adc73f9544f7211328cfcfef0410 | [
"BSD-3-Clause"
] | 1 | 2019-08-19T12:09:18.000Z | 2019-08-19T12:09:18.000Z | from django.test import TestCase
from molo.core.tests.base import MoloTestCaseMixin
from molo.forms.models import (
MoloFormField,
MoloFormPage,
)
from ..utils import SkipLogicPaginator
from .utils import skip_logic_data
class TestSkipLogicPaginator(TestCase, MoloTestCaseMixin):
def setUp(self):
... | 34.356347 | 72 | 0.597174 |
35d70d67f3ba82c64944b1df6cc591d70df98077 | 1,334 | py | Python | aplpy/tests/test_ticks.py | nbrunett/aplpy | f5d128faf3568adea753d52c11ba43014d25d90a | [
"MIT"
] | null | null | null | aplpy/tests/test_ticks.py | nbrunett/aplpy | f5d128faf3568adea753d52c11ba43014d25d90a | [
"MIT"
] | null | null | null | aplpy/tests/test_ticks.py | nbrunett/aplpy | f5d128faf3568adea753d52c11ba43014d25d90a | [
"MIT"
] | 1 | 2018-02-26T03:04:19.000Z | 2018-02-26T03:04:19.000Z | import matplotlib
matplotlib.use('Agg')
import numpy as np
from astropy.tests.helper import pytest
from .. import FITSFigure
def test_ticks_show_hide():
data = np.zeros((16, 16))
f = FITSFigure(data)
f.ticks.hide()
f.ticks.show()
f.ticks.hide_x()
f.ticks.show_x()
f.ticks.hide_y()
f.t... | 20.212121 | 39 | 0.638681 |
704b28f4d1f97692593bfc84f48dcc9dcd53ccad | 1,345 | py | Python | core/audit.py | superstap/jimi | d921b815c726e169c5a35f01a81eea8a75b8321d | [
"Apache-2.0"
] | null | null | null | core/audit.py | superstap/jimi | d921b815c726e169c5a35f01a81eea8a75b8321d | [
"Apache-2.0"
] | null | null | null | core/audit.py | superstap/jimi | d921b815c726e169c5a35f01a81eea8a75b8321d | [
"Apache-2.0"
] | null | null | null | import datetime
import time, json
from pathlib import Path
from bson import json_util,ObjectId
import jimi
# audit Class
class _audit(jimi.db._document):
_dbCollection = jimi.db.db["audit"]
def add(self,eventSource, eventType, eventData):
auditData = { "time" : time.time(), "systemID" : systemSetting... | 44.833333 | 169 | 0.62974 |
152a3c67d37ccd307b6e109d0c2ff7092888cede | 17,652 | py | Python | plotext/utility.py | asartori86/plotext | 255eb8f86cb528a6bce53e9d6f866f653adc4909 | [
"MIT"
] | null | null | null | plotext/utility.py | asartori86/plotext | 255eb8f86cb528a6bce53e9d6f866f653adc4909 | [
"MIT"
] | null | null | null | plotext/utility.py | asartori86/plotext | 255eb8f86cb528a6bce53e9d6f866f653adc4909 | [
"MIT"
] | null | null | null | import os
import shutil
import sys
import math
from datetime import datetime as dt
import docstrings as _docstrings
##############################################
############ Set Functions #############
##############################################
def set_first_to_both(x = None, y = None):# by setting one pa... | 33.242938 | 283 | 0.506232 |
7163e95ea4cbfac2e46b0b42ed1be81f41b25c5d | 8,756 | py | Python | test/functional/wallet_abandonconflict.py | durgeshkmr/Libra-Coin | c40293ac5c8f289e4c06b46d0c7f3ca76ff591a6 | [
"MIT"
] | null | null | null | test/functional/wallet_abandonconflict.py | durgeshkmr/Libra-Coin | c40293ac5c8f289e4c06b46d0c7f3ca76ff591a6 | [
"MIT"
] | null | null | null | test/functional/wallet_abandonconflict.py | durgeshkmr/Libra-Coin | c40293ac5c8f289e4c06b46d0c7f3ca76ff591a6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2018 The Libra Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the abandontransaction RPC.
The abandontransaction RPC marks a transaction and all its in-wallet
... | 49.468927 | 137 | 0.669941 |
f3c07db438412abed6e16b50ad423ed156d0d7b3 | 2,854 | py | Python | tensorflow/contrib/py2tf/convert/gradients_function.py | worldveil/tensorflow | f5de234d7f601214443f371e90fbadc8f128bb9a | [
"Apache-2.0"
] | 1 | 2021-04-22T08:23:27.000Z | 2021-04-22T08:23:27.000Z | tensorflow/contrib/py2tf/convert/gradients_function.py | worldveil/tensorflow | f5de234d7f601214443f371e90fbadc8f128bb9a | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/py2tf/convert/gradients_function.py | worldveil/tensorflow | f5de234d7f601214443f371e90fbadc8f128bb9a | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 35.234568 | 80 | 0.629292 |
38dd6965a671304913011fb8c839899fedabbd92 | 192 | py | Python | test/mock_framework.py | mqtran01/python-yahoo-finance | 9a4bb17d24cf81214c1778cae3f231a3f0e93516 | [
"MIT"
] | 3 | 2018-11-22T13:42:48.000Z | 2021-03-03T00:55:03.000Z | test/mock_framework.py | mqtran01/python-yahoo-finance | 9a4bb17d24cf81214c1778cae3f231a3f0e93516 | [
"MIT"
] | 5 | 2020-03-24T16:37:19.000Z | 2021-07-15T05:20:05.000Z | test/mock_framework.py | mqtran01/python-yahoo-finance | 9a4bb17d24cf81214c1778cae3f231a3f0e93516 | [
"MIT"
] | 2 | 2019-04-15T18:54:32.000Z | 2021-03-04T02:23:12.000Z | class MockResponse:
def __init__(self, text):
self.text = text
def json(self):
return self.json_data
@property
def cookies(self):
return {'B': '1234'} | 19.2 | 29 | 0.578125 |
b5aba75a61998ce408bf4722457952c8f1a2efba | 7,085 | py | Python | reviewboard/accounts/tests/test_user.py | amalik2/reviewboard | 676aa2dce38ce619a74f2d4cb3cfae9bce21416e | [
"MIT"
] | 921 | 2015-01-01T15:26:28.000Z | 2022-03-29T11:30:38.000Z | reviewboard/accounts/tests/test_user.py | amalik2/reviewboard | 676aa2dce38ce619a74f2d4cb3cfae9bce21416e | [
"MIT"
] | 5 | 2015-03-17T18:57:47.000Z | 2020-10-02T13:24:31.000Z | reviewboard/accounts/tests/test_user.py | amalik2/reviewboard | 676aa2dce38ce619a74f2d4cb3cfae9bce21416e | [
"MIT"
] | 285 | 2015-01-12T06:24:36.000Z | 2022-03-29T11:03:50.000Z | """Unit tests for additions to django.contrib.auth.models.User."""
from __future__ import unicode_literals
from django.contrib.auth.models import AnonymousUser, User
from djblets.testing.decorators import add_fixtures
from reviewboard.site.models import LocalSite
from reviewboard.testing import TestCase
class User... | 36.709845 | 79 | 0.68398 |
79e84e4a8f6a0e00e462cbede15b35bd6c0f7b3e | 35,169 | py | Python | sdk/tables/azure-data-tables/tests/test_table_batch.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 1 | 2021-04-30T04:44:41.000Z | 2021-04-30T04:44:41.000Z | sdk/tables/azure-data-tables/tests/test_table_batch.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | null | null | null | sdk/tables/azure-data-tables/tests/test_table_batch.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | null | null | null | # coding: utf-8
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------... | 39.382979 | 128 | 0.610651 |
a956ddca2b5e0f5150988278a5308b837fb53518 | 426 | py | Python | module_06/src/locators/checkout.py | memsprop/2021_python_selenium | eb3de282b11933cb6886d4008fb1b557147afaae | [
"Unlicense"
] | null | null | null | module_06/src/locators/checkout.py | memsprop/2021_python_selenium | eb3de282b11933cb6886d4008fb1b557147afaae | [
"Unlicense"
] | null | null | null | module_06/src/locators/checkout.py | memsprop/2021_python_selenium | eb3de282b11933cb6886d4008fb1b557147afaae | [
"Unlicense"
] | null | null | null | """Locators for Your Cart items"""
from selenium.webdriver.common.by import By
class CartLoc:
"""Cart item locators.
Locators are relative to parent container div.
"""
CART_LST = (By.CLASS_NAME, 'cart_list')
CHECKOUT_BTN = (By.XPATH, "//*[@class='cart_footer']/a[contains(@class,'btn_action')]")
... | 26.625 | 103 | 0.673709 |
3bfe17d4dc49d2a3d5767107c06da5f3d692c8c7 | 4,464 | py | Python | ddd20/prepare_dataset.py | yeshwanthv5/federated-learning | 313477a8a05d1fc8d43051ea7f09c3f61865807b | [
"MIT"
] | null | null | null | ddd20/prepare_dataset.py | yeshwanthv5/federated-learning | 313477a8a05d1fc8d43051ea7f09c3f61865807b | [
"MIT"
] | null | null | null | ddd20/prepare_dataset.py | yeshwanthv5/federated-learning | 313477a8a05d1fc8d43051ea7f09c3f61865807b | [
"MIT"
] | null | null | null | import os
import itertools
import pdb
import argparse
import time
def write_sbatch_conf(f, exp_name = "default", grace_partition = "pi_panda", dir_name = "./"):
f.write('#!/bin/bash\n')
f.write('#SBATCH --job-name=' + exp_name + '\n')
f.write('#SBATCH --ntasks=1 --nodes=1\n')
f.write('#SBATCH --partiti... | 54.439024 | 438 | 0.667787 |
21c8aabf4152a1b3b883dff0c5038d4b2babbb93 | 8,669 | py | Python | tiny_face_eval.py | atom06/Tiny_Faces_in_Tensorflow_v2 | 18251ba7e2bc6cbe70428fff92ac31f18e73cb4b | [
"MIT"
] | 1 | 2021-12-14T18:44:08.000Z | 2021-12-14T18:44:08.000Z | tiny_face_eval.py | atom06/Tiny_Faces_in_Tensorflow_v2 | 18251ba7e2bc6cbe70428fff92ac31f18e73cb4b | [
"MIT"
] | 1 | 2021-12-14T20:48:21.000Z | 2021-12-14T20:48:21.000Z | tiny_face_eval.py | abtGIT/Tiny_Faces_in_Tensorflow_v2 | 18251ba7e2bc6cbe70428fff92ac31f18e73cb4b | [
"MIT"
] | 1 | 2021-05-12T16:18:58.000Z | 2021-05-12T16:18:58.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import tiny_face_model
import util
from argparse import ArgumentParser
import cv2
import scipy.io
import numpy as np
import matplotlib.pyplot as plt
import cv2
im... | 38.02193 | 143 | 0.638828 |
82f43e468c0b1d8d58bc13ef1b28c40348d183a6 | 4,217 | py | Python | webscraper/finpi.py | rodrigolessa/demo.scraping.trademark | ab9c55262ea740434885c5efe5066915f7987320 | [
"Apache-2.0"
] | null | null | null | webscraper/finpi.py | rodrigolessa/demo.scraping.trademark | ab9c55262ea740434885c5efe5066915f7987320 | [
"Apache-2.0"
] | null | null | null | webscraper/finpi.py | rodrigolessa/demo.scraping.trademark | ab9c55262ea740434885c5efe5066915f7987320 | [
"Apache-2.0"
] | null | null | null | # Sample:
# create a concatenated string from 0 to 19 (e.g. "012..1819")
# nums = [str(n) for n in range(20)]
# print "".join(nums)
# much more efficient then: nums += str(n)
# Best
# nums = map(str, range(20))
# print "".join(nums)
# import the necessary packages
from requests import exceptions
import argparse
import... | 30.781022 | 100 | 0.727531 |
961b3bd01ec3f27385e63694e05c77b8c5d5828a | 3,347 | py | Python | mtgelo/scraper/database.py | shawntabrizi/mtgelo | 84a6c08413b427c676846df0f0ac0fdafbbf40a8 | [
"MIT"
] | null | null | null | mtgelo/scraper/database.py | shawntabrizi/mtgelo | 84a6c08413b427c676846df0f0ac0fdafbbf40a8 | [
"MIT"
] | null | null | null | mtgelo/scraper/database.py | shawntabrizi/mtgelo | 84a6c08413b427c676846df0f0ac0fdafbbf40a8 | [
"MIT"
] | null | null | null | import sqlite3
import os
from mtgelo.scraper.unicode_parser import *
__file__ = "C:\\Users\shawn\PycharmProjects\mtgelo\mtgelo\scraper\database.py"
def reset_db():
delete_db()
create_db()
def connect_db():
file_dir = os.path.dirname(__file__)
filename = os.path.join(file_dir, '..\db\playerhistory.... | 32.182692 | 121 | 0.480729 |
8e9d5108472245dfce5373c9cd20ee66cdc885bc | 450 | py | Python | data/scripts/templates/object/building/player/city/shared_cantina_naboo.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/building/player/city/shared_cantina_naboo.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/building/player/city/shared_cantina_naboo.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Building()
result.template = "object/building/player/city/shared_cantina_naboo.iff"
result.attribute_template_id ... | 26.470588 | 73 | 0.726667 |
fbe8e88e1c3ec27075c4c08a3221791d7052bbaf | 502 | py | Python | WebCLI/views/my_algorithms.py | quantum-ohtu/WebMark | 485e30b0339835d342d8f14be95ebcd135f832f0 | [
"MIT"
] | 1 | 2021-05-22T03:32:04.000Z | 2021-05-22T03:32:04.000Z | WebCLI/views/my_algorithms.py | quantum-ohtu/WebMark | 485e30b0339835d342d8f14be95ebcd135f832f0 | [
"MIT"
] | 137 | 2021-01-25T10:54:32.000Z | 2021-10-07T06:42:46.000Z | WebCLI/views/my_algorithms.py | quantum-ohtu/WebMark | 485e30b0339835d342d8f14be95ebcd135f832f0 | [
"MIT"
] | 3 | 2021-05-18T17:36:54.000Z | 2021-06-04T13:49:48.000Z | from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from ..models import Algorithm
from .homepage import AlgorithmListView
class MyAlgorithmListView(AlgorithmListView):
@method_decorator(login_required)
def get(self, request, *args, **kwargs):
... | 33.466667 | 80 | 0.772908 |
9312631b0c4dcd8322a54e15facc14505af833ad | 7,655 | py | Python | platform.py | leroyle/nordicnrf52 | 52afc08fadd83154002d9bf22090d56966bfffa9 | [
"Apache-2.0"
] | null | null | null | platform.py | leroyle/nordicnrf52 | 52afc08fadd83154002d9bf22090d56966bfffa9 | [
"Apache-2.0"
] | null | null | null | platform.py | leroyle/nordicnrf52 | 52afc08fadd83154002d9bf22090d56966bfffa9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014-present PlatformIO <contact@platformio.org>
#
# 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 a... | 41.830601 | 86 | 0.508165 |
57d0d671131dc48672f3fe73cfd6845b0c5e9659 | 3,082 | py | Python | Project_1/test_pendulum.py | eugene-UiO/IN1910 | a8dbc78ba36b2881ad4790d05c8a4ae0ad762128 | [
"MIT"
] | null | null | null | Project_1/test_pendulum.py | eugene-UiO/IN1910 | a8dbc78ba36b2881ad4790d05c8a4ae0ad762128 | [
"MIT"
] | 1 | 2021-11-12T12:07:55.000Z | 2021-11-12T12:07:55.000Z | Project_1/test_pendulum.py | henrik-uio/IN1910 | a8dbc78ba36b2881ad4790d05c8a4ae0ad762128 | [
"MIT"
] | null | null | null | import nose.tools as nt # Using nosetests
import numpy as np
from pendulum import Pendulum
def test_special_method_call_in_Pendulum_class():
"""Tests that theta and omega is computed correctly."""
# Test values
theta = np.pi/4 # Angular position of the pendulum
omega = 0.1 # Angular ve... | 26.118644 | 86 | 0.615834 |
1ea78da791583c9f569bb736e5754e121205d7c2 | 269 | py | Python | automobile/config/desktop.py | hrgadeha/concept | 150ac108f048b7c22ec0389e17cd887dfa13ecac | [
"MIT"
] | null | null | null | automobile/config/desktop.py | hrgadeha/concept | 150ac108f048b7c22ec0389e17cd887dfa13ecac | [
"MIT"
] | null | null | null | automobile/config/desktop.py | hrgadeha/concept | 150ac108f048b7c22ec0389e17cd887dfa13ecac | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"module_name": "Automobile",
"color": "grey",
"icon": "octicon octicon-file-directory",
"type": "module",
"label": _("Automobile")
}
]
| 17.933333 | 44 | 0.620818 |
fa20faae8dfbe0cc7ab4aedf8f3bc907b658de26 | 1,682 | py | Python | algorithms/209. Minimum Size Subarray Sum.py | woozway/py3-leetcode | e51a9ce7a6bb3e35c0fcb8c8f4f6cd5763708dbf | [
"MIT"
] | 1 | 2020-12-02T13:54:30.000Z | 2020-12-02T13:54:30.000Z | algorithms/209. Minimum Size Subarray Sum.py | woozway/py3-leetcode | e51a9ce7a6bb3e35c0fcb8c8f4f6cd5763708dbf | [
"MIT"
] | null | null | null | algorithms/209. Minimum Size Subarray Sum.py | woozway/py3-leetcode | e51a9ce7a6bb3e35c0fcb8c8f4f6cd5763708dbf | [
"MIT"
] | null | null | null | """
1. Clarification
2. Possible solutions
- Brute force
- Prefix sum + Binary search
- Two Pointers
3. Coding
4. Tests
"""
# # T=O(n^2), S=O(1), Time Limit Exceeded
# class Solution:
# def minSubArrayLen(self, target: int, nums: List[int]) -> int:
# if target < 1 or not nums: return 0
# ... | 27.57377 | 68 | 0.452438 |
351466e01e3c82fe397f8b1dcad1090d9cb8e5a6 | 2,281 | py | Python | tests/pytests/materials/obsolete/TestElasticIsotropic3D.py | Grant-Block/pylith | f6338261b17551eba879da998a5aaf2d91f5f658 | [
"MIT"
] | 93 | 2015-01-08T16:41:22.000Z | 2022-02-25T13:40:02.000Z | tests/pytests/materials/obsolete/TestElasticIsotropic3D.py | Grant-Block/pylith | f6338261b17551eba879da998a5aaf2d91f5f658 | [
"MIT"
] | 277 | 2015-02-20T16:27:35.000Z | 2022-03-30T21:13:09.000Z | tests/pytests/materials/obsolete/TestElasticIsotropic3D.py | Grant-Block/pylith | f6338261b17551eba879da998a5aaf2d91f5f658 | [
"MIT"
] | 71 | 2015-03-24T12:11:08.000Z | 2022-03-03T04:26:02.000Z | #!/usr/bin/env python
#
# ======================================================================
#
# Brad T. Aagaard, U.S. Geological Survey
# Charles A. Williams, GNS Science
# Matthew G. Knepley, University of Chicago
#
# This code was developed as part of the Computational Infrastructure
# for Geodynamics (http://ge... | 22.362745 | 72 | 0.628672 |
d9d6e8cc642e36ae3ecd0e21c45b1922843b2a6f | 3,714 | py | Python | memsource_cli/models/business_unit_edit_dto.py | unofficial-memsource/memsource-cli-client | a6639506b74e95476da87f4375953448b76ea90c | [
"Apache-2.0"
] | 16 | 2019-09-25T00:20:38.000Z | 2021-05-04T05:56:10.000Z | memsource_cli/models/business_unit_edit_dto.py | zerodayz/memsource-cli-client | c2574f1467539a49e6637c874e88d75c7ef789b3 | [
"Apache-2.0"
] | 26 | 2019-09-30T14:00:03.000Z | 2021-05-12T11:15:18.000Z | memsource_cli/models/business_unit_edit_dto.py | zerodayz/memsource-cli-client | c2574f1467539a49e6637c874e88d75c7ef789b3 | [
"Apache-2.0"
] | 1 | 2021-05-24T16:19:14.000Z | 2021-05-24T16:19:14.000Z | # coding: utf-8
"""
Memsource REST API
Welcome to Memsource's API documentation. To view our legacy APIs please [visit our documentation](https://wiki.memsource.com/wiki/Memsource_API) and for more information about our new APIs, [visit our blog](https://www.memsource.com/blog/2017/10/24/introducing-rest-apis... | 30.95 | 421 | 0.578352 |
bbb9fb971b4f00620931fcafb4c1a17e7284c42c | 1,164 | py | Python | Round 2/red-tape-committee.py | kamyu104/GoogleCodeJame-2016 | 5222eeb34e7762a92e6d42a985e1fc6fc0dd151d | [
"MIT"
] | 19 | 2016-04-10T13:55:50.000Z | 2020-05-16T07:10:05.000Z | Round 2/red-tape-committee.py | kamyu104/GoogleCodeJame-2016 | 5222eeb34e7762a92e6d42a985e1fc6fc0dd151d | [
"MIT"
] | null | null | null | Round 2/red-tape-committee.py | kamyu104/GoogleCodeJame-2016 | 5222eeb34e7762a92e6d42a985e1fc6fc0dd151d | [
"MIT"
] | 19 | 2016-04-12T10:04:03.000Z | 2021-07-22T22:38:13.000Z | # Copyright (c) 2016 kamyu. All rights reserved.
#
# Google Code Jam 2016 Round 2 - Problem B. Red Tape Committee
# https://code.google.com/codejam/contest/10224486/dashboard#s=p1
#
# Time: O(NlogN + K^3)
# Space: O(K)
#
def red_tape_committee():
N, K = map(int, raw_input().strip().split())
P = sorted(map(flo... | 31.459459 | 78 | 0.525773 |
bf18fa58c0d559b55dfb9867a4cedb7533c3048a | 5,750 | py | Python | python/graph_sawyer.py | kalyanvasudev/gpmp2 | 1ee99c743d978ab20dc804c8cd9cfa7813084957 | [
"BSD-3-Clause"
] | null | null | null | python/graph_sawyer.py | kalyanvasudev/gpmp2 | 1ee99c743d978ab20dc804c8cd9cfa7813084957 | [
"BSD-3-Clause"
] | null | null | null | python/graph_sawyer.py | kalyanvasudev/gpmp2 | 1ee99c743d978ab20dc804c8cd9cfa7813084957 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from gtsam import *
from gpmp2 import *
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import axes3d, Axes3D #<-- Note the capitalization!
from gpmp_utils.generate3Ddataset import generate3Ddataset
from gpmp_utils.signedDistanceField3D import signedDistanceField3D
from gpmp_utils.generat... | 28.894472 | 82 | 0.736522 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.